diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..0915b639 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = false + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true \ No newline at end of file diff --git a/.eslintrc b/.eslintrc index c06c48f7..3b962db9 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,7 +1,8 @@ { /** Enable ES6 features */ "parserOptions": { - "ecmaVersion": 6, + "ecmaVersion": 2017, + "sourceType": "module" }, "rules": { @@ -18,7 +19,7 @@ "no-shadow": 2, "no-undef-init": 2, "no-undef": 2, - "no-unused-vars": 1, + "no-unused-vars": 0, /** Style */ "array-bracket-spacing": [2, "never", { @@ -26,7 +27,10 @@ "objectsInArrays": true, "arraysInArrays": true }], - "quotes": [2, "single", "avoid-escape"], + "quotes": [2, "single", { + "avoidEscape": true, + "allowTemplateLiterals": true + }], "eqeqeq": 0, "brace-style": [2, "1tbs"], "comma-spacing": [2, { @@ -38,7 +42,7 @@ "no-nested-ternary": 1, "no-trailing-spaces": 2, "no-mixed-spaces-and-tabs": 2, - "padded-blocks": [2, "always"], + "padded-blocks": [2, "never"], "space-before-blocks": 1, "space-before-function-paren": [1, { "anonymous": "always", @@ -49,7 +53,7 @@ "markers": ["=", "!"] }], "semi": [2, "always"], - "indent": [2, 4, { + "indent": [2, 2, { "SwitchCase": 1 }], "camelcase": [2, { @@ -71,7 +75,14 @@ "FormData": true, "XMLHttpRequest": true, "ActiveXObject": true, - "RegExp": true - + "RegExp": true, + "Module": true, + "Node": true, + "Element": true, + "Proxy": true, + "Symbol": true, + "$": true, + "_": true, + "setTimeout": true } -} \ No newline at end of file +} diff --git a/.gitignore b/.gitignore index 93782c6f..22c8dd70 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ node_modules/* /uploads/ plugins/personality/ + +npm-debug.log \ No newline at end of file diff --git a/.jshintrc b/.jshintrc index 49d68f10..fdb7413c 100644 --- a/.jshintrc +++ b/.jshintrc @@ -12,11 +12,15 @@ // Define globals exposed by CodeX Team "predef": [ - "codex" + "codex", + "_", + "$", + "editorModules", + "Module" ], // Allow ES6. - "esversion": 6, + "esversion": 2017, /* * ENFORCING OPTIONS diff --git a/.postcssrc b/.postcssrc new file mode 100644 index 00000000..3780c0bc --- /dev/null +++ b/.postcssrc @@ -0,0 +1,16 @@ +plugins: + postcss-smart-import: {} + postcss-custom-properties: {} + postcss-apply: {} + postcss-custom-media: {} + postcss-media-minmax: {} + postcss-custom-selectors: {} + postcss-nested-ancestors: {} + postcss-nesting: {} + postcss-nested: {} + postcss-color-mod-function: {} + postcss-color-hex-alpha: {} + postcss-font-variant: {} + postcss-font-family-system-ui: {} + autoprefixer: + browsers: ['last 2 versions', '> 1%'] diff --git a/.stylelintrc b/.stylelintrc index 57c9fa2a..23b203aa 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -1,12 +1,17 @@ { "rules": { - "at-rule-empty-line-before": [ "always", { - except: [ - "blockless-after-same-name-blockless", - "first-nested", - ], - ignore: ["after-comment"], - } ], + "at-rule-empty-line-before": [ + "always", + { + except: [ + "blockless-after-same-name-blockless", + "first-nested", + ], + ignore: [ + "after-comment" + ], + } + ], "at-rule-name-case": "lower", "at-rule-name-space-after": "always-single-line", "at-rule-semicolon-newline-after": "always", @@ -21,27 +26,42 @@ "color-hex-case": "lower", "color-hex-length": "short", "color-no-invalid-hex": true, - "comment-empty-line-before": [ "always", { - except: ["first-nested"], - ignore: ["stylelint-commands"], - } ], + "comment-empty-line-before": [ + "always", + { + except: [ + "first-nested" + ], + ignore: [ + "stylelint-commands" + ], + } + ], "comment-no-empty": true, "comment-whitespace-inside": "always", - "custom-property-empty-line-before": [ "always", { - except: [ - "after-custom-property", - "first-nested", - ], - ignore: [ - "after-comment", - "inside-single-line-block", - ], - } ], + "custom-property-empty-line-before": [ + "always", + { + except: [ + "after-custom-property", + "first-nested", + ], + ignore: [ + "after-comment", + "inside-single-line-block", + ], + } + ], "declaration-bang-space-after": "never", "declaration-bang-space-before": "always", - "declaration-block-no-duplicate-properties": [ true, { - ignore: ["consecutive-duplicates-with-different-values"], - } ], + "declaration-block-no-duplicate-properties": [ + true, + { + ignore: [ + "consecutive-duplicates-with-different-values" + ], + } + ], "declaration-block-no-redundant-longhand-properties": true, "declaration-block-no-shorthand-property-overrides": true, "declaration-block-semicolon-newline-after": "always-multi-line", @@ -52,16 +72,19 @@ "declaration-colon-newline-after": "always-multi-line", "declaration-colon-space-after": "always-single-line", "declaration-colon-space-before": "never", - "declaration-empty-line-before": [ "always", { - except: [ - "after-declaration", - "first-nested", - ], - ignore: [ - "after-comment", - "inside-single-line-block", - ], - } ], + "declaration-empty-line-before": [ + "always", + { + except: [ + "after-declaration", + "first-nested", + ], + ignore: [ + "after-comment", + "inside-single-line-block", + ], + } + ], "font-family-no-duplicate-names": true, "function-calc-no-unspaced-operator": true, "function-comma-newline-after": "always-multi-line", @@ -96,13 +119,17 @@ "number-no-trailing-zeros": true, "property-case": "lower", "property-no-unknown": true, - "rule-nested-empty-line-before": [ "always-multi-line", { - except: ["first-nested"], - ignore: ["after-comment"], - } ], - "rule-non-nested-empty-line-before": [ "always-multi-line", { - ignore: ["after-comment"], - } ], + "rule-empty-line-before": [ + "always-multi-line", + { + except: [ + "first-nested" + ], + ignore: [ + "after-comment" + ], + } + ], "selector-attribute-brackets-space-inside": "never", "selector-attribute-operator-space-after": "never", "selector-attribute-operator-space-before": "never", @@ -129,4 +156,4 @@ "value-list-comma-space-before": "never", "value-list-max-empty-lines": 0, }, -} \ No newline at end of file +} diff --git a/build/codex-editor.js b/build/codex-editor.js new file mode 100644 index 00000000..28a85214 --- /dev/null +++ b/build/codex-editor.js @@ -0,0 +1,23770 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["CodexEditor"] = factory(); + else + root["CodexEditor"] = factory(); +})(window, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./build/sprite.svg": +/*!**************************!*\ + !*** ./build/sprite.svg ***! + \**************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = "\n\n\r\n \r\n\n\n\r\n \r\n\n\n\r\n \r\n\n\n\r\n \r\n\n\n\r\n \r\n \r\n \r\n \r\n \r\n\n\n\r\n \r\n\n\n\r\n \r\n\n\n\r\n \r\n\n\n\r\n \r\n\n" + +/***/ }), + +/***/ "./node_modules/babel-core/register.js": +/*!*********************************************!*\ + !*** ./node_modules/babel-core/register.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* eslint max-len: 0 */ +// TODO: eventually deprecate this console.trace("use the `babel-register` package instead of `babel-core/register`"); +module.exports = __webpack_require__(/*! babel-register */ "./node_modules/babel-register/lib/browser.js"); + + +/***/ }), + +/***/ "./node_modules/babel-polyfill/lib/index.js": +/*!**************************************************!*\ + !*** ./node_modules/babel-polyfill/lib/index.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +__webpack_require__(/*! core-js/shim */ "./node_modules/core-js/shim.js"); + +__webpack_require__(/*! regenerator-runtime/runtime */ "./node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js"); + +__webpack_require__(/*! core-js/fn/regexp/escape */ "./node_modules/core-js/fn/regexp/escape.js"); + +if (global._babelPolyfill) { + throw new Error("only one instance of babel-polyfill is allowed"); +} +global._babelPolyfill = true; + +var DEFINE_PROPERTY = "defineProperty"; +function define(O, key, value) { + O[key] || Object[DEFINE_PROPERTY](O, key, { + writable: true, + configurable: true, + value: value + }); +} + +define(String.prototype, "padLeft", "".padStart); +define(String.prototype, "padRight", "".padEnd); + +"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) { + [][key] && define(Array, key, Function.call.bind([][key])); +}); +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) {/** + * Copyright (c) 2014, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * https://raw.github.com/facebook/regenerator/master/LICENSE file. An + * additional grant of patent rights can be found in the PATENTS file in + * the same directory. + */ + +!(function(global) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; // More compressible than void 0. + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + var inModule = typeof module === "object"; + var runtime = global.regeneratorRuntime; + if (runtime) { + if (inModule) { + // If regeneratorRuntime is defined globally and we're in a module, + // make the exports object identical to regeneratorRuntime. + module.exports = runtime; + } + // Don't bother evaluating the rest of this file if the runtime was + // already defined globally. + return; + } + + // Define the runtime globally (as expected by generated code) as either + // module.exports (if we're in a module) or a new, empty object. + runtime = global.regeneratorRuntime = inModule ? module.exports : {}; + + function wrap(innerFn, outerFn, self, tryLocsList) { + // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + + // The ._invoke method unifies the implementations of the .next, + // .throw, and .return methods. + generator._invoke = makeInvokeMethod(innerFn, self, context); + + return generator; + } + runtime.wrap = wrap; + + // Try/catch helper to minimize deoptimizations. Returns a completion + // record like context.tryEntries[i].completion. This interface could + // have been (and was previously) designed to take a closure to be + // invoked without arguments, but in all the cases we care about we + // already have an existing method we want to call, so there's no need + // to create a new function object. We can even get away with assuming + // the method takes exactly one argument, since that happens to be true + // in every case, so we don't have to touch the arguments object. The + // only additional allocation required is the completion record, which + // has a stable shape and so hopefully should be cheap to allocate. + function tryCatch(fn, obj, arg) { + try { + return { type: "normal", arg: fn.call(obj, arg) }; + } catch (err) { + return { type: "throw", arg: err }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + + // Returning this object from the innerFn has the same effect as + // breaking out of the dispatch switch statement. + var ContinueSentinel = {}; + + // Dummy constructor functions that we use as the .constructor and + // .constructor.prototype properties for functions that return Generator + // objects. For full spec compliance, you may wish to configure your + // minifier not to mangle the names of these two functions. + function Generator() {} + function GeneratorFunction() {} + function GeneratorFunctionPrototype() {} + + // This is a polyfill for %IteratorPrototype% for environments that + // don't natively support it. + var IteratorPrototype = {}; + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + if (NativeIteratorPrototype && + NativeIteratorPrototype !== Op && + hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + // This environment has a native %IteratorPrototype%; use it instead + // of the polyfill. + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = + Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunctionPrototype[toStringTagSymbol] = + GeneratorFunction.displayName = "GeneratorFunction"; + + // Helper for defining the .next, .throw, and .return methods of the + // Iterator interface in terms of a single ._invoke method. + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function(method) { + prototype[method] = function(arg) { + return this._invoke(method, arg); + }; + }); + } + + runtime.isGeneratorFunction = function(genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor + ? ctor === GeneratorFunction || + // For the native GeneratorFunction constructor, the best we can + // do is to check its .name property. + (ctor.displayName || ctor.name) === "GeneratorFunction" + : false; + }; + + runtime.mark = function(genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + if (!(toStringTagSymbol in genFun)) { + genFun[toStringTagSymbol] = "GeneratorFunction"; + } + } + genFun.prototype = Object.create(Gp); + return genFun; + }; + + // Within the body of any async function, `await x` is transformed to + // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test + // `hasOwn.call(value, "__await")` to determine if the yielded value is + // meant to be awaited. + runtime.awrap = function(arg) { + return { __await: arg }; + }; + + function AsyncIterator(generator) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + if (value && + typeof value === "object" && + hasOwn.call(value, "__await")) { + return Promise.resolve(value.__await).then(function(value) { + invoke("next", value, resolve, reject); + }, function(err) { + invoke("throw", err, resolve, reject); + }); + } + + return Promise.resolve(value).then(function(unwrapped) { + // When a yielded Promise is resolved, its final value becomes + // the .value of the Promise<{value,done}> result for the + // current iteration. If the Promise is rejected, however, the + // result for this iteration will be rejected with the same + // reason. Note that rejections of yielded Promises are not + // thrown back into the generator function, as is the case + // when an awaited Promise is rejected. This difference in + // behavior between yield and await is important, because it + // allows the consumer to decide what to do with the yielded + // rejection (swallow it and continue, manually .throw it back + // into the generator, abandon iteration, whatever). With + // await, by contrast, there is no opportunity to examine the + // rejection reason outside the generator function, so the + // only option is to throw it from the await expression, and + // let the generator function handle the exception. + result.value = unwrapped; + resolve(result); + }, reject); + } + } + + if (typeof global.process === "object" && global.process.domain) { + invoke = global.process.domain.bind(invoke); + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new Promise(function(resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = + // If enqueue has been called before, then we want to wait until + // all previous Promises have been resolved before calling invoke, + // so that results are always delivered in the correct order. If + // enqueue has not been called before, then it is important to + // call invoke immediately, without waiting on a callback to fire, + // so that the async generator function has the opportunity to do + // any necessary setup in a predictable way. This predictability + // is why the Promise constructor synchronously invokes its + // executor callback, and why async functions synchronously + // execute code before the first await. Since we implement simple + // async functions in terms of async generators, it is especially + // important to get this right, even though it requires care. + previousPromise ? previousPromise.then( + callInvokeWithMethodAndArg, + // Avoid propagating failures to Promises returned by later + // invocations of the iterator. + callInvokeWithMethodAndArg + ) : callInvokeWithMethodAndArg(); + } + + // Define the unified helper method that is used to implement .next, + // .throw, and .return (see defineIteratorMethods). + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + runtime.AsyncIterator = AsyncIterator; + + // Note that simple async functions are implemented on top of + // AsyncIterator objects; they just return a Promise for the value of + // the final result produced by the iterator. + runtime.async = function(innerFn, outerFn, self, tryLocsList) { + var iter = new AsyncIterator( + wrap(innerFn, outerFn, self, tryLocsList) + ); + + return runtime.isGeneratorFunction(outerFn) + ? iter // If outerFn is a generator, return the full iterator. + : iter.next().then(function(result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + // Be forgiving, per 25.3.3.3.3 of the spec: + // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + // Setting context._sent for legacy support of Babel's + // function.sent implementation. + context.sent = context._sent = context.arg; + + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + + var record = tryCatch(innerFn, self, context); + if (record.type === "normal") { + // If an exception is thrown from innerFn, we leave state === + // GenStateExecuting and loop back for another invocation. + state = context.done + ? GenStateCompleted + : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + + } else if (record.type === "throw") { + state = GenStateCompleted; + // Dispatch the exception by looping back around to the + // context.dispatchException(context.arg) call above. + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + // Call delegate.iterator[context.method](context.arg) and handle the + // result, either by returning a { value, done } result from the + // delegate iterator, or by modifying context.method and context.arg, + // setting context.delegate to null, and returning the ContinueSentinel. + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + if (method === undefined) { + // A .throw or .return when the delegate iterator has no .throw + // method always terminates the yield* loop. + context.delegate = null; + + if (context.method === "throw") { + if (delegate.iterator.return) { + // If the delegate iterator has a return method, give it a + // chance to clean up. + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + // If maybeInvokeDelegate(context) changed context.method from + // "return" to "throw", let that override the TypeError below. + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError( + "The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (! info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + // Assign the result of the finished delegate to the temporary + // variable specified by delegate.resultName (see delegateYield). + context[delegate.resultName] = info.value; + + // Resume execution at the desired location (see delegateYield). + context.next = delegate.nextLoc; + + // If context.method was "throw" but the delegate handled the + // exception, let the outer generator proceed normally. If + // context.method was "next", forget context.arg since it has been + // "consumed" by the delegate iterator. If context.method was + // "return", allow the original .return call to continue in the + // outer generator. + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + + } else { + // Re-yield the result returned by the delegate method. + return info; + } + + // The delegate iterator is finished, so forget it and continue with + // the outer generator. + context.delegate = null; + return ContinueSentinel; + } + + // Define Generator.prototype.{next,throw,return} in terms of the + // unified ._invoke helper method. + defineIteratorMethods(Gp); + + Gp[toStringTagSymbol] = "Generator"; + + // A Generator should always return itself as the iterator object when the + // @@iterator function is called on it. Some browsers' implementations of the + // iterator prototype chain incorrectly implement this, causing the Generator + // object to not be returned from this call. This ensures that doesn't happen. + // See https://github.com/facebook/regenerator/issues/274 for more details. + Gp[iteratorSymbol] = function() { + return this; + }; + + Gp.toString = function() { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { tryLoc: locs[0] }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + // The root entry object (effectively a try statement without a catch + // or a finally block) gives us a place to store values thrown from + // locations where there is no enclosing try statement. + this.tryEntries = [{ tryLoc: "root" }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + runtime.keys = function(object) { + var keys = []; + for (var key in object) { + keys.push(key); + } + keys.reverse(); + + // Rather than returning an object with a next method, we keep + // things simple and return the next function itself. + return function next() { + while (keys.length) { + var key = keys.pop(); + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + // To avoid creating an additional object, we just hang the .value + // and .done properties off the next function object itself. This + // also ensures that the minifier will not anonymize the function. + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + + return next; + }; + + return next.next = next; + } + } + + // Return an iterator with no values. + return { next: doneResult }; + } + runtime.values = values; + + function doneResult() { + return { value: undefined, done: true }; + } + + Context.prototype = { + constructor: Context, + + reset: function(skipTempReset) { + this.prev = 0; + this.next = 0; + // Resetting context._sent for legacy support of Babel's + // function.sent implementation. + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + + this.method = "next"; + this.arg = undefined; + + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + // Not sure about the optimal order of these conditions: + if (name.charAt(0) === "t" && + hasOwn.call(this, name) && + !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + + stop: function() { + this.done = true; + + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + + dispatchException: function(exception) { + if (this.done) { + throw exception; + } + + var context = this; + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + // If the dispatched exception was caught by a catch block, + // then let that catch block handle the exception normally. + context.method = "next"; + context.arg = undefined; + } + + return !! caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + // Exception thrown outside of any try block that could handle + // it, so set the completion value of the entire function to + // throw the exception. + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + + abrupt: function(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc <= this.prev && + hasOwn.call(entry, "finallyLoc") && + this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && + (type === "break" || + type === "continue") && + finallyEntry.tryLoc <= arg && + arg <= finallyEntry.finallyLoc) { + // Ignore the finally entry if control is not jumping to a + // location outside the try/catch block. + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + + complete: function(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || + record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + + finish: function(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + + "catch": function(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + return thrown; + } + } + + // The context.catch method must only be called with a location + // argument that corresponds to a known catch block. + throw new Error("illegal catch attempt"); + }, + + delegateYield: function(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + // Deliberately forget the last sent value so that we don't + // accidentally pass it on to the delegate. + this.arg = undefined; + } + + return ContinueSentinel; + } + }; +})( + // Among the various tricks for obtaining a reference to the global + // object, this seems to be the most reliable technique that does not + // use indirect eval (which violates Content Security Policy). + typeof global === "object" ? global : + typeof window === "object" ? window : + typeof self === "object" ? self : this +); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "./node_modules/babel-register/lib/browser.js": +/*!****************************************************!*\ + !*** ./node_modules/babel-register/lib/browser.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.__esModule = true; + +exports.default = function () {}; + +module.exports = exports["default"]; + +/***/ }), + +/***/ "./node_modules/core-js/fn/regexp/escape.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/fn/regexp/escape.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ../../modules/core.regexp.escape */ "./node_modules/core-js/modules/core.regexp.escape.js"); +module.exports = __webpack_require__(/*! ../../modules/_core */ "./node_modules/core-js/modules/_core.js").RegExp.escape; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_a-function.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_a-function.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it) { + if (typeof it != 'function') throw TypeError(it + ' is not a function!'); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_a-number-value.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/_a-number-value.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +module.exports = function (it, msg) { + if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); + return +it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_add-to-unscopables.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/_add-to-unscopables.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.31 Array.prototype[@@unscopables] +var UNSCOPABLES = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('unscopables'); +var ArrayProto = Array.prototype; +if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")(ArrayProto, UNSCOPABLES, {}); +module.exports = function (key) { + ArrayProto[UNSCOPABLES][key] = true; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_an-instance.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_an-instance.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it, Constructor, name, forbiddenField) { + if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { + throw TypeError(name + ': incorrect invocation!'); + } return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_an-object.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_an-object.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +module.exports = function (it) { + if (!isObject(it)) throw TypeError(it + ' is not an object!'); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_array-copy-within.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_array-copy-within.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) + +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toAbsoluteIndex = __webpack_require__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); + +module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { + var O = toObject(this); + var len = toLength(O.length); + var to = toAbsoluteIndex(target, len); + var from = toAbsoluteIndex(start, len); + var end = arguments.length > 2 ? arguments[2] : undefined; + var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); + var inc = 1; + if (from < to && to < from + count) { + inc = -1; + from += count - 1; + to += count - 1; + } + while (count-- > 0) { + if (from in O) O[to] = O[from]; + else delete O[to]; + to += inc; + from += inc; + } return O; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_array-fill.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_array-fill.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) + +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toAbsoluteIndex = __webpack_require__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +module.exports = function fill(value /* , start = 0, end = @length */) { + var O = toObject(this); + var length = toLength(O.length); + var aLen = arguments.length; + var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); + var end = aLen > 2 ? arguments[2] : undefined; + var endPos = end === undefined ? length : toAbsoluteIndex(end, length); + while (endPos > index) O[index++] = value; + return O; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_array-from-iterable.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_array-from-iterable.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); + +module.exports = function (iter, ITERATOR) { + var result = []; + forOf(iter, false, result.push, result, ITERATOR); + return result; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_array-includes.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/_array-includes.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// false -> Array#indexOf +// true -> Array#includes +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var toAbsoluteIndex = __webpack_require__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +module.exports = function (IS_INCLUDES) { + return function ($this, el, fromIndex) { + var O = toIObject($this); + var length = toLength(O.length); + var index = toAbsoluteIndex(fromIndex, length); + var value; + // Array#includes uses SameValueZero equality algorithm + // eslint-disable-next-line no-self-compare + if (IS_INCLUDES && el != el) while (length > index) { + value = O[index++]; + // eslint-disable-next-line no-self-compare + if (value != value) return true; + // Array#indexOf ignores holes, Array#includes - not + } else for (;length > index; index++) if (IS_INCLUDES || index in O) { + if (O[index] === el) return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_array-methods.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_array-methods.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 0 -> Array#forEach +// 1 -> Array#map +// 2 -> Array#filter +// 3 -> Array#some +// 4 -> Array#every +// 5 -> Array#find +// 6 -> Array#findIndex +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var asc = __webpack_require__(/*! ./_array-species-create */ "./node_modules/core-js/modules/_array-species-create.js"); +module.exports = function (TYPE, $create) { + var IS_MAP = TYPE == 1; + var IS_FILTER = TYPE == 2; + var IS_SOME = TYPE == 3; + var IS_EVERY = TYPE == 4; + var IS_FIND_INDEX = TYPE == 6; + var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; + var create = $create || asc; + return function ($this, callbackfn, that) { + var O = toObject($this); + var self = IObject(O); + var f = ctx(callbackfn, that, 3); + var length = toLength(self.length); + var index = 0; + var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; + var val, res; + for (;length > index; index++) if (NO_HOLES || index in self) { + val = self[index]; + res = f(val, index, O); + if (TYPE) { + if (IS_MAP) result[index] = res; // map + else if (res) switch (TYPE) { + case 3: return true; // some + case 5: return val; // find + case 6: return index; // findIndex + case 2: result.push(val); // filter + } else if (IS_EVERY) return false; // every + } + } + return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_array-reduce.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/_array-reduce.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); + +module.exports = function (that, callbackfn, aLen, memo, isRight) { + aFunction(callbackfn); + var O = toObject(that); + var self = IObject(O); + var length = toLength(O.length); + var index = isRight ? length - 1 : 0; + var i = isRight ? -1 : 1; + if (aLen < 2) for (;;) { + if (index in self) { + memo = self[index]; + index += i; + break; + } + index += i; + if (isRight ? index < 0 : length <= index) { + throw TypeError('Reduce of empty array with no initial value'); + } + } + for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { + memo = callbackfn(memo, self[index], index, O); + } + return memo; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_array-species-constructor.js": +/*!********************************************************************!*\ + !*** ./node_modules/core-js/modules/_array-species-constructor.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var isArray = __webpack_require__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js"); +var SPECIES = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species'); + +module.exports = function (original) { + var C; + if (isArray(original)) { + C = original.constructor; + // cross-realm fallback + if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; + if (isObject(C)) { + C = C[SPECIES]; + if (C === null) C = undefined; + } + } return C === undefined ? Array : C; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_array-species-create.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/_array-species-create.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 9.4.2.3 ArraySpeciesCreate(originalArray, length) +var speciesConstructor = __webpack_require__(/*! ./_array-species-constructor */ "./node_modules/core-js/modules/_array-species-constructor.js"); + +module.exports = function (original, length) { + return new (speciesConstructor(original))(length); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_bind.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_bind.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var invoke = __webpack_require__(/*! ./_invoke */ "./node_modules/core-js/modules/_invoke.js"); +var arraySlice = [].slice; +var factories = {}; + +var construct = function (F, len, args) { + if (!(len in factories)) { + for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; + // eslint-disable-next-line no-new-func + factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); + } return factories[len](F, args); +}; + +module.exports = Function.bind || function bind(that /* , ...args */) { + var fn = aFunction(this); + var partArgs = arraySlice.call(arguments, 1); + var bound = function (/* args... */) { + var args = partArgs.concat(arraySlice.call(arguments)); + return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); + }; + if (isObject(fn.prototype)) bound.prototype = fn.prototype; + return bound; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_classof.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_classof.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +var TAG = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toStringTag'); +// ES3 wrong here +var ARG = cof(function () { return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function (it, key) { + try { + return it[key]; + } catch (e) { /* empty */ } +}; + +module.exports = function (it) { + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_cof.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_cof.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = function (it) { + return toString.call(it).slice(8, -1); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_collection-strong.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_collection-strong.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var create = __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); +var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var $iterDefine = __webpack_require__(/*! ./_iter-define */ "./node_modules/core-js/modules/_iter-define.js"); +var step = __webpack_require__(/*! ./_iter-step */ "./node_modules/core-js/modules/_iter-step.js"); +var setSpecies = __webpack_require__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js"); +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var fastKey = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").fastKey; +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var SIZE = DESCRIPTORS ? '_s' : 'size'; + +var getEntry = function (that, key) { + // fast case + var index = fastKey(key); + var entry; + if (index !== 'F') return that._i[index]; + // frozen object case + for (entry = that._f; entry; entry = entry.n) { + if (entry.k == key) return entry; + } +}; + +module.exports = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear() { + for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { + entry.r = true; + if (entry.p) entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function (key) { + var that = validate(this, NAME); + var entry = getEntry(that, key); + if (entry) { + var next = entry.n; + var prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if (prev) prev.n = next; + if (next) next.p = prev; + if (that._f == entry) that._f = next; + if (that._l == entry) that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /* , that = undefined */) { + validate(this, NAME); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); + var entry; + while (entry = entry ? entry.n : this._f) { + f(entry.v, entry.k, this); + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key) { + return !!getEntry(validate(this, NAME), key); + } + }); + if (DESCRIPTORS) dP(C.prototype, 'size', { + get: function () { + return validate(this, NAME)[SIZE]; + } + }); + return C; + }, + def: function (that, key, value) { + var entry = getEntry(that, key); + var prev, index; + // change existing entry + if (entry) { + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if (!that._f) that._f = entry; + if (prev) prev.n = entry; + that[SIZE]++; + // add to index + if (index !== 'F') that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function (C, NAME, IS_MAP) { + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function (iterated, kind) { + this._t = validate(iterated, NAME); // target + this._k = kind; // kind + this._l = undefined; // previous + }, function () { + var that = this; + var kind = that._k; + var entry = that._l; + // revert to the last existing entry + while (entry && entry.r) entry = entry.p; + // get next entry + if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if (kind == 'keys') return step(0, entry.k); + if (kind == 'values') return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_collection-to-json.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/_collection-to-json.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var classof = __webpack_require__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var from = __webpack_require__(/*! ./_array-from-iterable */ "./node_modules/core-js/modules/_array-from-iterable.js"); +module.exports = function (NAME) { + return function toJSON() { + if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); + return from(this); + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_collection-weak.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_collection-weak.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); +var getWeak = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").getWeak; +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var createArrayMethod = __webpack_require__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js"); +var $has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var arrayFind = createArrayMethod(5); +var arrayFindIndex = createArrayMethod(6); +var id = 0; + +// fallback for uncaught frozen keys +var uncaughtFrozenStore = function (that) { + return that._l || (that._l = new UncaughtFrozenStore()); +}; +var UncaughtFrozenStore = function () { + this.a = []; +}; +var findUncaughtFrozen = function (store, key) { + return arrayFind(store.a, function (it) { + return it[0] === key; + }); +}; +UncaughtFrozenStore.prototype = { + get: function (key) { + var entry = findUncaughtFrozen(this, key); + if (entry) return entry[1]; + }, + has: function (key) { + return !!findUncaughtFrozen(this, key); + }, + set: function (key, value) { + var entry = findUncaughtFrozen(this, key); + if (entry) entry[1] = value; + else this.a.push([key, value]); + }, + 'delete': function (key) { + var index = arrayFindIndex(this.a, function (it) { + return it[0] === key; + }); + if (~index) this.a.splice(index, 1); + return !!~index; + } +}; + +module.exports = { + getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { + var C = wrapper(function (that, iterable) { + anInstance(that, C, NAME, '_i'); + that._t = NAME; // collection type + that._i = id++; // collection id + that._l = undefined; // leak store for uncaught frozen objects + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.3.3.2 WeakMap.prototype.delete(key) + // 23.4.3.3 WeakSet.prototype.delete(value) + 'delete': function (key) { + if (!isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); + return data && $has(data, this._i) && delete data[this._i]; + }, + // 23.3.3.4 WeakMap.prototype.has(key) + // 23.4.3.4 WeakSet.prototype.has(value) + has: function has(key) { + if (!isObject(key)) return false; + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); + return data && $has(data, this._i); + } + }); + return C; + }, + def: function (that, key, value) { + var data = getWeak(anObject(key), true); + if (data === true) uncaughtFrozenStore(that).set(key, value); + else data[that._i] = value; + return that; + }, + ufstore: uncaughtFrozenStore +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_collection.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_collection.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); +var meta = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js"); +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var $iterDetect = __webpack_require__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js"); +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var inheritIfRequired = __webpack_require__(/*! ./_inherit-if-required */ "./node_modules/core-js/modules/_inherit-if-required.js"); + +module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { + var Base = global[NAME]; + var C = Base; + var ADDER = IS_MAP ? 'set' : 'add'; + var proto = C && C.prototype; + var O = {}; + var fixMethod = function (KEY) { + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function (a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a) { + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a) { + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { + new C().entries().next(); + }))) { + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + var instance = new C(); + // early implementations not supports chaining + var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); + // most early implementations doesn't supports iterables, most modern - not close it correctly + var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + var BUGGY_ZERO = !IS_WEAK && fails(function () { + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C(); + var index = 5; + while (index--) $instance[ADDER](index, index); + return !$instance.has(-0); + }); + if (!ACCEPT_ITERABLES) { + C = wrapper(function (target, iterable) { + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base(), target, C); + if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); + // weak collections should not contains .clear method + if (IS_WEAK && proto.clear) delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); + + return C; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_core.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_core.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var core = module.exports = { version: '2.5.7' }; +if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_create-property.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_create-property.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $defineProperty = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); + +module.exports = function (object, index, value) { + if (index in object) $defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_ctx.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_ctx.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// optional / simple context binding +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +module.exports = function (fn, that, length) { + aFunction(fn); + if (that === undefined) return fn; + switch (length) { + case 1: return function (a) { + return fn.call(that, a); + }; + case 2: return function (a, b) { + return fn.call(that, a, b); + }; + case 3: return function (a, b, c) { + return fn.call(that, a, b, c); + }; + } + return function (/* ...args */) { + return fn.apply(that, arguments); + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_date-to-iso-string.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/_date-to-iso-string.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var getTime = Date.prototype.getTime; +var $toISOString = Date.prototype.toISOString; + +var lz = function (num) { + return num > 9 ? num : '0' + num; +}; + +// PhantomJS / old WebKit has a broken implementations +module.exports = (fails(function () { + return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; +}) || !fails(function () { + $toISOString.call(new Date(NaN)); +})) ? function toISOString() { + if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); + var d = this; + var y = d.getUTCFullYear(); + var m = d.getUTCMilliseconds(); + var s = y < 0 ? '-' : y > 9999 ? '+' : ''; + return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + + '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + + 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + + ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; +} : $toISOString; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_date-to-primitive.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_date-to-primitive.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var NUMBER = 'number'; + +module.exports = function (hint) { + if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); + return toPrimitive(anObject(this), hint != NUMBER); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_defined.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_defined.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function (it) { + if (it == undefined) throw TypeError("Can't call method on " + it); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_descriptors.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_descriptors.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// Thank's IE8 for his funny defineProperty +module.exports = !__webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_dom-create.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_dom-create.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var document = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").document; +// typeof document.createElement is 'object' in old IE +var is = isObject(document) && isObject(document.createElement); +module.exports = function (it) { + return is ? document.createElement(it) : {}; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_enum-bug-keys.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_enum-bug-keys.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_enum-keys.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_enum-keys.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// all enumerable object keys, includes symbols +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var gOPS = __webpack_require__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); +var pIE = __webpack_require__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js"); +module.exports = function (it) { + var result = getKeys(it); + var getSymbols = gOPS.f; + if (getSymbols) { + var symbols = getSymbols(it); + var isEnum = pIE.f; + var i = 0; + var key; + while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); + } return result; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_export.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_export.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var PROTOTYPE = 'prototype'; + +var $export = function (type, name, source) { + var IS_FORCED = type & $export.F; + var IS_GLOBAL = type & $export.G; + var IS_STATIC = type & $export.S; + var IS_PROTO = type & $export.P; + var IS_BIND = type & $export.B; + var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; + var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); + var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); + var key, own, out, exp; + if (IS_GLOBAL) source = name; + for (key in source) { + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if (target) redefine(target, key, out, type & $export.U); + // export + if (exports[key] != out) hide(exports, key, exp); + if (IS_PROTO && expProto[key] != out) expProto[key] = out; + } +}; +global.core = core; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_fails-is-regexp.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_fails-is-regexp.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var MATCH = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('match'); +module.exports = function (KEY) { + var re = /./; + try { + '/./'[KEY](re); + } catch (e) { + try { + re[MATCH] = false; + return !'/./'[KEY](re); + } catch (f) { /* empty */ } + } return true; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_fails.js": +/*!************************************************!*\ + !*** ./node_modules/core-js/modules/_fails.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return !!exec(); + } catch (e) { + return true; + } +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_fix-re-wks.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_fix-re-wks.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +var wks = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); + +module.exports = function (KEY, length, exec) { + var SYMBOL = wks(KEY); + var fns = exec(defined, SYMBOL, ''[KEY]); + var strfn = fns[0]; + var rxfn = fns[1]; + if (fails(function () { + var O = {}; + O[SYMBOL] = function () { return 7; }; + return ''[KEY](O) != 7; + })) { + redefine(String.prototype, KEY, strfn); + hide(RegExp.prototype, SYMBOL, length == 2 + // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) + // 21.2.5.11 RegExp.prototype[@@split](string, limit) + ? function (string, arg) { return rxfn.call(string, this, arg); } + // 21.2.5.6 RegExp.prototype[@@match](string) + // 21.2.5.9 RegExp.prototype[@@search](string) + : function (string) { return rxfn.call(string, this); } + ); + } +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_flags.js": +/*!************************************************!*\ + !*** ./node_modules/core-js/modules/_flags.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 21.2.5.3 get RegExp.prototype.flags +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +module.exports = function () { + var that = anObject(this); + var result = ''; + if (that.global) result += 'g'; + if (that.ignoreCase) result += 'i'; + if (that.multiline) result += 'm'; + if (that.unicode) result += 'u'; + if (that.sticky) result += 'y'; + return result; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_flatten-into-array.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/_flatten-into-array.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray +var isArray = __webpack_require__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var IS_CONCAT_SPREADABLE = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('isConcatSpreadable'); + +function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { + var targetIndex = start; + var sourceIndex = 0; + var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; + var element, spreadable; + + while (sourceIndex < sourceLen) { + if (sourceIndex in source) { + element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; + + spreadable = false; + if (isObject(element)) { + spreadable = element[IS_CONCAT_SPREADABLE]; + spreadable = spreadable !== undefined ? !!spreadable : isArray(element); + } + + if (spreadable && depth > 0) { + targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; + } else { + if (targetIndex >= 0x1fffffffffffff) throw TypeError(); + target[targetIndex] = element; + } + + targetIndex++; + } + sourceIndex++; + } + return targetIndex; +} + +module.exports = flattenIntoArray; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_for-of.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_for-of.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var call = __webpack_require__(/*! ./_iter-call */ "./node_modules/core-js/modules/_iter-call.js"); +var isArrayIter = __webpack_require__(/*! ./_is-array-iter */ "./node_modules/core-js/modules/_is-array-iter.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ "./node_modules/core-js/modules/core.get-iterator-method.js"); +var BREAK = {}; +var RETURN = {}; +var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { + var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); + var f = ctx(fn, that, entries ? 2 : 1); + var index = 0; + var length, step, iterator, result; + if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if (result === BREAK || result === RETURN) return result; + } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { + result = call(iterator, f, step.value, entries); + if (result === BREAK || result === RETURN) return result; + } +}; +exports.BREAK = BREAK; +exports.RETURN = RETURN; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_global.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_global.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self + // eslint-disable-next-line no-new-func + : Function('return this')(); +if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_has.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_has.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function (it, key) { + return hasOwnProperty.call(it, key); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_hide.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_hide.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +module.exports = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? function (object, key, value) { + return dP.f(object, key, createDesc(1, value)); +} : function (object, key, value) { + object[key] = value; + return object; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_html.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_html.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var document = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").document; +module.exports = document && document.documentElement; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_ie8-dom-define.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/_ie8-dom-define.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = !__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && !__webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return Object.defineProperty(__webpack_require__(/*! ./_dom-create */ "./node_modules/core-js/modules/_dom-create.js")('div'), 'a', { get: function () { return 7; } }).a != 7; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_inherit-if-required.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_inherit-if-required.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var setPrototypeOf = __webpack_require__(/*! ./_set-proto */ "./node_modules/core-js/modules/_set-proto.js").set; +module.exports = function (that, target, C) { + var S = target.constructor; + var P; + if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { + setPrototypeOf(that, P); + } return that; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_invoke.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_invoke.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function (fn, args, that) { + var un = that === undefined; + switch (args.length) { + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iobject.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_iobject.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +// eslint-disable-next-line no-prototype-builtins +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { + return cof(it) == 'String' ? it.split('') : Object(it); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_is-array-iter.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_is-array-iter.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// check on default Array iterator +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); +var ArrayProto = Array.prototype; + +module.exports = function (it) { + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_is-array.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_is-array.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.2 IsArray(argument) +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +module.exports = Array.isArray || function isArray(arg) { + return cof(arg) == 'Array'; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_is-integer.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_is-integer.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.3 Number.isInteger(number) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var floor = Math.floor; +module.exports = function isInteger(it) { + return !isObject(it) && isFinite(it) && floor(it) === it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_is-object.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_is-object.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (it) { + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_is-regexp.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_is-regexp.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.2.8 IsRegExp(argument) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +var MATCH = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('match'); +module.exports = function (it) { + var isRegExp; + return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iter-call.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-call.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// call something on iterator step with safe closing on error +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +module.exports = function (iterator, fn, value, entries) { + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch (e) { + var ret = iterator['return']; + if (ret !== undefined) anObject(ret.call(iterator)); + throw e; + } +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iter-create.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-create.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var create = __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); +var descriptor = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +__webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")(IteratorPrototype, __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'), function () { return this; }); + +module.exports = function (Constructor, NAME, next) { + Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); + setToStringTag(Constructor, NAME + ' Iterator'); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iter-define.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-define.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +var $iterCreate = __webpack_require__(/*! ./_iter-create */ "./node_modules/core-js/modules/_iter-create.js"); +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); +var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` +var FF_ITERATOR = '@@iterator'; +var KEYS = 'keys'; +var VALUES = 'values'; + +var returnThis = function () { return this; }; + +module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { + $iterCreate(Constructor, NAME, next); + var getMethod = function (kind) { + if (!BUGGY && kind in proto) return proto[kind]; + switch (kind) { + case KEYS: return function keys() { return new Constructor(this, kind); }; + case VALUES: return function values() { return new Constructor(this, kind); }; + } return function entries() { return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator'; + var DEF_VALUES = DEFAULT == VALUES; + var VALUES_BUG = false; + var proto = Base.prototype; + var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; + var $default = $native || getMethod(DEFAULT); + var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; + var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; + var methods, key, IteratorPrototype; + // Fix native + if ($anyNative) { + IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); + if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if (DEF_VALUES && $native && $native.name !== VALUES) { + VALUES_BUG = true; + $default = function values() { return $native.call(this); }; + } + // Define iterator + if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if (DEFAULT) { + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if (FORCED) for (key in methods) { + if (!(key in proto)) redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iter-detect.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-detect.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); +var SAFE_CLOSING = false; + +try { + var riter = [7][ITERATOR](); + riter['return'] = function () { SAFE_CLOSING = true; }; + // eslint-disable-next-line no-throw-literal + Array.from(riter, function () { throw 2; }); +} catch (e) { /* empty */ } + +module.exports = function (exec, skipClosing) { + if (!skipClosing && !SAFE_CLOSING) return false; + var safe = false; + try { + var arr = [7]; + var iter = arr[ITERATOR](); + iter.next = function () { return { done: safe = true }; }; + arr[ITERATOR] = function () { return iter; }; + exec(arr); + } catch (e) { /* empty */ } + return safe; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iter-step.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_iter-step.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (done, value) { + return { value: value, done: !!done }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_iterators.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_iterators.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = {}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_library.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_library.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = false; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_math-expm1.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_math-expm1.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 20.2.2.14 Math.expm1(x) +var $expm1 = Math.expm1; +module.exports = (!$expm1 + // Old FF bug + || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 + // Tor Browser bug + || $expm1(-2e-17) != -2e-17 +) ? function expm1(x) { + return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; +} : $expm1; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_math-fround.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_math-fround.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.16 Math.fround(x) +var sign = __webpack_require__(/*! ./_math-sign */ "./node_modules/core-js/modules/_math-sign.js"); +var pow = Math.pow; +var EPSILON = pow(2, -52); +var EPSILON32 = pow(2, -23); +var MAX32 = pow(2, 127) * (2 - EPSILON32); +var MIN32 = pow(2, -126); + +var roundTiesToEven = function (n) { + return n + 1 / EPSILON - 1 / EPSILON; +}; + +module.exports = Math.fround || function fround(x) { + var $abs = Math.abs(x); + var $sign = sign(x); + var a, result; + if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; + a = (1 + EPSILON32 / EPSILON) * $abs; + result = a - (a - $abs); + // eslint-disable-next-line no-self-compare + if (result > MAX32 || result != result) return $sign * Infinity; + return $sign * result; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_math-log1p.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_math-log1p.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 20.2.2.20 Math.log1p(x) +module.exports = Math.log1p || function log1p(x) { + return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_math-scale.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_math-scale.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// https://rwaldron.github.io/proposal-math-extensions/ +module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { + if ( + arguments.length === 0 + // eslint-disable-next-line no-self-compare + || x != x + // eslint-disable-next-line no-self-compare + || inLow != inLow + // eslint-disable-next-line no-self-compare + || inHigh != inHigh + // eslint-disable-next-line no-self-compare + || outLow != outLow + // eslint-disable-next-line no-self-compare + || outHigh != outHigh + ) return NaN; + if (x === Infinity || x === -Infinity) return x; + return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_math-sign.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_math-sign.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 20.2.2.28 Math.sign(x) +module.exports = Math.sign || function sign(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_meta.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_meta.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var META = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js")('meta'); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var setDesc = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var id = 0; +var isExtensible = Object.isExtensible || function () { + return true; +}; +var FREEZE = !__webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function (it) { + setDesc(it, META, { value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + } }); +}; +var fastKey = function (it, create) { + // return primitive with prefix + if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return 'F'; + // not necessary to add metadata + if (!create) return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function (it, create) { + if (!has(it, META)) { + // can't set metadata to uncaught frozen object + if (!isExtensible(it)) return true; + // not necessary to add metadata + if (!create) return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function (it) { + if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_metadata.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_metadata.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Map = __webpack_require__(/*! ./es6.map */ "./node_modules/core-js/modules/es6.map.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var shared = __webpack_require__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('metadata'); +var store = shared.store || (shared.store = new (__webpack_require__(/*! ./es6.weak-map */ "./node_modules/core-js/modules/es6.weak-map.js"))()); + +var getOrCreateMetadataMap = function (target, targetKey, create) { + var targetMetadata = store.get(target); + if (!targetMetadata) { + if (!create) return undefined; + store.set(target, targetMetadata = new Map()); + } + var keyMetadata = targetMetadata.get(targetKey); + if (!keyMetadata) { + if (!create) return undefined; + targetMetadata.set(targetKey, keyMetadata = new Map()); + } return keyMetadata; +}; +var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? false : metadataMap.has(MetadataKey); +}; +var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { + var metadataMap = getOrCreateMetadataMap(O, P, false); + return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); +}; +var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { + getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); +}; +var ordinaryOwnMetadataKeys = function (target, targetKey) { + var metadataMap = getOrCreateMetadataMap(target, targetKey, false); + var keys = []; + if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); + return keys; +}; +var toMetaKey = function (it) { + return it === undefined || typeof it == 'symbol' ? it : String(it); +}; +var exp = function (O) { + $export($export.S, 'Reflect', O); +}; + +module.exports = { + store: store, + map: getOrCreateMetadataMap, + has: ordinaryHasOwnMetadata, + get: ordinaryGetOwnMetadata, + set: ordinaryDefineOwnMetadata, + keys: ordinaryOwnMetadataKeys, + key: toMetaKey, + exp: exp +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_microtask.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_microtask.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var macrotask = __webpack_require__(/*! ./_task */ "./node_modules/core-js/modules/_task.js").set; +var Observer = global.MutationObserver || global.WebKitMutationObserver; +var process = global.process; +var Promise = global.Promise; +var isNode = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js")(process) == 'process'; + +module.exports = function () { + var head, last, notify; + + var flush = function () { + var parent, fn; + if (isNode && (parent = process.domain)) parent.exit(); + while (head) { + fn = head.fn; + head = head.next; + try { + fn(); + } catch (e) { + if (head) notify(); + else last = undefined; + throw e; + } + } last = undefined; + if (parent) parent.enter(); + }; + + // Node.js + if (isNode) { + notify = function () { + process.nextTick(flush); + }; + // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 + } else if (Observer && !(global.navigator && global.navigator.standalone)) { + var toggle = true; + var node = document.createTextNode(''); + new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new + notify = function () { + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if (Promise && Promise.resolve) { + // Promise.resolve without an argument throws an error in LG WebOS 2 + var promise = Promise.resolve(undefined); + notify = function () { + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function () { + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function (fn) { + var task = { fn: fn, next: undefined }; + if (last) last.next = task; + if (!head) { + head = task; + notify(); + } last = task; + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_new-promise-capability.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/modules/_new-promise-capability.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 25.4.1.5 NewPromiseCapability(C) +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); + +function PromiseCapability(C) { + var resolve, reject; + this.promise = new C(function ($$resolve, $$reject) { + if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +} + +module.exports.f = function (C) { + return new PromiseCapability(C); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-assign.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_object-assign.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var gOPS = __webpack_require__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); +var pIE = __webpack_require__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); +var $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + var A = {}; + var B = {}; + // eslint-disable-next-line no-undef + var S = Symbol(); + var K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function (k) { B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; +}) ? function assign(target, source) { // eslint-disable-line no-unused-vars + var T = toObject(target); + var aLen = arguments.length; + var index = 1; + var getSymbols = gOPS.f; + var isEnum = pIE.f; + while (aLen > index) { + var S = IObject(arguments[index++]); + var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); + var length = keys.length; + var j = 0; + var key; + while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; + } return T; +} : $assign; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-create.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_object-create.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var dPs = __webpack_require__(/*! ./_object-dps */ "./node_modules/core-js/modules/_object-dps.js"); +var enumBugKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/core-js/modules/_enum-bug-keys.js"); +var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/core-js/modules/_shared-key.js")('IE_PROTO'); +var Empty = function () { /* empty */ }; +var PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function () { + // Thrash, waste and sodomy: IE GC bug + var iframe = __webpack_require__(/*! ./_dom-create */ "./node_modules/core-js/modules/_dom-create.js")('iframe'); + var i = enumBugKeys.length; + var lt = '<'; + var gt = '>'; + var iframeDocument; + iframe.style.display = 'none'; + __webpack_require__(/*! ./_html */ "./node_modules/core-js/modules/_html.js").appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties) { + var result; + if (O !== null) { + Empty[PROTOTYPE] = anObject(O); + result = new Empty(); + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-dp.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-dp.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var IE8_DOM_DEFINE = __webpack_require__(/*! ./_ie8-dom-define */ "./node_modules/core-js/modules/_ie8-dom-define.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var dP = Object.defineProperty; + +exports.f = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? Object.defineProperty : function defineProperty(O, P, Attributes) { + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if (IE8_DOM_DEFINE) try { + return dP(O, P, Attributes); + } catch (e) { /* empty */ } + if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); + if ('value' in Attributes) O[P] = Attributes.value; + return O; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-dps.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-dps.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); + +module.exports = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? Object.defineProperties : function defineProperties(O, Properties) { + anObject(O); + var keys = getKeys(Properties); + var length = keys.length; + var i = 0; + var P; + while (length > i) dP.f(O, P = keys[i++], Properties[P]); + return O; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-forced-pam.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_object-forced-pam.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// Forced replacement prototype accessors methods +module.exports = __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js") || !__webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + var K = Math.random(); + // In FF throws only define methods + // eslint-disable-next-line no-undef, no-useless-call + __defineSetter__.call(null, K, function () { /* empty */ }); + delete __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js")[K]; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-gopd.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gopd.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var pIE = __webpack_require__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js"); +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var IE8_DOM_DEFINE = __webpack_require__(/*! ./_ie8-dom-define */ "./node_modules/core-js/modules/_ie8-dom-define.js"); +var gOPD = Object.getOwnPropertyDescriptor; + +exports.f = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? gOPD : function getOwnPropertyDescriptor(O, P) { + O = toIObject(O); + P = toPrimitive(P, true); + if (IE8_DOM_DEFINE) try { + return gOPD(O, P); + } catch (e) { /* empty */ } + if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-gopn-ext.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gopn-ext.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var gOPN = __webpack_require__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; +var toString = {}.toString; + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function (it) { + try { + return gOPN(it); + } catch (e) { + return windowNames.slice(); + } +}; + +module.exports.f = function getOwnPropertyNames(it) { + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-gopn.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gopn.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = __webpack_require__(/*! ./_object-keys-internal */ "./node_modules/core-js/modules/_object-keys-internal.js"); +var hiddenKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/core-js/modules/_enum-bug-keys.js").concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { + return $keys(O, hiddenKeys); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-gops.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gops.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +exports.f = Object.getOwnPropertySymbols; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-gpo.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-gpo.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/core-js/modules/_shared-key.js")('IE_PROTO'); +var ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function (O) { + O = toObject(O); + if (has(O, IE_PROTO)) return O[IE_PROTO]; + if (typeof O.constructor == 'function' && O instanceof O.constructor) { + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-keys-internal.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/_object-keys-internal.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var arrayIndexOf = __webpack_require__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js")(false); +var IE_PROTO = __webpack_require__(/*! ./_shared-key */ "./node_modules/core-js/modules/_shared-key.js")('IE_PROTO'); + +module.exports = function (object, names) { + var O = toIObject(object); + var i = 0; + var result = []; + var key; + for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while (names.length > i) if (has(O, key = names[i++])) { + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-keys.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_object-keys.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = __webpack_require__(/*! ./_object-keys-internal */ "./node_modules/core-js/modules/_object-keys-internal.js"); +var enumBugKeys = __webpack_require__(/*! ./_enum-bug-keys */ "./node_modules/core-js/modules/_enum-bug-keys.js"); + +module.exports = Object.keys || function keys(O) { + return $keys(O, enumBugKeys); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-pie.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-pie.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +exports.f = {}.propertyIsEnumerable; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-sap.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_object-sap.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// most Object methods by ES6 should accept primitives +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +module.exports = function (KEY, exec) { + var fn = (core.Object || {})[KEY] || Object[KEY]; + var exp = {}; + exp[KEY] = exec(fn); + $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_object-to-array.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_object-to-array.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var isEnum = __webpack_require__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js").f; +module.exports = function (isEntries) { + return function (it) { + var O = toIObject(it); + var keys = getKeys(O); + var length = keys.length; + var i = 0; + var result = []; + var key; + while (length > i) if (isEnum.call(O, key = keys[i++])) { + result.push(isEntries ? [key, O[key]] : O[key]); + } return result; + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_own-keys.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_own-keys.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// all object keys, includes non-enumerable and symbols +var gOPN = __webpack_require__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js"); +var gOPS = __webpack_require__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var Reflect = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Reflect; +module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { + var keys = gOPN.f(anObject(it)); + var getSymbols = gOPS.f; + return getSymbols ? keys.concat(getSymbols(it)) : keys; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_parse-float.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_parse-float.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $parseFloat = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").parseFloat; +var $trim = __webpack_require__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js").trim; + +module.exports = 1 / $parseFloat(__webpack_require__(/*! ./_string-ws */ "./node_modules/core-js/modules/_string-ws.js") + '-0') !== -Infinity ? function parseFloat(str) { + var string = $trim(String(str), 3); + var result = $parseFloat(string); + return result === 0 && string.charAt(0) == '-' ? -0 : result; +} : $parseFloat; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_parse-int.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_parse-int.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $parseInt = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").parseInt; +var $trim = __webpack_require__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js").trim; +var ws = __webpack_require__(/*! ./_string-ws */ "./node_modules/core-js/modules/_string-ws.js"); +var hex = /^[-+]?0[xX]/; + +module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { + var string = $trim(String(str), 3); + return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); +} : $parseInt; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_perform.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_perform.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (exec) { + try { + return { e: false, v: exec() }; + } catch (e) { + return { e: true, v: e }; + } +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_promise-resolve.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/_promise-resolve.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var newPromiseCapability = __webpack_require__(/*! ./_new-promise-capability */ "./node_modules/core-js/modules/_new-promise-capability.js"); + +module.exports = function (C, x) { + anObject(C); + if (isObject(x) && x.constructor === C) return x; + var promiseCapability = newPromiseCapability.f(C); + var resolve = promiseCapability.resolve; + resolve(x); + return promiseCapability.promise; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_property-desc.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_property-desc.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (bitmap, value) { + return { + enumerable: !(bitmap & 1), + configurable: !(bitmap & 2), + writable: !(bitmap & 4), + value: value + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_redefine-all.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/_redefine-all.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +module.exports = function (target, src, safe) { + for (var key in src) redefine(target, key, src[key], safe); + return target; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_redefine.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_redefine.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var SRC = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js")('src'); +var TO_STRING = 'toString'; +var $toString = Function[TO_STRING]; +var TPL = ('' + $toString).split(TO_STRING); + +__webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js").inspectSource = function (it) { + return $toString.call(it); +}; + +(module.exports = function (O, key, val, safe) { + var isFunction = typeof val == 'function'; + if (isFunction) has(val, 'name') || hide(val, 'name', key); + if (O[key] === val) return; + if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if (O === global) { + O[key] = val; + } else if (!safe) { + delete O[key]; + hide(O, key, val); + } else if (O[key]) { + O[key] = val; + } else { + hide(O, key, val); + } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, TO_STRING, function toString() { + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_replacer.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_replacer.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function (regExp, replace) { + var replacer = replace === Object(replace) ? function (part) { + return replace[part]; + } : replace; + return function (it) { + return String(it).replace(regExp, replacer); + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_same-value.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_same-value.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 7.2.9 SameValue(x, y) +module.exports = Object.is || function is(x, y) { + // eslint-disable-next-line no-self-compare + return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_set-collection-from.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_set-collection-from.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); + +module.exports = function (COLLECTION) { + $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { + var mapFn = arguments[1]; + var mapping, A, n, cb; + aFunction(this); + mapping = mapFn !== undefined; + if (mapping) aFunction(mapFn); + if (source == undefined) return new this(); + A = []; + if (mapping) { + n = 0; + cb = ctx(mapFn, arguments[2], 2); + forOf(source, false, function (nextItem) { + A.push(cb(nextItem, n++)); + }); + } else { + forOf(source, false, A.push, A); + } + return new this(A); + } }); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_set-collection-of.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_set-collection-of.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-setmap-offrom/ +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +module.exports = function (COLLECTION) { + $export($export.S, COLLECTION, { of: function of() { + var length = arguments.length; + var A = new Array(length); + while (length--) A[length] = arguments[length]; + return new this(A); + } }); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_set-proto.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_set-proto.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var check = function (O, proto) { + anObject(O); + if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); +}; +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function (test, buggy, set) { + try { + set = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js")(Function.call, __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch (e) { buggy = true; } + return function setPrototypeOf(O, proto) { + check(O, proto); + if (buggy) O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_set-species.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_set-species.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var SPECIES = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species'); + +module.exports = function (KEY) { + var C = global[KEY]; + if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { + configurable: true, + get: function () { return this; } + }); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_set-to-string-tag.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_set-to-string-tag.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var def = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var TAG = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toStringTag'); + +module.exports = function (it, tag, stat) { + if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_shared-key.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_shared-key.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var shared = __webpack_require__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('keys'); +var uid = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); +module.exports = function (key) { + return shared[key] || (shared[key] = uid(key)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_shared.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/_shared.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var SHARED = '__core-js_shared__'; +var store = global[SHARED] || (global[SHARED] = {}); + +(module.exports = function (key, value) { + return store[key] || (store[key] = value !== undefined ? value : {}); +})('versions', []).push({ + version: core.version, + mode: __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js") ? 'pure' : 'global', + copyright: '© 2018 Denis Pushkarev (zloirock.ru)' +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_species-constructor.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_species-constructor.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var SPECIES = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species'); +module.exports = function (O, D) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_strict-method.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_strict-method.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); + +module.exports = function (method, arg) { + return !!method && fails(function () { + // eslint-disable-next-line no-useless-call + arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); + }); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-at.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_string-at.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +// true -> String#at +// false -> String#codePointAt +module.exports = function (TO_STRING) { + return function (that, pos) { + var s = String(defined(that)); + var i = toInteger(pos); + var l = s.length; + var a, b; + if (i < 0 || i >= l) return TO_STRING ? '' : undefined; + a = s.charCodeAt(i); + return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff + ? TO_STRING ? s.charAt(i) : a + : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; + }; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-context.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/_string-context.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// helper for String#{startsWith, endsWith, includes} +var isRegExp = __webpack_require__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); + +module.exports = function (that, searchString, NAME) { + if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); + return String(defined(that)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-html.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_string-html.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +var quot = /"/g; +// B.2.3.2.1 CreateHTML(string, tag, attribute, value) +var createHTML = function (string, tag, attribute, value) { + var S = String(defined(string)); + var p1 = '<' + tag; + if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; + return p1 + '>' + S + ''; +}; +module.exports = function (NAME, exec) { + var O = {}; + O[NAME] = exec(createHTML); + $export($export.P + $export.F * fails(function () { + var test = ''[NAME]('"'); + return test !== test.toLowerCase() || test.split('"').length > 3; + }), 'String', O); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-pad.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_string-pad.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-string-pad-start-end +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var repeat = __webpack_require__(/*! ./_string-repeat */ "./node_modules/core-js/modules/_string-repeat.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); + +module.exports = function (that, maxLength, fillString, left) { + var S = String(defined(that)); + var stringLength = S.length; + var fillStr = fillString === undefined ? ' ' : String(fillString); + var intMaxLength = toLength(maxLength); + if (intMaxLength <= stringLength || fillStr == '') return S; + var fillLen = intMaxLength - stringLength; + var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); + if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); + return left ? stringFiller + S : S + stringFiller; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-repeat.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/_string-repeat.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); + +module.exports = function repeat(count) { + var str = String(defined(this)); + var res = ''; + var n = toInteger(count); + if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); + for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; + return res; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-trim.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_string-trim.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var spaces = __webpack_require__(/*! ./_string-ws */ "./node_modules/core-js/modules/_string-ws.js"); +var space = '[' + spaces + ']'; +var non = '\u200b\u0085'; +var ltrim = RegExp('^' + space + space + '*'); +var rtrim = RegExp(space + space + '*$'); + +var exporter = function (KEY, exec, ALIAS) { + var exp = {}; + var FORCE = fails(function () { + return !!spaces[KEY]() || non[KEY]() != non; + }); + var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; + if (ALIAS) exp[ALIAS] = fn; + $export($export.P + $export.F * FORCE, 'String', exp); +}; + +// 1 -> String#trimLeft +// 2 -> String#trimRight +// 3 -> String#trim +var trim = exporter.trim = function (string, TYPE) { + string = String(defined(string)); + if (TYPE & 1) string = string.replace(ltrim, ''); + if (TYPE & 2) string = string.replace(rtrim, ''); + return string; +}; + +module.exports = exporter; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_string-ws.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_string-ws.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + + '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_task.js": +/*!***********************************************!*\ + !*** ./node_modules/core-js/modules/_task.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var invoke = __webpack_require__(/*! ./_invoke */ "./node_modules/core-js/modules/_invoke.js"); +var html = __webpack_require__(/*! ./_html */ "./node_modules/core-js/modules/_html.js"); +var cel = __webpack_require__(/*! ./_dom-create */ "./node_modules/core-js/modules/_dom-create.js"); +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var process = global.process; +var setTask = global.setImmediate; +var clearTask = global.clearImmediate; +var MessageChannel = global.MessageChannel; +var Dispatch = global.Dispatch; +var counter = 0; +var queue = {}; +var ONREADYSTATECHANGE = 'onreadystatechange'; +var defer, channel, port; +var run = function () { + var id = +this; + // eslint-disable-next-line no-prototype-builtins + if (queue.hasOwnProperty(id)) { + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function (event) { + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if (!setTask || !clearTask) { + setTask = function setImmediate(fn) { + var args = []; + var i = 1; + while (arguments.length > i) args.push(arguments[i++]); + queue[++counter] = function () { + // eslint-disable-next-line no-new-func + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id) { + delete queue[id]; + }; + // Node.js 0.8- + if (__webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js")(process) == 'process') { + defer = function (id) { + process.nextTick(ctx(run, id, 1)); + }; + // Sphere (JS game engine) Dispatch API + } else if (Dispatch && Dispatch.now) { + defer = function (id) { + Dispatch.now(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if (MessageChannel) { + channel = new MessageChannel(); + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { + defer = function (id) { + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if (ONREADYSTATECHANGE in cel('script')) { + defer = function (id) { + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function (id) { + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-absolute-index.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/_to-absolute-index.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var max = Math.max; +var min = Math.min; +module.exports = function (index, length) { + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-index.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/modules/_to-index.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/ecma262/#sec-toindex +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +module.exports = function (it) { + if (it === undefined) return 0; + var number = toInteger(it); + var length = toLength(number); + if (number !== length) throw RangeError('Wrong length!'); + return length; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-integer.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_to-integer.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +// 7.1.4 ToInteger +var ceil = Math.ceil; +var floor = Math.floor; +module.exports = function (it) { + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-iobject.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_to-iobject.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = __webpack_require__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +module.exports = function (it) { + return IObject(defined(it)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-length.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_to-length.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.15 ToLength +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var min = Math.min; +module.exports = function (it) { + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-object.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/_to-object.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.13 ToObject(argument) +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +module.exports = function (it) { + return Object(defined(it)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_to-primitive.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/_to-primitive.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function (it, S) { + if (!isObject(it)) return it; + var fn, val; + if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; + if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; + throw TypeError("Can't convert object to primitive value"); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_typed-array.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/_typed-array.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +if (__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js")) { + var LIBRARY = __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); + var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); + var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); + var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + var $typed = __webpack_require__(/*! ./_typed */ "./node_modules/core-js/modules/_typed.js"); + var $buffer = __webpack_require__(/*! ./_typed-buffer */ "./node_modules/core-js/modules/_typed-buffer.js"); + var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); + var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); + var propertyDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); + var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); + var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); + var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); + var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); + var toIndex = __webpack_require__(/*! ./_to-index */ "./node_modules/core-js/modules/_to-index.js"); + var toAbsoluteIndex = __webpack_require__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); + var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); + var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); + var classof = __webpack_require__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); + var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); + var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); + var isArrayIter = __webpack_require__(/*! ./_is-array-iter */ "./node_modules/core-js/modules/_is-array-iter.js"); + var create = __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); + var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); + var gOPN = __webpack_require__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; + var getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ "./node_modules/core-js/modules/core.get-iterator-method.js"); + var uid = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); + var wks = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); + var createArrayMethod = __webpack_require__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js"); + var createArrayIncludes = __webpack_require__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js"); + var speciesConstructor = __webpack_require__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); + var ArrayIterators = __webpack_require__(/*! ./es6.array.iterator */ "./node_modules/core-js/modules/es6.array.iterator.js"); + var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); + var $iterDetect = __webpack_require__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js"); + var setSpecies = __webpack_require__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js"); + var arrayFill = __webpack_require__(/*! ./_array-fill */ "./node_modules/core-js/modules/_array-fill.js"); + var arrayCopyWithin = __webpack_require__(/*! ./_array-copy-within */ "./node_modules/core-js/modules/_array-copy-within.js"); + var $DP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); + var $GOPD = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); + var dP = $DP.f; + var gOPD = $GOPD.f; + var RangeError = global.RangeError; + var TypeError = global.TypeError; + var Uint8Array = global.Uint8Array; + var ARRAY_BUFFER = 'ArrayBuffer'; + var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; + var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; + var PROTOTYPE = 'prototype'; + var ArrayProto = Array[PROTOTYPE]; + var $ArrayBuffer = $buffer.ArrayBuffer; + var $DataView = $buffer.DataView; + var arrayForEach = createArrayMethod(0); + var arrayFilter = createArrayMethod(2); + var arraySome = createArrayMethod(3); + var arrayEvery = createArrayMethod(4); + var arrayFind = createArrayMethod(5); + var arrayFindIndex = createArrayMethod(6); + var arrayIncludes = createArrayIncludes(true); + var arrayIndexOf = createArrayIncludes(false); + var arrayValues = ArrayIterators.values; + var arrayKeys = ArrayIterators.keys; + var arrayEntries = ArrayIterators.entries; + var arrayLastIndexOf = ArrayProto.lastIndexOf; + var arrayReduce = ArrayProto.reduce; + var arrayReduceRight = ArrayProto.reduceRight; + var arrayJoin = ArrayProto.join; + var arraySort = ArrayProto.sort; + var arraySlice = ArrayProto.slice; + var arrayToString = ArrayProto.toString; + var arrayToLocaleString = ArrayProto.toLocaleString; + var ITERATOR = wks('iterator'); + var TAG = wks('toStringTag'); + var TYPED_CONSTRUCTOR = uid('typed_constructor'); + var DEF_CONSTRUCTOR = uid('def_constructor'); + var ALL_CONSTRUCTORS = $typed.CONSTR; + var TYPED_ARRAY = $typed.TYPED; + var VIEW = $typed.VIEW; + var WRONG_LENGTH = 'Wrong length!'; + + var $map = createArrayMethod(1, function (O, length) { + return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); + }); + + var LITTLE_ENDIAN = fails(function () { + // eslint-disable-next-line no-undef + return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; + }); + + var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { + new Uint8Array(1).set({}); + }); + + var toOffset = function (it, BYTES) { + var offset = toInteger(it); + if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); + return offset; + }; + + var validate = function (it) { + if (isObject(it) && TYPED_ARRAY in it) return it; + throw TypeError(it + ' is not a typed array!'); + }; + + var allocate = function (C, length) { + if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { + throw TypeError('It is not a typed array constructor!'); + } return new C(length); + }; + + var speciesFromList = function (O, list) { + return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); + }; + + var fromList = function (C, list) { + var index = 0; + var length = list.length; + var result = allocate(C, length); + while (length > index) result[index] = list[index++]; + return result; + }; + + var addGetter = function (it, key, internal) { + dP(it, key, { get: function () { return this._d[internal]; } }); + }; + + var $from = function from(source /* , mapfn, thisArg */) { + var O = toObject(source); + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var iterFn = getIterFn(O); + var i, length, values, result, step, iterator; + if (iterFn != undefined && !isArrayIter(iterFn)) { + for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { + values.push(step.value); + } O = values; + } + if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); + for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { + result[i] = mapping ? mapfn(O[i], i) : O[i]; + } + return result; + }; + + var $of = function of(/* ...items */) { + var index = 0; + var length = arguments.length; + var result = allocate(this, length); + while (length > index) result[index] = arguments[index++]; + return result; + }; + + // iOS Safari 6.x fails here + var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); + + var $toLocaleString = function toLocaleString() { + return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); + }; + + var proto = { + copyWithin: function copyWithin(target, start /* , end */) { + return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); + }, + every: function every(callbackfn /* , thisArg */) { + return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars + return arrayFill.apply(validate(this), arguments); + }, + filter: function filter(callbackfn /* , thisArg */) { + return speciesFromList(this, arrayFilter(validate(this), callbackfn, + arguments.length > 1 ? arguments[1] : undefined)); + }, + find: function find(predicate /* , thisArg */) { + return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + findIndex: function findIndex(predicate /* , thisArg */) { + return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); + }, + forEach: function forEach(callbackfn /* , thisArg */) { + arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + indexOf: function indexOf(searchElement /* , fromIndex */) { + return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + includes: function includes(searchElement /* , fromIndex */) { + return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); + }, + join: function join(separator) { // eslint-disable-line no-unused-vars + return arrayJoin.apply(validate(this), arguments); + }, + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars + return arrayLastIndexOf.apply(validate(this), arguments); + }, + map: function map(mapfn /* , thisArg */) { + return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); + }, + reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduce.apply(validate(this), arguments); + }, + reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars + return arrayReduceRight.apply(validate(this), arguments); + }, + reverse: function reverse() { + var that = this; + var length = validate(that).length; + var middle = Math.floor(length / 2); + var index = 0; + var value; + while (index < middle) { + value = that[index]; + that[index++] = that[--length]; + that[length] = value; + } return that; + }, + some: function some(callbackfn /* , thisArg */) { + return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); + }, + sort: function sort(comparefn) { + return arraySort.call(validate(this), comparefn); + }, + subarray: function subarray(begin, end) { + var O = validate(this); + var length = O.length; + var $begin = toAbsoluteIndex(begin, length); + return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( + O.buffer, + O.byteOffset + $begin * O.BYTES_PER_ELEMENT, + toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) + ); + } + }; + + var $slice = function slice(start, end) { + return speciesFromList(this, arraySlice.call(validate(this), start, end)); + }; + + var $set = function set(arrayLike /* , offset */) { + validate(this); + var offset = toOffset(arguments[1], 1); + var length = this.length; + var src = toObject(arrayLike); + var len = toLength(src.length); + var index = 0; + if (len + offset > length) throw RangeError(WRONG_LENGTH); + while (index < len) this[offset + index] = src[index++]; + }; + + var $iterators = { + entries: function entries() { + return arrayEntries.call(validate(this)); + }, + keys: function keys() { + return arrayKeys.call(validate(this)); + }, + values: function values() { + return arrayValues.call(validate(this)); + } + }; + + var isTAIndex = function (target, key) { + return isObject(target) + && target[TYPED_ARRAY] + && typeof key != 'symbol' + && key in target + && String(+key) == String(key); + }; + var $getDesc = function getOwnPropertyDescriptor(target, key) { + return isTAIndex(target, key = toPrimitive(key, true)) + ? propertyDesc(2, target[key]) + : gOPD(target, key); + }; + var $setDesc = function defineProperty(target, key, desc) { + if (isTAIndex(target, key = toPrimitive(key, true)) + && isObject(desc) + && has(desc, 'value') + && !has(desc, 'get') + && !has(desc, 'set') + // TODO: add validation descriptor w/o calling accessors + && !desc.configurable + && (!has(desc, 'writable') || desc.writable) + && (!has(desc, 'enumerable') || desc.enumerable) + ) { + target[key] = desc.value; + return target; + } return dP(target, key, desc); + }; + + if (!ALL_CONSTRUCTORS) { + $GOPD.f = $getDesc; + $DP.f = $setDesc; + } + + $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { + getOwnPropertyDescriptor: $getDesc, + defineProperty: $setDesc + }); + + if (fails(function () { arrayToString.call({}); })) { + arrayToString = arrayToLocaleString = function toString() { + return arrayJoin.call(this); + }; + } + + var $TypedArrayPrototype$ = redefineAll({}, proto); + redefineAll($TypedArrayPrototype$, $iterators); + hide($TypedArrayPrototype$, ITERATOR, $iterators.values); + redefineAll($TypedArrayPrototype$, { + slice: $slice, + set: $set, + constructor: function () { /* noop */ }, + toString: arrayToString, + toLocaleString: $toLocaleString + }); + addGetter($TypedArrayPrototype$, 'buffer', 'b'); + addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); + addGetter($TypedArrayPrototype$, 'byteLength', 'l'); + addGetter($TypedArrayPrototype$, 'length', 'e'); + dP($TypedArrayPrototype$, TAG, { + get: function () { return this[TYPED_ARRAY]; } + }); + + // eslint-disable-next-line max-statements + module.exports = function (KEY, BYTES, wrapper, CLAMPED) { + CLAMPED = !!CLAMPED; + var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; + var GETTER = 'get' + KEY; + var SETTER = 'set' + KEY; + var TypedArray = global[NAME]; + var Base = TypedArray || {}; + var TAC = TypedArray && getPrototypeOf(TypedArray); + var FORCED = !TypedArray || !$typed.ABV; + var O = {}; + var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; + var getter = function (that, index) { + var data = that._d; + return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); + }; + var setter = function (that, index, value) { + var data = that._d; + if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; + data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); + }; + var addElement = function (that, index) { + dP(that, index, { + get: function () { + return getter(this, index); + }, + set: function (value) { + return setter(this, index, value); + }, + enumerable: true + }); + }; + if (FORCED) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME, '_d'); + var index = 0; + var offset = 0; + var buffer, byteLength, length, klass; + if (!isObject(data)) { + length = toIndex(data); + byteLength = length * BYTES; + buffer = new $ArrayBuffer(byteLength); + } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + buffer = data; + offset = toOffset($offset, BYTES); + var $len = data.byteLength; + if ($length === undefined) { + if ($len % BYTES) throw RangeError(WRONG_LENGTH); + byteLength = $len - offset; + if (byteLength < 0) throw RangeError(WRONG_LENGTH); + } else { + byteLength = toLength($length) * BYTES; + if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); + } + length = byteLength / BYTES; + } else if (TYPED_ARRAY in data) { + return fromList(TypedArray, data); + } else { + return $from.call(TypedArray, data); + } + hide(that, '_d', { + b: buffer, + o: offset, + l: byteLength, + e: length, + v: new $DataView(buffer) + }); + while (index < length) addElement(that, index++); + }); + TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); + hide(TypedArrayPrototype, 'constructor', TypedArray); + } else if (!fails(function () { + TypedArray(1); + }) || !fails(function () { + new TypedArray(-1); // eslint-disable-line no-new + }) || !$iterDetect(function (iter) { + new TypedArray(); // eslint-disable-line no-new + new TypedArray(null); // eslint-disable-line no-new + new TypedArray(1.5); // eslint-disable-line no-new + new TypedArray(iter); // eslint-disable-line no-new + }, true)) { + TypedArray = wrapper(function (that, data, $offset, $length) { + anInstance(that, TypedArray, NAME); + var klass; + // `ws` module bug, temporarily remove validation length for Uint8Array + // https://github.com/websockets/ws/pull/645 + if (!isObject(data)) return new Base(toIndex(data)); + if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { + return $length !== undefined + ? new Base(data, toOffset($offset, BYTES), $length) + : $offset !== undefined + ? new Base(data, toOffset($offset, BYTES)) + : new Base(data); + } + if (TYPED_ARRAY in data) return fromList(TypedArray, data); + return $from.call(TypedArray, data); + }); + arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { + if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); + }); + TypedArray[PROTOTYPE] = TypedArrayPrototype; + if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; + } + var $nativeIterator = TypedArrayPrototype[ITERATOR]; + var CORRECT_ITER_NAME = !!$nativeIterator + && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); + var $iterator = $iterators.values; + hide(TypedArray, TYPED_CONSTRUCTOR, true); + hide(TypedArrayPrototype, TYPED_ARRAY, NAME); + hide(TypedArrayPrototype, VIEW, true); + hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); + + if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { + dP(TypedArrayPrototype, TAG, { + get: function () { return NAME; } + }); + } + + O[NAME] = TypedArray; + + $export($export.G + $export.W + $export.F * (TypedArray != Base), O); + + $export($export.S, NAME, { + BYTES_PER_ELEMENT: BYTES + }); + + $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { + from: $from, + of: $of + }); + + if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); + + $export($export.P, NAME, proto); + + setSpecies(NAME); + + $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); + + $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); + + if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; + + $export($export.P + $export.F * fails(function () { + new TypedArray(1).slice(); + }), NAME, { slice: $slice }); + + $export($export.P + $export.F * (fails(function () { + return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); + }) || !fails(function () { + TypedArrayPrototype.toLocaleString.call([1, 2]); + })), NAME, { toLocaleString: $toLocaleString }); + + Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; + if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); + }; +} else module.exports = function () { /* empty */ }; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_typed-buffer.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/_typed-buffer.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var LIBRARY = __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); +var $typed = __webpack_require__(/*! ./_typed */ "./node_modules/core-js/modules/_typed.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var toIndex = __webpack_require__(/*! ./_to-index */ "./node_modules/core-js/modules/_to-index.js"); +var gOPN = __webpack_require__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var arrayFill = __webpack_require__(/*! ./_array-fill */ "./node_modules/core-js/modules/_array-fill.js"); +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var ARRAY_BUFFER = 'ArrayBuffer'; +var DATA_VIEW = 'DataView'; +var PROTOTYPE = 'prototype'; +var WRONG_LENGTH = 'Wrong length!'; +var WRONG_INDEX = 'Wrong index!'; +var $ArrayBuffer = global[ARRAY_BUFFER]; +var $DataView = global[DATA_VIEW]; +var Math = global.Math; +var RangeError = global.RangeError; +// eslint-disable-next-line no-shadow-restricted-names +var Infinity = global.Infinity; +var BaseBuffer = $ArrayBuffer; +var abs = Math.abs; +var pow = Math.pow; +var floor = Math.floor; +var log = Math.log; +var LN2 = Math.LN2; +var BUFFER = 'buffer'; +var BYTE_LENGTH = 'byteLength'; +var BYTE_OFFSET = 'byteOffset'; +var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; +var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; +var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; + +// IEEE754 conversions based on https://github.com/feross/ieee754 +function packIEEE754(value, mLen, nBytes) { + var buffer = new Array(nBytes); + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; + var i = 0; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + var e, m, c; + value = abs(value); + // eslint-disable-next-line no-self-compare + if (value != value || value === Infinity) { + // eslint-disable-next-line no-self-compare + m = value != value ? 1 : 0; + e = eMax; + } else { + e = floor(log(value) / LN2); + if (value * (c = pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * pow(2, mLen); + e = e + eBias; + } else { + m = value * pow(2, eBias - 1) * pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); + buffer[--i] |= s * 128; + return buffer; +} +function unpackIEEE754(buffer, mLen, nBytes) { + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = eLen - 7; + var i = nBytes - 1; + var s = buffer[i--]; + var e = s & 127; + var m; + s >>= 7; + for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : s ? -Infinity : Infinity; + } else { + m = m + pow(2, mLen); + e = e - eBias; + } return (s ? -1 : 1) * m * pow(2, e - mLen); +} + +function unpackI32(bytes) { + return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; +} +function packI8(it) { + return [it & 0xff]; +} +function packI16(it) { + return [it & 0xff, it >> 8 & 0xff]; +} +function packI32(it) { + return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; +} +function packF64(it) { + return packIEEE754(it, 52, 8); +} +function packF32(it) { + return packIEEE754(it, 23, 4); +} + +function addGetter(C, key, internal) { + dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); +} + +function get(view, bytes, index, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = store.slice(start, start + bytes); + return isLittleEndian ? pack : pack.reverse(); +} +function set(view, bytes, index, conversion, value, isLittleEndian) { + var numIndex = +index; + var intIndex = toIndex(numIndex); + if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); + var store = view[$BUFFER]._b; + var start = intIndex + view[$OFFSET]; + var pack = conversion(+value); + for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; +} + +if (!$typed.ABV) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer, ARRAY_BUFFER); + var byteLength = toIndex(length); + this._b = arrayFill.call(new Array(byteLength), 0); + this[$LENGTH] = byteLength; + }; + + $DataView = function DataView(buffer, byteOffset, byteLength) { + anInstance(this, $DataView, DATA_VIEW); + anInstance(buffer, $ArrayBuffer, DATA_VIEW); + var bufferLength = buffer[$LENGTH]; + var offset = toInteger(byteOffset); + if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); + byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); + if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); + this[$BUFFER] = buffer; + this[$OFFSET] = offset; + this[$LENGTH] = byteLength; + }; + + if (DESCRIPTORS) { + addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); + addGetter($DataView, BUFFER, '_b'); + addGetter($DataView, BYTE_LENGTH, '_l'); + addGetter($DataView, BYTE_OFFSET, '_o'); + } + + redefineAll($DataView[PROTOTYPE], { + getInt8: function getInt8(byteOffset) { + return get(this, 1, byteOffset)[0] << 24 >> 24; + }, + getUint8: function getUint8(byteOffset) { + return get(this, 1, byteOffset)[0]; + }, + getInt16: function getInt16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return (bytes[1] << 8 | bytes[0]) << 16 >> 16; + }, + getUint16: function getUint16(byteOffset /* , littleEndian */) { + var bytes = get(this, 2, byteOffset, arguments[1]); + return bytes[1] << 8 | bytes[0]; + }, + getInt32: function getInt32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])); + }, + getUint32: function getUint32(byteOffset /* , littleEndian */) { + return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; + }, + getFloat32: function getFloat32(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); + }, + getFloat64: function getFloat64(byteOffset /* , littleEndian */) { + return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); + }, + setInt8: function setInt8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setUint8: function setUint8(byteOffset, value) { + set(this, 1, byteOffset, packI8, value); + }, + setInt16: function setInt16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setUint16: function setUint16(byteOffset, value /* , littleEndian */) { + set(this, 2, byteOffset, packI16, value, arguments[2]); + }, + setInt32: function setInt32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setUint32: function setUint32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packI32, value, arguments[2]); + }, + setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { + set(this, 4, byteOffset, packF32, value, arguments[2]); + }, + setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { + set(this, 8, byteOffset, packF64, value, arguments[2]); + } + }); +} else { + if (!fails(function () { + $ArrayBuffer(1); + }) || !fails(function () { + new $ArrayBuffer(-1); // eslint-disable-line no-new + }) || fails(function () { + new $ArrayBuffer(); // eslint-disable-line no-new + new $ArrayBuffer(1.5); // eslint-disable-line no-new + new $ArrayBuffer(NaN); // eslint-disable-line no-new + return $ArrayBuffer.name != ARRAY_BUFFER; + })) { + $ArrayBuffer = function ArrayBuffer(length) { + anInstance(this, $ArrayBuffer); + return new BaseBuffer(toIndex(length)); + }; + var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; + for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { + if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); + } + if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; + } + // iOS Safari 7.x bug + var view = new $DataView(new $ArrayBuffer(2)); + var $setInt8 = $DataView[PROTOTYPE].setInt8; + view.setInt8(0, 2147483648); + view.setInt8(1, 2147483649); + if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { + setInt8: function setInt8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + }, + setUint8: function setUint8(byteOffset, value) { + $setInt8.call(this, byteOffset, value << 24 >> 24); + } + }, true); +} +setToStringTag($ArrayBuffer, ARRAY_BUFFER); +setToStringTag($DataView, DATA_VIEW); +hide($DataView[PROTOTYPE], $typed.VIEW, true); +exports[ARRAY_BUFFER] = $ArrayBuffer; +exports[DATA_VIEW] = $DataView; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_typed.js": +/*!************************************************!*\ + !*** ./node_modules/core-js/modules/_typed.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var uid = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); +var TYPED = uid('typed_array'); +var VIEW = uid('view'); +var ABV = !!(global.ArrayBuffer && global.DataView); +var CONSTR = ABV; +var i = 0; +var l = 9; +var Typed; + +var TypedArrayConstructors = ( + 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' +).split(','); + +while (i < l) { + if (Typed = global[TypedArrayConstructors[i++]]) { + hide(Typed.prototype, TYPED, true); + hide(Typed.prototype, VIEW, true); + } else CONSTR = false; +} + +module.exports = { + ABV: ABV, + CONSTR: CONSTR, + TYPED: TYPED, + VIEW: VIEW +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_uid.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_uid.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var id = 0; +var px = Math.random(); +module.exports = function (key) { + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_user-agent.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_user-agent.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var navigator = global.navigator; + +module.exports = navigator && navigator.userAgent || ''; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_validate-collection.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/_validate-collection.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +module.exports = function (it, TYPE) { + if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); + return it; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_wks-define.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/_wks-define.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var LIBRARY = __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); +var wksExt = __webpack_require__(/*! ./_wks-ext */ "./node_modules/core-js/modules/_wks-ext.js"); +var defineProperty = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +module.exports = function (name) { + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_wks-ext.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/_wks-ext.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports.f = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/_wks.js": +/*!**********************************************!*\ + !*** ./node_modules/core-js/modules/_wks.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var store = __webpack_require__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js")('wks'); +var uid = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); +var Symbol = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Symbol; +var USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function (name) { + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/core.get-iterator-method.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/core.get-iterator-method.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var classof = __webpack_require__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var ITERATOR = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('iterator'); +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +module.exports = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js").getIteratorMethod = function (it) { + if (it != undefined) return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; + + +/***/ }), + +/***/ "./node_modules/core-js/modules/core.regexp.escape.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/core.regexp.escape.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/benjamingr/RexExp.escape +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $re = __webpack_require__(/*! ./_replacer */ "./node_modules/core-js/modules/_replacer.js")(/[\\^$*+?.()|[\]{}]/g, '\\$&'); + +$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.copy-within.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.copy-within.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.P, 'Array', { copyWithin: __webpack_require__(/*! ./_array-copy-within */ "./node_modules/core-js/modules/_array-copy-within.js") }); + +__webpack_require__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('copyWithin'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.every.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.every.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $every = __webpack_require__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(4); + +$export($export.P + $export.F * !__webpack_require__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].every, true), 'Array', { + // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) + every: function every(callbackfn /* , thisArg */) { + return $every(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.fill.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.fill.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.P, 'Array', { fill: __webpack_require__(/*! ./_array-fill */ "./node_modules/core-js/modules/_array-fill.js") }); + +__webpack_require__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('fill'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.filter.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.filter.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $filter = __webpack_require__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(2); + +$export($export.P + $export.F * !__webpack_require__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].filter, true), 'Array', { + // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) + filter: function filter(callbackfn /* , thisArg */) { + return $filter(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.find-index.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.find-index.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $find = __webpack_require__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(6); +var KEY = 'findIndex'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + findIndex: function findIndex(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +__webpack_require__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")(KEY); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.find.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.find.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $find = __webpack_require__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(5); +var KEY = 'find'; +var forced = true; +// Shouldn't skip holes +if (KEY in []) Array(1)[KEY](function () { forced = false; }); +$export($export.P + $export.F * forced, 'Array', { + find: function find(callbackfn /* , that = undefined */) { + return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); + } +}); +__webpack_require__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")(KEY); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.for-each.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.for-each.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $forEach = __webpack_require__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(0); +var STRICT = __webpack_require__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].forEach, true); + +$export($export.P + $export.F * !STRICT, 'Array', { + // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) + forEach: function forEach(callbackfn /* , thisArg */) { + return $forEach(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.from.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.from.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var call = __webpack_require__(/*! ./_iter-call */ "./node_modules/core-js/modules/_iter-call.js"); +var isArrayIter = __webpack_require__(/*! ./_is-array-iter */ "./node_modules/core-js/modules/_is-array-iter.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var createProperty = __webpack_require__(/*! ./_create-property */ "./node_modules/core-js/modules/_create-property.js"); +var getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ "./node_modules/core-js/modules/core.get-iterator-method.js"); + +$export($export.S + $export.F * !__webpack_require__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js")(function (iter) { Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { + var O = toObject(arrayLike); + var C = typeof this == 'function' ? this : Array; + var aLen = arguments.length; + var mapfn = aLen > 1 ? arguments[1] : undefined; + var mapping = mapfn !== undefined; + var index = 0; + var iterFn = getIterFn(O); + var length, result, step, iterator; + if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { + for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + for (result = new C(length); length > index; index++) { + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.index-of.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.index-of.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $indexOf = __webpack_require__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js")(false); +var $native = [].indexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")($native)), 'Array', { + // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) + indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { + return NEGATIVE_ZERO + // convert -0 to +0 + ? $native.apply(this, arguments) || 0 + : $indexOf(this, searchElement, arguments[1]); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.is-array.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.is-array.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 22.1.2.2 / 15.4.3.2 Array.isArray(arg) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Array', { isArray: __webpack_require__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.iterator.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.iterator.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var addToUnscopables = __webpack_require__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js"); +var step = __webpack_require__(/*! ./_iter-step */ "./node_modules/core-js/modules/_iter-step.js"); +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); + +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +module.exports = __webpack_require__(/*! ./_iter-define */ "./node_modules/core-js/modules/_iter-define.js")(Array, 'Array', function (iterated, kind) { + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function () { + var O = this._t; + var kind = this._k; + var index = this._i++; + if (!O || index >= O.length) { + this._t = undefined; + return step(1); + } + if (kind == 'keys') return step(0, index); + if (kind == 'values') return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +Iterators.Arguments = Iterators.Array; + +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.join.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.join.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 22.1.3.13 Array.prototype.join(separator) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var arrayJoin = [].join; + +// fallback for not array-like strings +$export($export.P + $export.F * (__webpack_require__(/*! ./_iobject */ "./node_modules/core-js/modules/_iobject.js") != Object || !__webpack_require__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")(arrayJoin)), 'Array', { + join: function join(separator) { + return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.last-index-of.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.last-index-of.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var $native = [].lastIndexOf; +var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; + +$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")($native)), 'Array', { + // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) + lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { + // convert -0 to +0 + if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; + var O = toIObject(this); + var length = toLength(O.length); + var index = length - 1; + if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); + if (index < 0) index = length + index; + for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; + return -1; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.map.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.map.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $map = __webpack_require__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(1); + +$export($export.P + $export.F * !__webpack_require__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].map, true), 'Array', { + // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) + map: function map(callbackfn /* , thisArg */) { + return $map(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.of.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.of.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var createProperty = __webpack_require__(/*! ./_create-property */ "./node_modules/core-js/modules/_create-property.js"); + +// WebKit Array.of isn't generic +$export($export.S + $export.F * __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + function F() { /* empty */ } + return !(Array.of.call(F) instanceof F); +}), 'Array', { + // 22.1.2.3 Array.of( ...items) + of: function of(/* ...args */) { + var index = 0; + var aLen = arguments.length; + var result = new (typeof this == 'function' ? this : Array)(aLen); + while (aLen > index) createProperty(result, index, arguments[index++]); + result.length = aLen; + return result; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.reduce-right.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.reduce-right.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $reduce = __webpack_require__(/*! ./_array-reduce */ "./node_modules/core-js/modules/_array-reduce.js"); + +$export($export.P + $export.F * !__webpack_require__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].reduceRight, true), 'Array', { + // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) + reduceRight: function reduceRight(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], true); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.reduce.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.reduce.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $reduce = __webpack_require__(/*! ./_array-reduce */ "./node_modules/core-js/modules/_array-reduce.js"); + +$export($export.P + $export.F * !__webpack_require__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].reduce, true), 'Array', { + // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) + reduce: function reduce(callbackfn /* , initialValue */) { + return $reduce(this, callbackfn, arguments.length, arguments[1], false); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.slice.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.slice.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var html = __webpack_require__(/*! ./_html */ "./node_modules/core-js/modules/_html.js"); +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +var toAbsoluteIndex = __webpack_require__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var arraySlice = [].slice; + +// fallback for not array-like ES3 strings and DOM objects +$export($export.P + $export.F * __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + if (html) arraySlice.call(html); +}), 'Array', { + slice: function slice(begin, end) { + var len = toLength(this.length); + var klass = cof(this); + end = end === undefined ? len : end; + if (klass == 'Array') return arraySlice.call(this, begin, end); + var start = toAbsoluteIndex(begin, len); + var upTo = toAbsoluteIndex(end, len); + var size = toLength(upTo - start); + var cloned = new Array(size); + var i = 0; + for (; i < size; i++) cloned[i] = klass == 'String' + ? this.charAt(start + i) + : this[start + i]; + return cloned; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.some.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.some.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $some = __webpack_require__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(3); + +$export($export.P + $export.F * !__webpack_require__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")([].some, true), 'Array', { + // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) + some: function some(callbackfn /* , thisArg */) { + return $some(this, callbackfn, arguments[1]); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.sort.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.sort.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var $sort = [].sort; +var test = [1, 2, 3]; + +$export($export.P + $export.F * (fails(function () { + // IE8- + test.sort(undefined); +}) || !fails(function () { + // V8 bug + test.sort(null); + // Old WebKit +}) || !__webpack_require__(/*! ./_strict-method */ "./node_modules/core-js/modules/_strict-method.js")($sort)), 'Array', { + // 22.1.3.25 Array.prototype.sort(comparefn) + sort: function sort(comparefn) { + return comparefn === undefined + ? $sort.call(toObject(this)) + : $sort.call(toObject(this), aFunction(comparefn)); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.array.species.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.array.species.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")('Array'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.date.now.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.date.now.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.3.3.1 / 15.9.4.4 Date.now() +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.date.to-iso-string.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.date.to-iso-string.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toISOString = __webpack_require__(/*! ./_date-to-iso-string */ "./node_modules/core-js/modules/_date-to-iso-string.js"); + +// PhantomJS / old WebKit has a broken implementations +$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { + toISOString: toISOString +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.date.to-json.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.date.to-json.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); + +$export($export.P + $export.F * __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return new Date(NaN).toJSON() !== null + || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; +}), 'Date', { + // eslint-disable-next-line no-unused-vars + toJSON: function toJSON(key) { + var O = toObject(this); + var pv = toPrimitive(O); + return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.date.to-primitive.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.date.to-primitive.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var TO_PRIMITIVE = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toPrimitive'); +var proto = Date.prototype; + +if (!(TO_PRIMITIVE in proto)) __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")(proto, TO_PRIMITIVE, __webpack_require__(/*! ./_date-to-primitive */ "./node_modules/core-js/modules/_date-to-primitive.js")); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.date.to-string.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.date.to-string.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var DateProto = Date.prototype; +var INVALID_DATE = 'Invalid Date'; +var TO_STRING = 'toString'; +var $toString = DateProto[TO_STRING]; +var getTime = DateProto.getTime; +if (new Date(NaN) + '' != INVALID_DATE) { + __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(DateProto, TO_STRING, function toString() { + var value = getTime.call(this); + // eslint-disable-next-line no-self-compare + return value === value ? $toString.call(this) : INVALID_DATE; + }); +} + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.function.bind.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.function.bind.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.P, 'Function', { bind: __webpack_require__(/*! ./_bind */ "./node_modules/core-js/modules/_bind.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.function.has-instance.js": +/*!*******************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.function.has-instance.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var HAS_INSTANCE = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('hasInstance'); +var FunctionProto = Function.prototype; +// 19.2.3.6 Function.prototype[@@hasInstance](V) +if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f(FunctionProto, HAS_INSTANCE, { value: function (O) { + if (typeof this != 'function' || !isObject(O)) return false; + if (!isObject(this.prototype)) return O instanceof this; + // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: + while (O = getPrototypeOf(O)) if (this.prototype === O) return true; + return false; +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.function.name.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.function.name.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var FProto = Function.prototype; +var nameRE = /^\s*function ([^ (]*)/; +var NAME = 'name'; + +// 19.2.4.2 name +NAME in FProto || __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && dP(FProto, NAME, { + configurable: true, + get: function () { + try { + return ('' + this).match(nameRE)[1]; + } catch (e) { + return ''; + } + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.map.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/es6.map.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var strong = __webpack_require__(/*! ./_collection-strong */ "./node_modules/core-js/modules/_collection-strong.js"); +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var MAP = 'Map'; + +// 23.1 Map Objects +module.exports = __webpack_require__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(MAP, function (get) { + return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key) { + var entry = strong.getEntry(validate(this, MAP), key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value) { + return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); + } +}, strong, true); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.acosh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.acosh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.3 Math.acosh(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var log1p = __webpack_require__(/*! ./_math-log1p */ "./node_modules/core-js/modules/_math-log1p.js"); +var sqrt = Math.sqrt; +var $acosh = Math.acosh; + +$export($export.S + $export.F * !($acosh + // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 + && Math.floor($acosh(Number.MAX_VALUE)) == 710 + // Tor Browser bug: Math.acosh(Infinity) -> NaN + && $acosh(Infinity) == Infinity +), 'Math', { + acosh: function acosh(x) { + return (x = +x) < 1 ? NaN : x > 94906265.62425156 + ? Math.log(x) + Math.LN2 + : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.asinh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.asinh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.5 Math.asinh(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $asinh = Math.asinh; + +function asinh(x) { + return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); +} + +// Tor Browser bug: Math.asinh(0) -> -0 +$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.atanh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.atanh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.7 Math.atanh(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $atanh = Math.atanh; + +// Tor Browser bug: Math.atanh(-0) -> 0 +$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { + atanh: function atanh(x) { + return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.cbrt.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.cbrt.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.9 Math.cbrt(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var sign = __webpack_require__(/*! ./_math-sign */ "./node_modules/core-js/modules/_math-sign.js"); + +$export($export.S, 'Math', { + cbrt: function cbrt(x) { + return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.clz32.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.clz32.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.11 Math.clz32(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { + clz32: function clz32(x) { + return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.cosh.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.cosh.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.12 Math.cosh(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var exp = Math.exp; + +$export($export.S, 'Math', { + cosh: function cosh(x) { + return (exp(x = +x) + exp(-x)) / 2; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.expm1.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.expm1.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.14 Math.expm1(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $expm1 = __webpack_require__(/*! ./_math-expm1 */ "./node_modules/core-js/modules/_math-expm1.js"); + +$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.fround.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.fround.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.16 Math.fround(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { fround: __webpack_require__(/*! ./_math-fround */ "./node_modules/core-js/modules/_math-fround.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.hypot.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.hypot.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.17 Math.hypot([value1[, value2[, … ]]]) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var abs = Math.abs; + +$export($export.S, 'Math', { + hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars + var sum = 0; + var i = 0; + var aLen = arguments.length; + var larg = 0; + var arg, div; + while (i < aLen) { + arg = abs(arguments[i++]); + if (larg < arg) { + div = larg / arg; + sum = sum * div * div + 1; + larg = arg; + } else if (arg > 0) { + div = arg / larg; + sum += div * div; + } else sum += arg; + } + return larg === Infinity ? Infinity : larg * Math.sqrt(sum); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.imul.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.imul.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.18 Math.imul(x, y) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $imul = Math.imul; + +// some WebKit versions fails with big numbers, some has wrong arity +$export($export.S + $export.F * __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return $imul(0xffffffff, 5) != -5 || $imul.length != 2; +}), 'Math', { + imul: function imul(x, y) { + var UINT16 = 0xffff; + var xn = +x; + var yn = +y; + var xl = UINT16 & xn; + var yl = UINT16 & yn; + return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.log10.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.log10.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.21 Math.log10(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { + log10: function log10(x) { + return Math.log(x) * Math.LOG10E; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.log1p.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.log1p.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.20 Math.log1p(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { log1p: __webpack_require__(/*! ./_math-log1p */ "./node_modules/core-js/modules/_math-log1p.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.log2.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.log2.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.22 Math.log2(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { + log2: function log2(x) { + return Math.log(x) / Math.LN2; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.sign.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.sign.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.28 Math.sign(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { sign: __webpack_require__(/*! ./_math-sign */ "./node_modules/core-js/modules/_math-sign.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.sinh.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.sinh.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.30 Math.sinh(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var expm1 = __webpack_require__(/*! ./_math-expm1 */ "./node_modules/core-js/modules/_math-expm1.js"); +var exp = Math.exp; + +// V8 near Chromium 38 has a problem with very small numbers +$export($export.S + $export.F * __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return !Math.sinh(-2e-17) != -2e-17; +}), 'Math', { + sinh: function sinh(x) { + return Math.abs(x = +x) < 1 + ? (expm1(x) - expm1(-x)) / 2 + : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.tanh.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.tanh.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.33 Math.tanh(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var expm1 = __webpack_require__(/*! ./_math-expm1 */ "./node_modules/core-js/modules/_math-expm1.js"); +var exp = Math.exp; + +$export($export.S, 'Math', { + tanh: function tanh(x) { + var a = expm1(x = +x); + var b = expm1(-x); + return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.math.trunc.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.math.trunc.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.2.2.34 Math.trunc(x) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { + trunc: function trunc(it) { + return (it > 0 ? Math.floor : Math.ceil)(it); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.number.constructor.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.constructor.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); +var inheritIfRequired = __webpack_require__(/*! ./_inherit-if-required */ "./node_modules/core-js/modules/_inherit-if-required.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var gOPN = __webpack_require__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; +var gOPD = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var $trim = __webpack_require__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js").trim; +var NUMBER = 'Number'; +var $Number = global[NUMBER]; +var Base = $Number; +var proto = $Number.prototype; +// Opera ~12 has broken Object#toString +var BROKEN_COF = cof(__webpack_require__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js")(proto)) == NUMBER; +var TRIM = 'trim' in String.prototype; + +// 7.1.3 ToNumber(argument) +var toNumber = function (argument) { + var it = toPrimitive(argument, false); + if (typeof it == 'string' && it.length > 2) { + it = TRIM ? it.trim() : $trim(it, 3); + var first = it.charCodeAt(0); + var third, radix, maxCode; + if (first === 43 || first === 45) { + third = it.charCodeAt(2); + if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix + } else if (first === 48) { + switch (it.charCodeAt(1)) { + case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i + case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i + default: return +it; + } + for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { + code = digits.charCodeAt(i); + // parseInt parses a string to a first unavailable symbol + // but ToNumber should return NaN if a string contains unavailable symbols + if (code < 48 || code > maxCode) return NaN; + } return parseInt(digits, radix); + } + } return +it; +}; + +if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { + $Number = function Number(value) { + var it = arguments.length < 1 ? 0 : value; + var that = this; + return that instanceof $Number + // check on 1..constructor(foo) case + && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) + ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); + }; + for (var keys = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") ? gOPN(Base) : ( + // ES3: + 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + + // ES6 (in case, if modules with ES6 Number statics required before): + 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + + 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' + ).split(','), j = 0, key; keys.length > j; j++) { + if (has(Base, key = keys[j]) && !has($Number, key)) { + dP($Number, key, gOPD(Base, key)); + } + } + $Number.prototype = proto; + proto.constructor = $Number; + __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(global, NUMBER, $Number); +} + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.number.epsilon.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.epsilon.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.1 Number.EPSILON +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.number.is-finite.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.is-finite.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.2 Number.isFinite(number) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var _isFinite = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").isFinite; + +$export($export.S, 'Number', { + isFinite: function isFinite(it) { + return typeof it == 'number' && _isFinite(it); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.number.is-integer.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.is-integer.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.3 Number.isInteger(number) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Number', { isInteger: __webpack_require__(/*! ./_is-integer */ "./node_modules/core-js/modules/_is-integer.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.number.is-nan.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.is-nan.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.4 Number.isNaN(number) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Number', { + isNaN: function isNaN(number) { + // eslint-disable-next-line no-self-compare + return number != number; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.number.is-safe-integer.js": +/*!********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.is-safe-integer.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.5 Number.isSafeInteger(number) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var isInteger = __webpack_require__(/*! ./_is-integer */ "./node_modules/core-js/modules/_is-integer.js"); +var abs = Math.abs; + +$export($export.S, 'Number', { + isSafeInteger: function isSafeInteger(number) { + return isInteger(number) && abs(number) <= 0x1fffffffffffff; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.number.max-safe-integer.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.max-safe-integer.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.6 Number.MAX_SAFE_INTEGER +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.number.min-safe-integer.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.min-safe-integer.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 20.1.2.10 Number.MIN_SAFE_INTEGER +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.number.parse-float.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.parse-float.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $parseFloat = __webpack_require__(/*! ./_parse-float */ "./node_modules/core-js/modules/_parse-float.js"); +// 20.1.2.12 Number.parseFloat(string) +$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.number.parse-int.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.parse-int.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $parseInt = __webpack_require__(/*! ./_parse-int */ "./node_modules/core-js/modules/_parse-int.js"); +// 20.1.2.13 Number.parseInt(string, radix) +$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.number.to-fixed.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.to-fixed.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var aNumberValue = __webpack_require__(/*! ./_a-number-value */ "./node_modules/core-js/modules/_a-number-value.js"); +var repeat = __webpack_require__(/*! ./_string-repeat */ "./node_modules/core-js/modules/_string-repeat.js"); +var $toFixed = 1.0.toFixed; +var floor = Math.floor; +var data = [0, 0, 0, 0, 0, 0]; +var ERROR = 'Number.toFixed: incorrect invocation!'; +var ZERO = '0'; + +var multiply = function (n, c) { + var i = -1; + var c2 = c; + while (++i < 6) { + c2 += n * data[i]; + data[i] = c2 % 1e7; + c2 = floor(c2 / 1e7); + } +}; +var divide = function (n) { + var i = 6; + var c = 0; + while (--i >= 0) { + c += data[i]; + data[i] = floor(c / n); + c = (c % n) * 1e7; + } +}; +var numToString = function () { + var i = 6; + var s = ''; + while (--i >= 0) { + if (s !== '' || i === 0 || data[i] !== 0) { + var t = String(data[i]); + s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; + } + } return s; +}; +var pow = function (x, n, acc) { + return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); +}; +var log = function (x) { + var n = 0; + var x2 = x; + while (x2 >= 4096) { + n += 12; + x2 /= 4096; + } + while (x2 >= 2) { + n += 1; + x2 /= 2; + } return n; +}; + +$export($export.P + $export.F * (!!$toFixed && ( + 0.00008.toFixed(3) !== '0.000' || + 0.9.toFixed(0) !== '1' || + 1.255.toFixed(2) !== '1.25' || + 1000000000000000128.0.toFixed(0) !== '1000000000000000128' +) || !__webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + // V8 ~ Android 4.3- + $toFixed.call({}); +})), 'Number', { + toFixed: function toFixed(fractionDigits) { + var x = aNumberValue(this, ERROR); + var f = toInteger(fractionDigits); + var s = ''; + var m = ZERO; + var e, z, j, k; + if (f < 0 || f > 20) throw RangeError(ERROR); + // eslint-disable-next-line no-self-compare + if (x != x) return 'NaN'; + if (x <= -1e21 || x >= 1e21) return String(x); + if (x < 0) { + s = '-'; + x = -x; + } + if (x > 1e-21) { + e = log(x * pow(2, 69, 1)) - 69; + z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); + z *= 0x10000000000000; + e = 52 - e; + if (e > 0) { + multiply(0, z); + j = f; + while (j >= 7) { + multiply(1e7, 0); + j -= 7; + } + multiply(pow(10, j, 1), 0); + j = e - 1; + while (j >= 23) { + divide(1 << 23); + j -= 23; + } + divide(1 << j); + multiply(1, 1); + divide(2); + m = numToString(); + } else { + multiply(0, z); + multiply(1 << -e, 0); + m = numToString() + repeat.call(ZERO, f); + } + } + if (f > 0) { + k = m.length; + m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); + } else { + m = s + m; + } return m; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.number.to-precision.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.number.to-precision.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var aNumberValue = __webpack_require__(/*! ./_a-number-value */ "./node_modules/core-js/modules/_a-number-value.js"); +var $toPrecision = 1.0.toPrecision; + +$export($export.P + $export.F * ($fails(function () { + // IE7- + return $toPrecision.call(1, undefined) !== '1'; +}) || !$fails(function () { + // V8 ~ Android 4.3- + $toPrecision.call({}); +})), 'Number', { + toPrecision: function toPrecision(precision) { + var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); + return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.assign.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.assign.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.1 Object.assign(target, source) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S + $export.F, 'Object', { assign: __webpack_require__(/*! ./_object-assign */ "./node_modules/core-js/modules/_object-assign.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.create.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.create.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +$export($export.S, 'Object', { create: __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.define-properties.js": +/*!**********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.define-properties.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) +$export($export.S + $export.F * !__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"), 'Object', { defineProperties: __webpack_require__(/*! ./_object-dps */ "./node_modules/core-js/modules/_object-dps.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.define-property.js": +/*!********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.define-property.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) +$export($export.S + $export.F * !__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"), 'Object', { defineProperty: __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.freeze.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.freeze.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.5 Object.freeze(O) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var meta = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").onFreeze; + +__webpack_require__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('freeze', function ($freeze) { + return function freeze(it) { + return $freeze && isObject(it) ? $freeze(meta(it)) : it; + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js": +/*!********************************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var $getOwnPropertyDescriptor = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; + +__webpack_require__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('getOwnPropertyDescriptor', function () { + return function getOwnPropertyDescriptor(it, key) { + return $getOwnPropertyDescriptor(toIObject(it), key); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.get-own-property-names.js": +/*!***************************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.get-own-property-names.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.7 Object.getOwnPropertyNames(O) +__webpack_require__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('getOwnPropertyNames', function () { + return __webpack_require__(/*! ./_object-gopn-ext */ "./node_modules/core-js/modules/_object-gopn-ext.js").f; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.get-prototype-of.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.get-prototype-of.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.9 Object.getPrototypeOf(O) +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var $getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); + +__webpack_require__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('getPrototypeOf', function () { + return function getPrototypeOf(it) { + return $getPrototypeOf(toObject(it)); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.is-extensible.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.is-extensible.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.11 Object.isExtensible(O) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); + +__webpack_require__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('isExtensible', function ($isExtensible) { + return function isExtensible(it) { + return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false; + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.is-frozen.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.is-frozen.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.12 Object.isFrozen(O) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); + +__webpack_require__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('isFrozen', function ($isFrozen) { + return function isFrozen(it) { + return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.is-sealed.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.is-sealed.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.13 Object.isSealed(O) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); + +__webpack_require__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('isSealed', function ($isSealed) { + return function isSealed(it) { + return isObject(it) ? $isSealed ? $isSealed(it) : false : true; + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.is.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.is.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.10 Object.is(value1, value2) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +$export($export.S, 'Object', { is: __webpack_require__(/*! ./_same-value */ "./node_modules/core-js/modules/_same-value.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.keys.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.keys.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.14 Object.keys(O) +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var $keys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); + +__webpack_require__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('keys', function () { + return function keys(it) { + return $keys(toObject(it)); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.prevent-extensions.js": +/*!***********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.prevent-extensions.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.15 Object.preventExtensions(O) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var meta = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").onFreeze; + +__webpack_require__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('preventExtensions', function ($preventExtensions) { + return function preventExtensions(it) { + return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.seal.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.seal.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.2.17 Object.seal(O) +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var meta = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").onFreeze; + +__webpack_require__(/*! ./_object-sap */ "./node_modules/core-js/modules/_object-sap.js")('seal', function ($seal) { + return function seal(it) { + return $seal && isObject(it) ? $seal(meta(it)) : it; + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.set-prototype-of.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.set-prototype-of.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(/*! ./_set-proto */ "./node_modules/core-js/modules/_set-proto.js").set }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.object.to-string.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.object.to-string.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 19.1.3.6 Object.prototype.toString() +var classof = __webpack_require__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var test = {}; +test[__webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('toStringTag')] = 'z'; +if (test + '' != '[object z]') { + __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(Object.prototype, 'toString', function toString() { + return '[object ' + classof(this) + ']'; + }, true); +} + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.parse-float.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.parse-float.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $parseFloat = __webpack_require__(/*! ./_parse-float */ "./node_modules/core-js/modules/_parse-float.js"); +// 18.2.4 parseFloat(string) +$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.parse-int.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.parse-int.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $parseInt = __webpack_require__(/*! ./_parse-int */ "./node_modules/core-js/modules/_parse-int.js"); +// 18.2.5 parseInt(string, radix) +$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.promise.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/modules/es6.promise.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var LIBRARY = __webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js"); +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var ctx = __webpack_require__(/*! ./_ctx */ "./node_modules/core-js/modules/_ctx.js"); +var classof = __webpack_require__(/*! ./_classof */ "./node_modules/core-js/modules/_classof.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var speciesConstructor = __webpack_require__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); +var task = __webpack_require__(/*! ./_task */ "./node_modules/core-js/modules/_task.js").set; +var microtask = __webpack_require__(/*! ./_microtask */ "./node_modules/core-js/modules/_microtask.js")(); +var newPromiseCapabilityModule = __webpack_require__(/*! ./_new-promise-capability */ "./node_modules/core-js/modules/_new-promise-capability.js"); +var perform = __webpack_require__(/*! ./_perform */ "./node_modules/core-js/modules/_perform.js"); +var userAgent = __webpack_require__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); +var promiseResolve = __webpack_require__(/*! ./_promise-resolve */ "./node_modules/core-js/modules/_promise-resolve.js"); +var PROMISE = 'Promise'; +var TypeError = global.TypeError; +var process = global.process; +var versions = process && process.versions; +var v8 = versions && versions.v8 || ''; +var $Promise = global[PROMISE]; +var isNode = classof(process) == 'process'; +var empty = function () { /* empty */ }; +var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; +var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; + +var USE_NATIVE = !!function () { + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1); + var FakePromise = (promise.constructor = {})[__webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('species')] = function (exec) { + exec(empty, empty); + }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') + && promise.then(empty) instanceof FakePromise + // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables + // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 + // we can't detect it synchronously, so just check versions + && v8.indexOf('6.6') !== 0 + && userAgent.indexOf('Chrome/66') === -1; + } catch (e) { /* empty */ } +}(); + +// helpers +var isThenable = function (it) { + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var notify = function (promise, isReject) { + if (promise._n) return; + promise._n = true; + var chain = promise._c; + microtask(function () { + var value = promise._v; + var ok = promise._s == 1; + var i = 0; + var run = function (reaction) { + var handler = ok ? reaction.ok : reaction.fail; + var resolve = reaction.resolve; + var reject = reaction.reject; + var domain = reaction.domain; + var result, then, exited; + try { + if (handler) { + if (!ok) { + if (promise._h == 2) onHandleUnhandled(promise); + promise._h = 1; + } + if (handler === true) result = value; + else { + if (domain) domain.enter(); + result = handler(value); // may throw + if (domain) { + domain.exit(); + exited = true; + } + } + if (result === reaction.promise) { + reject(TypeError('Promise-chain cycle')); + } else if (then = isThenable(result)) { + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch (e) { + if (domain && !exited) domain.exit(); + reject(e); + } + }; + while (chain.length > i) run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if (isReject && !promise._h) onUnhandled(promise); + }); +}; +var onUnhandled = function (promise) { + task.call(global, function () { + var value = promise._v; + var unhandled = isUnhandled(promise); + var result, handler, console; + if (unhandled) { + result = perform(function () { + if (isNode) { + process.emit('unhandledRejection', value, promise); + } else if (handler = global.onunhandledrejection) { + handler({ promise: promise, reason: value }); + } else if ((console = global.console) && console.error) { + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if (unhandled && result.e) throw result.v; + }); +}; +var isUnhandled = function (promise) { + return promise._h !== 1 && (promise._a || promise._c).length === 0; +}; +var onHandleUnhandled = function (promise) { + task.call(global, function () { + var handler; + if (isNode) { + process.emit('rejectionHandled', promise); + } else if (handler = global.onrejectionhandled) { + handler({ promise: promise, reason: promise._v }); + } + }); +}; +var $reject = function (value) { + var promise = this; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if (!promise._a) promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function (value) { + var promise = this; + var then; + if (promise._d) return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if (promise === value) throw TypeError("Promise can't be resolved itself"); + if (then = isThenable(value)) { + microtask(function () { + var wrapper = { _w: promise, _d: false }; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch (e) { + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch (e) { + $reject.call({ _w: promise, _d: false }, e); // wrap + } +}; + +// constructor polyfill +if (!USE_NATIVE) { + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor) { + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch (err) { + $reject.call(this, err); + } + }; + // eslint-disable-next-line no-unused-vars + Internal = function Promise(executor) { + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = __webpack_require__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js")($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected) { + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if (this._a) this._a.push(reaction); + if (this._s) notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function (onRejected) { + return this.then(undefined, onRejected); + } + }); + OwnPromiseCapability = function () { + var promise = new Internal(); + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; + newPromiseCapabilityModule.f = newPromiseCapability = function (C) { + return C === $Promise || C === Wrapper + ? new OwnPromiseCapability(C) + : newGenericPromiseCapability(C); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); +__webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js")($Promise, PROMISE); +__webpack_require__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")(PROMISE); +Wrapper = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js")[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r) { + var capability = newPromiseCapability(this); + var $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x) { + return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); + } +}); +$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(/*! ./_iter-detect */ "./node_modules/core-js/modules/_iter-detect.js")(function (iter) { + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var resolve = capability.resolve; + var reject = capability.reject; + var result = perform(function () { + var values = []; + var index = 0; + var remaining = 1; + forOf(iterable, false, function (promise) { + var $index = index++; + var alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function (value) { + if (alreadyCalled) return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if (result.e) reject(result.v); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable) { + var C = this; + var capability = newPromiseCapability(C); + var reject = capability.reject; + var result = perform(function () { + forOf(iterable, false, function (promise) { + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if (result.e) reject(result.v); + return capability.promise; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.apply.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.apply.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.1 Reflect.apply(target, thisArgument, argumentsList) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var rApply = (__webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Reflect || {}).apply; +var fApply = Function.apply; +// MS Edge argumentsList argument is optional +$export($export.S + $export.F * !__webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + rApply(function () { /* empty */ }); +}), 'Reflect', { + apply: function apply(target, thisArgument, argumentsList) { + var T = aFunction(target); + var L = anObject(argumentsList); + return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.construct.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.construct.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var create = __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var bind = __webpack_require__(/*! ./_bind */ "./node_modules/core-js/modules/_bind.js"); +var rConstruct = (__webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").Reflect || {}).construct; + +// MS Edge supports only 2 arguments and argumentsList argument is optional +// FF Nightly sets third argument as `new.target`, but does not create `this` from it +var NEW_TARGET_BUG = fails(function () { + function F() { /* empty */ } + return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); +}); +var ARGS_BUG = !fails(function () { + rConstruct(function () { /* empty */ }); +}); + +$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { + construct: function construct(Target, args /* , newTarget */) { + aFunction(Target); + anObject(args); + var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); + if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); + if (Target == newTarget) { + // w/o altered newTarget, optimization for 0-4 arguments + switch (args.length) { + case 0: return new Target(); + case 1: return new Target(args[0]); + case 2: return new Target(args[0], args[1]); + case 3: return new Target(args[0], args[1], args[2]); + case 4: return new Target(args[0], args[1], args[2], args[3]); + } + // w/o altered newTarget, lot of arguments case + var $args = [null]; + $args.push.apply($args, args); + return new (bind.apply(Target, $args))(); + } + // with altered newTarget, not support built-in constructors + var proto = newTarget.prototype; + var instance = create(isObject(proto) ? proto : Object.prototype); + var result = Function.apply.call(Target, instance, args); + return isObject(result) ? result : instance; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.define-property.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.define-property.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); + +// MS Edge has broken Reflect.defineProperty - throwing instead of returning false +$export($export.S + $export.F * __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + // eslint-disable-next-line no-undef + Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); +}), 'Reflect', { + defineProperty: function defineProperty(target, propertyKey, attributes) { + anObject(target); + propertyKey = toPrimitive(propertyKey, true); + anObject(attributes); + try { + dP.f(target, propertyKey, attributes); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.delete-property.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.delete-property.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.4 Reflect.deleteProperty(target, propertyKey) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var gOPD = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); + +$export($export.S, 'Reflect', { + deleteProperty: function deleteProperty(target, propertyKey) { + var desc = gOPD(anObject(target), propertyKey); + return desc && !desc.configurable ? false : delete target[propertyKey]; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.enumerate.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.enumerate.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 26.1.5 Reflect.enumerate(target) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var Enumerate = function (iterated) { + this._t = anObject(iterated); // target + this._i = 0; // next index + var keys = this._k = []; // keys + var key; + for (key in iterated) keys.push(key); +}; +__webpack_require__(/*! ./_iter-create */ "./node_modules/core-js/modules/_iter-create.js")(Enumerate, 'Object', function () { + var that = this; + var keys = that._k; + var key; + do { + if (that._i >= keys.length) return { value: undefined, done: true }; + } while (!((key = keys[that._i++]) in that._t)); + return { value: key, done: false }; +}); + +$export($export.S, 'Reflect', { + enumerate: function enumerate(target) { + return new Enumerate(target); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) +var gOPD = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); + +$export($export.S, 'Reflect', { + getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { + return gOPD.f(anObject(target), propertyKey); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.get-prototype-of.js": +/*!**********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.get-prototype-of.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.8 Reflect.getPrototypeOf(target) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var getProto = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); + +$export($export.S, 'Reflect', { + getPrototypeOf: function getPrototypeOf(target) { + return getProto(anObject(target)); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.get.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.get.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.6 Reflect.get(target, propertyKey [, receiver]) +var gOPD = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); +var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); + +function get(target, propertyKey /* , receiver */) { + var receiver = arguments.length < 3 ? target : arguments[2]; + var desc, proto; + if (anObject(target) === receiver) return target[propertyKey]; + if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') + ? desc.value + : desc.get !== undefined + ? desc.get.call(receiver) + : undefined; + if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); +} + +$export($export.S, 'Reflect', { get: get }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.has.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.has.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.9 Reflect.has(target, propertyKey) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Reflect', { + has: function has(target, propertyKey) { + return propertyKey in target; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.is-extensible.js": +/*!*******************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.is-extensible.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.10 Reflect.isExtensible(target) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var $isExtensible = Object.isExtensible; + +$export($export.S, 'Reflect', { + isExtensible: function isExtensible(target) { + anObject(target); + return $isExtensible ? $isExtensible(target) : true; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.own-keys.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.own-keys.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.11 Reflect.ownKeys(target) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Reflect', { ownKeys: __webpack_require__(/*! ./_own-keys */ "./node_modules/core-js/modules/_own-keys.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.prevent-extensions.js": +/*!************************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.prevent-extensions.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.12 Reflect.preventExtensions(target) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var $preventExtensions = Object.preventExtensions; + +$export($export.S, 'Reflect', { + preventExtensions: function preventExtensions(target) { + anObject(target); + try { + if ($preventExtensions) $preventExtensions(target); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.set-prototype-of.js": +/*!**********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.set-prototype-of.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.14 Reflect.setPrototypeOf(target, proto) +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var setProto = __webpack_require__(/*! ./_set-proto */ "./node_modules/core-js/modules/_set-proto.js"); + +if (setProto) $export($export.S, 'Reflect', { + setPrototypeOf: function setPrototypeOf(target, proto) { + setProto.check(target, proto); + try { + setProto.set(target, proto); + return true; + } catch (e) { + return false; + } + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.reflect.set.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.reflect.set.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var gOPD = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); +var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); + +function set(target, propertyKey, V /* , receiver */) { + var receiver = arguments.length < 4 ? target : arguments[3]; + var ownDesc = gOPD.f(anObject(target), propertyKey); + var existingDescriptor, proto; + if (!ownDesc) { + if (isObject(proto = getPrototypeOf(target))) { + return set(proto, propertyKey, V, receiver); + } + ownDesc = createDesc(0); + } + if (has(ownDesc, 'value')) { + if (ownDesc.writable === false || !isObject(receiver)) return false; + if (existingDescriptor = gOPD.f(receiver, propertyKey)) { + if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false; + existingDescriptor.value = V; + dP.f(receiver, propertyKey, existingDescriptor); + } else dP.f(receiver, propertyKey, createDesc(0, V)); + return true; + } + return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); +} + +$export($export.S, 'Reflect', { set: set }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.constructor.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.constructor.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var inheritIfRequired = __webpack_require__(/*! ./_inherit-if-required */ "./node_modules/core-js/modules/_inherit-if-required.js"); +var dP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f; +var gOPN = __webpack_require__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f; +var isRegExp = __webpack_require__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); +var $flags = __webpack_require__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js"); +var $RegExp = global.RegExp; +var Base = $RegExp; +var proto = $RegExp.prototype; +var re1 = /a/g; +var re2 = /a/g; +// "new" creates a new object, old webkit buggy here +var CORRECT_NEW = new $RegExp(re1) !== re1; + +if (__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && (!CORRECT_NEW || __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + re2[__webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('match')] = false; + // RegExp constructor can alter flags and IsRegExp works correct with @@match + return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; +}))) { + $RegExp = function RegExp(p, f) { + var tiRE = this instanceof $RegExp; + var piRE = isRegExp(p); + var fiU = f === undefined; + return !tiRE && piRE && p.constructor === $RegExp && fiU ? p + : inheritIfRequired(CORRECT_NEW + ? new Base(piRE && !fiU ? p.source : p, f) + : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) + , tiRE ? this : proto, $RegExp); + }; + var proxy = function (key) { + key in $RegExp || dP($RegExp, key, { + configurable: true, + get: function () { return Base[key]; }, + set: function (it) { Base[key] = it; } + }); + }; + for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); + proto.constructor = $RegExp; + $RegExp.prototype = proto; + __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(global, 'RegExp', $RegExp); +} + +__webpack_require__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")('RegExp'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.flags.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.flags.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// 21.2.5.3 get RegExp.prototype.flags() +if (__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && /./g.flags != 'g') __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js").f(RegExp.prototype, 'flags', { + configurable: true, + get: __webpack_require__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js") +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.match.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.match.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// @@match logic +__webpack_require__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('match', 1, function (defined, MATCH, $match) { + // 21.1.3.11 String.prototype.match(regexp) + return [function match(regexp) { + 'use strict'; + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[MATCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); + }, $match]; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.replace.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.replace.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// @@replace logic +__webpack_require__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('replace', 2, function (defined, REPLACE, $replace) { + // 21.1.3.14 String.prototype.replace(searchValue, replaceValue) + return [function replace(searchValue, replaceValue) { + 'use strict'; + var O = defined(this); + var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; + return fn !== undefined + ? fn.call(searchValue, O, replaceValue) + : $replace.call(String(O), searchValue, replaceValue); + }, $replace]; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.search.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.search.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// @@search logic +__webpack_require__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('search', 1, function (defined, SEARCH, $search) { + // 21.1.3.15 String.prototype.search(regexp) + return [function search(regexp) { + 'use strict'; + var O = defined(this); + var fn = regexp == undefined ? undefined : regexp[SEARCH]; + return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); + }, $search]; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.split.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.split.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// @@split logic +__webpack_require__(/*! ./_fix-re-wks */ "./node_modules/core-js/modules/_fix-re-wks.js")('split', 2, function (defined, SPLIT, $split) { + 'use strict'; + var isRegExp = __webpack_require__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); + var _split = $split; + var $push = [].push; + var $SPLIT = 'split'; + var LENGTH = 'length'; + var LAST_INDEX = 'lastIndex'; + if ( + 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || + 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || + 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || + '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || + '.'[$SPLIT](/()()/)[LENGTH] > 1 || + ''[$SPLIT](/.?/)[LENGTH] + ) { + var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group + // based on es5-shim implementation, need to rework it + $split = function (separator, limit) { + var string = String(this); + if (separator === undefined && limit === 0) return []; + // If `separator` is not a regex, use native split + if (!isRegExp(separator)) return _split.call(string, separator, limit); + var output = []; + var flags = (separator.ignoreCase ? 'i' : '') + + (separator.multiline ? 'm' : '') + + (separator.unicode ? 'u' : '') + + (separator.sticky ? 'y' : ''); + var lastLastIndex = 0; + var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; + // Make `global` and avoid `lastIndex` issues by working with a copy + var separatorCopy = new RegExp(separator.source, flags + 'g'); + var separator2, match, lastIndex, lastLength, i; + // Doesn't need flags gy, but they don't hurt + if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\s)', flags); + while (match = separatorCopy.exec(string)) { + // `separatorCopy.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0][LENGTH]; + if (lastIndex > lastLastIndex) { + output.push(string.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG + // eslint-disable-next-line no-loop-func + if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () { + for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined; + }); + if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); + lastLength = match[0][LENGTH]; + lastLastIndex = lastIndex; + if (output[LENGTH] >= splitLimit) break; + } + if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop + } + if (lastLastIndex === string[LENGTH]) { + if (lastLength || !separatorCopy.test('')) output.push(''); + } else output.push(string.slice(lastLastIndex)); + return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; + }; + // Chakra, V8 + } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { + $split = function (separator, limit) { + return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit); + }; + } + // 21.1.3.17 String.prototype.split(separator, limit) + return [function split(separator, limit) { + var O = defined(this); + var fn = separator == undefined ? undefined : separator[SPLIT]; + return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit); + }, $split]; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.regexp.to-string.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.regexp.to-string.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +__webpack_require__(/*! ./es6.regexp.flags */ "./node_modules/core-js/modules/es6.regexp.flags.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var $flags = __webpack_require__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js"); +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var TO_STRING = 'toString'; +var $toString = /./[TO_STRING]; + +var define = function (fn) { + __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js")(RegExp.prototype, TO_STRING, fn, true); +}; + +// 21.2.5.14 RegExp.prototype.toString() +if (__webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { + define(function toString() { + var R = anObject(this); + return '/'.concat(R.source, '/', + 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); + }); +// FF44- RegExp#toString has a wrong name +} else if ($toString.name != TO_STRING) { + define(function toString() { + return $toString.call(this); + }); +} + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.set.js": +/*!*************************************************!*\ + !*** ./node_modules/core-js/modules/es6.set.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var strong = __webpack_require__(/*! ./_collection-strong */ "./node_modules/core-js/modules/_collection-strong.js"); +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var SET = 'Set'; + +// 23.2 Set Objects +module.exports = __webpack_require__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(SET, function (get) { + return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value) { + return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); + } +}, strong); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.anchor.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.anchor.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.2 String.prototype.anchor(name) +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('anchor', function (createHTML) { + return function anchor(name) { + return createHTML(this, 'a', 'name', name); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.big.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.big.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.3 String.prototype.big() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('big', function (createHTML) { + return function big() { + return createHTML(this, 'big', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.blink.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.blink.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.4 String.prototype.blink() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('blink', function (createHTML) { + return function blink() { + return createHTML(this, 'blink', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.bold.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.bold.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.5 String.prototype.bold() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('bold', function (createHTML) { + return function bold() { + return createHTML(this, 'b', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.code-point-at.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.code-point-at.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $at = __webpack_require__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(false); +$export($export.P, 'String', { + // 21.1.3.3 String.prototype.codePointAt(pos) + codePointAt: function codePointAt(pos) { + return $at(this, pos); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.ends-with.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.ends-with.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var context = __webpack_require__(/*! ./_string-context */ "./node_modules/core-js/modules/_string-context.js"); +var ENDS_WITH = 'endsWith'; +var $endsWith = ''[ENDS_WITH]; + +$export($export.P + $export.F * __webpack_require__(/*! ./_fails-is-regexp */ "./node_modules/core-js/modules/_fails-is-regexp.js")(ENDS_WITH), 'String', { + endsWith: function endsWith(searchString /* , endPosition = @length */) { + var that = context(this, searchString, ENDS_WITH); + var endPosition = arguments.length > 1 ? arguments[1] : undefined; + var len = toLength(that.length); + var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); + var search = String(searchString); + return $endsWith + ? $endsWith.call(that, search, end) + : that.slice(end - search.length, end) === search; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.fixed.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.fixed.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.6 String.prototype.fixed() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('fixed', function (createHTML) { + return function fixed() { + return createHTML(this, 'tt', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.fontcolor.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.fontcolor.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.7 String.prototype.fontcolor(color) +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('fontcolor', function (createHTML) { + return function fontcolor(color) { + return createHTML(this, 'font', 'color', color); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.fontsize.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.fontsize.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.8 String.prototype.fontsize(size) +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('fontsize', function (createHTML) { + return function fontsize(size) { + return createHTML(this, 'font', 'size', size); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.from-code-point.js": +/*!********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.from-code-point.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toAbsoluteIndex = __webpack_require__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +var fromCharCode = String.fromCharCode; +var $fromCodePoint = String.fromCodePoint; + +// length should be 1, old FF problem +$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { + // 21.1.2.2 String.fromCodePoint(...codePoints) + fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars + var res = []; + var aLen = arguments.length; + var i = 0; + var code; + while (aLen > i) { + code = +arguments[i++]; + if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); + res.push(code < 0x10000 + ? fromCharCode(code) + : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) + ); + } return res.join(''); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.includes.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.includes.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.7 String.prototype.includes(searchString, position = 0) + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var context = __webpack_require__(/*! ./_string-context */ "./node_modules/core-js/modules/_string-context.js"); +var INCLUDES = 'includes'; + +$export($export.P + $export.F * __webpack_require__(/*! ./_fails-is-regexp */ "./node_modules/core-js/modules/_fails-is-regexp.js")(INCLUDES), 'String', { + includes: function includes(searchString /* , position = 0 */) { + return !!~context(this, searchString, INCLUDES) + .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.italics.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.italics.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.9 String.prototype.italics() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('italics', function (createHTML) { + return function italics() { + return createHTML(this, 'i', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.iterator.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.iterator.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $at = __webpack_require__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(true); + +// 21.1.3.27 String.prototype[@@iterator]() +__webpack_require__(/*! ./_iter-define */ "./node_modules/core-js/modules/_iter-define.js")(String, 'String', function (iterated) { + this._t = String(iterated); // target + this._i = 0; // next index +// 21.1.5.2.1 %StringIteratorPrototype%.next() +}, function () { + var O = this._t; + var index = this._i; + var point; + if (index >= O.length) return { value: undefined, done: true }; + point = $at(O, index); + this._i += point.length; + return { value: point, done: false }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.link.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.link.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.10 String.prototype.link(url) +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('link', function (createHTML) { + return function link(url) { + return createHTML(this, 'a', 'href', url); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.raw.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.raw.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); + +$export($export.S, 'String', { + // 21.1.2.4 String.raw(callSite, ...substitutions) + raw: function raw(callSite) { + var tpl = toIObject(callSite.raw); + var len = toLength(tpl.length); + var aLen = arguments.length; + var res = []; + var i = 0; + while (len > i) { + res.push(String(tpl[i++])); + if (i < aLen) res.push(String(arguments[i])); + } return res.join(''); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.repeat.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.repeat.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.P, 'String', { + // 21.1.3.13 String.prototype.repeat(count) + repeat: __webpack_require__(/*! ./_string-repeat */ "./node_modules/core-js/modules/_string-repeat.js") +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.small.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.small.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.11 String.prototype.small() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('small', function (createHTML) { + return function small() { + return createHTML(this, 'small', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.starts-with.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.starts-with.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// 21.1.3.18 String.prototype.startsWith(searchString [, position ]) + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var context = __webpack_require__(/*! ./_string-context */ "./node_modules/core-js/modules/_string-context.js"); +var STARTS_WITH = 'startsWith'; +var $startsWith = ''[STARTS_WITH]; + +$export($export.P + $export.F * __webpack_require__(/*! ./_fails-is-regexp */ "./node_modules/core-js/modules/_fails-is-regexp.js")(STARTS_WITH), 'String', { + startsWith: function startsWith(searchString /* , position = 0 */) { + var that = context(this, searchString, STARTS_WITH); + var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); + var search = String(searchString); + return $startsWith + ? $startsWith.call(that, search, index) + : that.slice(index, index + search.length) === search; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.strike.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.strike.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.12 String.prototype.strike() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('strike', function (createHTML) { + return function strike() { + return createHTML(this, 'strike', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.sub.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.sub.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.13 String.prototype.sub() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('sub', function (createHTML) { + return function sub() { + return createHTML(this, 'sub', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.sup.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.sup.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// B.2.3.14 String.prototype.sup() +__webpack_require__(/*! ./_string-html */ "./node_modules/core-js/modules/_string-html.js")('sup', function (createHTML) { + return function sup() { + return createHTML(this, 'sup', '', ''); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.string.trim.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es6.string.trim.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// 21.1.3.25 String.prototype.trim() +__webpack_require__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js")('trim', function ($trim) { + return function trim() { + return $trim(this, 3); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.symbol.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/es6.symbol.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// ECMAScript 6 symbols shim +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var has = __webpack_require__(/*! ./_has */ "./node_modules/core-js/modules/_has.js"); +var DESCRIPTORS = __webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var META = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js").KEY; +var $fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var shared = __webpack_require__(/*! ./_shared */ "./node_modules/core-js/modules/_shared.js"); +var setToStringTag = __webpack_require__(/*! ./_set-to-string-tag */ "./node_modules/core-js/modules/_set-to-string-tag.js"); +var uid = __webpack_require__(/*! ./_uid */ "./node_modules/core-js/modules/_uid.js"); +var wks = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); +var wksExt = __webpack_require__(/*! ./_wks-ext */ "./node_modules/core-js/modules/_wks-ext.js"); +var wksDefine = __webpack_require__(/*! ./_wks-define */ "./node_modules/core-js/modules/_wks-define.js"); +var enumKeys = __webpack_require__(/*! ./_enum-keys */ "./node_modules/core-js/modules/_enum-keys.js"); +var isArray = __webpack_require__(/*! ./_is-array */ "./node_modules/core-js/modules/_is-array.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var createDesc = __webpack_require__(/*! ./_property-desc */ "./node_modules/core-js/modules/_property-desc.js"); +var _create = __webpack_require__(/*! ./_object-create */ "./node_modules/core-js/modules/_object-create.js"); +var gOPNExt = __webpack_require__(/*! ./_object-gopn-ext */ "./node_modules/core-js/modules/_object-gopn-ext.js"); +var $GOPD = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); +var $DP = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); +var $keys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var gOPD = $GOPD.f; +var dP = $DP.f; +var gOPN = gOPNExt.f; +var $Symbol = global.Symbol; +var $JSON = global.JSON; +var _stringify = $JSON && $JSON.stringify; +var PROTOTYPE = 'prototype'; +var HIDDEN = wks('_hidden'); +var TO_PRIMITIVE = wks('toPrimitive'); +var isEnum = {}.propertyIsEnumerable; +var SymbolRegistry = shared('symbol-registry'); +var AllSymbols = shared('symbols'); +var OPSymbols = shared('op-symbols'); +var ObjectProto = Object[PROTOTYPE]; +var USE_NATIVE = typeof $Symbol == 'function'; +var QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDesc = DESCRIPTORS && $fails(function () { + return _create(dP({}, 'a', { + get: function () { return dP(this, 'a', { value: 7 }).a; } + })).a != 7; +}) ? function (it, key, D) { + var protoDesc = gOPD(ObjectProto, key); + if (protoDesc) delete ObjectProto[key]; + dP(it, key, D); + if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); +} : dP; + +var wrap = function (tag) { + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; +}; + +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { + return typeof it == 'symbol'; +} : function (it) { + return it instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(it, key, D) { + if (it === ObjectProto) $defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if (has(AllSymbols, key)) { + if (!D.enumerable) { + if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; + D = _create(D, { enumerable: createDesc(0, false) }); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); +}; +var $defineProperties = function defineProperties(it, P) { + anObject(it); + var keys = enumKeys(P = toIObject(P)); + var i = 0; + var l = keys.length; + var key; + while (l > i) $defineProperty(it, key = keys[i++], P[key]); + return it; +}; +var $create = function create(it, P) { + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; +var $propertyIsEnumerable = function propertyIsEnumerable(key) { + var E = isEnum.call(this, key = toPrimitive(key, true)); + if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { + it = toIObject(it); + key = toPrimitive(key, true); + if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; + var D = gOPD(it, key); + if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; + return D; +}; +var $getOwnPropertyNames = function getOwnPropertyNames(it) { + var names = gOPN(toIObject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); + } return result; +}; +var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { + var IS_OP = it === ObjectProto; + var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); + var result = []; + var i = 0; + var key; + while (names.length > i) { + if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); + } return result; +}; + +// 19.4.1.1 Symbol([description]) +if (!USE_NATIVE) { + $Symbol = function Symbol() { + if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function (value) { + if (this === ObjectProto) $set.call(OPSymbols, value); + if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString() { + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + __webpack_require__(/*! ./_object-gopn */ "./node_modules/core-js/modules/_object-gopn.js").f = gOPNExt.f = $getOwnPropertyNames; + __webpack_require__(/*! ./_object-pie */ "./node_modules/core-js/modules/_object-pie.js").f = $propertyIsEnumerable; + __webpack_require__(/*! ./_object-gops */ "./node_modules/core-js/modules/_object-gops.js").f = $getOwnPropertySymbols; + + if (DESCRIPTORS && !__webpack_require__(/*! ./_library */ "./node_modules/core-js/modules/_library.js")) { + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function (name) { + return wrap(wks(name)); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); + +for (var es6Symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' +).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); + +for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); + +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function (key) { + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(sym) { + if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); + for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; + }, + useSetter: function () { setter = true; }, + useSimple: function () { setter = false; } +}); + +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); + +// 24.3.2 JSON.stringify(value [, replacer [, space]]) +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it) { + var args = [it]; + var i = 1; + var replacer, $replacer; + while (arguments.length > i) args.push(arguments[i++]); + $replacer = replacer = args[1]; + if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined + if (!isArray(replacer)) replacer = function (key, value) { + if (typeof $replacer == 'function') value = $replacer.call(this, key, value); + if (!isSymbol(value)) return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); + +// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) +$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js")($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// 19.4.3.5 Symbol.prototype[@@toStringTag] +setToStringTag($Symbol, 'Symbol'); +// 20.2.1.9 Math[@@toStringTag] +setToStringTag(Math, 'Math', true); +// 24.3.3 JSON[@@toStringTag] +setToStringTag(global.JSON, 'JSON', true); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.typed.array-buffer.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.array-buffer.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $typed = __webpack_require__(/*! ./_typed */ "./node_modules/core-js/modules/_typed.js"); +var buffer = __webpack_require__(/*! ./_typed-buffer */ "./node_modules/core-js/modules/_typed-buffer.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toAbsoluteIndex = __webpack_require__(/*! ./_to-absolute-index */ "./node_modules/core-js/modules/_to-absolute-index.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var ArrayBuffer = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").ArrayBuffer; +var speciesConstructor = __webpack_require__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); +var $ArrayBuffer = buffer.ArrayBuffer; +var $DataView = buffer.DataView; +var $isView = $typed.ABV && ArrayBuffer.isView; +var $slice = $ArrayBuffer.prototype.slice; +var VIEW = $typed.VIEW; +var ARRAY_BUFFER = 'ArrayBuffer'; + +$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); + +$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { + // 24.1.3.1 ArrayBuffer.isView(arg) + isView: function isView(it) { + return $isView && $isView(it) || isObject(it) && VIEW in it; + } +}); + +$export($export.P + $export.U + $export.F * __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js")(function () { + return !new $ArrayBuffer(2).slice(1, undefined).byteLength; +}), ARRAY_BUFFER, { + // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) + slice: function slice(start, end) { + if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix + var len = anObject(this).byteLength; + var first = toAbsoluteIndex(start, len); + var fin = toAbsoluteIndex(end === undefined ? len : end, len); + var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); + var viewS = new $DataView(this); + var viewT = new $DataView(result); + var index = 0; + while (first < fin) { + viewT.setUint8(index++, viewS.getUint8(first++)); + } return result; + } +}); + +__webpack_require__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")(ARRAY_BUFFER); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.typed.data-view.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.data-view.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +$export($export.G + $export.W + $export.F * !__webpack_require__(/*! ./_typed */ "./node_modules/core-js/modules/_typed.js").ABV, { + DataView: __webpack_require__(/*! ./_typed-buffer */ "./node_modules/core-js/modules/_typed-buffer.js").DataView +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.typed.float32-array.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.float32-array.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Float32', 4, function (init) { + return function Float32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.typed.float64-array.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.float64-array.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Float64', 8, function (init) { + return function Float64Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.typed.int16-array.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.int16-array.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Int16', 2, function (init) { + return function Int16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.typed.int32-array.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.int32-array.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Int32', 4, function (init) { + return function Int32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.typed.int8-array.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.int8-array.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Int8', 1, function (init) { + return function Int8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.typed.uint16-array.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.uint16-array.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Uint16', 2, function (init) { + return function Uint16Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.typed.uint32-array.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.uint32-array.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Uint32', 4, function (init) { + return function Uint32Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.typed.uint8-array.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.uint8-array.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Uint8', 1, function (init) { + return function Uint8Array(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.typed.uint8-clamped-array.js": +/*!***********************************************************************!*\ + !*** ./node_modules/core-js/modules/es6.typed.uint8-clamped-array.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_typed-array */ "./node_modules/core-js/modules/_typed-array.js")('Uint8', 1, function (init) { + return function Uint8ClampedArray(data, byteOffset, length) { + return init(this, data, byteOffset, length); + }; +}, true); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.weak-map.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.weak-map.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var each = __webpack_require__(/*! ./_array-methods */ "./node_modules/core-js/modules/_array-methods.js")(0); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var meta = __webpack_require__(/*! ./_meta */ "./node_modules/core-js/modules/_meta.js"); +var assign = __webpack_require__(/*! ./_object-assign */ "./node_modules/core-js/modules/_object-assign.js"); +var weak = __webpack_require__(/*! ./_collection-weak */ "./node_modules/core-js/modules/_collection-weak.js"); +var isObject = __webpack_require__(/*! ./_is-object */ "./node_modules/core-js/modules/_is-object.js"); +var fails = __webpack_require__(/*! ./_fails */ "./node_modules/core-js/modules/_fails.js"); +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var WEAK_MAP = 'WeakMap'; +var getWeak = meta.getWeak; +var isExtensible = Object.isExtensible; +var uncaughtFrozenStore = weak.ufstore; +var tmp = {}; +var InternalMap; + +var wrapper = function (get) { + return function WeakMap() { + return get(this, arguments.length > 0 ? arguments[0] : undefined); + }; +}; + +var methods = { + // 23.3.3.3 WeakMap.prototype.get(key) + get: function get(key) { + if (isObject(key)) { + var data = getWeak(key); + if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); + return data ? data[this._i] : undefined; + } + }, + // 23.3.3.5 WeakMap.prototype.set(key, value) + set: function set(key, value) { + return weak.def(validate(this, WEAK_MAP), key, value); + } +}; + +// 23.3 WeakMap Objects +var $WeakMap = module.exports = __webpack_require__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(WEAK_MAP, wrapper, methods, weak, true, true); + +// IE11 WeakMap frozen keys fix +if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { + InternalMap = weak.getConstructor(wrapper, WEAK_MAP); + assign(InternalMap.prototype, methods); + meta.NEED = true; + each(['delete', 'has', 'get', 'set'], function (key) { + var proto = $WeakMap.prototype; + var method = proto[key]; + redefine(proto, key, function (a, b) { + // store frozen objects on internal weakmap shim + if (isObject(a) && !isExtensible(a)) { + if (!this._f) this._f = new InternalMap(); + var result = this._f[key](a, b); + return key == 'set' ? this : result; + // store all the rest on native weakmap + } return method.call(this, a, b); + }); + }); +} + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es6.weak-set.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/es6.weak-set.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var weak = __webpack_require__(/*! ./_collection-weak */ "./node_modules/core-js/modules/_collection-weak.js"); +var validate = __webpack_require__(/*! ./_validate-collection */ "./node_modules/core-js/modules/_validate-collection.js"); +var WEAK_SET = 'WeakSet'; + +// 23.4 WeakSet Objects +__webpack_require__(/*! ./_collection */ "./node_modules/core-js/modules/_collection.js")(WEAK_SET, function (get) { + return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.4.3.1 WeakSet.prototype.add(value) + add: function add(value) { + return weak.def(validate(this, WEAK_SET), value, true); + } +}, weak, false, true); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.array.flat-map.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.array.flat-map.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var flattenIntoArray = __webpack_require__(/*! ./_flatten-into-array */ "./node_modules/core-js/modules/_flatten-into-array.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var arraySpeciesCreate = __webpack_require__(/*! ./_array-species-create */ "./node_modules/core-js/modules/_array-species-create.js"); + +$export($export.P, 'Array', { + flatMap: function flatMap(callbackfn /* , thisArg */) { + var O = toObject(this); + var sourceLen, A; + aFunction(callbackfn); + sourceLen = toLength(O.length); + A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); + return A; + } +}); + +__webpack_require__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('flatMap'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.array.flatten.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.array.flatten.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var flattenIntoArray = __webpack_require__(/*! ./_flatten-into-array */ "./node_modules/core-js/modules/_flatten-into-array.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var toInteger = __webpack_require__(/*! ./_to-integer */ "./node_modules/core-js/modules/_to-integer.js"); +var arraySpeciesCreate = __webpack_require__(/*! ./_array-species-create */ "./node_modules/core-js/modules/_array-species-create.js"); + +$export($export.P, 'Array', { + flatten: function flatten(/* depthArg = 1 */) { + var depthArg = arguments[0]; + var O = toObject(this); + var sourceLen = toLength(O.length); + var A = arraySpeciesCreate(O, 0); + flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); + return A; + } +}); + +__webpack_require__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('flatten'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.array.includes.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.array.includes.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/Array.prototype.includes +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $includes = __webpack_require__(/*! ./_array-includes */ "./node_modules/core-js/modules/_array-includes.js")(true); + +$export($export.P, 'Array', { + includes: function includes(el /* , fromIndex = 0 */) { + return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); + } +}); + +__webpack_require__(/*! ./_add-to-unscopables */ "./node_modules/core-js/modules/_add-to-unscopables.js")('includes'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.asap.js": +/*!**************************************************!*\ + !*** ./node_modules/core-js/modules/es7.asap.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var microtask = __webpack_require__(/*! ./_microtask */ "./node_modules/core-js/modules/_microtask.js")(); +var process = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js").process; +var isNode = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js")(process) == 'process'; + +$export($export.G, { + asap: function asap(fn) { + var domain = isNode && process.domain; + microtask(domain ? domain.bind(fn) : fn); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.error.is-error.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.error.is-error.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/ljharb/proposal-is-error +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var cof = __webpack_require__(/*! ./_cof */ "./node_modules/core-js/modules/_cof.js"); + +$export($export.S, 'Error', { + isError: function isError(it) { + return cof(it) === 'Error'; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.global.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/es7.global.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-global +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.G, { global: __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.map.from.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/es7.map.from.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from +__webpack_require__(/*! ./_set-collection-from */ "./node_modules/core-js/modules/_set-collection-from.js")('Map'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.map.of.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/es7.map.of.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of +__webpack_require__(/*! ./_set-collection-of */ "./node_modules/core-js/modules/_set-collection-of.js")('Map'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.map.to-json.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.map.to-json.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(/*! ./_collection-to-json */ "./node_modules/core-js/modules/_collection-to-json.js")('Map') }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.clamp.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.clamp.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { + clamp: function clamp(x, lower, upper) { + return Math.min(upper, Math.max(lower, x)); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.deg-per-rad.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.deg-per-rad.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.degrees.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.degrees.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var RAD_PER_DEG = 180 / Math.PI; + +$export($export.S, 'Math', { + degrees: function degrees(radians) { + return radians * RAD_PER_DEG; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.fscale.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.fscale.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var scale = __webpack_require__(/*! ./_math-scale */ "./node_modules/core-js/modules/_math-scale.js"); +var fround = __webpack_require__(/*! ./_math-fround */ "./node_modules/core-js/modules/_math-fround.js"); + +$export($export.S, 'Math', { + fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { + return fround(scale(x, inLow, inHigh, outLow, outHigh)); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.iaddh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.iaddh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { + iaddh: function iaddh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.imulh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.imulh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { + imulh: function imulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >> 16; + var v1 = $v >> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.isubh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.isubh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { + isubh: function isubh(x0, x1, y0, y1) { + var $x0 = x0 >>> 0; + var $x1 = x1 >>> 0; + var $y0 = y0 >>> 0; + return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.rad-per-deg.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.rad-per-deg.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.radians.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.radians.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var DEG_PER_RAD = Math.PI / 180; + +$export($export.S, 'Math', { + radians: function radians(degrees) { + return degrees * DEG_PER_RAD; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.scale.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.scale.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://rwaldron.github.io/proposal-math-extensions/ +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { scale: __webpack_require__(/*! ./_math-scale */ "./node_modules/core-js/modules/_math-scale.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.signbit.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.signbit.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// http://jfbastien.github.io/papers/Math.signbit.html +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { signbit: function signbit(x) { + // eslint-disable-next-line no-self-compare + return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.math.umulh.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.math.umulh.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://gist.github.com/BrendanEich/4294d5c212a6d2254703 +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'Math', { + umulh: function umulh(u, v) { + var UINT16 = 0xffff; + var $u = +u; + var $v = +v; + var u0 = $u & UINT16; + var v0 = $v & UINT16; + var u1 = $u >>> 16; + var v1 = $v >>> 16; + var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); + return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.object.define-getter.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.define-getter.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var $defineProperty = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); + +// B.2.2.2 Object.prototype.__defineGetter__(P, getter) +__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && $export($export.P + __webpack_require__(/*! ./_object-forced-pam */ "./node_modules/core-js/modules/_object-forced-pam.js"), 'Object', { + __defineGetter__: function __defineGetter__(P, getter) { + $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.object.define-setter.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.define-setter.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var $defineProperty = __webpack_require__(/*! ./_object-dp */ "./node_modules/core-js/modules/_object-dp.js"); + +// B.2.2.3 Object.prototype.__defineSetter__(P, setter) +__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && $export($export.P + __webpack_require__(/*! ./_object-forced-pam */ "./node_modules/core-js/modules/_object-forced-pam.js"), 'Object', { + __defineSetter__: function __defineSetter__(P, setter) { + $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.object.entries.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.entries.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-values-entries +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $entries = __webpack_require__(/*! ./_object-to-array */ "./node_modules/core-js/modules/_object-to-array.js")(true); + +$export($export.S, 'Object', { + entries: function entries(it) { + return $entries(it); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-getownpropertydescriptors +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var ownKeys = __webpack_require__(/*! ./_own-keys */ "./node_modules/core-js/modules/_own-keys.js"); +var toIObject = __webpack_require__(/*! ./_to-iobject */ "./node_modules/core-js/modules/_to-iobject.js"); +var gOPD = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js"); +var createProperty = __webpack_require__(/*! ./_create-property */ "./node_modules/core-js/modules/_create-property.js"); + +$export($export.S, 'Object', { + getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { + var O = toIObject(object); + var getDesc = gOPD.f; + var keys = ownKeys(O); + var result = {}; + var i = 0; + var key, desc; + while (keys.length > i) { + desc = getDesc(O, key = keys[i++]); + if (desc !== undefined) createProperty(result, key, desc); + } + return result; + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.object.lookup-getter.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.lookup-getter.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var getOwnPropertyDescriptor = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; + +// B.2.2.4 Object.prototype.__lookupGetter__(P) +__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && $export($export.P + __webpack_require__(/*! ./_object-forced-pam */ "./node_modules/core-js/modules/_object-forced-pam.js"), 'Object', { + __lookupGetter__: function __lookupGetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.get; + } while (O = getPrototypeOf(O)); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.object.lookup-setter.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.lookup-setter.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var toObject = __webpack_require__(/*! ./_to-object */ "./node_modules/core-js/modules/_to-object.js"); +var toPrimitive = __webpack_require__(/*! ./_to-primitive */ "./node_modules/core-js/modules/_to-primitive.js"); +var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var getOwnPropertyDescriptor = __webpack_require__(/*! ./_object-gopd */ "./node_modules/core-js/modules/_object-gopd.js").f; + +// B.2.2.5 Object.prototype.__lookupSetter__(P) +__webpack_require__(/*! ./_descriptors */ "./node_modules/core-js/modules/_descriptors.js") && $export($export.P + __webpack_require__(/*! ./_object-forced-pam */ "./node_modules/core-js/modules/_object-forced-pam.js"), 'Object', { + __lookupSetter__: function __lookupSetter__(P) { + var O = toObject(this); + var K = toPrimitive(P, true); + var D; + do { + if (D = getOwnPropertyDescriptor(O, K)) return D.set; + } while (O = getPrototypeOf(O)); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.object.values.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.object.values.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-object-values-entries +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $values = __webpack_require__(/*! ./_object-to-array */ "./node_modules/core-js/modules/_object-to-array.js")(false); + +$export($export.S, 'Object', { + values: function values(it) { + return $values(it); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.observable.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.observable.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/zenparsing/es-observable +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var microtask = __webpack_require__(/*! ./_microtask */ "./node_modules/core-js/modules/_microtask.js")(); +var OBSERVABLE = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js")('observable'); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var anInstance = __webpack_require__(/*! ./_an-instance */ "./node_modules/core-js/modules/_an-instance.js"); +var redefineAll = __webpack_require__(/*! ./_redefine-all */ "./node_modules/core-js/modules/_redefine-all.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var forOf = __webpack_require__(/*! ./_for-of */ "./node_modules/core-js/modules/_for-of.js"); +var RETURN = forOf.RETURN; + +var getMethod = function (fn) { + return fn == null ? undefined : aFunction(fn); +}; + +var cleanupSubscription = function (subscription) { + var cleanup = subscription._c; + if (cleanup) { + subscription._c = undefined; + cleanup(); + } +}; + +var subscriptionClosed = function (subscription) { + return subscription._o === undefined; +}; + +var closeSubscription = function (subscription) { + if (!subscriptionClosed(subscription)) { + subscription._o = undefined; + cleanupSubscription(subscription); + } +}; + +var Subscription = function (observer, subscriber) { + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer); + var subscription = cleanup; + if (cleanup != null) { + if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch (e) { + observer.error(e); + return; + } if (subscriptionClosed(this)) cleanupSubscription(this); +}; + +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe() { closeSubscription(this); } +}); + +var SubscriptionObserver = function (subscription) { + this._s = subscription; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if (m) return m.call(observer, value); + } catch (e) { + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value) { + var subscription = this._s; + if (subscriptionClosed(subscription)) throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if (!m) throw value; + value = m.call(observer, value); + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value) { + var subscription = this._s; + if (!subscriptionClosed(subscription)) { + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch (e) { + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } +}); + +var $Observable = function Observable(subscriber) { + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); +}; + +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer) { + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn) { + var that = this; + return new (core.Promise || global.Promise)(function (resolve, reject) { + aFunction(fn); + var subscription = that.subscribe({ + next: function (value) { + try { + return fn(value); + } catch (e) { + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } +}); + +redefineAll($Observable, { + from: function from(x) { + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if (method) { + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function (observer) { + return observable.subscribe(observer); + }); + } + return new C(function (observer) { + var done = false; + microtask(function () { + if (!done) { + try { + if (forOf(x, false, function (it) { + observer.next(it); + if (done) return RETURN; + }) === RETURN) return; + } catch (e) { + if (done) throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + }, + of: function of() { + for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function (observer) { + var done = false; + microtask(function () { + if (!done) { + for (var j = 0; j < items.length; ++j) { + observer.next(items[j]); + if (done) return; + } observer.complete(); + } + }); + return function () { done = true; }; + }); + } +}); + +hide($Observable.prototype, OBSERVABLE, function () { return this; }); + +$export($export.G, { Observable: $Observable }); + +__webpack_require__(/*! ./_set-species */ "./node_modules/core-js/modules/_set-species.js")('Observable'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.promise.finally.js": +/*!*************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.promise.finally.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// https://github.com/tc39/proposal-promise-finally + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var core = __webpack_require__(/*! ./_core */ "./node_modules/core-js/modules/_core.js"); +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var speciesConstructor = __webpack_require__(/*! ./_species-constructor */ "./node_modules/core-js/modules/_species-constructor.js"); +var promiseResolve = __webpack_require__(/*! ./_promise-resolve */ "./node_modules/core-js/modules/_promise-resolve.js"); + +$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { + var C = speciesConstructor(this, core.Promise || global.Promise); + var isFunction = typeof onFinally == 'function'; + return this.then( + isFunction ? function (x) { + return promiseResolve(C, onFinally()).then(function () { return x; }); + } : onFinally, + isFunction ? function (e) { + return promiseResolve(C, onFinally()).then(function () { throw e; }); + } : onFinally + ); +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.promise.try.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.promise.try.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-promise-try +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var newPromiseCapability = __webpack_require__(/*! ./_new-promise-capability */ "./node_modules/core-js/modules/_new-promise-capability.js"); +var perform = __webpack_require__(/*! ./_perform */ "./node_modules/core-js/modules/_perform.js"); + +$export($export.S, 'Promise', { 'try': function (callbackfn) { + var promiseCapability = newPromiseCapability.f(this); + var result = perform(callbackfn); + (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); + return promiseCapability.promise; +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.reflect.define-metadata.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.define-metadata.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toMetaKey = metadata.key; +var ordinaryDefineOwnMetadata = metadata.set; + +metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { + ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.reflect.delete-metadata.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.delete-metadata.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var toMetaKey = metadata.key; +var getOrCreateMetadataMap = metadata.map; +var store = metadata.store; + +metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { + var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); + var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); + if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; + if (metadataMap.size) return true; + var targetMetadata = store.get(target); + targetMetadata['delete'](targetKey); + return !!targetMetadata.size || store['delete'](target); +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.reflect.get-metadata-keys.js": +/*!***********************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.get-metadata-keys.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var Set = __webpack_require__(/*! ./es6.set */ "./node_modules/core-js/modules/es6.set.js"); +var from = __webpack_require__(/*! ./_array-from-iterable */ "./node_modules/core-js/modules/_array-from-iterable.js"); +var metadata = __webpack_require__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +var ordinaryMetadataKeys = function (O, P) { + var oKeys = ordinaryOwnMetadataKeys(O, P); + var parent = getPrototypeOf(O); + if (parent === null) return oKeys; + var pKeys = ordinaryMetadataKeys(parent, P); + return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; +}; + +metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { + return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.reflect.get-metadata.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.get-metadata.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var ordinaryHasOwnMetadata = metadata.has; +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +var ordinaryGetMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; +}; + +metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js": +/*!***************************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js ***! + \***************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var ordinaryOwnMetadataKeys = metadata.keys; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { + return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.reflect.get-own-metadata.js": +/*!**********************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.get-own-metadata.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var ordinaryGetOwnMetadata = metadata.get; +var toMetaKey = metadata.key; + +metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryGetOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.reflect.has-metadata.js": +/*!******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.has-metadata.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var getPrototypeOf = __webpack_require__(/*! ./_object-gpo */ "./node_modules/core-js/modules/_object-gpo.js"); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +var ordinaryHasMetadata = function (MetadataKey, O, P) { + var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); + if (hasOwn) return true; + var parent = getPrototypeOf(O); + return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; +}; + +metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.reflect.has-own-metadata.js": +/*!**********************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.has-own-metadata.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var metadata = __webpack_require__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var ordinaryHasOwnMetadata = metadata.has; +var toMetaKey = metadata.key; + +metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { + return ordinaryHasOwnMetadata(metadataKey, anObject(target) + , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.reflect.metadata.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.reflect.metadata.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $metadata = __webpack_require__(/*! ./_metadata */ "./node_modules/core-js/modules/_metadata.js"); +var anObject = __webpack_require__(/*! ./_an-object */ "./node_modules/core-js/modules/_an-object.js"); +var aFunction = __webpack_require__(/*! ./_a-function */ "./node_modules/core-js/modules/_a-function.js"); +var toMetaKey = $metadata.key; +var ordinaryDefineOwnMetadata = $metadata.set; + +$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { + return function decorator(target, targetKey) { + ordinaryDefineOwnMetadata( + metadataKey, metadataValue, + (targetKey !== undefined ? anObject : aFunction)(target), + toMetaKey(targetKey) + ); + }; +} }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.set.from.js": +/*!******************************************************!*\ + !*** ./node_modules/core-js/modules/es7.set.from.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from +__webpack_require__(/*! ./_set-collection-from */ "./node_modules/core-js/modules/_set-collection-from.js")('Set'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.set.of.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/es7.set.of.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of +__webpack_require__(/*! ./_set-collection-of */ "./node_modules/core-js/modules/_set-collection-of.js")('Set'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.set.to-json.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.set.to-json.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/DavidBruant/Map-Set.prototype.toJSON +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(/*! ./_collection-to-json */ "./node_modules/core-js/modules/_collection-to-json.js")('Set') }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.string.at.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/es7.string.at.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/mathiasbynens/String.prototype.at +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $at = __webpack_require__(/*! ./_string-at */ "./node_modules/core-js/modules/_string-at.js")(true); + +$export($export.P, 'String', { + at: function at(pos) { + return $at(this, pos); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.string.match-all.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.string.match-all.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://tc39.github.io/String.prototype.matchAll/ +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var defined = __webpack_require__(/*! ./_defined */ "./node_modules/core-js/modules/_defined.js"); +var toLength = __webpack_require__(/*! ./_to-length */ "./node_modules/core-js/modules/_to-length.js"); +var isRegExp = __webpack_require__(/*! ./_is-regexp */ "./node_modules/core-js/modules/_is-regexp.js"); +var getFlags = __webpack_require__(/*! ./_flags */ "./node_modules/core-js/modules/_flags.js"); +var RegExpProto = RegExp.prototype; + +var $RegExpStringIterator = function (regexp, string) { + this._r = regexp; + this._s = string; +}; + +__webpack_require__(/*! ./_iter-create */ "./node_modules/core-js/modules/_iter-create.js")($RegExpStringIterator, 'RegExp String', function next() { + var match = this._r.exec(this._s); + return { value: match, done: match === null }; +}); + +$export($export.P, 'String', { + matchAll: function matchAll(regexp) { + defined(this); + if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); + var S = String(this); + var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); + var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); + rx.lastIndex = toLength(regexp.lastIndex); + return new $RegExpStringIterator(rx, S); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.string.pad-end.js": +/*!************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.string.pad-end.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-string-pad-start-end +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $pad = __webpack_require__(/*! ./_string-pad */ "./node_modules/core-js/modules/_string-pad.js"); +var userAgent = __webpack_require__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); + +// https://github.com/zloirock/core-js/issues/280 +$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { + padEnd: function padEnd(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.string.pad-start.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.string.pad-start.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/tc39/proposal-string-pad-start-end +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $pad = __webpack_require__(/*! ./_string-pad */ "./node_modules/core-js/modules/_string-pad.js"); +var userAgent = __webpack_require__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); + +// https://github.com/zloirock/core-js/issues/280 +$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { + padStart: function padStart(maxLength /* , fillString = ' ' */) { + return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); + } +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.string.trim-left.js": +/*!**************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.string.trim-left.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +__webpack_require__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js")('trimLeft', function ($trim) { + return function trimLeft() { + return $trim(this, 1); + }; +}, 'trimStart'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.string.trim-right.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.string.trim-right.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// https://github.com/sebmarkbage/ecmascript-string-left-right-trim +__webpack_require__(/*! ./_string-trim */ "./node_modules/core-js/modules/_string-trim.js")('trimRight', function ($trim) { + return function trimRight() { + return $trim(this, 2); + }; +}, 'trimEnd'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.symbol.async-iterator.js": +/*!*******************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.symbol.async-iterator.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_wks-define */ "./node_modules/core-js/modules/_wks-define.js")('asyncIterator'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.symbol.observable.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/modules/es7.symbol.observable.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./_wks-define */ "./node_modules/core-js/modules/_wks-define.js")('observable'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.system.global.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.system.global.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://github.com/tc39/proposal-global +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); + +$export($export.S, 'System', { global: __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js") }); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.weak-map.from.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.weak-map.from.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from +__webpack_require__(/*! ./_set-collection-from */ "./node_modules/core-js/modules/_set-collection-from.js")('WeakMap'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.weak-map.of.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.weak-map.of.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of +__webpack_require__(/*! ./_set-collection-of */ "./node_modules/core-js/modules/_set-collection-of.js")('WeakMap'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.weak-set.from.js": +/*!***********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.weak-set.from.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from +__webpack_require__(/*! ./_set-collection-from */ "./node_modules/core-js/modules/_set-collection-from.js")('WeakSet'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/es7.weak-set.of.js": +/*!*********************************************************!*\ + !*** ./node_modules/core-js/modules/es7.weak-set.of.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of +__webpack_require__(/*! ./_set-collection-of */ "./node_modules/core-js/modules/_set-collection-of.js")('WeakSet'); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/web.dom.iterable.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/modules/web.dom.iterable.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $iterators = __webpack_require__(/*! ./es6.array.iterator */ "./node_modules/core-js/modules/es6.array.iterator.js"); +var getKeys = __webpack_require__(/*! ./_object-keys */ "./node_modules/core-js/modules/_object-keys.js"); +var redefine = __webpack_require__(/*! ./_redefine */ "./node_modules/core-js/modules/_redefine.js"); +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var hide = __webpack_require__(/*! ./_hide */ "./node_modules/core-js/modules/_hide.js"); +var Iterators = __webpack_require__(/*! ./_iterators */ "./node_modules/core-js/modules/_iterators.js"); +var wks = __webpack_require__(/*! ./_wks */ "./node_modules/core-js/modules/_wks.js"); +var ITERATOR = wks('iterator'); +var TO_STRING_TAG = wks('toStringTag'); +var ArrayValues = Iterators.Array; + +var DOMIterables = { + CSSRuleList: true, // TODO: Not spec compliant, should be false. + CSSStyleDeclaration: false, + CSSValueList: false, + ClientRectList: false, + DOMRectList: false, + DOMStringList: false, + DOMTokenList: true, + DataTransferItemList: false, + FileList: false, + HTMLAllCollection: false, + HTMLCollection: false, + HTMLFormElement: false, + HTMLSelectElement: false, + MediaList: true, // TODO: Not spec compliant, should be false. + MimeTypeArray: false, + NamedNodeMap: false, + NodeList: true, + PaintRequestList: false, + Plugin: false, + PluginArray: false, + SVGLengthList: false, + SVGNumberList: false, + SVGPathSegList: false, + SVGPointList: false, + SVGStringList: false, + SVGTransformList: false, + SourceBufferList: false, + StyleSheetList: true, // TODO: Not spec compliant, should be false. + TextTrackCueList: false, + TextTrackList: false, + TouchList: false +}; + +for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { + var NAME = collections[i]; + var explicit = DOMIterables[NAME]; + var Collection = global[NAME]; + var proto = Collection && Collection.prototype; + var key; + if (proto) { + if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); + if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); + Iterators[NAME] = ArrayValues; + if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); + } +} + + +/***/ }), + +/***/ "./node_modules/core-js/modules/web.immediate.js": +/*!*******************************************************!*\ + !*** ./node_modules/core-js/modules/web.immediate.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var $task = __webpack_require__(/*! ./_task */ "./node_modules/core-js/modules/_task.js"); +$export($export.G + $export.B, { + setImmediate: $task.set, + clearImmediate: $task.clear +}); + + +/***/ }), + +/***/ "./node_modules/core-js/modules/web.timers.js": +/*!****************************************************!*\ + !*** ./node_modules/core-js/modules/web.timers.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +// ie9- setTimeout & setInterval additional parameters fix +var global = __webpack_require__(/*! ./_global */ "./node_modules/core-js/modules/_global.js"); +var $export = __webpack_require__(/*! ./_export */ "./node_modules/core-js/modules/_export.js"); +var userAgent = __webpack_require__(/*! ./_user-agent */ "./node_modules/core-js/modules/_user-agent.js"); +var slice = [].slice; +var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check +var wrap = function (set) { + return function (fn, time /* , ...args */) { + var boundArgs = arguments.length > 2; + var args = boundArgs ? slice.call(arguments, 2) : false; + return set(boundArgs ? function () { + // eslint-disable-next-line no-new-func + (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); + } : fn, time); + }; +}; +$export($export.G + $export.B + $export.F * MSIE, { + setTimeout: wrap(global.setTimeout), + setInterval: wrap(global.setInterval) +}); + + +/***/ }), + +/***/ "./node_modules/core-js/shim.js": +/*!**************************************!*\ + !*** ./node_modules/core-js/shim.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! ./modules/es6.symbol */ "./node_modules/core-js/modules/es6.symbol.js"); +__webpack_require__(/*! ./modules/es6.object.create */ "./node_modules/core-js/modules/es6.object.create.js"); +__webpack_require__(/*! ./modules/es6.object.define-property */ "./node_modules/core-js/modules/es6.object.define-property.js"); +__webpack_require__(/*! ./modules/es6.object.define-properties */ "./node_modules/core-js/modules/es6.object.define-properties.js"); +__webpack_require__(/*! ./modules/es6.object.get-own-property-descriptor */ "./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js"); +__webpack_require__(/*! ./modules/es6.object.get-prototype-of */ "./node_modules/core-js/modules/es6.object.get-prototype-of.js"); +__webpack_require__(/*! ./modules/es6.object.keys */ "./node_modules/core-js/modules/es6.object.keys.js"); +__webpack_require__(/*! ./modules/es6.object.get-own-property-names */ "./node_modules/core-js/modules/es6.object.get-own-property-names.js"); +__webpack_require__(/*! ./modules/es6.object.freeze */ "./node_modules/core-js/modules/es6.object.freeze.js"); +__webpack_require__(/*! ./modules/es6.object.seal */ "./node_modules/core-js/modules/es6.object.seal.js"); +__webpack_require__(/*! ./modules/es6.object.prevent-extensions */ "./node_modules/core-js/modules/es6.object.prevent-extensions.js"); +__webpack_require__(/*! ./modules/es6.object.is-frozen */ "./node_modules/core-js/modules/es6.object.is-frozen.js"); +__webpack_require__(/*! ./modules/es6.object.is-sealed */ "./node_modules/core-js/modules/es6.object.is-sealed.js"); +__webpack_require__(/*! ./modules/es6.object.is-extensible */ "./node_modules/core-js/modules/es6.object.is-extensible.js"); +__webpack_require__(/*! ./modules/es6.object.assign */ "./node_modules/core-js/modules/es6.object.assign.js"); +__webpack_require__(/*! ./modules/es6.object.is */ "./node_modules/core-js/modules/es6.object.is.js"); +__webpack_require__(/*! ./modules/es6.object.set-prototype-of */ "./node_modules/core-js/modules/es6.object.set-prototype-of.js"); +__webpack_require__(/*! ./modules/es6.object.to-string */ "./node_modules/core-js/modules/es6.object.to-string.js"); +__webpack_require__(/*! ./modules/es6.function.bind */ "./node_modules/core-js/modules/es6.function.bind.js"); +__webpack_require__(/*! ./modules/es6.function.name */ "./node_modules/core-js/modules/es6.function.name.js"); +__webpack_require__(/*! ./modules/es6.function.has-instance */ "./node_modules/core-js/modules/es6.function.has-instance.js"); +__webpack_require__(/*! ./modules/es6.parse-int */ "./node_modules/core-js/modules/es6.parse-int.js"); +__webpack_require__(/*! ./modules/es6.parse-float */ "./node_modules/core-js/modules/es6.parse-float.js"); +__webpack_require__(/*! ./modules/es6.number.constructor */ "./node_modules/core-js/modules/es6.number.constructor.js"); +__webpack_require__(/*! ./modules/es6.number.to-fixed */ "./node_modules/core-js/modules/es6.number.to-fixed.js"); +__webpack_require__(/*! ./modules/es6.number.to-precision */ "./node_modules/core-js/modules/es6.number.to-precision.js"); +__webpack_require__(/*! ./modules/es6.number.epsilon */ "./node_modules/core-js/modules/es6.number.epsilon.js"); +__webpack_require__(/*! ./modules/es6.number.is-finite */ "./node_modules/core-js/modules/es6.number.is-finite.js"); +__webpack_require__(/*! ./modules/es6.number.is-integer */ "./node_modules/core-js/modules/es6.number.is-integer.js"); +__webpack_require__(/*! ./modules/es6.number.is-nan */ "./node_modules/core-js/modules/es6.number.is-nan.js"); +__webpack_require__(/*! ./modules/es6.number.is-safe-integer */ "./node_modules/core-js/modules/es6.number.is-safe-integer.js"); +__webpack_require__(/*! ./modules/es6.number.max-safe-integer */ "./node_modules/core-js/modules/es6.number.max-safe-integer.js"); +__webpack_require__(/*! ./modules/es6.number.min-safe-integer */ "./node_modules/core-js/modules/es6.number.min-safe-integer.js"); +__webpack_require__(/*! ./modules/es6.number.parse-float */ "./node_modules/core-js/modules/es6.number.parse-float.js"); +__webpack_require__(/*! ./modules/es6.number.parse-int */ "./node_modules/core-js/modules/es6.number.parse-int.js"); +__webpack_require__(/*! ./modules/es6.math.acosh */ "./node_modules/core-js/modules/es6.math.acosh.js"); +__webpack_require__(/*! ./modules/es6.math.asinh */ "./node_modules/core-js/modules/es6.math.asinh.js"); +__webpack_require__(/*! ./modules/es6.math.atanh */ "./node_modules/core-js/modules/es6.math.atanh.js"); +__webpack_require__(/*! ./modules/es6.math.cbrt */ "./node_modules/core-js/modules/es6.math.cbrt.js"); +__webpack_require__(/*! ./modules/es6.math.clz32 */ "./node_modules/core-js/modules/es6.math.clz32.js"); +__webpack_require__(/*! ./modules/es6.math.cosh */ "./node_modules/core-js/modules/es6.math.cosh.js"); +__webpack_require__(/*! ./modules/es6.math.expm1 */ "./node_modules/core-js/modules/es6.math.expm1.js"); +__webpack_require__(/*! ./modules/es6.math.fround */ "./node_modules/core-js/modules/es6.math.fround.js"); +__webpack_require__(/*! ./modules/es6.math.hypot */ "./node_modules/core-js/modules/es6.math.hypot.js"); +__webpack_require__(/*! ./modules/es6.math.imul */ "./node_modules/core-js/modules/es6.math.imul.js"); +__webpack_require__(/*! ./modules/es6.math.log10 */ "./node_modules/core-js/modules/es6.math.log10.js"); +__webpack_require__(/*! ./modules/es6.math.log1p */ "./node_modules/core-js/modules/es6.math.log1p.js"); +__webpack_require__(/*! ./modules/es6.math.log2 */ "./node_modules/core-js/modules/es6.math.log2.js"); +__webpack_require__(/*! ./modules/es6.math.sign */ "./node_modules/core-js/modules/es6.math.sign.js"); +__webpack_require__(/*! ./modules/es6.math.sinh */ "./node_modules/core-js/modules/es6.math.sinh.js"); +__webpack_require__(/*! ./modules/es6.math.tanh */ "./node_modules/core-js/modules/es6.math.tanh.js"); +__webpack_require__(/*! ./modules/es6.math.trunc */ "./node_modules/core-js/modules/es6.math.trunc.js"); +__webpack_require__(/*! ./modules/es6.string.from-code-point */ "./node_modules/core-js/modules/es6.string.from-code-point.js"); +__webpack_require__(/*! ./modules/es6.string.raw */ "./node_modules/core-js/modules/es6.string.raw.js"); +__webpack_require__(/*! ./modules/es6.string.trim */ "./node_modules/core-js/modules/es6.string.trim.js"); +__webpack_require__(/*! ./modules/es6.string.iterator */ "./node_modules/core-js/modules/es6.string.iterator.js"); +__webpack_require__(/*! ./modules/es6.string.code-point-at */ "./node_modules/core-js/modules/es6.string.code-point-at.js"); +__webpack_require__(/*! ./modules/es6.string.ends-with */ "./node_modules/core-js/modules/es6.string.ends-with.js"); +__webpack_require__(/*! ./modules/es6.string.includes */ "./node_modules/core-js/modules/es6.string.includes.js"); +__webpack_require__(/*! ./modules/es6.string.repeat */ "./node_modules/core-js/modules/es6.string.repeat.js"); +__webpack_require__(/*! ./modules/es6.string.starts-with */ "./node_modules/core-js/modules/es6.string.starts-with.js"); +__webpack_require__(/*! ./modules/es6.string.anchor */ "./node_modules/core-js/modules/es6.string.anchor.js"); +__webpack_require__(/*! ./modules/es6.string.big */ "./node_modules/core-js/modules/es6.string.big.js"); +__webpack_require__(/*! ./modules/es6.string.blink */ "./node_modules/core-js/modules/es6.string.blink.js"); +__webpack_require__(/*! ./modules/es6.string.bold */ "./node_modules/core-js/modules/es6.string.bold.js"); +__webpack_require__(/*! ./modules/es6.string.fixed */ "./node_modules/core-js/modules/es6.string.fixed.js"); +__webpack_require__(/*! ./modules/es6.string.fontcolor */ "./node_modules/core-js/modules/es6.string.fontcolor.js"); +__webpack_require__(/*! ./modules/es6.string.fontsize */ "./node_modules/core-js/modules/es6.string.fontsize.js"); +__webpack_require__(/*! ./modules/es6.string.italics */ "./node_modules/core-js/modules/es6.string.italics.js"); +__webpack_require__(/*! ./modules/es6.string.link */ "./node_modules/core-js/modules/es6.string.link.js"); +__webpack_require__(/*! ./modules/es6.string.small */ "./node_modules/core-js/modules/es6.string.small.js"); +__webpack_require__(/*! ./modules/es6.string.strike */ "./node_modules/core-js/modules/es6.string.strike.js"); +__webpack_require__(/*! ./modules/es6.string.sub */ "./node_modules/core-js/modules/es6.string.sub.js"); +__webpack_require__(/*! ./modules/es6.string.sup */ "./node_modules/core-js/modules/es6.string.sup.js"); +__webpack_require__(/*! ./modules/es6.date.now */ "./node_modules/core-js/modules/es6.date.now.js"); +__webpack_require__(/*! ./modules/es6.date.to-json */ "./node_modules/core-js/modules/es6.date.to-json.js"); +__webpack_require__(/*! ./modules/es6.date.to-iso-string */ "./node_modules/core-js/modules/es6.date.to-iso-string.js"); +__webpack_require__(/*! ./modules/es6.date.to-string */ "./node_modules/core-js/modules/es6.date.to-string.js"); +__webpack_require__(/*! ./modules/es6.date.to-primitive */ "./node_modules/core-js/modules/es6.date.to-primitive.js"); +__webpack_require__(/*! ./modules/es6.array.is-array */ "./node_modules/core-js/modules/es6.array.is-array.js"); +__webpack_require__(/*! ./modules/es6.array.from */ "./node_modules/core-js/modules/es6.array.from.js"); +__webpack_require__(/*! ./modules/es6.array.of */ "./node_modules/core-js/modules/es6.array.of.js"); +__webpack_require__(/*! ./modules/es6.array.join */ "./node_modules/core-js/modules/es6.array.join.js"); +__webpack_require__(/*! ./modules/es6.array.slice */ "./node_modules/core-js/modules/es6.array.slice.js"); +__webpack_require__(/*! ./modules/es6.array.sort */ "./node_modules/core-js/modules/es6.array.sort.js"); +__webpack_require__(/*! ./modules/es6.array.for-each */ "./node_modules/core-js/modules/es6.array.for-each.js"); +__webpack_require__(/*! ./modules/es6.array.map */ "./node_modules/core-js/modules/es6.array.map.js"); +__webpack_require__(/*! ./modules/es6.array.filter */ "./node_modules/core-js/modules/es6.array.filter.js"); +__webpack_require__(/*! ./modules/es6.array.some */ "./node_modules/core-js/modules/es6.array.some.js"); +__webpack_require__(/*! ./modules/es6.array.every */ "./node_modules/core-js/modules/es6.array.every.js"); +__webpack_require__(/*! ./modules/es6.array.reduce */ "./node_modules/core-js/modules/es6.array.reduce.js"); +__webpack_require__(/*! ./modules/es6.array.reduce-right */ "./node_modules/core-js/modules/es6.array.reduce-right.js"); +__webpack_require__(/*! ./modules/es6.array.index-of */ "./node_modules/core-js/modules/es6.array.index-of.js"); +__webpack_require__(/*! ./modules/es6.array.last-index-of */ "./node_modules/core-js/modules/es6.array.last-index-of.js"); +__webpack_require__(/*! ./modules/es6.array.copy-within */ "./node_modules/core-js/modules/es6.array.copy-within.js"); +__webpack_require__(/*! ./modules/es6.array.fill */ "./node_modules/core-js/modules/es6.array.fill.js"); +__webpack_require__(/*! ./modules/es6.array.find */ "./node_modules/core-js/modules/es6.array.find.js"); +__webpack_require__(/*! ./modules/es6.array.find-index */ "./node_modules/core-js/modules/es6.array.find-index.js"); +__webpack_require__(/*! ./modules/es6.array.species */ "./node_modules/core-js/modules/es6.array.species.js"); +__webpack_require__(/*! ./modules/es6.array.iterator */ "./node_modules/core-js/modules/es6.array.iterator.js"); +__webpack_require__(/*! ./modules/es6.regexp.constructor */ "./node_modules/core-js/modules/es6.regexp.constructor.js"); +__webpack_require__(/*! ./modules/es6.regexp.to-string */ "./node_modules/core-js/modules/es6.regexp.to-string.js"); +__webpack_require__(/*! ./modules/es6.regexp.flags */ "./node_modules/core-js/modules/es6.regexp.flags.js"); +__webpack_require__(/*! ./modules/es6.regexp.match */ "./node_modules/core-js/modules/es6.regexp.match.js"); +__webpack_require__(/*! ./modules/es6.regexp.replace */ "./node_modules/core-js/modules/es6.regexp.replace.js"); +__webpack_require__(/*! ./modules/es6.regexp.search */ "./node_modules/core-js/modules/es6.regexp.search.js"); +__webpack_require__(/*! ./modules/es6.regexp.split */ "./node_modules/core-js/modules/es6.regexp.split.js"); +__webpack_require__(/*! ./modules/es6.promise */ "./node_modules/core-js/modules/es6.promise.js"); +__webpack_require__(/*! ./modules/es6.map */ "./node_modules/core-js/modules/es6.map.js"); +__webpack_require__(/*! ./modules/es6.set */ "./node_modules/core-js/modules/es6.set.js"); +__webpack_require__(/*! ./modules/es6.weak-map */ "./node_modules/core-js/modules/es6.weak-map.js"); +__webpack_require__(/*! ./modules/es6.weak-set */ "./node_modules/core-js/modules/es6.weak-set.js"); +__webpack_require__(/*! ./modules/es6.typed.array-buffer */ "./node_modules/core-js/modules/es6.typed.array-buffer.js"); +__webpack_require__(/*! ./modules/es6.typed.data-view */ "./node_modules/core-js/modules/es6.typed.data-view.js"); +__webpack_require__(/*! ./modules/es6.typed.int8-array */ "./node_modules/core-js/modules/es6.typed.int8-array.js"); +__webpack_require__(/*! ./modules/es6.typed.uint8-array */ "./node_modules/core-js/modules/es6.typed.uint8-array.js"); +__webpack_require__(/*! ./modules/es6.typed.uint8-clamped-array */ "./node_modules/core-js/modules/es6.typed.uint8-clamped-array.js"); +__webpack_require__(/*! ./modules/es6.typed.int16-array */ "./node_modules/core-js/modules/es6.typed.int16-array.js"); +__webpack_require__(/*! ./modules/es6.typed.uint16-array */ "./node_modules/core-js/modules/es6.typed.uint16-array.js"); +__webpack_require__(/*! ./modules/es6.typed.int32-array */ "./node_modules/core-js/modules/es6.typed.int32-array.js"); +__webpack_require__(/*! ./modules/es6.typed.uint32-array */ "./node_modules/core-js/modules/es6.typed.uint32-array.js"); +__webpack_require__(/*! ./modules/es6.typed.float32-array */ "./node_modules/core-js/modules/es6.typed.float32-array.js"); +__webpack_require__(/*! ./modules/es6.typed.float64-array */ "./node_modules/core-js/modules/es6.typed.float64-array.js"); +__webpack_require__(/*! ./modules/es6.reflect.apply */ "./node_modules/core-js/modules/es6.reflect.apply.js"); +__webpack_require__(/*! ./modules/es6.reflect.construct */ "./node_modules/core-js/modules/es6.reflect.construct.js"); +__webpack_require__(/*! ./modules/es6.reflect.define-property */ "./node_modules/core-js/modules/es6.reflect.define-property.js"); +__webpack_require__(/*! ./modules/es6.reflect.delete-property */ "./node_modules/core-js/modules/es6.reflect.delete-property.js"); +__webpack_require__(/*! ./modules/es6.reflect.enumerate */ "./node_modules/core-js/modules/es6.reflect.enumerate.js"); +__webpack_require__(/*! ./modules/es6.reflect.get */ "./node_modules/core-js/modules/es6.reflect.get.js"); +__webpack_require__(/*! ./modules/es6.reflect.get-own-property-descriptor */ "./node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js"); +__webpack_require__(/*! ./modules/es6.reflect.get-prototype-of */ "./node_modules/core-js/modules/es6.reflect.get-prototype-of.js"); +__webpack_require__(/*! ./modules/es6.reflect.has */ "./node_modules/core-js/modules/es6.reflect.has.js"); +__webpack_require__(/*! ./modules/es6.reflect.is-extensible */ "./node_modules/core-js/modules/es6.reflect.is-extensible.js"); +__webpack_require__(/*! ./modules/es6.reflect.own-keys */ "./node_modules/core-js/modules/es6.reflect.own-keys.js"); +__webpack_require__(/*! ./modules/es6.reflect.prevent-extensions */ "./node_modules/core-js/modules/es6.reflect.prevent-extensions.js"); +__webpack_require__(/*! ./modules/es6.reflect.set */ "./node_modules/core-js/modules/es6.reflect.set.js"); +__webpack_require__(/*! ./modules/es6.reflect.set-prototype-of */ "./node_modules/core-js/modules/es6.reflect.set-prototype-of.js"); +__webpack_require__(/*! ./modules/es7.array.includes */ "./node_modules/core-js/modules/es7.array.includes.js"); +__webpack_require__(/*! ./modules/es7.array.flat-map */ "./node_modules/core-js/modules/es7.array.flat-map.js"); +__webpack_require__(/*! ./modules/es7.array.flatten */ "./node_modules/core-js/modules/es7.array.flatten.js"); +__webpack_require__(/*! ./modules/es7.string.at */ "./node_modules/core-js/modules/es7.string.at.js"); +__webpack_require__(/*! ./modules/es7.string.pad-start */ "./node_modules/core-js/modules/es7.string.pad-start.js"); +__webpack_require__(/*! ./modules/es7.string.pad-end */ "./node_modules/core-js/modules/es7.string.pad-end.js"); +__webpack_require__(/*! ./modules/es7.string.trim-left */ "./node_modules/core-js/modules/es7.string.trim-left.js"); +__webpack_require__(/*! ./modules/es7.string.trim-right */ "./node_modules/core-js/modules/es7.string.trim-right.js"); +__webpack_require__(/*! ./modules/es7.string.match-all */ "./node_modules/core-js/modules/es7.string.match-all.js"); +__webpack_require__(/*! ./modules/es7.symbol.async-iterator */ "./node_modules/core-js/modules/es7.symbol.async-iterator.js"); +__webpack_require__(/*! ./modules/es7.symbol.observable */ "./node_modules/core-js/modules/es7.symbol.observable.js"); +__webpack_require__(/*! ./modules/es7.object.get-own-property-descriptors */ "./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js"); +__webpack_require__(/*! ./modules/es7.object.values */ "./node_modules/core-js/modules/es7.object.values.js"); +__webpack_require__(/*! ./modules/es7.object.entries */ "./node_modules/core-js/modules/es7.object.entries.js"); +__webpack_require__(/*! ./modules/es7.object.define-getter */ "./node_modules/core-js/modules/es7.object.define-getter.js"); +__webpack_require__(/*! ./modules/es7.object.define-setter */ "./node_modules/core-js/modules/es7.object.define-setter.js"); +__webpack_require__(/*! ./modules/es7.object.lookup-getter */ "./node_modules/core-js/modules/es7.object.lookup-getter.js"); +__webpack_require__(/*! ./modules/es7.object.lookup-setter */ "./node_modules/core-js/modules/es7.object.lookup-setter.js"); +__webpack_require__(/*! ./modules/es7.map.to-json */ "./node_modules/core-js/modules/es7.map.to-json.js"); +__webpack_require__(/*! ./modules/es7.set.to-json */ "./node_modules/core-js/modules/es7.set.to-json.js"); +__webpack_require__(/*! ./modules/es7.map.of */ "./node_modules/core-js/modules/es7.map.of.js"); +__webpack_require__(/*! ./modules/es7.set.of */ "./node_modules/core-js/modules/es7.set.of.js"); +__webpack_require__(/*! ./modules/es7.weak-map.of */ "./node_modules/core-js/modules/es7.weak-map.of.js"); +__webpack_require__(/*! ./modules/es7.weak-set.of */ "./node_modules/core-js/modules/es7.weak-set.of.js"); +__webpack_require__(/*! ./modules/es7.map.from */ "./node_modules/core-js/modules/es7.map.from.js"); +__webpack_require__(/*! ./modules/es7.set.from */ "./node_modules/core-js/modules/es7.set.from.js"); +__webpack_require__(/*! ./modules/es7.weak-map.from */ "./node_modules/core-js/modules/es7.weak-map.from.js"); +__webpack_require__(/*! ./modules/es7.weak-set.from */ "./node_modules/core-js/modules/es7.weak-set.from.js"); +__webpack_require__(/*! ./modules/es7.global */ "./node_modules/core-js/modules/es7.global.js"); +__webpack_require__(/*! ./modules/es7.system.global */ "./node_modules/core-js/modules/es7.system.global.js"); +__webpack_require__(/*! ./modules/es7.error.is-error */ "./node_modules/core-js/modules/es7.error.is-error.js"); +__webpack_require__(/*! ./modules/es7.math.clamp */ "./node_modules/core-js/modules/es7.math.clamp.js"); +__webpack_require__(/*! ./modules/es7.math.deg-per-rad */ "./node_modules/core-js/modules/es7.math.deg-per-rad.js"); +__webpack_require__(/*! ./modules/es7.math.degrees */ "./node_modules/core-js/modules/es7.math.degrees.js"); +__webpack_require__(/*! ./modules/es7.math.fscale */ "./node_modules/core-js/modules/es7.math.fscale.js"); +__webpack_require__(/*! ./modules/es7.math.iaddh */ "./node_modules/core-js/modules/es7.math.iaddh.js"); +__webpack_require__(/*! ./modules/es7.math.isubh */ "./node_modules/core-js/modules/es7.math.isubh.js"); +__webpack_require__(/*! ./modules/es7.math.imulh */ "./node_modules/core-js/modules/es7.math.imulh.js"); +__webpack_require__(/*! ./modules/es7.math.rad-per-deg */ "./node_modules/core-js/modules/es7.math.rad-per-deg.js"); +__webpack_require__(/*! ./modules/es7.math.radians */ "./node_modules/core-js/modules/es7.math.radians.js"); +__webpack_require__(/*! ./modules/es7.math.scale */ "./node_modules/core-js/modules/es7.math.scale.js"); +__webpack_require__(/*! ./modules/es7.math.umulh */ "./node_modules/core-js/modules/es7.math.umulh.js"); +__webpack_require__(/*! ./modules/es7.math.signbit */ "./node_modules/core-js/modules/es7.math.signbit.js"); +__webpack_require__(/*! ./modules/es7.promise.finally */ "./node_modules/core-js/modules/es7.promise.finally.js"); +__webpack_require__(/*! ./modules/es7.promise.try */ "./node_modules/core-js/modules/es7.promise.try.js"); +__webpack_require__(/*! ./modules/es7.reflect.define-metadata */ "./node_modules/core-js/modules/es7.reflect.define-metadata.js"); +__webpack_require__(/*! ./modules/es7.reflect.delete-metadata */ "./node_modules/core-js/modules/es7.reflect.delete-metadata.js"); +__webpack_require__(/*! ./modules/es7.reflect.get-metadata */ "./node_modules/core-js/modules/es7.reflect.get-metadata.js"); +__webpack_require__(/*! ./modules/es7.reflect.get-metadata-keys */ "./node_modules/core-js/modules/es7.reflect.get-metadata-keys.js"); +__webpack_require__(/*! ./modules/es7.reflect.get-own-metadata */ "./node_modules/core-js/modules/es7.reflect.get-own-metadata.js"); +__webpack_require__(/*! ./modules/es7.reflect.get-own-metadata-keys */ "./node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js"); +__webpack_require__(/*! ./modules/es7.reflect.has-metadata */ "./node_modules/core-js/modules/es7.reflect.has-metadata.js"); +__webpack_require__(/*! ./modules/es7.reflect.has-own-metadata */ "./node_modules/core-js/modules/es7.reflect.has-own-metadata.js"); +__webpack_require__(/*! ./modules/es7.reflect.metadata */ "./node_modules/core-js/modules/es7.reflect.metadata.js"); +__webpack_require__(/*! ./modules/es7.asap */ "./node_modules/core-js/modules/es7.asap.js"); +__webpack_require__(/*! ./modules/es7.observable */ "./node_modules/core-js/modules/es7.observable.js"); +__webpack_require__(/*! ./modules/web.timers */ "./node_modules/core-js/modules/web.timers.js"); +__webpack_require__(/*! ./modules/web.immediate */ "./node_modules/core-js/modules/web.immediate.js"); +__webpack_require__(/*! ./modules/web.dom.iterable */ "./node_modules/core-js/modules/web.dom.iterable.js"); +module.exports = __webpack_require__(/*! ./modules/_core */ "./node_modules/core-js/modules/_core.js"); + + +/***/ }), + +/***/ "./node_modules/css-loader/lib/css-base.js": +/*!*************************************************!*\ + !*** ./node_modules/css-loader/lib/css-base.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +module.exports = function(useSourceMap) { + var list = []; + + // return the list of modules as css string + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item, useSourceMap); + if(item[2]) { + return "@media " + item[2] + "{" + content + "}"; + } else { + return content; + } + }).join(""); + }; + + // import a list of modules into the list + list.i = function(modules, mediaQuery) { + if(typeof modules === "string") + modules = [[null, modules, ""]]; + var alreadyImportedModules = {}; + for(var i = 0; i < this.length; i++) { + var id = this[i][0]; + if(typeof id === "number") + alreadyImportedModules[id] = true; + } + for(i = 0; i < modules.length; i++) { + var item = modules[i]; + // skip already imported module + // this implementation is not 100% perfect for weird media query combinations + // when a module is imported multiple times with different media queries. + // I hope this will never occur (Hey this way we have smaller bundles) + if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { + if(mediaQuery && !item[2]) { + item[2] = mediaQuery; + } else if(mediaQuery) { + item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; + } + list.push(item); + } + } + }; + return list; +}; + +function cssWithMappingToString(item, useSourceMap) { + var content = item[1] || ''; + var cssMapping = item[3]; + if (!cssMapping) { + return content; + } + + if (useSourceMap && typeof btoa === 'function') { + var sourceMapping = toComment(cssMapping); + var sourceURLs = cssMapping.sources.map(function (source) { + return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' + }); + + return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); + } + + return [content].join('\n'); +} + +// Adapted from convert-source-map (MIT) +function toComment(sourceMap) { + // eslint-disable-next-line no-undef + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); + var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; + + return '/*# ' + data + ' */'; +} + + +/***/ }), + +/***/ "./node_modules/html-janitor/src/html-janitor.js": +/*!*******************************************************!*\ + !*** ./node_modules/html-janitor/src/html-janitor.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) { + if (true) { + !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), + __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? + (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : + __WEBPACK_AMD_DEFINE_FACTORY__), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} +}(this, function () { + + /** + * @param {Object} config.tags Dictionary of allowed tags. + * @param {boolean} config.keepNestedBlockElements Default false. + */ + function HTMLJanitor(config) { + + var tagDefinitions = config['tags']; + var tags = Object.keys(tagDefinitions); + + var validConfigValues = tags + .map(function(k) { return typeof tagDefinitions[k]; }) + .every(function(type) { return type === 'object' || type === 'boolean' || type === 'function'; }); + + if(!validConfigValues) { + throw new Error("The configuration was invalid"); + } + + this.config = config; + } + + // TODO: not exhaustive? + var blockElementNames = ['P', 'LI', 'TD', 'TH', 'DIV', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'PRE']; + function isBlockElement(node) { + return blockElementNames.indexOf(node.nodeName) !== -1; + } + + var inlineElementNames = ['A', 'B', 'STRONG', 'I', 'EM', 'SUB', 'SUP', 'U', 'STRIKE']; + function isInlineElement(node) { + return inlineElementNames.indexOf(node.nodeName) !== -1; + } + + HTMLJanitor.prototype.clean = function (html) { + var sandbox = document.createElement('div'); + sandbox.innerHTML = html; + + this._sanitize(sandbox); + + return sandbox.innerHTML; + }; + + HTMLJanitor.prototype._sanitize = function (parentNode) { + var treeWalker = createTreeWalker(parentNode); + var node = treeWalker.firstChild(); + if (!node) { return; } + + do { + // Ignore nodes that have already been sanitized + if (node._sanitized) { + continue; + } + + if (node.nodeType === Node.TEXT_NODE) { + // If this text node is just whitespace and the previous or next element + // sibling is a block element, remove it + // N.B.: This heuristic could change. Very specific to a bug with + // `contenteditable` in Firefox: http://jsbin.com/EyuKase/1/edit?js,output + // FIXME: make this an option? + if (node.data.trim() === '' + && ((node.previousElementSibling && isBlockElement(node.previousElementSibling)) + || (node.nextElementSibling && isBlockElement(node.nextElementSibling)))) { + parentNode.removeChild(node); + this._sanitize(parentNode); + break; + } else { + continue; + } + } + + // Remove all comments + if (node.nodeType === Node.COMMENT_NODE) { + parentNode.removeChild(node); + this._sanitize(parentNode); + break; + } + + var isInline = isInlineElement(node); + var containsBlockElement; + if (isInline) { + containsBlockElement = Array.prototype.some.call(node.childNodes, isBlockElement); + } + + // Block elements should not be nested (e.g.
  • ...); if + // they are, we want to unwrap the inner block element. + var isNotTopContainer = !! parentNode.parentNode; + var isNestedBlockElement = + isBlockElement(parentNode) && + isBlockElement(node) && + isNotTopContainer; + + var nodeName = node.nodeName.toLowerCase(); + + var allowedAttrs = getAllowedAttrs(this.config, nodeName, node); + + var isInvalid = isInline && containsBlockElement; + + // Drop tag entirely according to the whitelist *and* if the markup + // is invalid. + if (isInvalid || shouldRejectNode(node, allowedAttrs) + || (!this.config.keepNestedBlockElements && isNestedBlockElement)) { + // Do not keep the inner text of SCRIPT/STYLE elements. + if (! (node.nodeName === 'SCRIPT' || node.nodeName === 'STYLE')) { + while (node.childNodes.length > 0) { + parentNode.insertBefore(node.childNodes[0], node); + } + } + parentNode.removeChild(node); + + this._sanitize(parentNode); + break; + } + + // Sanitize attributes + for (var a = 0; a < node.attributes.length; a += 1) { + var attr = node.attributes[a]; + + if (shouldRejectAttr(attr, allowedAttrs, node)) { + node.removeAttribute(attr.name); + // Shift the array to continue looping. + a = a - 1; + } + } + + // Sanitize children + this._sanitize(node); + + // Mark node as sanitized so it's ignored in future runs + node._sanitized = true; + } while ((node = treeWalker.nextSibling())); + }; + + function createTreeWalker(node) { + return document.createTreeWalker(node, + NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT, + null, false); + } + + function getAllowedAttrs(config, nodeName, node){ + if (typeof config.tags[nodeName] === 'function') { + return config.tags[nodeName](node); + } else { + return config.tags[nodeName]; + } + } + + function shouldRejectNode(node, allowedAttrs){ + if (typeof allowedAttrs === 'undefined') { + return true; + } else if (typeof allowedAttrs === 'boolean') { + return !allowedAttrs; + } + + return false; + } + + function shouldRejectAttr(attr, allowedAttrs, node){ + var attrName = attr.name.toLowerCase(); + + if (allowedAttrs === true){ + return false; + } else if (typeof allowedAttrs[attrName] === 'function'){ + return !allowedAttrs[attrName](attr.value, node); + } else if (typeof allowedAttrs[attrName] === 'undefined'){ + return true; + } else if (allowedAttrs[attrName] === false) { + return true; + } else if (typeof allowedAttrs[attrName] === 'string') { + return (allowedAttrs[attrName] !== attr.value); + } + + return false; + } + + return HTMLJanitor; + +})); + + +/***/ }), + +/***/ "./node_modules/webpack/buildin/global.js": +/*!***********************************!*\ + !*** (webpack)/buildin/global.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1, eval)("this"); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + +/***/ }), + +/***/ "./src/codex.js": +/*!**********************!*\ + !*** ./src/codex.js ***! + \**********************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(_) {/** + * Codex Editor + * + * Short Description (눈_눈;) + * @version 2.0.0 + * + * How to start? + * Example: + * new CodexEditor({ + * holderId : 'codex-editor', + * initialBlock : 'text', + * placeholder : 'Write your story....', + * tools: { + * quote: Quote, + * anotherTool : AnotherTool + * }, + * toolsConfig: { + * quote: { + * iconClassname : 'quote-icon', + * displayInToolbox : true, + * enableLineBreaks : true + * }, + * anotherTool: { + * iconClassname : 'tool-icon' + * } + * } + * }); + * + * - tools is an object: { + * pluginName: PluginClass, + * ..... + * } + * - toolsConfig is an additional configuration that uses Codex Editor API + * iconClassname - CSS classname of toolbox icon + * displayInToolbox - if you want to see your Tool in toolbox hided in "plus" button, than set "True". By default : "False" + * enableLineBreaks - by default enter creates new block that set as initialblock, but if you set this property "True", enter will break the lines in current block + * + * @author CodeX-Team + * + */ + +/** + * @typedef {CodexEditor} CodexEditor - editor class + */ + +/** + * @typedef {Object} EditorConfig + * @property {String} holderId - Element to append Editor + * @property {Array} data - Blocks list in JSON-format + * @property {Object} tools - Map for used Tools in format { name : Class, ... } + * @property {String} initialBlock - This Tool will be added by default + * @property {String} placeholder - First Block placeholder + * @property {Object} sanitizer - @todo fill desc + * @property {Boolean} hideToolbar - @todo fill desc + * @property {Object} toolsConfig - tools configuration {@link tools#ToolConfig} + */ + +/** + * Dynamically imported utils + * + * @typedef {Dom} $ - {@link components/dom.js} + * @typedef {Util} _ - {@link components/utils.js} + */ + + + +/** + * Apply polyfills + */ + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +__webpack_require__(/*! babel-core/register */ "./node_modules/babel-core/register.js"); + +__webpack_require__(/*! babel-polyfill */ "./node_modules/babel-polyfill/lib/index.js"); + +__webpack_require__(/*! components/polyfills */ "./src/components/polyfills.js"); + +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Require Editor modules places in components/modules dir + */ +// eslint-disable-next-line +var modules = ["api-blocks.ts","api-events.ts","api-listener.ts","api-sanitizer.ts","api-saver.ts","api-selection.ts","api-toolbar.ts","api.ts","block-events.ts","blockManager.js","caret.js","events.js","listeners.js","paste.ts","renderer.js","sanitizer.js","saver.js","toolbar-blockSettings.js","toolbar-inline.ts","toolbar-toolbox.js","toolbar.js","tools.js","ui.js"].map(function (module) { + return __webpack_require__("./src/components/modules sync recursive ^\\.\\/.*$")("./" + module); +}); + +/** + * @class + * + * @classdesc CodeX Editor base class + * + * @property this.config - all settings + * @property this.moduleInstances - constructed editor components + * + * @type {CodexEditor} + */ + +var CodexEditor = function () { + _createClass(CodexEditor, null, [{ + key: 'version', + + /** Editor version */ + get: function get() { + return "2.0.0"; + } + + /** + * @param {EditorConfig} config - user configuration + * + */ + + }]); + + function CodexEditor(config) { + var _this = this; + + _classCallCheck(this, CodexEditor); + + /** + * Configuration object + * @type {EditorConfig} + */ + this.config = {}; + + /** + * @typedef {Object} EditorComponents + * @property {BlockManager} BlockManager + * @property {Tools} Tools + * @property {Events} Events + * @property {UI} UI + * @property {Toolbar} Toolbar + * @property {Toolbox} Toolbox + * @property {BlockSettings} BlockSettings + * @property {Renderer} Renderer + * @property {InlineToolbar} InlineToolbar + */ + this.moduleInstances = {}; + + Promise.resolve().then(function () { + _this.configuration = config; + }).then(function () { + return _this.init(); + }).then(function () { + return _this.start(); + }).then(function () { + var methods = _this.moduleInstances.API.methods; + + /** + * Make API methods available from inside easier + */ + for (var method in methods) { + _this[method] = methods[method]; + } + + // todo Is it necessary? + delete _this.moduleInstances; + }).then(function () { + console.log('CodeX Editor is ready!'); + }).catch(function (error) { + console.log('CodeX Editor does not ready because of %o', error); + }); + } + + /** + * Setting for configuration + * @param {EditorConfig} config + */ + + + _createClass(CodexEditor, [{ + key: 'init', + + + /** + * Initializes modules: + * - make and save instances + * - configure + */ + value: function init() { + /** + * Make modules instances and save it to the @property this.moduleInstances + */ + this.constructModules(); + + /** + * Modules configuration + */ + this.configureModules(); + } + + /** + * Make modules instances and save it to the @property this.moduleInstances + */ + + }, { + key: 'constructModules', + value: function constructModules() { + var _this2 = this; + + modules.forEach(function (Module) { + try { + /** + * We use class name provided by displayName property + * + * On build, Babel will transform all Classes to the Functions so, name will always be 'Function' + * To prevent this, we use 'babel-plugin-class-display-name' plugin + * @see https://www.npmjs.com/package/babel-plugin-class-display-name + */ + _this2.moduleInstances[Module.displayName] = new Module({ + config: _this2.configuration + }); + } catch (e) { + console.log('Module %o skipped because %o', Module, e); + } + }); + } + + /** + * Modules instances configuration: + * - pass other modules to the 'state' property + * - ... + */ + + }, { + key: 'configureModules', + value: function configureModules() { + for (var name in this.moduleInstances) { + /** + * Module does not need self-instance + */ + this.moduleInstances[name].state = this.getModulesDiff(name); + } + } + + /** + * Return modules without passed name + */ + + }, { + key: 'getModulesDiff', + value: function getModulesDiff(name) { + var diff = {}; + + for (var moduleName in this.moduleInstances) { + /** + * Skip module with passed name + */ + if (moduleName === name) { + continue; + } + diff[moduleName] = this.moduleInstances[moduleName]; + } + + return diff; + } + + /** + * Start Editor! + * + * Get list of modules that needs to be prepared and return a sequence (Promise) + * @return {Promise} + */ + + }, { + key: 'start', + value: function () { + var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { + var _this3 = this; + + var modulesToPrepare; + return regeneratorRuntime.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + modulesToPrepare = ['Tools', 'UI', 'BlockManager', 'Paste']; + _context2.next = 3; + return modulesToPrepare.reduce(function (promise, module) { + return promise.then(_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { + return regeneratorRuntime.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _.log('Preparing ' + module + ' module', 'time'); + + _context.prev = 1; + _context.next = 4; + return _this3.moduleInstances[module].prepare(); + + case 4: + _context.next = 9; + break; + + case 6: + _context.prev = 6; + _context.t0 = _context['catch'](1); + + _.log('Module ' + module + ' was skipped because of %o', 'warn', _context.t0); + + case 9: + _.log('Preparing ' + module + ' module', 'timeEnd'); + + case 10: + case 'end': + return _context.stop(); + } + } + }, _callee, _this3, [[1, 6]]); + }))); + }, Promise.resolve()); + + case 3: + return _context2.abrupt('return', this.moduleInstances.Renderer.render(this.config.data.items)); + + case 4: + case 'end': + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function start() { + return _ref.apply(this, arguments); + } + + return start; + }() + }, { + key: 'configuration', + set: function set(config) { + /** + * Initlai block type + * Uses in case when there is no items passed + * @type {{type: (*), data: {text: null}}} + */ + var initialBlock = { + type: config.initialBlock, + data: {} + }; + + this.config.holderId = config.holderId; + this.config.placeholder = config.placeholder || 'write your story...'; + this.config.sanitizer = config.sanitizer || { + p: true, + b: true, + a: true + }; + + this.config.hideToolbar = config.hideToolbar ? config.hideToolbar : false; + this.config.tools = config.tools || {}; + this.config.toolsConfig = config.toolsConfig || {}; + this.config.data = config.data || {}; + + /** + * Initialize items to pass data to the Renderer + */ + if (_.isEmpty(this.config.data)) { + this.config.data = {}; + this.config.data.items = [initialBlock]; + } else { + if (!this.config.data.items || this.config.data.items.length === 0) { + this.config.data.items = [initialBlock]; + } + } + + /** + * If initial Block's Tool was not passed, use the first Tool in config.tools + */ + if (!config.initialBlock) { + for (this.config.initialBlock in this.config.tools) { + break; + } + } else { + this.config.initialBlock = config.initialBlock; + } + } + + /** + * Returns private property + * @returns {EditorConfig} + */ + , + get: function get() { + return this.config; + } + }]); + + return CodexEditor; +}(); + +CodexEditor.displayName = 'CodexEditor'; +exports.default = CodexEditor; +; + +// module.exports = (function (editor) { +// +// 'use strict'; +// +// editor.version = VERSION; +// editor.scriptPrefix = 'cdx-script-'; +// +// var init = function () { +// +// editor.core = require('./modules/core'); +// editor.tools = require('./modules/tools'); +// editor.ui = require('./modules/ui'); +// editor.transport = require('./modules/transport'); +// editor.renderer = require('./modules/renderer'); +// editor.saver = require('./modules/saver'); +// editor.content = require('./modules/content'); +// editor.toolbar = require('./modules/toolbar/toolbar'); +// editor.callback = require('./modules/callbacks'); +// editor.draw = require('./modules/draw'); +// editor.caret = require('./modules/caret'); +// editor.notifications = require('./modules/notifications'); +// editor.parser = require('./modules/parser'); +// editor.sanitizer = require('./modules/sanitizer'); +// editor.listeners = require('./modules/listeners'); +// editor.destroyer = require('./modules/destroyer'); +// editor.paste = require('./modules/paste'); +// +// }; +// +// /** +// * @public +// * holds initial settings +// */ +// editor.settings = { +// tools : ['text', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'], +// holderId : 'codex-editor', +// +// // Type of block showing on empty editor +// initialBlockPlugin: 'text' +// }; +// +// /** +// * public +// * +// * Static nodes +// */ +// editor.nodes = { +// holder : null, +// wrapper : null, +// toolbar : null, +// inlineToolbar : { +// wrapper : null, +// buttons : null, +// actions : null +// }, +// toolbox : null, +// notifications : null, +// plusButton : null, +// showSettingsButton: null, +// showTrashButton : null, +// blockSettings : null, +// pluginSettings : null, +// defaultSettings : null, +// toolbarButtons : {}, // { type : DomEl, ... } +// redactor : null +// }; +// +// /** +// * @public +// * +// * Output state +// */ +// editor.state = { +// jsonOutput : [], +// blocks : [], +// inputs : [] +// }; +// +// /** +// * @public +// * Editor plugins +// */ +// editor.tools = {}; +// +// editor.start = function (userSettings) { +// +// init(); +// +// editor.core.prepare(userSettings) +// +// // If all ok, make UI, bind events and parse initial-content +// .then(editor.ui.prepare) +// .then(editor.tools.prepare) +// .then(editor.sanitizer.prepare) +// .then(editor.paste.prepare) +// .then(editor.transport.prepare) +// .then(editor.renderer.makeBlocksFromData) +// .then(editor.ui.saveInputs) +// .catch(function (error) { +// +// editor.core.log('Initialization failed with error: %o', 'warn', error); +// +// }); +// +// }; +// +// return editor; +// +// })({}); + +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/__module.ts": +/*!************************************!*\ + !*** ./src/components/__module.ts ***! + \************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * @abstract + * @class Module + * @classdesc All modules inherits from this class. + * + * @typedef {Module} Module + * @property {Object} config - Editor user settings + * @property {IEditorConfig} Editor - List of Editor modules + */ +var Module = function () { + /** + * @constructor + * @param {IModuleConfig} + */ + function Module(_ref) { + var config = _ref.config; + + _classCallCheck(this, Module); + + if (new.target === Module) { + throw new TypeError('Constructors for abstract class Module are not allowed.'); + } + this.config = config; + } + /** + * Editor modules setter + * @param {IEditor} Editor + */ + + + _createClass(Module, [{ + key: 'state', + set: function set(Editor) { + this.Editor = Editor; + } + }]); + + return Module; +}(); + +Module.displayName = 'Module'; +exports.default = Module; +module.exports = exports['default']; + +/***/ }), + +/***/ "./src/components/block-tunes/block-tune-delete.ts": +/*!*********************************************************!*\ + !*** ./src/components/block-tunes/block-tune-delete.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function($) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var DeleteTune = function () { + /** + * DeleteTune constructor + * + * @param {Object} api + */ + function DeleteTune(_ref) { + var _this = this; + + var api = _ref.api; + + _classCallCheck(this, DeleteTune); + + /** + * Styles + * @type {{wrapper: string}} + */ + this.CSS = { + wrapper: 'ass', + button: 'ce-settings__button', + buttonDelete: 'ce-settings__button--delete', + buttonConfirm: 'ce-settings__button--confirm' + }; + /** + * Tune nodes + */ + this.nodes = { + button: null + }; + this.api = api; + this.resetConfirmation = function () { + _this.setConfirmation(false); + }; + } + /** + * Create "Delete" button and add click event listener + * @returns [Element} + */ + + + _createClass(DeleteTune, [{ + key: 'render', + value: function render() { + var _this2 = this; + + this.nodes.button = $.make('div', [this.CSS.button, this.CSS.buttonDelete], {}); + this.nodes.button.appendChild($.svg('cross', 12, 12)); + this.api.listener.on(this.nodes.button, 'click', function (event) { + return _this2.handleClick(event); + }, false); + return this.nodes.button; + } + /** + * Delete block conditions passed + * @param {MouseEvent} event + */ + + }, { + key: 'handleClick', + value: function handleClick(event) { + /** + * if block is not waiting the confirmation, subscribe on block-settings-closing event to reset + * otherwise delete block + */ + if (!this.needConfirmation) { + this.setConfirmation(true); + /** + * Subscribe on event. + * When toolbar block settings is closed but block deletion is not confirmed, + * then reset confirmation state + */ + this.api.events.on('block-settings-closed', this.resetConfirmation); + } else { + /** + * Unsubscribe from block-settings closing event + */ + this.api.events.off('block-settings-closed', this.resetConfirmation); + this.api.blocks.delete(); + } + } + /** + * change tune state + */ + + }, { + key: 'setConfirmation', + value: function setConfirmation(state) { + this.needConfirmation = state; + this.nodes.button.classList.add(this.CSS.buttonConfirm); + } + }]); + + return DeleteTune; +}(); + +DeleteTune.displayName = 'DeleteTune'; +exports.default = DeleteTune; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! dom */ "./src/components/dom.js"))) + +/***/ }), + +/***/ "./src/components/block-tunes/block-tune-move-down.ts": +/*!************************************************************!*\ + !*** ./src/components/block-tunes/block-tune-move-down.ts ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function($) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var MoveDownTune = function () { + /** + * MoveDownTune constructor + * + * @param {Object} api + */ + function MoveDownTune(_ref) { + var api = _ref.api; + + _classCallCheck(this, MoveDownTune); + + /** + * Styles + * @type {{wrapper: string}} + */ + this.CSS = { + button: 'ce-settings__button', + wrapper: 'ce-tune-move-down', + animation: 'wobble' + }; + this.api = api; + } + /** + * Return 'move down' button + */ + + + _createClass(MoveDownTune, [{ + key: 'render', + value: function render() { + var _this = this; + + var moveDownButton = $.make('div', [this.CSS.button, this.CSS.wrapper], {}); + moveDownButton.appendChild($.svg('arrow-down', 14, 14)); + this.api.listener.on(moveDownButton, 'click', function (event) { + return _this.handleClick(event, moveDownButton); + }, false); + return moveDownButton; + } + /** + * Handle clicks on 'move down' button + * @param {MouseEvent} event + * @param {HTMLElement} button + */ + + }, { + key: 'handleClick', + value: function handleClick(event, button) { + var _this2 = this; + + var currentBlockIndex = this.api.blocks.getCurrentBlockIndex(); + // If Block is last do nothing + if (currentBlockIndex === this.api.blocks.getBlocksCount() - 1) { + button.classList.add(this.CSS.animation); + window.setTimeout(function () { + button.classList.remove(_this2.CSS.animation); + }, 500); + return; + } + var nextBlockElement = this.api.blocks.getBlockByIndex(currentBlockIndex + 1).holder, + nextBlockCoords = nextBlockElement.getBoundingClientRect(); + var scrollOffset = Math.abs(window.innerHeight - nextBlockElement.offsetHeight); + /** + * Next block ends on screen. + * Increment scroll by next block's height to save element onscreen-position + */ + if (nextBlockCoords.top < window.innerHeight) { + scrollOffset = window.scrollY + nextBlockElement.offsetHeight; + } + window.scrollTo(0, scrollOffset); + /** Change blocks positions */ + this.api.blocks.swap(currentBlockIndex, currentBlockIndex + 1); + } + }]); + + return MoveDownTune; +}(); + +MoveDownTune.displayName = 'MoveDownTune'; +exports.default = MoveDownTune; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! dom */ "./src/components/dom.js"))) + +/***/ }), + +/***/ "./src/components/block-tunes/block-tune-move-up.ts": +/*!**********************************************************!*\ + !*** ./src/components/block-tunes/block-tune-move-up.ts ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function($) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var MoveUpTune = function () { + /** + * MoveUpTune constructor + * + * @param {Object} api + */ + function MoveUpTune(_ref) { + var api = _ref.api; + + _classCallCheck(this, MoveUpTune); + + /** + * Styles + * @type {{wrapper: string}} + */ + this.CSS = { + button: 'ce-settings__button', + wrapper: 'ce-tune-move-up', + animation: 'wobble' + }; + this.api = api; + } + /** + * Create "MoveUp" button and add click event listener + * @returns [Element} + */ + + + _createClass(MoveUpTune, [{ + key: 'render', + value: function render() { + var _this = this; + + var moveUpButton = $.make('div', [this.CSS.button, this.CSS.wrapper], {}); + moveUpButton.appendChild($.svg('arrow-up', 14, 14)); + this.api.listener.on(moveUpButton, 'click', function (event) { + return _this.handleClick(event, moveUpButton); + }, false); + return moveUpButton; + } + /** + * Move current block up + * @param {MouseEvent} event + * @param {HTMLElement} button + */ + + }, { + key: 'handleClick', + value: function handleClick(event, button) { + var _this2 = this; + + var currentBlockIndex = this.api.blocks.getCurrentBlockIndex(); + if (currentBlockIndex === 0) { + button.classList.add(this.CSS.animation); + window.setTimeout(function () { + button.classList.remove(_this2.CSS.animation); + }, 500); + return; + } + var currentBlockElement = this.api.blocks.getBlockByIndex(currentBlockIndex).holder, + previousBlockElement = this.api.blocks.getBlockByIndex(currentBlockIndex - 1).holder; + /** + * Here is two cases: + * - when previous block has negative offset and part of it is visible on window, then we scroll + * by window's height and add offset which is mathematically difference between two blocks + * + * - when previous block is visible and has offset from the window, + * than we scroll window to the difference between this offsets. + */ + var currentBlockCoords = currentBlockElement.getBoundingClientRect(), + previousBlockCoords = previousBlockElement.getBoundingClientRect(); + var scrollUpOffset = void 0; + if (previousBlockCoords.top > 0) { + scrollUpOffset = Math.abs(currentBlockCoords.top) - Math.abs(previousBlockCoords.top); + } else { + scrollUpOffset = window.innerHeight - Math.abs(currentBlockCoords.top) + Math.abs(previousBlockCoords.top); + } + window.scrollBy(0, -1 * scrollUpOffset); + /** Change blocks positions */ + this.api.blocks.swap(currentBlockIndex, currentBlockIndex - 1); + } + }]); + + return MoveUpTune; +}(); + +MoveUpTune.displayName = 'MoveUpTune'; +exports.default = MoveUpTune; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! dom */ "./src/components/dom.js"))) + +/***/ }), + +/***/ "./src/components/block.js": +/*!*********************************!*\ + !*** ./src/components/block.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function($, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * @class Block + * @classdesc This class describes editor`s block, including block`s HTMLElement, data and tool + * + * @property {Tool} tool — current block tool (Paragraph, for example) + * @property {Object} CSS — block`s css classes + * + */ + +/** Import default tunes */ + + +var _blockTuneMoveUp = __webpack_require__(/*! ./block-tunes/block-tune-move-up */ "./src/components/block-tunes/block-tune-move-up.ts"); + +var _blockTuneMoveUp2 = _interopRequireDefault(_blockTuneMoveUp); + +var _blockTuneDelete = __webpack_require__(/*! ./block-tunes/block-tune-delete */ "./src/components/block-tunes/block-tune-delete.ts"); + +var _blockTuneDelete2 = _interopRequireDefault(_blockTuneDelete); + +var _blockTuneMoveDown = __webpack_require__(/*! ./block-tunes/block-tune-move-down */ "./src/components/block-tunes/block-tune-move-down.ts"); + +var _blockTuneMoveDown2 = _interopRequireDefault(_blockTuneMoveDown); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * @classdesc Abstract Block class that contains Block information, Tool name and Tool class instance + * + * @property tool - Tool instance + * @property html - Returns HTML content of plugin + * @property holder - Div element that wraps block content with Tool's content. Has `ce-block` CSS class + * @property pluginsContent - HTML content that returns by Tool's render function + */ +var Block = function () { + /** + * @constructor + * @param {String} toolName - Tool name that passed on initialization + * @param {Object} toolInstance — passed Tool`s instance that rendered the Block + * @param {Object} settings - default settings + * @param {Object} apiMethods - Editor API + */ + function Block(toolName, toolInstance, settings, apiMethods) { + _classCallCheck(this, Block); + + this.name = toolName; + this.tool = toolInstance; + this.settings = settings; + this.api = apiMethods; + this.holder = this.compose(); + + /** + * @type {IBlockTune[]} + */ + this.tunes = this.makeTunes(); + } + + /** + * CSS classes for the Block + * @return {{wrapper: string, content: string}} + */ + + + _createClass(Block, [{ + key: 'compose', + + + /** + * Make default Block wrappers and put Tool`s content there + * @returns {HTMLDivElement} + */ + value: function compose() { + var wrapper = $.make('div', Block.CSS.wrapper), + contentNode = $.make('div', Block.CSS.content), + pluginsContent = this.tool.render(); + + contentNode.appendChild(pluginsContent); + wrapper.appendChild(contentNode); + return wrapper; + } + + /** + * Calls Tool's method + * + * Method checks tool property {MethodName}. Fires method with passes params If it is instance of Function + * + * @param {String} methodName + * @param {Object} params + */ + + }, { + key: 'call', + value: function call(methodName, params) { + /** + * call Tool's method with the instance context + */ + if (this.tool[methodName] && this.tool[methodName] instanceof Function) { + this.tool[methodName].call(this.tool, params); + } + } + + /** + * Returns Plugins content + * @return {Node} + */ + + }, { + key: 'mergeWith', + + + /** + * Call plugins merge method + * @param {Object} data + */ + value: function mergeWith(data) { + var _this = this; + + return Promise.resolve().then(function () { + _this.tool.merge(data); + }); + } + /** + * Extracts data from Block + * Groups Tool's save processing time + * @return {Object} + */ + + }, { + key: 'save', + value: function save() { + var _this2 = this; + + var extractedBlock = this.tool.save(this.pluginsContent); + + /** Measuring execution time*/ + var measuringStart = window.performance.now(), + measuringEnd = void 0; + + return Promise.resolve(extractedBlock).then(function (finishedExtraction) { + /** measure promise execution */ + measuringEnd = window.performance.now(); + + return { + tool: _this2.name, + data: finishedExtraction, + time: measuringEnd - measuringStart + }; + }).catch(function (error) { + _.log('Saving proccess for ' + this.tool.name + ' tool failed due to the ' + error, 'log', 'red'); + }); + } + + /** + * Uses Tool's validation method to check the correctness of output data + * Tool's validation method is optional + * + * @description Method also can return data if it passed the validation + * + * @param {Object} data + * @returns {Boolean|Object} valid + */ + + }, { + key: 'validateData', + value: function validateData(data) { + var isValid = true; + + if (this.tool.validate instanceof Function) { + isValid = this.tool.validate(data); + } + + if (!isValid) { + return false; + } + + return data; + } + + /** + * Make an array with default settings + * Each block has default tune instance that have states + * @return {IBlockTune[]} + */ + + }, { + key: 'makeTunes', + value: function makeTunes() { + var _this3 = this; + + var tunesList = [_blockTuneMoveUp2.default, _blockTuneDelete2.default, _blockTuneMoveDown2.default]; + + // Pluck tunes list and return tune instances with passed Editor API and settings + return tunesList.map(function (tune) { + return new tune({ + api: _this3.api, + settings: _this3.settings + }); + }); + } + + /** + * Enumerates initialized tunes and returns fragment that can be appended to the toolbars area + * @return {DocumentFragment} + */ + + }, { + key: 'renderTunes', + value: function renderTunes() { + var tunesElement = document.createDocumentFragment(); + + this.tunes.forEach(function (tune) { + $.append(tunesElement, tune.render()); + }); + + return tunesElement; + } + + /** + * Check block for emptiness + * @return {Boolean} + */ + + }, { + key: 'pluginsContent', + get: function get() { + var pluginsContent = this.holder.querySelector('.' + Block.CSS.content); + + if (pluginsContent && pluginsContent.childNodes.length) { + return pluginsContent.childNodes[0]; + } + + return null; + } + + /** + * Get Block's JSON data + * @return {Object} + */ + + }, { + key: 'data', + get: function get() { + return this.save(); + } + + /** + * is block mergeable + * We plugin have merge function then we call it mergable + * @return {boolean} + */ + + }, { + key: 'mergeable', + get: function get() { + return typeof this.tool.merge === 'function'; + } + }, { + key: 'isEmpty', + get: function get() { + /** + * Allow Tool to represent decorative contentless blocks: for example "* * *"-tool + * That Tools are not empty + */ + if (this.tool.contentless) { + return false; + } + + var emptyText = $.isEmpty(this.pluginsContent), + emptyMedia = !this.hasMedia; + + return emptyText && emptyMedia; + } + + /** + * Check if block has a media content such as images, iframes and other + * @return {Boolean} + */ + + }, { + key: 'hasMedia', + get: function get() { + /** + * This tags represents media-content + * @type {string[]} + */ + var mediaTags = ['img', 'iframe', 'video', 'audio', 'source', 'input', 'textarea', 'twitterwidget']; + + return !!this.holder.querySelector(mediaTags.join(',')); + } + + /** + * Set selected state + * @param {Boolean} state - 'true' to select, 'false' to remove selection + */ + + }, { + key: 'selected', + set: function set(state) { + /** + * We don't need to mark Block as Selected when it is not empty + */ + if (state === true && !this.isEmpty) { + this.holder.classList.add(Block.CSS.selected); + } else { + this.holder.classList.remove(Block.CSS.selected); + } + } + }], [{ + key: 'CSS', + get: function get() { + return { + wrapper: 'ce-block', + content: 'ce-block__content', + selected: 'ce-block--selected' + }; + } + }]); + + return Block; +}(); + +Block.displayName = 'Block'; +exports.default = Block; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! dom */ "./src/components/dom.js"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/dom.js": +/*!*******************************!*\ + !*** ./src/components/dom.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * DOM manipulations helper + */ +var Dom = function () { + function Dom() { + _classCallCheck(this, Dom); + } + + _createClass(Dom, null, [{ + key: 'isSingleTag', + + /** + * Check if passed tag has no closed tag + * @param {Element} tag + * @return {Boolean} + */ + value: function isSingleTag(tag) { + return tag.tagName && ['AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR'].includes(tag.tagName); + } + }, { + key: 'make', + + + /** + * Helper for making Elements with classname and attributes + * + * @param {string} tagName - new Element tag name + * @param {array|string} classNames - list or name of CSS classname(s) + * @param {Object} attributes - any attributes + * @return {Element} + */ + value: function make(tagName) { + var classNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var el = document.createElement(tagName); + + if (Array.isArray(classNames)) { + var _el$classList; + + (_el$classList = el.classList).add.apply(_el$classList, _toConsumableArray(classNames)); + } else if (classNames) { + el.classList.add(classNames); + } + + for (var attrName in attributes) { + el[attrName] = attributes[attrName]; + } + + return el; + } + + /** + * Creates Text Node with the passed content + * @param {String} content - text content + * @return {Text} + */ + + }, { + key: 'text', + value: function text(content) { + return document.createTextNode(content); + } + + /** + * Creates SVG icon linked to the sprite + * @param {string} name - name (id) of icon from sprite + * @param {number} width + * @param {number} height + * @return {SVGElement} + */ + + }, { + key: 'svg', + value: function svg(name) { + var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 14; + var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 14; + + var icon = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); + + icon.classList.add('icon', 'icon--' + name); + icon.setAttribute('width', width + 'px'); + icon.setAttribute('height', height + 'px'); + icon.innerHTML = ''; + + return icon; + } + + /** + * Append one or several elements to the parent + * + * @param {Element} parent - where to append + * @param {Element|Element[]} - element ore elements list + */ + + }, { + key: 'append', + value: function append(parent, elements) { + if (Array.isArray(elements)) { + elements.forEach(function (el) { + return parent.appendChild(el); + }); + } else { + parent.appendChild(elements); + } + } + + /** + * Swap two elements in parent + * @param {HTMLElement} el1 - from + * @param {HTMLElement} el2 - to + */ + + }, { + key: 'swap', + value: function swap(el1, el2) { + // create marker element and insert it where el1 is + var temp = document.createElement('div'), + parent = el1.parentNode; + + parent.insertBefore(temp, el1); + + // move el1 to right before el2 + parent.insertBefore(el1, el2); + + // move el2 to right before where el1 used to be + parent.insertBefore(el2, temp); + + // remove temporary marker node + parent.removeChild(temp); + } + + /** + * Selector Decorator + * + * Returns first match + * + * @param {Element} el - element we searching inside. Default - DOM Document + * @param {String} selector - searching string + * + * @returns {Element} + */ + + }, { + key: 'find', + value: function find() { + var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document; + var selector = arguments[1]; + + return el.querySelector(selector); + } + + /** + * Selector Decorator. + * + * Returns all matches + * + * @param {Element} el - element we searching inside. Default - DOM Document + * @param {String} selector - searching string + * @returns {NodeList} + */ + + }, { + key: 'findAll', + value: function findAll() { + var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document; + var selector = arguments[1]; + + return el.querySelectorAll(selector); + } + + /** + * Search for deepest node which is Leaf. + * Leaf is the vertex that doesn't have any child nodes + * + * @description Method recursively goes throw the all Node until it finds the Leaf + * + * @param {Node} node - root Node. From this vertex we start Deep-first search {@link https://en.wikipedia.org/wiki/Depth-first_search} + * @param {Boolean} atLast - find last text node + * @return {Node} - it can be text Node or Element Node, so that caret will able to work with it + */ + + }, { + key: 'getDeepestNode', + value: function getDeepestNode(node) { + var atLast = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + /** + * Current function have two directions: + * - starts from first child and every time gets first or nextSibling in special cases + * - starts from last child and gets last or previousSibling + * @type {string} + */ + var child = atLast ? 'lastChild' : 'firstChild', + sibling = atLast ? 'previousSibling' : 'nextSibling'; + + if (node && node.nodeType === Node.ELEMENT_NODE && node[child]) { + var nodeChild = node[child]; + + /** + * special case when child is single tag that can't contain any content + */ + if (Dom.isSingleTag(nodeChild)) { + /** + * 1) We need to check the next sibling. If it is Node Element then continue searching for deepest + * from sibling + * + * 2) If single tag's next sibling is null, then go back to parent and check his sibling + * In case of Node Element continue searching + * + * 3) If none of conditions above happened return parent Node Element + */ + if (nodeChild[sibling]) { + nodeChild = nodeChild[sibling]; + } else if (nodeChild.parentNode[sibling]) { + nodeChild = nodeChild.parentNode[sibling]; + } else { + return nodeChild.parentNode; + } + } + + return this.getDeepestNode(nodeChild, atLast); + } + + return node; + } + + /** + * Check if object is DOM node + * + * @param {Object} node + * @returns {boolean} + */ + + }, { + key: 'isElement', + value: function isElement(node) { + return node && (typeof node === 'undefined' ? 'undefined' : _typeof(node)) === 'object' && node.nodeType && node.nodeType === Node.ELEMENT_NODE; + } + + /** + * Check if object is DocumentFragmemt node + * + * @param {Object} node + * @returns {boolean} + */ + + }, { + key: 'isFragment', + value: function isFragment(node) { + return node && (typeof node === 'undefined' ? 'undefined' : _typeof(node)) === 'object' && node.nodeType && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE; + } + + /** + * Checks target if it is native input + * @param {Element|String|Node} target - HTML element or string + * @return {Boolean} + */ + + }, { + key: 'isNativeInput', + value: function isNativeInput(target) { + var nativeInputs = ['INPUT', 'TEXTAREA']; + + return target ? nativeInputs.includes(target.tagName) : false; + } + + /** + * Checks node if it is empty + * + * @description Method checks simple Node without any childs for emptiness + * If you have Node with 2 or more children id depth, you better use {@link Dom#isEmpty} method + * + * @param {Node} node + * @return {Boolean} true if it is empty + */ + + }, { + key: 'isNodeEmpty', + value: function isNodeEmpty(node) { + var nodeText = void 0; + + if (this.isElement(node) && this.isNativeInput(node)) { + nodeText = node.value; + } else { + nodeText = node.textContent.replace('\u200B', ''); + } + + return nodeText.trim().length === 0; + } + + /** + * checks node if it is doesn't have any child nodes + * @param {Node} node + * @return {boolean} + */ + + }, { + key: 'isLeaf', + value: function isLeaf(node) { + if (!node) { + return false; + } + + return node.childNodes.length === 0; + } + + /** + * breadth-first search (BFS) + * {@link https://en.wikipedia.org/wiki/Breadth-first_search} + * + * @description Pushes to stack all DOM leafs and checks for emptiness + * + * @param {Node} node + * @return {boolean} + */ + + }, { + key: 'isEmpty', + value: function isEmpty(node) { + var _this = this; + + var treeWalker = [], + leafs = []; + + if (!node) { + return true; + } + + if (!node.childNodes.length) { + return this.isNodeEmpty(node); + } + + treeWalker.push(node.firstChild); + + while (treeWalker.length > 0) { + node = treeWalker.shift(); + + if (!node) continue; + + if (this.isLeaf(node)) { + leafs.push(node); + } else { + treeWalker.push(node.firstChild); + } + + while (node && node.nextSibling) { + node = node.nextSibling; + + if (!node) continue; + + treeWalker.push(node); + } + + /** + * If one of childs is not empty, checked Node is not empty too + */ + if (node && !this.isNodeEmpty(node)) { + return false; + } + } + + return leafs.every(function (leaf) { + return _this.isNodeEmpty(leaf); + }); + } + + /** + * Check if string contains html elements + * + * @param string + * @returns {boolean} + */ + + }, { + key: 'isHTMLString', + value: function isHTMLString(string) { + var wrapper = Dom.make('div'); + + wrapper.innerHTML = string; + + return wrapper.childElementCount > 0; + } + + /** + * Return array of names of block html elements + * + * @returns {string[]} + */ + + }, { + key: 'blockElements', + get: function get() { + return ['address', 'article', 'aside', 'blockquote', 'canvas', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', 'li', 'main', 'nav', 'noscript', 'ol', 'output', 'p', 'pre', 'ruby', 'section', 'table', 'tr', 'tfoot', 'ul', 'video']; + } + }]); + + return Dom; +}(); + +Dom.displayName = 'Dom'; +exports.default = Dom; +; +module.exports = exports['default']; + +/***/ }), + +/***/ "./src/components/inline-tools/inline-tool-bold.ts": +/*!*********************************************************!*\ + !*** ./src/components/inline-tools/inline-tool-bold.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function($) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Bold Tool + * + * Inline Toolbar Tool + * + * Makes selected text bolder + */ +var BoldInlineTool = function () { + function BoldInlineTool(api) { + _classCallCheck(this, BoldInlineTool); + + /** + * Native Document's command that uses for Bold + */ + this.commandName = 'bold'; + /** + * Styles + */ + this.CSS = { + button: 'ce-inline-tool', + buttonActive: 'ce-inline-tool--active', + buttonModifier: 'ce-inline-tool--bold' + }; + /** + * Elements + */ + this.nodes = { + button: null + }; + console.log('Bold Inline Tool is ready'); + } + /** + * Create button for Inline Toolbar + */ + + + _createClass(BoldInlineTool, [{ + key: 'render', + value: function render() { + this.nodes.button = document.createElement('button'); + this.nodes.button.classList.add(this.CSS.button, this.CSS.buttonModifier); + this.nodes.button.appendChild($.svg('bold', 13, 15)); + return this.nodes.button; + } + /** + * Wrap range with tag + * @param {Range} range + */ + + }, { + key: 'surround', + value: function surround(range) { + document.execCommand(this.commandName); + } + /** + * Check selection and set activated state to button if there are tag + * @param {Selection} selection + */ + + }, { + key: 'checkState', + value: function checkState(selection) { + var isActive = document.queryCommandState(this.commandName); + this.nodes.button.classList.toggle(this.CSS.buttonActive, isActive); + return isActive; + } + }]); + + return BoldInlineTool; +}(); + +BoldInlineTool.displayName = 'BoldInlineTool'; +exports.default = BoldInlineTool; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! dom */ "./src/components/dom.js"))) + +/***/ }), + +/***/ "./src/components/inline-tools/inline-tool-italic.ts": +/*!***********************************************************!*\ + !*** ./src/components/inline-tools/inline-tool-italic.ts ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function($) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Italic Tool + * + * Inline Toolbar Tool + * + * Style selected text with italic + */ +var ItalicInlineTool = function () { + function ItalicInlineTool(api) { + _classCallCheck(this, ItalicInlineTool); + + /** + * Native Document's command that uses for Italic + */ + this.commandName = 'italic'; + /** + * Styles + */ + this.CSS = { + button: 'ce-inline-tool', + buttonActive: 'ce-inline-tool--active', + buttonModifier: 'ce-inline-tool--italic' + }; + /** + * Elements + */ + this.nodes = { + button: null + }; + console.log('Italic Inline Tool is ready'); + } + /** + * Create button for Inline Toolbar + */ + + + _createClass(ItalicInlineTool, [{ + key: 'render', + value: function render() { + this.nodes.button = document.createElement('button'); + this.nodes.button.classList.add(this.CSS.button, this.CSS.buttonModifier); + this.nodes.button.appendChild($.svg('italic', 6, 15)); + return this.nodes.button; + } + /** + * Wrap range with tag + * @param {Range} range + */ + + }, { + key: 'surround', + value: function surround(range) { + document.execCommand(this.commandName); + } + /** + * Check selection and set activated state to button if there are tag + * @param {Selection} selection + */ + + }, { + key: 'checkState', + value: function checkState(selection) { + var isActive = document.queryCommandState(this.commandName); + this.nodes.button.classList.toggle(this.CSS.buttonActive, isActive); + return isActive; + } + }]); + + return ItalicInlineTool; +}(); + +ItalicInlineTool.displayName = 'ItalicInlineTool'; +exports.default = ItalicInlineTool; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! dom */ "./src/components/dom.js"))) + +/***/ }), + +/***/ "./src/components/inline-tools/inline-tool-link.ts": +/*!*********************************************************!*\ + !*** ./src/components/inline-tools/inline-tool-link.ts ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function($, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _selection = __webpack_require__(/*! ../selection */ "./src/components/selection.js"); + +var _selection2 = _interopRequireDefault(_selection); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Link Tool + * + * Inline Toolbar Tool + * + * Wrap selected text with tag + */ +var LinkInlineTool = function () { + /** + * @param {object} api - CodeX Editor API + * @param {object} api.toolbar - Inline Toolbar API + */ + function LinkInlineTool(api) { + _classCallCheck(this, LinkInlineTool); + + /** + * Native Document's commands for link/unlink + */ + this.commandLink = 'createLink'; + this.commandUnlink = 'unlink'; + /** + * Enter key code + */ + this.ENTER_KEY = 13; + /** + * Styles + */ + this.CSS = { + button: 'ce-inline-tool', + buttonActive: 'ce-inline-tool--active', + buttonModifier: 'ce-inline-tool--link', + buttonUnlink: 'ce-inline-tool--unlink', + input: 'ce-inline-tool-input', + inputShowed: 'ce-inline-tool-input--showed' + }; + /** + * Elements + */ + this.nodes = { + button: null, + input: null + }; + /** + * Input opening state + */ + this.inputOpened = false; + this.inlineToolbar = api.toolbar; + this.selection = new _selection2.default(); + } + /** + * Create button for Inline Toolbar + */ + + + _createClass(LinkInlineTool, [{ + key: 'render', + value: function render() { + this.nodes.button = document.createElement('button'); + this.nodes.button.classList.add(this.CSS.button, this.CSS.buttonModifier); + this.nodes.button.appendChild($.svg('link', 15, 14)); + this.nodes.button.appendChild($.svg('unlink', 16, 18)); + return this.nodes.button; + } + /** + * Input for the link + */ + + }, { + key: 'renderActions', + value: function renderActions() { + var _this = this; + + this.nodes.input = document.createElement('input'); + this.nodes.input.placeholder = 'Add a link'; + this.nodes.input.classList.add(this.CSS.input); + this.nodes.input.addEventListener('keydown', function (event) { + if (event.keyCode === _this.ENTER_KEY) { + _this.enterPressed(event); + } + }); + return this.nodes.input; + } + /** + * Handle clicks on the Inline Toolbar icon + * @param {Range} range + */ + + }, { + key: 'surround', + value: function surround(range) { + /** + * Range will be null when user makes second click on the 'link icon' to close opened input + */ + if (range) { + /** + * Save selection before change focus to the input + */ + this.selection.save(); + var parentAnchor = this.selection.findParentTag('A'); + /** + * Unlink icon pressed + */ + if (parentAnchor) { + this.selection.expandToTag(parentAnchor); + this.unlink(); + this.closeActions(); + this.checkState(); + this.inlineToolbar.close(); + return; + } + } + this.toggleActions(); + } + /** + * Check selection and set activated state to button if there are tag + * @param {Selection} selection + */ + + }, { + key: 'checkState', + value: function checkState(selection) { + var anchorTag = this.selection.findParentTag('A'); + if (anchorTag) { + this.nodes.button.classList.add(this.CSS.buttonUnlink); + this.nodes.button.classList.add(this.CSS.buttonActive); + this.openActions(); + /** + * Fill input value with link href + */ + var hrefAttr = anchorTag.getAttribute('href'); + this.nodes.input.value = hrefAttr !== 'null' ? hrefAttr : ''; + this.selection.save(); + } else { + this.nodes.button.classList.remove(this.CSS.buttonUnlink); + this.nodes.button.classList.remove(this.CSS.buttonActive); + } + return !!anchorTag; + } + /** + * Function called with Inline Toolbar closing + */ + + }, { + key: 'clear', + value: function clear() { + this.closeActions(); + } + }, { + key: 'toggleActions', + value: function toggleActions() { + if (!this.inputOpened) { + this.openActions(true); + } else { + this.closeActions(false); + } + } + /** + * @param {boolean} needFocus - on link creation we need to focus input. On editing - nope. + */ + + }, { + key: 'openActions', + value: function openActions() { + var needFocus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + this.nodes.input.classList.add(this.CSS.inputShowed); + if (needFocus) { + this.nodes.input.focus(); + } + this.inputOpened = true; + } + /** + * Close input + * @param {boolean} clearSavedSelection — we don't need to clear saved selection + * on toggle-clicks on the icon of opened Toolbar + */ + + }, { + key: 'closeActions', + value: function closeActions() { + var clearSavedSelection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.nodes.input.classList.remove(this.CSS.inputShowed); + this.nodes.input.value = ''; + if (clearSavedSelection) { + this.selection.clearSaved(); + } + this.inputOpened = false; + } + /** + * Enter pressed on input + * @param {KeyboardEvent} event + */ + + }, { + key: 'enterPressed', + value: function enterPressed(event) { + var value = this.nodes.input.value || ''; + if (!value.trim()) { + this.selection.restore(); + this.unlink(); + event.preventDefault(); + this.closeActions(); + } + if (!this.validateURL(value)) { + /** + * @todo show notification 'Incorrect Link' + */ + _.log('Incorrect Link pasted', 'warn', value); + return; + } + value = this.prepareLink(value); + this.selection.restore(); + this.insertLink(value); + /** + * Preventing events that will be able to happen + */ + event.preventDefault(); + event.stopPropagation(); + event.stopImmediatePropagation(); + this.closeActions(); + this.inlineToolbar.close(); + this.checkState(); + } + /** + * Detects if passed string is URL + * @param {string} str + * @return {Boolean} + */ + + }, { + key: 'validateURL', + value: function validateURL(str) { + /** + * Don't allow spaces + */ + return !/\s/.test(str); + } + /** + * Process link before injection + * - sanitize + * - add protocol for links like 'google.com' + * @param {string} link - raw user input + */ + + }, { + key: 'prepareLink', + value: function prepareLink(link) { + link = link.trim(); + link = this.addProtocol(link); + return link; + } + /** + * Add 'http' protocol to the links like 'vc.ru', 'google.com' + * @param {String} link + */ + + }, { + key: 'addProtocol', + value: function addProtocol(link) { + /** + * If protocol already exists, do nothing + */ + if (/^(\w+):\/\//.test(link)) { + return link; + } + /** + * We need to add missed HTTP protocol to the link, but skip 2 cases: + * 1) Internal links like "/general" + * 2) Anchors looks like "#results" + * 3) Protocol-relative URLs like "//google.com" + */ + var isInternal = /^\/[^\/\s]/.test(link), + isAnchor = link.substring(0, 1) === '#', + isProtocolRelative = /^\/\/[^\/\s]/.test(link); + if (!isInternal && !isAnchor && !isProtocolRelative) { + link = 'http://' + link; + } + return link; + } + /** + * Inserts tag with "href" + * @param {string} link - "href" value + */ + + }, { + key: 'insertLink', + value: function insertLink(link) { + /** + * Edit all link, not selected part + */ + var anchorTag = this.selection.findParentTag('A'); + if (anchorTag) { + this.selection.expandToTag(anchorTag); + } + document.execCommand(this.commandLink, false, link); + } + /** + * Removes tag + */ + + }, { + key: 'unlink', + value: function unlink() { + document.execCommand(this.commandUnlink); + } + }]); + + return LinkInlineTool; +}(); + +LinkInlineTool.displayName = 'LinkInlineTool'; +exports.default = LinkInlineTool; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! dom */ "./src/components/dom.js"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules sync recursive ^\\.\\/.*$": +/*!**********************************************!*\ + !*** ./src/components/modules sync ^\.\/.*$ ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var map = { + "./_anchors": "./src/components/modules/_anchors.js", + "./_anchors.js": "./src/components/modules/_anchors.js", + "./_callbacks": "./src/components/modules/_callbacks.js", + "./_callbacks.js": "./src/components/modules/_callbacks.js", + "./_caret": "./src/components/modules/_caret.js", + "./_caret.js": "./src/components/modules/_caret.js", + "./_content": "./src/components/modules/_content.js", + "./_content.js": "./src/components/modules/_content.js", + "./_destroyer": "./src/components/modules/_destroyer.js", + "./_destroyer.js": "./src/components/modules/_destroyer.js", + "./_notifications": "./src/components/modules/_notifications.js", + "./_notifications.js": "./src/components/modules/_notifications.js", + "./_parser": "./src/components/modules/_parser.js", + "./_parser.js": "./src/components/modules/_parser.js", + "./_paste": "./src/components/modules/_paste.js", + "./_paste.js": "./src/components/modules/_paste.js", + "./_transport": "./src/components/modules/_transport.js", + "./_transport.js": "./src/components/modules/_transport.js", + "./api": "./src/components/modules/api.ts", + "./api-blocks": "./src/components/modules/api-blocks.ts", + "./api-blocks.ts": "./src/components/modules/api-blocks.ts", + "./api-events": "./src/components/modules/api-events.ts", + "./api-events.ts": "./src/components/modules/api-events.ts", + "./api-listener": "./src/components/modules/api-listener.ts", + "./api-listener.ts": "./src/components/modules/api-listener.ts", + "./api-sanitizer": "./src/components/modules/api-sanitizer.ts", + "./api-sanitizer.ts": "./src/components/modules/api-sanitizer.ts", + "./api-saver": "./src/components/modules/api-saver.ts", + "./api-saver.ts": "./src/components/modules/api-saver.ts", + "./api-selection": "./src/components/modules/api-selection.ts", + "./api-selection.ts": "./src/components/modules/api-selection.ts", + "./api-toolbar": "./src/components/modules/api-toolbar.ts", + "./api-toolbar.ts": "./src/components/modules/api-toolbar.ts", + "./api.ts": "./src/components/modules/api.ts", + "./block-events": "./src/components/modules/block-events.ts", + "./block-events.ts": "./src/components/modules/block-events.ts", + "./blockManager": "./src/components/modules/blockManager.js", + "./blockManager.js": "./src/components/modules/blockManager.js", + "./caret": "./src/components/modules/caret.js", + "./caret.js": "./src/components/modules/caret.js", + "./events": "./src/components/modules/events.js", + "./events.js": "./src/components/modules/events.js", + "./listeners": "./src/components/modules/listeners.js", + "./listeners.js": "./src/components/modules/listeners.js", + "./paste": "./src/components/modules/paste.ts", + "./paste.ts": "./src/components/modules/paste.ts", + "./renderer": "./src/components/modules/renderer.js", + "./renderer.js": "./src/components/modules/renderer.js", + "./sanitizer": "./src/components/modules/sanitizer.js", + "./sanitizer.js": "./src/components/modules/sanitizer.js", + "./saver": "./src/components/modules/saver.js", + "./saver.js": "./src/components/modules/saver.js", + "./toolbar": "./src/components/modules/toolbar.js", + "./toolbar-blockSettings": "./src/components/modules/toolbar-blockSettings.js", + "./toolbar-blockSettings.js": "./src/components/modules/toolbar-blockSettings.js", + "./toolbar-inline": "./src/components/modules/toolbar-inline.ts", + "./toolbar-inline.ts": "./src/components/modules/toolbar-inline.ts", + "./toolbar-toolbox": "./src/components/modules/toolbar-toolbox.js", + "./toolbar-toolbox.js": "./src/components/modules/toolbar-toolbox.js", + "./toolbar.js": "./src/components/modules/toolbar.js", + "./toolbar/inline": "./src/components/modules/toolbar/inline.js", + "./toolbar/inline.js": "./src/components/modules/toolbar/inline.js", + "./toolbar/settings": "./src/components/modules/toolbar/settings.js", + "./toolbar/settings.js": "./src/components/modules/toolbar/settings.js", + "./toolbar/toolbar": "./src/components/modules/toolbar/toolbar.js", + "./toolbar/toolbar.js": "./src/components/modules/toolbar/toolbar.js", + "./toolbar/toolbox": "./src/components/modules/toolbar/toolbox.js", + "./toolbar/toolbox.js": "./src/components/modules/toolbar/toolbox.js", + "./tools": "./src/components/modules/tools.js", + "./tools.js": "./src/components/modules/tools.js", + "./ui": "./src/components/modules/ui.js", + "./ui.js": "./src/components/modules/ui.js" +}; + + +function webpackContext(req) { + var id = webpackContextResolve(req); + return __webpack_require__(id); +} +function webpackContextResolve(req) { + var id = map[req]; + if(!(id + 1)) { // check for number or string + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + } + return id; +} +webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); +}; +webpackContext.resolve = webpackContextResolve; +module.exports = webpackContext; +webpackContext.id = "./src/components/modules sync recursive ^\\.\\/.*$"; + +/***/ }), + +/***/ "./src/components/modules/_anchors.js": +/*!********************************************!*\ + !*** ./src/components/modules/_anchors.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Codex Editor Anchors module + * + * @author Codex Team + * @version 1.0 + */ + +module.exports = function (anchors) { + var editor = codex.editor; + + anchors.input = null; + anchors.currentNode = null; + + anchors.settingsOpened = function (currentBlock) { + anchors.currentNode = currentBlock; + anchors.input.value = anchors.currentNode.dataset.anchor || ''; + }; + + anchors.anchorChanged = function (e) { + var newAnchor = e.target.value = anchors.rusToTranslit(e.target.value); + + anchors.currentNode.dataset.anchor = newAnchor; + + if (newAnchor.trim() !== '') { + anchors.currentNode.classList.add(editor.ui.className.BLOCK_WITH_ANCHOR); + } else { + anchors.currentNode.classList.remove(editor.ui.className.BLOCK_WITH_ANCHOR); + } + }; + + anchors.keyDownOnAnchorInput = function (e) { + if (e.keyCode == editor.core.keys.ENTER) { + e.preventDefault(); + e.stopPropagation(); + + e.target.blur(); + editor.toolbar.settings.close(); + } + }; + + anchors.keyUpOnAnchorInput = function (e) { + if (e.keyCode >= editor.core.keys.LEFT && e.keyCode <= editor.core.keys.DOWN) { + e.stopPropagation(); + } + }; + + anchors.rusToTranslit = function (string) { + var ru = ['А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ь', 'Ы', 'Ь', 'Э', 'Ю', 'Я'], + en = ['A', 'B', 'V', 'G', 'D', 'E', 'E', 'Zh', 'Z', 'I', 'Y', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', 'H', 'C', 'Ch', 'Sh', 'Sch', '', 'Y', '', 'E', 'Yu', 'Ya']; + + for (var i = 0; i < ru.length; i++) { + string = string.split(ru[i]).join(en[i]); + string = string.split(ru[i].toLowerCase()).join(en[i].toLowerCase()); + } + + string = string.replace(/[^0-9a-zA-Z_]+/g, '-'); + + return string; + }; + + return anchors; +}({}); + +/***/ }), + +/***/ "./src/components/modules/_callbacks.js": +/*!**********************************************!*\ + !*** ./src/components/modules/_callbacks.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * @module Codex Editor Callbacks module + * @description Module works with editor added Elements + * + * @author Codex Team + * @version 1.4.0 + */ + +module.exports = function (callbacks) { + var editor = codex.editor; + + /** + * used by UI module + * @description Routes all keydowns on document + * @param {Object} event + */ + callbacks.globalKeydown = function (event) { + switch (event.keyCode) { + case editor.core.keys.ENTER: + enterKeyPressed_(event);break; + } + }; + + /** + * used by UI module + * @description Routes all keydowns on redactors area + * @param {Object} event + */ + callbacks.redactorKeyDown = function (event) { + switch (event.keyCode) { + case editor.core.keys.TAB: + tabKeyPressedOnRedactorsZone_(event);break; + case editor.core.keys.ENTER: + enterKeyPressedOnRedactorsZone_(event);break; + case editor.core.keys.ESC: + escapeKeyPressedOnRedactorsZone_(event);break; + default: + defaultKeyPressedOnRedactorsZone_(event);break; + } + }; + + /** + * used by UI module + * @description Routes all keyup events + * @param {Object} event + */ + callbacks.globalKeyup = function (event) { + switch (event.keyCode) { + case editor.core.keys.UP: + case editor.core.keys.LEFT: + case editor.core.keys.RIGHT: + case editor.core.keys.DOWN: + arrowKeyPressed_(event);break; + } + }; + + /** + * @param {Object} event + * @private + * + * Handles behaviour when tab pressed + * @description if Content is empty show toolbox (if it is closed) or leaf tools + * uses Toolbars toolbox module to handle the situation + */ + var tabKeyPressedOnRedactorsZone_ = function tabKeyPressedOnRedactorsZone_(event) { + /** + * Wait for solution. Would like to know the behaviour + * @todo Add spaces + */ + event.preventDefault(); + + if (!editor.core.isBlockEmpty(editor.content.currentNode)) { + return; + } + + if (!editor.toolbar.opened) { + editor.toolbar.open(); + } + + if (editor.toolbar.opened && !editor.toolbar.toolbox.opened) { + editor.toolbar.toolbox.open(); + } else { + editor.toolbar.toolbox.leaf(); + } + }; + + /** + * Handles global EnterKey Press + * @see enterPressedOnBlock_ + * @param {Object} event + */ + var enterKeyPressed_ = function enterKeyPressed_() { + if (editor.content.editorAreaHightlighted) { + /** + * it means that we lose input index, saved index before is not correct + * therefore we need to set caret when we insert new block + */ + editor.caret.inputIndex = -1; + + enterPressedOnBlock_(); + } + }; + + /** + * Callback for enter key pressing in first-level block area + * + * @param {Event} event + * @private + * + * @description Inserts new block with initial type from settings + */ + var enterPressedOnBlock_ = function enterPressedOnBlock_() { + var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; + + editor.content.insertBlock({ + type: NEW_BLOCK_TYPE, + block: editor.tools[NEW_BLOCK_TYPE].render() + }, true); + + editor.toolbar.move(); + editor.toolbar.open(); + }; + + /** + * ENTER key handler + * + * @param {Object} event + * @private + * + * @description Makes new block with initial type from settings + */ + var enterKeyPressedOnRedactorsZone_ = function enterKeyPressedOnRedactorsZone_(event) { + if (event.target.contentEditable == 'true') { + /** Update input index */ + editor.caret.saveCurrentInputIndex(); + } + + var currentInputIndex = editor.caret.getCurrentInputIndex() || 0, + workingNode = editor.content.currentNode, + tool = workingNode.dataset.tool, + isEnterPressedOnToolbar = editor.toolbar.opened && editor.toolbar.current && event.target == editor.state.inputs[currentInputIndex]; + + /** The list of tools which needs the default browser behaviour */ + var enableLineBreaks = editor.tools[tool].enableLineBreaks; + + /** This type of block creates when enter is pressed */ + var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; + + /** + * When toolbar is opened, select tool instead of making new paragraph + */ + if (isEnterPressedOnToolbar) { + event.preventDefault(); + + editor.toolbar.toolbox.toolClicked(event); + + editor.toolbar.close(); + + /** + * Stop other listeners callback executions + */ + event.stopPropagation(); + event.stopImmediatePropagation(); + + return; + } + + /** + * Allow paragraph lineBreaks with shift enter + * Or if shiftkey pressed and enter and enabledLineBreaks, the let new block creation + */ + if (event.shiftKey || enableLineBreaks) { + event.stopPropagation(); + event.stopImmediatePropagation(); + return; + } + + var currentSelection = window.getSelection(), + currentSelectedNode = currentSelection.anchorNode, + caretAtTheEndOfText = editor.caret.position.atTheEnd(), + isTextNodeHasParentBetweenContenteditable = false; + + /** + * Allow making new

    in same block by SHIFT+ENTER and forbids to prevent default browser behaviour + */ + if (event.shiftKey && !enableLineBreaks) { + editor.callback.enterPressedOnBlock(editor.content.currentBlock, event); + event.preventDefault(); + return; + } + + /** + * Workaround situation when caret at the Text node that has some wrapper Elements + * Split block cant handle this. + * We need to save default behavior + */ + isTextNodeHasParentBetweenContenteditable = currentSelectedNode && currentSelectedNode.parentNode.contentEditable != 'true'; + + /** + * Split blocks when input has several nodes and caret placed in textNode + */ + if (currentSelectedNode.nodeType == editor.core.nodeTypes.TEXT && !isTextNodeHasParentBetweenContenteditable && !caretAtTheEndOfText) { + event.preventDefault(); + + editor.core.log('Splitting Text node...'); + + editor.content.splitBlock(currentInputIndex); + + /** Show plus button when next input after split is empty*/ + if (!editor.state.inputs[currentInputIndex + 1].textContent.trim()) { + editor.toolbar.showPlusButton(); + } + } else { + var islastNode = editor.content.isLastNode(currentSelectedNode); + + if (islastNode && caretAtTheEndOfText) { + event.preventDefault(); + event.stopPropagation(); + event.stopImmediatePropagation(); + + editor.core.log('ENTER clicked in last textNode. Create new BLOCK'); + + editor.content.insertBlock({ + type: NEW_BLOCK_TYPE, + block: editor.tools[NEW_BLOCK_TYPE].render() + }, true); + + editor.toolbar.move(); + editor.toolbar.open(); + + /** Show plus button with empty block */ + editor.toolbar.showPlusButton(); + } + } + + /** get all inputs after new appending block */ + editor.ui.saveInputs(); + }; + + /** + * Escape behaviour + * @param event + * @private + * + * @description Closes toolbox and toolbar. Prevents default behaviour + */ + var escapeKeyPressedOnRedactorsZone_ = function escapeKeyPressedOnRedactorsZone_(event) { + /** Close all toolbar */ + editor.toolbar.close(); + + /** Close toolbox */ + editor.toolbar.toolbox.close(); + + event.preventDefault(); + }; + + /** + * @param {Event} event + * @private + * + * closes and moves toolbar + */ + var arrowKeyPressed_ = function arrowKeyPressed_(event) { + editor.content.workingNodeChanged(); + + /* Closing toolbar */ + editor.toolbar.close(); + editor.toolbar.move(); + }; + + /** + * @private + * @param {Event} event + * + * @description Closes all opened bars from toolbar. + * If block is mark, clears highlightning + */ + var defaultKeyPressedOnRedactorsZone_ = function defaultKeyPressedOnRedactorsZone_() { + editor.toolbar.close(); + + if (!editor.toolbar.inline.actionsOpened) { + editor.toolbar.inline.close(); + editor.content.clearMark(); + } + }; + + /** + * Handler when clicked on redactors area + * + * @protected + * @param event + * + * @description Detects clicked area. If it is first-level block area, marks as detected and + * on next enter press will be inserted new block + * Otherwise, save carets position (input index) and put caret to the editable zone. + * + * @see detectWhenClickedOnFirstLevelBlockArea_ + * + */ + callbacks.redactorClicked = function (event) { + detectWhenClickedOnFirstLevelBlockArea_(); + + editor.content.workingNodeChanged(event.target); + editor.ui.saveInputs(); + + var selectedText = editor.toolbar.inline.getSelectionText(), + firstLevelBlock; + + /** If selection range took off, then we hide inline toolbar */ + if (selectedText.length === 0) { + editor.toolbar.inline.close(); + } + + /** Update current input index in memory when caret focused into existed input */ + if (event.target.contentEditable == 'true') { + editor.caret.saveCurrentInputIndex(); + } + + if (editor.content.currentNode === null) { + /** + * If inputs in redactor does not exits, then we put input index 0 not -1 + */ + var indexOfLastInput = editor.state.inputs.length > 0 ? editor.state.inputs.length - 1 : 0; + + /** If we have any inputs */ + if (editor.state.inputs.length) { + /** getting firstlevel parent of input */ + firstLevelBlock = editor.content.getFirstLevelBlock(editor.state.inputs[indexOfLastInput]); + } + + /** If input is empty, then we set caret to the last input */ + if (editor.state.inputs.length && editor.state.inputs[indexOfLastInput].textContent === '' && firstLevelBlock.dataset.tool == editor.settings.initialBlockPlugin) { + editor.caret.setToBlock(indexOfLastInput); + } else { + /** Create new input when caret clicked in redactors area */ + var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; + + editor.content.insertBlock({ + type: NEW_BLOCK_TYPE, + block: editor.tools[NEW_BLOCK_TYPE].render() + }); + + /** If there is no inputs except inserted */ + if (editor.state.inputs.length === 1) { + editor.caret.setToBlock(indexOfLastInput); + } else { + /** Set caret to this appended input */ + editor.caret.setToNextBlock(indexOfLastInput); + } + } + } else { + /** Close all panels */ + editor.toolbar.settings.close(); + editor.toolbar.toolbox.close(); + } + + /** + * Move toolbar and open + */ + editor.toolbar.move(); + editor.toolbar.open(); + + var inputIsEmpty = !editor.content.currentNode.textContent.trim(), + currentNodeType = editor.content.currentNode.dataset.tool, + isInitialType = currentNodeType == editor.settings.initialBlockPlugin; + + /** Hide plus buttons */ + editor.toolbar.hidePlusButton(); + + if (!inputIsEmpty) { + /** Mark current block */ + editor.content.markBlock(); + } + + if (isInitialType && inputIsEmpty) { + /** Show plus button */ + editor.toolbar.showPlusButton(); + } + }; + + /** + * This method allows to define, is caret in contenteditable element or not. + * + * @private + * + * @description Otherwise, if we get TEXT node from range container, that will means we have input index. + * In this case we use default browsers behaviour (if plugin allows that) or overwritten action. + * Therefore, to be sure that we've clicked first-level block area, we should have currentNode, which always + * specifies to the first-level block. Other cases we just ignore. + */ + var detectWhenClickedOnFirstLevelBlockArea_ = function detectWhenClickedOnFirstLevelBlockArea_() { + var selection = window.getSelection(), + anchorNode = selection.anchorNode, + flag = false; + + if (selection.rangeCount === 0) { + editor.content.editorAreaHightlighted = true; + } else { + if (!editor.core.isDomNode(anchorNode)) { + anchorNode = anchorNode.parentNode; + } + + /** Already founded, without loop */ + if (anchorNode.contentEditable == 'true') { + flag = true; + } + + while (anchorNode.contentEditable != 'true') { + anchorNode = anchorNode.parentNode; + + if (anchorNode.contentEditable == 'true') { + flag = true; + } + + if (anchorNode == document.body) { + break; + } + } + + /** If editable element founded, flag is "TRUE", Therefore we return "FALSE" */ + editor.content.editorAreaHightlighted = !flag; + } + }; + + /** + * Toolbar button click handler + * + * @param {Object} event - cursor to the button + * @protected + * + * @description gets current tool and calls render method + */ + callbacks.toolbarButtonClicked = function (event) { + var button = this; + + editor.toolbar.current = button.dataset.type; + + editor.toolbar.toolbox.toolClicked(event); + editor.toolbar.close(); + }; + + /** + * Show or Hide toolbox when plus button is clicked + */ + callbacks.plusButtonClicked = function () { + if (!editor.nodes.toolbox.classList.contains('opened')) { + editor.toolbar.toolbox.open(); + } else { + editor.toolbar.toolbox.close(); + } + }; + + /** + * Block handlers for KeyDown events + * + * @protected + * @param {Object} event + * + * Handles keydowns on block + * @see blockRightOrDownArrowPressed_ + * @see backspacePressed_ + * @see blockLeftOrUpArrowPressed_ + */ + callbacks.blockKeydown = function (event) { + var block = event.target; // event.target is input + + switch (event.keyCode) { + case editor.core.keys.DOWN: + case editor.core.keys.RIGHT: + blockRightOrDownArrowPressed_(event); + break; + + case editor.core.keys.BACKSPACE: + backspacePressed_(block, event); + break; + + case editor.core.keys.UP: + case editor.core.keys.LEFT: + blockLeftOrUpArrowPressed_(event); + break; + } + }; + + /** + * RIGHT or DOWN keydowns on block + * + * @param {Object} event + * @private + * + * @description watches the selection and gets closest editable element. + * Uses method getDeepestTextNodeFromPosition to get the last node of next block + * Sets caret if it is contenteditable + */ + var blockRightOrDownArrowPressed_ = function blockRightOrDownArrowPressed_(event) { + var selection = window.getSelection(), + inputs = editor.state.inputs, + focusedNode = selection.anchorNode, + focusedNodeHolder; + + /** Check for caret existance */ + if (!focusedNode) { + return false; + } + + /** Looking for closest (parent) contentEditable element of focused node */ + while (focusedNode.contentEditable != 'true') { + focusedNodeHolder = focusedNode.parentNode; + focusedNode = focusedNodeHolder; + } + + /** Input index in DOM level */ + var editableElementIndex = 0; + + while (focusedNode != inputs[editableElementIndex]) { + editableElementIndex++; + } + + /** + * Founded contentEditable element doesn't have childs + * Or maybe New created block + */ + if (!focusedNode.textContent) { + editor.caret.setToNextBlock(editableElementIndex); + return; + } + + /** + * Do nothing when caret doesn not reaches the end of last child + */ + var caretInLastChild = false, + caretAtTheEndOfText = false; + + var lastChild, deepestTextnode; + + lastChild = focusedNode.childNodes[focusedNode.childNodes.length - 1]; + + if (editor.core.isDomNode(lastChild)) { + deepestTextnode = editor.content.getDeepestTextNodeFromPosition(lastChild, lastChild.childNodes.length); + } else { + deepestTextnode = lastChild; + } + + caretInLastChild = selection.anchorNode == deepestTextnode; + caretAtTheEndOfText = deepestTextnode.length == selection.anchorOffset; + + if (!caretInLastChild || !caretAtTheEndOfText) { + editor.core.log('arrow [down|right] : caret does not reached the end'); + return false; + } + + editor.caret.setToNextBlock(editableElementIndex); + }; + + /** + * LEFT or UP keydowns on block + * + * @param {Object} event + * @private + * + * watches the selection and gets closest editable element. + * Uses method getDeepestTextNodeFromPosition to get the last node of previous block + * Sets caret if it is contenteditable + * + */ + var blockLeftOrUpArrowPressed_ = function blockLeftOrUpArrowPressed_(event) { + var selection = window.getSelection(), + inputs = editor.state.inputs, + focusedNode = selection.anchorNode, + focusedNodeHolder; + + /** Check for caret existance */ + if (!focusedNode) { + return false; + } + + /** + * LEFT or UP not at the beginning + */ + if (selection.anchorOffset !== 0) { + return false; + } + + /** Looking for parent contentEditable block */ + while (focusedNode.contentEditable != 'true') { + focusedNodeHolder = focusedNode.parentNode; + focusedNode = focusedNodeHolder; + } + + /** Input index in DOM level */ + var editableElementIndex = 0; + + while (focusedNode != inputs[editableElementIndex]) { + editableElementIndex++; + } + + /** + * Do nothing if caret is not at the beginning of first child + */ + var caretInFirstChild = false, + caretAtTheBeginning = false; + + var firstChild, deepestTextnode; + + /** + * Founded contentEditable element doesn't have childs + * Or maybe New created block + */ + if (!focusedNode.textContent) { + editor.caret.setToPreviousBlock(editableElementIndex); + return; + } + + firstChild = focusedNode.childNodes[0]; + + if (editor.core.isDomNode(firstChild)) { + deepestTextnode = editor.content.getDeepestTextNodeFromPosition(firstChild, 0); + } else { + deepestTextnode = firstChild; + } + + caretInFirstChild = selection.anchorNode == deepestTextnode; + caretAtTheBeginning = selection.anchorOffset === 0; + + if (caretInFirstChild && caretAtTheBeginning) { + editor.caret.setToPreviousBlock(editableElementIndex); + } + }; + + /** + * Handles backspace keydown + * + * @param {Element} block + * @param {Object} event + * @private + * + * @description if block is empty, delete the block and set caret to the previous block + * If block is not empty, try to merge two blocks - current and previous + * But it we try'n to remove first block, then we should set caret to the next block, not previous. + * If we removed the last block, create new one + */ + var backspacePressed_ = function backspacePressed_(block, event) { + var currentInputIndex = editor.caret.getCurrentInputIndex(), + range, + selectionLength, + firstLevelBlocksCount; + + if (editor.core.isNativeInput(event.target)) { + /** If input value is empty - remove block */ + if (event.target.value.trim() == '') { + block.remove(); + } else { + return; + } + } + + if (block.textContent.trim()) { + range = editor.content.getRange(); + selectionLength = range.endOffset - range.startOffset; + + if (editor.caret.position.atStart() && !selectionLength && editor.state.inputs[currentInputIndex - 1]) { + editor.content.mergeBlocks(currentInputIndex); + } else { + return; + } + } + + if (!selectionLength) { + block.remove(); + } + + firstLevelBlocksCount = editor.nodes.redactor.childNodes.length; + + /** + * If all blocks are removed + */ + if (firstLevelBlocksCount === 0) { + /** update currentNode variable */ + editor.content.currentNode = null; + + /** Inserting new empty initial block */ + editor.ui.addInitialBlock(); + + /** Updating inputs state after deleting last block */ + editor.ui.saveInputs(); + + /** Set to current appended block */ + window.setTimeout(function () { + editor.caret.setToPreviousBlock(1); + }, 10); + } else { + if (editor.caret.inputIndex !== 0) { + /** Target block is not first */ + editor.caret.setToPreviousBlock(editor.caret.inputIndex); + } else { + /** If we try to delete first block */ + editor.caret.setToNextBlock(editor.caret.inputIndex); + } + } + + editor.toolbar.move(); + + if (!editor.toolbar.opened) { + editor.toolbar.open(); + } + + /** Updating inputs state */ + editor.ui.saveInputs(); + + /** Prevent default browser behaviour */ + event.preventDefault(); + }; + + /** + * used by UI module + * Clicks on block settings button + * + * @param {Object} event + * @protected + * @description Opens toolbar settings + */ + callbacks.showSettingsButtonClicked = function (event) { + /** + * Get type of current block + * It uses to append settings from tool.settings property. + * ... + * Type is stored in data-type attribute on block + */ + var currentToolType = editor.content.currentNode.dataset.tool; + + editor.toolbar.settings.toggle(currentToolType); + + /** Close toolbox when settings button is active */ + editor.toolbar.toolbox.close(); + editor.toolbar.settings.hideRemoveActions(); + }; + + return callbacks; +}({}); + +/***/ }), + +/***/ "./src/components/modules/_caret.js": +/*!******************************************!*\ + !*** ./src/components/modules/_caret.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Codex Editor Caret Module + * + * @author Codex Team + * @version 1.0 + */ + +module.exports = function (caret) { + var editor = codex.editor; + + /** + * @var {int} InputIndex - editable element in DOM + */ + caret.inputIndex = null; + + /** + * @var {int} offset - caret position in a text node. + */ + caret.offset = null; + + /** + * @var {int} focusedNodeIndex - we get index of child node from first-level block + */ + caret.focusedNodeIndex = null; + + /** + * Creates Document Range and sets caret to the element. + * @protected + * @uses caret.save — if you need to save caret position + * @param {Element} el - Changed Node. + */ + caret.set = function (el, index, offset) { + offset = offset || caret.offset || 0; + index = index || caret.focusedNodeIndex || 0; + + var childs = el.childNodes, + nodeToSet; + + if (childs.length === 0) { + nodeToSet = el; + } else { + nodeToSet = childs[index]; + } + + /** If Element is INPUT */ + if (el.contentEditable != 'true') { + el.focus(); + return; + } + + if (editor.core.isDomNode(nodeToSet)) { + nodeToSet = editor.content.getDeepestTextNodeFromPosition(nodeToSet, nodeToSet.childNodes.length); + } + + var range = document.createRange(), + selection = window.getSelection(); + + window.setTimeout(function () { + range.setStart(nodeToSet, offset); + range.setEnd(nodeToSet, offset); + + selection.removeAllRanges(); + selection.addRange(range); + + editor.caret.saveCurrentInputIndex(); + }, 20); + }; + + /** + * @protected + * Updates index of input and saves it in caret object + */ + caret.saveCurrentInputIndex = function () { + /** Index of Input that we paste sanitized content */ + var selection = window.getSelection(), + inputs = editor.state.inputs, + focusedNode = selection.anchorNode, + focusedNodeHolder; + + if (!focusedNode) { + return; + } + + /** Looking for parent contentEditable block */ + while (focusedNode.contentEditable != 'true') { + focusedNodeHolder = focusedNode.parentNode; + focusedNode = focusedNodeHolder; + } + + /** Input index in DOM level */ + var editableElementIndex = 0; + + while (focusedNode != inputs[editableElementIndex]) { + editableElementIndex++; + } + + caret.inputIndex = editableElementIndex; + }; + + /** + * Returns current input index (caret object) + */ + caret.getCurrentInputIndex = function () { + return caret.inputIndex; + }; + + /** + * @param {int} index - index of first-level block after that we set caret into next input + */ + caret.setToNextBlock = function (index) { + var inputs = editor.state.inputs, + nextInput = inputs[index + 1]; + + if (!nextInput) { + editor.core.log('We are reached the end'); + return; + } + + /** + * When new Block created or deleted content of input + * We should add some text node to set caret + */ + if (!nextInput.childNodes.length) { + var emptyTextElement = document.createTextNode(''); + + nextInput.appendChild(emptyTextElement); + } + + editor.caret.inputIndex = index + 1; + editor.caret.set(nextInput, 0, 0); + editor.content.workingNodeChanged(nextInput); + }; + + /** + * @param {int} index - index of target input. + * Sets caret to input with this index + */ + caret.setToBlock = function (index) { + var inputs = editor.state.inputs, + targetInput = inputs[index]; + + if (!targetInput) { + return; + } + + /** + * When new Block created or deleted content of input + * We should add some text node to set caret + */ + if (!targetInput.childNodes.length) { + var emptyTextElement = document.createTextNode(''); + + targetInput.appendChild(emptyTextElement); + } + + editor.caret.inputIndex = index; + editor.caret.set(targetInput, 0, 0); + editor.content.workingNodeChanged(targetInput); + }; + + /** + * @param {int} index - index of input + */ + caret.setToPreviousBlock = function (index) { + index = index || 0; + + var inputs = editor.state.inputs, + previousInput = inputs[index - 1], + lastChildNode, + lengthOfLastChildNode, + emptyTextElement; + + if (!previousInput) { + editor.core.log('We are reached first node'); + return; + } + + lastChildNode = editor.content.getDeepestTextNodeFromPosition(previousInput, previousInput.childNodes.length); + lengthOfLastChildNode = lastChildNode.length; + + /** + * When new Block created or deleted content of input + * We should add some text node to set caret + */ + if (!previousInput.childNodes.length) { + emptyTextElement = document.createTextNode(''); + previousInput.appendChild(emptyTextElement); + } + editor.caret.inputIndex = index - 1; + editor.caret.set(previousInput, previousInput.childNodes.length - 1, lengthOfLastChildNode); + editor.content.workingNodeChanged(inputs[index - 1]); + }; + + caret.position = { + + atStart: function atStart() { + var selection = window.getSelection(), + anchorOffset = selection.anchorOffset, + anchorNode = selection.anchorNode, + firstLevelBlock = editor.content.getFirstLevelBlock(anchorNode), + pluginsRender = firstLevelBlock.childNodes[0]; + + if (!editor.core.isDomNode(anchorNode)) { + anchorNode = anchorNode.parentNode; + } + + var isFirstNode = anchorNode === pluginsRender.childNodes[0], + isOffsetZero = anchorOffset === 0; + + return isFirstNode && isOffsetZero; + }, + + atTheEnd: function atTheEnd() { + var selection = window.getSelection(), + anchorOffset = selection.anchorOffset, + anchorNode = selection.anchorNode; + + /** Caret is at the end of input */ + return !anchorNode || !anchorNode.length || anchorOffset === anchorNode.length; + } + }; + + /** + * Inserts node at the caret location + * @param {HTMLElement|DocumentFragment} node + */ + caret.insertNode = function (node) { + var selection, + range, + lastNode = node; + + if (node.nodeType == editor.core.nodeTypes.DOCUMENT_FRAGMENT) { + lastNode = node.lastChild; + } + + selection = window.getSelection(); + + range = selection.getRangeAt(0); + range.deleteContents(); + + range.insertNode(node); + + range.setStartAfter(lastNode); + range.collapse(true); + + selection.removeAllRanges(); + selection.addRange(range); + }; + + return caret; +}({}); + +/***/ }), + +/***/ "./src/components/modules/_content.js": +/*!********************************************!*\ + !*** ./src/components/modules/_content.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); /** + * Codex Editor Content Module + * Works with DOM + * + * @class Content + * @classdesc Class works provides COdex Editor appearance logic + * + * @author Codex Team + * @version 2.0.0 + */ + +var _dom = __webpack_require__(/*! ../dom */ "./src/components/dom.js"); + +var _dom2 = _interopRequireDefault(_dom); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +module.exports = function () { + _createClass(Content, null, [{ + key: 'name', + + /** + * Module key name + * @returns {string} + */ + get: function get() { + return 'Content'; + } + + /** + * @constructor + * + * @param {EditorConfig} config + */ + + }]); + + function Content(config) { + _classCallCheck(this, Content); + + this.config = config; + this.Editor = null; + + this.CSS = { + block: 'ce-block', + content: 'ce-block__content', + stretched: 'ce-block--stretched', + highlighted: 'ce-block--highlighted' + }; + + this._currentNode = null; + this._currentIndex = 0; + } + + /** + * Editor modules setter + * @param {object} Editor + */ + + + _createClass(Content, [{ + key: 'composeBlock_', + + + /** + * @private + * @param pluginHTML + * @param {Boolean} isStretched - make stretched block or not + * + * @description adds necessary information to wrap new created block by first-level holder + */ + value: function composeBlock_(pluginHTML) { + var isStretched = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var block = _dom2.default.make('DIV', this.CSS.block), + blockContent = _dom2.default.make('DIV', this.CSS.content); + + blockContent.appendChild(pluginHTML); + block.appendChild(blockContent); + + if (isStretched) { + blockContent.classList.add(this.CSS.stretched); + } + + block.dataset.toolId = this._currentIndex++; + + return block; + } + }, { + key: 'getFirstLevelBlock', + + + /** + * Finds first-level block + * @description looks for first-level block. + * gets parent while node is not first-level + * + * @param {Element} node - selected or clicked in redactors area node + * @protected + * + */ + value: function getFirstLevelBlock(node) { + if (!_dom2.default.isElement(node)) { + node = node.parentNode; + } + + if (node === this.Editor.ui.nodes.redactor || node === document.body) { + return null; + } else { + while (node.classList && !node.classList.contains(this.CSS.block)) { + node = node.parentNode; + } + + return node; + } + } + }, { + key: 'insertBlock', + + + /** + * Insert new block to working area + * + * @param {HTMLElement} tool + * + * @returns {Number} tool index + * + */ + value: function insertBlock(tool) { + var newBlock = this.composeBlock_(tool); + + if (this.currentNode) { + this.currentNode.insertAdjacentElement('afterend', newBlock); + } else { + /** + * If redactor is empty, append as first child + */ + this.Editor.ui.nodes.redactor.appendChild(newBlock); + } + + /** + * Set new node as current + */ + this.currentNode = newBlock; + + return newBlock.dataset.toolId; + } + }, { + key: 'state', + set: function set(Editor) { + this.Editor = Editor; + } + + /** + * Get current working node + * + * @returns {null|HTMLElement} + */ + + }, { + key: 'currentNode', + get: function get() { + return this._currentNode; + } + + /** + * Set working node. Working node should be first level block, so we find it before set one to _currentNode property + * + * @param {HTMLElement} node + */ + , + set: function set(node) { + var firstLevelBlock = this.getFirstLevelBlock(node); + + this._currentNode = firstLevelBlock; + } + }]); + + return Content; +}(); + +// module.exports = (function (content) { +// +// let editor = codex.editor; +// +// /** +// * Links to current active block +// * @type {null | Element} +// */ +// content.currentNode = null; +// +// /** +// * clicked in redactor area +// * @type {null | Boolean} +// */ +// content.editorAreaHightlighted = null; +// +// /** +// * @deprecated +// * Synchronizes redactor with original textarea +// */ +// content.sync = function () { +// +// editor.core.log('syncing...'); +// +// /** +// * Save redactor content to editor.state +// */ +// editor.state.html = editor.nodes.redactor.innerHTML; +// +// }; +// +// /** +// * Appends background to the block +// * +// * @description add CSS class to highlight visually first-level block area +// */ +// content.markBlock = function () { +// +// editor.content.currentNode.classList.add(editor.ui.className.BLOCK_HIGHLIGHTED); +// +// }; +// +// /** +// * Clear background +// * +// * @description clears styles that highlights block +// */ +// content.clearMark = function () { +// +// if (editor.content.currentNode) { +// +// editor.content.currentNode.classList.remove(editor.ui.className.BLOCK_HIGHLIGHTED); +// +// } +// +// }; +// +// /** +// * Finds first-level block +// * +// * @param {Element} node - selected or clicked in redactors area node +// * @protected +// * +// * @description looks for first-level block. +// * gets parent while node is not first-level +// */ +// content.getFirstLevelBlock = function (node) { +// +// if (!editor.core.isDomNode(node)) { +// +// node = node.parentNode; +// +// } +// +// if (node === editor.nodes.redactor || node === document.body) { +// +// return null; +// +// } else { +// +// while(!node.classList.contains(editor.ui.className.BLOCK_CLASSNAME)) { +// +// node = node.parentNode; +// +// } +// +// return node; +// +// } +// +// }; +// +// /** +// * Trigger this event when working node changed +// * @param {Element} targetNode - first-level of this node will be current +// * @protected +// * +// * @description If targetNode is first-level then we set it as current else we look for parents to find first-level +// */ +// content.workingNodeChanged = function (targetNode) { +// +// /** Clear background from previous marked block before we change */ +// editor.content.clearMark(); +// +// if (!targetNode) { +// +// return; +// +// } +// +// content.currentNode = content.getFirstLevelBlock(targetNode); +// +// }; +// +// /** +// * Replaces one redactor block with another +// * @protected +// * @param {Element} targetBlock - block to replace. Mostly currentNode. +// * @param {Element} newBlock +// * @param {string} newBlockType - type of new block; we need to store it to data-attribute +// * +// * [!] Function does not saves old block content. +// * You can get it manually and pass with newBlock.innerHTML +// */ +// content.replaceBlock = function (targetBlock, newBlock) { +// +// if (!targetBlock || !newBlock) { +// +// editor.core.log('replaceBlock: missed params'); +// return; +// +// } +// +// /** If target-block is not a frist-level block, then we iterate parents to find it */ +// while(!targetBlock.classList.contains(editor.ui.className.BLOCK_CLASSNAME)) { +// +// targetBlock = targetBlock.parentNode; +// +// } +// +// /** Replacing */ +// editor.nodes.redactor.replaceChild(newBlock, targetBlock); +// +// /** +// * Set new node as current +// */ +// editor.content.workingNodeChanged(newBlock); +// +// /** +// * Add block handlers +// */ +// editor.ui.addBlockHandlers(newBlock); +// +// /** +// * Save changes +// */ +// editor.ui.saveInputs(); +// +// }; +// +// /** +// * @protected +// * +// * Inserts new block to redactor +// * Wrapps block into a DIV with BLOCK_CLASSNAME class +// * +// * @param blockData {object} +// * @param blockData.block {Element} element with block content +// * @param blockData.type {string} block plugin +// * @param needPlaceCaret {bool} pass true to set caret in new block +// * +// */ +// content.insertBlock = function ( blockData, needPlaceCaret ) { +// +// var workingBlock = editor.content.currentNode, +// newBlockContent = blockData.block, +// blockType = blockData.type, +// isStretched = blockData.stretched; +// +// var newBlock = composeNewBlock_(newBlockContent, blockType, isStretched); +// +// if (workingBlock) { +// +// editor.core.insertAfter(workingBlock, newBlock); +// +// } else { +// +// /** +// * If redactor is empty, append as first child +// */ +// editor.nodes.redactor.appendChild(newBlock); +// +// } +// +// /** +// * Block handler +// */ +// editor.ui.addBlockHandlers(newBlock); +// +// /** +// * Set new node as current +// */ +// editor.content.workingNodeChanged(newBlock); +// +// /** +// * Save changes +// */ +// editor.ui.saveInputs(); +// +// +// if ( needPlaceCaret ) { +// +// /** +// * If we don't know input index then we set default value -1 +// */ +// var currentInputIndex = editor.caret.getCurrentInputIndex() || -1; +// +// +// if (currentInputIndex == -1) { +// +// +// var editableElement = newBlock.querySelector('[contenteditable]'), +// emptyText = document.createTextNode(''); +// +// editableElement.appendChild(emptyText); +// editor.caret.set(editableElement, 0, 0); +// +// editor.toolbar.move(); +// editor.toolbar.showPlusButton(); +// +// +// } else { +// +// if (currentInputIndex === editor.state.inputs.length - 1) +// return; +// +// /** Timeout for browsers execution */ +// window.setTimeout(function () { +// +// /** Setting to the new input */ +// editor.caret.setToNextBlock(currentInputIndex); +// editor.toolbar.move(); +// editor.toolbar.open(); +// +// }, 10); +// +// } +// +// } +// +// /** +// * Block is inserted, wait for new click that defined focusing on editors area +// * @type {boolean} +// */ +// content.editorAreaHightlighted = false; +// +// }; +// +// /** +// * Replaces blocks with saving content +// * @protected +// * @param {Element} noteToReplace +// * @param {Element} newNode +// * @param {Element} blockType +// */ +// content.switchBlock = function (blockToReplace, newBlock, tool) { +// +// tool = tool || editor.content.currentNode.dataset.tool; +// var newBlockComposed = composeNewBlock_(newBlock, tool); +// +// /** Replacing */ +// editor.content.replaceBlock(blockToReplace, newBlockComposed); +// +// /** Save new Inputs when block is changed */ +// editor.ui.saveInputs(); +// +// }; +// +// /** +// * Iterates between child noted and looking for #text node on deepest level +// * @protected +// * +// * @param {Element} block - node where find +// * @param {int} postiton - starting postion +// * Example: childNodex.length to find from the end +// * or 0 to find from the start +// * @return {Text} block +// * @uses DFS +// */ +// content.getDeepestTextNodeFromPosition = function (block, position) { +// +// /** +// * Clear Block from empty and useless spaces with trim. +// * Such nodes we should remove +// */ +// var blockChilds = block.childNodes, +// index, +// node, +// text; +// +// for(index = 0; index < blockChilds.length; index++) { +// +// node = blockChilds[index]; +// +// if (node.nodeType == editor.core.nodeTypes.TEXT) { +// +// text = node.textContent.trim(); +// +// /** Text is empty. We should remove this child from node before we start DFS +// * decrease the quantity of childs. +// */ +// if (text === '') { +// +// block.removeChild(node); +// position--; +// +// } +// +// } +// +// } +// +// if (block.childNodes.length === 0) { +// +// return document.createTextNode(''); +// +// } +// +// /** Setting default position when we deleted all empty nodes */ +// if ( position < 0 ) +// position = 1; +// +// var lookingFromStart = false; +// +// /** For looking from START */ +// if (position === 0) { +// +// lookingFromStart = true; +// position = 1; +// +// } +// +// while ( position ) { +// +// /** initial verticle of node. */ +// if ( lookingFromStart ) { +// +// block = block.childNodes[0]; +// +// } else { +// +// block = block.childNodes[position - 1]; +// +// } +// +// if ( block.nodeType == editor.core.nodeTypes.TAG ) { +// +// position = block.childNodes.length; +// +// } else if (block.nodeType == editor.core.nodeTypes.TEXT ) { +// +// position = 0; +// +// } +// +// } +// +// return block; +// +// }; +// +// /** +// * @private +// * @param {Element} block - current plugins render +// * @param {String} tool - plugins name +// * @param {Boolean} isStretched - make stretched block or not +// * +// * @description adds necessary information to wrap new created block by first-level holder +// */ +// var composeNewBlock_ = function (block, tool, isStretched) { +// +// var newBlock = editor.draw.node('DIV', editor.ui.className.BLOCK_CLASSNAME, {}), +// blockContent = editor.draw.node('DIV', editor.ui.className.BLOCK_CONTENT, {}); +// +// blockContent.appendChild(block); +// newBlock.appendChild(blockContent); +// +// if (isStretched) { +// +// blockContent.classList.add(editor.ui.className.BLOCK_STRETCHED); +// +// } +// +// newBlock.dataset.tool = tool; +// return newBlock; +// +// }; +// +// /** +// * Returns Range object of current selection +// * @protected +// */ +// content.getRange = function () { +// +// var selection = window.getSelection().getRangeAt(0); +// +// return selection; +// +// }; +// +// /** +// * Divides block in two blocks (after and before caret) +// * +// * @protected +// * @param {int} inputIndex - target input index +// * +// * @description splits current input content to the separate blocks +// * When enter is pressed among the words, that text will be splited. +// */ +// content.splitBlock = function (inputIndex) { +// +// var selection = window.getSelection(), +// anchorNode = selection.anchorNode, +// anchorNodeText = anchorNode.textContent, +// caretOffset = selection.anchorOffset, +// textBeforeCaret, +// textNodeBeforeCaret, +// textAfterCaret, +// textNodeAfterCaret; +// +// var currentBlock = editor.content.currentNode.querySelector('[contentEditable]'); +// +// +// textBeforeCaret = anchorNodeText.substring(0, caretOffset); +// textAfterCaret = anchorNodeText.substring(caretOffset); +// +// textNodeBeforeCaret = document.createTextNode(textBeforeCaret); +// +// if (textAfterCaret) { +// +// textNodeAfterCaret = document.createTextNode(textAfterCaret); +// +// } +// +// var previousChilds = [], +// nextChilds = [], +// reachedCurrent = false; +// +// if (textNodeAfterCaret) { +// +// nextChilds.push(textNodeAfterCaret); +// +// } +// +// for ( var i = 0, child; !!(child = currentBlock.childNodes[i]); i++) { +// +// if ( child != anchorNode ) { +// +// if ( !reachedCurrent ) { +// +// previousChilds.push(child); +// +// } else { +// +// nextChilds.push(child); +// +// } +// +// } else { +// +// reachedCurrent = true; +// +// } +// +// } +// +// /** Clear current input */ +// editor.state.inputs[inputIndex].innerHTML = ''; +// +// /** +// * Append all childs founded before anchorNode +// */ +// var previousChildsLength = previousChilds.length; +// +// for(i = 0; i < previousChildsLength; i++) { +// +// editor.state.inputs[inputIndex].appendChild(previousChilds[i]); +// +// } +// +// editor.state.inputs[inputIndex].appendChild(textNodeBeforeCaret); +// +// /** +// * Append text node which is after caret +// */ +// var nextChildsLength = nextChilds.length, +// newNode = document.createElement('div'); +// +// for(i = 0; i < nextChildsLength; i++) { +// +// newNode.appendChild(nextChilds[i]); +// +// } +// +// newNode = newNode.innerHTML; +// +// /** This type of block creates when enter is pressed */ +// var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; +// +// /** +// * Make new paragraph with text after caret +// */ +// editor.content.insertBlock({ +// type : NEW_BLOCK_TYPE, +// block : editor.tools[NEW_BLOCK_TYPE].render({ +// text : newNode +// }) +// }, true ); +// +// }; +// +// /** +// * Merges two blocks — current and target +// * If target index is not exist, then previous will be as target +// * +// * @protected +// * @param {int} currentInputIndex +// * @param {int} targetInputIndex +// * +// * @description gets two inputs indexes and merges into one +// */ +// content.mergeBlocks = function (currentInputIndex, targetInputIndex) { +// +// /** If current input index is zero, then prevent method execution */ +// if (currentInputIndex === 0) { +// +// return; +// +// } +// +// var targetInput, +// currentInputContent = editor.state.inputs[currentInputIndex].innerHTML; +// +// if (!targetInputIndex) { +// +// targetInput = editor.state.inputs[currentInputIndex - 1]; +// +// } else { +// +// targetInput = editor.state.inputs[targetInputIndex]; +// +// } +// +// targetInput.innerHTML += currentInputContent; +// +// }; +// +// /** +// * Iterates all right siblings and parents, which has right siblings +// * while it does not reached the first-level block +// * +// * @param {Element} node +// * @return {boolean} +// */ +// content.isLastNode = function (node) { +// +// // console.log('погнали перебор родителей'); +// +// var allChecked = false; +// +// while ( !allChecked ) { +// +// // console.log('Смотрим на %o', node); +// // console.log('Проверим, пустые ли соседи справа'); +// +// if ( !allSiblingsEmpty_(node) ) { +// +// // console.log('Есть непустые соседи. Узел не последний. Выходим.'); +// return false; +// +// } +// +// node = node.parentNode; +// +// /** +// * Проверяем родителей до тех пор, пока не найдем блок первого уровня +// */ +// if ( node.classList.contains(editor.ui.className.BLOCK_CONTENT) ) { +// +// allChecked = true; +// +// } +// +// } +// +// return true; +// +// }; +// +// /** +// * Checks if all element right siblings is empty +// * @param node +// */ +// var allSiblingsEmpty_ = function (node) { +// +// /** +// * Нужно убедиться, что после пустого соседа ничего нет +// */ +// var sibling = node.nextSibling; +// +// while ( sibling ) { +// +// if (sibling.textContent.length) { +// +// return false; +// +// } +// +// sibling = sibling.nextSibling; +// +// } +// +// return true; +// +// }; +// +// /** +// * @public +// * +// * @param {string} htmlData - html content as string +// * @param {string} plainData - plain text +// * @return {string} - html content as string +// */ +// content.wrapTextWithParagraphs = function (htmlData, plainData) { +// +// if (!htmlData.trim()) { +// +// return wrapPlainTextWithParagraphs(plainData); +// +// } +// +// var wrapper = document.createElement('DIV'), +// newWrapper = document.createElement('DIV'), +// i, +// paragraph, +// firstLevelBlocks = ['DIV', 'P'], +// blockTyped, +// node; +// +// /** +// * Make HTML Element to Wrap Text +// * It allows us to work with input data as HTML content +// */ +// wrapper.innerHTML = htmlData; +// paragraph = document.createElement('P'); +// +// for (i = 0; i < wrapper.childNodes.length; i++) { +// +// node = wrapper.childNodes[i]; +// +// blockTyped = firstLevelBlocks.indexOf(node.tagName) != -1; +// +// /** +// * If node is first-levet +// * we add this node to our new wrapper +// */ +// if ( blockTyped ) { +// +// /** +// * If we had splitted inline nodes to paragraph before +// */ +// if ( paragraph.childNodes.length ) { +// +// newWrapper.appendChild(paragraph.cloneNode(true)); +// +// /** empty paragraph */ +// paragraph = null; +// paragraph = document.createElement('P'); +// +// } +// +// newWrapper.appendChild(node.cloneNode(true)); +// +// } else { +// +// /** Collect all inline nodes to one as paragraph */ +// paragraph.appendChild(node.cloneNode(true)); +// +// /** if node is last we should append this node to paragraph and paragraph to new wrapper */ +// if ( i == wrapper.childNodes.length - 1 ) { +// +// newWrapper.appendChild(paragraph.cloneNode(true)); +// +// } +// +// } +// +// } +// +// return newWrapper.innerHTML; +// +// }; +// +// /** +// * Splits strings on new line and wraps paragraphs with

    tag +// * @param plainText +// * @returns {string} +// */ +// var wrapPlainTextWithParagraphs = function (plainText) { +// +// if (!plainText) return ''; +// +// return '

    ' + plainText.split('\n\n').join('

    ') + '

    '; +// +// }; +// +// /** +// * Finds closest Contenteditable parent from Element +// * @param {Element} node element looking from +// * @return {Element} node contenteditable +// */ +// content.getEditableParent = function (node) { +// +// while (node && node.contentEditable != 'true') { +// +// node = node.parentNode; +// +// } +// +// return node; +// +// }; +// +// /** +// * Clear editors content +// * +// * @param {Boolean} all — if true, delete all article data (content, id, etc.) +// */ +// content.clear = function (all) { +// +// editor.nodes.redactor.innerHTML = ''; +// editor.content.sync(); +// editor.ui.saveInputs(); +// if (all) { +// +// editor.state.blocks = {}; +// +// } else if (editor.state.blocks) { +// +// editor.state.blocks.items = []; +// +// } +// +// editor.content.currentNode = null; +// +// }; +// +// /** +// * +// * Load new data to editor +// * If editor is not empty, just append articleData.items +// * +// * @param articleData.items +// */ +// content.load = function (articleData) { +// +// var currentContent = Object.assign({}, editor.state.blocks); +// +// editor.content.clear(); +// +// if (!Object.keys(currentContent).length) { +// +// editor.state.blocks = articleData; +// +// } else if (!currentContent.items) { +// +// currentContent.items = articleData.items; +// editor.state.blocks = currentContent; +// +// } else { +// +// currentContent.items = currentContent.items.concat(articleData.items); +// editor.state.blocks = currentContent; +// +// } +// +// editor.renderer.makeBlocksFromData(); +// +// }; +// +// return content; +// +// })({}); + +/***/ }), + +/***/ "./src/components/modules/_destroyer.js": +/*!**********************************************!*\ + !*** ./src/components/modules/_destroyer.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +/** + * Codex Editor Destroyer module + * + * @auhor Codex Team + * @version 1.0 + */ + +module.exports = function (destroyer) { + var editor = codex.editor; + + destroyer.removeNodes = function () { + editor.nodes.wrapper.remove(); + editor.nodes.notifications.remove(); + }; + + destroyer.destroyPlugins = function () { + for (var tool in editor.tools) { + if (typeof editor.tools[tool].destroy === 'function') { + editor.tools[tool].destroy(); + } + } + }; + + destroyer.destroyScripts = function () { + var scripts = document.getElementsByTagName('SCRIPT'); + + for (var i = 0; i < scripts.length; i++) { + if (scripts[i].id.indexOf(editor.scriptPrefix) + 1) { + scripts[i].remove(); + i--; + } + } + }; + + /** + * Delete editor data from webpage. + * You should send settings argument with boolean flags: + * @param settings.ui- remove redactor event listeners and DOM nodes + * @param settings.scripts - remove redactor scripts from DOM + * @param settings.plugins - remove plugin's objects + * @param settings.core - remove editor core. You can remove core only if UI and scripts flags is true + * } + * + */ + destroyer.destroy = function (settings) { + if (!settings || (typeof settings === 'undefined' ? 'undefined' : _typeof(settings)) !== 'object') { + return; + } + + if (settings.ui) { + destroyer.removeNodes(); + editor.listeners.removeAll(); + } + + if (settings.scripts) { + destroyer.destroyScripts(); + } + + if (settings.plugins) { + destroyer.destroyPlugins(); + } + + if (settings.ui && settings.scripts && settings.core) { + delete codex.editor; + } + }; + + return destroyer; +}({}); + +/***/ }), + +/***/ "./src/components/modules/_notifications.js": +/*!**************************************************!*\ + !*** ./src/components/modules/_notifications.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Codex Editor Notification Module + * + * @author Codex Team + * @version 1.0 + */ + +module.exports = function (notifications) { + var editor = codex.editor; + + var queue = []; + + var addToQueue = function addToQueue(settings) { + queue.push(settings); + + var index = 0; + + while (index < queue.length && queue.length > 5) { + if (queue[index].type == 'confirm' || queue[index].type == 'prompt') { + index++; + continue; + } + + queue[index].close(); + queue.splice(index, 1); + } + }; + + notifications.createHolder = function () { + var holder = editor.draw.node('DIV', 'cdx-notifications-block'); + + editor.nodes.notifications = document.body.appendChild(holder); + + return holder; + }; + + /** + * Error notificator. Shows block with message + * @protected + */ + notifications.errorThrown = function (errorMsg, event) { + editor.notifications.notification({ message: 'This action is not available currently', type: event.type }); + }; + + /** + * + * Appends notification + * + * settings = { + * type - notification type (reserved types: alert, confirm, prompt). Just add class 'cdx-notification-'+type + * message - notification message + * okMsg - confirm button text (default - 'Ok') + * cancelBtn - cancel button text (default - 'Cancel'). Only for confirm and prompt types + * confirm - function-handler for ok button click + * cancel - function-handler for cancel button click. Only for confirm and prompt types + * time - time (in seconds) after which notification will close (default - 10s) + * } + * + * @param settings + */ + notifications.notification = function (constructorSettings) { + /** Private vars and methods */ + var notification = null, + cancel = null, + type = null, + confirm = null, + inputField = null; + + var confirmHandler = function confirmHandler() { + close(); + + if (typeof confirm !== 'function') { + return; + } + + if (type == 'prompt') { + confirm(inputField.value); + return; + } + + confirm(); + }; + + var cancelHandler = function cancelHandler() { + close(); + + if (typeof cancel !== 'function') { + return; + } + + cancel(); + }; + + /** Public methods */ + function create(settings) { + if (!(settings && settings.message)) { + editor.core.log('Can\'t create notification. Message is missed'); + return; + } + + settings.type = settings.type || 'alert'; + settings.time = settings.time * 1000 || 10000; + + var wrapper = editor.draw.node('DIV', 'cdx-notification'), + message = editor.draw.node('DIV', 'cdx-notification__message'), + input = editor.draw.node('INPUT', 'cdx-notification__input'), + okBtn = editor.draw.node('SPAN', 'cdx-notification__ok-btn'), + cancelBtn = editor.draw.node('SPAN', 'cdx-notification__cancel-btn'); + + message.textContent = settings.message; + okBtn.textContent = settings.okMsg || 'ОК'; + cancelBtn.textContent = settings.cancelMsg || 'Отмена'; + + editor.listeners.add(okBtn, 'click', confirmHandler); + editor.listeners.add(cancelBtn, 'click', cancelHandler); + + wrapper.appendChild(message); + + if (settings.type == 'prompt') { + wrapper.appendChild(input); + } + + wrapper.appendChild(okBtn); + + if (settings.type == 'prompt' || settings.type == 'confirm') { + wrapper.appendChild(cancelBtn); + } + + wrapper.classList.add('cdx-notification-' + settings.type); + wrapper.dataset.type = settings.type; + + notification = wrapper; + type = settings.type; + confirm = settings.confirm; + cancel = settings.cancel; + inputField = input; + + if (settings.type != 'prompt' && settings.type != 'confirm') { + window.setTimeout(close, settings.time); + } + }; + + /** + * Show notification block + */ + function send() { + editor.nodes.notifications.appendChild(notification); + inputField.focus(); + + editor.nodes.notifications.classList.add('cdx-notification__notification-appending'); + + window.setTimeout(function () { + editor.nodes.notifications.classList.remove('cdx-notification__notification-appending'); + }, 100); + + addToQueue({ type: type, close: close }); + }; + + /** + * Remove notification block + */ + function close() { + notification.remove(); + }; + + if (constructorSettings) { + create(constructorSettings); + send(); + } + + return { + create: create, + send: send, + close: close + }; + }; + + notifications.clear = function () { + editor.nodes.notifications.innerHTML = ''; + queue = []; + }; + + return notifications; +}({}); + +/***/ }), + +/***/ "./src/components/modules/_parser.js": +/*!*******************************************!*\ + !*** ./src/components/modules/_parser.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Codex Editor Parser Module + * + * @author Codex Team + * @version 1.1 + */ + +module.exports = function (parser) { + var editor = codex.editor; + + /** inserting text */ + parser.insertPastedContent = function (blockType, tag) { + editor.content.insertBlock({ + type: blockType.type, + block: blockType.render({ + text: tag.innerHTML + }) + }); + }; + + /** + * Check DOM node for display style: separated block or child-view + */ + parser.isFirstLevelBlock = function (node) { + return node.nodeType == editor.core.nodeTypes.TAG && node.classList.contains(editor.ui.className.BLOCK_CLASSNAME); + }; + + return parser; +}({}); + +/***/ }), + +/***/ "./src/components/modules/_paste.js": +/*!******************************************!*\ + !*** ./src/components/modules/_paste.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Codex Editor Paste module + * + * @author Codex Team + * @version 1.1.1 + */ + +module.exports = function (paste) { + var editor = codex.editor; + + var patterns = []; + + paste.prepare = function () { + var tools = editor.tools; + + for (var tool in tools) { + if (!tools[tool].renderOnPastePatterns || !Array.isArray(tools[tool].renderOnPastePatterns)) { + continue; + } + + tools[tool].renderOnPastePatterns.map(function (pattern) { + patterns.push(pattern); + }); + } + + return Promise.resolve(); + }; + + /** + * Saves data + * @param event + */ + paste.pasted = function (event) { + var clipBoardData = event.clipboardData || window.clipboardData, + content = clipBoardData.getData('Text'); + + var result = analize(content); + + if (result) { + event.preventDefault(); + event.stopImmediatePropagation(); + } + + return result; + }; + + /** + * Analizes pated string and calls necessary method + */ + + var analize = function analize(string) { + var result = false, + content = editor.content.currentNode, + plugin = content.dataset.tool; + + patterns.map(function (pattern) { + var execArray = pattern.regex.exec(string), + match = execArray && execArray[0]; + + if (match && match === string.trim()) { + /** current block is not empty */ + if (content.textContent.trim() && plugin == editor.settings.initialBlockPlugin) { + pasteToNewBlock_(); + } + + pattern.callback(string, pattern); + result = true; + } + }); + + return result; + }; + + var pasteToNewBlock_ = function pasteToNewBlock_() { + /** Create new initial block */ + editor.content.insertBlock({ + + type: editor.settings.initialBlockPlugin, + block: editor.tools[editor.settings.initialBlockPlugin].render({ + text: '' + }) + + }, false); + }; + + /** + * This method prevents default behaviour. + * + * @param {Object} event + * @protected + * + * @description We get from clipboard pasted data, sanitize, make a fragment that contains of this sanitized nodes. + * Firstly, we need to memorize the caret position. We can do that by getting the range of selection. + * After all, we insert clear fragment into caret placed position. Then, we should move the caret to the last node + */ + paste.blockPasteCallback = function (event) { + if (!needsToHandlePasteEvent(event.target)) { + return; + } + + /** Prevent default behaviour */ + event.preventDefault(); + + /** get html pasted data - dirty data */ + var htmlData = event.clipboardData.getData('text/html'), + plainData = event.clipboardData.getData('text/plain'); + + /** Temporary DIV that is used to work with text's paragraphs as DOM-elements*/ + var paragraphs = editor.draw.node('DIV', '', {}), + cleanData, + wrappedData; + + /** Create fragment, that we paste to range after proccesing */ + cleanData = editor.sanitizer.clean(htmlData); + + /** + * We wrap pasted text with

    tags to split it logically + * @type {string} + */ + wrappedData = editor.content.wrapTextWithParagraphs(cleanData, plainData); + paragraphs.innerHTML = wrappedData; + + /** + * If there only one paragraph, just insert in at the caret location + */ + if (paragraphs.childNodes.length == 1) { + emulateUserAgentBehaviour(paragraphs.firstChild); + return; + } + + insertPastedParagraphs(paragraphs.childNodes); + }; + + /** + * Checks if we should handle paste event on block + * @param block + * + * @return {boolean} + */ + var needsToHandlePasteEvent = function needsToHandlePasteEvent(block) { + /** If area is input or textarea then allow default behaviour */ + if (editor.core.isNativeInput(block)) { + return false; + } + + var editableParent = editor.content.getEditableParent(block); + + /** Allow paste when event target placed in Editable element */ + if (!editableParent) { + return false; + } + + return true; + }; + + /** + * Inserts new initial plugin blocks with data in paragraphs + * + * @param {Array} paragraphs - array of paragraphs (

    ) whit content, that should be inserted + */ + var insertPastedParagraphs = function insertPastedParagraphs(paragraphs) { + var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin, + currentNode = editor.content.currentNode; + + paragraphs.forEach(function (paragraph) { + /** Don't allow empty paragraphs */ + if (editor.core.isBlockEmpty(paragraph)) { + return; + } + + editor.content.insertBlock({ + type: NEW_BLOCK_TYPE, + block: editor.tools[NEW_BLOCK_TYPE].render({ + text: paragraph.innerHTML + }) + }); + + editor.caret.inputIndex++; + }); + + editor.caret.setToPreviousBlock(editor.caret.getCurrentInputIndex() + 1); + + /** + * If there was no data in working node, remove it + */ + if (editor.core.isBlockEmpty(currentNode)) { + currentNode.remove(); + editor.ui.saveInputs(); + } + }; + + /** + * Inserts node content at the caret position + * + * @param {Node} node - DOM node (could be DocumentFragment), that should be inserted at the caret location + */ + var emulateUserAgentBehaviour = function emulateUserAgentBehaviour(node) { + var newNode; + + if (node.childElementCount) { + newNode = document.createDocumentFragment(); + + node.childNodes.forEach(function (current) { + if (!editor.core.isDomNode(current) && current.data.trim() === '') { + return; + } + + newNode.appendChild(current.cloneNode(true)); + }); + } else { + newNode = document.createTextNode(node.textContent); + } + + editor.caret.insertNode(newNode); + }; + + return paste; +}({}); + +/***/ }), + +/***/ "./src/components/modules/_transport.js": +/*!**********************************************!*\ + !*** ./src/components/modules/_transport.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * + * Codex.Editor Transport Module + * + * @copyright 2017 Codex-Team + * @version 1.2.0 + */ + +module.exports = function (transport) { + var editor = codex.editor; + + /** + * @private {Object} current XmlHttpRequest instance + */ + var currentRequest = null; + + /** + * @type {null} | {DOMElement} input - keeps input element in memory + */ + transport.input = null; + + /** + * @property {Object} arguments - keep plugin settings and defined callbacks + */ + transport.arguments = null; + + /** + * Prepares input element where will be files + */ + transport.prepare = function () { + var input = editor.draw.node('INPUT', '', { type: 'file' }); + + editor.listeners.add(input, 'change', editor.transport.fileSelected); + editor.transport.input = input; + }; + + /** Clear input when files is uploaded */ + transport.clearInput = function () { + /** Remove old input */ + transport.input = null; + + /** Prepare new one */ + transport.prepare(); + }; + + /** + * Callback for file selection + * @param {Event} event + */ + transport.fileSelected = function () { + var input = this, + i, + files = input.files, + formData = new FormData(); + + if (editor.transport.arguments.multiple === true) { + for (i = 0; i < files.length; i++) { + formData.append('files[]', files[i], files[i].name); + } + } else { + formData.append('files', files[0], files[0].name); + } + + currentRequest = editor.core.ajax({ + type: 'POST', + data: formData, + url: editor.transport.arguments.url, + beforeSend: editor.transport.arguments.beforeSend, + success: editor.transport.arguments.success, + error: editor.transport.arguments.error, + progress: editor.transport.arguments.progress + }); + + /** Clear input */ + transport.clearInput(); + }; + + /** + * Use plugin callbacks + * @protected + * + * @param {Object} args - can have : + * @param {String} args.url - fetch URL + * @param {Function} args.beforeSend - function calls before sending ajax + * @param {Function} args.success - success callback + * @param {Function} args.error - on error handler + * @param {Function} args.progress - xhr onprogress handler + * @param {Boolean} args.multiple - allow select several files + * @param {String} args.accept - adds accept attribute + */ + transport.selectAndUpload = function (args) { + transport.arguments = args; + + if (args.multiple === true) { + transport.input.setAttribute('multiple', 'multiple'); + } + + if (args.accept) { + transport.input.setAttribute('accept', args.accept); + } + + transport.input.click(); + }; + + transport.abort = function () { + currentRequest.abort(); + + currentRequest = null; + }; + + return transport; +}({}); + +/***/ }), + +/***/ "./src/components/modules/api-blocks.ts": +/*!**********************************************!*\ + !*** ./src/components/modules/api-blocks.ts ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @class BlocksAPI + * provides with methods working with Block + */ +var BlocksAPI = function (_Module) { + _inherits(BlocksAPI, _Module); + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + function BlocksAPI(_ref) { + var config = _ref.config; + + _classCallCheck(this, BlocksAPI); + + return _possibleConstructorReturn(this, (BlocksAPI.__proto__ || Object.getPrototypeOf(BlocksAPI)).call(this, { config: config })); + } + /** + * Available methods + * @return {IBlocksAPI} + */ + + + _createClass(BlocksAPI, [{ + key: "getBlocksCount", + + /** + * Returns Blocks count + * @return {number} + */ + value: function getBlocksCount() { + return this.Editor.BlockManager.blocks.length; + } + /** + * Returns current block index + * @return {number} + */ + + }, { + key: "getCurrentBlockIndex", + value: function getCurrentBlockIndex() { + return this.Editor.BlockManager.currentBlockIndex; + } + /** + * Returns Current Block + * @param {Number} index + * + * @return {Object} + */ + + }, { + key: "getBlockByIndex", + value: function getBlockByIndex(index) { + return this.Editor.BlockManager.getBlockByIndex(index); + } + /** + * Call Block Manager method that swap Blocks + * @param {number} fromIndex - position of first Block + * @param {number} toIndex - position of second Block + */ + + }, { + key: "swap", + value: function swap(fromIndex, toIndex) { + this.Editor.BlockManager.swap(fromIndex, toIndex); + /** + * Move toolbar + * DO not close the settings + */ + this.Editor.Toolbar.move(false); + } + /** + * Deletes Block + * @param blockIndex + */ + + }, { + key: "delete", + value: function _delete(blockIndex) { + this.Editor.BlockManager.removeBlock(blockIndex); + /** + * in case of last block deletion + * Insert new initial empty block + */ + if (this.Editor.BlockManager.blocks.length === 0) { + this.Editor.BlockManager.insert(); + } + /** + * In case of deletion first block we need to set caret to the current Block + */ + if (this.Editor.BlockManager.currentBlockIndex === 0) { + this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock); + } else { + this.Editor.Caret.navigatePrevious(true); + } + this.Editor.Toolbar.close(); + } + /** + * Clear Editor's area + */ + + }, { + key: "clear", + value: function clear() { + this.Editor.BlockManager.clear(true); + } + /** + * Fills Editor with Blocks data + * @param {IInputOutputData} data — Saved Editor data + */ + + }, { + key: "render", + value: function render(data) { + this.Editor.BlockManager.clear(); + this.Editor.Renderer.render(data.items); + } + }, { + key: "methods", + get: function get() { + var _this2 = this; + + return { + clear: function clear() { + return _this2.clear(); + }, + render: function render(data) { + return _this2.render(data); + }, + delete: function _delete() { + return _this2.delete(); + }, + swap: function swap(fromIndex, toIndex) { + return _this2.swap(fromIndex, toIndex); + }, + getBlockByIndex: function getBlockByIndex(index) { + return _this2.getBlockByIndex(index); + }, + getCurrentBlockIndex: function getCurrentBlockIndex() { + return _this2.getCurrentBlockIndex(); + }, + getBlocksCount: function getBlocksCount() { + return _this2.getBlocksCount(); + } + }; + } + }]); + + return BlocksAPI; +}(Module); + +BlocksAPI.displayName = "BlocksAPI"; +exports.default = BlocksAPI; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/api-events.ts": +/*!**********************************************!*\ + !*** ./src/components/modules/api-events.ts ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @class EventsAPI + * provides with methods working with Toolbar + */ +var EventsAPI = function (_Module) { + _inherits(EventsAPI, _Module); + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + function EventsAPI(_ref) { + var config = _ref.config; + + _classCallCheck(this, EventsAPI); + + return _possibleConstructorReturn(this, (EventsAPI.__proto__ || Object.getPrototypeOf(EventsAPI)).call(this, { config: config })); + } + /** + * Available methods + * @return {IEventsAPI} + */ + + + _createClass(EventsAPI, [{ + key: "on", + + /** + * Subscribe on Events + * @param {String} eventName + * @param {Function} callback + */ + value: function on(eventName, callback) { + this.Editor.Events.on(eventName, callback); + } + /** + * Emit event with data + * @param {String} eventName + * @param {Object} data + */ + + }, { + key: "emit", + value: function emit(eventName, data) { + this.Editor.Events.emit(eventName, data); + } + /** + * Unsubscribe from Event + * @param {String} eventName + * @param {Function} callback + */ + + }, { + key: "off", + value: function off(eventName, callback) { + this.Editor.Events.off(eventName, callback); + } + }, { + key: "methods", + get: function get() { + var _this2 = this; + + return { + emit: function emit(eventName, data) { + return _this2.emit(eventName, data); + }, + off: function off(eventName, callback) { + return _this2.off(eventName, callback); + }, + on: function on(eventName, callback) { + return _this2.on(eventName, callback); + } + }; + } + }]); + + return EventsAPI; +}(Module); + +EventsAPI.displayName = "EventsAPI"; +exports.default = EventsAPI; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/api-listener.ts": +/*!************************************************!*\ + !*** ./src/components/modules/api-listener.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @class API + * Provides with methods working with DOM Listener + */ +var ListenerAPI = function (_Module) { + _inherits(ListenerAPI, _Module); + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + function ListenerAPI(_ref) { + var config = _ref.config; + + _classCallCheck(this, ListenerAPI); + + return _possibleConstructorReturn(this, (ListenerAPI.__proto__ || Object.getPrototypeOf(ListenerAPI)).call(this, { config: config })); + } + /** + * Available methods + * @return {IToolbarAPI} + */ + + + _createClass(ListenerAPI, [{ + key: "on", + + /** + * adds DOM event listener + * + * @param {HTMLElement} element + * @param {string} eventType + * @param {() => void} handler + * @param {boolean} useCapture + */ + value: function on(element, eventType, handler, useCapture) { + this.Editor.Listeners.on(element, eventType, handler, useCapture); + } + /** + * Removes DOM listener from element + * + * @param element + * @param eventType + * @param handler + */ + + }, { + key: "off", + value: function off(element, eventType, handler) { + this.Editor.Listeners.off(element, eventType, handler); + } + }, { + key: "methods", + get: function get() { + var _this2 = this; + + return { + on: function on(element, eventType, handler, useCapture) { + return _this2.on(element, eventType, handler, useCapture); + }, + off: function off(element, eventType, handler) { + return _this2.off(element, eventType, handler); + } + }; + } + }]); + + return ListenerAPI; +}(Module); + +ListenerAPI.displayName = "ListenerAPI"; +exports.default = ListenerAPI; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/api-sanitizer.ts": +/*!*************************************************!*\ + !*** ./src/components/modules/api-sanitizer.ts ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @class API + * Provides CodeX Editor Sanitizer that allows developers to clean their HTML + */ +var SanitizerAPI = function (_Module) { + _inherits(SanitizerAPI, _Module); + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + function SanitizerAPI(_ref) { + var config = _ref.config; + + _classCallCheck(this, SanitizerAPI); + + return _possibleConstructorReturn(this, (SanitizerAPI.__proto__ || Object.getPrototypeOf(SanitizerAPI)).call(this, { config: config })); + } + /** + * Available methods + * @return {ISanitizerAPI} + */ + + + _createClass(SanitizerAPI, [{ + key: "clean", + value: function clean(taintString, config) { + return this.Editor.Sanitizer.clean(taintString, config); + } + }, { + key: "methods", + get: function get() { + var _this2 = this; + + return { + clean: function clean(taintString, config) { + return _this2.clean(taintString, config); + } + }; + } + }]); + + return SanitizerAPI; +}(Module); + +SanitizerAPI.displayName = "SanitizerAPI"; +exports.default = SanitizerAPI; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/api-saver.ts": +/*!*********************************************!*\ + !*** ./src/components/modules/api-saver.ts ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @class SaverAPI + * provides with methods to save data + */ +var SaverAPI = function (_Module) { + _inherits(SaverAPI, _Module); + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + function SaverAPI(_ref) { + var config = _ref.config; + + _classCallCheck(this, SaverAPI); + + return _possibleConstructorReturn(this, (SaverAPI.__proto__ || Object.getPrototypeOf(SaverAPI)).call(this, { config: config })); + } + /** + * Available methods + * @return {ISaverAPI} + */ + + + _createClass(SaverAPI, [{ + key: "save", + + /** + * Return Editor's data + */ + value: function save() { + return this.Editor.Saver.save(); + } + }, { + key: "methods", + get: function get() { + var _this2 = this; + + return { + save: function save() { + return _this2.save(); + } + }; + } + }]); + + return SaverAPI; +}(Module); + +SaverAPI.displayName = "SaverAPI"; +exports.default = SaverAPI; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/api-selection.ts": +/*!*************************************************!*\ + !*** ./src/components/modules/api-selection.ts ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _selection = __webpack_require__(/*! ../selection */ "./src/components/selection.js"); + +var _selection2 = _interopRequireDefault(_selection); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @class API + * Provides with methods working with Selection + */ +var SelectionAPI = function (_Module) { + _inherits(SelectionAPI, _Module); + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + function SelectionAPI(_ref) { + var config = _ref.config; + + _classCallCheck(this, SelectionAPI); + + return _possibleConstructorReturn(this, (SelectionAPI.__proto__ || Object.getPrototypeOf(SelectionAPI)).call(this, { config: config })); + } + /** + * Available methods + * @return {ISelectionAPI} + */ + + + _createClass(SelectionAPI, [{ + key: 'findParentTag', + + /** + * Looks ahead from selection and find passed tag with class name + * @param {string} tagName - tag to find + * @param {string} className - tag's class name + * @return {HTMLElement|null} + */ + value: function findParentTag(tagName, className) { + return new _selection2.default().findParentTag(tagName, className); + } + /** + * Expand selection to passed tag + * @param {HTMLElement} node - tag that should contain selection + */ + + }, { + key: 'expandToTag', + value: function expandToTag(node) { + new _selection2.default().expandToTag(node); + } + }, { + key: 'methods', + get: function get() { + var _this2 = this; + + return { + findParentTag: function findParentTag(tagName, className) { + return _this2.findParentTag(tagName, className); + }, + expandToTag: function expandToTag(node) { + return _this2.expandToTag(node); + } + }; + } + }]); + + return SelectionAPI; +}(Module); + +SelectionAPI.displayName = 'SelectionAPI'; +exports.default = SelectionAPI; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/api-toolbar.ts": +/*!***********************************************!*\ + !*** ./src/components/modules/api-toolbar.ts ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @class ToolbarsAPI + * provides with methods working with Toolbar + */ +var ToolbarAPI = function (_Module) { + _inherits(ToolbarAPI, _Module); + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + function ToolbarAPI(_ref) { + var config = _ref.config; + + _classCallCheck(this, ToolbarAPI); + + return _possibleConstructorReturn(this, (ToolbarAPI.__proto__ || Object.getPrototypeOf(ToolbarAPI)).call(this, { config: config })); + } + /** + * Available methods + * @return {IToolbarAPI} + */ + + + _createClass(ToolbarAPI, [{ + key: "open", + + /** + * Open toolbar + */ + value: function open() { + this.Editor.Toolbar.open(); + } + /** + * Close toolbar and all included elements + */ + + }, { + key: "close", + value: function close() { + this.Editor.Toolbar.close(); + } + }, { + key: "methods", + get: function get() { + var _this2 = this; + + return { + close: function close() { + return _this2.close(); + }, + open: function open() { + return _this2.open(); + } + }; + } + }]); + + return ToolbarAPI; +}(Module); + +ToolbarAPI.displayName = "ToolbarAPI"; +exports.default = ToolbarAPI; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/api.ts": +/*!***************************************!*\ + !*** ./src/components/modules/api.ts ***! + \***************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @class API + */ +var API = function (_Module) { + _inherits(API, _Module); + + /** + * Save Editor config. API provides passed configuration to the Blocks + * @param {EditorConfig} config + */ + function API(_ref) { + var config = _ref.config; + + _classCallCheck(this, API); + + return _possibleConstructorReturn(this, (API.__proto__ || Object.getPrototypeOf(API)).call(this, { config: config })); + } + + _createClass(API, [{ + key: "methods", + get: function get() { + return { + blocks: this.Editor.BlocksAPI.methods, + caret: {}, + events: this.Editor.EventsAPI.methods, + listener: this.Editor.ListenerAPI.methods, + sanitizer: this.Editor.SanitizerAPI.methods, + saver: this.Editor.SaverAPI.methods, + selection: this.Editor.SelectionAPI.methods, + toolbar: this.Editor.ToolbarAPI.methods + }; + } + }]); + + return API; +}(Module); + +API.displayName = "API"; +exports.default = API; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/block-events.ts": +/*!************************************************!*\ + !*** ./src/components/modules/block-events.ts ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var BlockEvents = function (_Module) { + _inherits(BlockEvents, _Module); + + /** + * @constructor + */ + function BlockEvents(_ref) { + var config = _ref.config; + + _classCallCheck(this, BlockEvents); + + return _possibleConstructorReturn(this, (BlockEvents.__proto__ || Object.getPrototypeOf(BlockEvents)).call(this, { config: config })); + } + /** + * All keydowns on Block + * @param {KeyboardEvent} event - keydown + */ + + + _createClass(BlockEvents, [{ + key: "keydown", + value: function keydown(event) { + /** + * Run common method for all keydown events + */ + this.beforeKeydownProcessing(); + /** + * Fire keydown processor by event.keyCode + */ + switch (event.keyCode) { + case _.keyCodes.BACKSPACE: + this.backspace(event); + break; + case _.keyCodes.ENTER: + this.enter(event); + break; + case _.keyCodes.DOWN: + case _.keyCodes.RIGHT: + this.arrowRightAndDown(); + break; + case _.keyCodes.UP: + case _.keyCodes.LEFT: + this.arrowLeftAndUp(); + break; + default: + this.defaultHandler(); + break; + } + } + /** + * Fires on keydown before event processing + */ + + }, { + key: "beforeKeydownProcessing", + value: function beforeKeydownProcessing() { + /** + * Clear all highlightings + */ + this.Editor.BlockManager.clearHighlightings(); + /** + * Hide Toolbar + */ + this.Editor.Toolbar.close(); + } + /** + * Key up on Block: + * - shows Inline Toolbar if something selected + */ + + }, { + key: "keyup", + value: function keyup(event) { + this.Editor.InlineToolbar.handleShowingEvent(event); + } + /** + * Mouse up on Block: + * - shows Inline Toolbar if something selected + */ + + }, { + key: "mouseUp", + value: function mouseUp(event) { + this.Editor.InlineToolbar.handleShowingEvent(event); + } + /** + * ENTER pressed on block + * @param {KeyboardEvent} event - keydown + */ + + }, { + key: "enter", + value: function enter(event) { + var currentBlock = this.Editor.BlockManager.currentBlock, + toolsConfig = this.config.toolsConfig[currentBlock.name]; + /** + * Don't handle Enter keydowns when Tool sets enableLineBreaks to true. + * Uses for Tools like where line breaks should be handled by default behaviour. + */ + if (toolsConfig && toolsConfig[this.Editor.Tools.apiSettings.IS_ENABLED_LINE_BREAKS]) { + return; + } + /** + * Allow to create linebreaks by Shift+Enter + */ + if (event.shiftKey) { + return; + } + /** + * Split the Current Block into two blocks + */ + this.Editor.BlockManager.split(); + /** + * Renew local current node after split + */ + var newCurrent = this.Editor.BlockManager.currentBlock; + this.Editor.Toolbar.move(); + /** + * If new Block is empty + */ + if (this.Editor.Tools.isInitial(newCurrent.tool) && newCurrent.isEmpty) { + /** + * Show Toolbar + */ + this.Editor.Toolbar.open(); + /** + * Show Plus Button + */ + this.Editor.Toolbar.plusButton.show(); + } + event.preventDefault(); + } + /** + * Handle backspace keydown on Block + * @param {KeyboardEvent} event - keydown + */ + + }, { + key: "backspace", + value: function backspace(event) { + var _this2 = this; + + var BM = this.Editor.BlockManager; + var isFirstBlock = BM.currentBlockIndex === 0, + canMergeBlocks = this.Editor.Caret.isAtStart && !isFirstBlock; + /** If current Block is empty just remove this Block */ + if (this.Editor.BlockManager.currentBlock.isEmpty) { + this.Editor.BlockManager.removeBlock(); + if (this.Editor.Caret.navigatePrevious(true)) { + this.Editor.Toolbar.close(); + } + return; + } + if (!canMergeBlocks) { + return; + } + // preventing browser default behaviour + event.preventDefault(); + var targetBlock = BM.getBlockByIndex(BM.currentBlockIndex - 1), + blockToMerge = BM.currentBlock; + /** + * Blocks that can be merged: + * 1) with the same Name + * 2) Tool has 'merge' method + * + * other case will handle as usual ARROW LEFT behaviour + */ + if (blockToMerge.name !== targetBlock.name || !targetBlock.mergeable) { + if (this.Editor.Caret.navigatePrevious()) { + this.Editor.Toolbar.close(); + } + return; + } + this.Editor.Caret.createShadow(targetBlock.pluginsContent); + BM.mergeBlocks(targetBlock, blockToMerge).then(function () { + /** Restore caret position after merge */ + _this2.Editor.Caret.restoreCaret(targetBlock.pluginsContent); + targetBlock.pluginsContent.normalize(); + _this2.Editor.Toolbar.close(); + }); + } + /** + * Handle right and down keyboard keys + */ + + }, { + key: "arrowRightAndDown", + value: function arrowRightAndDown() { + this.Editor.Caret.navigateNext(); + } + /** + * Handle left and up keyboard keys + */ + + }, { + key: "arrowLeftAndUp", + value: function arrowLeftAndUp() { + this.Editor.Caret.navigatePrevious(); + } + /** + * Default keydown handler + */ + + }, { + key: "defaultHandler", + value: function defaultHandler() {} + }]); + + return BlockEvents; +}(Module); + +BlockEvents.displayName = "BlockEvents"; +exports.default = BlockEvents; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/blockManager.js": +/*!************************************************!*\ + !*** ./src/components/modules/blockManager.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, $, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _block = __webpack_require__(/*! ../block */ "./src/components/block.js"); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @class BlockManager + * @classdesc Manage editor`s blocks storage and appearance + * + * @module BlockManager + * + * @version 2.0.0 + */ + +/** + * @typedef {BlockManager} BlockManager + * @property {Number} currentBlockIndex - Index of current working block + * @property {Proxy} _blocks - Proxy for Blocks instance {@link Blocks} + */ +var BlockManager = function (_Module) { + _inherits(BlockManager, _Module); + + /** + * @constructor + * @param {EditorConfig} config + */ + function BlockManager(_ref) { + var config = _ref.config; + + _classCallCheck(this, BlockManager); + + /** + * Proxy for Blocks instance {@link Blocks} + * + * @type {Proxy} + * @private + */ + var _this = _possibleConstructorReturn(this, (BlockManager.__proto__ || Object.getPrototypeOf(BlockManager)).call(this, { config: config })); + + _this._blocks = null; + + /** + * Index of current working block + * + * @type {number} + * @private + */ + _this.currentBlockIndex = -1; + return _this; + } + + /** + * Should be called after Editor.UI preparation + * Define this._blocks property + * + * @returns {Promise} + */ + + + _createClass(BlockManager, [{ + key: 'prepare', + value: function prepare() { + var _this2 = this; + + return new Promise(function (resolve) { + var blocks = new Blocks(_this2.Editor.UI.nodes.redactor); + + /** + * We need to use Proxy to overload set/get [] operator. + * So we can use array-like syntax to access blocks + * + * @example + * this._blocks[0] = new Block(...); + * + * block = this._blocks[0]; + * + * @todo proxy the enumerate method + * + * @type {Proxy} + * @private + */ + _this2._blocks = new Proxy(blocks, { + set: Blocks.set, + get: Blocks.get + }); + + resolve(); + }); + } + + /** + * Creates Block instance by tool name + * + * @param {String} toolName - tools passed in editor config {@link EditorConfig#tools} + * @param {Object} data - constructor params + * @param {Object} settings - block settings + * + * @return {Block} + */ + + }, { + key: 'composeBlock', + value: function composeBlock(toolName, data, settings) { + var toolInstance = this.Editor.Tools.construct(toolName, data), + block = new _block2.default(toolName, toolInstance, settings, this.Editor.API.methods); + + this.bindEvents(block); + /** + * Apply callback before inserting html + */ + block.call('appendCallback', {}); + + return block; + } + + /** + * Bind Events + * @param {Object} block + */ + + }, { + key: 'bindEvents', + value: function bindEvents(block) { + var _this3 = this; + + this.Editor.Listeners.on(block.holder, 'keydown', function (event) { + return _this3.Editor.BlockEvents.keydown(event); + }); + this.Editor.Listeners.on(block.holder, 'mouseup', function (event) { + return _this3.Editor.BlockEvents.mouseUp(event); + }); + this.Editor.Listeners.on(block.holder, 'keyup', function (event) { + return _this3.Editor.BlockEvents.keyup(event); + }); + } + + /** + * Insert new block into _blocks + * + * @param {String} toolName — plugin name, by default method inserts initial block type + * @param {Object} data — plugin data + * @param {Object} settings - default settings + * + * @return {Block} + */ + + }, { + key: 'insert', + value: function insert() { + var toolName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.config.initialBlock; + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var settings = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var block = this.composeBlock(toolName, data, settings); + + this._blocks[++this.currentBlockIndex] = block; + this.Editor.Caret.setToBlock(block); + + return block; + } + + /** + * Always inserts at the end + */ + + }, { + key: 'insertAtEnd', + value: function insertAtEnd() { + /** + * Define new value for current block index + */ + this.currentBlockIndex = this.blocks.length - 1; + + /** + * Insert initial typed block + */ + this.insert(); + } + + /** + * Merge two blocks + * @param {Block} targetBlock - previous block will be append to this block + * @param {Block} blockToMerge - block that will be merged with target block + * + * @return {Promise} - the sequence that can be continued + */ + + }, { + key: 'mergeBlocks', + value: function mergeBlocks(targetBlock, blockToMerge) { + var _this4 = this; + + var blockToMergeIndex = this._blocks.indexOf(blockToMerge); + + return Promise.resolve().then(function () { + if (blockToMerge.isEmpty) { + return; + } + + return blockToMerge.data.then(function (blockToMergeInfo) { + targetBlock.mergeWith(blockToMergeInfo.data); + }); + }).then(function () { + _this4.removeBlock(blockToMergeIndex); + _this4.currentBlockIndex = _this4._blocks.indexOf(targetBlock); + }); + } + + /** + * Remove block with passed index or remove last + * @param {Number|null} index + */ + + }, { + key: 'removeBlock', + value: function removeBlock(index) { + if (!index) { + index = this.currentBlockIndex; + } + this._blocks.remove(index); + } + + /** + * Split current Block + * 1. Extract content from Caret position to the Block`s end + * 2. Insert a new Block below current one with extracted content + */ + + }, { + key: 'split', + value: function split() { + var extractedFragment = this.Editor.Caret.extractFragmentFromCaretPosition(), + wrapper = $.make('div'); + + wrapper.append(extractedFragment); + + /** + * @todo make object in accordance with Tool + */ + var data = { + text: $.isEmpty(wrapper) ? '' : wrapper.innerHTML + }; + + /** + * Renew current Block + * @type {Block} + */ + var blockInserted = this.insert(this.config.initialBlock, data); + + this.currentNode = blockInserted.pluginsContent; + } + + /** + * Replace current working block + * + * @param {String} toolName — plugin name + * @param {Object} data — plugin data + */ + + }, { + key: 'replace', + value: function replace(toolName) { + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var block = this.composeBlock(toolName, data); + + this._blocks.insert(this.currentBlockIndex, block, true); + } + + /** + * returns last Block + * @return {Block} + */ + + }, { + key: 'getBlockByIndex', + + + /** + * Returns Block by passed index + * @param {Number} index + * @return {Block} + */ + value: function getBlockByIndex(index) { + return this._blocks[index]; + } + + /** + * Get Block instance by html element + * @param {Node} element + * @returns {Block} + */ + + }, { + key: 'getBlock', + value: function getBlock(element) { + if (!$.isElement(element)) { + element = element.parentNode; + } + + var nodes = this._blocks.nodes, + firstLevelBlock = element.closest('.' + _block2.default.CSS.wrapper), + index = nodes.indexOf(firstLevelBlock); + + if (index >= 0) { + return this._blocks[index]; + } + } + + /** + * Get current Block instance + * + * @return {Block} + */ + + }, { + key: 'highlightCurrentNode', + + + /** + * Remove selection from all Blocks then highlight only Current Block + */ + value: function highlightCurrentNode() { + /** + * Remove previous selected Block's state + */ + this.clearHighlightings(); + + /** + * Mark current Block as selected + * @type {boolean} + */ + this.currentBlock.selected = true; + } + + /** + * Remove selection from all Blocks + */ + + }, { + key: 'clearHighlightings', + value: function clearHighlightings() { + this.blocks.forEach(function (block) { + return block.selected = false; + }); + } + + /** + * Get array of Block instances + * + * @returns {Block[]} {@link Blocks#array} + */ + + }, { + key: 'setCurrentBlockByChildNode', + + + /** + * 1) Find first-level Block from passed child Node + * 2) Mark it as current + * + * @param {Element|Text} childNode - look ahead from this node. + * @throws Error - when passed Node is not included at the Block + */ + value: function setCurrentBlockByChildNode(childNode) { + /** + * If node is Text TextNode + */ + if (!$.isElement(childNode)) { + childNode = childNode.parentNode; + } + + var parentFirstLevelBlock = childNode.closest('.' + _block2.default.CSS.wrapper); + + if (parentFirstLevelBlock) { + this.currentNode = parentFirstLevelBlock; + } else { + throw new Error('Can not find a Block from this child Node'); + } + } + + /** + * Swap Blocks Position + * @param {Number} fromIndex + * @param {Number} toIndex + */ + + }, { + key: 'swap', + value: function swap(fromIndex, toIndex) { + /** Move up current Block */ + this._blocks.swap(fromIndex, toIndex); + + /** Now actual block moved up so that current block index decreased */ + this.currentBlockIndex = toIndex; + } + + /** + * Sets current Block Index -1 which means unknown + * and clear highlightings + */ + + }, { + key: 'dropPointer', + value: function dropPointer() { + this.currentBlockIndex = -1; + this.clearHighlightings(); + } + + /** + * Clears Editor + * @param {boolean} needAddInitialBlock - 1) in internal calls (for example, in api.blocks.render) + * we don't need to add empty initial block + * 2) in api.blocks.clear we should add empty block + */ + + }, { + key: 'clear', + value: function clear() { + var needAddInitialBlock = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + this._blocks.removeAll(); + this.dropPointer(); + + if (needAddInitialBlock) { + this.insert(this.config.initialBlock); + } + } + }, { + key: 'lastBlock', + get: function get() { + return this._blocks[this._blocks.length - 1]; + } + }, { + key: 'currentBlock', + get: function get() { + return this._blocks[this.currentBlockIndex]; + } + + /** + * Returns next Block instance + * @return {Block|null} + */ + + }, { + key: 'nextBlock', + get: function get() { + var isLastBlock = this.currentBlockIndex === this._blocks.length - 1; + + if (isLastBlock) { + return null; + } + + return this._blocks[this.currentBlockIndex + 1]; + } + + /** + * Returns previous Block instance + * @return {Block|null} + */ + + }, { + key: 'previousBlock', + get: function get() { + var isFirstBlock = this.currentBlockIndex === 0; + + if (isFirstBlock) { + return null; + } + + return this._blocks[this.currentBlockIndex - 1]; + } + + /** + * Get working html element + * + * @return {HTMLElement} + */ + + }, { + key: 'currentNode', + get: function get() { + return this._blocks.nodes[this.currentBlockIndex]; + } + + /** + * Set currentBlockIndex to passed block + * @param {Node} element + */ + , + set: function set(element) { + if (!$.isElement(element)) { + element = element.parentNode; + } + + var nodes = this._blocks.nodes, + firstLevelBlock = element.closest('.' + _block2.default.CSS.wrapper); + + if (!firstLevelBlock) { + throw Error('Passed element is not a Block.'); + } + + /** + * Update current Block's index + * @type {number} + */ + this.currentBlockIndex = nodes.indexOf(firstLevelBlock); + } + }, { + key: 'blocks', + get: function get() { + return this._blocks.array; + } + }]); + + return BlockManager; +}(Module); + +BlockManager.displayName = 'BlockManager'; +exports.default = BlockManager; +; + +/** + * @class Blocks + * @classdesc Class to work with Block instances array + * + * @private + * + * @property {HTMLElement} workingArea — editor`s working node + * + */ + +var Blocks = function () { + /** + * @constructor + * + * @param {HTMLElement} workingArea — editor`s working node + */ + function Blocks(workingArea) { + _classCallCheck(this, Blocks); + + this.blocks = []; + this.workingArea = workingArea; + } + + /** + * Push back new Block + * + * @param {Block} block + */ + + + _createClass(Blocks, [{ + key: 'push', + value: function push(block) { + this.blocks.push(block); + this.workingArea.appendChild(block.holder); + } + + /** + * Swaps blocks with indexes first and second + * @param {Number} first - first block index + * @param {Number} second - second block index + */ + + }, { + key: 'swap', + value: function swap(first, second) { + var secondBlock = this.blocks[second]; + + /** + * Change in DOM + */ + $.swap(this.blocks[first].holder, secondBlock.holder); + + /** + * Change in array + */ + this.blocks[second] = this.blocks[first]; + this.blocks[first] = secondBlock; + } + + /** + * Insert new Block at passed index + * + * @param {Number} index — index to insert Block + * @param {Block} block — Block to insert + * @param {Boolean} replace — it true, replace block on given index + */ + + }, { + key: 'insert', + value: function insert(index, block) { + var replace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (!this.length) { + this.push(block); + return; + } + + if (index > this.length) { + index = this.length; + } + + if (replace) { + this.blocks[index].holder.remove(); + } + + var deleteCount = replace ? 1 : 0; + + this.blocks.splice(index, deleteCount, block); + + if (index > 0) { + var previousBlock = this.blocks[index - 1]; + + previousBlock.holder.insertAdjacentElement('afterend', block.holder); + } else { + var nextBlock = this.blocks[index + 1]; + + if (nextBlock) { + nextBlock.holder.insertAdjacentElement('beforebegin', block.holder); + } else { + this.workingArea.appendChild(block.holder); + } + } + } + + /** + * Remove block + * @param {Number|null} index + */ + + }, { + key: 'remove', + value: function remove(index) { + if (isNaN(index)) { + index = this.length - 1; + } + + this.blocks[index].holder.remove(); + this.blocks.splice(index, 1); + } + + /** + * Remove all blocks + */ + + }, { + key: 'removeAll', + value: function removeAll() { + this.workingArea.innerHTML = ''; + this.blocks.length = 0; + } + + /** + * Insert Block after passed target + * + * @todo decide if this method is necessary + * + * @param {Block} targetBlock — target after wich Block should be inserted + * @param {Block} newBlock — Block to insert + */ + + }, { + key: 'insertAfter', + value: function insertAfter(targetBlock, newBlock) { + var index = this.blocks.indexOf(targetBlock); + + this.insert(index + 1, newBlock); + } + + /** + * Get Block by index + * + * @param {Number} index — Block index + * @returns {Block} + */ + + }, { + key: 'get', + value: function get(index) { + return this.blocks[index]; + } + + /** + * Return index of passed Block + * + * @param {Block} block + * @returns {Number} + */ + + }, { + key: 'indexOf', + value: function indexOf(block) { + return this.blocks.indexOf(block); + } + + /** + * Get length of Block instances array + * + * @returns {Number} + */ + + }, { + key: 'length', + get: function get() { + return this.blocks.length; + } + + /** + * Get Block instances array + * + * @returns {Block[]} + */ + + }, { + key: 'array', + get: function get() { + return this.blocks; + } + + /** + * Get blocks html elements array + * + * @returns {HTMLElement[]} + */ + + }, { + key: 'nodes', + get: function get() { + return _.array(this.workingArea.children); + } + + /** + * Proxy trap to implement array-like setter + * + * @example + * blocks[0] = new Block(...) + * + * @param {Blocks} instance — Blocks instance + * @param {Number|String} index — block index + * @param {Block} block — Block to set + * @returns {Boolean} + */ + + }], [{ + key: 'set', + value: function set(instance, index, block) { + if (isNaN(Number(index))) { + return false; + } + + instance.insert(index, block); + + return true; + } + + /** + * Proxy trap to implement array-like getter + * + * @param {Blocks} instance — Blocks instance + * @param {Number|String} index — Block index + * @returns {Block|*} + */ + + }, { + key: 'get', + value: function get(instance, index) { + if (isNaN(Number(index))) { + return instance[index]; + } + + return instance.get(index); + } + }]); + + return Blocks; +}(); + +Blocks.displayName = 'Blocks'; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/caret.js": +/*!*****************************************!*\ + !*** ./src/components/modules/caret.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, $, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _selection = __webpack_require__(/*! ../selection */ "./src/components/selection.js"); + +var _selection2 = _interopRequireDefault(_selection); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * @class Caret + * @classdesc Contains methods for working Caret + * + * Uses Range methods to manipulate with caret + * + * @module Caret + * + * @version 2.0.0 + */ + +/** + * @typedef {Caret} Caret + */ +var Caret = function (_Module) { + _inherits(Caret, _Module); + + /** + * @constructor + */ + function Caret(_ref) { + var config = _ref.config; + + _classCallCheck(this, Caret); + + return _possibleConstructorReturn(this, (Caret.__proto__ || Object.getPrototypeOf(Caret)).call(this, { config: config })); + } + + /** + * Elements styles that can be useful for Caret Module + */ + + + _createClass(Caret, [{ + key: 'setToBlock', + + + /** + * Method gets Block instance and puts caret to the text node with offset + * There two ways that method applies caret position: + * - first found text node: sets at the beginning, but you can pass an offset + * - last found text node: sets at the end of the node. Also, you can customize the behaviour + * + * @param {Block} block - Block class + * @param {Number} offset - caret offset regarding to the text node + * @param {Boolean} atEnd - put caret at the end of the text node or not + */ + value: function setToBlock(block) { + var _this2 = this; + + var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var atEnd = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + var element = block.pluginsContent; + + /** If Element is INPUT */ + if ($.isNativeInput(element)) { + element.focus(); + return; + } + + var nodeToSet = $.getDeepestNode(element, atEnd); + + if (atEnd || offset > nodeToSet.length) { + offset = nodeToSet.length; + } + + /** if found deepest node is native input */ + if ($.isNativeInput(nodeToSet)) { + nodeToSet.focus(); + return; + } + + /** + * @todo try to fix via Promises or use querySelectorAll to not to use timeout + */ + _.delay(function () { + _this2.set(nodeToSet, offset); + }, 20)(); + + this.Editor.BlockManager.currentNode = block.holder; + } + + /** + * Creates Document Range and sets caret to the element with offset + * @param {Element} element - target node. + * @param {Number} offset - offset + */ + + }, { + key: 'set', + value: function set(element) { + var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var range = document.createRange(), + selection = _selection2.default.get(); + + range.setStart(element, offset); + range.setEnd(element, offset); + + selection.removeAllRanges(); + selection.addRange(range); + } + }, { + key: 'setToTheLastBlock', + + + /** + * Set Caret to the last Block + * If last block is not empty, append another empty block + */ + value: function setToTheLastBlock() { + var lastBlock = this.Editor.BlockManager.lastBlock; + + if (!lastBlock) return; + + /** + * If last block is empty and it is an initialBlock, set to that. + * Otherwise, append new empty block and set to that + */ + if (lastBlock.isEmpty) { + this.setToBlock(lastBlock); + } else { + this.Editor.BlockManager.insertAtEnd(); + } + } + + /** + * Extract content fragment of current Block from Caret position to the end of the Block + */ + + }, { + key: 'extractFragmentFromCaretPosition', + value: function extractFragmentFromCaretPosition() { + var selection = _selection2.default.get(); + + if (selection.rangeCount) { + var selectRange = selection.getRangeAt(0), + blockElem = this.Editor.BlockManager.currentBlock.pluginsContent; + + selectRange.deleteContents(); + + if (blockElem) { + var range = selectRange.cloneRange(true); + + range.selectNodeContents(blockElem); + range.setStart(selectRange.endContainer, selectRange.endOffset); + return range.extractContents(); + } + } + } + + /** + * Get all first-level (first child of [contenteditabel]) siblings from passed node + * Then you can check it for emptiness + * + * @example + *
    + * + * @return {Element[]} + */ + + }, { + key: 'getHigherLevelSiblings', + value: function getHigherLevelSiblings(from, direction) { + var current = from, + siblings = []; + + /** + * Find passed node's firs-level parent (in example - blockquote) + */ + while (current.parentNode && current.parentNode.contentEditable !== 'true') { + current = current.parentNode; + } + + var sibling = direction === 'left' ? 'previousSibling' : 'nextSibling'; + + /** + * Find all left/right siblings + */ + while (current[sibling]) { + current = current[sibling]; + siblings.push(current); + } + + return siblings; + } + + /** + * Set's caret to the next Block + * Before moving caret, we should check if caret position is at the end of Plugins node + * Using {@link Dom#getDeepestNode} to get a last node and match with current selection + * + * @param {Boolean} force - force navigation even if caret is not at the end + * + * @return {Boolean} + */ + + }, { + key: 'navigateNext', + value: function navigateNext() { + var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + var nextBlock = this.Editor.BlockManager.nextBlock; + + if (!nextBlock) { + return false; + } + + if (force || this.isAtEnd) { + this.setToBlock(nextBlock); + return true; + } + + return false; + } + + /** + * Set's caret to the previous Block + * Before moving caret, we should check if caret position is start of the Plugins node + * Using {@link Dom#getDeepestNode} to get a last node and match with current selection + * + * @param {Boolean} force - force navigation even if caret is not at the start + * + * @return {Boolean} + */ + + }, { + key: 'navigatePrevious', + value: function navigatePrevious() { + var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + var previousBlock = this.Editor.BlockManager.previousBlock; + + if (!previousBlock) { + return false; + } + + if (force || this.isAtStart) { + this.setToBlock(previousBlock, 0, true); + return true; + } + + return false; + } + + /** + * Get's deepest first node and checks if offset is zero + * @return {boolean} + */ + + }, { + key: 'createShadow', + + + /** + * Inserts shadow element after passed element where caret can be placed + * @param {Node} element + */ + value: function createShadow(element) { + var shadowCaret = document.createElement('span'); + + shadowCaret.classList.add(Caret.CSS.shadowCaret); + element.insertAdjacentElement('beforeEnd', shadowCaret); + } + + /** + * Restores caret position + * @param {Node} element + */ + + }, { + key: 'restoreCaret', + value: function restoreCaret(element) { + var shadowCaret = element.querySelector('.' + Caret.CSS.shadowCaret); + + if (!shadowCaret) { + return; + } + + /** + * After we set the caret to the required place + * we need to clear shadow caret + * + * - make new range + * - select shadowed span + * - use extractContent to remove it from DOM + */ + var sel = new _selection2.default(); + + sel.expandToTag(shadowCaret); + + setTimeout(function () { + var newRange = document.createRange(); + + newRange.selectNode(shadowCaret); + newRange.extractContents(); + }, 50); + } + }, { + key: 'isAtStart', + get: function get() { + /** + * Don't handle ranges + */ + if (!_selection2.default.isCollapsed) { + return false; + } + + var selection = _selection2.default.get(), + anchorNode = selection.anchorNode, + firstNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent); + + /** + * Workaround case when caret in the text like " |Hello!" + * selection.anchorOffset is 1, but real caret visible position is 0 + * @type {number} + */ + var firstLetterPosition = anchorNode.textContent.search(/\S/); + + if (firstLetterPosition === -1) { + // empty text + firstLetterPosition = 0; + } + + /** + * In case of + *
    + *

    <-- first (and deepest) node is + * |adaddad <-- anchor node + *
    + */ + if ($.isEmpty(firstNode)) { + var leftSiblings = this.getHigherLevelSiblings(anchorNode, 'left'), + nothingAtLeft = leftSiblings.every(function (node) { + return $.isEmpty(node); + }); + + if (nothingAtLeft && selection.anchorOffset === firstLetterPosition) { + return true; + } + } + + /** + * We use <= comparison for case: + * "| Hello" <--- selection.anchorOffset is 0, but firstLetterPosition is 1 + */ + return firstNode === null || anchorNode === firstNode && selection.anchorOffset <= firstLetterPosition; + } + + /** + * Get's deepest last node and checks if offset is last node text length + * @return {boolean} + */ + + }, { + key: 'isAtEnd', + get: function get() { + /** + * Don't handle ranges + */ + if (!_selection2.default.isCollapsed) { + return false; + } + + var selection = _selection2.default.get(), + anchorNode = selection.anchorNode, + lastNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent, true); + + /** + * In case of + *
    + * adaddad| <-- anchor node + *

    <-- first (and deepest) node is + *
    + */ + if ($.isEmpty(lastNode)) { + var leftSiblings = this.getHigherLevelSiblings(anchorNode, 'right'), + nothingAtRight = leftSiblings.every(function (node) { + return $.isEmpty(node); + }); + + if (nothingAtRight && selection.anchorOffset === anchorNode.textContent.length) { + return true; + } + } + + /** + * Workaround case: + * hello | <--- anchorOffset will be 5, but textContent.length will be 6. + * Why not regular .trim(): + * in case of ' hello |' trim() will also remove space at the beginning, so length will be lower than anchorOffset + */ + var rightTrimmedText = lastNode.textContent.replace(/\s+$/, ''); + + /** + * We use >= comparison for case: + * "Hello |" <--- selection.anchorOffset is 7, but rightTrimmedText is 6 + */ + return anchorNode === lastNode && selection.anchorOffset >= rightTrimmedText.length; + } + }], [{ + key: 'CSS', + get: function get() { + return { + shadowCaret: 'cdx-shadow-caret' + }; + } + }]); + + return Caret; +}(Module); + +Caret.displayName = 'Caret'; +exports.default = Caret; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/events.js": +/*!******************************************!*\ + !*** ./src/components/modules/events.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @module eventDispatcher + * + * Has two important methods: + * - {Function} on - appends subscriber to the event. If event doesn't exist - creates new one + * - {Function} emit - fires all subscribers with data + * - {Function off - unsubsribes callback + * + * @version 1.0.0 + * + * @typedef {Events} Events + * @property {Object} subscribers - all subscribers grouped by event name + */ +var Events = function (_Module) { + _inherits(Events, _Module); + + /** + * @constructor + */ + function Events(_ref) { + var config = _ref.config; + + _classCallCheck(this, Events); + + var _this = _possibleConstructorReturn(this, (Events.__proto__ || Object.getPrototypeOf(Events)).call(this, { config: config })); + + _this.subscribers = {}; + return _this; + } + + /** + * Subscribe any event on callback + * + * @param {String} eventName - event name + * @param {Function} callback - subscriber + */ + + + _createClass(Events, [{ + key: "on", + value: function on(eventName, callback) { + if (!(eventName in this.subscribers)) { + this.subscribers[eventName] = []; + } + + // group by events + this.subscribers[eventName].push(callback); + } + + /** + * Emit callbacks with passed data + * + * @param {String} eventName - event name + * @param {Object} data - subscribers get this data when they were fired + */ + + }, { + key: "emit", + value: function emit(eventName, data) { + if (!this.subscribers[eventName]) { + return; + } + + this.subscribers[eventName].reduce(function (previousData, currentHandler) { + var newData = currentHandler(previousData); + + return newData ? newData : previousData; + }, data); + } + + /** + * Unsubsribe callback from event + * + * @param eventName + * @param callback + */ + + }, { + key: "off", + value: function off(eventName, callback) { + for (var i = 0; i < this.subscribers[eventName].length; i++) { + if (this.subscribers[eventName][i] === callback) { + delete this.subscribers[eventName][i]; + break; + } + } + } + + /** + * Destroyer + * clears subsribers list + */ + + }, { + key: "destroy", + value: function destroy() { + this.subscribers = null; + } + }]); + + return Events; +}(Module); + +Events.displayName = "Events"; +exports.default = Events; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/listeners.js": +/*!*********************************************!*\ + !*** ./src/components/modules/listeners.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * Codex Editor Listeners module + * + * @module Listeners + * + * Module-decorator for event listeners assignment + * + * @author Codex Team + * @version 2.0.0 + */ + +/** + * @typedef {Listeners} Listeners + * @property {Array} allListeners + */ +var Listeners = function (_Module) { + _inherits(Listeners, _Module); + + /** + * @constructor + * @param {EditorConfig} config + */ + function Listeners(_ref) { + var config = _ref.config; + + _classCallCheck(this, Listeners); + + var _this = _possibleConstructorReturn(this, (Listeners.__proto__ || Object.getPrototypeOf(Listeners)).call(this, { config: config })); + + _this.allListeners = []; + return _this; + } + + /** + * Assigns event listener on element + * + * @param {Element} element - DOM element that needs to be listened + * @param {String} eventType - event type + * @param {Function} handler - method that will be fired on event + * @param {Boolean} useCapture - use event bubbling + */ + + + _createClass(Listeners, [{ + key: "on", + value: function on(element, eventType, handler) { + var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + + var assignedEventData = { + element: element, + eventType: eventType, + handler: handler, + useCapture: useCapture + }; + + var alreadyExist = this.findOne(element, eventType, handler); + + if (alreadyExist) return; + + this.allListeners.push(assignedEventData); + element.addEventListener(eventType, handler, useCapture); + } + + /** + * Removes event listener from element + * + * @param {Element} element - DOM element that we removing listener + * @param {String} eventType - event type + * @param {Function} handler - remove handler, if element listens several handlers on the same event type + * @param {Boolean} useCapture - use event bubbling + */ + + }, { + key: "off", + value: function off(element, eventType, handler) { + var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + + var existingListeners = this.findAll(element, eventType, handler); + + for (var i = 0; i < existingListeners.length; i++) { + var index = this.allListeners.indexOf(existingListeners[i]); + + if (index > 0) { + this.allListeners.splice(index, 1); + } + } + + element.removeEventListener(eventType, handler, useCapture); + } + + /** + * Search method: looks for listener by passed element + * @param {Element} element - searching element + * @returns {Array} listeners that found on element + */ + + }, { + key: "findByElement", + value: function findByElement(element) { + var listenersOnElement = []; + + for (var i = 0; i < this.allListeners.length; i++) { + var listener = this.allListeners[i]; + + if (listener.element === element) { + listenersOnElement.push(listener); + } + } + + return listenersOnElement; + } + + /** + * Search method: looks for listener by passed event type + * @param {String} eventType + * @return {Array} listeners that found on element + */ + + }, { + key: "findByType", + value: function findByType(eventType) { + var listenersWithType = []; + + for (var i = 0; i < this.allListeners.length; i++) { + var listener = this.allListeners[i]; + + if (listener.type === eventType) { + listenersWithType.push(listener); + } + } + + return listenersWithType; + } + + /** + * Search method: looks for listener by passed handler + * @param {Function} handler + * @return {Array} listeners that found on element + */ + + }, { + key: "findByHandler", + value: function findByHandler(handler) { + var listenersWithHandler = []; + + for (var i = 0; i < this.allListeners.length; i++) { + var listener = this.allListeners[i]; + + if (listener.handler === handler) { + listenersWithHandler.push(listener); + } + } + + return listenersWithHandler; + } + + /** + * @param {Element} element + * @param {String} eventType + * @param {Function} handler + * @return {Element|null} + */ + + }, { + key: "findOne", + value: function findOne(element, eventType, handler) { + var foundListeners = this.findAll(element, eventType, handler); + + return foundListeners.length > 0 ? foundListeners[0] : null; + } + + /** + * @param {Element} element + * @param {String} eventType + * @param {Function} handler + * @return {Array} + */ + + }, { + key: "findAll", + value: function findAll(element, eventType, handler) { + var found = void 0, + foundByElements = element ? this.findByElement(element) : []; + // foundByEventType = eventType ? this.findByType(eventType) : [], + // foundByHandler = handler ? this.findByHandler(handler) : []; + + if (element && eventType && handler) { + found = foundByElements.filter(function (event) { + return event.eventType === eventType && event.handler === handler; + }); + } else if (element && eventType) { + found = foundByElements.filter(function (event) { + return event.eventType === eventType; + }); + } else { + found = foundByElements; + } + + return found; + } + + /** + * Removes all listeners + */ + + }, { + key: "removeAll", + value: function removeAll() { + this.allListeners.map(function (current) { + current.element.removeEventListener(current.eventType, current.handler); + }); + + this.allListeners = []; + } + }]); + + return Listeners; +}(Module); + +Listeners.displayName = "Listeners"; +exports.default = Listeners; +module.exports = exports["default"]; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/paste.ts": +/*!*****************************************!*\ + !*** ./src/components/modules/paste.ts ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, _, $) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @class Paste + * @classdesc Contains methods to handle paste on editor + * + * @module Paste + * + * @version 2.0.0 + */ +var Paste = function (_Module) { + _inherits(Paste, _Module); + + /** + * @constructor + */ + function Paste(_ref) { + var _this2 = this; + + var config = _ref.config; + + _classCallCheck(this, Paste); + + /** + * Tags` substitutions parameters + */ + var _this = _possibleConstructorReturn(this, (Paste.__proto__ || Object.getPrototypeOf(Paste)).call(this, { config: config })); + + _this.toolsTags = {}; + /** Patterns` substitutions parameters */ + _this.toolsPatterns = []; + /** + * Process paste config for each tools + * + * @param {string} tool + */ + _this.processTool = function (_ref2) { + var _ref3 = _slicedToArray(_ref2, 2), + name = _ref3[0], + tool = _ref3[1]; + + var toolPasteConfig = tool.onPaste || {}; + if (!toolPasteConfig.handler) { + _.log('"' + name + '" Tool MUST provide paste handler.', 'warn'); + } + if (typeof toolPasteConfig.handler !== 'function') { + _.log('Paste handler for "' + name + '" Tool should be a function.', 'warn'); + } else { + var tags = toolPasteConfig.tags || []; + tags.forEach(function (tag) { + if (_this.toolsTags.hasOwnProperty(tag)) { + _.log('Paste handler for "' + name + '" Tool on "' + tag + '" tag is skipped ' + ('because it is already used by "' + _this.toolsTags[tag].tool + '" Tool.'), 'warn'); + return; + } + _this.toolsTags[tag] = { + handler: toolPasteConfig.handler, + tool: name + }; + }); + } + if (!toolPasteConfig.patternHandler || _.isEmpty(toolPasteConfig.patterns)) { + return; + } + if (typeof toolPasteConfig.patternHandler !== 'function') { + _.log('Pattern parser for "' + name + '" Tool should be a function.', 'warn'); + } else { + Object.entries(toolPasteConfig.patterns).forEach(function (_ref4) { + var _ref5 = _slicedToArray(_ref4, 2), + key = _ref5[0], + pattern = _ref5[1]; + + /** Still need to validate pattern as it provided by user */ + if (!(pattern instanceof RegExp)) { + _.log('Pattern ' + pattern + ' for "' + tool + '" Tool is skipped because it should be a Regexp instance.', 'warn'); + } + _this.toolsPatterns.push({ + key: key, + pattern: pattern, + handler: toolPasteConfig.patternHandler, + tool: name + }); + }); + } + }; + /** + * Get pasted data, process it and insert into editor + * + * @param {ClipboardEvent} event + */ + _this.processPastedData = function () { + var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(event) { + var _this$Editor, Tools, Sanitizer, BlockManager, Caret, toolsConfig, block, toolConfig, htmlData, plainData, blockTags, toolsTags, customConfig, cleanData, dataToInsert; + + return regeneratorRuntime.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _this$Editor = _this.Editor, Tools = _this$Editor.Tools, Sanitizer = _this$Editor.Sanitizer, BlockManager = _this$Editor.BlockManager, Caret = _this$Editor.Caret, toolsConfig = _this.config.toolsConfig; + /** If target is native input or is not Block, use browser behaviour */ + + if (!_this.isNativeBehaviour(event.target)) { + _context2.next = 3; + break; + } + + return _context2.abrupt('return'); + + case 3: + event.preventDefault(); + block = BlockManager.getBlock(event.target); + toolConfig = toolsConfig[block.name]; + /** If paste is dissalowed in block do nothing */ + + if (!(toolConfig && toolConfig[Tools.apiSettings.IS_PASTE_DISALLOWED])) { + _context2.next = 8; + break; + } + + return _context2.abrupt('return'); + + case 8: + htmlData = event.clipboardData.getData('text/html'), plainData = event.clipboardData.getData('text/plain'); + /** Add all block tags and tags can be substituted to sanitizer configuration */ + + blockTags = $.blockElements.reduce(function (result, tag) { + result[tag.toLowerCase()] = {}; + return result; + }, {}); + toolsTags = Object.keys(_this.toolsTags).reduce(function (result, tag) { + result[tag.toLowerCase()] = {}; + return result; + }, {}); + customConfig = { tags: Object.assign({}, blockTags, toolsTags, Sanitizer.defaultConfig.tags) }; + cleanData = Sanitizer.clean(htmlData, customConfig); + dataToInsert = []; + /** If there is no HTML or HTML string is equal to plain one, process it as plain text */ + + if (!cleanData.trim() || cleanData.trim() === plainData || !$.isHTMLString(cleanData)) { + dataToInsert = _this.processPlain(plainData); + } else { + dataToInsert = _this.processHTML(htmlData); + } + + if (!(dataToInsert.length === 1 && !dataToInsert[0].isBlock)) { + _context2.next = 18; + break; + } + + _this.processSingleBlock(dataToInsert.pop()); + return _context2.abrupt('return'); + + case 18: + _this.splitBlock(); + _context2.next = 21; + return Promise.all(dataToInsert.map(function () { + var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(data, i) { + return regeneratorRuntime.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _this.insertBlock(data, i === 0); + + case 2: + return _context.abrupt('return', _context.sent); + + case 3: + case 'end': + return _context.stop(); + } + } + }, _callee, _this2); + })); + + return function (_x2, _x3) { + return _ref7.apply(this, arguments); + }; + }())); + + case 21: + Caret.setToBlock(BlockManager.currentBlock, 0, true); + + case 22: + case 'end': + return _context2.stop(); + } + } + }, _callee2, _this2); + })); + + return function (_x) { + return _ref6.apply(this, arguments); + }; + }(); + return _this; + } + + _createClass(Paste, [{ + key: 'prepare', + value: function () { + var _ref8 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() { + return regeneratorRuntime.wrap(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + this.setCallback(); + this.processTools(); + + case 2: + case 'end': + return _context3.stop(); + } + } + }, _callee3, this); + })); + + function prepare() { + return _ref8.apply(this, arguments); + } + + return prepare; + }() + /** + * Set onPaste callback handler + */ + + }, { + key: 'setCallback', + value: function setCallback() { + var _Editor = this.Editor, + Listeners = _Editor.Listeners, + UI = _Editor.UI; + + Listeners.on(UI.nodes.redactor, 'paste', this.processPastedData); + } + /** + * Get and process tool`s paste configs + */ + + }, { + key: 'processTools', + value: function processTools() { + var tools = this.Editor.Tools.blockTools; + Object.entries(tools).forEach(this.processTool); + } + /** + * Check if browser behavior suits better + * + * @param {EventTarget} element - element where content has been pasted + * @returns {boolean} + */ + + }, { + key: 'isNativeBehaviour', + value: function isNativeBehaviour(element) { + var BlockManager = this.Editor.BlockManager; + + if ($.isNativeInput(element)) { + return true; + } + var block = BlockManager.getBlock(element); + return !block; + } + /** + * Process paste to single Block: + * 1. Find patterns` matches + * 2. Insert new block if it is not the same type as current one + * 3. Just insert text if there is no substitutions + * + * @param {IPasteData} dataToInsert + */ + + }, { + key: 'processSingleBlock', + value: function () { + var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(dataToInsert) { + var initialTool, BlockManager, content, tool, blockData; + return regeneratorRuntime.wrap(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + initialTool = this.config.initialBlock; + BlockManager = this.Editor.BlockManager; + content = dataToInsert.content, tool = dataToInsert.tool; + + if (!(tool === initialTool && content.textContent.length < Paste.PATTERN_PROCESSING_MAX_LENGTH)) { + _context4.next = 11; + break; + } + + _context4.next = 6; + return this.processPattern(content.textContent); + + case 6: + blockData = _context4.sent; + + if (!blockData) { + _context4.next = 11; + break; + } + + this.splitBlock(); + if (BlockManager.currentBlock.isEmpty) { + BlockManager.replace(blockData.tool, blockData.data); + } else { + BlockManager.insert(blockData.tool, blockData.data); + } + return _context4.abrupt('return'); + + case 11: + /** If there is no pattern substitute - insert string as it is */ + document.execCommand('insertHTML', false, content.innerHTML); + + case 12: + case 'end': + return _context4.stop(); + } + } + }, _callee4, this); + })); + + function processSingleBlock(_x4) { + return _ref9.apply(this, arguments); + } + + return processSingleBlock; + }() + /** + * Get patterns` matches + * + * @param {string} text + * @returns Promise<{data: IBlockToolData, tool: string}> + */ + + }, { + key: 'processPattern', + value: function () { + var _ref10 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(text) { + var pattern, data; + return regeneratorRuntime.wrap(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + pattern = this.toolsPatterns.find(function (substitute) { + var execResult = substitute.pattern.exec(text); + if (!execResult) { + return false; + } + return text === execResult.shift(); + }); + _context5.t0 = pattern; + + if (!_context5.t0) { + _context5.next = 6; + break; + } + + _context5.next = 5; + return pattern.handler(text, pattern.key); + + case 5: + _context5.t0 = _context5.sent; + + case 6: + data = _context5.t0; + return _context5.abrupt('return', data && { + data: data, + tool: pattern.tool + }); + + case 8: + case 'end': + return _context5.stop(); + } + } + }, _callee5, this); + })); + + function processPattern(_x5) { + return _ref10.apply(this, arguments); + } + + return processPattern; + }() + /** + * + * @param {IPasteData} data + * @param {Boolean} canReplaceCurrentBlock - if true and is current Block is empty, will replace current Block + * @returns {Promise} + */ + + }, { + key: 'insertBlock', + value: function () { + var _ref11 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(data) { + var canReplaceCurrentBlock = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var blockData, BlockManager, currentBlock; + return regeneratorRuntime.wrap(function _callee6$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + _context6.next = 2; + return data.handler(data.content); + + case 2: + blockData = _context6.sent; + BlockManager = this.Editor.BlockManager; + currentBlock = BlockManager.currentBlock; + + if (!(canReplaceCurrentBlock && currentBlock.isEmpty)) { + _context6.next = 8; + break; + } + + BlockManager.replace(data.tool, blockData); + return _context6.abrupt('return'); + + case 8: + BlockManager.insert(data.tool, blockData); + + case 9: + case 'end': + return _context6.stop(); + } + } + }, _callee6, this); + })); + + function insertBlock(_x7) { + return _ref11.apply(this, arguments); + } + + return insertBlock; + }() + /** + * Split current block if paste isn't in the end of the block + */ + + }, { + key: 'splitBlock', + value: function splitBlock() { + var _Editor2 = this.Editor, + BlockManager = _Editor2.BlockManager, + Caret = _Editor2.Caret; + /** If we paste into middle of the current block: + * 1. Split + * 2. Navigate to the first part + */ + + if (!BlockManager.currentBlock.isEmpty && !Caret.isAtEnd) { + BlockManager.split(); + BlockManager.currentBlockIndex--; + } + } + /** + * Split HTML string to blocks and return it as array of Block data + * + * @param {string} innerHTML + * @returns {IPasteData[]} + */ + + }, { + key: 'processHTML', + value: function processHTML(innerHTML) { + var _this3 = this; + + var _Editor3 = this.Editor, + Tools = _Editor3.Tools, + Sanitizer = _Editor3.Sanitizer; + + var initialTool = this.config.initialBlock; + var wrapper = $.make('DIV'); + wrapper.innerHTML = innerHTML; + var nodes = this.getNodes(wrapper); + return nodes.map(function (node) { + var content = void 0, + tool = initialTool, + isBlock = false; + switch (node.nodeType) { + /** If node is a document fragment, use temp wrapper to get innerHTML */ + case Node.DOCUMENT_FRAGMENT_NODE: + content = $.make('div'); + content.appendChild(node); + content.innerHTML = Sanitizer.clean(content.innerHTML); + break; + /** If node is an element, then there might be a substitution */ + case Node.ELEMENT_NODE: + content = node; + isBlock = true; + content.innerHTML = Sanitizer.clean(content.innerHTML); + if (_this3.toolsTags[content.tagName]) { + tool = _this3.toolsTags[content.tagName].tool; + } + break; + } + var handler = Tools.blockTools[tool].onPaste.handler; + return { content: content, isBlock: isBlock, handler: handler, tool: tool }; + }).filter(function (data) { + return !$.isNodeEmpty(data.content); + }); + } + /** + * Split plain text by new line symbols and return it as array of Block data + * + * @param {string} plain + * @returns {IPasteData[]} + */ + + }, { + key: 'processPlain', + value: function processPlain(plain) { + var initialBlock = this.config.initialBlock; + var Tools = this.Editor.Tools; + + if (!plain) { + return []; + } + var tool = initialBlock; + var handler = Tools.blockTools[tool].onPaste.handler; + return plain.split('\n\n').map(function (text) { + var content = $.make('div'); + content.innerHTML = plain; + return { content: content, tool: tool, isBlock: false, handler: handler }; + }); + } + /** + * Recursively divide HTML string to two types of nodes: + * 1. Block element + * 2. Document Fragments contained text and markup tags like a, b, i etc. + * + * @param {Node} wrapper + * @returns {Node[]} + */ + + }, { + key: 'getNodes', + value: function getNodes(wrapper) { + var children = Array.from(wrapper.childNodes); + var tags = Object.keys(this.toolsTags); + var reducer = function reducer(nodes, node) { + if ($.isEmpty(node)) { + return nodes; + } + var lastNode = nodes[nodes.length - 1]; + var destNode = new DocumentFragment(); + if (lastNode && $.isFragment(lastNode)) { + destNode = nodes.pop(); + } + switch (node.nodeType) { + /** + * If node is HTML element: + * 1. Check if it is inline element + * 2. Check if it contains another block or substitutable elements + */ + case Node.ELEMENT_NODE: + var element = node; + /** Append inline elements to previous fragment */ + if (!$.blockElements.includes(element.tagName.toLowerCase()) && !tags.includes(element.tagName.toLowerCase())) { + destNode.appendChild(element); + return [].concat(_toConsumableArray(nodes), [destNode]); + } + if (tags.includes(element.tagName.toLowerCase()) && Array.from(element.children).every(function (_ref12) { + var tagName = _ref12.tagName; + return !tags.includes(tagName.toLowerCase()); + }) || $.blockElements.includes(element.tagName.toLowerCase()) && Array.from(element.children).every(function (_ref13) { + var tagName = _ref13.tagName; + return !$.blockElements.includes(tagName.toLowerCase()); + })) { + return [].concat(_toConsumableArray(nodes), [element]); + } + break; + /** + * If node is text node, wrap it with DocumentFragment + */ + case Node.TEXT_NODE: + destNode.appendChild(node); + return [].concat(_toConsumableArray(nodes), [destNode]); + default: + return [].concat(_toConsumableArray(nodes), [destNode]); + } + return [].concat(_toConsumableArray(nodes), _toConsumableArray(Array.from(node.childNodes).reduce(reducer, []))); + }; + return children.reduce(reducer, []); + } + }]); + + return Paste; +}(Module); +/** If string`s length is greater than this number we don't check paste patterns */ + + +Paste.displayName = 'Paste'; +exports.default = Paste; +Paste.PATTERN_PROCESSING_MAX_LENGTH = 450; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! utils */ "./src/components/utils.js"), __webpack_require__(/*! dom */ "./src/components/dom.js"))) + +/***/ }), + +/***/ "./src/components/modules/renderer.js": +/*!********************************************!*\ + !*** ./src/components/modules/renderer.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * Codex Editor Renderer Module + * + * @module Renderer + * @author CodeX Team + * + * @version 2.0.0 + */ +var Renderer = function (_Module) { + _inherits(Renderer, _Module); + + /** + * @constructor + * @param {EditorConfig} config + */ + function Renderer(_ref) { + var config = _ref.config; + + _classCallCheck(this, Renderer); + + return _possibleConstructorReturn(this, (Renderer.__proto__ || Object.getPrototypeOf(Renderer)).call(this, { config: config })); + } + + /** + * @typedef {Object} RendererItems + * @property {String} type - tool name + * @property {Object} data - tool data + */ + + /** + * @example + * + * items: [ + * { + * type : 'paragraph', + * data : { + * text : 'Hello from Codex!' + * } + * }, + * { + * type : 'paragraph', + * data : { + * text : 'Leave feedback if you like it!' + * } + * }, + * ] + * + */ + + /** + * Make plugin blocks from array of plugin`s data + * @param {RendererItems[]} items + */ + + + _createClass(Renderer, [{ + key: 'render', + value: function render(items) { + var _this2 = this; + + var chainData = []; + + var _loop = function _loop(i) { + chainData.push({ + function: function _function() { + return _this2.insertBlock(items[i]); + } + }); + }; + + for (var i = 0; i < items.length; i++) { + _loop(i); + } + + return _.sequence(chainData); + } + + /** + * Get plugin instance + * Add plugin instance to BlockManager + * Insert block to working zone + * + * @param {Object} item + * @returns {Promise.} + * @private + */ + + }, { + key: 'insertBlock', + value: function insertBlock(item) { + var tool = item.type, + data = item.data, + settings = item.settings; + + if (tool in this.Editor.Tools.available) { + this.Editor.BlockManager.insert(tool, data, settings); + } else { + /** + * @todo show warning notification message + * + * `${tool} blocks was skipped.` + */ + + _.log('Tool \xAB' + tool + '\xBB is not found. Check \'tools\' property at your initial CodeX Editor config.', 'warn'); + } + + return Promise.resolve(); + } + }]); + + return Renderer; +}(Module); + +Renderer.displayName = 'Renderer'; +exports.default = Renderer; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/sanitizer.js": +/*!*********************************************!*\ + !*** ./src/components/modules/sanitizer.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * CodeX Sanitizer + * + * @module Sanitizer + * Clears HTML from taint tags + * + * @version 2.0.0 + * + * @example + * Module can be used within two ways: + * 1) When you have an instance + * - this.Editor.Sanitizer.clean(yourTaintString); + * 2) As static method + * - CodexEditor.Sanitizer.clean(yourTaintString, yourCustomConfiguration); + * + * {@link SanitizerConfig} + */ + +/** + * @typedef {Object} SanitizerConfig + * @property {Object} tags - define tags restrictions + * + * @example + * + * tags : { + * p: true, + * a: { + * href: true, + * rel: "nofollow", + * target: "_blank" + * } + * } + */ +var Sanitizer = function (_Module) { + _inherits(Sanitizer, _Module); + + /** + * Initializes Sanitizer module + * Sets default configuration if custom not exists + * + * @property {SanitizerConfig} this.defaultConfig + * @property {HTMLJanitor} this._sanitizerInstance - Sanitizer library + * + * @param {SanitizerConfig} config + */ + function Sanitizer(_ref) { + var config = _ref.config; + + _classCallCheck(this, Sanitizer); + + // default config + var _this = _possibleConstructorReturn(this, (Sanitizer.__proto__ || Object.getPrototypeOf(Sanitizer)).call(this, { config: config })); + + _this.defaultConfig = null; + _this._sanitizerInstance = null; + + /** Custom configuration */ + _this.sanitizerConfig = config.settings ? config.settings.sanitizer : {}; + + /** HTML Janitor library */ + _this.sanitizerInstance = __webpack_require__(/*! html-janitor */ "./node_modules/html-janitor/src/html-janitor.js"); + return _this; + } + + /** + * If developer uses editor's API, then he can customize sanitize restrictions. + * Or, sanitizing config can be defined globally in editors initialization. That config will be used everywhere + * At least, if there is no config overrides, that API uses Default configuration + * + * @uses https://www.npmjs.com/package/html-janitor + * + * @param {HTMLJanitor} library - sanitizer extension + */ + + + _createClass(Sanitizer, [{ + key: 'clean', + + + /** + * Cleans string from unwanted tags + * @param {String} taintString - HTML string + * @param {Object} customConfig - custom sanitizer configuration. Method uses default if param is empty + * @return {String} clean HTML + */ + value: function clean(taintString) { + var customConfig = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (_.isEmpty(customConfig)) { + return this._sanitizerInstance.clean(taintString); + } else { + return Sanitizer.clean(taintString, customConfig); + } + } + + /** + * Cleans string from unwanted tags + * @static + * + * Method allows to use default config + * + * @param {String} taintString - taint string + * @param {SanitizerConfig} customConfig - allowed tags + * + * @return {String} clean HTML + */ + + }, { + key: 'sanitizerInstance', + set: function set(library) { + this._sanitizerInstance = new library(this.defaultConfig); + } + + /** + * Sets sanitizer configuration. Uses default config if user didn't pass the restriction + * @param {SanitizerConfig} config + */ + + }, { + key: 'sanitizerConfig', + set: function set(config) { + if (_.isEmpty(config)) { + this.defaultConfig = { + tags: { + p: {}, + a: { + href: true, + target: '_blank', + rel: 'nofollow' + }, + b: {}, + i: {} + } + }; + } else { + this.defaultConfig = config; + } + } + }], [{ + key: 'clean', + value: function clean(taintString, customConfig) { + var newInstance = new Sanitizer({ + config: { + settings: { + sanitizer: customConfig + } + } + }); + + return newInstance.clean(taintString); + } + }]); + + return Sanitizer; +}(Module); + +Sanitizer.displayName = 'Sanitizer'; +exports.default = Sanitizer; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/saver.js": +/*!*****************************************!*\ + !*** ./src/components/modules/saver.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * Codex Editor Saver + * + * @module Saver + * @author Codex Team + * @version 2.0.0 + */ + +/** + * @typedef {Object} SavedData + * @property {Date} time - saving proccess time + * @property {Object} items - extracted data + * @property {String} version - CodexEditor version + */ + +/** + * @classdesc This method reduces all Blocks asyncronically and calls Block's save method to extract data + * + * @typedef {Saver} Saver + * @property {Element} html - Editor HTML content + * @property {String} json - Editor JSON output + */ +var Saver = function (_Module) { + _inherits(Saver, _Module); + + /** + * @constructor + * @param config + */ + function Saver(_ref) { + var config = _ref.config; + + _classCallCheck(this, Saver); + + var _this = _possibleConstructorReturn(this, (Saver.__proto__ || Object.getPrototypeOf(Saver)).call(this, { config: config })); + + _this.output = null; + _this.blocksData = []; + return _this; + } + + /** + * Composes new chain of Promises to fire them alternatelly + * @return {SavedData} + */ + + + _createClass(Saver, [{ + key: 'save', + value: function save() { + var _this2 = this; + + var blocks = this.Editor.BlockManager.blocks, + chainData = []; + + blocks.forEach(function (block) { + chainData.push(block.data); + }); + + return Promise.all(chainData).then(function (allExtractedData) { + return _this2.makeOutput(allExtractedData); + }).then(function (outputData) { + return outputData; + }); + } + + /** + * Creates output object with saved data, time and version of editor + * @param {Object} allExtractedData + * @return {SavedData} + */ + + }, { + key: 'makeOutput', + value: function makeOutput(allExtractedData) { + var items = [], + totalTime = 0; + + console.groupCollapsed('[CodexEditor saving]:'); + + allExtractedData.forEach(function (extraction) { + /** Group process info */ + console.log('\xAB' + extraction.tool + '\xBB saving info', extraction); + totalTime += extraction.time; + items.push({ + type: extraction.tool, + data: extraction.data + }); + }); + + console.log('Total', totalTime); + console.groupEnd(); + + return { + time: +new Date(), + items: items, + version: "2.0.0" + }; + } + }]); + + return Saver; +}(Module); + +// module.exports = (function (saver) { +// +// let editor = codex.editor; +// +// /** +// * @public +// * Save blocks +// */ +// saver.save = function () { +// +// /** Save html content of redactor to memory */ +// editor.state.html = editor.nodes.redactor.innerHTML; +// +// /** Clean jsonOutput state */ +// editor.state.jsonOutput = []; +// +// return saveBlocks(editor.nodes.redactor.childNodes); +// +// }; +// +// /** +// * @private +// * Save each block data +// * +// * @param blocks +// * @returns {Promise.} +// */ +// let saveBlocks = function (blocks) { +// +// let data = []; +// +// for(let index = 0; index < blocks.length; index++) { +// +// data.push(getBlockData(blocks[index])); +// +// } +// +// return Promise.all(data) +// .then(makeOutput) +// .catch(editor.core.log); +// +// }; +// +// /** Save and validate block data */ +// let getBlockData = function (block) { +// +// return saveBlockData(block) +// .then(validateBlockData) +// .catch(editor.core.log); +// +// }; +// +// /** +// * @private +// * Call block`s plugin save method and return saved data +// * +// * @param block +// * @returns {Object} +// */ +// let saveBlockData = function (block) { +// +// let pluginName = block.dataset.tool; +// +// /** Check for plugin existence */ +// if (!editor.tools[pluginName]) { +// +// editor.core.log(`Plugin «${pluginName}» not found`, 'error'); +// return {data: null, pluginName: null}; +// +// } +// +// /** Check for plugin having save method */ +// if (typeof editor.tools[pluginName].save !== 'function') { +// +// editor.core.log(`Plugin «${pluginName}» must have save method`, 'error'); +// return {data: null, pluginName: null}; +// +// } +// +// /** Result saver */ +// let blockContent = block.childNodes[0], +// pluginsContent = blockContent.childNodes[0], +// position = pluginsContent.dataset.inputPosition; +// +// /** If plugin wasn't available then return data from cache */ +// if ( editor.tools[pluginName].available === false ) { +// +// return Promise.resolve({data: codex.editor.state.blocks.items[position].data, pluginName}); +// +// } +// +// return Promise.resolve(pluginsContent) +// .then(editor.tools[pluginName].save) +// .then(data => Object({data, pluginName})); +// +// }; +// +// /** +// * Call plugin`s validate method. Return false if validation failed +// * +// * @param data +// * @param pluginName +// * @returns {Object|Boolean} +// */ +// let validateBlockData = function ({data, pluginName}) { +// +// if (!data || !pluginName) { +// +// return false; +// +// } +// +// if (editor.tools[pluginName].validate) { +// +// let result = editor.tools[pluginName].validate(data); +// +// /** +// * Do not allow invalid data +// */ +// if (!result) { +// +// return false; +// +// } +// +// } +// +// return {data, pluginName}; +// +// +// }; +// +// /** +// * Compile article output +// * +// * @param savedData +// * @returns {{time: number, version, items: (*|Array)}} +// */ +// let makeOutput = function (savedData) { +// +// savedData = savedData.filter(blockData => blockData); +// +// let items = savedData.map(blockData => Object({type: blockData.pluginName, data: blockData.data})); +// +// editor.state.jsonOutput = items; +// +// return { +// id: editor.state.blocks.id || null, +// time: +new Date(), +// version: editor.version, +// items +// }; +// +// }; +// +// return saver; +// +// })({}); + + +Saver.displayName = 'Saver'; +exports.default = Saver; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"))) + +/***/ }), + +/***/ "./src/components/modules/toolbar-blockSettings.js": +/*!*********************************************************!*\ + !*** ./src/components/modules/toolbar-blockSettings.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, $) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * Block Settings + * + * ____ Settings Panel ____ + * | ...................... | + * | . Tool Settings . | + * | ...................... | + * | . Default Settings . | + * | ...................... | + * |________________________| + */ +var BlockSettings = function (_Module) { + _inherits(BlockSettings, _Module); + + /** + * @constructor + */ + function BlockSettings(_ref) { + var config = _ref.config; + + _classCallCheck(this, BlockSettings); + + var _this = _possibleConstructorReturn(this, (BlockSettings.__proto__ || Object.getPrototypeOf(BlockSettings)).call(this, { config: config })); + + _this.nodes = { + wrapper: null, + toolSettings: null, + defaultSettings: null + }; + return _this; + } + + /** + * Module Events + * @return {{opened: string, closed: string}} + */ + + + _createClass(BlockSettings, [{ + key: 'make', + + + /** + * Panel with block settings with 2 sections: + * - Tool's Settings + * - Default Settings [Move, Remove, etc] + * + * @return {Element} + */ + value: function make() { + this.nodes.wrapper = $.make('div', BlockSettings.CSS.wrapper); + + this.nodes.toolSettings = $.make('div', BlockSettings.CSS.toolSettings); + this.nodes.defaultSettings = $.make('div', BlockSettings.CSS.defaultSettings); + + $.append(this.nodes.wrapper, [this.nodes.toolSettings, this.nodes.defaultSettings]); + } + + /** + * Add Tool's settings + */ + + }, { + key: 'addToolSettings', + value: function addToolSettings() { + if (typeof this.Editor.BlockManager.currentBlock.tool.renderSettings === 'function') { + $.append(this.nodes.toolSettings, this.Editor.BlockManager.currentBlock.tool.renderSettings()); + } + } + + /** + * Add default settings + */ + + }, { + key: 'addDefaultSettings', + value: function addDefaultSettings() { + $.append(this.nodes.defaultSettings, this.Editor.BlockManager.currentBlock.renderTunes()); + } + + /** + * Is Block Settings opened or not + * @returns {boolean} + */ + + }, { + key: 'open', + + + /** + * Open Block Settings pane + */ + value: function open() { + this.nodes.wrapper.classList.add(BlockSettings.CSS.wrapperOpened); + + /** + * Fill Tool's settings + */ + this.addToolSettings(); + + /** + * Add default settings that presents for all Blocks + */ + this.addDefaultSettings(); + + /** Tell to subscribers that block settings is opened */ + this.Editor.Events.emit(this.events.opened); + } + + /** + * Close Block Settings pane + */ + + }, { + key: 'close', + value: function close() { + this.nodes.wrapper.classList.remove(BlockSettings.CSS.wrapperOpened); + + /** Clear settings */ + this.nodes.toolSettings.innerHTML = ''; + this.nodes.defaultSettings.innerHTML = ''; + + /** Tell to subscribers that block settings is closed */ + this.Editor.Events.emit(this.events.closed); + } + }, { + key: 'events', + get: function get() { + return { + opened: 'block-settings-opened', + closed: 'block-settings-closed' + }; + } + + /** + * Block Settings CSS + * @return {{wrapper, wrapperOpened, toolSettings, defaultSettings, button}} + */ + + }, { + key: 'opened', + get: function get() { + return this.nodes.wrapper.classList.contains(BlockSettings.CSS.wrapperOpened); + } + }], [{ + key: 'CSS', + get: function get() { + return { + // Settings Panel + wrapper: 'ce-settings', + wrapperOpened: 'ce-settings--opened', + toolSettings: 'ce-settings__plugin-zone', + defaultSettings: 'ce-settings__default-zone', + + button: 'ce-settings__button' + }; + } + }]); + + return BlockSettings; +}(Module); + +BlockSettings.displayName = 'BlockSettings'; +exports.default = BlockSettings; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"))) + +/***/ }), + +/***/ "./src/components/modules/toolbar-inline.ts": +/*!**************************************************!*\ + !*** ./src/components/modules/toolbar-inline.ts ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, $, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _inlineToolBold = __webpack_require__(/*! ../inline-tools/inline-tool-bold */ "./src/components/inline-tools/inline-tool-bold.ts"); + +var _inlineToolBold2 = _interopRequireDefault(_inlineToolBold); + +var _inlineToolItalic = __webpack_require__(/*! ../inline-tools/inline-tool-italic */ "./src/components/inline-tools/inline-tool-italic.ts"); + +var _inlineToolItalic2 = _interopRequireDefault(_inlineToolItalic); + +var _inlineToolLink = __webpack_require__(/*! ../inline-tools/inline-tool-link */ "./src/components/inline-tools/inline-tool-link.ts"); + +var _inlineToolLink2 = _interopRequireDefault(_inlineToolLink); + +var _selection = __webpack_require__(/*! ../selection */ "./src/components/selection.js"); + +var _selection2 = _interopRequireDefault(_selection); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var InlineToolbar = function (_Module) { + _inherits(InlineToolbar, _Module); + + /** + * @constructor + */ + function InlineToolbar(_ref) { + var config = _ref.config; + + _classCallCheck(this, InlineToolbar); + + /** + * CSS styles + */ + var _this = _possibleConstructorReturn(this, (InlineToolbar.__proto__ || Object.getPrototypeOf(InlineToolbar)).call(this, { config: config })); + + _this.CSS = { + inlineToolbar: 'ce-inline-toolbar', + inlineToolbarShowed: 'ce-inline-toolbar--showed', + buttonsWrapper: 'ce-inline-toolbar__buttons', + actionsWrapper: 'ce-inline-toolbar__actions' + }; + /** + * Inline Toolbar elements + */ + _this.nodes = { + wrapper: null, + buttons: null, + /** + * Zone below the buttons where Tools can create additional actions by 'renderActions()' method + * For example, input for the 'link' tool or textarea for the 'comment' tool + */ + actions: null + }; + /** + * Margin above/below the Toolbar + */ + _this.toolbarVerticalMargin = 20; + return _this; + } + /** + * Inline Toolbar Tools + * @todo Merge internal tools with external + */ + + + _createClass(InlineToolbar, [{ + key: 'make', + + /** + * Making DOM + */ + value: function make() { + this.nodes.wrapper = $.make('div', this.CSS.inlineToolbar); + this.nodes.buttons = $.make('div', this.CSS.buttonsWrapper); + this.nodes.actions = $.make('div', this.CSS.actionsWrapper); + /** + * Append Inline Toolbar to the Editor + */ + $.append(this.nodes.wrapper, [this.nodes.buttons, this.nodes.actions]); + $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper); + /** + * Append Inline Toolbar Tools + */ + this.addTools(); + } + /** + * + * + * Moving / appearance + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + */ + /** + * Shows Inline Toolbar by keyup/mouseup + * @param {KeyboardEvent|MouseEvent} event + */ + + }, { + key: 'handleShowingEvent', + value: function handleShowingEvent(event) { + if (!this.allowedToShow(event)) { + this.close(); + return; + } + this.move(); + this.open(); + /** Check Tools state for selected fragment */ + this.checkToolsState(); + } + /** + * Move Toolbar to the selected text + */ + + }, { + key: 'move', + value: function move() { + var selectionRect = _selection2.default.rect; + var wrapperOffset = this.Editor.UI.nodes.wrapper.getBoundingClientRect(); + var newCoords = { + x: selectionRect.x - wrapperOffset.left, + y: selectionRect.y + selectionRect.height + // + window.scrollY + - wrapperOffset.top + this.toolbarVerticalMargin + }; + /** + * If we know selections width, place InlineToolbar to center + */ + if (selectionRect.width) { + newCoords.x += Math.floor(selectionRect.width / 2); + } + this.nodes.wrapper.style.left = Math.floor(newCoords.x) + 'px'; + this.nodes.wrapper.style.top = Math.floor(newCoords.y) + 'px'; + } + /** + * Shows Inline Toolbar + */ + + }, { + key: 'open', + value: function open() { + this.nodes.wrapper.classList.add(this.CSS.inlineToolbarShowed); + this.tools.forEach(function (tool) { + if (typeof tool.clear === 'function') { + tool.clear(); + } + }); + } + /** + * Hides Inline Toolbar + */ + + }, { + key: 'close', + value: function close() { + this.nodes.wrapper.classList.remove(this.CSS.inlineToolbarShowed); + this.tools.forEach(function (tool) { + if (typeof tool.clear === 'function') { + tool.clear(); + } + }); + } + /** + * Need to show Inline Toolbar or not + * @param {KeyboardEvent|MouseEvent} event + */ + + }, { + key: 'allowedToShow', + value: function allowedToShow(event) { + /** + * Tags conflicts with window.selection function. + * Ex. IMG tag returns null (Firefox) or Redactors wrapper (Chrome) + */ + var tagsConflictsWithSelection = ['IMG', 'INPUT']; + if (event && tagsConflictsWithSelection.includes(event.target.tagName)) { + return false; + } + var currentSelection = _selection2.default.get(), + selectedText = _selection2.default.text; + // old browsers + if (!currentSelection || !currentSelection.anchorNode) { + return false; + } + // empty selection + if (currentSelection.isCollapsed || selectedText.length < 1) { + return false; + } + // is enabled by current Block's Tool + var currentBlock = this.Editor.BlockManager.getBlock(currentSelection.anchorNode); + if (!currentBlock) { + return false; + } + var toolConfig = this.config.toolsConfig[currentBlock.name]; + return toolConfig && toolConfig[this.Editor.Tools.apiSettings.IS_ENABLED_INLINE_TOOLBAR]; + } + /** + * + * + * Working with Tools + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + */ + /** + * Fill Inline Toolbar with Tools + */ + + }, { + key: 'addTools', + value: function addTools() { + var _this2 = this; + + this.tools.forEach(function (tool) { + _this2.addTool(tool); + }); + } + /** + * Add tool button and activate clicks + * @param {InlineTool} tool - Tool's instance + */ + + }, { + key: 'addTool', + value: function addTool(tool) { + var _this3 = this; + + var button = tool.render(); + if (!button) { + _.log('Render method must return an instance of Node', 'warn', tool); + return; + } + this.nodes.buttons.appendChild(button); + if (typeof tool.renderActions === 'function') { + var actions = tool.renderActions(); + this.nodes.actions.appendChild(actions); + } + this.Editor.Listeners.on(button, 'click', function () { + _this3.toolClicked(tool); + }); + } + /** + * Inline Tool button clicks + * @param {InlineTool} tool - Tool's instance + */ + + }, { + key: 'toolClicked', + value: function toolClicked(tool) { + var range = _selection2.default.range; + tool.surround(range); + this.checkToolsState(); + } + /** + * Check Tools` state by selection + */ + + }, { + key: 'checkToolsState', + value: function checkToolsState() { + this.tools.forEach(function (tool) { + tool.checkState(_selection2.default.get()); + }); + } + }, { + key: 'tools', + get: function get() { + var _this4 = this; + + if (!this.toolsInstances) { + this.toolsInstances = [new _inlineToolBold2.default(this.Editor.API.methods), new _inlineToolItalic2.default(this.Editor.API.methods), new _inlineToolLink2.default(this.Editor.API.methods)].concat(_toConsumableArray(this.Editor.Tools.inline.map(function (Tool) { + return new Tool(_this4.Editor.API.methods); + }))); + } + return this.toolsInstances; + } + }]); + + return InlineToolbar; +}(Module); + +InlineToolbar.displayName = 'InlineToolbar'; +exports.default = InlineToolbar; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/toolbar-toolbox.js": +/*!***************************************************!*\ + !*** ./src/components/modules/toolbar-toolbox.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, $, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @class Toolbox + * @classdesc Holder for Tools + * + * @typedef {Toolbox} Toolbox + * @property {Boolean} opened - opening state + * @property {Object} nodes - Toolbox nodes + * @property {Object} CSS - CSS class names + * + */ +var Toolbox = function (_Module) { + _inherits(Toolbox, _Module); + + /** + * @constructor + */ + function Toolbox(_ref) { + var config = _ref.config; + + _classCallCheck(this, Toolbox); + + var _this = _possibleConstructorReturn(this, (Toolbox.__proto__ || Object.getPrototypeOf(Toolbox)).call(this, { config: config })); + + _this.nodes = { + toolbox: null, + buttons: [] + }; + + /** + * Opening state + * @type {boolean} + */ + _this.opened = false; + return _this; + } + + /** + * CSS styles + * @return {{toolbox: string, toolboxButton: string, toolboxOpened: string}} + */ + + + _createClass(Toolbox, [{ + key: 'make', + + + /** + * Makes the Toolbox + */ + value: function make() { + this.nodes.toolbox = $.make('div', Toolbox.CSS.toolbox); + $.append(this.Editor.Toolbar.nodes.content, this.nodes.toolbox); + + this.addTools(); + } + + /** + * Iterates available tools and appends them to the Toolbox + */ + + }, { + key: 'addTools', + value: function addTools() { + var tools = this.Editor.Tools.toolsAvailable; + + for (var toolName in tools) { + this.addTool(toolName, tools[toolName]); + } + } + + /** + * Append Tool to the Toolbox + * + * @param {string} toolName - tool name + * @param {IBlockTool} tool - tool class + */ + + }, { + key: 'addTool', + value: function addTool(toolName, tool) { + var _this2 = this; + + var api = this.Editor.Tools.apiSettings; + + if (tool[api.IS_DISPLAYED_IN_TOOLBOX] && !tool[api.TOOLBAR_ICON_CLASS]) { + _.log('Toolbar icon class name is missed. Tool %o skipped', 'warn', toolName); + return; + } + + /** + * @todo Add checkup for the render method + */ + // if (typeof tool.render !== 'function') { + // + // _.log('render method missed. Tool %o skipped', 'warn', tool); + // return; + // + // } + + /** + * Skip tools that pass 'displayInToolbox=false' + */ + if (!tool[api.IS_DISPLAYED_IN_TOOLBOX]) { + return; + } + + var button = $.make('li', [Toolbox.CSS.toolboxButton, tool[api.TOOLBAR_ICON_CLASS]], { + title: toolName + }); + + button.innerHTML = tool.toolboxIcon; + + /** + * Save tool's name in the button data-name + */ + button.dataset.name = toolName; + + $.append(this.nodes.toolbox, button); + + this.nodes.toolbox.appendChild(button); + this.nodes.buttons.push(button); + + /** + * @todo add event with module Listeners + */ + // this.Editor.Listeners.add(); + button.addEventListener('click', function (event) { + _this2.buttonClicked(event); + }, false); + } + + /** + * Toolbox button click listener + * 1) if block is empty -> replace + * 2) if block is not empty -> add new block below + * + * @param {MouseEvent} event + */ + + }, { + key: 'buttonClicked', + value: function buttonClicked(event) { + var toolButton = event.target; + + toolButton = toolButton.closest('.' + Toolbox.CSS.toolboxButton); + + if (!toolButton) { + return; + } + + var toolName = toolButton.dataset.name, + tool = this.Editor.Tools.toolClasses[toolName]; + + /** + * @type {Block} + */ + var currentBlock = this.Editor.BlockManager.currentBlock; + + /** + * We do replace if: + * - block is empty + * - block is not irreplaceable + * @type {Array} + */ + if (!tool[this.Editor.Tools.apiSettings.IS_IRREPLACEBLE_TOOL] && currentBlock.isEmpty) { + this.Editor.BlockManager.replace(toolName); + } else { + this.Editor.BlockManager.insert(toolName); + } + + /** + * @todo set caret to the new block + */ + + // window.setTimeout(function () { + + /** Set caret to current block */ + // editor.caret.setToBlock(currentInputIndex); + + // }, 10); + + /** + * Move toolbar when node is changed + */ + this.Editor.Toolbar.move(); + } + + /** + * Open Toolbox with Tools + */ + + }, { + key: 'open', + value: function open() { + this.nodes.toolbox.classList.add(Toolbox.CSS.toolboxOpened); + this.opened = true; + } + + /** + * Close Toolbox + */ + + }, { + key: 'close', + value: function close() { + this.nodes.toolbox.classList.remove(Toolbox.CSS.toolboxOpened); + this.opened = false; + } + + /** + * Close Toolbox + */ + + }, { + key: 'toggle', + value: function toggle() { + if (!this.opened) { + this.open(); + } else { + this.close(); + } + } + }], [{ + key: 'CSS', + get: function get() { + return { + toolbox: 'ce-toolbox', + toolboxButton: 'ce-toolbox__button', + toolboxOpened: 'ce-toolbox--opened' + }; + } + }]); + + return Toolbox; +}(Module); + +Toolbox.displayName = 'Toolbox'; +exports.default = Toolbox; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/toolbar.js": +/*!*******************************************!*\ + !*** ./src/components/modules/toolbar.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, $) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * + * «Toolbar» is the node that moves up/down over current block + * + * ______________________________________ Toolbar ____________________________________________ + * | | + * | ..................... Content .................... ......... Block Actions .......... | + * | . . . . | + * | . . . [Open Settings] . | + * | . [Plus Button] [Toolbox: {Tool1}, {Tool2}] . . . | + * | . . . [Settings Panel] . | + * | .................................................. .................................. | + * | | + * |___________________________________________________________________________________________| + * + * + * Toolbox — its an Element contains tools buttons. Can be shown by Plus Button. + * + * _______________ Toolbox _______________ + * | | + * | [Header] [Image] [List] [Quote] ... | + * |_______________________________________| + * + * + * Settings Panel — is an Element with block settings: + * + * ____ Settings Panel ____ + * | ...................... | + * | . Tool Settings . | + * | ...................... | + * | . Default Settings . | + * | ...................... | + * |________________________| + * + * + * @class + * @classdesc Toolbar module + * + * @typedef {Toolbar} Toolbar + * @property {Object} nodes + * @property {Element} nodes.wrapper - Toolbar main element + * @property {Element} nodes.content - Zone with Plus button and toolbox. + * @property {Element} nodes.actions - Zone with Block Settings and Remove Button + * @property {Element} nodes.blockActionsButtons - Zone with Block Buttons: [Settings] + * @property {Element} nodes.plusButton - Button that opens or closes Toolbox + * @property {Element} nodes.toolbox - Container for tools + * @property {Element} nodes.settingsToggler - open/close Settings Panel button + * @property {Element} nodes.settings - Settings Panel + * @property {Element} nodes.pluginSettings - Plugin Settings section of Settings Panel + * @property {Element} nodes.defaultSettings - Default Settings section of Settings Panel + */ +var Toolbar = function (_Module) { + _inherits(Toolbar, _Module); + + /** + * @constructor + */ + function Toolbar(_ref) { + var config = _ref.config; + + _classCallCheck(this, Toolbar); + + var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, { config: config })); + + _this.nodes = { + wrapper: null, + content: null, + actions: null, + + // Content Zone + plusButton: null, + + // Actions Zone + blockActionsButtons: null, + settingsToggler: null + }; + return _this; + } + + /** + * CSS styles + * @return {Object} + * @constructor + */ + + + _createClass(Toolbar, [{ + key: 'make', + + + /** + * Makes toolbar + */ + value: function make() { + var _this2 = this; + + this.nodes.wrapper = $.make('div', Toolbar.CSS.toolbar); + + /** + * Make Content Zone and Actions Zone + */ + ['content', 'actions'].forEach(function (el) { + _this2.nodes[el] = $.make('div', Toolbar.CSS[el]); + $.append(_this2.nodes.wrapper, _this2.nodes[el]); + }); + + /** + * Fill Content Zone: + * - Plus Button + * - Toolbox + */ + this.nodes.plusButton = $.make('div', Toolbar.CSS.plusButton); + $.append(this.nodes.plusButton, $.svg('plus', 14, 14)); + $.append(this.nodes.content, this.nodes.plusButton); + this.nodes.plusButton.addEventListener('click', function (event) { + return _this2.plusButtonClicked(event); + }, false); + + /** + * Make a Toolbox + */ + this.Editor.Toolbox.make(); + + /** + * Fill Actions Zone: + * - Settings Toggler + * - Remove Block Button + * - Settings Panel + */ + this.nodes.blockActionsButtons = $.make('div', Toolbar.CSS.blockActionsButtons); + this.nodes.settingsToggler = $.make('span', Toolbar.CSS.settingsToggler); + var settingsIcon = $.svg('dots', 18, 4); + + $.append(this.nodes.settingsToggler, settingsIcon); + $.append(this.nodes.blockActionsButtons, this.nodes.settingsToggler); + $.append(this.nodes.actions, this.nodes.blockActionsButtons); + + /** + * Make and append Settings Panel + */ + this.Editor.BlockSettings.make(); + $.append(this.nodes.actions, this.Editor.BlockSettings.nodes.wrapper); + + /** + * Append toolbar to the Editor + */ + $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper); + + /** + * Bind events on the Toolbar elements + */ + this.bindEvents(); + } + + /** + * Move Toolbar to the Current Block + * @param {Boolean} forceClose - force close Toolbar Settings and Toolbar + */ + + }, { + key: 'move', + value: function move() { + var forceClose = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + if (forceClose) { + /** Close Toolbox when we move toolbar */ + this.Editor.Toolbox.close(); + this.Editor.BlockSettings.close(); + } + + var currentNode = this.Editor.BlockManager.currentNode; + + /** + * If no one Block selected as a Current + */ + if (!currentNode) { + return; + } + + /** + * @todo Compute dynamically on prepare + * @type {number} + */ + var defaultToolbarHeight = 49; + var defaultOffset = 34; + + var newYCoordinate = currentNode.offsetTop - defaultToolbarHeight / 2 + defaultOffset; + + this.nodes.wrapper.style.transform = 'translate3D(0, ' + Math.floor(newYCoordinate) + 'px, 0)'; + } + + /** + * Open Toolbar with Plus Button + */ + + }, { + key: 'open', + value: function open() { + this.nodes.wrapper.classList.add(Toolbar.CSS.toolbarOpened); + } + + /** + * Close the Toolbar + */ + + }, { + key: 'close', + value: function close() { + this.nodes.wrapper.classList.remove(Toolbar.CSS.toolbarOpened); + } + + /** + * Plus Button public methods + * @return {{hide: function(): void, show: function(): void}} + */ + + }, { + key: 'plusButtonClicked', + + + /** + * Handler for Plus Button + * @param {MouseEvent} event + */ + value: function plusButtonClicked() { + this.Editor.Toolbox.toggle(); + } + + /** + * Bind events on the Toolbar Elements: + * - Block Settings + */ + + }, { + key: 'bindEvents', + value: function bindEvents() { + var _this3 = this; + + /** + * Settings toggler + */ + this.Editor.Listeners.on(this.nodes.settingsToggler, 'click', function (event) { + _this3.settingsTogglerClicked(event); + }); + } + + /** + * Clicks on the Block Settings toggler + */ + + }, { + key: 'settingsTogglerClicked', + value: function settingsTogglerClicked() { + if (this.Editor.BlockSettings.opened) { + this.Editor.BlockSettings.close(); + } else { + this.Editor.BlockSettings.open(); + } + } + }, { + key: 'plusButton', + get: function get() { + var _this4 = this; + + return { + hide: function hide() { + return _this4.nodes.plusButton.classList.add(Toolbar.CSS.plusButtonHidden); + }, + show: function show() { + return _this4.nodes.plusButton.classList.remove(Toolbar.CSS.plusButtonHidden); + } + }; + } + }], [{ + key: 'CSS', + get: function get() { + return { + toolbar: 'ce-toolbar', + content: 'ce-toolbar__content', + actions: 'ce-toolbar__actions', + + toolbarOpened: 'ce-toolbar--opened', + + // Content Zone + plusButton: 'ce-toolbar__plus', + plusButtonHidden: 'ce-toolbar__plus--hidden', + + // Actions Zone + blockActionsButtons: 'ce-toolbar__actions-buttons', + settingsToggler: 'ce-toolbar__settings-btn' + }; + } + }]); + + return Toolbar; +}(Module); + +Toolbar.displayName = 'Toolbar'; +exports.default = Toolbar; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"))) + +/***/ }), + +/***/ "./src/components/modules/toolbar/inline.js": +/*!**************************************************!*\ + !*** ./src/components/modules/toolbar/inline.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Inline toolbar + * + * Contains from tools: + * Bold, Italic, Underline and Anchor + * + * @author Codex Team + * @version 1.0 + */ + +module.exports = function (inline) { + var editor = codex.editor; + + inline.buttonsOpened = null; + inline.actionsOpened = null; + inline.wrappersOffset = null; + + /** + * saving selection that need for execCommand for styling + * + */ + inline.storedSelection = null; + + /** + * @protected + * + * Open inline toobar + */ + inline.show = function () { + var currentNode = editor.content.currentNode, + tool = currentNode.dataset.tool, + plugin; + + /** + * tool allowed to open inline toolbar + */ + plugin = editor.tools[tool]; + + if (!plugin.showInlineToolbar) return; + + var selectedText = inline.getSelectionText(), + toolbar = editor.nodes.inlineToolbar.wrapper; + + if (selectedText.length > 0) { + /** Move toolbar and open */ + editor.toolbar.inline.move(); + + /** Open inline toolbar */ + toolbar.classList.add('opened'); + + /** show buttons of inline toolbar */ + editor.toolbar.inline.showButtons(); + } + }; + + /** + * @protected + * + * Closes inline toolbar + */ + inline.close = function () { + var toolbar = editor.nodes.inlineToolbar.wrapper; + + toolbar.classList.remove('opened'); + }; + + /** + * @private + * + * Moving toolbar + */ + inline.move = function () { + if (!this.wrappersOffset) { + this.wrappersOffset = this.getWrappersOffset(); + } + + var coords = this.getSelectionCoords(), + defaultOffset = 0, + toolbar = editor.nodes.inlineToolbar.wrapper, + newCoordinateX, + newCoordinateY; + + if (toolbar.offsetHeight === 0) { + defaultOffset = 40; + } + + newCoordinateX = coords.x - this.wrappersOffset.left; + newCoordinateY = coords.y + window.scrollY - this.wrappersOffset.top - defaultOffset - toolbar.offsetHeight; + + toolbar.style.transform = 'translate3D(' + Math.floor(newCoordinateX) + 'px, ' + Math.floor(newCoordinateY) + 'px, 0)'; + + /** Close everything */ + editor.toolbar.inline.closeButtons(); + editor.toolbar.inline.closeAction(); + }; + + /** + * @private + * + * Tool Clicked + */ + + inline.toolClicked = function (event, type) { + /** + * For simple tools we use default browser function + * For more complicated tools, we should write our own behavior + */ + switch (type) { + case 'createLink': + editor.toolbar.inline.createLinkAction(event, type);break; + default: + editor.toolbar.inline.defaultToolAction(type);break; + } + + /** + * highlight buttons + * after making some action + */ + editor.nodes.inlineToolbar.buttons.childNodes.forEach(editor.toolbar.inline.hightlight); + }; + + /** + * @private + * + * Saving wrappers offset in DOM + */ + inline.getWrappersOffset = function () { + var wrapper = editor.nodes.wrapper, + offset = this.getOffset(wrapper); + + this.wrappersOffset = offset; + return offset; + }; + + /** + * @private + * + * Calculates offset of DOM element + * + * @param el + * @returns {{top: number, left: number}} + */ + inline.getOffset = function (el) { + var _x = 0; + var _y = 0; + + while (el && !isNaN(el.offsetLeft) && !isNaN(el.offsetTop)) { + _x += el.offsetLeft + el.clientLeft; + _y += el.offsetTop + el.clientTop; + el = el.offsetParent; + } + return { top: _y, left: _x }; + }; + + /** + * @private + * + * Calculates position of selected text + * @returns {{x: number, y: number}} + */ + inline.getSelectionCoords = function () { + var sel = document.selection, + range; + var x = 0, + y = 0; + + if (sel) { + if (sel.type != 'Control') { + range = sel.createRange(); + range.collapse(true); + x = range.boundingLeft; + y = range.boundingTop; + } + } else if (window.getSelection) { + sel = window.getSelection(); + + if (sel.rangeCount) { + range = sel.getRangeAt(0).cloneRange(); + if (range.getClientRects) { + range.collapse(true); + var rect = range.getClientRects()[0]; + + if (!rect) { + return; + } + + x = rect.left; + y = rect.top; + } + } + } + return { x: x, y: y }; + }; + + /** + * @private + * + * Returns selected text as String + * @returns {string} + */ + inline.getSelectionText = function () { + var selectedText = ''; + + // all modern browsers and IE9+ + if (window.getSelection) { + selectedText = window.getSelection().toString(); + } + + return selectedText; + }; + + /** Opens buttons block */ + inline.showButtons = function () { + var buttons = editor.nodes.inlineToolbar.buttons; + + buttons.classList.add('opened'); + + editor.toolbar.inline.buttonsOpened = true; + + /** highlight buttons */ + editor.nodes.inlineToolbar.buttons.childNodes.forEach(editor.toolbar.inline.hightlight); + }; + + /** Makes buttons disappear */ + inline.closeButtons = function () { + var buttons = editor.nodes.inlineToolbar.buttons; + + buttons.classList.remove('opened'); + + editor.toolbar.inline.buttonsOpened = false; + }; + + /** Open buttons defined action if exist */ + inline.showActions = function () { + var action = editor.nodes.inlineToolbar.actions; + + action.classList.add('opened'); + + editor.toolbar.inline.actionsOpened = true; + }; + + /** Close actions block */ + inline.closeAction = function () { + var action = editor.nodes.inlineToolbar.actions; + + action.innerHTML = ''; + action.classList.remove('opened'); + editor.toolbar.inline.actionsOpened = false; + }; + + /** + * Callback for keydowns in inline toolbar "Insert link..." input + */ + var inlineToolbarAnchorInputKeydown_ = function inlineToolbarAnchorInputKeydown_(event) { + if (event.keyCode != editor.core.keys.ENTER) { + return; + } + + var editable = editor.content.currentNode, + storedSelection = editor.toolbar.inline.storedSelection; + + editor.toolbar.inline.restoreSelection(editable, storedSelection); + editor.toolbar.inline.setAnchor(this.value); + + /** + * Preventing events that will be able to happen + */ + event.preventDefault(); + event.stopImmediatePropagation(); + + editor.toolbar.inline.clearRange(); + }; + + /** Action for link creation or for setting anchor */ + inline.createLinkAction = function (event) { + var isActive = this.isLinkActive(); + + var editable = editor.content.currentNode, + storedSelection = editor.toolbar.inline.saveSelection(editable); + + /** Save globally selection */ + editor.toolbar.inline.storedSelection = storedSelection; + + if (isActive) { + /** + * Changing stored selection. if we want to remove anchor from word + * we should remove anchor from whole word, not only selected part. + * The solution is than we get the length of current link + * Change start position to - end of selection minus length of anchor + */ + editor.toolbar.inline.restoreSelection(editable, storedSelection); + + editor.toolbar.inline.defaultToolAction('unlink'); + } else { + /** Create input and close buttons */ + var action = editor.draw.inputForLink(); + + editor.nodes.inlineToolbar.actions.appendChild(action); + + editor.toolbar.inline.closeButtons(); + editor.toolbar.inline.showActions(); + + /** + * focus to input + * Solution: https://developer.mozilla.org/ru/docs/Web/API/HTMLElement/focus + * Prevents event after showing input and when we need to focus an input which is in unexisted form + */ + action.focus(); + event.preventDefault(); + + /** Callback to link action */ + editor.listeners.add(action, 'keydown', inlineToolbarAnchorInputKeydown_, false); + } + }; + + inline.isLinkActive = function () { + var isActive = false; + + editor.nodes.inlineToolbar.buttons.childNodes.forEach(function (tool) { + var dataType = tool.dataset.type; + + if (dataType == 'link' && tool.classList.contains('hightlighted')) { + isActive = true; + } + }); + + return isActive; + }; + + /** default action behavior of tool */ + inline.defaultToolAction = function (type) { + document.execCommand(type, false, null); + }; + + /** + * @private + * + * Sets URL + * + * @param {String} url - URL + */ + inline.setAnchor = function (url) { + document.execCommand('createLink', false, url); + + /** Close after URL inserting */ + editor.toolbar.inline.closeAction(); + }; + + /** + * @private + * + * Saves selection + */ + inline.saveSelection = function (containerEl) { + var range = window.getSelection().getRangeAt(0), + preSelectionRange = range.cloneRange(), + start; + + preSelectionRange.selectNodeContents(containerEl); + preSelectionRange.setEnd(range.startContainer, range.startOffset); + + start = preSelectionRange.toString().length; + + return { + start: start, + end: start + range.toString().length + }; + }; + + /** + * @private + * + * Sets to previous selection (Range) + * + * @param {Element} containerEl - editable element where we restore range + * @param {Object} savedSel - range basic information to restore + */ + inline.restoreSelection = function (containerEl, savedSel) { + var range = document.createRange(), + charIndex = 0; + + range.setStart(containerEl, 0); + range.collapse(true); + + var nodeStack = [containerEl], + node, + foundStart = false, + stop = false, + nextCharIndex; + + while (!stop && (node = nodeStack.pop())) { + if (node.nodeType == 3) { + nextCharIndex = charIndex + node.length; + + if (!foundStart && savedSel.start >= charIndex && savedSel.start <= nextCharIndex) { + range.setStart(node, savedSel.start - charIndex); + foundStart = true; + } + if (foundStart && savedSel.end >= charIndex && savedSel.end <= nextCharIndex) { + range.setEnd(node, savedSel.end - charIndex); + stop = true; + } + charIndex = nextCharIndex; + } else { + var i = node.childNodes.length; + + while (i--) { + nodeStack.push(node.childNodes[i]); + } + } + } + + var sel = window.getSelection(); + + sel.removeAllRanges(); + sel.addRange(range); + }; + + /** + * @private + * + * Removes all ranges from window selection + */ + inline.clearRange = function () { + var selection = window.getSelection(); + + selection.removeAllRanges(); + }; + + /** + * @private + * + * sets or removes hightlight + */ + inline.hightlight = function (tool) { + var dataType = tool.dataset.type; + + if (document.queryCommandState(dataType)) { + editor.toolbar.inline.setButtonHighlighted(tool); + } else { + editor.toolbar.inline.removeButtonsHighLight(tool); + } + + /** + * + * hightlight for anchors + */ + var selection = window.getSelection(), + tag = selection.anchorNode.parentNode; + + if (tag.tagName == 'A' && dataType == 'link') { + editor.toolbar.inline.setButtonHighlighted(tool); + } + }; + + /** + * @private + * + * Mark button if text is already executed + */ + inline.setButtonHighlighted = function (button) { + button.classList.add('hightlighted'); + + /** At link tool we also change icon */ + if (button.dataset.type == 'link') { + var icon = button.childNodes[0]; + + icon.classList.remove('ce-icon-link'); + icon.classList.add('ce-icon-unlink'); + } + }; + + /** + * @private + * + * Removes hightlight + */ + inline.removeButtonsHighLight = function (button) { + button.classList.remove('hightlighted'); + + /** At link tool we also change icon */ + if (button.dataset.type == 'link') { + var icon = button.childNodes[0]; + + icon.classList.remove('ce-icon-unlink'); + icon.classList.add('ce-icon-link'); + } + }; + + return inline; +}({}); + +/***/ }), + +/***/ "./src/components/modules/toolbar/settings.js": +/*!****************************************************!*\ + !*** ./src/components/modules/toolbar/settings.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Toolbar settings + * + * @version 1.0.5 + */ + +module.exports = function (settings) { + var editor = codex.editor; + + settings.opened = false; + + settings.setting = null; + settings.actions = null; + + /** + * Append and open settings + */ + settings.open = function (toolType) { + /** + * Append settings content + * It's stored in tool.settings + */ + if (!editor.tools[toolType] || !editor.tools[toolType].renderSettings) { + return; + } + + /** + * Draw settings block + */ + var settingsBlock = editor.tools[toolType].renderSettings(); + + editor.nodes.pluginSettings.appendChild(settingsBlock); + + /** Open settings block */ + editor.nodes.blockSettings.classList.add('opened'); + this.opened = true; + }; + + /** + * Close and clear settings + */ + settings.close = function () { + editor.nodes.blockSettings.classList.remove('opened'); + editor.nodes.pluginSettings.innerHTML = ''; + + this.opened = false; + }; + + /** + * @param {string} toolType - plugin type + */ + settings.toggle = function (toolType) { + if (!this.opened) { + this.open(toolType); + } else { + this.close(); + } + }; + + /** + * Here we will draw buttons and add listeners to components + */ + settings.makeRemoveBlockButton = function () { + var removeBlockWrapper = editor.draw.node('SPAN', 'ce-toolbar__remove-btn', {}), + settingButton = editor.draw.node('SPAN', 'ce-toolbar__remove-setting', { innerHTML: '' }), + actionWrapper = editor.draw.node('DIV', 'ce-toolbar__remove-confirmation', {}), + confirmAction = editor.draw.node('DIV', 'ce-toolbar__remove-confirm', { textContent: 'Удалить блок' }), + cancelAction = editor.draw.node('DIV', 'ce-toolbar__remove-cancel', { textContent: 'Отмена' }); + + editor.listeners.add(settingButton, 'click', editor.toolbar.settings.removeButtonClicked, false); + + editor.listeners.add(confirmAction, 'click', editor.toolbar.settings.confirmRemovingRequest, false); + + editor.listeners.add(cancelAction, 'click', editor.toolbar.settings.cancelRemovingRequest, false); + + actionWrapper.appendChild(confirmAction); + actionWrapper.appendChild(cancelAction); + + removeBlockWrapper.appendChild(settingButton); + removeBlockWrapper.appendChild(actionWrapper); + + /** Save setting */ + editor.toolbar.settings.setting = settingButton; + editor.toolbar.settings.actions = actionWrapper; + + return removeBlockWrapper; + }; + + settings.removeButtonClicked = function () { + var action = editor.toolbar.settings.actions; + + if (action.classList.contains('opened')) { + editor.toolbar.settings.hideRemoveActions(); + } else { + editor.toolbar.settings.showRemoveActions(); + } + + editor.toolbar.toolbox.close(); + editor.toolbar.settings.close(); + }; + + settings.cancelRemovingRequest = function () { + editor.toolbar.settings.actions.classList.remove('opened'); + }; + + settings.confirmRemovingRequest = function () { + var currentBlock = editor.content.currentNode, + firstLevelBlocksCount; + + currentBlock.remove(); + + firstLevelBlocksCount = editor.nodes.redactor.childNodes.length; + + /** + * If all blocks are removed + */ + if (firstLevelBlocksCount === 0) { + /** update currentNode variable */ + editor.content.currentNode = null; + + /** Inserting new empty initial block */ + editor.ui.addInitialBlock(); + } + + editor.ui.saveInputs(); + + editor.toolbar.close(); + }; + + settings.showRemoveActions = function () { + editor.toolbar.settings.actions.classList.add('opened'); + }; + + settings.hideRemoveActions = function () { + editor.toolbar.settings.actions.classList.remove('opened'); + }; + + return settings; +}({}); + +/***/ }), + +/***/ "./src/components/modules/toolbar/toolbar.js": +/*!***************************************************!*\ + !*** ./src/components/modules/toolbar/toolbar.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Codex Editor toolbar module + * + * Contains: + * - Inline toolbox + * - Toolbox within plus button + * - Settings section + * + * @author Codex Team + * @version 1.0 + */ + +module.exports = function (toolbar) { + var editor = codex.editor; + + toolbar.settings = __webpack_require__(/*! ./settings */ "./src/components/modules/toolbar/settings.js"); + toolbar.inline = __webpack_require__(/*! ./inline */ "./src/components/modules/toolbar/inline.js"); + toolbar.toolbox = __webpack_require__(/*! ./toolbox */ "./src/components/modules/toolbar/toolbox.js"); + + /** + * Margin between focused node and toolbar + */ + toolbar.defaultToolbarHeight = 49; + + toolbar.defaultOffset = 34; + + toolbar.opened = false; + + toolbar.current = null; + + /** + * @protected + */ + toolbar.open = function () { + if (editor.hideToolbar) { + return; + } + + var toolType = editor.content.currentNode.dataset.tool; + + if (!editor.tools[toolType] || !editor.tools[toolType].renderSettings) { + editor.nodes.showSettingsButton.classList.add('hide'); + } else { + editor.nodes.showSettingsButton.classList.remove('hide'); + } + + editor.nodes.toolbar.classList.add('opened'); + this.opened = true; + }; + + /** + * @protected + */ + toolbar.close = function () { + editor.nodes.toolbar.classList.remove('opened'); + + toolbar.opened = false; + toolbar.current = null; + + for (var button in editor.nodes.toolbarButtons) { + editor.nodes.toolbarButtons[button].classList.remove('selected'); + } + + /** Close toolbox when toolbar is not displayed */ + editor.toolbar.toolbox.close(); + editor.toolbar.settings.close(); + }; + + toolbar.toggle = function () { + if (!this.opened) { + this.open(); + } else { + this.close(); + } + }; + + toolbar.hidePlusButton = function () { + editor.nodes.plusButton.classList.add('hide'); + }; + + toolbar.showPlusButton = function () { + editor.nodes.plusButton.classList.remove('hide'); + }; + + /** + * Moving toolbar to the specified node + */ + toolbar.move = function () { + /** Close Toolbox when we move toolbar */ + editor.toolbar.toolbox.close(); + + if (!editor.content.currentNode) { + return; + } + + var newYCoordinate = editor.content.currentNode.offsetTop - editor.toolbar.defaultToolbarHeight / 2 + editor.toolbar.defaultOffset; + + editor.nodes.toolbar.style.transform = 'translate3D(0, ' + Math.floor(newYCoordinate) + 'px, 0)'; + + /** Close trash actions */ + editor.toolbar.settings.hideRemoveActions(); + }; + + return toolbar; +}({}); + +/***/ }), + +/***/ "./src/components/modules/toolbar/toolbox.js": +/*!***************************************************!*\ + !*** ./src/components/modules/toolbar/toolbox.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Codex Editor toolbox + * + * All tools be able to appended here + * + * @author Codex Team + * @version 1.0 + */ + +module.exports = function (toolbox) { + var editor = codex.editor; + + toolbox.opened = false; + toolbox.openedOnBlock = null; + + /** Shows toolbox */ + toolbox.open = function () { + /** Close setting if toolbox is opened */ + if (editor.toolbar.settings.opened) { + editor.toolbar.settings.close(); + } + + /** Add 'toolbar-opened' class for current block **/ + toolbox.openedOnBlock = editor.content.currentNode; + toolbox.openedOnBlock.classList.add('toolbar-opened'); + + /** display toolbox */ + editor.nodes.toolbox.classList.add('opened'); + + /** Animate plus button */ + editor.nodes.plusButton.classList.add('clicked'); + + /** toolbox state */ + editor.toolbar.toolbox.opened = true; + }; + + /** Closes toolbox */ + toolbox.close = function () { + /** Remove 'toolbar-opened' class from current block **/ + if (toolbox.openedOnBlock) toolbox.openedOnBlock.classList.remove('toolbar-opened'); + toolbox.openedOnBlock = null; + + /** Makes toolbox disappear */ + editor.nodes.toolbox.classList.remove('opened'); + + /** Rotate plus button */ + editor.nodes.plusButton.classList.remove('clicked'); + + /** toolbox state */ + editor.toolbar.toolbox.opened = false; + + editor.toolbar.current = null; + }; + + toolbox.leaf = function () { + var currentTool = editor.toolbar.current, + tools = Object.keys(editor.tools), + barButtons = editor.nodes.toolbarButtons, + nextToolIndex = 0, + toolToSelect = void 0, + visibleTool = void 0, + tool = void 0; + + if (!currentTool) { + /** Get first tool from object*/ + for (tool in editor.tools) { + if (editor.tools[tool].displayInToolbox) { + break; + } + + nextToolIndex++; + } + } else { + nextToolIndex = (tools.indexOf(currentTool) + 1) % tools.length; + visibleTool = tools[nextToolIndex]; + + while (!editor.tools[visibleTool].displayInToolbox) { + nextToolIndex = (nextToolIndex + 1) % tools.length; + visibleTool = tools[nextToolIndex]; + } + } + + toolToSelect = tools[nextToolIndex]; + + for (var button in barButtons) { + barButtons[button].classList.remove('selected'); + } + + barButtons[toolToSelect].classList.add('selected'); + editor.toolbar.current = toolToSelect; + }; + + /** + * Transforming selected node type into selected toolbar element type + * @param {event} event + */ + toolbox.toolClicked = function (event) { + /** + * UNREPLACEBLE_TOOLS this types of tools are forbidden to replace even they are empty + */ + var UNREPLACEBLE_TOOLS = ['image', 'link', 'list', 'instagram', 'twitter', 'embed'], + tool = editor.tools[editor.toolbar.current], + workingNode = editor.content.currentNode, + currentInputIndex = editor.caret.inputIndex, + newBlockContent, + appendCallback, + blockData; + + /** Make block from plugin */ + newBlockContent = tool.render(); + + /** information about block */ + blockData = { + block: newBlockContent, + type: tool.type, + stretched: false + }; + + if (workingNode && UNREPLACEBLE_TOOLS.indexOf(workingNode.dataset.tool) === -1 && workingNode.textContent.trim() === '') { + /** Replace current block */ + editor.content.switchBlock(workingNode, newBlockContent, tool.type); + } else { + /** Insert new Block from plugin */ + editor.content.insertBlock(blockData); + + /** increase input index */ + currentInputIndex++; + } + + /** Fire tool append callback */ + appendCallback = tool.appendCallback; + + if (appendCallback && typeof appendCallback == 'function') { + appendCallback.call(event); + } + + window.setTimeout(function () { + /** Set caret to current block */ + editor.caret.setToBlock(currentInputIndex); + }, 10); + + /** + * Changing current Node + */ + editor.content.workingNodeChanged(); + + /** + * Move toolbar when node is changed + */ + editor.toolbar.move(); + }; + + return toolbox; +}({}); + +/***/ }), + +/***/ "./src/components/modules/tools.js": +/*!*****************************************!*\ + !*** ./src/components/modules/tools.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +/** + * @module Codex Editor Tools Submodule + * + * Creates Instances from Plugins and binds external config to the instances + */ + +/** + * Each Tool must contain the following important objects: + * + * @typedef {Object} ToolConfig {@link docs/tools.md} + * @property {String} iconClassname - this a icon in toolbar + * @property {Boolean} displayInToolbox - will be displayed in toolbox. Default value is TRUE + * @property {Boolean} enableLineBreaks - inserts new block or break lines. Default value is FALSE + * @property {Boolean|String[]} inlineToolbar - Pass `true` to enable the Inline Toolbar with all Tools, all pass an array with specified Tools list | + * @property render @todo add description + * @property save @todo add description + * @property settings @todo add description + * @property validate - method that validates output data before saving + */ + +/** + * @typedef {Function} Tool {@link docs/tools.md} + * @property {Boolean} displayInToolbox - By default, tools won't be added in the Toolbox. Pass true to add. + * @property {String} iconClassName - CSS class name for the Toolbox button + * @property {Boolean} irreplaceable - Toolbox behaviour: replace or add new block below + * @property render + * @property save + * @property settings + * @property validate + * + * @todo update according to current API + * @todo describe Tool in the {@link docs/tools.md} + */ + +/** + * Class properties: + * + * @typedef {Tools} Tools + * @property {Tools[]} toolsAvailable - available Tools + * @property {Tools[]} toolsUnavailable - unavailable Tools + * @property {Object} toolsClasses - all classes + * @property {EditorConfig} config - Editor config + */ +var Tools = function (_Module) { + _inherits(Tools, _Module); + + _createClass(Tools, [{ + key: 'available', + + /** + * Returns available Tools + * @return {Tool[]} + */ + get: function get() { + return this.toolsAvailable; + } + + /** + * Returns unavailable Tools + * @return {Tool[]} + */ + + }, { + key: 'unavailable', + get: function get() { + return this.toolsUnavailable; + } + + /** + * Return Tools for the Inline Toolbar + * @return {Array} - array of Inline Tool's classes + */ + + }, { + key: 'inline', + get: function get() { + var _this2 = this; + + return Object.values(this.available).filter(function (tool) { + if (!tool[_this2.apiSettings.IS_INLINE]) { + return false; + } + + /** + * Some Tools validation + */ + var inlineToolRequiredMethods = ['render', 'surround', 'checkState']; + var notImplementedMethods = inlineToolRequiredMethods.filter(function (method) { + return !new tool()[method]; + }); + + if (notImplementedMethods.length) { + _.log('Incorrect Inline Tool: ' + tool.name + '. Some of required methods is not implemented %o', 'warn', notImplementedMethods); + return false; + } + + return true; + }); + } + + /** + * Return editor block tools + */ + + }, { + key: 'blockTools', + get: function get() { + var _this3 = this; + + // eslint-disable-next-line no-unused-vars + var tools = Object.entries(this.available).filter(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + name = _ref2[0], + tool = _ref2[1]; + + if (tool[_this3.apiSettings.IS_INLINE]) { + return false; + } + + return true; + }); + + var result = {}; + + tools.forEach(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 2), + name = _ref4[0], + tool = _ref4[1]; + + return result[name] = tool; + }); + + return result; + } + + /** + * Constant for available Tools Settings + * @return {object} + */ + + }, { + key: 'apiSettings', + get: function get() { + return { + IS_INLINE: 'isInline', + TOOLBAR_ICON_CLASS: 'iconClassName', + IS_DISPLAYED_IN_TOOLBOX: 'displayInToolbox', + IS_ENABLED_LINE_BREAKS: 'enableLineBreaks', + IS_IRREPLACEBLE_TOOL: 'irreplaceable', + IS_ENABLED_INLINE_TOOLBAR: 'inlineToolbar', + IS_PASTE_DISALLOWED: 'disallowPaste' + }; + } + + /** + * Static getter for default Tool config fields + * @return {ToolConfig} + */ + + }, { + key: 'defaultConfig', + get: function get() { + var _ref5; + + return _ref5 = {}, _defineProperty(_ref5, this.apiSettings.TOOLBAR_ICON_CLASS, false), _defineProperty(_ref5, this.apiSettings.IS_DISPLAYED_IN_TOOLBOX, false), _defineProperty(_ref5, this.apiSettings.IS_ENABLED_LINE_BREAKS, false), _defineProperty(_ref5, this.apiSettings.IS_IRREPLACEBLE_TOOL, false), _defineProperty(_ref5, this.apiSettings.IS_ENABLED_INLINE_TOOLBAR, false), _ref5; + } + + /** + * @constructor + * + * @param {EditorConfig} config + */ + + }]); + + function Tools(_ref6) { + var config = _ref6.config; + + _classCallCheck(this, Tools); + + /** + * Map {name: Class, ...} where: + * name — block type name in JSON. Got from EditorConfig.tools keys + * @type {Object} + */ + var _this = _possibleConstructorReturn(this, (Tools.__proto__ || Object.getPrototypeOf(Tools)).call(this, { config: config })); + + _this.toolClasses = {}; + + /** + * Available tools list + * {name: Class, ...} + * @type {Object} + */ + _this.toolsAvailable = {}; + + /** + * Tools that rejected a prepare method + * {name: Class, ... } + * @type {Object} + */ + _this.toolsUnavailable = {}; + return _this; + } + + /** + * Creates instances via passed or default configuration + * @return {Promise} + */ + + + _createClass(Tools, [{ + key: 'prepare', + value: function prepare() { + var _this4 = this; + + if (!this.config.hasOwnProperty('tools')) { + return Promise.reject("Can't start without tools"); + } + + for (var toolName in this.config.tools) { + this.toolClasses[toolName] = this.config.tools[toolName]; + } + + /** + * getting classes that has prepare method + */ + var sequenceData = this.getListOfPrepareFunctions(); + + /** + * if sequence data contains nothing then resolve current chain and run other module prepare + */ + if (sequenceData.length === 0) { + return Promise.resolve(); + } + + /** + * to see how it works {@link Util#sequence} + */ + return _.sequence(sequenceData, function (data) { + _this4.success(data); + }, function (data) { + _this4.fallback(data); + }); + } + + /** + * Binds prepare function of plugins with user or default config + * @return {Array} list of functions that needs to be fired sequentially + */ + + }, { + key: 'getListOfPrepareFunctions', + value: function getListOfPrepareFunctions() { + var toolPreparationList = []; + + for (var toolName in this.toolClasses) { + var toolClass = this.toolClasses[toolName]; + + if (typeof toolClass.prepare === 'function') { + toolPreparationList.push({ + function: toolClass.prepare, + data: { + toolName: toolName + } + }); + } else { + /** + * If Tool hasn't a prepare method, mark it as available + */ + this.toolsAvailable[toolName] = toolClass; + } + } + + return toolPreparationList; + } + + /** + * @param {ChainData.data} data - append tool to available list + */ + + }, { + key: 'success', + value: function success(data) { + this.toolsAvailable[data.toolName] = this.toolClasses[data.toolName]; + } + + /** + * @param {ChainData.data} data - append tool to unavailable list + */ + + }, { + key: 'fallback', + value: function fallback(data) { + this.toolsUnavailable[data.toolName] = this.toolClasses[data.toolName]; + } + + /** + * Return tool`a instance + * + * @param {String} tool — tool name + * @param {Object} data — initial data + * + * @todo throw exceptions if tool doesnt exist + * + */ + + }, { + key: 'construct', + value: function construct(tool, data) { + var plugin = this.toolClasses[tool], + config = this.config.toolsConfig[tool]; + + var instance = new plugin(data, config || {}); + + return instance; + } + + /** + * Check if passed Tool is an instance of Initial Block Tool + * @param {Tool} tool - Tool to check + * @return {Boolean} + */ + + }, { + key: 'isInitial', + value: function isInitial(tool) { + return tool instanceof this.available[this.config.initialBlock]; + } + }]); + + return Tools; +}(Module); + +Tools.displayName = 'Tools'; +exports.default = Tools; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/modules/ui.js": +/*!**************************************!*\ + !*** ./src/components/modules/ui.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(Module, $, _) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _sprite = __webpack_require__(/*! ../../../build/sprite.svg */ "./build/sprite.svg"); + +var _sprite2 = _interopRequireDefault(_sprite); + +var _selection = __webpack_require__(/*! ../selection */ "./src/components/selection.js"); + +var _selection2 = _interopRequireDefault(_selection); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /** + * Module UI + * + * @type {UI} + */ + +/** + * Prebuilded sprite of SVG icons + */ + + +/** + * @class + * + * @classdesc Makes CodeX Editor UI: + * + * + * + * + * + * + * @typedef {UI} UI + * @property {EditorConfig} config - editor configuration {@link CodexEditor#configuration} + * @property {Object} Editor - available editor modules {@link CodexEditor#moduleInstances} + * @property {Object} nodes - + * @property {Element} nodes.holder - element where we need to append redactor + * @property {Element} nodes.wrapper - + * @property {Element} nodes.redactor - + */ +var UI = function (_Module) { + _inherits(UI, _Module); + + /** + * @constructor + * + * @param {EditorConfig} config + */ + function UI(_ref) { + var config = _ref.config; + + _classCallCheck(this, UI); + + var _this = _possibleConstructorReturn(this, (UI.__proto__ || Object.getPrototypeOf(UI)).call(this, { config: config })); + + _this.nodes = { + holder: null, + wrapper: null, + redactor: null + }; + return _this; + } + + /** + * Making main interface + */ + + + _createClass(UI, [{ + key: 'prepare', + value: function () { + var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { + return regeneratorRuntime.wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return this.make(); + + case 2: + _context.next = 4; + return this.appendSVGSprite(); + + case 4: + _context.next = 6; + return this.Editor.Toolbar.make(); + + case 6: + _context.next = 8; + return this.Editor.InlineToolbar.make(); + + case 8: + _context.next = 10; + return this.loadStyles(); + + case 10: + _context.next = 12; + return this.bindEvents(); + + case 12: + case 'end': + return _context.stop(); + } + } + }, _callee, this); + })); + + function prepare() { + return _ref2.apply(this, arguments); + } + + return prepare; + }() + + /** + * CodeX Editor UI CSS class names + * @return {{editorWrapper: string, editorZone: string, block: string}} + */ + + }, { + key: 'make', + + + /** + * Makes CodeX Editor interface + * @return {Promise} + */ + value: function () { + var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { + return regeneratorRuntime.wrap(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + /** + * Element where we need to append CodeX Editor + * @type {Element} + */ + this.nodes.holder = document.getElementById(this.config.holderId); + + if (this.nodes.holder) { + _context2.next = 3; + break; + } + + throw Error("Holder wasn't found by ID: #" + this.config.holderId); + + case 3: + + /** + * Create and save main UI elements + */ + this.nodes.wrapper = $.make('div', this.CSS.editorWrapper); + this.nodes.redactor = $.make('div', this.CSS.editorZone); + + this.nodes.wrapper.appendChild(this.nodes.redactor); + this.nodes.holder.appendChild(this.nodes.wrapper); + + case 7: + case 'end': + return _context2.stop(); + } + } + }, _callee2, this); + })); + + function make() { + return _ref3.apply(this, arguments); + } + + return make; + }() + + /** + * Appends CSS + */ + + }, { + key: 'loadStyles', + value: function loadStyles() { + /** + * Load CSS + */ + var styles = __webpack_require__(/*! ../../styles/main.css */ "./src/styles/main.css"); + + /** + * Make tag + */ + var tag = $.make('style', null, { + textContent: styles.toString() + }); + + /** + * Append styles + */ + $.append(document.head, tag); + } + + /** + * Bind events on the CodeX Editor interface + */ + + }, { + key: 'bindEvents', + value: function bindEvents() { + var _this2 = this; + + this.Editor.Listeners.on(this.nodes.redactor, 'click', function (event) { + return _this2.redactorClicked(event); + }, false); + this.Editor.Listeners.on(document, 'keydown', function (event) { + return _this2.documentKeydown(event); + }, true); + this.Editor.Listeners.on(document, 'click', function (event) { + return _this2.documentClicked(event); + }, false); + } + + /** + * All keydowns on document + * @param event + */ + + }, { + key: 'documentKeydown', + value: function documentKeydown(event) { + switch (event.keyCode) { + case _.keyCodes.ENTER: + this.enterPressed(event); + break; + + default: + this.defaultBehaviour(event); + break; + } + } + + /** + * Ignore all other document's keydown events + * @param {KeyboardEvent} event + */ + + }, { + key: 'defaultBehaviour', + value: function defaultBehaviour(event) { + var keyDownOnEditor = event.target.closest('.' + this.CSS.editorWrapper); + + /** + * Ignore keydowns on document + * clear pointer and close toolbar + */ + if (!keyDownOnEditor) { + /** + * Remove all highlights and remove caret + */ + this.Editor.BlockManager.dropPointer(); + + /** + * Close Toolbar + */ + this.Editor.Toolbar.close(); + } + } + + /** + * Enter pressed on document + * @param event + */ + + }, { + key: 'enterPressed', + value: function enterPressed(event) { + var hasPointerToBlock = this.Editor.BlockManager.currentBlockIndex >= 0; + + /** + * If Selection is out of Editor and document has some selection + */ + if (!_selection2.default.isAtEditor && _selection2.default.anchorNode) { + return; + } + + /** + * If there is no selection (caret is not placed) and BlockManager points some to Block + */ + if (hasPointerToBlock && !_selection2.default.anchorNode) { + /** + * Insert initial typed Block + */ + this.Editor.BlockManager.insert(); + this.Editor.BlockManager.highlightCurrentNode(); + + /** + * Move toolbar and show plus button because new Block is empty + */ + this.Editor.Toolbar.move(); + this.Editor.Toolbar.plusButton.show(); + } + } + + /** + * All clicks on document + * @param {MouseEvent} event - Click + */ + + }, { + key: 'documentClicked', + value: function documentClicked(event) { + /** + * Close Inline Toolbar when nothing selected + * Do not fire check on clicks at the Inline Toolbar buttons + */ + var clickedOnInlineToolbarButton = event.target.closest('.' + this.Editor.InlineToolbar.CSS.inlineToolbar); + var clickedInsideofEditor = event.target.closest('.' + this.CSS.editorWrapper); + + /** Clear highlightings and pointer on BlockManager */ + if (!clickedInsideofEditor) { + this.Editor.BlockManager.dropPointer(); + this.Editor.Toolbar.close(); + } + + if (!clickedOnInlineToolbarButton) { + this.Editor.InlineToolbar.handleShowingEvent(event); + } + } + + /** + * All clicks on the redactor zone + * + * @param {MouseEvent} event + * + * @description + * 1. Save clicked Block as a current {@link BlockManager#currentNode} + * it uses for the following: + * - add CSS modifier for the selected Block + * - on Enter press, we make a new Block under that + * + * 2. Move and show the Toolbar + * + * 3. Set a Caret + * + * 4. By clicks on the Editor's bottom zone: + * - if last Block is empty, set a Caret to this + * - otherwise, add a new empty Block and set a Caret to that + * + * 5. Hide the Inline Toolbar + * + * @see selectClickedBlock + * + */ + + }, { + key: 'redactorClicked', + value: function redactorClicked(event) { + var clickedNode = event.target; + + /** + * Select clicked Block as Current + */ + try { + /** + * Renew Current Block + */ + this.Editor.BlockManager.setCurrentBlockByChildNode(clickedNode); + + /** + * Highlight Current Node + */ + this.Editor.BlockManager.highlightCurrentNode(); + } catch (e) { + /** + * If clicked outside first-level Blocks, set Caret to the last empty Block + */ + this.Editor.Caret.setToTheLastBlock(); + } + + /** + * Move toolbar and open + */ + this.Editor.Toolbar.move(); + this.Editor.Toolbar.open(); + + /** + * Hide the Plus Button + * */ + this.Editor.Toolbar.plusButton.hide(); + + /** + * Show the Plus Button if: + * - Block is an initial-block (Text) + * - Block is empty + */ + var isInitialBlock = this.Editor.Tools.isInitial(this.Editor.BlockManager.currentBlock.tool), + isEmptyBlock = this.Editor.BlockManager.currentBlock.isEmpty; + + if (isInitialBlock && isEmptyBlock) { + this.Editor.Toolbar.plusButton.show(); + } + } + + /** + * Append prebuilded sprite with SVG icons + */ + + }, { + key: 'appendSVGSprite', + value: function appendSVGSprite() { + var spriteHolder = $.make('div'); + + spriteHolder.innerHTML = _sprite2.default; + + $.append(this.nodes.wrapper, spriteHolder); + } + }, { + key: 'CSS', + get: function get() { + return { + editorWrapper: 'codex-editor', + editorZone: 'codex-editor__redactor' + }; + } + }]); + + return UI; +}(Module); + +// /** +// * Codex Editor UI module +// * +// * @author Codex Team +// * @version 1.2.0 +// */ +// +// module.exports = (function (ui) { +// +// let editor = codex.editor; +// +// /** +// * Basic editor classnames +// */ +// ui.prepare = function () { +// + +// +// }; +// +// /** Draw notifications holder */ +// var makeNotificationHolder_ = function () { +// +// /** Append block with notifications to the document */ +// editor.nodes.notifications = editor.notifications.createHolder(); +// +// }; +// +// +// var addInlineToolbarTools_ = function () { +// +// var tools = { +// +// bold: { +// icon : 'ce-icon-bold', +// command : 'bold' +// }, +// +// italic: { +// icon : 'ce-icon-italic', +// command : 'italic' +// }, +// +// link: { +// icon : 'ce-icon-link', +// command : 'createLink' +// } +// }; +// +// var toolButton, +// tool; +// +// for(var name in tools) { +// +// tool = tools[name]; +// +// toolButton = editor.draw.toolbarButtonInline(name, tool.icon); +// +// editor.nodes.inlineToolbar.buttons.appendChild(toolButton); +// /** +// * Add callbacks to this buttons +// */ +// editor.ui.setInlineToolbarButtonBehaviour(toolButton, tool.command); +// +// } +// +// }; +// +// /** +// * @private +// * Bind editor UI events +// */ +// var bindEvents_ = function () { +// +// editor.core.log('ui.bindEvents fired', 'info'); +// +// // window.addEventListener('error', function (errorMsg, url, lineNumber) { +// // editor.notifications.errorThrown(errorMsg, event); +// // }, false ); +// +// /** All keydowns on Document */ +// editor.listeners.add(document, 'keydown', editor.callback.globalKeydown, false); +// +// /** All keydowns on Redactor zone */ +// editor.listeners.add(editor.nodes.redactor, 'keydown', editor.callback.redactorKeyDown, false); +// +// /** All keydowns on Document */ +// editor.listeners.add(document, 'keyup', editor.callback.globalKeyup, false ); +// +// /** +// * Mouse click to radactor +// */ +// editor.listeners.add(editor.nodes.redactor, 'click', editor.callback.redactorClicked, false ); +// +// /** +// * Clicks to the Plus button +// */ +// editor.listeners.add(editor.nodes.plusButton, 'click', editor.callback.plusButtonClicked, false); +// +// /** +// * Clicks to SETTINGS button in toolbar +// */ +// editor.listeners.add(editor.nodes.showSettingsButton, 'click', editor.callback.showSettingsButtonClicked, false ); +// +// /** Bind click listeners on toolbar buttons */ +// for (var button in editor.nodes.toolbarButtons) { +// +// editor.listeners.add(editor.nodes.toolbarButtons[button], 'click', editor.callback.toolbarButtonClicked, false); +// +// } +// +// }; +// +// ui.addBlockHandlers = function (block) { +// +// if (!block) return; +// +// /** +// * Block keydowns +// */ +// editor.listeners.add(block, 'keydown', editor.callback.blockKeydown, false); +// +// /** +// * Pasting content from another source +// * We have two type of sanitization +// * First - uses deep-first search algorithm to get sub nodes, +// * sanitizes whole Block_content and replaces cleared nodes +// * This method is deprecated +// * Method is used in editor.callback.blockPaste(event) +// * +// * Secont - uses Mutation observer. +// * Observer "observe" DOM changes and send changings to callback. +// * Callback gets changed node, not whole Block_content. +// * Inserted or changed node, which we've gotten have been cleared and replaced with diry node +// * +// * Method is used in editor.callback.blockPasteViaSanitize(event) +// * +// * @uses html-janitor +// * @example editor.callback.blockPasteViaSanitize(event), the second method. +// * +// */ +// editor.listeners.add(block, 'paste', editor.paste.blockPasteCallback, false); +// +// /** +// * Show inline toolbar for selected text +// */ +// editor.listeners.add(block, 'mouseup', editor.toolbar.inline.show, false); +// editor.listeners.add(block, 'keyup', editor.toolbar.inline.show, false); +// +// }; +// +// /** getting all contenteditable elements */ +// ui.saveInputs = function () { +// +// var redactor = editor.nodes.redactor; +// +// editor.state.inputs = []; +// +// /** Save all inputs in global variable state */ +// var inputs = redactor.querySelectorAll('[contenteditable], input, textarea'); +// +// Array.prototype.map.call(inputs, function (current) { +// +// if (!current.type || current.type == 'text' || current.type == 'textarea') { +// +// editor.state.inputs.push(current); +// +// } +// +// }); +// +// }; +// +// /** +// * Adds first initial block on empty redactor +// */ +// ui.addInitialBlock = function () { +// +// var initialBlockType = editor.settings.initialBlockPlugin, +// initialBlock; +// +// if ( !editor.tools[initialBlockType] ) { +// +// editor.core.log('Plugin %o was not implemented and can\'t be used as initial block', 'warn', initialBlockType); +// return; +// +// } +// +// initialBlock = editor.tools[initialBlockType].render(); +// +// initialBlock.setAttribute('data-placeholder', editor.settings.placeholder); +// +// editor.content.insertBlock({ +// type : initialBlockType, +// block : initialBlock +// }); +// +// editor.content.workingNodeChanged(initialBlock); +// +// }; +// +// ui.setInlineToolbarButtonBehaviour = function (button, type) { +// +// editor.listeners.add(button, 'mousedown', function (event) { +// +// editor.toolbar.inline.toolClicked(event, type); +// +// }, false); +// +// }; +// +// return ui; +// +// })({}); + + +UI.displayName = 'UI'; +exports.default = UI; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../__module.ts */ "./src/components/__module.ts"), __webpack_require__(/*! dom */ "./src/components/dom.js"), __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/polyfills.js": +/*!*************************************!*\ + !*** ./src/components/polyfills.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * Element.closest() + * + * https://developer.mozilla.org/en-US/docs/Web/API/Element/closest + */ +if (!Element.prototype.matches) Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + +if (!Element.prototype.closest) Element.prototype.closest = function (s) { + var el = this; + + if (!document.documentElement.contains(el)) return null; + do { + if (el.matches(s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null); + return null; +}; + +/***/ }), + +/***/ "./src/components/selection.js": +/*!*************************************!*\ + !*** ./src/components/selection.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(_) { + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Working with selection + * @typedef {Selection} Selection + */ +var Selection = function () { + /** + * @constructor + */ + function Selection() { + _classCallCheck(this, Selection); + + this.instance = null; + this.selection = null; + + /** + * This property can store Selection's range for restoring later + * @type {Range|null} + */ + this.savedSelectionRange = null; + } + + /** + * Editor styles + * @return {{editorWrapper: string, editorZone: string}} + * @constructor + */ + + + _createClass(Selection, [{ + key: 'save', + + + /** + * Save Selection's range + */ + value: function save() { + this.savedSelectionRange = Selection.range; + } + + /** + * Restore saved Selection's range + */ + + }, { + key: 'restore', + value: function restore() { + if (!this.savedSelectionRange) { + return; + } + + var sel = window.getSelection(); + + sel.removeAllRanges(); + sel.addRange(this.savedSelectionRange); + } + + /** + * Clears saved selection + */ + + }, { + key: 'clearSaved', + value: function clearSaved() { + this.savedSelectionRange = null; + } + + /** + * Looks ahead to find passed tag from current selection + * + * @param {String} tagName - tag to found + * @param {String} [className] - tag's class name + * @param {Number} [searchDepth] - count of tags that can be included. For better performance. + * @return {HTMLElement|null} + */ + + }, { + key: 'findParentTag', + value: function findParentTag(tagName, className) { + var searchDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10; + + var selection = window.getSelection(), + parentTag = null; + + /** + * If selection is missing or no anchorNode or focusNode were found then return null + */ + if (!selection || !selection.anchorNode || !selection.focusNode) { + return null; + } + + /** + * Define Nodes for start and end of selection + */ + var boundNodes = [ + /** the Node in which the selection begins */ + selection.anchorNode, + /** the Node in which the selection ends */ + selection.focusNode]; + + /** + * For each selection parent Nodes we try to find target tag [with target class name] + * It would be saved in parentTag variable + */ + boundNodes.forEach(function (parent) { + /** Reset tags limit */ + var searchDepthIterable = searchDepth; + + while (searchDepthIterable > 0 && parent.parentNode) { + /** + * Check tag's name + */ + if (parent.tagName === tagName) { + /** + * Optional additional check for class-name matching + */ + if (className && parent.classList && !parent.classList.contains(className)) { + continue; + } + + /** + * If we have found required tag with class then save the result and go out from cycle + */ + parentTag = parent; + break; + } + + /** + * Target tag was not found. Go up to the parent and check it + */ + parent = parent.parentNode; + searchDepthIterable--; + } + }); + + /** + * Return found tag or null + */ + return parentTag; + } + + /** + * Expands selection range to the passed parent node + * + * @param {HTMLElement} node + */ + + }, { + key: 'expandToTag', + value: function expandToTag(node) { + var selection = window.getSelection(); + + selection.removeAllRanges(); + var range = document.createRange(); + + range.selectNodeContents(node); + selection.addRange(range); + } + }], [{ + key: 'get', + + + /** + * Returns window Selection + * {@link https://developer.mozilla.org/ru/docs/Web/API/Window/getSelection} + * @return {Selection} + */ + value: function get() { + return window.getSelection(); + } + + /** + * Returns selected anchor + * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorNode} + * @return {Node|null} + */ + + }, { + key: 'CSS', + get: function get() { + return { + editorWrapper: 'codex-editor', + editorZone: 'codex-editor__redactor' + }; + } + }, { + key: 'anchorNode', + get: function get() { + var selection = window.getSelection(); + + return selection ? selection.anchorNode : null; + } + + /** + * Returns selection offset according to the anchor node + * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorOffset} + * @return {Number|null} + */ + + }, { + key: 'anchorOffset', + get: function get() { + var selection = window.getSelection(); + + return selection ? selection.anchorOffset : null; + } + + /** + * Is current selection range collapsed + * @return {boolean|null} + */ + + }, { + key: 'isCollapsed', + get: function get() { + var selection = window.getSelection(); + + return selection ? selection.isCollapsed : null; + } + + /** + * Check current selection if it is at Editor's zone + * @return {boolean} + */ + + }, { + key: 'isAtEditor', + get: function get() { + var selection = Selection.get(), + selectedNode = void 0, + editorZone = false; + + /** + * Something selected on document + */ + selectedNode = selection.anchorNode || selection.focusNode; + + if (selectedNode && selectedNode.nodeType === Node.TEXT_NODE) { + selectedNode = selectedNode.parentNode; + } + + if (selectedNode) { + editorZone = selectedNode.closest('.' + Selection.CSS.editorZone); + } + + /** + * Selection is not out of Editor because Editor's wrapper was found + */ + return editorZone && editorZone.nodeType === Node.ELEMENT_NODE; + } + + /** + * Return first range + * @return {Range|null} + */ + + }, { + key: 'range', + get: function get() { + var selection = window.getSelection(); + + return selection && selection.rangeCount ? selection.getRangeAt(0) : null; + } + + /** + * Calculates position and size of selected text + * @return {{x, y, width, height, top?, left?, bottom?, right?}} + */ + + }, { + key: 'rect', + get: function get() { + var sel = document.selection, + range = void 0; + var rect = { + x: 0, + y: 0, + width: 0, + height: 0 + }; + + if (sel && sel.type !== 'Control') { + range = sel.createRange(); + rect.x = range.boundingLeft; + rect.y = range.boundingTop; + rect.width = range.boundingWidth; + rect.height = range.boundingHeight; + + return rect; + } + + if (!window.getSelection) { + _.log('Method window.getSelection is not supported', 'warn'); + return rect; + } + + sel = window.getSelection(); + + if (!sel.rangeCount) { + _.log('Method Selection.rangeCount() is not supported', 'warn'); + return rect; + } + + range = sel.getRangeAt(0).cloneRange(); + + if (range.getBoundingClientRect) { + rect = range.getBoundingClientRect(); + } + // Fall back to inserting a temporary element + if (rect.x === 0 && rect.y === 0) { + var span = document.createElement('span'); + + if (span.getBoundingClientRect) { + // Ensure span has dimensions and position by + // adding a zero-width space character + span.appendChild(document.createTextNode('\u200B')); + range.insertNode(span); + rect = span.getBoundingClientRect(); + + var spanParent = span.parentNode; + + spanParent.removeChild(span); + + // Glue any broken text nodes back together + spanParent.normalize(); + } + } + + return rect; + } + + /** + * Returns selected text as String + * @returns {string} + */ + + }, { + key: 'text', + get: function get() { + return window.getSelection ? window.getSelection().toString() : ''; + } + }]); + + return Selection; +}(); + +Selection.displayName = 'Selection'; +exports.default = Selection; +module.exports = exports['default']; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! utils */ "./src/components/utils.js"))) + +/***/ }), + +/***/ "./src/components/utils.js": +/*!*********************************!*\ + !*** ./src/components/utils.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +/** + * Codex Editor Util + */ +var Util = function () { + function Util() { + _classCallCheck(this, Util); + } + + _createClass(Util, null, [{ + key: 'log', + + /** + * Custom logger + * + * @param {string} msg - message + * @param {string} type - logging type 'log'|'warn'|'error'|'info' + * @param {*} args - argument to log with a message + */ + value: function log(msg, type, args) { + type = type || 'log'; + + if (!args) { + if (['time', 'timeEnd'].includes(type)) { + msg = '[codex-editor]: ' + msg; + } else { + args = msg || 'undefined'; + msg = '[codex-editor]: %o'; + } + } else { + msg = '[codex-editor]: ' + msg; + } + + try { + if ('console' in window && window.console[type]) { + if (args) window.console[type](msg, args);else window.console[type](msg); + } + } catch (e) { + // do nothing + } + } + + /** + * Returns basic keycodes as constants + * @return {{}} + */ + + }, { + key: 'sequence', + + + /** + * @typedef {Object} ChainData + * @property {Object} data - data that will be passed to the success or fallback + * @property {Function} function - function's that must be called asynchronically + */ + + /** + * Fires a promise sequence asyncronically + * + * @param {Object[]} chains - list or ChainData's + * @param {Function} success - success callback + * @param {Function} fallback - callback that fires in case of errors + * + * @return {Promise} + */ + value: function sequence(chains) { + var success = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {}; + var fallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; + + return new Promise(function (resolve) { + /** + * pluck each element from queue + * First, send resolved Promise as previous value + * Each plugins "prepare" method returns a Promise, that's why + * reduce current element will not be able to continue while can't get + * a resolved Promise + */ + chains.reduce(function (previousValue, currentValue, iteration) { + return previousValue.then(function () { + return waitNextBlock(currentValue, success, fallback); + }).then(function () { + // finished + if (iteration === chains.length - 1) { + resolve(); + } + }); + }, Promise.resolve()); + }); + + /** + * Decorator + * + * @param {ChainData} chainData + * + * @param {Function} successCallback + * @param {Function} fallbackCallback + * + * @return {Promise} + */ + function waitNextBlock(chainData, successCallback, fallbackCallback) { + return new Promise(function (resolve) { + chainData.function().then(function () { + successCallback(chainData.data || {}); + }).then(resolve).catch(function () { + fallbackCallback(chainData.data || {}); + + // anyway, go ahead even it falls + resolve(); + }); + }); + } + } + + /** + * Make array from array-like collection + * + * @param {*} collection + * + * @return {Array} + */ + + }, { + key: 'array', + value: function array(collection) { + return Array.prototype.slice.call(collection); + } + + /** + * Checks if object is empty + * + * @param {Object} object + * @return {boolean} + */ + + }, { + key: 'isEmpty', + value: function isEmpty(object) { + return Object.keys(object).length === 0 && object.constructor === Object; + } + + /** + * Check if passed object is a Promise + * @param {*} object - object to check + * @return {Boolean} + */ + + }, { + key: 'isPromise', + value: function isPromise(object) { + return Promise.resolve(object) === object; + } + + /** + * Check if passed element is contenteditable + * @param element + * @return {boolean} + */ + + }, { + key: 'isContentEditable', + value: function isContentEditable(element) { + return element.contentEditable === 'true'; + } + + /** + * Delays method execution + * + * @param method + * @param timeout + */ + + }, { + key: 'delay', + value: function delay(method, timeout) { + return function () { + var context = this, + args = arguments; + + window.setTimeout(function () { + return method.apply(context, args); + }, timeout); + }; + } + }, { + key: 'keyCodes', + get: function get() { + return { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + SHIFT: 16, + CTRL: 17, + ALT: 18, + ESC: 27, + SPACE: 32, + LEFT: 37, + UP: 38, + DOWN: 40, + RIGHT: 39, + DELETE: 46, + META: 91 + }; + } + }]); + + return Util; +}(); + +Util.displayName = 'Util'; +exports.default = Util; +; +module.exports = exports['default']; + +/***/ }), + +/***/ "./src/styles/main.css": +/*!*****************************!*\ + !*** ./src/styles/main.css ***! + \*****************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ../../node_modules/css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); +// imports + + +// module +exports.push([module.i, ":root {\r\n /**\r\n * Selection color\r\n */\r\n --selectionColor: rgba(61,166,239,0.63);\r\n\r\n /**\r\n * Toolbar buttons\r\n */\r\n --bg-light: #eff2f5;\r\n\r\n /**\r\n * All gray texts: placeholders, settings\r\n */\r\n --grayText: #707684;\r\n\r\n /** Blue icons */\r\n --color-active-icon: #388AE5;\r\n\r\n /**\r\n * Block content width\r\n */\r\n --content-width: 650px;\r\n\r\n /**\r\n * Toolbar buttons height and width\r\n */\r\n --toolbar-buttons-size: 34px;\r\n\r\n /**\r\n * Toolbar Plus Button and Toolbox buttons height and width\r\n */\r\n --toolbox-buttons-size: 20px;\r\n\r\n /**\r\n * Confirm deletion bg\r\n */\r\n --color-confirm: #E24A4A;\r\n}\r\n/**\r\n* Editor wrapper\r\n*/\r\n.codex-editor {\r\n position: relative;\r\n box-sizing: border-box;\r\n}\r\n.codex-editor .hide {\r\n display: none;\r\n }\r\n.codex-editor__redactor {\r\n padding-bottom: 300px;\r\n }\r\n.codex-editor svg {\r\n fill: currentColor;\r\n vertical-align: middle;\r\n max-height: 100%;\r\n }\r\n/**\r\n * Set color for native selection\r\n */\r\n::-moz-selection{\r\n background-color: rgba(61,166,239,0.63);\r\n background-color: var(--selectionColor);\r\n}\r\n::selection{\r\n background-color: rgba(61,166,239,0.63);\r\n background-color: var(--selectionColor);\r\n}\r\n/**\r\n * Add placeholder to content editable elements with data attribute\r\n * data-placeholder=\"Hello world!\"\r\n */\r\n[contentEditable=true][data-placeholder]:empty:not(:focus):before{\r\n content: attr(data-placeholder);\r\n color: #707684;\r\n color: var(--grayText);\r\n}\r\n.ce-toolbar {\r\n position: absolute;\r\n left: 0;\r\n right: 0;\r\n top: 0;\r\n /*opacity: 0;*/\r\n /*visibility: hidden;*/\r\n transition: opacity 100ms ease;\r\n will-change: opacity, transform;\r\n display: none;\r\n}\r\n.ce-toolbar--opened {\r\n display: block;\r\n /*opacity: 1;*/\r\n /*visibility: visible;*/\r\n }\r\n.ce-toolbar__content {\r\n max-width: 650px;\r\n max-width: var(--content-width);\r\n margin: 0 auto;\r\n position: relative;\r\n }\r\n.ce-toolbar__plus {\r\n color: #707684;\r\n color: var(--grayText);\r\n cursor: pointer;\r\n display: inline-block;\r\n width: 20px;\r\n width: var(--toolbox-buttons-size);\r\n height: 20px;\r\n height: var(--toolbox-buttons-size);\r\n /*line-height: var(--toolbox-buttons-size);*/\r\n display: -ms-flexbox;\r\n display: flex;\r\n -ms-flex-pack: center;\r\n justify-content: center;\r\n -ms-flex-align: center;\r\n align-items: center\r\n }\r\n.ce-toolbar__plus:not(:last-of-type){\r\n margin-right: 3px;\r\n }\r\n.ce-toolbar__plus:hover {\r\n color: #388AE5;\r\n color: var(--color-active-icon);\r\n }\r\n.ce-toolbar__plus {\r\n\r\n position: absolute;\r\n left: calc(calc(20px + 10px) * -1);\r\n left: calc(calc(var(--toolbox-buttons-size) + 10px) * -1);\r\n }\r\n.ce-toolbar__plus--hidden {\r\n display: none;\r\n }\r\n/**\r\n * Block actions Zone\r\n * -------------------------\r\n */\r\n.ce-toolbar__actions {\r\n position: absolute;\r\n right: 0;\r\n top: 0;\r\n padding-right: 16px;\r\n }\r\n.ce-toolbar__actions-buttons {\r\n text-align: right;\r\n }\r\n.ce-toolbar__settings-btn {\r\n display: inline-block;\r\n width: 24px;\r\n height: 24px;\r\n color: #707684;\r\n color: var(--grayText);\r\n cursor: pointer;\r\n }\r\n.ce-toolbox {\r\n position: absolute;\r\n visibility: hidden;\r\n transition: opacity 100ms ease;\r\n will-change: opacity;\r\n}\r\n.ce-toolbox--opened {\r\n opacity: 1;\r\n visibility: visible;\r\n }\r\n.ce-toolbox__button {\r\n color: #707684;\r\n color: var(--grayText);\r\n cursor: pointer;\r\n display: inline-block;\r\n width: 20px;\r\n width: var(--toolbox-buttons-size);\r\n height: 20px;\r\n height: var(--toolbox-buttons-size);\r\n /*line-height: var(--toolbox-buttons-size);*/\r\n display: -ms-flexbox;\r\n display: flex;\r\n -ms-flex-pack: center;\r\n justify-content: center;\r\n -ms-flex-align: center;\r\n align-items: center;\r\n }\r\n.ce-toolbox__button:not(:last-of-type){\r\n margin-right: 3px;\r\n }\r\n.ce-toolbox__button:hover {\r\n color: #388AE5;\r\n color: var(--color-active-icon);\r\n }\r\n.ce-inline-toolbar {\r\n position: absolute;\r\n background-color: #FFFFFF;\r\n box-shadow: 0 8px 23px -6px rgba(21,40,54,0.31), 22px -14px 34px -18px rgba(33,48,73,0.26);\r\n border-radius: 4px;\r\n z-index: 2\r\n}\r\n.ce-inline-toolbar::before {\r\n content: '';\r\n width: 15px;\r\n height: 15px;\r\n position: absolute;\r\n top: -7px;\r\n left: 50%;\r\n margin-left: -7px;\r\n transform: rotate(-45deg);\r\n background-color: #fff;\r\n z-index: -1;\r\n }\r\n.ce-inline-toolbar {\r\n padding: 6px;\r\n transform: translateX(-50%);\r\n display: none;\r\n box-shadow: 0 6px 12px -6px rgba(131, 147, 173, 0.46),\r\n 5px -12px 34px -13px rgba(97, 105, 134, 0.6),\r\n 0 26px 52px 3px rgba(147, 165, 186, 0.24);\r\n}\r\n.ce-inline-toolbar--showed {\r\n display: block;\r\n }\r\n.ce-inline-tool {\r\n display: inline-block;\r\n width: 34px;\r\n height: 34px;\r\n line-height: 34px;\r\n text-align: center;\r\n border-radius: 3px;\r\n cursor: pointer;\r\n border: 0;\r\n outline: none;\r\n background-color: transparent;\r\n vertical-align: bottom;\r\n color: #707684;\r\n color: var(--grayText)\r\n}\r\n.ce-inline-tool:not(:last-of-type){\r\n margin-right: 5px;\r\n }\r\n.ce-inline-tool:hover {\r\n background-color: #eff2f5;\r\n background-color: var(--bg-light);\r\n }\r\n.ce-inline-tool {\r\n line-height: normal;\r\n}\r\n.ce-inline-tool--active {\r\n color: #388AE5;\r\n color: var(--color-active-icon);\r\n }\r\n.ce-inline-tool--link .icon {\r\n margin-top: -2px;\r\n }\r\n.ce-inline-tool--link .icon--unlink {\r\n display: none;\r\n }\r\n.ce-inline-tool--unlink .icon--link {\r\n display: none;\r\n }\r\n.ce-inline-tool--unlink .icon--unlink {\r\n display: inline-block;\r\n }\r\n.ce-inline-tool-input {\r\n background-color: #eff2f5;\r\n background-color: var(--bg-light);\r\n outline: none;\r\n border: 0;\r\n border-radius: 3px;\r\n margin: 6px 0 0;\r\n font-size: 13px;\r\n padding: 8px;\r\n width: 100%;\r\n box-sizing: border-box;\r\n display: none\r\n }\r\n.ce-inline-tool-input::-webkit-input-placeholder {\r\n color: #707684;\r\n color: var(--grayText);\r\n }\r\n.ce-inline-tool-input:-ms-input-placeholder {\r\n color: #707684;\r\n color: var(--grayText);\r\n }\r\n.ce-inline-tool-input::placeholder {\r\n color: #707684;\r\n color: var(--grayText);\r\n }\r\n.ce-inline-tool-input--showed {\r\n display: block;\r\n }\r\n.ce-settings {\r\n position: absolute;\r\n background-color: #FFFFFF;\r\n box-shadow: 0 8px 23px -6px rgba(21,40,54,0.31), 22px -14px 34px -18px rgba(33,48,73,0.26);\r\n border-radius: 4px;\r\n z-index: 2\r\n}\r\n.ce-settings::before {\r\n content: '';\r\n width: 15px;\r\n height: 15px;\r\n position: absolute;\r\n top: -7px;\r\n left: 50%;\r\n margin-left: -7px;\r\n transform: rotate(-45deg);\r\n background-color: #fff;\r\n z-index: -1;\r\n }\r\n.ce-settings {\r\n right: 5px;\r\n top: 35px;\r\n min-width: 124px\r\n}\r\n.ce-settings::before{\r\n left: auto;\r\n right: 12px;\r\n }\r\n.ce-settings {\r\n\r\n display: none;\r\n}\r\n.ce-settings--opened {\r\n display: block;\r\n }\r\n.ce-settings__plugin-zone:not(:empty){\r\n padding: 6px 6px 0;\r\n }\r\n.ce-settings__default-zone:not(:empty){\r\n padding: 6px;\r\n }\r\n.ce-settings__button {\r\n display: inline-block;\r\n width: 34px;\r\n height: 34px;\r\n line-height: 34px;\r\n text-align: center;\r\n border-radius: 3px;\r\n cursor: pointer;\r\n border: 0;\r\n outline: none;\r\n background-color: transparent;\r\n vertical-align: bottom;\r\n color: #707684;\r\n color: var(--grayText)\r\n }\r\n.ce-settings__button:not(:last-of-type){\r\n margin-right: 5px;\r\n }\r\n.ce-settings__button:hover {\r\n background-color: #eff2f5;\r\n background-color: var(--bg-light);\r\n }\r\n.ce-settings__button--active {\r\n color: #388AE5;\r\n color: var(--color-active-icon);\r\n }\r\n.ce-settings__button--disabled {\r\n cursor: not-allowed !important;\r\n opacity: .3;\r\n }\r\n.ce-settings__button--selected {\r\n color: #388AE5;\r\n color: var(--color-active-icon);\r\n }\r\n.ce-settings__button--delete {\r\n transition: background-color 300ms ease;\r\n will-change: background-color;\r\n }\r\n.ce-settings__button--delete .icon {\r\n transition: transform 200ms ease-out;\r\n will-change: transform;\r\n }\r\n.ce-settings__button--confirm {\r\n background-color: #E24A4A;\r\n background-color: var(--color-confirm);\r\n color: #fff\r\n }\r\n.ce-settings__button--confirm:hover {\r\n background-color: rgb(213, 74, 74) !important;\r\n background-color: rgb(213, 74, 74) !important;\r\n }\r\n.ce-settings__button--confirm .icon {\r\n transform: rotate(90deg);\r\n }\r\n.ce-block:first-of-type {\r\n margin-top: 0;\r\n }\r\n.ce-block--selected {\r\n background-image: linear-gradient(17deg, rgba(243, 248, 255, 0.03) 63.45%, rgba(207, 214, 229, 0.27) 98%);\r\n border-radius: 3px;\r\n }\r\n.ce-block__content {\r\n max-width: 650px;\r\n max-width: var(--content-width);\r\n margin: 0 auto;\r\n }\r\n.wobble {\r\n animation-name: wobble;\r\n animation-duration: 400ms;\r\n}\r\n/**\r\n * @author Nick Pettit - https://github.com/nickpettit/glide\r\n */\r\n@keyframes wobble {\r\n from {\r\n transform: translate3d(0, 0, 0);\r\n }\r\n\r\n 15% {\r\n transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -5deg);\r\n }\r\n\r\n 30% {\r\n transform: translate3d(2%, 0, 0) rotate3d(0, 0, 1, 3deg);\r\n }\r\n\r\n 45% {\r\n transform: translate3d(-3%, 0, 0) rotate3d(0, 0, 1, -3deg);\r\n }\r\n\r\n 60% {\r\n transform: translate3d(2%, 0, 0) rotate3d(0, 0, 1, 2deg);\r\n }\r\n\r\n 75% {\r\n transform: translate3d(-1%, 0, 0) rotate3d(0, 0, 1, -1deg);\r\n }\r\n\r\n to {\r\n transform: translate3d(0, 0, 0);\r\n }\r\n}\r\n", ""]); + +// exports + + +/***/ }), + +/***/ 0: +/*!****************************************!*\ + !*** multi babel-polyfill ./src/codex ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! babel-polyfill */"./node_modules/babel-polyfill/lib/index.js"); +module.exports = __webpack_require__(/*! ./src/codex */"./src/codex.js"); + + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=codex-editor.js.map \ No newline at end of file diff --git a/build/codex-editor.js.map b/build/codex-editor.js.map new file mode 100644 index 00000000..0e662431 --- /dev/null +++ b/build/codex-editor.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://CodexEditor/webpack/universalModuleDefinition","webpack://CodexEditor/webpack/bootstrap","webpack://CodexEditor/./build/sprite.svg","webpack://CodexEditor/./node_modules/babel-core/register.js","webpack://CodexEditor/./node_modules/babel-polyfill/lib/index.js","webpack://CodexEditor/./node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js","webpack://CodexEditor/./node_modules/babel-register/lib/browser.js","webpack://CodexEditor/./node_modules/core-js/fn/regexp/escape.js","webpack://CodexEditor/./node_modules/core-js/modules/_a-function.js","webpack://CodexEditor/./node_modules/core-js/modules/_a-number-value.js","webpack://CodexEditor/./node_modules/core-js/modules/_add-to-unscopables.js","webpack://CodexEditor/./node_modules/core-js/modules/_an-instance.js","webpack://CodexEditor/./node_modules/core-js/modules/_an-object.js","webpack://CodexEditor/./node_modules/core-js/modules/_array-copy-within.js","webpack://CodexEditor/./node_modules/core-js/modules/_array-fill.js","webpack://CodexEditor/./node_modules/core-js/modules/_array-from-iterable.js","webpack://CodexEditor/./node_modules/core-js/modules/_array-includes.js","webpack://CodexEditor/./node_modules/core-js/modules/_array-methods.js","webpack://CodexEditor/./node_modules/core-js/modules/_array-reduce.js","webpack://CodexEditor/./node_modules/core-js/modules/_array-species-constructor.js","webpack://CodexEditor/./node_modules/core-js/modules/_array-species-create.js","webpack://CodexEditor/./node_modules/core-js/modules/_bind.js","webpack://CodexEditor/./node_modules/core-js/modules/_classof.js","webpack://CodexEditor/./node_modules/core-js/modules/_cof.js","webpack://CodexEditor/./node_modules/core-js/modules/_collection-strong.js","webpack://CodexEditor/./node_modules/core-js/modules/_collection-to-json.js","webpack://CodexEditor/./node_modules/core-js/modules/_collection-weak.js","webpack://CodexEditor/./node_modules/core-js/modules/_collection.js","webpack://CodexEditor/./node_modules/core-js/modules/_core.js","webpack://CodexEditor/./node_modules/core-js/modules/_create-property.js","webpack://CodexEditor/./node_modules/core-js/modules/_ctx.js","webpack://CodexEditor/./node_modules/core-js/modules/_date-to-iso-string.js","webpack://CodexEditor/./node_modules/core-js/modules/_date-to-primitive.js","webpack://CodexEditor/./node_modules/core-js/modules/_defined.js","webpack://CodexEditor/./node_modules/core-js/modules/_descriptors.js","webpack://CodexEditor/./node_modules/core-js/modules/_dom-create.js","webpack://CodexEditor/./node_modules/core-js/modules/_enum-bug-keys.js","webpack://CodexEditor/./node_modules/core-js/modules/_enum-keys.js","webpack://CodexEditor/./node_modules/core-js/modules/_export.js","webpack://CodexEditor/./node_modules/core-js/modules/_fails-is-regexp.js","webpack://CodexEditor/./node_modules/core-js/modules/_fails.js","webpack://CodexEditor/./node_modules/core-js/modules/_fix-re-wks.js","webpack://CodexEditor/./node_modules/core-js/modules/_flags.js","webpack://CodexEditor/./node_modules/core-js/modules/_flatten-into-array.js","webpack://CodexEditor/./node_modules/core-js/modules/_for-of.js","webpack://CodexEditor/./node_modules/core-js/modules/_global.js","webpack://CodexEditor/./node_modules/core-js/modules/_has.js","webpack://CodexEditor/./node_modules/core-js/modules/_hide.js","webpack://CodexEditor/./node_modules/core-js/modules/_html.js","webpack://CodexEditor/./node_modules/core-js/modules/_ie8-dom-define.js","webpack://CodexEditor/./node_modules/core-js/modules/_inherit-if-required.js","webpack://CodexEditor/./node_modules/core-js/modules/_invoke.js","webpack://CodexEditor/./node_modules/core-js/modules/_iobject.js","webpack://CodexEditor/./node_modules/core-js/modules/_is-array-iter.js","webpack://CodexEditor/./node_modules/core-js/modules/_is-array.js","webpack://CodexEditor/./node_modules/core-js/modules/_is-integer.js","webpack://CodexEditor/./node_modules/core-js/modules/_is-object.js","webpack://CodexEditor/./node_modules/core-js/modules/_is-regexp.js","webpack://CodexEditor/./node_modules/core-js/modules/_iter-call.js","webpack://CodexEditor/./node_modules/core-js/modules/_iter-create.js","webpack://CodexEditor/./node_modules/core-js/modules/_iter-define.js","webpack://CodexEditor/./node_modules/core-js/modules/_iter-detect.js","webpack://CodexEditor/./node_modules/core-js/modules/_iter-step.js","webpack://CodexEditor/./node_modules/core-js/modules/_iterators.js","webpack://CodexEditor/./node_modules/core-js/modules/_library.js","webpack://CodexEditor/./node_modules/core-js/modules/_math-expm1.js","webpack://CodexEditor/./node_modules/core-js/modules/_math-fround.js","webpack://CodexEditor/./node_modules/core-js/modules/_math-log1p.js","webpack://CodexEditor/./node_modules/core-js/modules/_math-scale.js","webpack://CodexEditor/./node_modules/core-js/modules/_math-sign.js","webpack://CodexEditor/./node_modules/core-js/modules/_meta.js","webpack://CodexEditor/./node_modules/core-js/modules/_metadata.js","webpack://CodexEditor/./node_modules/core-js/modules/_microtask.js","webpack://CodexEditor/./node_modules/core-js/modules/_new-promise-capability.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-assign.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-create.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-dp.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-dps.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-forced-pam.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-gopd.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-gopn-ext.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-gopn.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-gops.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-gpo.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-keys-internal.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-keys.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-pie.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-sap.js","webpack://CodexEditor/./node_modules/core-js/modules/_object-to-array.js","webpack://CodexEditor/./node_modules/core-js/modules/_own-keys.js","webpack://CodexEditor/./node_modules/core-js/modules/_parse-float.js","webpack://CodexEditor/./node_modules/core-js/modules/_parse-int.js","webpack://CodexEditor/./node_modules/core-js/modules/_perform.js","webpack://CodexEditor/./node_modules/core-js/modules/_promise-resolve.js","webpack://CodexEditor/./node_modules/core-js/modules/_property-desc.js","webpack://CodexEditor/./node_modules/core-js/modules/_redefine-all.js","webpack://CodexEditor/./node_modules/core-js/modules/_redefine.js","webpack://CodexEditor/./node_modules/core-js/modules/_replacer.js","webpack://CodexEditor/./node_modules/core-js/modules/_same-value.js","webpack://CodexEditor/./node_modules/core-js/modules/_set-collection-from.js","webpack://CodexEditor/./node_modules/core-js/modules/_set-collection-of.js","webpack://CodexEditor/./node_modules/core-js/modules/_set-proto.js","webpack://CodexEditor/./node_modules/core-js/modules/_set-species.js","webpack://CodexEditor/./node_modules/core-js/modules/_set-to-string-tag.js","webpack://CodexEditor/./node_modules/core-js/modules/_shared-key.js","webpack://CodexEditor/./node_modules/core-js/modules/_shared.js","webpack://CodexEditor/./node_modules/core-js/modules/_species-constructor.js","webpack://CodexEditor/./node_modules/core-js/modules/_strict-method.js","webpack://CodexEditor/./node_modules/core-js/modules/_string-at.js","webpack://CodexEditor/./node_modules/core-js/modules/_string-context.js","webpack://CodexEditor/./node_modules/core-js/modules/_string-html.js","webpack://CodexEditor/./node_modules/core-js/modules/_string-pad.js","webpack://CodexEditor/./node_modules/core-js/modules/_string-repeat.js","webpack://CodexEditor/./node_modules/core-js/modules/_string-trim.js","webpack://CodexEditor/./node_modules/core-js/modules/_string-ws.js","webpack://CodexEditor/./node_modules/core-js/modules/_task.js","webpack://CodexEditor/./node_modules/core-js/modules/_to-absolute-index.js","webpack://CodexEditor/./node_modules/core-js/modules/_to-index.js","webpack://CodexEditor/./node_modules/core-js/modules/_to-integer.js","webpack://CodexEditor/./node_modules/core-js/modules/_to-iobject.js","webpack://CodexEditor/./node_modules/core-js/modules/_to-length.js","webpack://CodexEditor/./node_modules/core-js/modules/_to-object.js","webpack://CodexEditor/./node_modules/core-js/modules/_to-primitive.js","webpack://CodexEditor/./node_modules/core-js/modules/_typed-array.js","webpack://CodexEditor/./node_modules/core-js/modules/_typed-buffer.js","webpack://CodexEditor/./node_modules/core-js/modules/_typed.js","webpack://CodexEditor/./node_modules/core-js/modules/_uid.js","webpack://CodexEditor/./node_modules/core-js/modules/_user-agent.js","webpack://CodexEditor/./node_modules/core-js/modules/_validate-collection.js","webpack://CodexEditor/./node_modules/core-js/modules/_wks-define.js","webpack://CodexEditor/./node_modules/core-js/modules/_wks-ext.js","webpack://CodexEditor/./node_modules/core-js/modules/_wks.js","webpack://CodexEditor/./node_modules/core-js/modules/core.get-iterator-method.js","webpack://CodexEditor/./node_modules/core-js/modules/core.regexp.escape.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.copy-within.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.every.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.fill.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.filter.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.find-index.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.find.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.for-each.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.from.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.index-of.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.is-array.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.iterator.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.join.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.last-index-of.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.map.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.of.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.reduce-right.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.reduce.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.slice.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.some.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.sort.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.array.species.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.date.now.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.date.to-iso-string.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.date.to-json.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.date.to-primitive.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.date.to-string.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.function.bind.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.function.has-instance.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.function.name.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.map.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.acosh.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.asinh.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.atanh.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.cbrt.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.clz32.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.cosh.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.expm1.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.fround.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.hypot.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.imul.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.log10.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.log1p.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.log2.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.sign.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.sinh.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.tanh.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.math.trunc.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.number.constructor.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.number.epsilon.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.number.is-finite.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.number.is-integer.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.number.is-nan.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.number.is-safe-integer.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.number.max-safe-integer.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.number.min-safe-integer.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.number.parse-float.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.number.parse-int.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.number.to-fixed.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.number.to-precision.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.assign.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.create.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.define-properties.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.define-property.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.freeze.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.get-own-property-descriptor.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.get-own-property-names.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.get-prototype-of.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.is-extensible.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.is-frozen.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.is-sealed.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.is.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.keys.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.prevent-extensions.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.seal.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.set-prototype-of.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.object.to-string.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.parse-float.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.parse-int.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.promise.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.apply.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.construct.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.define-property.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.delete-property.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.enumerate.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.get-own-property-descriptor.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.get-prototype-of.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.get.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.has.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.is-extensible.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.own-keys.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.prevent-extensions.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.set-prototype-of.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.reflect.set.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.regexp.constructor.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.regexp.flags.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.regexp.match.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.regexp.replace.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.regexp.search.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.regexp.split.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.regexp.to-string.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.set.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.anchor.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.big.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.blink.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.bold.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.code-point-at.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.ends-with.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.fixed.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.fontcolor.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.fontsize.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.from-code-point.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.includes.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.italics.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.iterator.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.link.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.raw.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.repeat.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.small.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.starts-with.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.strike.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.sub.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.sup.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.string.trim.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.symbol.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.typed.array-buffer.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.typed.data-view.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.typed.float32-array.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.typed.float64-array.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.typed.int16-array.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.typed.int32-array.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.typed.int8-array.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.typed.uint16-array.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.typed.uint32-array.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.typed.uint8-array.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.typed.uint8-clamped-array.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.weak-map.js","webpack://CodexEditor/./node_modules/core-js/modules/es6.weak-set.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.array.flat-map.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.array.flatten.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.array.includes.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.asap.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.error.is-error.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.global.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.map.from.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.map.of.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.map.to-json.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.math.clamp.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.math.deg-per-rad.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.math.degrees.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.math.fscale.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.math.iaddh.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.math.imulh.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.math.isubh.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.math.rad-per-deg.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.math.radians.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.math.scale.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.math.signbit.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.math.umulh.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.object.define-getter.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.object.define-setter.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.object.entries.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.object.lookup-getter.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.object.lookup-setter.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.object.values.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.observable.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.promise.finally.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.promise.try.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.reflect.define-metadata.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.reflect.delete-metadata.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.reflect.get-metadata-keys.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.reflect.get-metadata.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.reflect.get-own-metadata-keys.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.reflect.get-own-metadata.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.reflect.has-metadata.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.reflect.has-own-metadata.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.reflect.metadata.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.set.from.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.set.of.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.set.to-json.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.string.at.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.string.match-all.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.string.pad-end.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.string.pad-start.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.string.trim-left.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.string.trim-right.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.symbol.async-iterator.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.symbol.observable.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.system.global.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.weak-map.from.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.weak-map.of.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.weak-set.from.js","webpack://CodexEditor/./node_modules/core-js/modules/es7.weak-set.of.js","webpack://CodexEditor/./node_modules/core-js/modules/web.dom.iterable.js","webpack://CodexEditor/./node_modules/core-js/modules/web.immediate.js","webpack://CodexEditor/./node_modules/core-js/modules/web.timers.js","webpack://CodexEditor/./node_modules/core-js/shim.js","webpack://CodexEditor/./node_modules/css-loader/lib/css-base.js","webpack://CodexEditor/./node_modules/html-janitor/src/html-janitor.js","webpack://CodexEditor/(webpack)/buildin/global.js","webpack://CodexEditor/./src/codex.js","webpack://CodexEditor/./src/components/__module.ts","webpack://CodexEditor/./src/components/block-tunes/block-tune-delete.ts","webpack://CodexEditor/./src/components/block-tunes/block-tune-move-down.ts","webpack://CodexEditor/./src/components/block-tunes/block-tune-move-up.ts","webpack://CodexEditor/./src/components/block.js","webpack://CodexEditor/./src/components/dom.js","webpack://CodexEditor/./src/components/inline-tools/inline-tool-bold.ts","webpack://CodexEditor/./src/components/inline-tools/inline-tool-italic.ts","webpack://CodexEditor/./src/components/inline-tools/inline-tool-link.ts","webpack://CodexEditor/./src/components/modules sync ^\\.\\/.*$","webpack://CodexEditor/./src/components/modules/_anchors.js","webpack://CodexEditor/./src/components/modules/_callbacks.js","webpack://CodexEditor/./src/components/modules/_caret.js","webpack://CodexEditor/./src/components/modules/_content.js","webpack://CodexEditor/./src/components/modules/_destroyer.js","webpack://CodexEditor/./src/components/modules/_notifications.js","webpack://CodexEditor/./src/components/modules/_parser.js","webpack://CodexEditor/./src/components/modules/_paste.js","webpack://CodexEditor/./src/components/modules/_transport.js","webpack://CodexEditor/./src/components/modules/api-blocks.ts","webpack://CodexEditor/./src/components/modules/api-events.ts","webpack://CodexEditor/./src/components/modules/api-listener.ts","webpack://CodexEditor/./src/components/modules/api-sanitizer.ts","webpack://CodexEditor/./src/components/modules/api-saver.ts","webpack://CodexEditor/./src/components/modules/api-selection.ts","webpack://CodexEditor/./src/components/modules/api-toolbar.ts","webpack://CodexEditor/./src/components/modules/api.ts","webpack://CodexEditor/./src/components/modules/block-events.ts","webpack://CodexEditor/./src/components/modules/blockManager.js","webpack://CodexEditor/./src/components/modules/caret.js","webpack://CodexEditor/./src/components/modules/events.js","webpack://CodexEditor/./src/components/modules/listeners.js","webpack://CodexEditor/./src/components/modules/paste.ts","webpack://CodexEditor/./src/components/modules/renderer.js","webpack://CodexEditor/./src/components/modules/sanitizer.js","webpack://CodexEditor/./src/components/modules/saver.js","webpack://CodexEditor/./src/components/modules/toolbar-blockSettings.js","webpack://CodexEditor/./src/components/modules/toolbar-inline.ts","webpack://CodexEditor/./src/components/modules/toolbar-toolbox.js","webpack://CodexEditor/./src/components/modules/toolbar.js","webpack://CodexEditor/./src/components/modules/toolbar/inline.js","webpack://CodexEditor/./src/components/modules/toolbar/settings.js","webpack://CodexEditor/./src/components/modules/toolbar/toolbar.js","webpack://CodexEditor/./src/components/modules/toolbar/toolbox.js","webpack://CodexEditor/./src/components/modules/tools.js","webpack://CodexEditor/./src/components/modules/ui.js","webpack://CodexEditor/./src/components/polyfills.js","webpack://CodexEditor/./src/components/selection.js","webpack://CodexEditor/./src/components/utils.js","webpack://CodexEditor/./src/styles/main.css"],"names":["modules","editorModules","map","module","CodexEditor","config","moduleInstances","Promise","resolve","then","configuration","init","start","methods","API","method","console","log","catch","error","constructModules","configureModules","forEach","Module","displayName","e","name","state","getModulesDiff","diff","moduleName","modulesToPrepare","reduce","promise","_","prepare","Renderer","render","data","items","initialBlock","type","holderId","placeholder","sanitizer","p","b","a","hideToolbar","tools","toolsConfig","isEmpty","length","Block","toolName","toolInstance","settings","apiMethods","tool","api","holder","compose","tunes","makeTunes","wrapper","$","make","CSS","contentNode","content","pluginsContent","appendChild","methodName","params","Function","call","merge","extractedBlock","save","measuringStart","window","performance","now","measuringEnd","finishedExtraction","time","isValid","validate","tunesList","MoveUpTune","DeleteTune","MoveDownTune","tune","tunesElement","document","createDocumentFragment","append","querySelector","childNodes","contentless","emptyText","emptyMedia","hasMedia","mediaTags","join","classList","add","selected","remove","Dom","tag","tagName","includes","classNames","attributes","el","createElement","Array","isArray","attrName","createTextNode","width","height","icon","createElementNS","setAttribute","innerHTML","parent","elements","el1","el2","temp","parentNode","insertBefore","removeChild","selector","querySelectorAll","node","atLast","child","sibling","nodeType","Node","ELEMENT_NODE","nodeChild","isSingleTag","getDeepestNode","DOCUMENT_FRAGMENT_NODE","target","nativeInputs","nodeText","isElement","isNativeInput","value","textContent","replace","trim","treeWalker","leafs","isNodeEmpty","push","firstChild","shift","isLeaf","nextSibling","every","leaf","string","childElementCount","exports","anchors","editor","codex","input","currentNode","settingsOpened","currentBlock","dataset","anchor","anchorChanged","newAnchor","rusToTranslit","ui","className","BLOCK_WITH_ANCHOR","keyDownOnAnchorInput","keyCode","core","keys","ENTER","preventDefault","stopPropagation","blur","toolbar","close","keyUpOnAnchorInput","LEFT","DOWN","ru","en","i","split","toLowerCase","callbacks","globalKeydown","event","enterKeyPressed_","redactorKeyDown","TAB","tabKeyPressedOnRedactorsZone_","enterKeyPressedOnRedactorsZone_","ESC","escapeKeyPressedOnRedactorsZone_","defaultKeyPressedOnRedactorsZone_","globalKeyup","UP","RIGHT","arrowKeyPressed_","isBlockEmpty","opened","open","toolbox","editorAreaHightlighted","caret","inputIndex","enterPressedOnBlock_","NEW_BLOCK_TYPE","initialBlockPlugin","insertBlock","block","move","contentEditable","saveCurrentInputIndex","currentInputIndex","getCurrentInputIndex","workingNode","isEnterPressedOnToolbar","current","inputs","enableLineBreaks","toolClicked","stopImmediatePropagation","shiftKey","currentSelection","getSelection","currentSelectedNode","anchorNode","caretAtTheEndOfText","position","atTheEnd","isTextNodeHasParentBetweenContenteditable","callback","enterPressedOnBlock","nodeTypes","TEXT","splitBlock","showPlusButton","islastNode","isLastNode","saveInputs","workingNodeChanged","inline","actionsOpened","clearMark","redactorClicked","detectWhenClickedOnFirstLevelBlockArea_","selectedText","getSelectionText","firstLevelBlock","indexOfLastInput","getFirstLevelBlock","setToBlock","setToNextBlock","inputIsEmpty","currentNodeType","isInitialType","hidePlusButton","markBlock","selection","flag","rangeCount","isDomNode","body","toolbarButtonClicked","button","plusButtonClicked","nodes","contains","blockKeydown","blockRightOrDownArrowPressed_","BACKSPACE","backspacePressed_","blockLeftOrUpArrowPressed_","focusedNode","focusedNodeHolder","editableElementIndex","caretInLastChild","lastChild","deepestTextnode","getDeepestTextNodeFromPosition","anchorOffset","caretInFirstChild","caretAtTheBeginning","setToPreviousBlock","range","selectionLength","firstLevelBlocksCount","getRange","endOffset","startOffset","atStart","mergeBlocks","redactor","addInitialBlock","setTimeout","showSettingsButtonClicked","currentToolType","toggle","hideRemoveActions","offset","focusedNodeIndex","set","index","childs","nodeToSet","focus","createRange","setStart","setEnd","removeAllRanges","addRange","nextInput","emptyTextElement","targetInput","previousInput","lastChildNode","lengthOfLastChildNode","pluginsRender","isFirstNode","isOffsetZero","insertNode","lastNode","DOCUMENT_FRAGMENT","getRangeAt","deleteContents","setStartAfter","collapse","Editor","stretched","highlighted","_currentNode","_currentIndex","pluginHTML","isStretched","blockContent","toolId","newBlock","composeBlock_","insertAdjacentElement","destroyer","removeNodes","notifications","destroyPlugins","destroy","destroyScripts","scripts","getElementsByTagName","id","indexOf","scriptPrefix","listeners","removeAll","plugins","queue","addToQueue","splice","createHolder","draw","errorThrown","errorMsg","notification","message","constructorSettings","cancel","confirm","inputField","confirmHandler","cancelHandler","create","okBtn","cancelBtn","okMsg","cancelMsg","send","clear","parser","insertPastedContent","blockType","text","isFirstLevelBlock","TAG","BLOCK_CLASSNAME","paste","patterns","renderOnPastePatterns","pattern","pasted","clipBoardData","clipboardData","getData","result","analize","plugin","execArray","regex","exec","match","pasteToNewBlock_","blockPasteCallback","needsToHandlePasteEvent","htmlData","plainData","paragraphs","cleanData","wrappedData","clean","wrapTextWithParagraphs","emulateUserAgentBehaviour","insertPastedParagraphs","editableParent","getEditableParent","paragraph","newNode","cloneNode","transport","currentRequest","arguments","fileSelected","clearInput","files","formData","FormData","multiple","ajax","url","beforeSend","success","progress","selectAndUpload","args","accept","click","abort","BlockManager","_blocks","currentBlockIndex","blocks","Blocks","UI","Proxy","get","Tools","construct","bindEvents","Listeners","on","BlockEvents","keydown","mouseUp","keyup","composeBlock","Caret","insert","targetBlock","blockToMerge","blockToMergeIndex","blockToMergeInfo","mergeWith","removeBlock","extractedFragment","extractFragmentFromCaretPosition","blockInserted","element","closest","clearHighlightings","childNode","parentFirstLevelBlock","Error","fromIndex","toIndex","swap","needAddInitialBlock","dropPointer","isLastBlock","isFirstBlock","array","workingArea","first","second","secondBlock","deleteCount","previousBlock","nextBlock","isNaN","children","instance","Number","atEnd","delay","Selection","lastBlock","insertAtEnd","selectRange","blockElem","cloneRange","selectNodeContents","endContainer","extractContents","from","direction","siblings","force","isAtEnd","isAtStart","shadowCaret","sel","expandToTag","newRange","selectNode","isCollapsed","firstNode","firstLetterPosition","search","leftSiblings","getHigherLevelSiblings","nothingAtLeft","nothingAtRight","rightTrimmedText","Events","subscribers","eventName","previousData","currentHandler","newData","allListeners","eventType","handler","useCapture","assignedEventData","alreadyExist","findOne","addEventListener","existingListeners","findAll","removeEventListener","listenersOnElement","listener","listenersWithType","listenersWithHandler","foundListeners","found","foundByElements","findByElement","filter","chainData","function","sequence","item","available","Sanitizer","defaultConfig","_sanitizerInstance","sanitizerConfig","sanitizerInstance","require","taintString","customConfig","library","tags","href","rel","newInstance","Saver","output","blocksData","all","allExtractedData","makeOutput","outputData","totalTime","groupCollapsed","extraction","groupEnd","Date","version","VERSION","BlockSettings","toolSettings","defaultSettings","renderSettings","renderTunes","wrapperOpened","addToolSettings","addDefaultSettings","emit","events","closed","Toolbox","buttons","Toolbar","addTools","toolsAvailable","addTool","apiSettings","IS_DISPLAYED_IN_TOOLBOX","TOOLBAR_ICON_CLASS","toolboxButton","title","toolboxIcon","buttonClicked","toolButton","toolClasses","IS_IRREPLACEBLE_TOOL","toolboxOpened","actions","plusButton","blockActionsButtons","settingsToggler","svg","settingsIcon","forceClose","defaultToolbarHeight","defaultOffset","newYCoordinate","offsetTop","style","transform","Math","floor","toolbarOpened","settingsTogglerClicked","hide","plusButtonHidden","show","buttonsOpened","wrappersOffset","storedSelection","showInlineToolbar","inlineToolbar","showButtons","getWrappersOffset","coords","getSelectionCoords","newCoordinateX","newCoordinateY","offsetHeight","x","left","y","scrollY","top","closeButtons","closeAction","createLinkAction","defaultToolAction","hightlight","getOffset","_x","_y","offsetLeft","clientLeft","clientTop","offsetParent","boundingLeft","boundingTop","getClientRects","rect","toString","showActions","action","inlineToolbarAnchorInputKeydown_","editable","restoreSelection","setAnchor","clearRange","isActive","isLinkActive","saveSelection","inputForLink","dataType","execCommand","containerEl","preSelectionRange","startContainer","end","savedSel","charIndex","nodeStack","foundStart","stop","nextCharIndex","pop","queryCommandState","setButtonHighlighted","removeButtonsHighLight","setting","toolType","settingsBlock","pluginSettings","blockSettings","makeRemoveBlockButton","removeBlockWrapper","settingButton","actionWrapper","confirmAction","cancelAction","removeButtonClicked","confirmRemovingRequest","cancelRemovingRequest","showRemoveActions","showSettingsButton","toolbarButtons","openedOnBlock","currentTool","Object","barButtons","nextToolIndex","toolToSelect","visibleTool","displayInToolbox","UNREPLACEBLE_TOOLS","newBlockContent","appendCallback","blockData","switchBlock","toolsUnavailable","values","IS_INLINE","inlineToolRequiredMethods","notImplementedMethods","entries","IS_ENABLED_LINE_BREAKS","IS_ENABLED_INLINE_TOOLBAR","IS_PASTE_DISALLOWED","hasOwnProperty","reject","sequenceData","getListOfPrepareFunctions","fallback","toolPreparationList","toolClass","appendSVGSprite","InlineToolbar","loadStyles","getElementById","editorWrapper","editorZone","styles","head","documentKeydown","documentClicked","keyCodes","enterPressed","defaultBehaviour","keyDownOnEditor","hasPointerToBlock","isAtEditor","highlightCurrentNode","clickedOnInlineToolbarButton","clickedInsideofEditor","handleShowingEvent","clickedNode","setCurrentBlockByChildNode","setToTheLastBlock","isInitialBlock","isInitial","isEmptyBlock","spriteHolder","sprite","Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","s","documentElement","parentElement","savedSelectionRange","searchDepth","parentTag","focusNode","boundNodes","searchDepthIterable","selectedNode","TEXT_NODE","boundingWidth","boundingHeight","getBoundingClientRect","span","spanParent","normalize","Util","msg","chains","previousValue","currentValue","iteration","waitNextBlock","successCallback","fallbackCallback","collection","slice","object","constructor","timeout","context","apply","SHIFT","CTRL","ALT","SPACE","DELETE","META"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;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;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;AClFA,whI;;;;;;;;;;;ACAA;AACA;AACA;;;;;;;;;;;;;8CCFA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;;AAEA;AACA;AACA,CAAC,E;;;;;;;;;;;;AC3BD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,KAAK;AACL,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yDAAyD;AACzD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX;;AAEA;AACA;AACA,wCAAwC,WAAW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;;AAEA;;AAEA,SAAS;AACT;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oCAAoC,cAAc;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,kBAAkB;AACnD;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB;;AAEjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,YAAY;AACZ;AACA;;AAEA;AACA,YAAY;AACZ;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,8CAA8C,QAAQ;AACtD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA,WAAW;AACX;AACA;AACA;;AAEA,WAAW;AACX;AACA;AACA;;AAEA,WAAW;AACX;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,8CAA8C,QAAQ;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;AC/tBA;;AAEA;;AAEA;;AAEA,oC;;;;;;;;;;;ACNA;AACA;;;;;;;;;;;;ACDA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA,mJAAwF;AACxF;AACA;AACA;;;;;;;;;;;;ACNA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACdA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,YAAY,eAAe;AAChC;AACA,KAAK;AACL;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,eAAe;AACzB;AACA;AACA;AACA,wCAAwC;AACxC;AACA,8BAA8B;AAC9B,6BAA6B;AAC7B,+BAA+B;AAC/B,mCAAmC;AACnC,SAAS,iCAAiC;AAC1C;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3CA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,sCAAsC;AAC9C;AACA;AACA;AACA;;;;;;;;;;;;AC3BA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACfA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2BAA2B,SAAS;AACpC;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA,2BAA2B,kBAAkB,EAAE;;AAE/C;AACA;AACA;AACA;AACA,GAAG,YAAY;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtBA,iBAAiB;;AAEjB;AACA;AACA;;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,6BAA6B;AAC7B,0BAA0B;AAC1B,0BAA0B;AAC1B,qBAAqB;AACrB;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,8EAA8E,OAAO;AACrF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC,qBAAqB;AACrB,0BAA0B;AAC1B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;;;;;;;;;;;AC/IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,qBAAqB;AACrB,0BAA0B;AAC1B;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;;;;;;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO,mCAAmC,gCAAgC,aAAa;AACvF,8BAA8B,mCAAmC,aAAa;AAC9E;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,qDAAqD;AACrD;AACA,kDAAkD,iBAAiB,EAAE;AACrE;AACA,wDAAwD,aAAa,EAAE,EAAE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;;;;;;;;;;;ACpFA,6BAA6B;AAC7B,uCAAuC;;;;;;;;;;;;;ACDvC;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACzBD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA,iCAAiC,QAAQ,mBAAmB,UAAU,EAAE,EAAE;AAC1E,CAAC;;;;;;;;;;;;ACHD;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACNA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,kFAAkF,uBAAuB;AACzG,iEAAiE;AACjE,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,eAAe;AACf,eAAe;AACf,eAAe;AACf,gBAAgB;AAChB;;;;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK,YAAY;AACjB,GAAG;AACH;;;;;;;;;;;;ACXA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,UAAU;AACvC;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,gCAAgC,qCAAqC;AACrE;AACA;AACA,2BAA2B,gCAAgC;AAC3D;AACA;AACA;;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,iBAAiB,EAAE;AAC1D;AACA;AACA;AACA;AACA;AACA,mEAAmE,gBAAgB;AACnF;AACA;AACA,GAAG,4CAA4C,gCAAgC;AAC/E;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA,yCAAyC;;;;;;;;;;;;ACLzC,uBAAuB;AACvB;AACA;AACA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;;;;;;;;;;;ACPA;AACA;;;;;;;;;;;;ACDA;AACA,uIAAsE,mBAAmB,UAAU,EAAE,EAAE;AACvG,CAAC;;;;;;;;;;;;ACFD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACLA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACLA;AACA;AACA;;;;;;;;;;;;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;;AAEA;AACA,uMAAkF,aAAa,EAAE;;AAEjG;AACA,qDAAqD,4BAA4B;AACjF;AACA;;;;;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C;AAC9C;AACA;AACA;;AAEA,8BAA8B,aAAa;;AAE3C;AACA;AACA;AACA;AACA;AACA,yCAAyC,oCAAoC;AAC7E,6CAA6C,oCAAoC;AACjF,KAAK,4BAA4B,oCAAoC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,mBAAmB;AACnC;AACA;AACA,kCAAkC,2BAA2B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;;;;;;;;;;;ACpEA;AACA;;AAEA;AACA;AACA,iCAAiC,qBAAqB;AACtD;AACA,iCAAiC,SAAS,EAAE;AAC5C,CAAC,YAAY;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,SAAS,qBAAqB;AAC3D,iCAAiC,aAAa;AAC9C;AACA,GAAG,YAAY;AACf;AACA;;;;;;;;;;;;ACrBA;AACA,UAAU;AACV;;;;;;;;;;;;ACFA;;;;;;;;;;;;ACAA;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACTD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACtBA;AACA;AACA;AACA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD,CAAC;AACD;AACA,qBAAqB;AACrB;AACA,SAAS;AACT,GAAG,EAAE;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpDA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,gBAAgB,EAAE;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClDA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,uCAAuC,sBAAsB,EAAE;AAC/D;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;;;;;;;;ACpEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,UAAU,EAAE;AAChD,mBAAmB,sCAAsC;AACzD,CAAC,qCAAqC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;ACjCD;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;;;;;;;;;;;ACxCA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,YAAY;AACf;AACA;AACA;AACA;;;;;;;;;;;;ACfA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG,YAAY;AACf;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;AClBA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACNA;;;;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACZA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACNA,cAAc;;;;;;;;;;;;ACAd;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,qDAAqD,OAAO,EAAE;AAC9D;;;;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;;;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACTA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACPD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;AACA,YAAY;AACZ,GAAG;AACH,YAAY;AACZ;AACA;;;;;;;;;;;;ACNA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;AACA,CAAC;AACD;AACA,CAAC;;;;;;;;;;;;AC9BD;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,GAAG,EAAE;AACL;;;;;;;;;;;;;AC3BA;AACA;AACA;;AAEA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,GAAG,EAAE;AACL;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA;AACA;AACA,OAAO,YAAY,cAAc;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,GAAG;AACR;AACA;;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,aAAa;AACnC,GAAG;AACH;;;;;;;;;;;;ACZA;AACA;AACA;;AAEA;AACA,oEAAoE,iCAAiC;AACrG;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA,kDAAkD;;AAElD;AACA,qEAAqE;AACrE,CAAC;AACD;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACXD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACRA;AACA;;AAEA;AACA;AACA;AACA,yCAAyC,cAAc;AACvD,GAAG;AACH;;;;;;;;;;;;ACRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AChBA,sBAAsB;AACtB;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;AClBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACfA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ,MAAM;AACd;AACA;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC7BA;AACA;;;;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;;;;;;;;;;;;ACLA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA,GAAG;;AAEH;AACA,4BAA4B;AAC5B,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iBAAiB,mBAAmB,0BAA0B,EAAE,EAAE;AAClE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,gCAAgC;AACzF;AACA,OAAO;AACP;AACA;AACA,6EAA6E,YAAY;AACzF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yDAAyD,6CAA6C,EAAE;;AAExG;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,mDAAmD;AACnD;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,oCAAoC;AACpC;AACA,KAAK;AACL,wEAAwE;AACxE;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,8DAA8D;AAC9D;AACA,KAAK;AACL,wEAAwE;AACxE;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH,yBAAyB,sBAAsB,EAAE,EAAE;AACnD;AACA;AACA;AACA;;AAEA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA,8BAA8B,aAAa;AAC3C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,sBAAsB,0BAA0B;AAChD,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,yBAAyB;AACzB,KAAK;AACL,uBAAuB;AACvB,2BAA2B;AAC3B,0BAA0B;AAC1B,2BAA2B;AAC3B,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B,aAAa;AACvC,OAAO;AACP;;AAEA;;AAEA;;AAEA;AACA;AACA,KAAK;;AAEL,uDAAuD,6BAA6B,EAAE;AACtF;AACA;AACA,KAAK;;AAEL;;AAEA;;AAEA;;AAEA,uDAAuD,YAAY;;AAEnE;;AAEA;;AAEA;AACA;AACA,KAAK,UAAU,gBAAgB;;AAE/B;AACA;AACA,KAAK;AACL;AACA,KAAK,WAAW,kCAAkC;;AAElD;AACA;AACA;AACA,CAAC,oCAAoC;;;;;;;;;;;;;AC/drC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,QAAQ,WAAW;AACnB;AACA;AACA,QAAQ,UAAU;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,WAAW;AACnB;AACA;AACA;AACA,QAAQ,WAAW;AACnB;AACA;AACA,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,yBAAyB,mBAAmB,uBAAuB,EAAE,EAAE;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,WAAW;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH,CAAC;AACD;AACA;AACA,GAAG;AACH,yBAAyB;AACzB,GAAG;AACH,uBAAuB;AACvB,0BAA0B;AAC1B,0BAA0B;AAC1B;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,iDAAiD,iBAAiB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACnRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;;AAEA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,sBAAsB;AAChF,kFAAkF,wBAAwB;AAC1G;;;;;;;;;;;;ACRA;;;;;;;;;;;;ACAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACPA;AACA;AACA,kHAAmD;;AAEnD,8BAA8B,8BAA8B,gBAAgB,EAAE,EAAE;;;;;;;;;;;;ACJhF;AACA;;AAEA,6BAA6B,sHAA8C;;AAE3E;;;;;;;;;;;;;ACLA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACTD;AACA;;AAEA,6BAA6B,kGAAiC;;AAE9D;;;;;;;;;;;;;ACLA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACTD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gBAAgB,EAAE;AAC5D;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,gBAAgB,EAAE;AAC5D;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACbA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACVD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,8IAA4E,kBAAkB,EAAE;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,gCAAgC;AACvF;AACA;AACA,KAAK;AACL;AACA,kCAAkC,gBAAgB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACpCD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACdD;AACA;;AAEA,6BAA6B,iGAAkC;;;;;;;;;;;;;ACH/D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC,cAAc;AACd,iBAAiB;AACjB;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACXD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,WAAW;AACrB;AACA;AACA,CAAC;;;;;;;;;;;;;ACrBD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACTD;AACA;AACA;;AAEA;AACA;AACA,gBAAgB;AAChB;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;AClBD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACTD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACTD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,UAAU;AACpB;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;AC3BD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACTD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACtBD;;;;;;;;;;;;ACAA;AACA;;AAEA,4BAA4B,mBAAmB,6BAA6B,EAAE,EAAE;;;;;;;;;;;;ACHhF;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACPD;AACA;AACA;AACA;;AAEA;AACA;AACA,mCAAmC,2BAA2B,UAAU,EAAE,EAAE;AAC5E,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACfD;AACA;;AAEA;;;;;;;;;;;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACXA;AACA;;AAEA,gCAAgC,sFAA2B;;;;;;;;;;;;;ACH3D;AACA;AACA;AACA;AACA;AACA;AACA,8JAA8F;AAC9F;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;;;;;;;;;;;ACZH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACfD;AACA;AACA;AACA;;AAEA;AACA;AACA,yBAAyB,mEAAmE;AAC5F,CAAC;AACD;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;AClBD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACjBD;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,yEAAyE,eAAe;;;;;;;;;;;;ACTxF;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACTD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACPD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;AACA;;AAEA,iEAAiE,gBAAgB;;;;;;;;;;;;ACJjF;AACA;;AAEA,4BAA4B,sGAAoC;;;;;;;;;;;;ACHhE;AACA;AACA;;AAEA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACxBD;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;AChBD;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACPD;AACA;;AAEA,4BAA4B,mGAAkC;;;;;;;;;;;;ACH9D;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACPD;AACA;;AAEA,4BAA4B,gGAAgC;;;;;;;;;;;;ACH5D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACdD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACXD;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACPD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD,KAAK;AACL;AACA,oCAAoC,cAAc,OAAO;AACzD,qCAAqC,cAAc,OAAO;AAC1D;AACA;AACA,oEAAoE,OAAO;AAC3E;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,0BAA0B,EAAE;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,iBAAiB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpEA;AACA;;AAEA,8BAA8B,4BAA4B;;;;;;;;;;;;ACH1D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;;AAEA,8BAA8B,uGAAsC;;;;;;;;;;;;ACHpE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACTD;AACA;;AAEA,8BAA8B,qCAAqC;;;;;;;;;;;;ACHnE;AACA;;AAEA,8BAA8B,sCAAsC;;;;;;;;;;;;ACHpE;AACA;AACA;AACA,+EAA+E,0BAA0B;;;;;;;;;;;;ACHzG;AACA;AACA;AACA,2EAA2E,sBAAsB;;;;;;;;;;;;;ACHjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,CAAC;;;;;;;;;;;;;ACjHD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA,sBAAsB;AACtB,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACjBD;AACA;;AAEA,0CAA0C,0GAAsC;;;;;;;;;;;;ACHhF;AACA;AACA,8BAA8B,0GAAsC;;;;;;;;;;;;ACFpE;AACA;AACA,yIAAuE,8GAA6C;;;;;;;;;;;;ACFpH;AACA;AACA,yIAAuE,4GAA4C;;;;;;;;;;;;ACFnH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACHD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACPD;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACPD;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACPD;AACA;AACA,8BAA8B,gGAA+B;;;;;;;;;;;;ACF7D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;AACA,8BAA8B,8GAA8C;;;;;;;;;;;;;ACF5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;;;;;;;;;;;ACTA;AACA;AACA;AACA,8DAA8D,0BAA0B;;;;;;;;;;;;ACHxF;AACA;AACA;AACA,0DAA0D,sBAAsB;;;;;;;;;;;;;ACHhF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,YAAY;AACf,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,mBAAmB,kCAAkC;AACrD,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,eAAe,uCAAuC;AACtD;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA,uBAAuB,0BAA0B;AACjD;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH,kBAAkB,yBAAyB,KAAK;AAChD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,wBAAwB;AACxB,gBAAgB;AAChB,oBAAoB;AACpB,wBAAwB;AACxB,gBAAgB;AAChB,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,0DAA0D,oBAAoB;AAC9E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,CAAC;;;;;;;;;;;;AC7RD;AACA;AACA;AACA;AACA,6GAAgD;AAChD;AACA;AACA;AACA,sBAAsB,cAAc;AACpC,CAAC;AACD;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACfD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iHAAoD;;AAEpD;AACA;AACA;AACA,gBAAgB;AAChB,mCAAmC,cAAc;AACjD,CAAC;AACD;AACA,0BAA0B,cAAc;AACxC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;AC9CD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC,MAAM,WAAW,OAAO,WAAW;AACnE,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACtBD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACVD;AACA;AACA;AACA;AACA;AACA,+BAA+B;AAC/B,cAAc;AACd,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC;AACxC,GAAG;AACH,UAAU;AACV,CAAC;;AAED;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACzBD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACTD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACTD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,+BAA+B,WAAW;;;;;;;;;;;;ACpB1C;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACPD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACVD;AACA;;AAEA,+BAA+B,iGAAkC;;;;;;;;;;;;ACHjE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACfD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACdD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA,+BAA+B,WAAW;;;;;;;;;;;;AChC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,kBAAkB,EAAE;AAC5C,0BAA0B,gBAAgB;AAC1C,KAAK;AACL;AACA,oCAAoC,iBAAiB;AACrD;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;AC1CA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACJD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;ACTD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;ACXD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;ACTD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAAgD;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,2BAA2B;AAClD,WAAW;AACX;AACA;AACA;AACA;AACA;AACA,mFAAmF;AACnF;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,CAAC;;;;;;;;;;;;;ACtED;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iGAAqC,wBAAwB,0BAA0B,YAAY,EAAE;AACrG;AACA;AACA;AACA;AACA,GAAG;AACH;AACA,CAAC;AACD;AACA;AACA,GAAG;AACH;;;;;;;;;;;;;ACxBA;AACA;AACA;AACA;;AAEA;AACA;AACA,yBAAyB,mEAAmE;AAC5F,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACbD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACRD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACnBD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACND;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;;;;;;;;;;;;ACtBD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACXD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B,cAAc;AACd;AACA,CAAC;AACD;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,UAAU;AACV,CAAC;;;;;;;;;;;;;AChBD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACND;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;;;;;;;;;;;ACjBD;;AAEA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACLD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACjBD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB;AACtB,sBAAsB,uBAAuB,WAAW,IAAI;AAC5D,GAAG;AACH,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;AACD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA,KAAK;AACL;AACA,sBAAsB,mCAAmC;AACzD,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gEAAgE,gCAAgC;AAChG;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0DAA0D,kBAAkB;;AAE5E;AACA;AACA;AACA,oBAAoB,uBAAuB;;AAE3C,oDAAoD,6BAA6B;;AAEjF;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,GAAG;AACH,0BAA0B,eAAe,EAAE;AAC3C,0BAA0B,gBAAgB;AAC1C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,OAAO,QAAQ,iCAAiC;AACpG,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,wEAAwE;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACzOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6EAA6E,4BAA4B;;AAEzG;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;AACD;AACA;AACA,6FAA6F;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;;;;;;;;;;;;AC7CA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACHD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACJD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACJD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACJD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACJD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACJD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACJD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACJD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACJD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACJD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,uBAAuB,4EAA4E,EAAE;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,GAAG;AACH;;;;;;;;;;;;;AC1DA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B,mEAAmE;AAChG,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACbD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;;ACpBA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;AAED;;;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACXD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;;AAEA,oBAAoB,4FAA+B;;;;;;;;;;;;ACHnD;AACA;;;;;;;;;;;;ACDA;AACA;;;;;;;;;;;;ACDA;AACA;;AAEA,uCAAuC,2HAAkD;;;;;;;;;;;;ACHzF;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACPD;AACA;;AAEA,4BAA4B,6BAA6B;;;;;;;;;;;;ACHzD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACTD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACVD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACfD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACVD;AACA;;AAEA,4BAA4B,6BAA6B;;;;;;;;;;;;ACHzD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;;AAEA,4BAA4B,mGAAkC;;;;;;;;;;;;ACH9D;AACA;;AAEA,4BAA4B;AAC5B;AACA;AACA,CAAC,EAAE;;;;;;;;;;;;ACNH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACfD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C,+DAA+D;AACzG;AACA,CAAC;;;;;;;;;;;;;ACXD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0CAA0C,+DAA+D;AACzG;AACA,CAAC;;;;;;;;;;;;ACXD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACRD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACrBD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;;;;;;;;;;;;ACjBD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;;;;;;;;;;;ACjBD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACRD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,4BAA4B;AACxG;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;;AAEA,uCAAuC;AACvC,uCAAuC,yBAAyB;AAChE,CAAC;;AAED;AACA;AACA;;AAEA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP,0BAA0B,aAAa;AACvC,KAAK;AACL,GAAG;AACH;AACA,+DAA+D,OAAO;AACtE;AACA;AACA;AACA;AACA,yBAAyB,kBAAkB;AAC3C;AACA;AACA,WAAW;AACX;AACA,OAAO;AACP,0BAA0B,aAAa;AACvC,KAAK;AACL;AACA,CAAC;;AAED,qDAAqD,aAAa,EAAE;;AAEpE,oBAAoB,0BAA0B;;AAE9C;;;;;;;;;;;;;ACtMA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA,8DAA8D,UAAU,EAAE;AAC1E,KAAK;AACL;AACA,8DAA8D,SAAS,EAAE;AACzE,KAAK;AACL;AACA,CAAC,EAAE;;;;;;;;;;;;;ACnBH;AACA;AACA;AACA;AACA;;AAEA,+BAA+B;AAC/B;AACA;AACA;AACA;AACA,CAAC,EAAE;;;;;;;;;;;;ACXH;AACA;AACA;AACA;;AAEA,cAAc;AACd;AACA,CAAC,EAAE;;;;;;;;;;;;ACPH;AACA;AACA;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;;;;;;;;;;;ACdH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc;AACd;AACA,CAAC,EAAE;;;;;;;;;;;;AClBH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc;AACd;AACA,CAAC,EAAE;;;;;;;;;;;;AChBH;AACA;AACA;AACA;;AAEA,cAAc;AACd;AACA,CAAC,EAAE;;;;;;;;;;;;ACPH;AACA;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA,CAAC,EAAE;;;;;;;;;;;;ACRH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,cAAc;AACd;AACA,CAAC,EAAE;;;;;;;;;;;;ACfH;AACA;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA,CAAC,EAAE;;;;;;;;;;;;ACRH;AACA;AACA;AACA;AACA;;AAEA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE;;;;;;;;;;;;ACdH;AACA;;;;;;;;;;;;ACDA;AACA;;;;;;;;;;;;ACDA;AACA;;AAEA,uCAAuC,2HAAkD;;;;;;;;;;;;;ACHzF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACTD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;AC7BD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACXD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACXD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;ACND;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACND;;;;;;;;;;;;ACAA;;;;;;;;;;;;ACAA;AACA;;AAEA,8BAA8B,4FAA+B;;;;;;;;;;;;ACH7D;AACA;;;;;;;;;;;;ACDA;AACA;;;;;;;;;;;;ACDA;AACA;;;;;;;;;;;;ACDA;AACA;;;;;;;;;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,oDAAoD,wBAAwB;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACLD;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;ACnBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACpMA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mCAAmC,gBAAgB;AACnD,IAAI;AACJ;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;AACA;AACA,YAAY,oBAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,oDAAoD,cAAc;;AAElE;AACA;;;;;;;;;;;;AC3EA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA,GAAG,QAIH;AACA,CAAC;;AAED;AACA,aAAa,OAAO;AACpB,aAAa,QAAQ;AACrB;AACA;;AAEA;AACA;;AAEA;AACA,wBAAwB,iCAAiC,EAAE;AAC3D,6BAA6B,uEAAuE,EAAE;;AAEtG;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,QAAQ;;AAExB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,+DAA+D;AAC/D;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;A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ACL,YAAI,CAAC,KAAKnC,MAAL,CAAYiC,IAAZ,CAAiBC,KAAlB,IAA2B,KAAKlC,MAAL,CAAYiC,IAAZ,CAAiBC,KAAjB,CAAuBa,MAAvB,KAAkC,CAAjE,EAAoE;AAClE,eAAK/C,MAAL,CAAYiC,IAAZ,CAAiBC,KAAjB,GAAyB,CAAEC,YAAF,CAAzB;AACD;AACF;;AAED;;;AAGA,UAAI,CAACnC,OAAOmC,YAAZ,EAA0B;AACxB,aAAK,KAAKnC,MAAL,CAAYmC,YAAjB,IAAiC,KAAKnC,MAAL,CAAY4C,KAA7C;AAAoD;AAApD;AACD,OAFD,MAEO;AACL,aAAK5C,MAAL,CAAYmC,YAAZ,GAA2BnC,OAAOmC,YAAlC;AACD;AACF;;AAED;;;;;wBAIoB;AAClB,aAAO,KAAKnC,MAAZ;AACD;;;;;;;kBAlHkBD,W;AAqNpB;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IC/Yc,M;AAcZ;;;;AAIA,0BAAmC;AAAA,YAAtB,MAAsB,QAAtB,MAAsB;;AAAA;;AACjC,YAAI,IAAI,MAAJ,KAAe,MAAnB,EAA2B;AACzB,kBAAM,IAAI,SAAJ,CAAc,yDAAd,CAAN;AACD;AAED,aAAK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AAjC,CAAzB,EAAkE;AAChE5F,iBAAOA,KAAKL,UAAZ;AACD;;AAED,eAAOK,IAAP;AACD;AACF;AAxGH;AAAA;;;AA0GE;;;;;;;;AA1GF,gCAkHc/E,IAlHd,EAkHoB;AAChB,UAAI0S,WAAW,KAAKC,aAAL,CAAmB3S,IAAnB,CAAf;;AAEA,UAAI,KAAKoH,WAAT,EAAsB;AACpB,aAAKA,WAAL,CAAiBwL,qBAAjB,CAAuC,UAAvC,EAAmDF,QAAnD;AACD,OAFD,MAEO;AACL;;;AAGA,aAAKT,MAAL,CAAYrK,EAAZ,CAAewG,KAAf,CAAqB0B,QAArB,CAA8BjP,WAA9B,CAA0C6R,QAA1C;AACD;;AAED;;;AAGA,WAAKtL,WAAL,GAAmBsL,QAAnB;;AAEA,aAAOA,SAASnL,OAAT,CAAiBkL,MAAxB;AACD;AApIH;AAAA;AAAA,sBAiCYR,MAjCZ,EAiCoB;AAChB,WAAKA,MAAL,GAAcA,MAAd;AACD;;AAED;;;;;;AArCF;AAAA;AAAA,wBA0CoB;AAChB,aAAO,KAAKG,YAAZ;AACD;;AAED;;;;;AA9CF;AAAA,sBAmDkBrN,IAnDlB,EAmDwB;AACpB,UAAImI,kBAAkB,KAAKE,kBAAL,CAAwBrI,IAAxB,CAAtB;;AAEA,WAAKqN,YAAL,GAAoBlF,eAApB;AACD;AAvDH;;AAAA;AAAA;;AAuIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,U;;;;;;;;;;;;;;;;AC56BA;;;;;;;AAOAzQ,OAAOsK,OAAP,GAAiB,UAAU8L,SAAV,EAAqB;AACpC,MAAI5L,SAASC,MAAM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P;AAKD;;AAED;;;;;;;;+BAKWF,gB,EAAkB;AAC3B,UAAIniB,QAAQ,EAAZ;AAAA,UACEsiB,YAAY,CADd;;AAGA7jB,cAAQ8jB,cAAR,CAAuB,uBAAvB;;AAEAJ,uBAAiBpjB,OAAjB,CAAyB,UAACyjB,UAAD,EAAgB;AACvC;AACA/jB,gBAAQC,GAAR,UAAgB8jB,WAAWrhB,IAA3B,uBAAgDqhB,UAAhD;AACAF,qBAAaE,WAAW1f,IAAxB;AACA9C,cAAMyH,IAAN,CAAW;AACTvH,gBAAMsiB,WAAWrhB,IADR;AAETpB,gBAAMyiB,WAAWziB;AAFR,SAAX;AAID,OARD;;AAUAtB,cAAQC,GAAR,CAAY,OAAZ,EAAqB4jB,SAArB;AACA7jB,cAAQgkB,QAAR;;AAEA,aAAO;AACL3f,cAAU,CAAC,IAAI4f,IAAJ,EADN;AAEL1iB,eAAUA,KAFL;AAGL2iB,iBAAU,OAAAC;AAHL,OAAP;AAKD;;;;EA5DgC5jB,M;;AA+DnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;kBA1fqBmb,E;;;;;;;;;;;;;;;;AC9BrB;;;;;AAKA,IAAI,CAACiU,QAAQC,SAAR,CAAkBC,OAAvB,EACEF,QAAQC,SAAR,CAAkBC,OAAlB,GAA4BF,QAAQC,SAAR,CAAkBE,iBAAlB,IACtBH,QAAQC,SAAR,CAAkBG,qBADxB;;AAGF,IAAI,CAACJ,QAAQC,SAAR,CAAkBzS,OAAvB,EACEwS,QAAQC,SAAR,CAAkBzS,OAAlB,GAA4B,UAAU6S,CAAV,EAAa;AACvC,MAAI7pB,KAAK,IAAT;;AAEA,MAAI,CAACrB,SAASmrB,eAAT,CAAyBlf,Q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","file":"codex-editor.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CodexEditor\"] = factory();\n\telse\n\t\troot[\"CodexEditor\"] = factory();\n})(window, function() {\nreturn "," \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// 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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","module.exports = \"\\n\\n\\r\\n \\r\\n\\n\\n\\r\\n \\r\\n\\n\\n\\r\\n \\r\\n\\n\\n\\r\\n \\r\\n\\n\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\n\\n\\r\\n \\r\\n\\n\\n\\r\\n \\r\\n\\n\\n\\r\\n \\r\\n\\n\\n\\r\\n \\r\\n\\n\"","/* eslint max-len: 0 */\n// TODO: eventually deprecate this console.trace(\"use the `babel-register` package instead of `babel-core/register`\");\nmodule.exports = require(\"babel-register\");\n","\"use strict\";\n\nrequire(\"core-js/shim\");\n\nrequire(\"regenerator-runtime/runtime\");\n\nrequire(\"core-js/fn/regexp/escape\");\n\nif (global._babelPolyfill) {\n throw new Error(\"only one instance of babel-polyfill is allowed\");\n}\nglobal._babelPolyfill = true;\n\nvar DEFINE_PROPERTY = \"defineProperty\";\nfunction define(O, key, value) {\n O[key] || Object[DEFINE_PROPERTY](O, key, {\n writable: true,\n configurable: true,\n value: value\n });\n}\n\ndefine(String.prototype, \"padLeft\", \"\".padStart);\ndefine(String.prototype, \"padRight\", \"\".padEnd);\n\n\"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill\".split(\",\").forEach(function (key) {\n [][key] && define(Array, key, Function.call.bind([][key]));\n});","/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n!(function(global) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration. If the Promise is rejected, however, the\n // result for this iteration will be rejected with the same\n // reason. Note that rejections of yielded Promises are not\n // thrown back into the generator function, as is the case\n // when an awaited Promise is rejected. This difference in\n // behavior between yield and await is important, because it\n // allows the consumer to decide what to do with the yielded\n // rejection (swallow it and continue, manually .throw it back\n // into the generator, abandon iteration, whatever). With\n // await, by contrast, there is no opportunity to examine the\n // rejection reason outside the generator function, so the\n // only option is to throw it from the await expression, and\n // let the generator function handle the exception.\n result.value = unwrapped;\n resolve(result);\n }, reject);\n }\n }\n\n if (typeof global.process === \"object\" && global.process.domain) {\n invoke = global.process.domain.bind(invoke);\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // Among the various tricks for obtaining a reference to the global\n // object, this seems to be the most reliable technique that does not\n // use indirect eval (which violates Content Security Policy).\n typeof global === \"object\" ? global :\n typeof window === \"object\" ? window :\n typeof self === \"object\" ? self : this\n);\n","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function () {};\n\nmodule.exports = exports[\"default\"];","require('../../modules/core.regexp.escape');\nmodule.exports = require('../../modules/_core').RegExp.escape;\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","var cof = require('./_cof');\nmodule.exports = function (it, msg) {\n if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);\n return +it;\n};\n","// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = require('./_wks')('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) require('./_hide')(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n","module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n","var isObject = require('./_is-object');\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\n\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n'use strict';\nvar toObject = require('./_to-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var aLen = arguments.length;\n var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);\n var end = aLen > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n","var forOf = require('./_for-of');\n\nmodule.exports = function (iter, ITERATOR) {\n var result = [];\n forOf(iter, false, result.push, result, ITERATOR);\n return result;\n};\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = require('./_ctx');\nvar IObject = require('./_iobject');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar asc = require('./_array-species-create');\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n","var aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar toLength = require('./_to-length');\n\nmodule.exports = function (that, callbackfn, aLen, memo, isRight) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IObject(O);\n var length = toLength(O.length);\n var index = isRight ? length - 1 : 0;\n var i = isRight ? -1 : 1;\n if (aLen < 2) for (;;) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (isRight ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n};\n","var isObject = require('./_is-object');\nvar isArray = require('./_is-array');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n","// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = require('./_array-species-constructor');\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n","'use strict';\nvar aFunction = require('./_a-function');\nvar isObject = require('./_is-object');\nvar invoke = require('./_invoke');\nvar arraySlice = [].slice;\nvar factories = {};\n\nvar construct = function (F, len, args) {\n if (!(len in factories)) {\n for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');\n } return factories[len](F, args);\n};\n\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = arraySlice.call(arguments, 1);\n var bound = function (/* args... */) {\n var args = partArgs.concat(arraySlice.call(arguments));\n return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);\n };\n if (isObject(fn.prototype)) bound.prototype = fn.prototype;\n return bound;\n};\n","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\nvar TAG = require('./_wks')('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n","'use strict';\nvar dP = require('./_object-dp').f;\nvar create = require('./_object-create');\nvar redefineAll = require('./_redefine-all');\nvar ctx = require('./_ctx');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar $iterDefine = require('./_iter-define');\nvar step = require('./_iter-step');\nvar setSpecies = require('./_set-species');\nvar DESCRIPTORS = require('./_descriptors');\nvar fastKey = require('./_meta').fastKey;\nvar validate = require('./_validate-collection');\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar classof = require('./_classof');\nvar from = require('./_array-from-iterable');\nmodule.exports = function (NAME) {\n return function toJSON() {\n if (classof(this) != NAME) throw TypeError(NAME + \"#toJSON isn't generic\");\n return from(this);\n };\n};\n","'use strict';\nvar redefineAll = require('./_redefine-all');\nvar getWeak = require('./_meta').getWeak;\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar createArrayMethod = require('./_array-methods');\nvar $has = require('./_has');\nvar validate = require('./_validate-collection');\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n","'use strict';\nvar global = require('./_global');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar redefineAll = require('./_redefine-all');\nvar meta = require('./_meta');\nvar forOf = require('./_for-of');\nvar anInstance = require('./_an-instance');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar $iterDetect = require('./_iter-detect');\nvar setToStringTag = require('./_set-to-string-tag');\nvar inheritIfRequired = require('./_inherit-if-required');\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n","var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n","'use strict';\nvar $defineProperty = require('./_object-dp');\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n","'use strict';\n// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar fails = require('./_fails');\nvar getTime = Date.prototype.getTime;\nvar $toISOString = Date.prototype.toISOString;\n\nvar lz = function (num) {\n return num > 9 ? num : '0' + num;\n};\n\n// PhantomJS / old WebKit has a broken implementations\nmodule.exports = (fails(function () {\n return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';\n}) || !fails(function () {\n $toISOString.call(new Date(NaN));\n})) ? function toISOString() {\n if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');\n var d = this;\n var y = d.getUTCFullYear();\n var m = d.getUTCMilliseconds();\n var s = y < 0 ? '-' : y > 9999 ? '+' : '';\n return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +\n '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +\n 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +\n ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';\n} : $toISOString;\n","'use strict';\nvar anObject = require('./_an-object');\nvar toPrimitive = require('./_to-primitive');\nvar NUMBER = 'number';\n\nmodule.exports = function (hint) {\n if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');\n return toPrimitive(anObject(this), hint != NUMBER);\n};\n","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};\n","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar document = require('./_global').document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar ctx = require('./_ctx');\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n","var MATCH = require('./_wks')('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n","'use strict';\nvar hide = require('./_hide');\nvar redefine = require('./_redefine');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar wks = require('./_wks');\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n","'use strict';\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = require('./_an-object');\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n","'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar isArray = require('./_is-array');\nvar isObject = require('./_is-object');\nvar toLength = require('./_to-length');\nvar ctx = require('./_ctx');\nvar IS_CONCAT_SPREADABLE = require('./_wks')('isConcatSpreadable');\n\nfunction flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;\n var element, spreadable;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n spreadable = false;\n if (isObject(element)) {\n spreadable = element[IS_CONCAT_SPREADABLE];\n spreadable = spreadable !== undefined ? !!spreadable : isArray(element);\n }\n\n if (spreadable && depth > 0) {\n targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;\n } else {\n if (targetIndex >= 0x1fffffffffffff) throw TypeError();\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n}\n\nmodule.exports = flattenIntoArray;\n","var ctx = require('./_ctx');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar anObject = require('./_an-object');\nvar toLength = require('./_to-length');\nvar getIterFn = require('./core.get-iterator-method');\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n","var dP = require('./_object-dp');\nvar createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n","var isObject = require('./_is-object');\nvar setPrototypeOf = require('./_set-proto').set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n","// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n","// check on default Array iterator\nvar Iterators = require('./_iterators');\nvar ITERATOR = require('./_wks')('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","// 20.1.2.3 Number.isInteger(number)\nvar isObject = require('./_is-object');\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n","// 7.2.8 IsRegExp(argument)\nvar isObject = require('./_is-object');\nvar cof = require('./_cof');\nvar MATCH = require('./_wks')('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","'use strict';\nvar LIBRARY = require('./_library');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar $iterCreate = require('./_iter-create');\nvar setToStringTag = require('./_set-to-string-tag');\nvar getPrototypeOf = require('./_object-gpo');\nvar ITERATOR = require('./_wks')('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n","var ITERATOR = require('./_wks')('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","module.exports = {};\n","module.exports = false;\n","// 20.2.2.14 Math.expm1(x)\nvar $expm1 = Math.expm1;\nmodule.exports = (!$expm1\n // Old FF bug\n || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168\n // Tor Browser bug\n || $expm1(-2e-17) != -2e-17\n) ? function expm1(x) {\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;\n} : $expm1;\n","// 20.2.2.16 Math.fround(x)\nvar sign = require('./_math-sign');\nvar pow = Math.pow;\nvar EPSILON = pow(2, -52);\nvar EPSILON32 = pow(2, -23);\nvar MAX32 = pow(2, 127) * (2 - EPSILON32);\nvar MIN32 = pow(2, -126);\n\nvar roundTiesToEven = function (n) {\n return n + 1 / EPSILON - 1 / EPSILON;\n};\n\nmodule.exports = Math.fround || function fround(x) {\n var $abs = Math.abs(x);\n var $sign = sign(x);\n var a, result;\n if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;\n a = (1 + EPSILON32 / EPSILON) * $abs;\n result = a - (a - $abs);\n // eslint-disable-next-line no-self-compare\n if (result > MAX32 || result != result) return $sign * Infinity;\n return $sign * result;\n};\n","// 20.2.2.20 Math.log1p(x)\nmodule.exports = Math.log1p || function log1p(x) {\n return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);\n};\n","// https://rwaldron.github.io/proposal-math-extensions/\nmodule.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {\n if (\n arguments.length === 0\n // eslint-disable-next-line no-self-compare\n || x != x\n // eslint-disable-next-line no-self-compare\n || inLow != inLow\n // eslint-disable-next-line no-self-compare\n || inHigh != inHigh\n // eslint-disable-next-line no-self-compare\n || outLow != outLow\n // eslint-disable-next-line no-self-compare\n || outHigh != outHigh\n ) return NaN;\n if (x === Infinity || x === -Infinity) return x;\n return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;\n};\n","// 20.2.2.28 Math.sign(x)\nmodule.exports = Math.sign || function sign(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n};\n","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","var Map = require('./es6.map');\nvar $export = require('./_export');\nvar shared = require('./_shared')('metadata');\nvar store = shared.store || (shared.store = new (require('./es6.weak-map'))());\n\nvar getOrCreateMetadataMap = function (target, targetKey, create) {\n var targetMetadata = store.get(target);\n if (!targetMetadata) {\n if (!create) return undefined;\n store.set(target, targetMetadata = new Map());\n }\n var keyMetadata = targetMetadata.get(targetKey);\n if (!keyMetadata) {\n if (!create) return undefined;\n targetMetadata.set(targetKey, keyMetadata = new Map());\n } return keyMetadata;\n};\nvar ordinaryHasOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? false : metadataMap.has(MetadataKey);\n};\nvar ordinaryGetOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);\n};\nvar ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {\n getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);\n};\nvar ordinaryOwnMetadataKeys = function (target, targetKey) {\n var metadataMap = getOrCreateMetadataMap(target, targetKey, false);\n var keys = [];\n if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });\n return keys;\n};\nvar toMetaKey = function (it) {\n return it === undefined || typeof it == 'symbol' ? it : String(it);\n};\nvar exp = function (O) {\n $export($export.S, 'Reflect', O);\n};\n\nmodule.exports = {\n store: store,\n map: getOrCreateMetadataMap,\n has: ordinaryHasOwnMetadata,\n get: ordinaryGetOwnMetadata,\n set: ordinaryDefineOwnMetadata,\n keys: ordinaryOwnMetadataKeys,\n key: toMetaKey,\n exp: exp\n};\n","var global = require('./_global');\nvar macrotask = require('./_task').set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = require('./_cof')(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n var promise = Promise.resolve(undefined);\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n","'use strict';\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = require('./_a-function');\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\nvar dPs = require('./_object-dps');\nvar enumBugKeys = require('./_enum-bug-keys');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n require('./_html').appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n","var anObject = require('./_an-object');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar toPrimitive = require('./_to-primitive');\nvar dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","'use strict';\n// Forced replacement prototype accessors methods\nmodule.exports = require('./_library') || !require('./_fails')(function () {\n var K = Math.random();\n // In FF throws only define methods\n // eslint-disable-next-line no-undef, no-useless-call\n __defineSetter__.call(null, K, function () { /* empty */ });\n delete require('./_global')[K];\n});\n","var pIE = require('./_object-pie');\nvar createDesc = require('./_property-desc');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar has = require('./_has');\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = require('./_descriptors') ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = require('./_object-keys-internal');\nvar hiddenKeys = require('./_enum-bug-keys').concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n","exports.f = Object.getOwnPropertySymbols;\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","var has = require('./_has');\nvar toIObject = require('./_to-iobject');\nvar arrayIndexOf = require('./_array-includes')(false);\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n","exports.f = {}.propertyIsEnumerable;\n","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\nvar core = require('./_core');\nvar fails = require('./_fails');\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n","var getKeys = require('./_object-keys');\nvar toIObject = require('./_to-iobject');\nvar isEnum = require('./_object-pie').f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) if (isEnum.call(O, key = keys[i++])) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n } return result;\n };\n};\n","// all object keys, includes non-enumerable and symbols\nvar gOPN = require('./_object-gopn');\nvar gOPS = require('./_object-gops');\nvar anObject = require('./_an-object');\nvar Reflect = require('./_global').Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {\n var keys = gOPN.f(anObject(it));\n var getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n","var $parseFloat = require('./_global').parseFloat;\nvar $trim = require('./_string-trim').trim;\n\nmodule.exports = 1 / $parseFloat(require('./_string-ws') + '-0') !== -Infinity ? function parseFloat(str) {\n var string = $trim(String(str), 3);\n var result = $parseFloat(string);\n return result === 0 && string.charAt(0) == '-' ? -0 : result;\n} : $parseFloat;\n","var $parseInt = require('./_global').parseInt;\nvar $trim = require('./_string-trim').trim;\nvar ws = require('./_string-ws');\nvar hex = /^[-+]?0[xX]/;\n\nmodule.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {\n var string = $trim(String(str), 3);\n return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));\n} : $parseInt;\n","module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n","var anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar newPromiseCapability = require('./_new-promise-capability');\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n","var redefine = require('./_redefine');\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar has = require('./_has');\nvar SRC = require('./_uid')('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\nrequire('./_core').inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n","module.exports = function (regExp, replace) {\n var replacer = replace === Object(replace) ? function (part) {\n return replace[part];\n } : replace;\n return function (it) {\n return String(it).replace(regExp, replacer);\n };\n};\n","// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar ctx = require('./_ctx');\nvar forOf = require('./_for-of');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {\n var mapFn = arguments[1];\n var mapping, A, n, cb;\n aFunction(this);\n mapping = mapFn !== undefined;\n if (mapping) aFunction(mapFn);\n if (source == undefined) return new this();\n A = [];\n if (mapping) {\n n = 0;\n cb = ctx(mapFn, arguments[2], 2);\n forOf(source, false, function (nextItem) {\n A.push(cb(nextItem, n++));\n });\n } else {\n forOf(source, false, A.push, A);\n }\n return new this(A);\n } });\n};\n","'use strict';\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = require('./_export');\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { of: function of() {\n var length = arguments.length;\n var A = new Array(length);\n while (length--) A[length] = arguments[length];\n return new this(A);\n } });\n};\n","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","'use strict';\nvar global = require('./_global');\nvar dP = require('./_object-dp');\nvar DESCRIPTORS = require('./_descriptors');\nvar SPECIES = require('./_wks')('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n","var def = require('./_object-dp').f;\nvar has = require('./_has');\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n","var shared = require('./_shared')('keys');\nvar uid = require('./_uid');\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n","var core = require('./_core');\nvar global = require('./_global');\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n","// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar SPECIES = require('./_wks')('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n","'use strict';\nvar fails = require('./_fails');\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = require('./_is-regexp');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n","var $export = require('./_export');\nvar fails = require('./_fails');\nvar defined = require('./_defined');\nvar quot = /\"/g;\n// B.2.3.2.1 CreateHTML(string, tag, attribute, value)\nvar createHTML = function (string, tag, attribute, value) {\n var S = String(defined(string));\n var p1 = '<' + tag;\n if (attribute !== '') p1 += ' ' + attribute + '=\"' + String(value).replace(quot, '"') + '\"';\n return p1 + '>' + S + '';\n};\nmodule.exports = function (NAME, exec) {\n var O = {};\n O[NAME] = exec(createHTML);\n $export($export.P + $export.F * fails(function () {\n var test = ''[NAME]('\"');\n return test !== test.toLowerCase() || test.split('\"').length > 3;\n }), 'String', O);\n};\n","// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = require('./_to-length');\nvar repeat = require('./_string-repeat');\nvar defined = require('./_defined');\n\nmodule.exports = function (that, maxLength, fillString, left) {\n var S = String(defined(that));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n if (intMaxLength <= stringLength || fillStr == '') return S;\n var fillLen = intMaxLength - stringLength;\n var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n","'use strict';\nvar toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n\nmodule.exports = function repeat(count) {\n var str = String(defined(this));\n var res = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n","var $export = require('./_export');\nvar defined = require('./_defined');\nvar fails = require('./_fails');\nvar spaces = require('./_string-ws');\nvar space = '[' + spaces + ']';\nvar non = '\\u200b\\u0085';\nvar ltrim = RegExp('^' + space + space + '*');\nvar rtrim = RegExp(space + space + '*$');\n\nvar exporter = function (KEY, exec, ALIAS) {\n var exp = {};\n var FORCE = fails(function () {\n return !!spaces[KEY]() || non[KEY]() != non;\n });\n var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];\n if (ALIAS) exp[ALIAS] = fn;\n $export($export.P + $export.F * FORCE, 'String', exp);\n};\n\n// 1 -> String#trimLeft\n// 2 -> String#trimRight\n// 3 -> String#trim\nvar trim = exporter.trim = function (string, TYPE) {\n string = String(defined(string));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n};\n\nmodule.exports = exporter;\n","module.exports = '\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003' +\n '\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n","var ctx = require('./_ctx');\nvar invoke = require('./_invoke');\nvar html = require('./_html');\nvar cel = require('./_dom-create');\nvar global = require('./_global');\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (require('./_cof')(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","// https://tc39.github.io/ecma262/#sec-toindex\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length!');\n return length;\n};\n","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n","'use strict';\nif (require('./_descriptors')) {\n var LIBRARY = require('./_library');\n var global = require('./_global');\n var fails = require('./_fails');\n var $export = require('./_export');\n var $typed = require('./_typed');\n var $buffer = require('./_typed-buffer');\n var ctx = require('./_ctx');\n var anInstance = require('./_an-instance');\n var propertyDesc = require('./_property-desc');\n var hide = require('./_hide');\n var redefineAll = require('./_redefine-all');\n var toInteger = require('./_to-integer');\n var toLength = require('./_to-length');\n var toIndex = require('./_to-index');\n var toAbsoluteIndex = require('./_to-absolute-index');\n var toPrimitive = require('./_to-primitive');\n var has = require('./_has');\n var classof = require('./_classof');\n var isObject = require('./_is-object');\n var toObject = require('./_to-object');\n var isArrayIter = require('./_is-array-iter');\n var create = require('./_object-create');\n var getPrototypeOf = require('./_object-gpo');\n var gOPN = require('./_object-gopn').f;\n var getIterFn = require('./core.get-iterator-method');\n var uid = require('./_uid');\n var wks = require('./_wks');\n var createArrayMethod = require('./_array-methods');\n var createArrayIncludes = require('./_array-includes');\n var speciesConstructor = require('./_species-constructor');\n var ArrayIterators = require('./es6.array.iterator');\n var Iterators = require('./_iterators');\n var $iterDetect = require('./_iter-detect');\n var setSpecies = require('./_set-species');\n var arrayFill = require('./_array-fill');\n var arrayCopyWithin = require('./_array-copy-within');\n var $DP = require('./_object-dp');\n var $GOPD = require('./_object-gopd');\n var dP = $DP.f;\n var gOPD = $GOPD.f;\n var RangeError = global.RangeError;\n var TypeError = global.TypeError;\n var Uint8Array = global.Uint8Array;\n var ARRAY_BUFFER = 'ArrayBuffer';\n var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;\n var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\n var PROTOTYPE = 'prototype';\n var ArrayProto = Array[PROTOTYPE];\n var $ArrayBuffer = $buffer.ArrayBuffer;\n var $DataView = $buffer.DataView;\n var arrayForEach = createArrayMethod(0);\n var arrayFilter = createArrayMethod(2);\n var arraySome = createArrayMethod(3);\n var arrayEvery = createArrayMethod(4);\n var arrayFind = createArrayMethod(5);\n var arrayFindIndex = createArrayMethod(6);\n var arrayIncludes = createArrayIncludes(true);\n var arrayIndexOf = createArrayIncludes(false);\n var arrayValues = ArrayIterators.values;\n var arrayKeys = ArrayIterators.keys;\n var arrayEntries = ArrayIterators.entries;\n var arrayLastIndexOf = ArrayProto.lastIndexOf;\n var arrayReduce = ArrayProto.reduce;\n var arrayReduceRight = ArrayProto.reduceRight;\n var arrayJoin = ArrayProto.join;\n var arraySort = ArrayProto.sort;\n var arraySlice = ArrayProto.slice;\n var arrayToString = ArrayProto.toString;\n var arrayToLocaleString = ArrayProto.toLocaleString;\n var ITERATOR = wks('iterator');\n var TAG = wks('toStringTag');\n var TYPED_CONSTRUCTOR = uid('typed_constructor');\n var DEF_CONSTRUCTOR = uid('def_constructor');\n var ALL_CONSTRUCTORS = $typed.CONSTR;\n var TYPED_ARRAY = $typed.TYPED;\n var VIEW = $typed.VIEW;\n var WRONG_LENGTH = 'Wrong length!';\n\n var $map = createArrayMethod(1, function (O, length) {\n return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);\n });\n\n var LITTLE_ENDIAN = fails(function () {\n // eslint-disable-next-line no-undef\n return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;\n });\n\n var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {\n new Uint8Array(1).set({});\n });\n\n var toOffset = function (it, BYTES) {\n var offset = toInteger(it);\n if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');\n return offset;\n };\n\n var validate = function (it) {\n if (isObject(it) && TYPED_ARRAY in it) return it;\n throw TypeError(it + ' is not a typed array!');\n };\n\n var allocate = function (C, length) {\n if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {\n throw TypeError('It is not a typed array constructor!');\n } return new C(length);\n };\n\n var speciesFromList = function (O, list) {\n return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);\n };\n\n var fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = allocate(C, length);\n while (length > index) result[index] = list[index++];\n return result;\n };\n\n var addGetter = function (it, key, internal) {\n dP(it, key, { get: function () { return this._d[internal]; } });\n };\n\n var $from = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iterFn = getIterFn(O);\n var i, length, values, result, step, iterator;\n if (iterFn != undefined && !isArrayIter(iterFn)) {\n for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {\n values.push(step.value);\n } O = values;\n }\n if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);\n for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n };\n\n var $of = function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = allocate(this, length);\n while (length > index) result[index] = arguments[index++];\n return result;\n };\n\n // iOS Safari 6.x fails here\n var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });\n\n var $toLocaleString = function toLocaleString() {\n return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);\n };\n\n var proto = {\n copyWithin: function copyWithin(target, start /* , end */) {\n return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n },\n every: function every(callbackfn /* , thisArg */) {\n return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars\n return arrayFill.apply(validate(this), arguments);\n },\n filter: function filter(callbackfn /* , thisArg */) {\n return speciesFromList(this, arrayFilter(validate(this), callbackfn,\n arguments.length > 1 ? arguments[1] : undefined));\n },\n find: function find(predicate /* , thisArg */) {\n return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n findIndex: function findIndex(predicate /* , thisArg */) {\n return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n forEach: function forEach(callbackfn /* , thisArg */) {\n arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n indexOf: function indexOf(searchElement /* , fromIndex */) {\n return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n includes: function includes(searchElement /* , fromIndex */) {\n return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n join: function join(separator) { // eslint-disable-line no-unused-vars\n return arrayJoin.apply(validate(this), arguments);\n },\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars\n return arrayLastIndexOf.apply(validate(this), arguments);\n },\n map: function map(mapfn /* , thisArg */) {\n return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduce.apply(validate(this), arguments);\n },\n reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduceRight.apply(validate(this), arguments);\n },\n reverse: function reverse() {\n var that = this;\n var length = validate(that).length;\n var middle = Math.floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n },\n some: function some(callbackfn /* , thisArg */) {\n return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n sort: function sort(comparefn) {\n return arraySort.call(validate(this), comparefn);\n },\n subarray: function subarray(begin, end) {\n var O = validate(this);\n var length = O.length;\n var $begin = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(\n O.buffer,\n O.byteOffset + $begin * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)\n );\n }\n };\n\n var $slice = function slice(start, end) {\n return speciesFromList(this, arraySlice.call(validate(this), start, end));\n };\n\n var $set = function set(arrayLike /* , offset */) {\n validate(this);\n var offset = toOffset(arguments[1], 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError(WRONG_LENGTH);\n while (index < len) this[offset + index] = src[index++];\n };\n\n var $iterators = {\n entries: function entries() {\n return arrayEntries.call(validate(this));\n },\n keys: function keys() {\n return arrayKeys.call(validate(this));\n },\n values: function values() {\n return arrayValues.call(validate(this));\n }\n };\n\n var isTAIndex = function (target, key) {\n return isObject(target)\n && target[TYPED_ARRAY]\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n };\n var $getDesc = function getOwnPropertyDescriptor(target, key) {\n return isTAIndex(target, key = toPrimitive(key, true))\n ? propertyDesc(2, target[key])\n : gOPD(target, key);\n };\n var $setDesc = function defineProperty(target, key, desc) {\n if (isTAIndex(target, key = toPrimitive(key, true))\n && isObject(desc)\n && has(desc, 'value')\n && !has(desc, 'get')\n && !has(desc, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !desc.configurable\n && (!has(desc, 'writable') || desc.writable)\n && (!has(desc, 'enumerable') || desc.enumerable)\n ) {\n target[key] = desc.value;\n return target;\n } return dP(target, key, desc);\n };\n\n if (!ALL_CONSTRUCTORS) {\n $GOPD.f = $getDesc;\n $DP.f = $setDesc;\n }\n\n $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {\n getOwnPropertyDescriptor: $getDesc,\n defineProperty: $setDesc\n });\n\n if (fails(function () { arrayToString.call({}); })) {\n arrayToString = arrayToLocaleString = function toString() {\n return arrayJoin.call(this);\n };\n }\n\n var $TypedArrayPrototype$ = redefineAll({}, proto);\n redefineAll($TypedArrayPrototype$, $iterators);\n hide($TypedArrayPrototype$, ITERATOR, $iterators.values);\n redefineAll($TypedArrayPrototype$, {\n slice: $slice,\n set: $set,\n constructor: function () { /* noop */ },\n toString: arrayToString,\n toLocaleString: $toLocaleString\n });\n addGetter($TypedArrayPrototype$, 'buffer', 'b');\n addGetter($TypedArrayPrototype$, 'byteOffset', 'o');\n addGetter($TypedArrayPrototype$, 'byteLength', 'l');\n addGetter($TypedArrayPrototype$, 'length', 'e');\n dP($TypedArrayPrototype$, TAG, {\n get: function () { return this[TYPED_ARRAY]; }\n });\n\n // eslint-disable-next-line max-statements\n module.exports = function (KEY, BYTES, wrapper, CLAMPED) {\n CLAMPED = !!CLAMPED;\n var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + KEY;\n var SETTER = 'set' + KEY;\n var TypedArray = global[NAME];\n var Base = TypedArray || {};\n var TAC = TypedArray && getPrototypeOf(TypedArray);\n var FORCED = !TypedArray || !$typed.ABV;\n var O = {};\n var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];\n var getter = function (that, index) {\n var data = that._d;\n return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);\n };\n var setter = function (that, index, value) {\n var data = that._d;\n if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;\n data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);\n };\n var addElement = function (that, index) {\n dP(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n if (FORCED) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME, '_d');\n var index = 0;\n var offset = 0;\n var buffer, byteLength, length, klass;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new $ArrayBuffer(byteLength);\n } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n buffer = data;\n offset = toOffset($offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - offset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (TYPED_ARRAY in data) {\n return fromList(TypedArray, data);\n } else {\n return $from.call(TypedArray, data);\n }\n hide(that, '_d', {\n b: buffer,\n o: offset,\n l: byteLength,\n e: length,\n v: new $DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);\n hide(TypedArrayPrototype, 'constructor', TypedArray);\n } else if (!fails(function () {\n TypedArray(1);\n }) || !fails(function () {\n new TypedArray(-1); // eslint-disable-line no-new\n }) || !$iterDetect(function (iter) {\n new TypedArray(); // eslint-disable-line no-new\n new TypedArray(null); // eslint-disable-line no-new\n new TypedArray(1.5); // eslint-disable-line no-new\n new TypedArray(iter); // eslint-disable-line no-new\n }, true)) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME);\n var klass;\n // `ws` module bug, temporarily remove validation length for Uint8Array\n // https://github.com/websockets/ws/pull/645\n if (!isObject(data)) return new Base(toIndex(data));\n if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n return $length !== undefined\n ? new Base(data, toOffset($offset, BYTES), $length)\n : $offset !== undefined\n ? new Base(data, toOffset($offset, BYTES))\n : new Base(data);\n }\n if (TYPED_ARRAY in data) return fromList(TypedArray, data);\n return $from.call(TypedArray, data);\n });\n arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {\n if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);\n });\n TypedArray[PROTOTYPE] = TypedArrayPrototype;\n if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;\n }\n var $nativeIterator = TypedArrayPrototype[ITERATOR];\n var CORRECT_ITER_NAME = !!$nativeIterator\n && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);\n var $iterator = $iterators.values;\n hide(TypedArray, TYPED_CONSTRUCTOR, true);\n hide(TypedArrayPrototype, TYPED_ARRAY, NAME);\n hide(TypedArrayPrototype, VIEW, true);\n hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);\n\n if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {\n dP(TypedArrayPrototype, TAG, {\n get: function () { return NAME; }\n });\n }\n\n O[NAME] = TypedArray;\n\n $export($export.G + $export.W + $export.F * (TypedArray != Base), O);\n\n $export($export.S, NAME, {\n BYTES_PER_ELEMENT: BYTES\n });\n\n $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {\n from: $from,\n of: $of\n });\n\n if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);\n\n $export($export.P, NAME, proto);\n\n setSpecies(NAME);\n\n $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });\n\n $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);\n\n if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;\n\n $export($export.P + $export.F * fails(function () {\n new TypedArray(1).slice();\n }), NAME, { slice: $slice });\n\n $export($export.P + $export.F * (fails(function () {\n return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();\n }) || !fails(function () {\n TypedArrayPrototype.toLocaleString.call([1, 2]);\n })), NAME, { toLocaleString: $toLocaleString });\n\n Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;\n if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);\n };\n} else module.exports = function () { /* empty */ };\n","'use strict';\nvar global = require('./_global');\nvar DESCRIPTORS = require('./_descriptors');\nvar LIBRARY = require('./_library');\nvar $typed = require('./_typed');\nvar hide = require('./_hide');\nvar redefineAll = require('./_redefine-all');\nvar fails = require('./_fails');\nvar anInstance = require('./_an-instance');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar toIndex = require('./_to-index');\nvar gOPN = require('./_object-gopn').f;\nvar dP = require('./_object-dp').f;\nvar arrayFill = require('./_array-fill');\nvar setToStringTag = require('./_set-to-string-tag');\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length!';\nvar WRONG_INDEX = 'Wrong index!';\nvar $ArrayBuffer = global[ARRAY_BUFFER];\nvar $DataView = global[DATA_VIEW];\nvar Math = global.Math;\nvar RangeError = global.RangeError;\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = global.Infinity;\nvar BaseBuffer = $ArrayBuffer;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\nvar BUFFER = 'buffer';\nvar BYTE_LENGTH = 'byteLength';\nvar BYTE_OFFSET = 'byteOffset';\nvar $BUFFER = DESCRIPTORS ? '_b' : BUFFER;\nvar $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;\nvar $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;\n\n// IEEE754 conversions based on https://github.com/feross/ieee754\nfunction packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}\nfunction unpackIEEE754(buffer, mLen, nBytes) {\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = eLen - 7;\n var i = nBytes - 1;\n var s = buffer[i--];\n var e = s & 127;\n var m;\n s >>= 7;\n for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : s ? -Infinity : Infinity;\n } else {\n m = m + pow(2, mLen);\n e = e - eBias;\n } return (s ? -1 : 1) * m * pow(2, e - mLen);\n}\n\nfunction unpackI32(bytes) {\n return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];\n}\nfunction packI8(it) {\n return [it & 0xff];\n}\nfunction packI16(it) {\n return [it & 0xff, it >> 8 & 0xff];\n}\nfunction packI32(it) {\n return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];\n}\nfunction packF64(it) {\n return packIEEE754(it, 52, 8);\n}\nfunction packF32(it) {\n return packIEEE754(it, 23, 4);\n}\n\nfunction addGetter(C, key, internal) {\n dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });\n}\n\nfunction get(view, bytes, index, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = store.slice(start, start + bytes);\n return isLittleEndian ? pack : pack.reverse();\n}\nfunction set(view, bytes, index, conversion, value, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = conversion(+value);\n for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];\n}\n\nif (!$typed.ABV) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n this._b = arrayFill.call(new Array(byteLength), 0);\n this[$LENGTH] = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = buffer[$LENGTH];\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n this[$BUFFER] = buffer;\n this[$OFFSET] = offset;\n this[$LENGTH] = byteLength;\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, BYTE_LENGTH, '_l');\n addGetter($DataView, BUFFER, '_b');\n addGetter($DataView, BYTE_LENGTH, '_l');\n addGetter($DataView, BYTE_OFFSET, '_o');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1]));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packF32, value, arguments[2]);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packF64, value, arguments[2]);\n }\n });\n} else {\n if (!fails(function () {\n $ArrayBuffer(1);\n }) || !fails(function () {\n new $ArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new $ArrayBuffer(); // eslint-disable-line no-new\n new $ArrayBuffer(1.5); // eslint-disable-line no-new\n new $ArrayBuffer(NaN); // eslint-disable-line no-new\n return $ArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new BaseBuffer(toIndex(length));\n };\n var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];\n for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);\n }\n if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;\n }\n // iOS Safari 7.x bug\n var view = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataView[PROTOTYPE].setInt8;\n view.setInt8(0, 2147483648);\n view.setInt8(1, 2147483649);\n if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, true);\n}\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\nhide($DataView[PROTOTYPE], $typed.VIEW, true);\nexports[ARRAY_BUFFER] = $ArrayBuffer;\nexports[DATA_VIEW] = $DataView;\n","var global = require('./_global');\nvar hide = require('./_hide');\nvar uid = require('./_uid');\nvar TYPED = uid('typed_array');\nvar VIEW = uid('view');\nvar ABV = !!(global.ArrayBuffer && global.DataView);\nvar CONSTR = ABV;\nvar i = 0;\nvar l = 9;\nvar Typed;\n\nvar TypedArrayConstructors = (\n 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'\n).split(',');\n\nwhile (i < l) {\n if (Typed = global[TypedArrayConstructors[i++]]) {\n hide(Typed.prototype, TYPED, true);\n hide(Typed.prototype, VIEW, true);\n } else CONSTR = false;\n}\n\nmodule.exports = {\n ABV: ABV,\n CONSTR: CONSTR,\n TYPED: TYPED,\n VIEW: VIEW\n};\n","var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n","var global = require('./_global');\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n","var isObject = require('./_is-object');\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n","var global = require('./_global');\nvar core = require('./_core');\nvar LIBRARY = require('./_library');\nvar wksExt = require('./_wks-ext');\nvar defineProperty = require('./_object-dp').f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n","exports.f = require('./_wks');\n","var store = require('./_shared')('wks');\nvar uid = require('./_uid');\nvar Symbol = require('./_global').Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n","var classof = require('./_classof');\nvar ITERATOR = require('./_wks')('iterator');\nvar Iterators = require('./_iterators');\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n","// https://github.com/benjamingr/RexExp.escape\nvar $export = require('./_export');\nvar $re = require('./_replacer')(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n\n$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });\n","// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { copyWithin: require('./_array-copy-within') });\n\nrequire('./_add-to-unscopables')('copyWithin');\n","'use strict';\nvar $export = require('./_export');\nvar $every = require('./_array-methods')(4);\n\n$export($export.P + $export.F * !require('./_strict-method')([].every, true), 'Array', {\n // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])\n every: function every(callbackfn /* , thisArg */) {\n return $every(this, callbackfn, arguments[1]);\n }\n});\n","// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = require('./_export');\n\n$export($export.P, 'Array', { fill: require('./_array-fill') });\n\nrequire('./_add-to-unscopables')('fill');\n","'use strict';\nvar $export = require('./_export');\nvar $filter = require('./_array-methods')(2);\n\n$export($export.P + $export.F * !require('./_strict-method')([].filter, true), 'Array', {\n // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(6);\nvar KEY = 'findIndex';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","'use strict';\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = require('./_export');\nvar $find = require('./_array-methods')(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\nrequire('./_add-to-unscopables')(KEY);\n","'use strict';\nvar $export = require('./_export');\nvar $forEach = require('./_array-methods')(0);\nvar STRICT = require('./_strict-method')([].forEach, true);\n\n$export($export.P + $export.F * !STRICT, 'Array', {\n // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])\n forEach: function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\nvar ctx = require('./_ctx');\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar call = require('./_iter-call');\nvar isArrayIter = require('./_is-array-iter');\nvar toLength = require('./_to-length');\nvar createProperty = require('./_create-property');\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $indexOf = require('./_array-includes')(false);\nvar $native = [].indexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {\n // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? $native.apply(this, arguments) || 0\n : $indexOf(this, searchElement, arguments[1]);\n }\n});\n","// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)\nvar $export = require('./_export');\n\n$export($export.S, 'Array', { isArray: require('./_is-array') });\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","'use strict';\n// 22.1.3.13 Array.prototype.join(separator)\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar arrayJoin = [].join;\n\n// fallback for not array-like strings\n$export($export.P + $export.F * (require('./_iobject') != Object || !require('./_strict-method')(arrayJoin)), 'Array', {\n join: function join(separator) {\n return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toInteger = require('./_to-integer');\nvar toLength = require('./_to-length');\nvar $native = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !require('./_strict-method')($native)), 'Array', {\n // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;\n var O = toIObject(this);\n var length = toLength(O.length);\n var index = length - 1;\n if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;\n return -1;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $map = require('./_array-methods')(1);\n\n$export($export.P + $export.F * !require('./_strict-method')([].map, true), 'Array', {\n // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar createProperty = require('./_create-property');\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * require('./_fails')(function () {\n function F() { /* empty */ }\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */) {\n var index = 0;\n var aLen = arguments.length;\n var result = new (typeof this == 'function' ? this : Array)(aLen);\n while (aLen > index) createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduceRight, true), 'Array', {\n // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])\n reduceRight: function reduceRight(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], true);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $reduce = require('./_array-reduce');\n\n$export($export.P + $export.F * !require('./_strict-method')([].reduce, true), 'Array', {\n // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])\n reduce: function reduce(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], false);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar html = require('./_html');\nvar cof = require('./_cof');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nvar arraySlice = [].slice;\n\n// fallback for not array-like ES3 strings and DOM objects\n$export($export.P + $export.F * require('./_fails')(function () {\n if (html) arraySlice.call(html);\n}), 'Array', {\n slice: function slice(begin, end) {\n var len = toLength(this.length);\n var klass = cof(this);\n end = end === undefined ? len : end;\n if (klass == 'Array') return arraySlice.call(this, begin, end);\n var start = toAbsoluteIndex(begin, len);\n var upTo = toAbsoluteIndex(end, len);\n var size = toLength(upTo - start);\n var cloned = new Array(size);\n var i = 0;\n for (; i < size; i++) cloned[i] = klass == 'String'\n ? this.charAt(start + i)\n : this[start + i];\n return cloned;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $some = require('./_array-methods')(3);\n\n$export($export.P + $export.F * !require('./_strict-method')([].some, true), 'Array', {\n // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])\n some: function some(callbackfn /* , thisArg */) {\n return $some(this, callbackfn, arguments[1]);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar toObject = require('./_to-object');\nvar fails = require('./_fails');\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !require('./_strict-method')($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n","require('./_set-species')('Array');\n","// 20.3.3.1 / 15.9.4.4 Date.now()\nvar $export = require('./_export');\n\n$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });\n","// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar $export = require('./_export');\nvar toISOString = require('./_date-to-iso-string');\n\n// PhantomJS / old WebKit has a broken implementations\n$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {\n toISOString: toISOString\n});\n","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar toPrimitive = require('./_to-primitive');\n\n$export($export.P + $export.F * require('./_fails')(function () {\n return new Date(NaN).toJSON() !== null\n || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;\n}), 'Date', {\n // eslint-disable-next-line no-unused-vars\n toJSON: function toJSON(key) {\n var O = toObject(this);\n var pv = toPrimitive(O);\n return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();\n }\n});\n","var TO_PRIMITIVE = require('./_wks')('toPrimitive');\nvar proto = Date.prototype;\n\nif (!(TO_PRIMITIVE in proto)) require('./_hide')(proto, TO_PRIMITIVE, require('./_date-to-primitive'));\n","var DateProto = Date.prototype;\nvar INVALID_DATE = 'Invalid Date';\nvar TO_STRING = 'toString';\nvar $toString = DateProto[TO_STRING];\nvar getTime = DateProto.getTime;\nif (new Date(NaN) + '' != INVALID_DATE) {\n require('./_redefine')(DateProto, TO_STRING, function toString() {\n var value = getTime.call(this);\n // eslint-disable-next-line no-self-compare\n return value === value ? $toString.call(this) : INVALID_DATE;\n });\n}\n","// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)\nvar $export = require('./_export');\n\n$export($export.P, 'Function', { bind: require('./_bind') });\n","'use strict';\nvar isObject = require('./_is-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar HAS_INSTANCE = require('./_wks')('hasInstance');\nvar FunctionProto = Function.prototype;\n// 19.2.3.6 Function.prototype[@@hasInstance](V)\nif (!(HAS_INSTANCE in FunctionProto)) require('./_object-dp').f(FunctionProto, HAS_INSTANCE, { value: function (O) {\n if (typeof this != 'function' || !isObject(O)) return false;\n if (!isObject(this.prototype)) return O instanceof this;\n // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:\n while (O = getPrototypeOf(O)) if (this.prototype === O) return true;\n return false;\n} });\n","var dP = require('./_object-dp').f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || require('./_descriptors') && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = require('./_collection')(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n","// 20.2.2.3 Math.acosh(x)\nvar $export = require('./_export');\nvar log1p = require('./_math-log1p');\nvar sqrt = Math.sqrt;\nvar $acosh = Math.acosh;\n\n$export($export.S + $export.F * !($acosh\n // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509\n && Math.floor($acosh(Number.MAX_VALUE)) == 710\n // Tor Browser bug: Math.acosh(Infinity) -> NaN\n && $acosh(Infinity) == Infinity\n), 'Math', {\n acosh: function acosh(x) {\n return (x = +x) < 1 ? NaN : x > 94906265.62425156\n ? Math.log(x) + Math.LN2\n : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));\n }\n});\n","// 20.2.2.5 Math.asinh(x)\nvar $export = require('./_export');\nvar $asinh = Math.asinh;\n\nfunction asinh(x) {\n return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));\n}\n\n// Tor Browser bug: Math.asinh(0) -> -0\n$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });\n","// 20.2.2.7 Math.atanh(x)\nvar $export = require('./_export');\nvar $atanh = Math.atanh;\n\n// Tor Browser bug: Math.atanh(-0) -> 0\n$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {\n atanh: function atanh(x) {\n return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;\n }\n});\n","// 20.2.2.9 Math.cbrt(x)\nvar $export = require('./_export');\nvar sign = require('./_math-sign');\n\n$export($export.S, 'Math', {\n cbrt: function cbrt(x) {\n return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);\n }\n});\n","// 20.2.2.11 Math.clz32(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n clz32: function clz32(x) {\n return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;\n }\n});\n","// 20.2.2.12 Math.cosh(x)\nvar $export = require('./_export');\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n cosh: function cosh(x) {\n return (exp(x = +x) + exp(-x)) / 2;\n }\n});\n","// 20.2.2.14 Math.expm1(x)\nvar $export = require('./_export');\nvar $expm1 = require('./_math-expm1');\n\n$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });\n","// 20.2.2.16 Math.fround(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { fround: require('./_math-fround') });\n","// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])\nvar $export = require('./_export');\nvar abs = Math.abs;\n\n$export($export.S, 'Math', {\n hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars\n var sum = 0;\n var i = 0;\n var aLen = arguments.length;\n var larg = 0;\n var arg, div;\n while (i < aLen) {\n arg = abs(arguments[i++]);\n if (larg < arg) {\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if (arg > 0) {\n div = arg / larg;\n sum += div * div;\n } else sum += arg;\n }\n return larg === Infinity ? Infinity : larg * Math.sqrt(sum);\n }\n});\n","// 20.2.2.18 Math.imul(x, y)\nvar $export = require('./_export');\nvar $imul = Math.imul;\n\n// some WebKit versions fails with big numbers, some has wrong arity\n$export($export.S + $export.F * require('./_fails')(function () {\n return $imul(0xffffffff, 5) != -5 || $imul.length != 2;\n}), 'Math', {\n imul: function imul(x, y) {\n var UINT16 = 0xffff;\n var xn = +x;\n var yn = +y;\n var xl = UINT16 & xn;\n var yl = UINT16 & yn;\n return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);\n }\n});\n","// 20.2.2.21 Math.log10(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log10: function log10(x) {\n return Math.log(x) * Math.LOG10E;\n }\n});\n","// 20.2.2.20 Math.log1p(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { log1p: require('./_math-log1p') });\n","// 20.2.2.22 Math.log2(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n log2: function log2(x) {\n return Math.log(x) / Math.LN2;\n }\n});\n","// 20.2.2.28 Math.sign(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { sign: require('./_math-sign') });\n","// 20.2.2.30 Math.sinh(x)\nvar $export = require('./_export');\nvar expm1 = require('./_math-expm1');\nvar exp = Math.exp;\n\n// V8 near Chromium 38 has a problem with very small numbers\n$export($export.S + $export.F * require('./_fails')(function () {\n return !Math.sinh(-2e-17) != -2e-17;\n}), 'Math', {\n sinh: function sinh(x) {\n return Math.abs(x = +x) < 1\n ? (expm1(x) - expm1(-x)) / 2\n : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);\n }\n});\n","// 20.2.2.33 Math.tanh(x)\nvar $export = require('./_export');\nvar expm1 = require('./_math-expm1');\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n tanh: function tanh(x) {\n var a = expm1(x = +x);\n var b = expm1(-x);\n return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));\n }\n});\n","// 20.2.2.34 Math.trunc(x)\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n trunc: function trunc(it) {\n return (it > 0 ? Math.floor : Math.ceil)(it);\n }\n});\n","'use strict';\nvar global = require('./_global');\nvar has = require('./_has');\nvar cof = require('./_cof');\nvar inheritIfRequired = require('./_inherit-if-required');\nvar toPrimitive = require('./_to-primitive');\nvar fails = require('./_fails');\nvar gOPN = require('./_object-gopn').f;\nvar gOPD = require('./_object-gopd').f;\nvar dP = require('./_object-dp').f;\nvar $trim = require('./_string-trim').trim;\nvar NUMBER = 'Number';\nvar $Number = global[NUMBER];\nvar Base = $Number;\nvar proto = $Number.prototype;\n// Opera ~12 has broken Object#toString\nvar BROKEN_COF = cof(require('./_object-create')(proto)) == NUMBER;\nvar TRIM = 'trim' in String.prototype;\n\n// 7.1.3 ToNumber(argument)\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, false);\n if (typeof it == 'string' && it.length > 2) {\n it = TRIM ? it.trim() : $trim(it, 3);\n var first = it.charCodeAt(0);\n var third, radix, maxCode;\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i\n default: return +it;\n }\n for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {\n code = digits.charCodeAt(i);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\nif (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {\n $Number = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var that = this;\n return that instanceof $Number\n // check on 1..constructor(foo) case\n && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)\n ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);\n };\n for (var keys = require('./_descriptors') ? gOPN(Base) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES6 (in case, if modules with ES6 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(Base, key = keys[j]) && !has($Number, key)) {\n dP($Number, key, gOPD(Base, key));\n }\n }\n $Number.prototype = proto;\n proto.constructor = $Number;\n require('./_redefine')(global, NUMBER, $Number);\n}\n","// 20.1.2.1 Number.EPSILON\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });\n","// 20.1.2.2 Number.isFinite(number)\nvar $export = require('./_export');\nvar _isFinite = require('./_global').isFinite;\n\n$export($export.S, 'Number', {\n isFinite: function isFinite(it) {\n return typeof it == 'number' && _isFinite(it);\n }\n});\n","// 20.1.2.3 Number.isInteger(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { isInteger: require('./_is-integer') });\n","// 20.1.2.4 Number.isNaN(number)\nvar $export = require('./_export');\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n","// 20.1.2.5 Number.isSafeInteger(number)\nvar $export = require('./_export');\nvar isInteger = require('./_is-integer');\nvar abs = Math.abs;\n\n$export($export.S, 'Number', {\n isSafeInteger: function isSafeInteger(number) {\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n});\n","// 20.1.2.6 Number.MAX_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });\n","// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = require('./_export');\n\n$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });\n","var $export = require('./_export');\nvar $parseFloat = require('./_parse-float');\n// 20.1.2.12 Number.parseFloat(string)\n$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });\n","var $export = require('./_export');\nvar $parseInt = require('./_parse-int');\n// 20.1.2.13 Number.parseInt(string, radix)\n$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });\n","'use strict';\nvar $export = require('./_export');\nvar toInteger = require('./_to-integer');\nvar aNumberValue = require('./_a-number-value');\nvar repeat = require('./_string-repeat');\nvar $toFixed = 1.0.toFixed;\nvar floor = Math.floor;\nvar data = [0, 0, 0, 0, 0, 0];\nvar ERROR = 'Number.toFixed: incorrect invocation!';\nvar ZERO = '0';\n\nvar multiply = function (n, c) {\n var i = -1;\n var c2 = c;\n while (++i < 6) {\n c2 += n * data[i];\n data[i] = c2 % 1e7;\n c2 = floor(c2 / 1e7);\n }\n};\nvar divide = function (n) {\n var i = 6;\n var c = 0;\n while (--i >= 0) {\n c += data[i];\n data[i] = floor(c / n);\n c = (c % n) * 1e7;\n }\n};\nvar numToString = function () {\n var i = 6;\n var s = '';\n while (--i >= 0) {\n if (s !== '' || i === 0 || data[i] !== 0) {\n var t = String(data[i]);\n s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;\n }\n } return s;\n};\nvar pow = function (x, n, acc) {\n return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);\n};\nvar log = function (x) {\n var n = 0;\n var x2 = x;\n while (x2 >= 4096) {\n n += 12;\n x2 /= 4096;\n }\n while (x2 >= 2) {\n n += 1;\n x2 /= 2;\n } return n;\n};\n\n$export($export.P + $export.F * (!!$toFixed && (\n 0.00008.toFixed(3) !== '0.000' ||\n 0.9.toFixed(0) !== '1' ||\n 1.255.toFixed(2) !== '1.25' ||\n 1000000000000000128.0.toFixed(0) !== '1000000000000000128'\n) || !require('./_fails')(function () {\n // V8 ~ Android 4.3-\n $toFixed.call({});\n})), 'Number', {\n toFixed: function toFixed(fractionDigits) {\n var x = aNumberValue(this, ERROR);\n var f = toInteger(fractionDigits);\n var s = '';\n var m = ZERO;\n var e, z, j, k;\n if (f < 0 || f > 20) throw RangeError(ERROR);\n // eslint-disable-next-line no-self-compare\n if (x != x) return 'NaN';\n if (x <= -1e21 || x >= 1e21) return String(x);\n if (x < 0) {\n s = '-';\n x = -x;\n }\n if (x > 1e-21) {\n e = log(x * pow(2, 69, 1)) - 69;\n z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);\n z *= 0x10000000000000;\n e = 52 - e;\n if (e > 0) {\n multiply(0, z);\n j = f;\n while (j >= 7) {\n multiply(1e7, 0);\n j -= 7;\n }\n multiply(pow(10, j, 1), 0);\n j = e - 1;\n while (j >= 23) {\n divide(1 << 23);\n j -= 23;\n }\n divide(1 << j);\n multiply(1, 1);\n divide(2);\n m = numToString();\n } else {\n multiply(0, z);\n multiply(1 << -e, 0);\n m = numToString() + repeat.call(ZERO, f);\n }\n }\n if (f > 0) {\n k = m.length;\n m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));\n } else {\n m = s + m;\n } return m;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar $fails = require('./_fails');\nvar aNumberValue = require('./_a-number-value');\nvar $toPrecision = 1.0.toPrecision;\n\n$export($export.P + $export.F * ($fails(function () {\n // IE7-\n return $toPrecision.call(1, undefined) !== '1';\n}) || !$fails(function () {\n // V8 ~ Android 4.3-\n $toPrecision.call({});\n})), 'Number', {\n toPrecision: function toPrecision(precision) {\n var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');\n return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);\n }\n});\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","var $export = require('./_export');\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: require('./_object-create') });\n","var $export = require('./_export');\n// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperties: require('./_object-dps') });\n","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n","// 19.1.2.5 Object.freeze(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n","// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = require('./_to-iobject');\nvar $getOwnPropertyDescriptor = require('./_object-gopd').f;\n\nrequire('./_object-sap')('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n","// 19.1.2.7 Object.getOwnPropertyNames(O)\nrequire('./_object-sap')('getOwnPropertyNames', function () {\n return require('./_object-gopn-ext').f;\n});\n","// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = require('./_to-object');\nvar $getPrototypeOf = require('./_object-gpo');\n\nrequire('./_object-sap')('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n","// 19.1.2.11 Object.isExtensible(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isExtensible', function ($isExtensible) {\n return function isExtensible(it) {\n return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;\n };\n});\n","// 19.1.2.12 Object.isFrozen(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isFrozen', function ($isFrozen) {\n return function isFrozen(it) {\n return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;\n };\n});\n","// 19.1.2.13 Object.isSealed(O)\nvar isObject = require('./_is-object');\n\nrequire('./_object-sap')('isSealed', function ($isSealed) {\n return function isSealed(it) {\n return isObject(it) ? $isSealed ? $isSealed(it) : false : true;\n };\n});\n","// 19.1.3.10 Object.is(value1, value2)\nvar $export = require('./_export');\n$export($export.S, 'Object', { is: require('./_same-value') });\n","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n","// 19.1.2.15 Object.preventExtensions(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('preventExtensions', function ($preventExtensions) {\n return function preventExtensions(it) {\n return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;\n };\n});\n","// 19.1.2.17 Object.seal(O)\nvar isObject = require('./_is-object');\nvar meta = require('./_meta').onFreeze;\n\nrequire('./_object-sap')('seal', function ($seal) {\n return function seal(it) {\n return $seal && isObject(it) ? $seal(meta(it)) : it;\n };\n});\n","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n","'use strict';\n// 19.1.3.6 Object.prototype.toString()\nvar classof = require('./_classof');\nvar test = {};\ntest[require('./_wks')('toStringTag')] = 'z';\nif (test + '' != '[object z]') {\n require('./_redefine')(Object.prototype, 'toString', function toString() {\n return '[object ' + classof(this) + ']';\n }, true);\n}\n","var $export = require('./_export');\nvar $parseFloat = require('./_parse-float');\n// 18.2.4 parseFloat(string)\n$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });\n","var $export = require('./_export');\nvar $parseInt = require('./_parse-int');\n// 18.2.5 parseInt(string, radix)\n$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });\n","'use strict';\nvar LIBRARY = require('./_library');\nvar global = require('./_global');\nvar ctx = require('./_ctx');\nvar classof = require('./_classof');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar aFunction = require('./_a-function');\nvar anInstance = require('./_an-instance');\nvar forOf = require('./_for-of');\nvar speciesConstructor = require('./_species-constructor');\nvar task = require('./_task').set;\nvar microtask = require('./_microtask')();\nvar newPromiseCapabilityModule = require('./_new-promise-capability');\nvar perform = require('./_perform');\nvar userAgent = require('./_user-agent');\nvar promiseResolve = require('./_promise-resolve');\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8 || '';\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[require('./_wks')('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function')\n && promise.then(empty) instanceof FakePromise\n // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // we can't detect it synchronously, so just check versions\n && v8.indexOf('6.6') !== 0\n && userAgent.indexOf('Chrome/66') === -1;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // may throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n if (domain && !exited) domain.exit();\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = require('./_redefine-all')($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\nrequire('./_set-to-string-tag')($Promise, PROMISE);\nrequire('./_set-species')(PROMISE);\nWrapper = require('./_core')[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && require('./_iter-detect')(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n","// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)\nvar $export = require('./_export');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar rApply = (require('./_global').Reflect || {}).apply;\nvar fApply = Function.apply;\n// MS Edge argumentsList argument is optional\n$export($export.S + $export.F * !require('./_fails')(function () {\n rApply(function () { /* empty */ });\n}), 'Reflect', {\n apply: function apply(target, thisArgument, argumentsList) {\n var T = aFunction(target);\n var L = anObject(argumentsList);\n return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);\n }\n});\n","// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])\nvar $export = require('./_export');\nvar create = require('./_object-create');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar bind = require('./_bind');\nvar rConstruct = (require('./_global').Reflect || {}).construct;\n\n// MS Edge supports only 2 arguments and argumentsList argument is optional\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\nvar NEW_TARGET_BUG = fails(function () {\n function F() { /* empty */ }\n return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);\n});\nvar ARGS_BUG = !fails(function () {\n rConstruct(function () { /* empty */ });\n});\n\n$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {\n construct: function construct(Target, args /* , newTarget */) {\n aFunction(Target);\n anObject(args);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);\n if (Target == newTarget) {\n // w/o altered newTarget, optimization for 0-4 arguments\n switch (args.length) {\n case 0: return new Target();\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args))();\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype;\n var instance = create(isObject(proto) ? proto : Object.prototype);\n var result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n});\n","// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)\nvar dP = require('./_object-dp');\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar toPrimitive = require('./_to-primitive');\n\n// MS Edge has broken Reflect.defineProperty - throwing instead of returning false\n$export($export.S + $export.F * require('./_fails')(function () {\n // eslint-disable-next-line no-undef\n Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });\n}), 'Reflect', {\n defineProperty: function defineProperty(target, propertyKey, attributes) {\n anObject(target);\n propertyKey = toPrimitive(propertyKey, true);\n anObject(attributes);\n try {\n dP.f(target, propertyKey, attributes);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.4 Reflect.deleteProperty(target, propertyKey)\nvar $export = require('./_export');\nvar gOPD = require('./_object-gopd').f;\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n deleteProperty: function deleteProperty(target, propertyKey) {\n var desc = gOPD(anObject(target), propertyKey);\n return desc && !desc.configurable ? false : delete target[propertyKey];\n }\n});\n","'use strict';\n// 26.1.5 Reflect.enumerate(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar Enumerate = function (iterated) {\n this._t = anObject(iterated); // target\n this._i = 0; // next index\n var keys = this._k = []; // keys\n var key;\n for (key in iterated) keys.push(key);\n};\nrequire('./_iter-create')(Enumerate, 'Object', function () {\n var that = this;\n var keys = that._k;\n var key;\n do {\n if (that._i >= keys.length) return { value: undefined, done: true };\n } while (!((key = keys[that._i++]) in that._t));\n return { value: key, done: false };\n});\n\n$export($export.S, 'Reflect', {\n enumerate: function enumerate(target) {\n return new Enumerate(target);\n }\n});\n","// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)\nvar gOPD = require('./_object-gopd');\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {\n return gOPD.f(anObject(target), propertyKey);\n }\n});\n","// 26.1.8 Reflect.getPrototypeOf(target)\nvar $export = require('./_export');\nvar getProto = require('./_object-gpo');\nvar anObject = require('./_an-object');\n\n$export($export.S, 'Reflect', {\n getPrototypeOf: function getPrototypeOf(target) {\n return getProto(anObject(target));\n }\n});\n","// 26.1.6 Reflect.get(target, propertyKey [, receiver])\nvar gOPD = require('./_object-gopd');\nvar getPrototypeOf = require('./_object-gpo');\nvar has = require('./_has');\nvar $export = require('./_export');\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\n\nfunction get(target, propertyKey /* , receiver */) {\n var receiver = arguments.length < 3 ? target : arguments[2];\n var desc, proto;\n if (anObject(target) === receiver) return target[propertyKey];\n if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')\n ? desc.value\n : desc.get !== undefined\n ? desc.get.call(receiver)\n : undefined;\n if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);\n}\n\n$export($export.S, 'Reflect', { get: get });\n","// 26.1.9 Reflect.has(target, propertyKey)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', {\n has: function has(target, propertyKey) {\n return propertyKey in target;\n }\n});\n","// 26.1.10 Reflect.isExtensible(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar $isExtensible = Object.isExtensible;\n\n$export($export.S, 'Reflect', {\n isExtensible: function isExtensible(target) {\n anObject(target);\n return $isExtensible ? $isExtensible(target) : true;\n }\n});\n","// 26.1.11 Reflect.ownKeys(target)\nvar $export = require('./_export');\n\n$export($export.S, 'Reflect', { ownKeys: require('./_own-keys') });\n","// 26.1.12 Reflect.preventExtensions(target)\nvar $export = require('./_export');\nvar anObject = require('./_an-object');\nvar $preventExtensions = Object.preventExtensions;\n\n$export($export.S, 'Reflect', {\n preventExtensions: function preventExtensions(target) {\n anObject(target);\n try {\n if ($preventExtensions) $preventExtensions(target);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.14 Reflect.setPrototypeOf(target, proto)\nvar $export = require('./_export');\nvar setProto = require('./_set-proto');\n\nif (setProto) $export($export.S, 'Reflect', {\n setPrototypeOf: function setPrototypeOf(target, proto) {\n setProto.check(target, proto);\n try {\n setProto.set(target, proto);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n","// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])\nvar dP = require('./_object-dp');\nvar gOPD = require('./_object-gopd');\nvar getPrototypeOf = require('./_object-gpo');\nvar has = require('./_has');\nvar $export = require('./_export');\nvar createDesc = require('./_property-desc');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\n\nfunction set(target, propertyKey, V /* , receiver */) {\n var receiver = arguments.length < 4 ? target : arguments[3];\n var ownDesc = gOPD.f(anObject(target), propertyKey);\n var existingDescriptor, proto;\n if (!ownDesc) {\n if (isObject(proto = getPrototypeOf(target))) {\n return set(proto, propertyKey, V, receiver);\n }\n ownDesc = createDesc(0);\n }\n if (has(ownDesc, 'value')) {\n if (ownDesc.writable === false || !isObject(receiver)) return false;\n if (existingDescriptor = gOPD.f(receiver, propertyKey)) {\n if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;\n existingDescriptor.value = V;\n dP.f(receiver, propertyKey, existingDescriptor);\n } else dP.f(receiver, propertyKey, createDesc(0, V));\n return true;\n }\n return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);\n}\n\n$export($export.S, 'Reflect', { set: set });\n","var global = require('./_global');\nvar inheritIfRequired = require('./_inherit-if-required');\nvar dP = require('./_object-dp').f;\nvar gOPN = require('./_object-gopn').f;\nvar isRegExp = require('./_is-regexp');\nvar $flags = require('./_flags');\nvar $RegExp = global.RegExp;\nvar Base = $RegExp;\nvar proto = $RegExp.prototype;\nvar re1 = /a/g;\nvar re2 = /a/g;\n// \"new\" creates a new object, old webkit buggy here\nvar CORRECT_NEW = new $RegExp(re1) !== re1;\n\nif (require('./_descriptors') && (!CORRECT_NEW || require('./_fails')(function () {\n re2[require('./_wks')('match')] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';\n}))) {\n $RegExp = function RegExp(p, f) {\n var tiRE = this instanceof $RegExp;\n var piRE = isRegExp(p);\n var fiU = f === undefined;\n return !tiRE && piRE && p.constructor === $RegExp && fiU ? p\n : inheritIfRequired(CORRECT_NEW\n ? new Base(piRE && !fiU ? p.source : p, f)\n : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)\n , tiRE ? this : proto, $RegExp);\n };\n var proxy = function (key) {\n key in $RegExp || dP($RegExp, key, {\n configurable: true,\n get: function () { return Base[key]; },\n set: function (it) { Base[key] = it; }\n });\n };\n for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);\n proto.constructor = $RegExp;\n $RegExp.prototype = proto;\n require('./_redefine')(global, 'RegExp', $RegExp);\n}\n\nrequire('./_set-species')('RegExp');\n","// 21.2.5.3 get RegExp.prototype.flags()\nif (require('./_descriptors') && /./g.flags != 'g') require('./_object-dp').f(RegExp.prototype, 'flags', {\n configurable: true,\n get: require('./_flags')\n});\n","// @@match logic\nrequire('./_fix-re-wks')('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n","// @@replace logic\nrequire('./_fix-re-wks')('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n","// @@search logic\nrequire('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search) {\n // 21.1.3.15 String.prototype.search(regexp)\n return [function search(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n }, $search];\n});\n","// @@split logic\nrequire('./_fix-re-wks')('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = require('./_is-regexp');\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n","'use strict';\nrequire('./es6.regexp.flags');\nvar anObject = require('./_an-object');\nvar $flags = require('./_flags');\nvar DESCRIPTORS = require('./_descriptors');\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n require('./_redefine')(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (require('./_fails')(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n","'use strict';\nvar strong = require('./_collection-strong');\nvar validate = require('./_validate-collection');\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = require('./_collection')(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n","'use strict';\n// B.2.3.2 String.prototype.anchor(name)\nrequire('./_string-html')('anchor', function (createHTML) {\n return function anchor(name) {\n return createHTML(this, 'a', 'name', name);\n };\n});\n","'use strict';\n// B.2.3.3 String.prototype.big()\nrequire('./_string-html')('big', function (createHTML) {\n return function big() {\n return createHTML(this, 'big', '', '');\n };\n});\n","'use strict';\n// B.2.3.4 String.prototype.blink()\nrequire('./_string-html')('blink', function (createHTML) {\n return function blink() {\n return createHTML(this, 'blink', '', '');\n };\n});\n","'use strict';\n// B.2.3.5 String.prototype.bold()\nrequire('./_string-html')('bold', function (createHTML) {\n return function bold() {\n return createHTML(this, 'b', '', '');\n };\n});\n","'use strict';\nvar $export = require('./_export');\nvar $at = require('./_string-at')(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos) {\n return $at(this, pos);\n }\n});\n","// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar ENDS_WITH = 'endsWith';\nvar $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = context(this, searchString, ENDS_WITH);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);\n var search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n","'use strict';\n// B.2.3.6 String.prototype.fixed()\nrequire('./_string-html')('fixed', function (createHTML) {\n return function fixed() {\n return createHTML(this, 'tt', '', '');\n };\n});\n","'use strict';\n// B.2.3.7 String.prototype.fontcolor(color)\nrequire('./_string-html')('fontcolor', function (createHTML) {\n return function fontcolor(color) {\n return createHTML(this, 'font', 'color', color);\n };\n});\n","'use strict';\n// B.2.3.8 String.prototype.fontsize(size)\nrequire('./_string-html')('fontsize', function (createHTML) {\n return function fontsize(size) {\n return createHTML(this, 'font', 'size', size);\n };\n});\n","var $export = require('./_export');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar fromCharCode = String.fromCharCode;\nvar $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars\n var res = [];\n var aLen = arguments.length;\n var i = 0;\n var code;\n while (aLen > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n","// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n'use strict';\nvar $export = require('./_export');\nvar context = require('./_string-context');\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n","'use strict';\n// B.2.3.9 String.prototype.italics()\nrequire('./_string-html')('italics', function (createHTML) {\n return function italics() {\n return createHTML(this, 'i', '', '');\n };\n});\n","'use strict';\nvar $at = require('./_string-at')(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n","'use strict';\n// B.2.3.10 String.prototype.link(url)\nrequire('./_string-html')('link', function (createHTML) {\n return function link(url) {\n return createHTML(this, 'a', 'href', url);\n };\n});\n","var $export = require('./_export');\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\n\n$export($export.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite) {\n var tpl = toIObject(callSite.raw);\n var len = toLength(tpl.length);\n var aLen = arguments.length;\n var res = [];\n var i = 0;\n while (len > i) {\n res.push(String(tpl[i++]));\n if (i < aLen) res.push(String(arguments[i]));\n } return res.join('');\n }\n});\n","var $export = require('./_export');\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: require('./_string-repeat')\n});\n","'use strict';\n// B.2.3.11 String.prototype.small()\nrequire('./_string-html')('small', function (createHTML) {\n return function small() {\n return createHTML(this, 'small', '', '');\n };\n});\n","// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n'use strict';\nvar $export = require('./_export');\nvar toLength = require('./_to-length');\nvar context = require('./_string-context');\nvar STARTS_WITH = 'startsWith';\nvar $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * require('./_fails-is-regexp')(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = context(this, searchString, STARTS_WITH);\n var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n","'use strict';\n// B.2.3.12 String.prototype.strike()\nrequire('./_string-html')('strike', function (createHTML) {\n return function strike() {\n return createHTML(this, 'strike', '', '');\n };\n});\n","'use strict';\n// B.2.3.13 String.prototype.sub()\nrequire('./_string-html')('sub', function (createHTML) {\n return function sub() {\n return createHTML(this, 'sub', '', '');\n };\n});\n","'use strict';\n// B.2.3.14 String.prototype.sup()\nrequire('./_string-html')('sup', function (createHTML) {\n return function sup() {\n return createHTML(this, 'sup', '', '');\n };\n});\n","'use strict';\n// 21.1.3.25 String.prototype.trim()\nrequire('./_string-trim')('trim', function ($trim) {\n return function trim() {\n return $trim(this, 3);\n };\n});\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n require('./_object-gops').f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","'use strict';\nvar $export = require('./_export');\nvar $typed = require('./_typed');\nvar buffer = require('./_typed-buffer');\nvar anObject = require('./_an-object');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nvar toLength = require('./_to-length');\nvar isObject = require('./_is-object');\nvar ArrayBuffer = require('./_global').ArrayBuffer;\nvar speciesConstructor = require('./_species-constructor');\nvar $ArrayBuffer = buffer.ArrayBuffer;\nvar $DataView = buffer.DataView;\nvar $isView = $typed.ABV && ArrayBuffer.isView;\nvar $slice = $ArrayBuffer.prototype.slice;\nvar VIEW = $typed.VIEW;\nvar ARRAY_BUFFER = 'ArrayBuffer';\n\n$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });\n\n$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {\n // 24.1.3.1 ArrayBuffer.isView(arg)\n isView: function isView(it) {\n return $isView && $isView(it) || isObject(it) && VIEW in it;\n }\n});\n\n$export($export.P + $export.U + $export.F * require('./_fails')(function () {\n return !new $ArrayBuffer(2).slice(1, undefined).byteLength;\n}), ARRAY_BUFFER, {\n // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)\n slice: function slice(start, end) {\n if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix\n var len = anObject(this).byteLength;\n var first = toAbsoluteIndex(start, len);\n var fin = toAbsoluteIndex(end === undefined ? len : end, len);\n var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));\n var viewS = new $DataView(this);\n var viewT = new $DataView(result);\n var index = 0;\n while (first < fin) {\n viewT.setUint8(index++, viewS.getUint8(first++));\n } return result;\n }\n});\n\nrequire('./_set-species')(ARRAY_BUFFER);\n","var $export = require('./_export');\n$export($export.G + $export.W + $export.F * !require('./_typed').ABV, {\n DataView: require('./_typed-buffer').DataView\n});\n","require('./_typed-array')('Float32', 4, function (init) {\n return function Float32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Float64', 8, function (init) {\n return function Float64Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int16', 2, function (init) {\n return function Int16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int32', 4, function (init) {\n return function Int32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Int8', 1, function (init) {\n return function Int8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint16', 2, function (init) {\n return function Uint16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint32', 4, function (init) {\n return function Uint32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n","require('./_typed-array')('Uint8', 1, function (init) {\n return function Uint8ClampedArray(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n}, true);\n","'use strict';\nvar each = require('./_array-methods')(0);\nvar redefine = require('./_redefine');\nvar meta = require('./_meta');\nvar assign = require('./_object-assign');\nvar weak = require('./_collection-weak');\nvar isObject = require('./_is-object');\nvar fails = require('./_fails');\nvar validate = require('./_validate-collection');\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar tmp = {};\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = require('./_collection')(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n","'use strict';\nvar weak = require('./_collection-weak');\nvar validate = require('./_validate-collection');\nvar WEAK_SET = 'WeakSet';\n\n// 23.4 WeakSet Objects\nrequire('./_collection')(WEAK_SET, function (get) {\n return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value) {\n return weak.def(validate(this, WEAK_SET), value, true);\n }\n}, weak, false, true);\n","'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap\nvar $export = require('./_export');\nvar flattenIntoArray = require('./_flatten-into-array');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar aFunction = require('./_a-function');\nvar arraySpeciesCreate = require('./_array-species-create');\n\n$export($export.P, 'Array', {\n flatMap: function flatMap(callbackfn /* , thisArg */) {\n var O = toObject(this);\n var sourceLen, A;\n aFunction(callbackfn);\n sourceLen = toLength(O.length);\n A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);\n return A;\n }\n});\n\nrequire('./_add-to-unscopables')('flatMap');\n","'use strict';\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten\nvar $export = require('./_export');\nvar flattenIntoArray = require('./_flatten-into-array');\nvar toObject = require('./_to-object');\nvar toLength = require('./_to-length');\nvar toInteger = require('./_to-integer');\nvar arraySpeciesCreate = require('./_array-species-create');\n\n$export($export.P, 'Array', {\n flatten: function flatten(/* depthArg = 1 */) {\n var depthArg = arguments[0];\n var O = toObject(this);\n var sourceLen = toLength(O.length);\n var A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));\n return A;\n }\n});\n\nrequire('./_add-to-unscopables')('flatten');\n","'use strict';\n// https://github.com/tc39/Array.prototype.includes\nvar $export = require('./_export');\nvar $includes = require('./_array-includes')(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\nrequire('./_add-to-unscopables')('includes');\n","// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask\nvar $export = require('./_export');\nvar microtask = require('./_microtask')();\nvar process = require('./_global').process;\nvar isNode = require('./_cof')(process) == 'process';\n\n$export($export.G, {\n asap: function asap(fn) {\n var domain = isNode && process.domain;\n microtask(domain ? domain.bind(fn) : fn);\n }\n});\n","// https://github.com/ljharb/proposal-is-error\nvar $export = require('./_export');\nvar cof = require('./_cof');\n\n$export($export.S, 'Error', {\n isError: function isError(it) {\n return cof(it) === 'Error';\n }\n});\n","// https://github.com/tc39/proposal-global\nvar $export = require('./_export');\n\n$export($export.G, { global: require('./_global') });\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from\nrequire('./_set-collection-from')('Map');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of\nrequire('./_set-collection-of')('Map');\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = require('./_export');\n\n$export($export.P + $export.R, 'Map', { toJSON: require('./_collection-to-json')('Map') });\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n clamp: function clamp(x, lower, upper) {\n return Math.min(upper, Math.max(lower, x));\n }\n});\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\nvar RAD_PER_DEG = 180 / Math.PI;\n\n$export($export.S, 'Math', {\n degrees: function degrees(radians) {\n return radians * RAD_PER_DEG;\n }\n});\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\nvar scale = require('./_math-scale');\nvar fround = require('./_math-fround');\n\n$export($export.S, 'Math', {\n fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {\n return fround(scale(x, inLow, inHigh, outLow, outHigh));\n }\n});\n","// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n iaddh: function iaddh(x0, x1, y0, y1) {\n var $x0 = x0 >>> 0;\n var $x1 = x1 >>> 0;\n var $y0 = y0 >>> 0;\n return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;\n }\n});\n","// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n imulh: function imulh(u, v) {\n var UINT16 = 0xffff;\n var $u = +u;\n var $v = +v;\n var u0 = $u & UINT16;\n var v0 = $v & UINT16;\n var u1 = $u >> 16;\n var v1 = $v >> 16;\n var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);\n return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);\n }\n});\n","// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n isubh: function isubh(x0, x1, y0, y1) {\n var $x0 = x0 >>> 0;\n var $x1 = x1 >>> 0;\n var $y0 = y0 >>> 0;\n return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;\n }\n});\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\nvar DEG_PER_RAD = Math.PI / 180;\n\n$export($export.S, 'Math', {\n radians: function radians(degrees) {\n return degrees * DEG_PER_RAD;\n }\n});\n","// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { scale: require('./_math-scale') });\n","// http://jfbastien.github.io/papers/Math.signbit.html\nvar $export = require('./_export');\n\n$export($export.S, 'Math', { signbit: function signbit(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;\n} });\n","// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = require('./_export');\n\n$export($export.S, 'Math', {\n umulh: function umulh(u, v) {\n var UINT16 = 0xffff;\n var $u = +u;\n var $v = +v;\n var u0 = $u & UINT16;\n var v0 = $v & UINT16;\n var u1 = $u >>> 16;\n var v1 = $v >>> 16;\n var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);\n return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar aFunction = require('./_a-function');\nvar $defineProperty = require('./_object-dp');\n\n// B.2.2.2 Object.prototype.__defineGetter__(P, getter)\nrequire('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {\n __defineGetter__: function __defineGetter__(P, getter) {\n $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar aFunction = require('./_a-function');\nvar $defineProperty = require('./_object-dp');\n\n// B.2.2.3 Object.prototype.__defineSetter__(P, setter)\nrequire('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {\n __defineSetter__: function __defineSetter__(P, setter) {\n $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });\n }\n});\n","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $entries = require('./_object-to-array')(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it) {\n return $entries(it);\n }\n});\n","// https://github.com/tc39/proposal-object-getownpropertydescriptors\nvar $export = require('./_export');\nvar ownKeys = require('./_own-keys');\nvar toIObject = require('./_to-iobject');\nvar gOPD = require('./_object-gopd');\nvar createProperty = require('./_create-property');\n\n$export($export.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIObject(object);\n var getDesc = gOPD.f;\n var keys = ownKeys(O);\n var result = {};\n var i = 0;\n var key, desc;\n while (keys.length > i) {\n desc = getDesc(O, key = keys[i++]);\n if (desc !== undefined) createProperty(result, key, desc);\n }\n return result;\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar toPrimitive = require('./_to-primitive');\nvar getPrototypeOf = require('./_object-gpo');\nvar getOwnPropertyDescriptor = require('./_object-gopd').f;\n\n// B.2.2.4 Object.prototype.__lookupGetter__(P)\nrequire('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {\n __lookupGetter__: function __lookupGetter__(P) {\n var O = toObject(this);\n var K = toPrimitive(P, true);\n var D;\n do {\n if (D = getOwnPropertyDescriptor(O, K)) return D.get;\n } while (O = getPrototypeOf(O));\n }\n});\n","'use strict';\nvar $export = require('./_export');\nvar toObject = require('./_to-object');\nvar toPrimitive = require('./_to-primitive');\nvar getPrototypeOf = require('./_object-gpo');\nvar getOwnPropertyDescriptor = require('./_object-gopd').f;\n\n// B.2.2.5 Object.prototype.__lookupSetter__(P)\nrequire('./_descriptors') && $export($export.P + require('./_object-forced-pam'), 'Object', {\n __lookupSetter__: function __lookupSetter__(P) {\n var O = toObject(this);\n var K = toPrimitive(P, true);\n var D;\n do {\n if (D = getOwnPropertyDescriptor(O, K)) return D.set;\n } while (O = getPrototypeOf(O));\n }\n});\n","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\nvar $values = require('./_object-to-array')(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n","'use strict';\n// https://github.com/zenparsing/es-observable\nvar $export = require('./_export');\nvar global = require('./_global');\nvar core = require('./_core');\nvar microtask = require('./_microtask')();\nvar OBSERVABLE = require('./_wks')('observable');\nvar aFunction = require('./_a-function');\nvar anObject = require('./_an-object');\nvar anInstance = require('./_an-instance');\nvar redefineAll = require('./_redefine-all');\nvar hide = require('./_hide');\nvar forOf = require('./_for-of');\nvar RETURN = forOf.RETURN;\n\nvar getMethod = function (fn) {\n return fn == null ? undefined : aFunction(fn);\n};\n\nvar cleanupSubscription = function (subscription) {\n var cleanup = subscription._c;\n if (cleanup) {\n subscription._c = undefined;\n cleanup();\n }\n};\n\nvar subscriptionClosed = function (subscription) {\n return subscription._o === undefined;\n};\n\nvar closeSubscription = function (subscription) {\n if (!subscriptionClosed(subscription)) {\n subscription._o = undefined;\n cleanupSubscription(subscription);\n }\n};\n\nvar Subscription = function (observer, subscriber) {\n anObject(observer);\n this._c = undefined;\n this._o = observer;\n observer = new SubscriptionObserver(this);\n try {\n var cleanup = subscriber(observer);\n var subscription = cleanup;\n if (cleanup != null) {\n if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };\n else aFunction(cleanup);\n this._c = cleanup;\n }\n } catch (e) {\n observer.error(e);\n return;\n } if (subscriptionClosed(this)) cleanupSubscription(this);\n};\n\nSubscription.prototype = redefineAll({}, {\n unsubscribe: function unsubscribe() { closeSubscription(this); }\n});\n\nvar SubscriptionObserver = function (subscription) {\n this._s = subscription;\n};\n\nSubscriptionObserver.prototype = redefineAll({}, {\n next: function next(value) {\n var subscription = this._s;\n if (!subscriptionClosed(subscription)) {\n var observer = subscription._o;\n try {\n var m = getMethod(observer.next);\n if (m) return m.call(observer, value);\n } catch (e) {\n try {\n closeSubscription(subscription);\n } finally {\n throw e;\n }\n }\n }\n },\n error: function error(value) {\n var subscription = this._s;\n if (subscriptionClosed(subscription)) throw value;\n var observer = subscription._o;\n subscription._o = undefined;\n try {\n var m = getMethod(observer.error);\n if (!m) throw value;\n value = m.call(observer, value);\n } catch (e) {\n try {\n cleanupSubscription(subscription);\n } finally {\n throw e;\n }\n } cleanupSubscription(subscription);\n return value;\n },\n complete: function complete(value) {\n var subscription = this._s;\n if (!subscriptionClosed(subscription)) {\n var observer = subscription._o;\n subscription._o = undefined;\n try {\n var m = getMethod(observer.complete);\n value = m ? m.call(observer, value) : undefined;\n } catch (e) {\n try {\n cleanupSubscription(subscription);\n } finally {\n throw e;\n }\n } cleanupSubscription(subscription);\n return value;\n }\n }\n});\n\nvar $Observable = function Observable(subscriber) {\n anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);\n};\n\nredefineAll($Observable.prototype, {\n subscribe: function subscribe(observer) {\n return new Subscription(observer, this._f);\n },\n forEach: function forEach(fn) {\n var that = this;\n return new (core.Promise || global.Promise)(function (resolve, reject) {\n aFunction(fn);\n var subscription = that.subscribe({\n next: function (value) {\n try {\n return fn(value);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n error: reject,\n complete: resolve\n });\n });\n }\n});\n\nredefineAll($Observable, {\n from: function from(x) {\n var C = typeof this === 'function' ? this : $Observable;\n var method = getMethod(anObject(x)[OBSERVABLE]);\n if (method) {\n var observable = anObject(method.call(x));\n return observable.constructor === C ? observable : new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n return new C(function (observer) {\n var done = false;\n microtask(function () {\n if (!done) {\n try {\n if (forOf(x, false, function (it) {\n observer.next(it);\n if (done) return RETURN;\n }) === RETURN) return;\n } catch (e) {\n if (done) throw e;\n observer.error(e);\n return;\n } observer.complete();\n }\n });\n return function () { done = true; };\n });\n },\n of: function of() {\n for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++];\n return new (typeof this === 'function' ? this : $Observable)(function (observer) {\n var done = false;\n microtask(function () {\n if (!done) {\n for (var j = 0; j < items.length; ++j) {\n observer.next(items[j]);\n if (done) return;\n } observer.complete();\n }\n });\n return function () { done = true; };\n });\n }\n});\n\nhide($Observable.prototype, OBSERVABLE, function () { return this; });\n\n$export($export.G, { Observable: $Observable });\n\nrequire('./_set-species')('Observable');\n","// https://github.com/tc39/proposal-promise-finally\n'use strict';\nvar $export = require('./_export');\nvar core = require('./_core');\nvar global = require('./_global');\nvar speciesConstructor = require('./_species-constructor');\nvar promiseResolve = require('./_promise-resolve');\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n","'use strict';\n// https://github.com/tc39/proposal-promise-try\nvar $export = require('./_export');\nvar newPromiseCapability = require('./_new-promise-capability');\nvar perform = require('./_perform');\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapability.f(this);\n var result = perform(callbackfn);\n (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n return promiseCapability.promise;\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar toMetaKey = metadata.key;\nvar ordinaryDefineOwnMetadata = metadata.set;\n\nmetadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {\n ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar toMetaKey = metadata.key;\nvar getOrCreateMetadataMap = metadata.map;\nvar store = metadata.store;\n\nmetadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {\n var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);\n var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);\n if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;\n if (metadataMap.size) return true;\n var targetMetadata = store.get(target);\n targetMetadata['delete'](targetKey);\n return !!targetMetadata.size || store['delete'](target);\n} });\n","var Set = require('./es6.set');\nvar from = require('./_array-from-iterable');\nvar metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar ordinaryOwnMetadataKeys = metadata.keys;\nvar toMetaKey = metadata.key;\n\nvar ordinaryMetadataKeys = function (O, P) {\n var oKeys = ordinaryOwnMetadataKeys(O, P);\n var parent = getPrototypeOf(O);\n if (parent === null) return oKeys;\n var pKeys = ordinaryMetadataKeys(parent, P);\n return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;\n};\n\nmetadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {\n return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar ordinaryHasOwnMetadata = metadata.has;\nvar ordinaryGetOwnMetadata = metadata.get;\nvar toMetaKey = metadata.key;\n\nvar ordinaryGetMetadata = function (MetadataKey, O, P) {\n var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);\n var parent = getPrototypeOf(O);\n return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;\n};\n\nmetadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar ordinaryOwnMetadataKeys = metadata.keys;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {\n return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar ordinaryGetOwnMetadata = metadata.get;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryGetOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar getPrototypeOf = require('./_object-gpo');\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nvar ordinaryHasMetadata = function (MetadataKey, O, P) {\n var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return true;\n var parent = getPrototypeOf(O);\n return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;\n};\n\nmetadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n","var metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n","var $metadata = require('./_metadata');\nvar anObject = require('./_an-object');\nvar aFunction = require('./_a-function');\nvar toMetaKey = $metadata.key;\nvar ordinaryDefineOwnMetadata = $metadata.set;\n\n$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {\n return function decorator(target, targetKey) {\n ordinaryDefineOwnMetadata(\n metadataKey, metadataValue,\n (targetKey !== undefined ? anObject : aFunction)(target),\n toMetaKey(targetKey)\n );\n };\n} });\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from\nrequire('./_set-collection-from')('Set');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of\nrequire('./_set-collection-of')('Set');\n","// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = require('./_export');\n\n$export($export.P + $export.R, 'Set', { toJSON: require('./_collection-to-json')('Set') });\n","'use strict';\n// https://github.com/mathiasbynens/String.prototype.at\nvar $export = require('./_export');\nvar $at = require('./_string-at')(true);\n\n$export($export.P, 'String', {\n at: function at(pos) {\n return $at(this, pos);\n }\n});\n","'use strict';\n// https://tc39.github.io/String.prototype.matchAll/\nvar $export = require('./_export');\nvar defined = require('./_defined');\nvar toLength = require('./_to-length');\nvar isRegExp = require('./_is-regexp');\nvar getFlags = require('./_flags');\nvar RegExpProto = RegExp.prototype;\n\nvar $RegExpStringIterator = function (regexp, string) {\n this._r = regexp;\n this._s = string;\n};\n\nrequire('./_iter-create')($RegExpStringIterator, 'RegExp String', function next() {\n var match = this._r.exec(this._s);\n return { value: match, done: match === null };\n});\n\n$export($export.P, 'String', {\n matchAll: function matchAll(regexp) {\n defined(this);\n if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');\n var S = String(this);\n var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);\n var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);\n rx.lastIndex = toLength(regexp.lastIndex);\n return new $RegExpStringIterator(rx, S);\n }\n});\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\n$export($export.P + $export.F * /Version\\/10\\.\\d+(\\.\\d+)? Safari\\//.test(userAgent), 'String', {\n padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n","'use strict';\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = require('./_export');\nvar $pad = require('./_string-pad');\nvar userAgent = require('./_user-agent');\n\n// https://github.com/zloirock/core-js/issues/280\n$export($export.P + $export.F * /Version\\/10\\.\\d+(\\.\\d+)? Safari\\//.test(userAgent), 'String', {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n","'use strict';\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\nrequire('./_string-trim')('trimLeft', function ($trim) {\n return function trimLeft() {\n return $trim(this, 1);\n };\n}, 'trimStart');\n","'use strict';\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\nrequire('./_string-trim')('trimRight', function ($trim) {\n return function trimRight() {\n return $trim(this, 2);\n };\n}, 'trimEnd');\n","require('./_wks-define')('asyncIterator');\n","require('./_wks-define')('observable');\n","// https://github.com/tc39/proposal-global\nvar $export = require('./_export');\n\n$export($export.S, 'System', { global: require('./_global') });\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from\nrequire('./_set-collection-from')('WeakMap');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of\nrequire('./_set-collection-of')('WeakMap');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from\nrequire('./_set-collection-from')('WeakSet');\n","// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of\nrequire('./_set-collection-of')('WeakSet');\n","var $iterators = require('./es6.array.iterator');\nvar getKeys = require('./_object-keys');\nvar redefine = require('./_redefine');\nvar global = require('./_global');\nvar hide = require('./_hide');\nvar Iterators = require('./_iterators');\nvar wks = require('./_wks');\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n","var $export = require('./_export');\nvar $task = require('./_task');\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});\n","// ie9- setTimeout & setInterval additional parameters fix\nvar global = require('./_global');\nvar $export = require('./_export');\nvar userAgent = require('./_user-agent');\nvar slice = [].slice;\nvar MSIE = /MSIE .\\./.test(userAgent); // <- dirty ie9- check\nvar wrap = function (set) {\n return function (fn, time /* , ...args */) {\n var boundArgs = arguments.length > 2;\n var args = boundArgs ? slice.call(arguments, 2) : false;\n return set(boundArgs ? function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);\n } : fn, time);\n };\n};\n$export($export.G + $export.B + $export.F * MSIE, {\n setTimeout: wrap(global.setTimeout),\n setInterval: wrap(global.setInterval)\n});\n","require('./modules/es6.symbol');\nrequire('./modules/es6.object.create');\nrequire('./modules/es6.object.define-property');\nrequire('./modules/es6.object.define-properties');\nrequire('./modules/es6.object.get-own-property-descriptor');\nrequire('./modules/es6.object.get-prototype-of');\nrequire('./modules/es6.object.keys');\nrequire('./modules/es6.object.get-own-property-names');\nrequire('./modules/es6.object.freeze');\nrequire('./modules/es6.object.seal');\nrequire('./modules/es6.object.prevent-extensions');\nrequire('./modules/es6.object.is-frozen');\nrequire('./modules/es6.object.is-sealed');\nrequire('./modules/es6.object.is-extensible');\nrequire('./modules/es6.object.assign');\nrequire('./modules/es6.object.is');\nrequire('./modules/es6.object.set-prototype-of');\nrequire('./modules/es6.object.to-string');\nrequire('./modules/es6.function.bind');\nrequire('./modules/es6.function.name');\nrequire('./modules/es6.function.has-instance');\nrequire('./modules/es6.parse-int');\nrequire('./modules/es6.parse-float');\nrequire('./modules/es6.number.constructor');\nrequire('./modules/es6.number.to-fixed');\nrequire('./modules/es6.number.to-precision');\nrequire('./modules/es6.number.epsilon');\nrequire('./modules/es6.number.is-finite');\nrequire('./modules/es6.number.is-integer');\nrequire('./modules/es6.number.is-nan');\nrequire('./modules/es6.number.is-safe-integer');\nrequire('./modules/es6.number.max-safe-integer');\nrequire('./modules/es6.number.min-safe-integer');\nrequire('./modules/es6.number.parse-float');\nrequire('./modules/es6.number.parse-int');\nrequire('./modules/es6.math.acosh');\nrequire('./modules/es6.math.asinh');\nrequire('./modules/es6.math.atanh');\nrequire('./modules/es6.math.cbrt');\nrequire('./modules/es6.math.clz32');\nrequire('./modules/es6.math.cosh');\nrequire('./modules/es6.math.expm1');\nrequire('./modules/es6.math.fround');\nrequire('./modules/es6.math.hypot');\nrequire('./modules/es6.math.imul');\nrequire('./modules/es6.math.log10');\nrequire('./modules/es6.math.log1p');\nrequire('./modules/es6.math.log2');\nrequire('./modules/es6.math.sign');\nrequire('./modules/es6.math.sinh');\nrequire('./modules/es6.math.tanh');\nrequire('./modules/es6.math.trunc');\nrequire('./modules/es6.string.from-code-point');\nrequire('./modules/es6.string.raw');\nrequire('./modules/es6.string.trim');\nrequire('./modules/es6.string.iterator');\nrequire('./modules/es6.string.code-point-at');\nrequire('./modules/es6.string.ends-with');\nrequire('./modules/es6.string.includes');\nrequire('./modules/es6.string.repeat');\nrequire('./modules/es6.string.starts-with');\nrequire('./modules/es6.string.anchor');\nrequire('./modules/es6.string.big');\nrequire('./modules/es6.string.blink');\nrequire('./modules/es6.string.bold');\nrequire('./modules/es6.string.fixed');\nrequire('./modules/es6.string.fontcolor');\nrequire('./modules/es6.string.fontsize');\nrequire('./modules/es6.string.italics');\nrequire('./modules/es6.string.link');\nrequire('./modules/es6.string.small');\nrequire('./modules/es6.string.strike');\nrequire('./modules/es6.string.sub');\nrequire('./modules/es6.string.sup');\nrequire('./modules/es6.date.now');\nrequire('./modules/es6.date.to-json');\nrequire('./modules/es6.date.to-iso-string');\nrequire('./modules/es6.date.to-string');\nrequire('./modules/es6.date.to-primitive');\nrequire('./modules/es6.array.is-array');\nrequire('./modules/es6.array.from');\nrequire('./modules/es6.array.of');\nrequire('./modules/es6.array.join');\nrequire('./modules/es6.array.slice');\nrequire('./modules/es6.array.sort');\nrequire('./modules/es6.array.for-each');\nrequire('./modules/es6.array.map');\nrequire('./modules/es6.array.filter');\nrequire('./modules/es6.array.some');\nrequire('./modules/es6.array.every');\nrequire('./modules/es6.array.reduce');\nrequire('./modules/es6.array.reduce-right');\nrequire('./modules/es6.array.index-of');\nrequire('./modules/es6.array.last-index-of');\nrequire('./modules/es6.array.copy-within');\nrequire('./modules/es6.array.fill');\nrequire('./modules/es6.array.find');\nrequire('./modules/es6.array.find-index');\nrequire('./modules/es6.array.species');\nrequire('./modules/es6.array.iterator');\nrequire('./modules/es6.regexp.constructor');\nrequire('./modules/es6.regexp.to-string');\nrequire('./modules/es6.regexp.flags');\nrequire('./modules/es6.regexp.match');\nrequire('./modules/es6.regexp.replace');\nrequire('./modules/es6.regexp.search');\nrequire('./modules/es6.regexp.split');\nrequire('./modules/es6.promise');\nrequire('./modules/es6.map');\nrequire('./modules/es6.set');\nrequire('./modules/es6.weak-map');\nrequire('./modules/es6.weak-set');\nrequire('./modules/es6.typed.array-buffer');\nrequire('./modules/es6.typed.data-view');\nrequire('./modules/es6.typed.int8-array');\nrequire('./modules/es6.typed.uint8-array');\nrequire('./modules/es6.typed.uint8-clamped-array');\nrequire('./modules/es6.typed.int16-array');\nrequire('./modules/es6.typed.uint16-array');\nrequire('./modules/es6.typed.int32-array');\nrequire('./modules/es6.typed.uint32-array');\nrequire('./modules/es6.typed.float32-array');\nrequire('./modules/es6.typed.float64-array');\nrequire('./modules/es6.reflect.apply');\nrequire('./modules/es6.reflect.construct');\nrequire('./modules/es6.reflect.define-property');\nrequire('./modules/es6.reflect.delete-property');\nrequire('./modules/es6.reflect.enumerate');\nrequire('./modules/es6.reflect.get');\nrequire('./modules/es6.reflect.get-own-property-descriptor');\nrequire('./modules/es6.reflect.get-prototype-of');\nrequire('./modules/es6.reflect.has');\nrequire('./modules/es6.reflect.is-extensible');\nrequire('./modules/es6.reflect.own-keys');\nrequire('./modules/es6.reflect.prevent-extensions');\nrequire('./modules/es6.reflect.set');\nrequire('./modules/es6.reflect.set-prototype-of');\nrequire('./modules/es7.array.includes');\nrequire('./modules/es7.array.flat-map');\nrequire('./modules/es7.array.flatten');\nrequire('./modules/es7.string.at');\nrequire('./modules/es7.string.pad-start');\nrequire('./modules/es7.string.pad-end');\nrequire('./modules/es7.string.trim-left');\nrequire('./modules/es7.string.trim-right');\nrequire('./modules/es7.string.match-all');\nrequire('./modules/es7.symbol.async-iterator');\nrequire('./modules/es7.symbol.observable');\nrequire('./modules/es7.object.get-own-property-descriptors');\nrequire('./modules/es7.object.values');\nrequire('./modules/es7.object.entries');\nrequire('./modules/es7.object.define-getter');\nrequire('./modules/es7.object.define-setter');\nrequire('./modules/es7.object.lookup-getter');\nrequire('./modules/es7.object.lookup-setter');\nrequire('./modules/es7.map.to-json');\nrequire('./modules/es7.set.to-json');\nrequire('./modules/es7.map.of');\nrequire('./modules/es7.set.of');\nrequire('./modules/es7.weak-map.of');\nrequire('./modules/es7.weak-set.of');\nrequire('./modules/es7.map.from');\nrequire('./modules/es7.set.from');\nrequire('./modules/es7.weak-map.from');\nrequire('./modules/es7.weak-set.from');\nrequire('./modules/es7.global');\nrequire('./modules/es7.system.global');\nrequire('./modules/es7.error.is-error');\nrequire('./modules/es7.math.clamp');\nrequire('./modules/es7.math.deg-per-rad');\nrequire('./modules/es7.math.degrees');\nrequire('./modules/es7.math.fscale');\nrequire('./modules/es7.math.iaddh');\nrequire('./modules/es7.math.isubh');\nrequire('./modules/es7.math.imulh');\nrequire('./modules/es7.math.rad-per-deg');\nrequire('./modules/es7.math.radians');\nrequire('./modules/es7.math.scale');\nrequire('./modules/es7.math.umulh');\nrequire('./modules/es7.math.signbit');\nrequire('./modules/es7.promise.finally');\nrequire('./modules/es7.promise.try');\nrequire('./modules/es7.reflect.define-metadata');\nrequire('./modules/es7.reflect.delete-metadata');\nrequire('./modules/es7.reflect.get-metadata');\nrequire('./modules/es7.reflect.get-metadata-keys');\nrequire('./modules/es7.reflect.get-own-metadata');\nrequire('./modules/es7.reflect.get-own-metadata-keys');\nrequire('./modules/es7.reflect.has-metadata');\nrequire('./modules/es7.reflect.has-own-metadata');\nrequire('./modules/es7.reflect.metadata');\nrequire('./modules/es7.asap');\nrequire('./modules/es7.observable');\nrequire('./modules/web.timers');\nrequire('./modules/web.immediate');\nrequire('./modules/web.dom.iterable');\nmodule.exports = require('./modules/_core');\n","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\nmodule.exports = function(useSourceMap) {\n\tvar list = [];\n\n\t// return the list of modules as css string\n\tlist.toString = function toString() {\n\t\treturn this.map(function (item) {\n\t\t\tvar content = cssWithMappingToString(item, useSourceMap);\n\t\t\tif(item[2]) {\n\t\t\t\treturn \"@media \" + item[2] + \"{\" + content + \"}\";\n\t\t\t} else {\n\t\t\t\treturn content;\n\t\t\t}\n\t\t}).join(\"\");\n\t};\n\n\t// import a list of modules into the list\n\tlist.i = function(modules, mediaQuery) {\n\t\tif(typeof modules === \"string\")\n\t\t\tmodules = [[null, modules, \"\"]];\n\t\tvar alreadyImportedModules = {};\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar id = this[i][0];\n\t\t\tif(typeof id === \"number\")\n\t\t\t\talreadyImportedModules[id] = true;\n\t\t}\n\t\tfor(i = 0; i < modules.length; i++) {\n\t\t\tvar item = modules[i];\n\t\t\t// skip already imported module\n\t\t\t// this implementation is not 100% perfect for weird media query combinations\n\t\t\t// when a module is imported multiple times with different media queries.\n\t\t\t// I hope this will never occur (Hey this way we have smaller bundles)\n\t\t\tif(typeof item[0] !== \"number\" || !alreadyImportedModules[item[0]]) {\n\t\t\t\tif(mediaQuery && !item[2]) {\n\t\t\t\t\titem[2] = mediaQuery;\n\t\t\t\t} else if(mediaQuery) {\n\t\t\t\t\titem[2] = \"(\" + item[2] + \") and (\" + mediaQuery + \")\";\n\t\t\t\t}\n\t\t\t\tlist.push(item);\n\t\t\t}\n\t\t}\n\t};\n\treturn list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n\tvar content = item[1] || '';\n\tvar cssMapping = item[3];\n\tif (!cssMapping) {\n\t\treturn content;\n\t}\n\n\tif (useSourceMap && typeof btoa === 'function') {\n\t\tvar sourceMapping = toComment(cssMapping);\n\t\tvar sourceURLs = cssMapping.sources.map(function (source) {\n\t\t\treturn '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'\n\t\t});\n\n\t\treturn [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n\t}\n\n\treturn [content].join('\\n');\n}\n\n// Adapted from convert-source-map (MIT)\nfunction toComment(sourceMap) {\n\t// eslint-disable-next-line no-undef\n\tvar base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n\tvar data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;\n\n\treturn '/*# ' + data + ' */';\n}\n","(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define('html-janitor', factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.HTMLJanitor = factory();\n }\n}(this, function () {\n\n /**\n * @param {Object} config.tags Dictionary of allowed tags.\n * @param {boolean} config.keepNestedBlockElements Default false.\n */\n function HTMLJanitor(config) {\n\n var tagDefinitions = config['tags'];\n var tags = Object.keys(tagDefinitions);\n\n var validConfigValues = tags\n .map(function(k) { return typeof tagDefinitions[k]; })\n .every(function(type) { return type === 'object' || type === 'boolean' || type === 'function'; });\n\n if(!validConfigValues) {\n throw new Error(\"The configuration was invalid\");\n }\n\n this.config = config;\n }\n\n // TODO: not exhaustive?\n var blockElementNames = ['P', 'LI', 'TD', 'TH', 'DIV', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'PRE'];\n function isBlockElement(node) {\n return blockElementNames.indexOf(node.nodeName) !== -1;\n }\n\n var inlineElementNames = ['A', 'B', 'STRONG', 'I', 'EM', 'SUB', 'SUP', 'U', 'STRIKE'];\n function isInlineElement(node) {\n return inlineElementNames.indexOf(node.nodeName) !== -1;\n }\n\n HTMLJanitor.prototype.clean = function (html) {\n var sandbox = document.createElement('div');\n sandbox.innerHTML = html;\n\n this._sanitize(sandbox);\n\n return sandbox.innerHTML;\n };\n\n HTMLJanitor.prototype._sanitize = function (parentNode) {\n var treeWalker = createTreeWalker(parentNode);\n var node = treeWalker.firstChild();\n if (!node) { return; }\n\n do {\n // Ignore nodes that have already been sanitized\n if (node._sanitized) {\n continue;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n // If this text node is just whitespace and the previous or next element\n // sibling is a block element, remove it\n // N.B.: This heuristic could change. Very specific to a bug with\n // `contenteditable` in Firefox: http://jsbin.com/EyuKase/1/edit?js,output\n // FIXME: make this an option?\n if (node.data.trim() === ''\n && ((node.previousElementSibling && isBlockElement(node.previousElementSibling))\n || (node.nextElementSibling && isBlockElement(node.nextElementSibling)))) {\n parentNode.removeChild(node);\n this._sanitize(parentNode);\n break;\n } else {\n continue;\n }\n }\n\n // Remove all comments\n if (node.nodeType === Node.COMMENT_NODE) {\n parentNode.removeChild(node);\n this._sanitize(parentNode);\n break;\n }\n\n var isInline = isInlineElement(node);\n var containsBlockElement;\n if (isInline) {\n containsBlockElement = Array.prototype.some.call(node.childNodes, isBlockElement);\n }\n\n // Block elements should not be nested (e.g.
  • ...); if\n // they are, we want to unwrap the inner block element.\n var isNotTopContainer = !! parentNode.parentNode;\n var isNestedBlockElement =\n isBlockElement(parentNode) &&\n isBlockElement(node) &&\n isNotTopContainer;\n\n var nodeName = node.nodeName.toLowerCase();\n\n var allowedAttrs = getAllowedAttrs(this.config, nodeName, node);\n\n var isInvalid = isInline && containsBlockElement;\n\n // Drop tag entirely according to the whitelist *and* if the markup\n // is invalid.\n if (isInvalid || shouldRejectNode(node, allowedAttrs)\n || (!this.config.keepNestedBlockElements && isNestedBlockElement)) {\n // Do not keep the inner text of SCRIPT/STYLE elements.\n if (! (node.nodeName === 'SCRIPT' || node.nodeName === 'STYLE')) {\n while (node.childNodes.length > 0) {\n parentNode.insertBefore(node.childNodes[0], node);\n }\n }\n parentNode.removeChild(node);\n\n this._sanitize(parentNode);\n break;\n }\n\n // Sanitize attributes\n for (var a = 0; a < node.attributes.length; a += 1) {\n var attr = node.attributes[a];\n\n if (shouldRejectAttr(attr, allowedAttrs, node)) {\n node.removeAttribute(attr.name);\n // Shift the array to continue looping.\n a = a - 1;\n }\n }\n\n // Sanitize children\n this._sanitize(node);\n\n // Mark node as sanitized so it's ignored in future runs\n node._sanitized = true;\n } while ((node = treeWalker.nextSibling()));\n };\n\n function createTreeWalker(node) {\n return document.createTreeWalker(node,\n NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT,\n null, false);\n }\n\n function getAllowedAttrs(config, nodeName, node){\n if (typeof config.tags[nodeName] === 'function') {\n return config.tags[nodeName](node);\n } else {\n return config.tags[nodeName];\n }\n }\n\n function shouldRejectNode(node, allowedAttrs){\n if (typeof allowedAttrs === 'undefined') {\n return true;\n } else if (typeof allowedAttrs === 'boolean') {\n return !allowedAttrs;\n }\n\n return false;\n }\n\n function shouldRejectAttr(attr, allowedAttrs, node){\n var attrName = attr.name.toLowerCase();\n\n if (allowedAttrs === true){\n return false;\n } else if (typeof allowedAttrs[attrName] === 'function'){\n return !allowedAttrs[attrName](attr.value, node);\n } else if (typeof allowedAttrs[attrName] === 'undefined'){\n return true;\n } else if (allowedAttrs[attrName] === false) {\n return true;\n } else if (typeof allowedAttrs[attrName] === 'string') {\n return (allowedAttrs[attrName] !== attr.value);\n }\n\n return false;\n }\n\n return HTMLJanitor;\n\n}));\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/**\r\n * Codex Editor\r\n *\r\n * Short Description (눈_눈;)\r\n * @version 2.0.0\r\n *\r\n * How to start?\r\n * Example:\r\n * new CodexEditor({\r\n * holderId : 'codex-editor',\r\n * initialBlock : 'text',\r\n * placeholder : 'Write your story....',\r\n * tools: {\r\n * quote: Quote,\r\n * anotherTool : AnotherTool\r\n * },\r\n * toolsConfig: {\r\n * quote: {\r\n * iconClassname : 'quote-icon',\r\n * displayInToolbox : true,\r\n * enableLineBreaks : true\r\n * },\r\n * anotherTool: {\r\n * iconClassname : 'tool-icon'\r\n * }\r\n * }\r\n * });\r\n *\r\n * - tools is an object: {\r\n * pluginName: PluginClass,\r\n * .....\r\n * }\r\n * - toolsConfig is an additional configuration that uses Codex Editor API\r\n * iconClassname - CSS classname of toolbox icon\r\n * displayInToolbox - if you want to see your Tool in toolbox hided in \"plus\" button, than set \"True\". By default : \"False\"\r\n * enableLineBreaks - by default enter creates new block that set as initialblock, but if you set this property \"True\", enter will break the lines in current block\r\n *\r\n * @author CodeX-Team \r\n *\r\n */\r\n\r\n/**\r\n * @typedef {CodexEditor} CodexEditor - editor class\r\n */\r\n\r\n/**\r\n * @typedef {Object} EditorConfig\r\n * @property {String} holderId - Element to append Editor\r\n * @property {Array} data - Blocks list in JSON-format\r\n * @property {Object} tools - Map for used Tools in format { name : Class, ... }\r\n * @property {String} initialBlock - This Tool will be added by default\r\n * @property {String} placeholder - First Block placeholder\r\n * @property {Object} sanitizer - @todo fill desc\r\n * @property {Boolean} hideToolbar - @todo fill desc\r\n * @property {Object} toolsConfig - tools configuration {@link tools#ToolConfig}\r\n */\r\n\r\n/**\r\n * Dynamically imported utils\r\n *\r\n * @typedef {Dom} $ - {@link components/dom.js}\r\n * @typedef {Util} _ - {@link components/utils.js}\r\n */\r\n\r\n'use strict';\r\n\r\n/**\r\n * Apply polyfills\r\n */\r\nimport 'babel-core/register';\r\nimport 'babel-polyfill';\r\nimport 'components/polyfills';\r\n\r\n/**\r\n * Require Editor modules places in components/modules dir\r\n */\r\n// eslint-disable-next-line\r\nlet modules = editorModules.map( module => require('./components/modules/' + module ));\r\n\r\n/**\r\n * @class\r\n *\r\n * @classdesc CodeX Editor base class\r\n *\r\n * @property this.config - all settings\r\n * @property this.moduleInstances - constructed editor components\r\n *\r\n * @type {CodexEditor}\r\n */\r\nexport default class CodexEditor {\r\n /** Editor version */\r\n static get version() {\r\n return VERSION;\r\n }\r\n\r\n /**\r\n * @param {EditorConfig} config - user configuration\r\n *\r\n */\r\n constructor(config) {\r\n /**\r\n * Configuration object\r\n * @type {EditorConfig}\r\n */\r\n this.config = {};\r\n\r\n /**\r\n * @typedef {Object} EditorComponents\r\n * @property {BlockManager} BlockManager\r\n * @property {Tools} Tools\r\n * @property {Events} Events\r\n * @property {UI} UI\r\n * @property {Toolbar} Toolbar\r\n * @property {Toolbox} Toolbox\r\n * @property {BlockSettings} BlockSettings\r\n * @property {Renderer} Renderer\r\n * @property {InlineToolbar} InlineToolbar\r\n */\r\n this.moduleInstances = {};\r\n\r\n Promise.resolve()\r\n .then(() => {\r\n this.configuration = config;\r\n })\r\n .then(() => this.init())\r\n .then(() => this.start())\r\n .then(() => {\r\n let methods = this.moduleInstances.API.methods;\r\n\r\n /**\r\n * Make API methods available from inside easier\r\n */\r\n for (let method in methods) {\r\n this[method] = methods[method];\r\n }\r\n\r\n // todo Is it necessary?\r\n delete this.moduleInstances;\r\n })\r\n .then(() => {\r\n console.log('CodeX Editor is ready!');\r\n })\r\n .catch(error => {\r\n console.log('CodeX Editor does not ready because of %o', error);\r\n });\r\n }\r\n\r\n /**\r\n * Setting for configuration\r\n * @param {EditorConfig} config\r\n */\r\n set configuration(config) {\r\n /**\r\n * Initlai block type\r\n * Uses in case when there is no items passed\r\n * @type {{type: (*), data: {text: null}}}\r\n */\r\n let initialBlock = {\r\n type : config.initialBlock,\r\n data : {}\r\n };\r\n\r\n this.config.holderId = config.holderId;\r\n this.config.placeholder = config.placeholder || 'write your story...';\r\n this.config.sanitizer = config.sanitizer || {\r\n p: true,\r\n b: true,\r\n a: true\r\n };\r\n\r\n this.config.hideToolbar = config.hideToolbar ? config.hideToolbar : false;\r\n this.config.tools = config.tools || {};\r\n this.config.toolsConfig = config.toolsConfig || {};\r\n this.config.data = config.data || {};\r\n\r\n /**\r\n * Initialize items to pass data to the Renderer\r\n */\r\n if (_.isEmpty(this.config.data)) {\r\n this.config.data = {};\r\n this.config.data.items = [ initialBlock ];\r\n } else {\r\n if (!this.config.data.items || this.config.data.items.length === 0) {\r\n this.config.data.items = [ initialBlock ];\r\n }\r\n }\r\n\r\n /**\r\n * If initial Block's Tool was not passed, use the first Tool in config.tools\r\n */\r\n if (!config.initialBlock) {\r\n for (this.config.initialBlock in this.config.tools) break;\r\n } else {\r\n this.config.initialBlock = config.initialBlock;\r\n }\r\n }\r\n\r\n /**\r\n * Returns private property\r\n * @returns {EditorConfig}\r\n */\r\n get configuration() {\r\n return this.config;\r\n }\r\n\r\n /**\r\n * Initializes modules:\r\n * - make and save instances\r\n * - configure\r\n */\r\n init() {\r\n /**\r\n * Make modules instances and save it to the @property this.moduleInstances\r\n */\r\n this.constructModules();\r\n\r\n /**\r\n * Modules configuration\r\n */\r\n this.configureModules();\r\n }\r\n\r\n /**\r\n * Make modules instances and save it to the @property this.moduleInstances\r\n */\r\n constructModules() {\r\n modules.forEach( Module => {\r\n try {\r\n /**\r\n * We use class name provided by displayName property\r\n *\r\n * On build, Babel will transform all Classes to the Functions so, name will always be 'Function'\r\n * To prevent this, we use 'babel-plugin-class-display-name' plugin\r\n * @see https://www.npmjs.com/package/babel-plugin-class-display-name\r\n */\r\n this.moduleInstances[Module.displayName] = new Module({\r\n config : this.configuration\r\n });\r\n } catch ( e ) {\r\n console.log('Module %o skipped because %o', Module, e);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Modules instances configuration:\r\n * - pass other modules to the 'state' property\r\n * - ...\r\n */\r\n configureModules() {\r\n for(let name in this.moduleInstances) {\r\n /**\r\n * Module does not need self-instance\r\n */\r\n this.moduleInstances[name].state = this.getModulesDiff( name );\r\n }\r\n }\r\n\r\n /**\r\n * Return modules without passed name\r\n */\r\n getModulesDiff( name ) {\r\n let diff = {};\r\n\r\n for(let moduleName in this.moduleInstances) {\r\n /**\r\n * Skip module with passed name\r\n */\r\n if (moduleName === name) {\r\n continue;\r\n }\r\n diff[moduleName] = this.moduleInstances[moduleName];\r\n }\r\n\r\n return diff;\r\n }\r\n\r\n /**\r\n * Start Editor!\r\n *\r\n * Get list of modules that needs to be prepared and return a sequence (Promise)\r\n * @return {Promise}\r\n */\r\n async start() {\r\n const modulesToPrepare = ['Tools', 'UI', 'BlockManager', 'Paste'];\r\n\r\n await modulesToPrepare.reduce(\r\n (promise, module) => promise.then(async () => {\r\n _.log(`Preparing ${module} module`, 'time');\r\n\r\n try {\r\n await this.moduleInstances[module].prepare();\r\n } catch (e) {\r\n _.log(`Module ${module} was skipped because of %o`, 'warn', e);\r\n }\r\n _.log(`Preparing ${module} module`, 'timeEnd');\r\n }),\r\n Promise.resolve()\r\n );\r\n\r\n return this.moduleInstances.Renderer.render(this.config.data.items);\r\n }\r\n};\r\n\r\n// module.exports = (function (editor) {\r\n//\r\n// 'use strict';\r\n//\r\n// editor.version = VERSION;\r\n// editor.scriptPrefix = 'cdx-script-';\r\n//\r\n// var init = function () {\r\n//\r\n// editor.core = require('./modules/core');\r\n// editor.tools = require('./modules/tools');\r\n// editor.ui = require('./modules/ui');\r\n// editor.transport = require('./modules/transport');\r\n// editor.renderer = require('./modules/renderer');\r\n// editor.saver = require('./modules/saver');\r\n// editor.content = require('./modules/content');\r\n// editor.toolbar = require('./modules/toolbar/toolbar');\r\n// editor.callback = require('./modules/callbacks');\r\n// editor.draw = require('./modules/draw');\r\n// editor.caret = require('./modules/caret');\r\n// editor.notifications = require('./modules/notifications');\r\n// editor.parser = require('./modules/parser');\r\n// editor.sanitizer = require('./modules/sanitizer');\r\n// editor.listeners = require('./modules/listeners');\r\n// editor.destroyer = require('./modules/destroyer');\r\n// editor.paste = require('./modules/paste');\r\n//\r\n// };\r\n//\r\n// /**\r\n// * @public\r\n// * holds initial settings\r\n// */\r\n// editor.settings = {\r\n// tools : ['text', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'],\r\n// holderId : 'codex-editor',\r\n//\r\n// // Type of block showing on empty editor\r\n// initialBlockPlugin: 'text'\r\n// };\r\n//\r\n// /**\r\n// * public\r\n// *\r\n// * Static nodes\r\n// */\r\n// editor.nodes = {\r\n// holder : null,\r\n// wrapper : null,\r\n// toolbar : null,\r\n// inlineToolbar : {\r\n// wrapper : null,\r\n// buttons : null,\r\n// actions : null\r\n// },\r\n// toolbox : null,\r\n// notifications : null,\r\n// plusButton : null,\r\n// showSettingsButton: null,\r\n// showTrashButton : null,\r\n// blockSettings : null,\r\n// pluginSettings : null,\r\n// defaultSettings : null,\r\n// toolbarButtons : {}, // { type : DomEl, ... }\r\n// redactor : null\r\n// };\r\n//\r\n// /**\r\n// * @public\r\n// *\r\n// * Output state\r\n// */\r\n// editor.state = {\r\n// jsonOutput : [],\r\n// blocks : [],\r\n// inputs : []\r\n// };\r\n//\r\n// /**\r\n// * @public\r\n// * Editor plugins\r\n// */\r\n// editor.tools = {};\r\n//\r\n// editor.start = function (userSettings) {\r\n//\r\n// init();\r\n//\r\n// editor.core.prepare(userSettings)\r\n//\r\n// // If all ok, make UI, bind events and parse initial-content\r\n// .then(editor.ui.prepare)\r\n// .then(editor.tools.prepare)\r\n// .then(editor.sanitizer.prepare)\r\n// .then(editor.paste.prepare)\r\n// .then(editor.transport.prepare)\r\n// .then(editor.renderer.makeBlocksFromData)\r\n// .then(editor.ui.saveInputs)\r\n// .catch(function (error) {\r\n//\r\n// editor.core.log('Initialization failed with error: %o', 'warn', error);\r\n//\r\n// });\r\n//\r\n// };\r\n//\r\n// return editor;\r\n//\r\n// })({});\r\n","import IEditor from './interfaces/editor';\r\nimport IEditorConfig from './interfaces/editor-config';\r\nimport IModuleConfig from './interfaces/module-config';\r\n\r\n/**\r\n * @abstract\r\n * @class Module\r\n * @classdesc All modules inherits from this class.\r\n *\r\n * @typedef {Module} Module\r\n * @property {Object} config - Editor user settings\r\n * @property {IEditorConfig} Editor - List of Editor modules\r\n */\r\nexport default class Module {\r\n\r\n /**\r\n * Editor modules list\r\n * @type {IEditor}\r\n */\r\n protected Editor: IEditor;\r\n\r\n /**\r\n * Editor configuration object\r\n * @type {IEditorConfig}\r\n */\r\n protected config: IEditorConfig;\r\n\r\n /**\r\n * @constructor\r\n * @param {IModuleConfig}\r\n */\r\n constructor({config}: IModuleConfig) {\r\n if (new.target === Module) {\r\n throw new TypeError('Constructors for abstract class Module are not allowed.');\r\n }\r\n\r\n this.config = config;\r\n }\r\n\r\n /**\r\n * Editor modules setter\r\n * @param {IEditor} Editor\r\n */\r\n set state(Editor) {\r\n this.Editor = Editor;\r\n }\r\n}\r\n","/**\r\n * @class DeleteTune\r\n * @classdesc Editor's default tune that moves up selected block\r\n *\r\n * @copyright 2018\r\n */\r\nimport IBlockTune from '../interfaces/block-tune';\r\n\r\ndeclare var $: any;\r\ndeclare var _: any;\r\n\r\nexport default class DeleteTune implements IBlockTune {\r\n\r\n /**\r\n * Property that contains CodeX Editor API methods\r\n * @see {docs/api.md}\r\n */\r\n private readonly api: any;\r\n\r\n /**\r\n * Styles\r\n * @type {{wrapper: string}}\r\n */\r\n private CSS = {\r\n wrapper: 'ass',\r\n button: 'ce-settings__button',\r\n buttonDelete: 'ce-settings__button--delete',\r\n buttonConfirm: 'ce-settings__button--confirm',\r\n };\r\n\r\n /**\r\n * Delete confirmation\r\n */\r\n private needConfirmation: boolean;\r\n\r\n /**\r\n * set false confirmation state\r\n */\r\n private resetConfirmation: () => void;\r\n\r\n /**\r\n * Tune nodes\r\n */\r\n private nodes = {\r\n button: null,\r\n };\r\n\r\n /**\r\n * DeleteTune constructor\r\n *\r\n * @param {Object} api\r\n */\r\n constructor({api}) {\r\n this.api = api;\r\n\r\n this.resetConfirmation = () => {\r\n this.setConfirmation(false);\r\n };\r\n }\r\n\r\n /**\r\n * Create \"Delete\" button and add click event listener\r\n * @returns [Element}\r\n */\r\n public render() {\r\n this.nodes.button = $.make('div', [this.CSS.button, this.CSS.buttonDelete], {});\r\n this.nodes.button.appendChild($.svg('cross', 12, 12));\r\n this.api.listener.on(this.nodes.button, 'click', (event) => this.handleClick(event), false);\r\n return this.nodes.button;\r\n }\r\n\r\n /**\r\n * Delete block conditions passed\r\n * @param {MouseEvent} event\r\n */\r\n public handleClick(event: MouseEvent): void {\r\n\r\n /**\r\n * if block is not waiting the confirmation, subscribe on block-settings-closing event to reset\r\n * otherwise delete block\r\n */\r\n if (!this.needConfirmation) {\r\n this.setConfirmation(true);\r\n\r\n /**\r\n * Subscribe on event.\r\n * When toolbar block settings is closed but block deletion is not confirmed,\r\n * then reset confirmation state\r\n */\r\n this.api.events.on('block-settings-closed', this.resetConfirmation);\r\n\r\n } else {\r\n\r\n /**\r\n * Unsubscribe from block-settings closing event\r\n */\r\n this.api.events.off('block-settings-closed', this.resetConfirmation);\r\n\r\n this.api.blocks.delete();\r\n }\r\n }\r\n\r\n /**\r\n * change tune state\r\n */\r\n private setConfirmation(state): void {\r\n this.needConfirmation = state;\r\n this.nodes.button.classList.add(this.CSS.buttonConfirm);\r\n }\r\n\r\n}\r\n","/**\r\n * @class MoveDownTune\r\n * @classdesc Editor's default tune - Moves down highlighted block\r\n *\r\n * @copyright 2018\r\n */\r\nimport IBlockTune from '../interfaces/block-tune';\r\n\r\ndeclare var $: any;\r\ndeclare var _: any;\r\n\r\nexport default class MoveDownTune implements IBlockTune {\r\n /**\r\n * Property that contains CodeX Editor API methods\r\n * @see {api.md}\r\n */\r\n private readonly api: any;\r\n\r\n /**\r\n * Styles\r\n * @type {{wrapper: string}}\r\n */\r\n private CSS = {\r\n button: 'ce-settings__button',\r\n wrapper: 'ce-tune-move-down',\r\n animation: 'wobble',\r\n };\r\n\r\n /**\r\n * MoveDownTune constructor\r\n *\r\n * @param {Object} api\r\n */\r\n public constructor({api}) {\r\n this.api = api;\r\n }\r\n\r\n /**\r\n * Return 'move down' button\r\n */\r\n public render() {\r\n const moveDownButton = $.make('div', [this.CSS.button, this.CSS.wrapper], {});\r\n moveDownButton.appendChild($.svg('arrow-down', 14, 14));\r\n this.api.listener.on(moveDownButton, 'click', (event) => this.handleClick(event, moveDownButton), false);\r\n return moveDownButton;\r\n }\r\n\r\n /**\r\n * Handle clicks on 'move down' button\r\n * @param {MouseEvent} event\r\n * @param {HTMLElement} button\r\n */\r\n public handleClick(event: MouseEvent, button: HTMLElement) {\r\n\r\n const currentBlockIndex = this.api.blocks.getCurrentBlockIndex();\r\n\r\n // If Block is last do nothing\r\n if (currentBlockIndex === this.api.blocks.getBlocksCount() - 1) {\r\n button.classList.add(this.CSS.animation);\r\n\r\n window.setTimeout( () => {\r\n button.classList.remove(this.CSS.animation);\r\n }, 500);\r\n return;\r\n }\r\n\r\n const nextBlockElement = this.api.blocks.getBlockByIndex(currentBlockIndex + 1).holder,\r\n nextBlockCoords = nextBlockElement.getBoundingClientRect();\r\n\r\n let scrollOffset = Math.abs(window.innerHeight - nextBlockElement.offsetHeight);\r\n\r\n /**\r\n * Next block ends on screen.\r\n * Increment scroll by next block's height to save element onscreen-position\r\n */\r\n if (nextBlockCoords.top < window.innerHeight) {\r\n\r\n scrollOffset = window.scrollY + nextBlockElement.offsetHeight;\r\n\r\n }\r\n\r\n window.scrollTo(0, scrollOffset);\r\n\r\n /** Change blocks positions */\r\n this.api.blocks.swap(currentBlockIndex, currentBlockIndex + 1);\r\n\r\n }\r\n}\r\n","/**\r\n * @class MoveUpTune\r\n * @classdesc Editor's default tune that moves up selected block\r\n *\r\n * @copyright 2018\r\n */\r\nimport IBlockTune from '../interfaces/block-tune';\r\n\r\ndeclare var $: any;\r\ndeclare var _: any;\r\n\r\nexport default class MoveUpTune implements IBlockTune {\r\n\r\n /**\r\n * Property that contains CodeX Editor API methods\r\n * @see {api.md}\r\n */\r\n private readonly api: any;\r\n\r\n /**\r\n * Styles\r\n * @type {{wrapper: string}}\r\n */\r\n private CSS = {\r\n button: 'ce-settings__button',\r\n wrapper: 'ce-tune-move-up',\r\n animation: 'wobble',\r\n };\r\n\r\n /**\r\n * MoveUpTune constructor\r\n *\r\n * @param {Object} api\r\n */\r\n public constructor({api}) {\r\n this.api = api;\r\n }\r\n\r\n /**\r\n * Create \"MoveUp\" button and add click event listener\r\n * @returns [Element}\r\n */\r\n public render() {\r\n const moveUpButton = $.make('div', [this.CSS.button, this.CSS.wrapper], {});\r\n moveUpButton.appendChild($.svg('arrow-up', 14, 14));\r\n this.api.listener.on(moveUpButton, 'click', (event) => this.handleClick(event, moveUpButton), false);\r\n return moveUpButton;\r\n }\r\n\r\n /**\r\n * Move current block up\r\n * @param {MouseEvent} event\r\n * @param {HTMLElement} button\r\n */\r\n public handleClick(event: MouseEvent, button: HTMLElement): void {\r\n\r\n const currentBlockIndex = this.api.blocks.getCurrentBlockIndex();\r\n\r\n if (currentBlockIndex === 0) {\r\n button.classList.add(this.CSS.animation);\r\n\r\n window.setTimeout( () => {\r\n button.classList.remove(this.CSS.animation);\r\n }, 500);\r\n return;\r\n }\r\n\r\n const currentBlockElement = this.api.blocks.getBlockByIndex(currentBlockIndex).holder,\r\n previousBlockElement = this.api.blocks.getBlockByIndex(currentBlockIndex - 1).holder;\r\n\r\n /**\r\n * Here is two cases:\r\n * - when previous block has negative offset and part of it is visible on window, then we scroll\r\n * by window's height and add offset which is mathematically difference between two blocks\r\n *\r\n * - when previous block is visible and has offset from the window,\r\n * than we scroll window to the difference between this offsets.\r\n */\r\n const currentBlockCoords = currentBlockElement.getBoundingClientRect(),\r\n previousBlockCoords = previousBlockElement.getBoundingClientRect();\r\n\r\n let scrollUpOffset;\r\n\r\n if (previousBlockCoords.top > 0) {\r\n scrollUpOffset = Math.abs(currentBlockCoords.top) - Math.abs(previousBlockCoords.top);\r\n } else {\r\n scrollUpOffset = window.innerHeight - Math.abs(currentBlockCoords.top) + Math.abs(previousBlockCoords.top);\r\n }\r\n\r\n window.scrollBy(0, -1 * scrollUpOffset);\r\n\r\n /** Change blocks positions */\r\n this.api.blocks.swap(currentBlockIndex, currentBlockIndex - 1);\r\n }\r\n}\r\n","/**\r\n * @class Block\r\n * @classdesc This class describes editor`s block, including block`s HTMLElement, data and tool\r\n *\r\n * @property {Tool} tool — current block tool (Paragraph, for example)\r\n * @property {Object} CSS — block`s css classes\r\n *\r\n */\r\n\r\n/** Import default tunes */\r\nimport MoveUpTune from './block-tunes/block-tune-move-up';\r\nimport DeleteTune from './block-tunes/block-tune-delete';\r\nimport MoveDownTune from './block-tunes/block-tune-move-down';\r\n\r\n/**\r\n * @classdesc Abstract Block class that contains Block information, Tool name and Tool class instance\r\n *\r\n * @property tool - Tool instance\r\n * @property html - Returns HTML content of plugin\r\n * @property holder - Div element that wraps block content with Tool's content. Has `ce-block` CSS class\r\n * @property pluginsContent - HTML content that returns by Tool's render function\r\n */\r\nexport default class Block {\r\n /**\r\n * @constructor\r\n * @param {String} toolName - Tool name that passed on initialization\r\n * @param {Object} toolInstance — passed Tool`s instance that rendered the Block\r\n * @param {Object} settings - default settings\r\n * @param {Object} apiMethods - Editor API\r\n */\r\n constructor(toolName, toolInstance, settings, apiMethods) {\r\n this.name = toolName;\r\n this.tool = toolInstance;\r\n this.settings = settings;\r\n this.api = apiMethods;\r\n this.holder = this.compose();\r\n\r\n /**\r\n * @type {IBlockTune[]}\r\n */\r\n this.tunes = this.makeTunes();\r\n }\r\n\r\n /**\r\n * CSS classes for the Block\r\n * @return {{wrapper: string, content: string}}\r\n */\r\n static get CSS() {\r\n return {\r\n wrapper: 'ce-block',\r\n content: 'ce-block__content',\r\n selected: 'ce-block--selected'\r\n };\r\n }\r\n\r\n /**\r\n * Make default Block wrappers and put Tool`s content there\r\n * @returns {HTMLDivElement}\r\n */\r\n compose() {\r\n let wrapper = $.make('div', Block.CSS.wrapper),\r\n contentNode = $.make('div', Block.CSS.content),\r\n pluginsContent = this.tool.render();\r\n\r\n contentNode.appendChild(pluginsContent);\r\n wrapper.appendChild(contentNode);\r\n return wrapper;\r\n }\r\n\r\n /**\r\n * Calls Tool's method\r\n *\r\n * Method checks tool property {MethodName}. Fires method with passes params If it is instance of Function\r\n *\r\n * @param {String} methodName\r\n * @param {Object} params\r\n */\r\n call(methodName, params) {\r\n /**\r\n * call Tool's method with the instance context\r\n */\r\n if (this.tool[methodName] && this.tool[methodName] instanceof Function) {\r\n this.tool[methodName].call(this.tool, params);\r\n }\r\n }\r\n\r\n /**\r\n * Returns Plugins content\r\n * @return {Node}\r\n */\r\n get pluginsContent() {\r\n let pluginsContent = this.holder.querySelector(`.${Block.CSS.content}`);\r\n\r\n if (pluginsContent && pluginsContent.childNodes.length) {\r\n return pluginsContent.childNodes[0];\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Get Block's JSON data\r\n * @return {Object}\r\n */\r\n get data() {\r\n return this.save();\r\n }\r\n\r\n /**\r\n * is block mergeable\r\n * We plugin have merge function then we call it mergable\r\n * @return {boolean}\r\n */\r\n get mergeable() {\r\n return typeof this.tool.merge === 'function';\r\n }\r\n\r\n /**\r\n * Call plugins merge method\r\n * @param {Object} data\r\n */\r\n mergeWith(data) {\r\n return Promise.resolve()\r\n .then(() => {\r\n this.tool.merge(data);\r\n });\r\n }\r\n /**\r\n * Extracts data from Block\r\n * Groups Tool's save processing time\r\n * @return {Object}\r\n */\r\n save() {\r\n let extractedBlock = this.tool.save(this.pluginsContent);\r\n\r\n /** Measuring execution time*/\r\n let measuringStart = window.performance.now(),\r\n measuringEnd;\r\n\r\n return Promise.resolve(extractedBlock)\r\n .then((finishedExtraction) => {\r\n /** measure promise execution */\r\n measuringEnd = window.performance.now();\r\n\r\n return {\r\n tool: this.name,\r\n data: finishedExtraction,\r\n time : measuringEnd - measuringStart\r\n };\r\n })\r\n .catch(function (error) {\r\n _.log(`Saving proccess for ${this.tool.name} tool failed due to the ${error}`, 'log', 'red');\r\n });\r\n }\r\n\r\n /**\r\n * Uses Tool's validation method to check the correctness of output data\r\n * Tool's validation method is optional\r\n *\r\n * @description Method also can return data if it passed the validation\r\n *\r\n * @param {Object} data\r\n * @returns {Boolean|Object} valid\r\n */\r\n validateData(data) {\r\n let isValid = true;\r\n\r\n if (this.tool.validate instanceof Function) {\r\n isValid = this.tool.validate(data);\r\n }\r\n\r\n if (!isValid) {\r\n return false;\r\n }\r\n\r\n return data;\r\n }\r\n\r\n /**\r\n * Make an array with default settings\r\n * Each block has default tune instance that have states\r\n * @return {IBlockTune[]}\r\n */\r\n makeTunes() {\r\n let tunesList = [MoveUpTune, DeleteTune, MoveDownTune];\r\n\r\n // Pluck tunes list and return tune instances with passed Editor API and settings\r\n return tunesList.map( (tune) => {\r\n return new tune({\r\n api: this.api,\r\n settings: this.settings,\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Enumerates initialized tunes and returns fragment that can be appended to the toolbars area\r\n * @return {DocumentFragment}\r\n */\r\n renderTunes() {\r\n let tunesElement = document.createDocumentFragment();\r\n\r\n this.tunes.forEach( tune => {\r\n $.append(tunesElement, tune.render());\r\n });\r\n\r\n return tunesElement;\r\n }\r\n\r\n /**\r\n * Check block for emptiness\r\n * @return {Boolean}\r\n */\r\n get isEmpty() {\r\n /**\r\n * Allow Tool to represent decorative contentless blocks: for example \"* * *\"-tool\r\n * That Tools are not empty\r\n */\r\n if (this.tool.contentless) {\r\n return false;\r\n }\r\n\r\n let emptyText = $.isEmpty(this.pluginsContent),\r\n emptyMedia = !this.hasMedia;\r\n\r\n return emptyText && emptyMedia;\r\n }\r\n\r\n /**\r\n * Check if block has a media content such as images, iframes and other\r\n * @return {Boolean}\r\n */\r\n get hasMedia() {\r\n /**\r\n * This tags represents media-content\r\n * @type {string[]}\r\n */\r\n const mediaTags = [\r\n 'img',\r\n 'iframe',\r\n 'video',\r\n 'audio',\r\n 'source',\r\n 'input',\r\n 'textarea',\r\n 'twitterwidget'\r\n ];\r\n\r\n return !!this.holder.querySelector(mediaTags.join(','));\r\n }\r\n\r\n /**\r\n * Set selected state\r\n * @param {Boolean} state - 'true' to select, 'false' to remove selection\r\n */\r\n set selected(state) {\r\n /**\r\n * We don't need to mark Block as Selected when it is not empty\r\n */\r\n if (state === true && !this.isEmpty) {\r\n this.holder.classList.add(Block.CSS.selected);\r\n } else {\r\n this.holder.classList.remove(Block.CSS.selected);\r\n }\r\n }\r\n}\r\n","/**\r\n * DOM manipulations helper\r\n */\r\nexport default class Dom {\r\n /**\r\n * Check if passed tag has no closed tag\r\n * @param {Element} tag\r\n * @return {Boolean}\r\n */\r\n static isSingleTag(tag) {\r\n return tag.tagName && ['AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR'].includes(tag.tagName);\r\n };\r\n\r\n\r\n /**\r\n * Helper for making Elements with classname and attributes\r\n *\r\n * @param {string} tagName - new Element tag name\r\n * @param {array|string} classNames - list or name of CSS classname(s)\r\n * @param {Object} attributes - any attributes\r\n * @return {Element}\r\n */\r\n static make(tagName, classNames = null, attributes = {}) {\r\n let el = document.createElement(tagName);\r\n\r\n if ( Array.isArray(classNames) ) {\r\n el.classList.add(...classNames);\r\n } else if( classNames ) {\r\n el.classList.add(classNames);\r\n }\r\n\r\n for (let attrName in attributes) {\r\n el[attrName] = attributes[attrName];\r\n }\r\n\r\n return el;\r\n }\r\n\r\n /**\r\n * Creates Text Node with the passed content\r\n * @param {String} content - text content\r\n * @return {Text}\r\n */\r\n static text(content) {\r\n return document.createTextNode(content);\r\n }\r\n\r\n /**\r\n * Creates SVG icon linked to the sprite\r\n * @param {string} name - name (id) of icon from sprite\r\n * @param {number} width\r\n * @param {number} height\r\n * @return {SVGElement}\r\n */\r\n static svg(name, width = 14, height = 14) {\r\n let icon = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\r\n\r\n icon.classList.add('icon', 'icon--' + name);\r\n icon.setAttribute('width', width + 'px');\r\n icon.setAttribute('height', height + 'px');\r\n icon.innerHTML = ``;\r\n\r\n return icon;\r\n }\r\n\r\n /**\r\n * Append one or several elements to the parent\r\n *\r\n * @param {Element} parent - where to append\r\n * @param {Element|Element[]} - element ore elements list\r\n */\r\n static append(parent, elements) {\r\n if ( Array.isArray(elements) ) {\r\n elements.forEach( el => parent.appendChild(el) );\r\n } else {\r\n parent.appendChild(elements);\r\n }\r\n }\r\n\r\n /**\r\n * Swap two elements in parent\r\n * @param {HTMLElement} el1 - from\r\n * @param {HTMLElement} el2 - to\r\n */\r\n static swap(el1, el2) {\r\n // create marker element and insert it where el1 is\r\n const temp = document.createElement('div'),\r\n parent = el1.parentNode;\r\n\r\n parent.insertBefore(temp, el1);\r\n\r\n // move el1 to right before el2\r\n parent.insertBefore(el1, el2);\r\n\r\n // move el2 to right before where el1 used to be\r\n parent.insertBefore(el2, temp);\r\n\r\n // remove temporary marker node\r\n parent.removeChild(temp);\r\n }\r\n\r\n /**\r\n * Selector Decorator\r\n *\r\n * Returns first match\r\n *\r\n * @param {Element} el - element we searching inside. Default - DOM Document\r\n * @param {String} selector - searching string\r\n *\r\n * @returns {Element}\r\n */\r\n static find(el = document, selector) {\r\n return el.querySelector(selector);\r\n }\r\n\r\n /**\r\n * Selector Decorator.\r\n *\r\n * Returns all matches\r\n *\r\n * @param {Element} el - element we searching inside. Default - DOM Document\r\n * @param {String} selector - searching string\r\n * @returns {NodeList}\r\n */\r\n static findAll(el = document, selector) {\r\n return el.querySelectorAll(selector);\r\n }\r\n\r\n /**\r\n * Search for deepest node which is Leaf.\r\n * Leaf is the vertex that doesn't have any child nodes\r\n *\r\n * @description Method recursively goes throw the all Node until it finds the Leaf\r\n *\r\n * @param {Node} node - root Node. From this vertex we start Deep-first search {@link https://en.wikipedia.org/wiki/Depth-first_search}\r\n * @param {Boolean} atLast - find last text node\r\n * @return {Node} - it can be text Node or Element Node, so that caret will able to work with it\r\n */\r\n static getDeepestNode(node, atLast = false) {\r\n /**\r\n * Current function have two directions:\r\n * - starts from first child and every time gets first or nextSibling in special cases\r\n * - starts from last child and gets last or previousSibling\r\n * @type {string}\r\n */\r\n let child = atLast ? 'lastChild' : 'firstChild',\r\n sibling = atLast ? 'previousSibling' : 'nextSibling';\r\n\r\n if (node && node.nodeType === Node.ELEMENT_NODE && node[child]) {\r\n let nodeChild = node[child];\r\n\r\n /**\r\n * special case when child is single tag that can't contain any content\r\n */\r\n if (Dom.isSingleTag(nodeChild)) {\r\n /**\r\n * 1) We need to check the next sibling. If it is Node Element then continue searching for deepest\r\n * from sibling\r\n *\r\n * 2) If single tag's next sibling is null, then go back to parent and check his sibling\r\n * In case of Node Element continue searching\r\n *\r\n * 3) If none of conditions above happened return parent Node Element\r\n */\r\n if (nodeChild[sibling]) {\r\n nodeChild = nodeChild[sibling];\r\n } else if (nodeChild.parentNode[sibling]) {\r\n nodeChild = nodeChild.parentNode[sibling];\r\n } else {\r\n return nodeChild.parentNode;\r\n }\r\n }\r\n\r\n return this.getDeepestNode(nodeChild, atLast);\r\n }\r\n\r\n return node;\r\n }\r\n\r\n /**\r\n * Check if object is DOM node\r\n *\r\n * @param {Object} node\r\n * @returns {boolean}\r\n */\r\n static isElement(node) {\r\n return node && typeof node === 'object' && node.nodeType && node.nodeType === Node.ELEMENT_NODE;\r\n }\r\n\r\n /**\r\n * Check if object is DocumentFragmemt node\r\n *\r\n * @param {Object} node\r\n * @returns {boolean}\r\n */\r\n static isFragment(node) {\r\n return node && typeof node === 'object' && node.nodeType && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE;\r\n }\r\n\r\n /**\r\n * Checks target if it is native input\r\n * @param {Element|String|Node} target - HTML element or string\r\n * @return {Boolean}\r\n */\r\n static isNativeInput(target) {\r\n let nativeInputs = [\r\n 'INPUT',\r\n 'TEXTAREA'\r\n ];\r\n\r\n return target ? nativeInputs.includes(target.tagName) : false;\r\n }\r\n\r\n /**\r\n * Checks node if it is empty\r\n *\r\n * @description Method checks simple Node without any childs for emptiness\r\n * If you have Node with 2 or more children id depth, you better use {@link Dom#isEmpty} method\r\n *\r\n * @param {Node} node\r\n * @return {Boolean} true if it is empty\r\n */\r\n static isNodeEmpty(node) {\r\n let nodeText;\r\n\r\n if ( this.isElement(node) && this.isNativeInput(node) ) {\r\n nodeText = node.value;\r\n } else {\r\n nodeText = node.textContent.replace('\\u200B', '');\r\n }\r\n\r\n return nodeText.trim().length === 0;\r\n }\r\n\r\n /**\r\n * checks node if it is doesn't have any child nodes\r\n * @param {Node} node\r\n * @return {boolean}\r\n */\r\n static isLeaf(node) {\r\n if (!node) {\r\n return false;\r\n }\r\n\r\n return node.childNodes.length === 0;\r\n }\r\n\r\n /**\r\n * breadth-first search (BFS)\r\n * {@link https://en.wikipedia.org/wiki/Breadth-first_search}\r\n *\r\n * @description Pushes to stack all DOM leafs and checks for emptiness\r\n *\r\n * @param {Node} node\r\n * @return {boolean}\r\n */\r\n static isEmpty(node) {\r\n let treeWalker = [],\r\n leafs = [];\r\n\r\n if (!node) {\r\n return true;\r\n }\r\n\r\n if (!node.childNodes.length) {\r\n return this.isNodeEmpty(node);\r\n }\r\n\r\n treeWalker.push(node.firstChild);\r\n\r\n while ( treeWalker.length > 0 ) {\r\n node = treeWalker.shift();\r\n\r\n if (!node) continue;\r\n\r\n if ( this.isLeaf(node) ) {\r\n leafs.push(node);\r\n } else {\r\n treeWalker.push(node.firstChild);\r\n }\r\n\r\n while ( node && node.nextSibling ) {\r\n node = node.nextSibling;\r\n\r\n if (!node) continue;\r\n\r\n treeWalker.push(node);\r\n }\r\n\r\n /**\r\n * If one of childs is not empty, checked Node is not empty too\r\n */\r\n if (node && !this.isNodeEmpty(node)) {\r\n return false;\r\n }\r\n }\r\n\r\n return leafs.every( leaf => this.isNodeEmpty(leaf) );\r\n }\r\n\r\n /**\r\n * Check if string contains html elements\r\n *\r\n * @param string\r\n * @returns {boolean}\r\n */\r\n static isHTMLString(string) {\r\n const wrapper = Dom.make('div');\r\n\r\n wrapper.innerHTML = string;\r\n\r\n return wrapper.childElementCount > 0;\r\n }\r\n\r\n /**\r\n * Return array of names of block html elements\r\n *\r\n * @returns {string[]}\r\n */\r\n static get blockElements() {\r\n return [\r\n 'address',\r\n 'article',\r\n 'aside',\r\n 'blockquote',\r\n 'canvas',\r\n 'div',\r\n 'dl',\r\n 'dt',\r\n 'fieldset',\r\n 'figcaption',\r\n 'figure',\r\n 'footer',\r\n 'form',\r\n 'h1',\r\n 'h2',\r\n 'h3',\r\n 'h4',\r\n 'h5',\r\n 'h6',\r\n 'header',\r\n 'hgroup',\r\n 'hr',\r\n 'li',\r\n 'main',\r\n 'nav',\r\n 'noscript',\r\n 'ol',\r\n 'output',\r\n 'p',\r\n 'pre',\r\n 'ruby',\r\n 'section',\r\n 'table',\r\n 'tr',\r\n 'tfoot',\r\n 'ul',\r\n 'video'\r\n ];\r\n }\r\n};\r\n","import InlineTool from '../interfaces/inline-tool';\r\n\r\ndeclare var $: any;\r\n\r\n/**\r\n * Bold Tool\r\n *\r\n * Inline Toolbar Tool\r\n *\r\n * Makes selected text bolder\r\n */\r\nexport default class BoldInlineTool implements InlineTool {\r\n\r\n /**\r\n * Native Document's command that uses for Bold\r\n */\r\n private readonly commandName: string = 'bold';\r\n\r\n /**\r\n * Styles\r\n */\r\n private readonly CSS = {\r\n button: 'ce-inline-tool',\r\n buttonActive: 'ce-inline-tool--active',\r\n buttonModifier: 'ce-inline-tool--bold',\r\n };\r\n\r\n /**\r\n * Elements\r\n */\r\n private nodes = {\r\n button: null,\r\n };\r\n\r\n constructor(api) {\r\n console.log('Bold Inline Tool is ready');\r\n }\r\n\r\n /**\r\n * Create button for Inline Toolbar\r\n */\r\n public render(): HTMLElement {\r\n this.nodes.button = document.createElement('button');\r\n this.nodes.button.classList.add(this.CSS.button, this.CSS.buttonModifier);\r\n this.nodes.button.appendChild($.svg('bold', 13, 15));\r\n return this.nodes.button;\r\n }\r\n\r\n /**\r\n * Wrap range with tag\r\n * @param {Range} range\r\n */\r\n public surround(range: Range): void {\r\n document.execCommand(this.commandName);\r\n }\r\n\r\n /**\r\n * Check selection and set activated state to button if there are tag\r\n * @param {Selection} selection\r\n */\r\n public checkState(selection: Selection): boolean {\r\n const isActive = document.queryCommandState(this.commandName);\r\n\r\n this.nodes.button.classList.toggle(this.CSS.buttonActive, isActive);\r\n return isActive;\r\n }\r\n}\r\n","import InlineTool from '../interfaces/inline-tool';\r\n\r\ndeclare var $: any;\r\n\r\n/**\r\n * Italic Tool\r\n *\r\n * Inline Toolbar Tool\r\n *\r\n * Style selected text with italic\r\n */\r\nexport default class ItalicInlineTool implements InlineTool {\r\n\r\n /**\r\n * Native Document's command that uses for Italic\r\n */\r\n private readonly commandName: string = 'italic';\r\n\r\n /**\r\n * Styles\r\n */\r\n private readonly CSS = {\r\n button: 'ce-inline-tool',\r\n buttonActive: 'ce-inline-tool--active',\r\n buttonModifier: 'ce-inline-tool--italic',\r\n };\r\n\r\n /**\r\n * Elements\r\n */\r\n private nodes = {\r\n button: null,\r\n };\r\n\r\n constructor(api) {\r\n console.log('Italic Inline Tool is ready');\r\n }\r\n\r\n /**\r\n * Create button for Inline Toolbar\r\n */\r\n public render(): HTMLElement {\r\n this.nodes.button = document.createElement('button');\r\n this.nodes.button.classList.add(this.CSS.button, this.CSS.buttonModifier);\r\n this.nodes.button.appendChild($.svg('italic', 6, 15));\r\n return this.nodes.button;\r\n }\r\n\r\n /**\r\n * Wrap range with tag\r\n * @param {Range} range\r\n */\r\n public surround(range: Range): void {\r\n document.execCommand(this.commandName);\r\n }\r\n\r\n /**\r\n * Check selection and set activated state to button if there are tag\r\n * @param {Selection} selection\r\n */\r\n public checkState(selection: Selection): boolean {\r\n const isActive = document.queryCommandState(this.commandName);\r\n\r\n this.nodes.button.classList.toggle(this.CSS.buttonActive, isActive);\r\n return isActive;\r\n }\r\n}\r\n","import InlineTool from '../interfaces/inline-tool';\r\nimport Selection from '../selection';\r\n\r\ndeclare var $: any;\r\ndeclare var _: any;\r\n\r\n/**\r\n * Link Tool\r\n *\r\n * Inline Toolbar Tool\r\n *\r\n * Wrap selected text with tag\r\n */\r\nexport default class LinkInlineTool implements InlineTool {\r\n\r\n /**\r\n * Native Document's commands for link/unlink\r\n */\r\n private readonly commandLink: string = 'createLink';\r\n private readonly commandUnlink: string = 'unlink';\r\n\r\n /**\r\n * Enter key code\r\n */\r\n private readonly ENTER_KEY: number = 13;\r\n\r\n /**\r\n * Styles\r\n */\r\n private readonly CSS = {\r\n button: 'ce-inline-tool',\r\n buttonActive: 'ce-inline-tool--active',\r\n buttonModifier: 'ce-inline-tool--link',\r\n buttonUnlink: 'ce-inline-tool--unlink',\r\n input: 'ce-inline-tool-input',\r\n inputShowed: 'ce-inline-tool-input--showed',\r\n };\r\n\r\n /**\r\n * Elements\r\n */\r\n private nodes = {\r\n button: null,\r\n input: null,\r\n };\r\n\r\n /**\r\n * Selection instance\r\n */\r\n private selection: Selection;\r\n\r\n /**\r\n * Input opening state\r\n */\r\n private inputOpened: boolean = false;\r\n\r\n /**\r\n * Available Inline Toolbar methods (open/close)\r\n */\r\n private inlineToolbar: any;\r\n\r\n /**\r\n * @param {object} api - CodeX Editor API\r\n * @param {object} api.toolbar - Inline Toolbar API\r\n */\r\n constructor(api) {\r\n this.inlineToolbar = api.toolbar;\r\n this.selection = new Selection();\r\n }\r\n\r\n /**\r\n * Create button for Inline Toolbar\r\n */\r\n public render(): HTMLElement {\r\n this.nodes.button = document.createElement('button');\r\n this.nodes.button.classList.add(this.CSS.button, this.CSS.buttonModifier);\r\n this.nodes.button.appendChild($.svg('link', 15, 14));\r\n this.nodes.button.appendChild($.svg('unlink', 16, 18));\r\n return this.nodes.button;\r\n }\r\n\r\n /**\r\n * Input for the link\r\n */\r\n public renderActions(): HTMLElement {\r\n this.nodes.input = document.createElement('input');\r\n this.nodes.input.placeholder = 'Add a link';\r\n this.nodes.input.classList.add(this.CSS.input);\r\n this.nodes.input.addEventListener('keydown', (event) => {\r\n if (event.keyCode === this.ENTER_KEY ) {\r\n this.enterPressed(event);\r\n }\r\n });\r\n return this.nodes.input;\r\n }\r\n\r\n /**\r\n * Handle clicks on the Inline Toolbar icon\r\n * @param {Range} range\r\n */\r\n public surround(range: Range): void {\r\n /**\r\n * Range will be null when user makes second click on the 'link icon' to close opened input\r\n */\r\n if (range) {\r\n /**\r\n * Save selection before change focus to the input\r\n */\r\n this.selection.save();\r\n const parentAnchor = this.selection.findParentTag('A');\r\n\r\n /**\r\n * Unlink icon pressed\r\n */\r\n if (parentAnchor) {\r\n this.selection.expandToTag(parentAnchor);\r\n this.unlink();\r\n this.closeActions();\r\n this.checkState();\r\n this.inlineToolbar.close();\r\n return;\r\n }\r\n }\r\n\r\n this.toggleActions();\r\n }\r\n\r\n /**\r\n * Check selection and set activated state to button if there are tag\r\n * @param {Selection} selection\r\n */\r\n public checkState(selection?: Selection): boolean {\r\n const anchorTag = this.selection.findParentTag('A');\r\n\r\n if (anchorTag) {\r\n this.nodes.button.classList.add(this.CSS.buttonUnlink);\r\n this.nodes.button.classList.add(this.CSS.buttonActive);\r\n this.openActions();\r\n\r\n /**\r\n * Fill input value with link href\r\n */\r\n const hrefAttr = anchorTag.getAttribute('href');\r\n this.nodes.input.value = hrefAttr !== 'null' ? hrefAttr : '';\r\n\r\n this.selection.save();\r\n } else {\r\n this.nodes.button.classList.remove(this.CSS.buttonUnlink);\r\n this.nodes.button.classList.remove(this.CSS.buttonActive);\r\n }\r\n\r\n return !!anchorTag;\r\n }\r\n\r\n /**\r\n * Function called with Inline Toolbar closing\r\n */\r\n public clear(): void {\r\n this.closeActions();\r\n }\r\n\r\n private toggleActions(): void {\r\n if (!this.inputOpened) {\r\n this.openActions(true);\r\n } else {\r\n this.closeActions(false);\r\n }\r\n }\r\n\r\n /**\r\n * @param {boolean} needFocus - on link creation we need to focus input. On editing - nope.\r\n */\r\n private openActions(needFocus: boolean = false): void {\r\n this.nodes.input.classList.add(this.CSS.inputShowed);\r\n if (needFocus) {\r\n this.nodes.input.focus();\r\n }\r\n this.inputOpened = true;\r\n }\r\n\r\n /**\r\n * Close input\r\n * @param {boolean} clearSavedSelection — we don't need to clear saved selection\r\n * on toggle-clicks on the icon of opened Toolbar\r\n */\r\n private closeActions(clearSavedSelection: boolean = true): void {\r\n this.nodes.input.classList.remove(this.CSS.inputShowed);\r\n this.nodes.input.value = '';\r\n if (clearSavedSelection) {\r\n this.selection.clearSaved();\r\n }\r\n this.inputOpened = false;\r\n }\r\n\r\n /**\r\n * Enter pressed on input\r\n * @param {KeyboardEvent} event\r\n */\r\n private enterPressed(event: KeyboardEvent): void {\r\n let value = this.nodes.input.value || '';\r\n\r\n if (!value.trim()) {\r\n this.selection.restore();\r\n this.unlink();\r\n event.preventDefault();\r\n this.closeActions();\r\n }\r\n\r\n if (!this.validateURL(value)) {\r\n /**\r\n * @todo show notification 'Incorrect Link'\r\n */\r\n _.log('Incorrect Link pasted', 'warn', value);\r\n return;\r\n }\r\n\r\n value = this.prepareLink(value);\r\n\r\n this.selection.restore();\r\n this.insertLink(value);\r\n\r\n /**\r\n * Preventing events that will be able to happen\r\n */\r\n event.preventDefault();\r\n event.stopPropagation();\r\n event.stopImmediatePropagation();\r\n\r\n this.closeActions();\r\n this.inlineToolbar.close();\r\n this.checkState();\r\n }\r\n\r\n /**\r\n * Detects if passed string is URL\r\n * @param {string} str\r\n * @return {Boolean}\r\n */\r\n private validateURL(str: string): boolean {\r\n /**\r\n * Don't allow spaces\r\n */\r\n return !/\\s/.test(str);\r\n }\r\n\r\n /**\r\n * Process link before injection\r\n * - sanitize\r\n * - add protocol for links like 'google.com'\r\n * @param {string} link - raw user input\r\n */\r\n private prepareLink(link: string): string {\r\n link = link.trim();\r\n link = this.addProtocol(link);\r\n return link;\r\n }\r\n\r\n /**\r\n * Add 'http' protocol to the links like 'vc.ru', 'google.com'\r\n * @param {String} link\r\n */\r\n private addProtocol(link: string): string {\r\n /**\r\n * If protocol already exists, do nothing\r\n */\r\n if (/^(\\w+):\\/\\//.test(link)) {\r\n return link;\r\n }\r\n\r\n /**\r\n * We need to add missed HTTP protocol to the link, but skip 2 cases:\r\n * 1) Internal links like \"/general\"\r\n * 2) Anchors looks like \"#results\"\r\n * 3) Protocol-relative URLs like \"//google.com\"\r\n */\r\n const isInternal = /^\\/[^\\/\\s]/.test(link),\r\n isAnchor = link.substring(0, 1) === '#',\r\n isProtocolRelative = /^\\/\\/[^\\/\\s]/.test(link);\r\n\r\n if (!isInternal && !isAnchor && !isProtocolRelative) {\r\n link = 'http://' + link;\r\n }\r\n\r\n return link;\r\n }\r\n\r\n /**\r\n * Inserts tag with \"href\"\r\n * @param {string} link - \"href\" value\r\n */\r\n private insertLink(link: string): void {\r\n\r\n /**\r\n * Edit all link, not selected part\r\n */\r\n const anchorTag = this.selection.findParentTag('A');\r\n\r\n if (anchorTag) {\r\n this.selection.expandToTag(anchorTag);\r\n }\r\n\r\n document.execCommand(this.commandLink, false, link);\r\n }\r\n\r\n /**\r\n * Removes tag\r\n */\r\n private unlink(): void {\r\n document.execCommand(this.commandUnlink);\r\n }\r\n}\r\n","var map = {\n\t\"./_anchors\": \"./src/components/modules/_anchors.js\",\n\t\"./_anchors.js\": \"./src/components/modules/_anchors.js\",\n\t\"./_callbacks\": \"./src/components/modules/_callbacks.js\",\n\t\"./_callbacks.js\": \"./src/components/modules/_callbacks.js\",\n\t\"./_caret\": \"./src/components/modules/_caret.js\",\n\t\"./_caret.js\": \"./src/components/modules/_caret.js\",\n\t\"./_content\": \"./src/components/modules/_content.js\",\n\t\"./_content.js\": \"./src/components/modules/_content.js\",\n\t\"./_destroyer\": \"./src/components/modules/_destroyer.js\",\n\t\"./_destroyer.js\": \"./src/components/modules/_destroyer.js\",\n\t\"./_notifications\": \"./src/components/modules/_notifications.js\",\n\t\"./_notifications.js\": \"./src/components/modules/_notifications.js\",\n\t\"./_parser\": \"./src/components/modules/_parser.js\",\n\t\"./_parser.js\": \"./src/components/modules/_parser.js\",\n\t\"./_paste\": \"./src/components/modules/_paste.js\",\n\t\"./_paste.js\": \"./src/components/modules/_paste.js\",\n\t\"./_transport\": \"./src/components/modules/_transport.js\",\n\t\"./_transport.js\": \"./src/components/modules/_transport.js\",\n\t\"./api\": \"./src/components/modules/api.ts\",\n\t\"./api-blocks\": \"./src/components/modules/api-blocks.ts\",\n\t\"./api-blocks.ts\": \"./src/components/modules/api-blocks.ts\",\n\t\"./api-events\": \"./src/components/modules/api-events.ts\",\n\t\"./api-events.ts\": \"./src/components/modules/api-events.ts\",\n\t\"./api-listener\": \"./src/components/modules/api-listener.ts\",\n\t\"./api-listener.ts\": \"./src/components/modules/api-listener.ts\",\n\t\"./api-sanitizer\": \"./src/components/modules/api-sanitizer.ts\",\n\t\"./api-sanitizer.ts\": \"./src/components/modules/api-sanitizer.ts\",\n\t\"./api-saver\": \"./src/components/modules/api-saver.ts\",\n\t\"./api-saver.ts\": \"./src/components/modules/api-saver.ts\",\n\t\"./api-selection\": \"./src/components/modules/api-selection.ts\",\n\t\"./api-selection.ts\": \"./src/components/modules/api-selection.ts\",\n\t\"./api-toolbar\": \"./src/components/modules/api-toolbar.ts\",\n\t\"./api-toolbar.ts\": \"./src/components/modules/api-toolbar.ts\",\n\t\"./api.ts\": \"./src/components/modules/api.ts\",\n\t\"./block-events\": \"./src/components/modules/block-events.ts\",\n\t\"./block-events.ts\": \"./src/components/modules/block-events.ts\",\n\t\"./blockManager\": \"./src/components/modules/blockManager.js\",\n\t\"./blockManager.js\": \"./src/components/modules/blockManager.js\",\n\t\"./caret\": \"./src/components/modules/caret.js\",\n\t\"./caret.js\": \"./src/components/modules/caret.js\",\n\t\"./events\": \"./src/components/modules/events.js\",\n\t\"./events.js\": \"./src/components/modules/events.js\",\n\t\"./listeners\": \"./src/components/modules/listeners.js\",\n\t\"./listeners.js\": \"./src/components/modules/listeners.js\",\n\t\"./paste\": \"./src/components/modules/paste.ts\",\n\t\"./paste.ts\": \"./src/components/modules/paste.ts\",\n\t\"./renderer\": \"./src/components/modules/renderer.js\",\n\t\"./renderer.js\": \"./src/components/modules/renderer.js\",\n\t\"./sanitizer\": \"./src/components/modules/sanitizer.js\",\n\t\"./sanitizer.js\": \"./src/components/modules/sanitizer.js\",\n\t\"./saver\": \"./src/components/modules/saver.js\",\n\t\"./saver.js\": \"./src/components/modules/saver.js\",\n\t\"./toolbar\": \"./src/components/modules/toolbar.js\",\n\t\"./toolbar-blockSettings\": \"./src/components/modules/toolbar-blockSettings.js\",\n\t\"./toolbar-blockSettings.js\": \"./src/components/modules/toolbar-blockSettings.js\",\n\t\"./toolbar-inline\": \"./src/components/modules/toolbar-inline.ts\",\n\t\"./toolbar-inline.ts\": \"./src/components/modules/toolbar-inline.ts\",\n\t\"./toolbar-toolbox\": \"./src/components/modules/toolbar-toolbox.js\",\n\t\"./toolbar-toolbox.js\": \"./src/components/modules/toolbar-toolbox.js\",\n\t\"./toolbar.js\": \"./src/components/modules/toolbar.js\",\n\t\"./toolbar/inline\": \"./src/components/modules/toolbar/inline.js\",\n\t\"./toolbar/inline.js\": \"./src/components/modules/toolbar/inline.js\",\n\t\"./toolbar/settings\": \"./src/components/modules/toolbar/settings.js\",\n\t\"./toolbar/settings.js\": \"./src/components/modules/toolbar/settings.js\",\n\t\"./toolbar/toolbar\": \"./src/components/modules/toolbar/toolbar.js\",\n\t\"./toolbar/toolbar.js\": \"./src/components/modules/toolbar/toolbar.js\",\n\t\"./toolbar/toolbox\": \"./src/components/modules/toolbar/toolbox.js\",\n\t\"./toolbar/toolbox.js\": \"./src/components/modules/toolbar/toolbox.js\",\n\t\"./tools\": \"./src/components/modules/tools.js\",\n\t\"./tools.js\": \"./src/components/modules/tools.js\",\n\t\"./ui\": \"./src/components/modules/ui.js\",\n\t\"./ui.js\": \"./src/components/modules/ui.js\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tvar id = map[req];\n\tif(!(id + 1)) { // check for number or string\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn id;\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"./src/components/modules sync recursive ^\\\\.\\\\/.*$\";","/**\r\n * Codex Editor Anchors module\r\n *\r\n * @author Codex Team\r\n * @version 1.0\r\n */\r\n\r\nmodule.exports = function (anchors) {\r\n let editor = codex.editor;\r\n\r\n anchors.input = null;\r\n anchors.currentNode = null;\r\n\r\n anchors.settingsOpened = function (currentBlock) {\r\n anchors.currentNode = currentBlock;\r\n anchors.input.value = anchors.currentNode.dataset.anchor || '';\r\n };\r\n\r\n anchors.anchorChanged = function (e) {\r\n var newAnchor = e.target.value = anchors.rusToTranslit(e.target.value);\r\n\r\n anchors.currentNode.dataset.anchor = newAnchor;\r\n\r\n if (newAnchor.trim() !== '') {\r\n anchors.currentNode.classList.add(editor.ui.className.BLOCK_WITH_ANCHOR);\r\n } else {\r\n anchors.currentNode.classList.remove(editor.ui.className.BLOCK_WITH_ANCHOR);\r\n }\r\n };\r\n\r\n anchors.keyDownOnAnchorInput = function (e) {\r\n if (e.keyCode == editor.core.keys.ENTER) {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n e.target.blur();\r\n editor.toolbar.settings.close();\r\n }\r\n };\r\n\r\n anchors.keyUpOnAnchorInput = function (e) {\r\n if (e.keyCode >= editor.core.keys.LEFT && e.keyCode <= editor.core.keys.DOWN) {\r\n e.stopPropagation();\r\n }\r\n };\r\n\r\n anchors.rusToTranslit = function (string) {\r\n var ru = [\r\n 'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й',\r\n 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф',\r\n 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ь', 'Ы', 'Ь', 'Э', 'Ю', 'Я'\r\n ],\r\n en = [\r\n 'A', 'B', 'V', 'G', 'D', 'E', 'E', 'Zh', 'Z', 'I', 'Y',\r\n 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F',\r\n 'H', 'C', 'Ch', 'Sh', 'Sch', '', 'Y', '', 'E', 'Yu', 'Ya'\r\n ];\r\n\r\n for (var i = 0; i < ru.length; i++) {\r\n string = string.split(ru[i]).join(en[i]);\r\n string = string.split(ru[i].toLowerCase()).join(en[i].toLowerCase());\r\n }\r\n\r\n string = string.replace(/[^0-9a-zA-Z_]+/g, '-');\r\n\r\n return string;\r\n };\r\n\r\n return anchors;\r\n}({});","/**\r\n * @module Codex Editor Callbacks module\r\n * @description Module works with editor added Elements\r\n *\r\n * @author Codex Team\r\n * @version 1.4.0\r\n */\r\n\r\nmodule.exports = (function (callbacks) {\r\n let editor = codex.editor;\r\n\r\n /**\r\n * used by UI module\r\n * @description Routes all keydowns on document\r\n * @param {Object} event\r\n */\r\n callbacks.globalKeydown = function (event) {\r\n switch (event.keyCode) {\r\n case editor.core.keys.ENTER : enterKeyPressed_(event); break;\r\n }\r\n };\r\n\r\n /**\r\n * used by UI module\r\n * @description Routes all keydowns on redactors area\r\n * @param {Object} event\r\n */\r\n callbacks.redactorKeyDown = function (event) {\r\n switch (event.keyCode) {\r\n case editor.core.keys.TAB : tabKeyPressedOnRedactorsZone_(event); break;\r\n case editor.core.keys.ENTER : enterKeyPressedOnRedactorsZone_(event); break;\r\n case editor.core.keys.ESC : escapeKeyPressedOnRedactorsZone_(event); break;\r\n default : defaultKeyPressedOnRedactorsZone_(event); break;\r\n }\r\n };\r\n\r\n /**\r\n * used by UI module\r\n * @description Routes all keyup events\r\n * @param {Object} event\r\n */\r\n callbacks.globalKeyup = function (event) {\r\n switch (event.keyCode) {\r\n case editor.core.keys.UP :\r\n case editor.core.keys.LEFT :\r\n case editor.core.keys.RIGHT :\r\n case editor.core.keys.DOWN : arrowKeyPressed_(event); break;\r\n }\r\n };\r\n\r\n /**\r\n * @param {Object} event\r\n * @private\r\n *\r\n * Handles behaviour when tab pressed\r\n * @description if Content is empty show toolbox (if it is closed) or leaf tools\r\n * uses Toolbars toolbox module to handle the situation\r\n */\r\n var tabKeyPressedOnRedactorsZone_ = function (event) {\r\n /**\r\n * Wait for solution. Would like to know the behaviour\r\n * @todo Add spaces\r\n */\r\n event.preventDefault();\r\n\r\n\r\n if (!editor.core.isBlockEmpty(editor.content.currentNode)) {\r\n return;\r\n }\r\n\r\n if ( !editor.toolbar.opened ) {\r\n editor.toolbar.open();\r\n }\r\n\r\n if (editor.toolbar.opened && !editor.toolbar.toolbox.opened) {\r\n editor.toolbar.toolbox.open();\r\n } else {\r\n editor.toolbar.toolbox.leaf();\r\n }\r\n };\r\n\r\n /**\r\n * Handles global EnterKey Press\r\n * @see enterPressedOnBlock_\r\n * @param {Object} event\r\n */\r\n var enterKeyPressed_ = function () {\r\n if (editor.content.editorAreaHightlighted) {\r\n /**\r\n * it means that we lose input index, saved index before is not correct\r\n * therefore we need to set caret when we insert new block\r\n */\r\n editor.caret.inputIndex = -1;\r\n\r\n enterPressedOnBlock_();\r\n }\r\n };\r\n\r\n /**\r\n * Callback for enter key pressing in first-level block area\r\n *\r\n * @param {Event} event\r\n * @private\r\n *\r\n * @description Inserts new block with initial type from settings\r\n */\r\n var enterPressedOnBlock_ = function () {\r\n var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\r\n\r\n editor.content.insertBlock({\r\n type : NEW_BLOCK_TYPE,\r\n block : editor.tools[NEW_BLOCK_TYPE].render()\r\n }, true );\r\n\r\n editor.toolbar.move();\r\n editor.toolbar.open();\r\n };\r\n\r\n\r\n /**\r\n * ENTER key handler\r\n *\r\n * @param {Object} event\r\n * @private\r\n *\r\n * @description Makes new block with initial type from settings\r\n */\r\n var enterKeyPressedOnRedactorsZone_ = function (event) {\r\n if (event.target.contentEditable == 'true') {\r\n /** Update input index */\r\n editor.caret.saveCurrentInputIndex();\r\n }\r\n\r\n var currentInputIndex = editor.caret.getCurrentInputIndex() || 0,\r\n workingNode = editor.content.currentNode,\r\n tool = workingNode.dataset.tool,\r\n isEnterPressedOnToolbar = editor.toolbar.opened &&\r\n editor.toolbar.current &&\r\n event.target == editor.state.inputs[currentInputIndex];\r\n\r\n /** The list of tools which needs the default browser behaviour */\r\n var enableLineBreaks = editor.tools[tool].enableLineBreaks;\r\n\r\n /** This type of block creates when enter is pressed */\r\n var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\r\n\r\n /**\r\n * When toolbar is opened, select tool instead of making new paragraph\r\n */\r\n if ( isEnterPressedOnToolbar ) {\r\n event.preventDefault();\r\n\r\n editor.toolbar.toolbox.toolClicked(event);\r\n\r\n editor.toolbar.close();\r\n\r\n /**\r\n * Stop other listeners callback executions\r\n */\r\n event.stopPropagation();\r\n event.stopImmediatePropagation();\r\n\r\n return;\r\n }\r\n\r\n /**\r\n * Allow paragraph lineBreaks with shift enter\r\n * Or if shiftkey pressed and enter and enabledLineBreaks, the let new block creation\r\n */\r\n if ( event.shiftKey || enableLineBreaks ) {\r\n event.stopPropagation();\r\n event.stopImmediatePropagation();\r\n return;\r\n }\r\n\r\n var currentSelection = window.getSelection(),\r\n currentSelectedNode = currentSelection.anchorNode,\r\n caretAtTheEndOfText = editor.caret.position.atTheEnd(),\r\n isTextNodeHasParentBetweenContenteditable = false;\r\n\r\n /**\r\n * Allow making new

    in same block by SHIFT+ENTER and forbids to prevent default browser behaviour\r\n */\r\n if ( event.shiftKey && !enableLineBreaks ) {\r\n editor.callback.enterPressedOnBlock(editor.content.currentBlock, event);\r\n event.preventDefault();\r\n return;\r\n }\r\n\r\n /**\r\n * Workaround situation when caret at the Text node that has some wrapper Elements\r\n * Split block cant handle this.\r\n * We need to save default behavior\r\n */\r\n isTextNodeHasParentBetweenContenteditable = currentSelectedNode && currentSelectedNode.parentNode.contentEditable != 'true';\r\n\r\n /**\r\n * Split blocks when input has several nodes and caret placed in textNode\r\n */\r\n if (\r\n currentSelectedNode.nodeType == editor.core.nodeTypes.TEXT &&\r\n !isTextNodeHasParentBetweenContenteditable &&\r\n !caretAtTheEndOfText\r\n ) {\r\n event.preventDefault();\r\n\r\n editor.core.log('Splitting Text node...');\r\n\r\n editor.content.splitBlock(currentInputIndex);\r\n\r\n /** Show plus button when next input after split is empty*/\r\n if (!editor.state.inputs[currentInputIndex + 1].textContent.trim()) {\r\n editor.toolbar.showPlusButton();\r\n }\r\n } else {\r\n var islastNode = editor.content.isLastNode(currentSelectedNode);\r\n\r\n if ( islastNode && caretAtTheEndOfText ) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n event.stopImmediatePropagation();\r\n\r\n editor.core.log('ENTER clicked in last textNode. Create new BLOCK');\r\n\r\n editor.content.insertBlock({\r\n type: NEW_BLOCK_TYPE,\r\n block: editor.tools[NEW_BLOCK_TYPE].render()\r\n }, true);\r\n\r\n editor.toolbar.move();\r\n editor.toolbar.open();\r\n\r\n /** Show plus button with empty block */\r\n editor.toolbar.showPlusButton();\r\n }\r\n }\r\n\r\n /** get all inputs after new appending block */\r\n editor.ui.saveInputs();\r\n };\r\n\r\n /**\r\n * Escape behaviour\r\n * @param event\r\n * @private\r\n *\r\n * @description Closes toolbox and toolbar. Prevents default behaviour\r\n */\r\n var escapeKeyPressedOnRedactorsZone_ = function (event) {\r\n /** Close all toolbar */\r\n editor.toolbar.close();\r\n\r\n /** Close toolbox */\r\n editor.toolbar.toolbox.close();\r\n\r\n event.preventDefault();\r\n };\r\n\r\n /**\r\n * @param {Event} event\r\n * @private\r\n *\r\n * closes and moves toolbar\r\n */\r\n var arrowKeyPressed_ = function (event) {\r\n editor.content.workingNodeChanged();\r\n\r\n /* Closing toolbar */\r\n editor.toolbar.close();\r\n editor.toolbar.move();\r\n };\r\n\r\n /**\r\n * @private\r\n * @param {Event} event\r\n *\r\n * @description Closes all opened bars from toolbar.\r\n * If block is mark, clears highlightning\r\n */\r\n var defaultKeyPressedOnRedactorsZone_ = function () {\r\n editor.toolbar.close();\r\n\r\n if (!editor.toolbar.inline.actionsOpened) {\r\n editor.toolbar.inline.close();\r\n editor.content.clearMark();\r\n }\r\n };\r\n\r\n /**\r\n * Handler when clicked on redactors area\r\n *\r\n * @protected\r\n * @param event\r\n *\r\n * @description Detects clicked area. If it is first-level block area, marks as detected and\r\n * on next enter press will be inserted new block\r\n * Otherwise, save carets position (input index) and put caret to the editable zone.\r\n *\r\n * @see detectWhenClickedOnFirstLevelBlockArea_\r\n *\r\n */\r\n callbacks.redactorClicked = function (event) {\r\n detectWhenClickedOnFirstLevelBlockArea_();\r\n\r\n editor.content.workingNodeChanged(event.target);\r\n editor.ui.saveInputs();\r\n\r\n var selectedText = editor.toolbar.inline.getSelectionText(),\r\n firstLevelBlock;\r\n\r\n /** If selection range took off, then we hide inline toolbar */\r\n if (selectedText.length === 0) {\r\n editor.toolbar.inline.close();\r\n }\r\n\r\n /** Update current input index in memory when caret focused into existed input */\r\n if (event.target.contentEditable == 'true') {\r\n editor.caret.saveCurrentInputIndex();\r\n }\r\n\r\n if (editor.content.currentNode === null) {\r\n /**\r\n * If inputs in redactor does not exits, then we put input index 0 not -1\r\n */\r\n var indexOfLastInput = editor.state.inputs.length > 0 ? editor.state.inputs.length - 1 : 0;\r\n\r\n /** If we have any inputs */\r\n if (editor.state.inputs.length) {\r\n /** getting firstlevel parent of input */\r\n firstLevelBlock = editor.content.getFirstLevelBlock(editor.state.inputs[indexOfLastInput]);\r\n }\r\n\r\n /** If input is empty, then we set caret to the last input */\r\n if (editor.state.inputs.length && editor.state.inputs[indexOfLastInput].textContent === '' && firstLevelBlock.dataset.tool == editor.settings.initialBlockPlugin) {\r\n editor.caret.setToBlock(indexOfLastInput);\r\n } else {\r\n /** Create new input when caret clicked in redactors area */\r\n var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\r\n\r\n editor.content.insertBlock({\r\n type : NEW_BLOCK_TYPE,\r\n block : editor.tools[NEW_BLOCK_TYPE].render()\r\n });\r\n\r\n /** If there is no inputs except inserted */\r\n if (editor.state.inputs.length === 1) {\r\n editor.caret.setToBlock(indexOfLastInput);\r\n } else {\r\n /** Set caret to this appended input */\r\n editor.caret.setToNextBlock(indexOfLastInput);\r\n }\r\n }\r\n } else {\r\n /** Close all panels */\r\n editor.toolbar.settings.close();\r\n editor.toolbar.toolbox.close();\r\n }\r\n\r\n /**\r\n * Move toolbar and open\r\n */\r\n editor.toolbar.move();\r\n editor.toolbar.open();\r\n\r\n var inputIsEmpty = !editor.content.currentNode.textContent.trim(),\r\n currentNodeType = editor.content.currentNode.dataset.tool,\r\n isInitialType = currentNodeType == editor.settings.initialBlockPlugin;\r\n\r\n\r\n /** Hide plus buttons */\r\n editor.toolbar.hidePlusButton();\r\n\r\n if (!inputIsEmpty) {\r\n /** Mark current block */\r\n editor.content.markBlock();\r\n }\r\n\r\n if ( isInitialType && inputIsEmpty ) {\r\n /** Show plus button */\r\n editor.toolbar.showPlusButton();\r\n }\r\n };\r\n\r\n /**\r\n * This method allows to define, is caret in contenteditable element or not.\r\n *\r\n * @private\r\n *\r\n * @description Otherwise, if we get TEXT node from range container, that will means we have input index.\r\n * In this case we use default browsers behaviour (if plugin allows that) or overwritten action.\r\n * Therefore, to be sure that we've clicked first-level block area, we should have currentNode, which always\r\n * specifies to the first-level block. Other cases we just ignore.\r\n */\r\n var detectWhenClickedOnFirstLevelBlockArea_ = function () {\r\n var selection = window.getSelection(),\r\n anchorNode = selection.anchorNode,\r\n flag = false;\r\n\r\n if (selection.rangeCount === 0) {\r\n editor.content.editorAreaHightlighted = true;\r\n } else {\r\n if (!editor.core.isDomNode(anchorNode)) {\r\n anchorNode = anchorNode.parentNode;\r\n }\r\n\r\n /** Already founded, without loop */\r\n if (anchorNode.contentEditable == 'true') {\r\n flag = true;\r\n }\r\n\r\n while (anchorNode.contentEditable != 'true') {\r\n anchorNode = anchorNode.parentNode;\r\n\r\n if (anchorNode.contentEditable == 'true') {\r\n flag = true;\r\n }\r\n\r\n if (anchorNode == document.body) {\r\n break;\r\n }\r\n }\r\n\r\n /** If editable element founded, flag is \"TRUE\", Therefore we return \"FALSE\" */\r\n editor.content.editorAreaHightlighted = !flag;\r\n }\r\n };\r\n\r\n /**\r\n * Toolbar button click handler\r\n *\r\n * @param {Object} event - cursor to the button\r\n * @protected\r\n *\r\n * @description gets current tool and calls render method\r\n */\r\n callbacks.toolbarButtonClicked = function (event) {\r\n var button = this;\r\n\r\n editor.toolbar.current = button.dataset.type;\r\n\r\n editor.toolbar.toolbox.toolClicked(event);\r\n editor.toolbar.close();\r\n };\r\n\r\n /**\r\n * Show or Hide toolbox when plus button is clicked\r\n */\r\n callbacks.plusButtonClicked = function () {\r\n if (!editor.nodes.toolbox.classList.contains('opened')) {\r\n editor.toolbar.toolbox.open();\r\n } else {\r\n editor.toolbar.toolbox.close();\r\n }\r\n };\r\n\r\n /**\r\n * Block handlers for KeyDown events\r\n *\r\n * @protected\r\n * @param {Object} event\r\n *\r\n * Handles keydowns on block\r\n * @see blockRightOrDownArrowPressed_\r\n * @see backspacePressed_\r\n * @see blockLeftOrUpArrowPressed_\r\n */\r\n callbacks.blockKeydown = function (event) {\r\n let block = event.target; // event.target is input\r\n\r\n switch (event.keyCode) {\r\n case editor.core.keys.DOWN:\r\n case editor.core.keys.RIGHT:\r\n blockRightOrDownArrowPressed_(event);\r\n break;\r\n\r\n case editor.core.keys.BACKSPACE:\r\n backspacePressed_(block, event);\r\n break;\r\n\r\n case editor.core.keys.UP:\r\n case editor.core.keys.LEFT:\r\n blockLeftOrUpArrowPressed_(event);\r\n break;\r\n }\r\n };\r\n\r\n /**\r\n * RIGHT or DOWN keydowns on block\r\n *\r\n * @param {Object} event\r\n * @private\r\n *\r\n * @description watches the selection and gets closest editable element.\r\n * Uses method getDeepestTextNodeFromPosition to get the last node of next block\r\n * Sets caret if it is contenteditable\r\n */\r\n var blockRightOrDownArrowPressed_ = function (event) {\r\n var selection = window.getSelection(),\r\n inputs = editor.state.inputs,\r\n focusedNode = selection.anchorNode,\r\n focusedNodeHolder;\r\n\r\n /** Check for caret existance */\r\n if (!focusedNode) {\r\n return false;\r\n }\r\n\r\n /** Looking for closest (parent) contentEditable element of focused node */\r\n while (focusedNode.contentEditable != 'true') {\r\n focusedNodeHolder = focusedNode.parentNode;\r\n focusedNode = focusedNodeHolder;\r\n }\r\n\r\n /** Input index in DOM level */\r\n var editableElementIndex = 0;\r\n\r\n while (focusedNode != inputs[editableElementIndex]) {\r\n editableElementIndex ++;\r\n }\r\n\r\n /**\r\n * Founded contentEditable element doesn't have childs\r\n * Or maybe New created block\r\n */\r\n if (!focusedNode.textContent) {\r\n editor.caret.setToNextBlock(editableElementIndex);\r\n return;\r\n }\r\n\r\n /**\r\n * Do nothing when caret doesn not reaches the end of last child\r\n */\r\n var caretInLastChild = false,\r\n caretAtTheEndOfText = false;\r\n\r\n var lastChild,\r\n deepestTextnode;\r\n\r\n lastChild = focusedNode.childNodes[focusedNode.childNodes.length - 1 ];\r\n\r\n if (editor.core.isDomNode(lastChild)) {\r\n deepestTextnode = editor.content.getDeepestTextNodeFromPosition(lastChild, lastChild.childNodes.length);\r\n } else {\r\n deepestTextnode = lastChild;\r\n }\r\n\r\n caretInLastChild = selection.anchorNode == deepestTextnode;\r\n caretAtTheEndOfText = deepestTextnode.length == selection.anchorOffset;\r\n\r\n if ( !caretInLastChild || !caretAtTheEndOfText ) {\r\n editor.core.log('arrow [down|right] : caret does not reached the end');\r\n return false;\r\n }\r\n\r\n editor.caret.setToNextBlock(editableElementIndex);\r\n };\r\n\r\n /**\r\n * LEFT or UP keydowns on block\r\n *\r\n * @param {Object} event\r\n * @private\r\n *\r\n * watches the selection and gets closest editable element.\r\n * Uses method getDeepestTextNodeFromPosition to get the last node of previous block\r\n * Sets caret if it is contenteditable\r\n *\r\n */\r\n var blockLeftOrUpArrowPressed_ = function (event) {\r\n var selection = window.getSelection(),\r\n inputs = editor.state.inputs,\r\n focusedNode = selection.anchorNode,\r\n focusedNodeHolder;\r\n\r\n /** Check for caret existance */\r\n if (!focusedNode) {\r\n return false;\r\n }\r\n\r\n /**\r\n * LEFT or UP not at the beginning\r\n */\r\n if ( selection.anchorOffset !== 0) {\r\n return false;\r\n }\r\n\r\n /** Looking for parent contentEditable block */\r\n while (focusedNode.contentEditable != 'true') {\r\n focusedNodeHolder = focusedNode.parentNode;\r\n focusedNode = focusedNodeHolder;\r\n }\r\n\r\n /** Input index in DOM level */\r\n var editableElementIndex = 0;\r\n\r\n while (focusedNode != inputs[editableElementIndex]) {\r\n editableElementIndex ++;\r\n }\r\n\r\n /**\r\n * Do nothing if caret is not at the beginning of first child\r\n */\r\n var caretInFirstChild = false,\r\n caretAtTheBeginning = false;\r\n\r\n var firstChild,\r\n deepestTextnode;\r\n\r\n /**\r\n * Founded contentEditable element doesn't have childs\r\n * Or maybe New created block\r\n */\r\n if (!focusedNode.textContent) {\r\n editor.caret.setToPreviousBlock(editableElementIndex);\r\n return;\r\n }\r\n\r\n firstChild = focusedNode.childNodes[0];\r\n\r\n if (editor.core.isDomNode(firstChild)) {\r\n deepestTextnode = editor.content.getDeepestTextNodeFromPosition(firstChild, 0);\r\n } else {\r\n deepestTextnode = firstChild;\r\n }\r\n\r\n caretInFirstChild = selection.anchorNode == deepestTextnode;\r\n caretAtTheBeginning = selection.anchorOffset === 0;\r\n\r\n if ( caretInFirstChild && caretAtTheBeginning ) {\r\n editor.caret.setToPreviousBlock(editableElementIndex);\r\n }\r\n };\r\n\r\n /**\r\n * Handles backspace keydown\r\n *\r\n * @param {Element} block\r\n * @param {Object} event\r\n * @private\r\n *\r\n * @description if block is empty, delete the block and set caret to the previous block\r\n * If block is not empty, try to merge two blocks - current and previous\r\n * But it we try'n to remove first block, then we should set caret to the next block, not previous.\r\n * If we removed the last block, create new one\r\n */\r\n var backspacePressed_ = function (block, event) {\r\n var currentInputIndex = editor.caret.getCurrentInputIndex(),\r\n range,\r\n selectionLength,\r\n firstLevelBlocksCount;\r\n\r\n if (editor.core.isNativeInput(event.target)) {\r\n /** If input value is empty - remove block */\r\n if (event.target.value.trim() == '') {\r\n block.remove();\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n if (block.textContent.trim()) {\r\n range = editor.content.getRange();\r\n selectionLength = range.endOffset - range.startOffset;\r\n\r\n if (editor.caret.position.atStart() && !selectionLength && editor.state.inputs[currentInputIndex - 1]) {\r\n editor.content.mergeBlocks(currentInputIndex);\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n if (!selectionLength) {\r\n block.remove();\r\n }\r\n\r\n\r\n firstLevelBlocksCount = editor.nodes.redactor.childNodes.length;\r\n\r\n /**\r\n * If all blocks are removed\r\n */\r\n if (firstLevelBlocksCount === 0) {\r\n /** update currentNode variable */\r\n editor.content.currentNode = null;\r\n\r\n /** Inserting new empty initial block */\r\n editor.ui.addInitialBlock();\r\n\r\n /** Updating inputs state after deleting last block */\r\n editor.ui.saveInputs();\r\n\r\n /** Set to current appended block */\r\n window.setTimeout(function () {\r\n editor.caret.setToPreviousBlock(1);\r\n }, 10);\r\n } else {\r\n if (editor.caret.inputIndex !== 0) {\r\n /** Target block is not first */\r\n editor.caret.setToPreviousBlock(editor.caret.inputIndex);\r\n } else {\r\n /** If we try to delete first block */\r\n editor.caret.setToNextBlock(editor.caret.inputIndex);\r\n }\r\n }\r\n\r\n editor.toolbar.move();\r\n\r\n if (!editor.toolbar.opened) {\r\n editor.toolbar.open();\r\n }\r\n\r\n /** Updating inputs state */\r\n editor.ui.saveInputs();\r\n\r\n /** Prevent default browser behaviour */\r\n event.preventDefault();\r\n };\r\n\r\n /**\r\n * used by UI module\r\n * Clicks on block settings button\r\n *\r\n * @param {Object} event\r\n * @protected\r\n * @description Opens toolbar settings\r\n */\r\n callbacks.showSettingsButtonClicked = function (event) {\r\n /**\r\n * Get type of current block\r\n * It uses to append settings from tool.settings property.\r\n * ...\r\n * Type is stored in data-type attribute on block\r\n */\r\n var currentToolType = editor.content.currentNode.dataset.tool;\r\n\r\n editor.toolbar.settings.toggle(currentToolType);\r\n\r\n /** Close toolbox when settings button is active */\r\n editor.toolbar.toolbox.close();\r\n editor.toolbar.settings.hideRemoveActions();\r\n };\r\n\r\n return callbacks;\r\n})({});","/**\r\n * Codex Editor Caret Module\r\n *\r\n * @author Codex Team\r\n * @version 1.0\r\n */\r\n\r\nmodule.exports = (function (caret) {\r\n let editor = codex.editor;\r\n\r\n /**\r\n * @var {int} InputIndex - editable element in DOM\r\n */\r\n caret.inputIndex = null;\r\n\r\n /**\r\n * @var {int} offset - caret position in a text node.\r\n */\r\n caret.offset = null;\r\n\r\n /**\r\n * @var {int} focusedNodeIndex - we get index of child node from first-level block\r\n */\r\n caret.focusedNodeIndex = null;\r\n\r\n /**\r\n * Creates Document Range and sets caret to the element.\r\n * @protected\r\n * @uses caret.save — if you need to save caret position\r\n * @param {Element} el - Changed Node.\r\n */\r\n caret.set = function ( el, index, offset) {\r\n offset = offset || caret.offset || 0;\r\n index = index || caret.focusedNodeIndex || 0;\r\n\r\n var childs = el.childNodes,\r\n nodeToSet;\r\n\r\n if ( childs.length === 0 ) {\r\n nodeToSet = el;\r\n } else {\r\n nodeToSet = childs[index];\r\n }\r\n\r\n /** If Element is INPUT */\r\n if (el.contentEditable != 'true') {\r\n el.focus();\r\n return;\r\n }\r\n\r\n if (editor.core.isDomNode(nodeToSet)) {\r\n nodeToSet = editor.content.getDeepestTextNodeFromPosition(nodeToSet, nodeToSet.childNodes.length);\r\n }\r\n\r\n var range = document.createRange(),\r\n selection = window.getSelection();\r\n\r\n window.setTimeout(function () {\r\n range.setStart(nodeToSet, offset);\r\n range.setEnd(nodeToSet, offset);\r\n\r\n selection.removeAllRanges();\r\n selection.addRange(range);\r\n\r\n editor.caret.saveCurrentInputIndex();\r\n }, 20);\r\n };\r\n\r\n /**\r\n * @protected\r\n * Updates index of input and saves it in caret object\r\n */\r\n caret.saveCurrentInputIndex = function () {\r\n /** Index of Input that we paste sanitized content */\r\n var selection = window.getSelection(),\r\n inputs = editor.state.inputs,\r\n focusedNode = selection.anchorNode,\r\n focusedNodeHolder;\r\n\r\n if (!focusedNode) {\r\n return;\r\n }\r\n\r\n /** Looking for parent contentEditable block */\r\n while (focusedNode.contentEditable != 'true') {\r\n focusedNodeHolder = focusedNode.parentNode;\r\n focusedNode = focusedNodeHolder;\r\n }\r\n\r\n /** Input index in DOM level */\r\n var editableElementIndex = 0;\r\n\r\n while (focusedNode != inputs[editableElementIndex]) {\r\n editableElementIndex ++;\r\n }\r\n\r\n caret.inputIndex = editableElementIndex;\r\n };\r\n\r\n /**\r\n * Returns current input index (caret object)\r\n */\r\n caret.getCurrentInputIndex = function () {\r\n return caret.inputIndex;\r\n };\r\n\r\n /**\r\n * @param {int} index - index of first-level block after that we set caret into next input\r\n */\r\n caret.setToNextBlock = function (index) {\r\n var inputs = editor.state.inputs,\r\n nextInput = inputs[index + 1];\r\n\r\n if (!nextInput) {\r\n editor.core.log('We are reached the end');\r\n return;\r\n }\r\n\r\n /**\r\n * When new Block created or deleted content of input\r\n * We should add some text node to set caret\r\n */\r\n if (!nextInput.childNodes.length) {\r\n var emptyTextElement = document.createTextNode('');\r\n\r\n nextInput.appendChild(emptyTextElement);\r\n }\r\n\r\n editor.caret.inputIndex = index + 1;\r\n editor.caret.set(nextInput, 0, 0);\r\n editor.content.workingNodeChanged(nextInput);\r\n };\r\n\r\n /**\r\n * @param {int} index - index of target input.\r\n * Sets caret to input with this index\r\n */\r\n caret.setToBlock = function (index) {\r\n var inputs = editor.state.inputs,\r\n targetInput = inputs[index];\r\n\r\n if ( !targetInput ) {\r\n return;\r\n }\r\n\r\n /**\r\n * When new Block created or deleted content of input\r\n * We should add some text node to set caret\r\n */\r\n if (!targetInput.childNodes.length) {\r\n var emptyTextElement = document.createTextNode('');\r\n\r\n targetInput.appendChild(emptyTextElement);\r\n }\r\n\r\n editor.caret.inputIndex = index;\r\n editor.caret.set(targetInput, 0, 0);\r\n editor.content.workingNodeChanged(targetInput);\r\n };\r\n\r\n /**\r\n * @param {int} index - index of input\r\n */\r\n caret.setToPreviousBlock = function (index) {\r\n index = index || 0;\r\n\r\n var inputs = editor.state.inputs,\r\n previousInput = inputs[index - 1],\r\n lastChildNode,\r\n lengthOfLastChildNode,\r\n emptyTextElement;\r\n\r\n\r\n if (!previousInput) {\r\n editor.core.log('We are reached first node');\r\n return;\r\n }\r\n\r\n lastChildNode = editor.content.getDeepestTextNodeFromPosition(previousInput, previousInput.childNodes.length);\r\n lengthOfLastChildNode = lastChildNode.length;\r\n\r\n /**\r\n * When new Block created or deleted content of input\r\n * We should add some text node to set caret\r\n */\r\n if (!previousInput.childNodes.length) {\r\n emptyTextElement = document.createTextNode('');\r\n previousInput.appendChild(emptyTextElement);\r\n }\r\n editor.caret.inputIndex = index - 1;\r\n editor.caret.set(previousInput, previousInput.childNodes.length - 1, lengthOfLastChildNode);\r\n editor.content.workingNodeChanged(inputs[index - 1]);\r\n };\r\n\r\n caret.position = {\r\n\r\n atStart : function () {\r\n var selection = window.getSelection(),\r\n anchorOffset = selection.anchorOffset,\r\n anchorNode = selection.anchorNode,\r\n firstLevelBlock = editor.content.getFirstLevelBlock(anchorNode),\r\n pluginsRender = firstLevelBlock.childNodes[0];\r\n\r\n if (!editor.core.isDomNode(anchorNode)) {\r\n anchorNode = anchorNode.parentNode;\r\n }\r\n\r\n var isFirstNode = anchorNode === pluginsRender.childNodes[0],\r\n isOffsetZero = anchorOffset === 0;\r\n\r\n return isFirstNode && isOffsetZero;\r\n },\r\n\r\n atTheEnd : function () {\r\n var selection = window.getSelection(),\r\n anchorOffset = selection.anchorOffset,\r\n anchorNode = selection.anchorNode;\r\n\r\n /** Caret is at the end of input */\r\n return !anchorNode || !anchorNode.length || anchorOffset === anchorNode.length;\r\n }\r\n };\r\n\r\n\r\n /**\r\n * Inserts node at the caret location\r\n * @param {HTMLElement|DocumentFragment} node\r\n */\r\n caret.insertNode = function (node) {\r\n var selection, range,\r\n lastNode = node;\r\n\r\n if (node.nodeType == editor.core.nodeTypes.DOCUMENT_FRAGMENT) {\r\n lastNode = node.lastChild;\r\n }\r\n\r\n selection = window.getSelection();\r\n\r\n range = selection.getRangeAt(0);\r\n range.deleteContents();\r\n\r\n range.insertNode(node);\r\n\r\n range.setStartAfter(lastNode);\r\n range.collapse(true);\r\n\r\n selection.removeAllRanges();\r\n selection.addRange(range);\r\n };\r\n\r\n return caret;\r\n})({});","/**\r\n * Codex Editor Content Module\r\n * Works with DOM\r\n *\r\n * @class Content\r\n * @classdesc Class works provides COdex Editor appearance logic\r\n *\r\n * @author Codex Team\r\n * @version 2.0.0\r\n */\r\n\r\nimport $ from '../dom';\r\n\r\nmodule.exports = class Content {\r\n /**\r\n * Module key name\r\n * @returns {string}\r\n */\r\n static get name() {\r\n return 'Content';\r\n }\r\n\r\n /**\r\n * @constructor\r\n *\r\n * @param {EditorConfig} config\r\n */\r\n constructor(config) {\r\n this.config = config;\r\n this.Editor = null;\r\n\r\n this.CSS = {\r\n block: 'ce-block',\r\n content: 'ce-block__content',\r\n stretched: 'ce-block--stretched',\r\n highlighted: 'ce-block--highlighted',\r\n };\r\n\r\n this._currentNode = null;\r\n this._currentIndex = 0;\r\n }\r\n\r\n /**\r\n * Editor modules setter\r\n * @param {object} Editor\r\n */\r\n set state(Editor) {\r\n this.Editor = Editor;\r\n }\r\n\r\n /**\r\n * Get current working node\r\n *\r\n * @returns {null|HTMLElement}\r\n */\r\n get currentNode() {\r\n return this._currentNode;\r\n }\r\n\r\n /**\r\n * Set working node. Working node should be first level block, so we find it before set one to _currentNode property\r\n *\r\n * @param {HTMLElement} node\r\n */\r\n set currentNode(node) {\r\n let firstLevelBlock = this.getFirstLevelBlock(node);\r\n\r\n this._currentNode = firstLevelBlock;\r\n }\r\n\r\n\r\n /**\r\n * @private\r\n * @param pluginHTML\r\n * @param {Boolean} isStretched - make stretched block or not\r\n *\r\n * @description adds necessary information to wrap new created block by first-level holder\r\n */\r\n composeBlock_(pluginHTML, isStretched = false) {\r\n let block = $.make('DIV', this.CSS.block),\r\n blockContent = $.make('DIV', this.CSS.content);\r\n\r\n blockContent.appendChild(pluginHTML);\r\n block.appendChild(blockContent);\r\n\r\n if (isStretched) {\r\n blockContent.classList.add(this.CSS.stretched);\r\n }\r\n\r\n block.dataset.toolId = this._currentIndex++;\r\n\r\n return block;\r\n };\r\n\r\n /**\r\n * Finds first-level block\r\n * @description looks for first-level block.\r\n * gets parent while node is not first-level\r\n *\r\n * @param {Element} node - selected or clicked in redactors area node\r\n * @protected\r\n *\r\n */\r\n getFirstLevelBlock(node) {\r\n if (!$.isElement(node)) {\r\n node = node.parentNode;\r\n }\r\n\r\n if (node === this.Editor.ui.nodes.redactor || node === document.body) {\r\n return null;\r\n } else {\r\n while(node.classList && !node.classList.contains(this.CSS.block)) {\r\n node = node.parentNode;\r\n }\r\n\r\n return node;\r\n }\r\n };\r\n\r\n /**\r\n * Insert new block to working area\r\n *\r\n * @param {HTMLElement} tool\r\n *\r\n * @returns {Number} tool index\r\n *\r\n */\r\n insertBlock(tool) {\r\n let newBlock = this.composeBlock_(tool);\r\n\r\n if (this.currentNode) {\r\n this.currentNode.insertAdjacentElement('afterend', newBlock);\r\n } else {\r\n /**\r\n * If redactor is empty, append as first child\r\n */\r\n this.Editor.ui.nodes.redactor.appendChild(newBlock);\r\n }\r\n\r\n /**\r\n * Set new node as current\r\n */\r\n this.currentNode = newBlock;\r\n\r\n return newBlock.dataset.toolId;\r\n }\r\n};\r\n\r\n// module.exports = (function (content) {\r\n//\r\n// let editor = codex.editor;\r\n//\r\n// /**\r\n// * Links to current active block\r\n// * @type {null | Element}\r\n// */\r\n// content.currentNode = null;\r\n//\r\n// /**\r\n// * clicked in redactor area\r\n// * @type {null | Boolean}\r\n// */\r\n// content.editorAreaHightlighted = null;\r\n//\r\n// /**\r\n// * @deprecated\r\n// * Synchronizes redactor with original textarea\r\n// */\r\n// content.sync = function () {\r\n//\r\n// editor.core.log('syncing...');\r\n//\r\n// /**\r\n// * Save redactor content to editor.state\r\n// */\r\n// editor.state.html = editor.nodes.redactor.innerHTML;\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Appends background to the block\r\n// *\r\n// * @description add CSS class to highlight visually first-level block area\r\n// */\r\n// content.markBlock = function () {\r\n//\r\n// editor.content.currentNode.classList.add(editor.ui.className.BLOCK_HIGHLIGHTED);\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Clear background\r\n// *\r\n// * @description clears styles that highlights block\r\n// */\r\n// content.clearMark = function () {\r\n//\r\n// if (editor.content.currentNode) {\r\n//\r\n// editor.content.currentNode.classList.remove(editor.ui.className.BLOCK_HIGHLIGHTED);\r\n//\r\n// }\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Finds first-level block\r\n// *\r\n// * @param {Element} node - selected or clicked in redactors area node\r\n// * @protected\r\n// *\r\n// * @description looks for first-level block.\r\n// * gets parent while node is not first-level\r\n// */\r\n// content.getFirstLevelBlock = function (node) {\r\n//\r\n// if (!editor.core.isDomNode(node)) {\r\n//\r\n// node = node.parentNode;\r\n//\r\n// }\r\n//\r\n// if (node === editor.nodes.redactor || node === document.body) {\r\n//\r\n// return null;\r\n//\r\n// } else {\r\n//\r\n// while(!node.classList.contains(editor.ui.className.BLOCK_CLASSNAME)) {\r\n//\r\n// node = node.parentNode;\r\n//\r\n// }\r\n//\r\n// return node;\r\n//\r\n// }\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Trigger this event when working node changed\r\n// * @param {Element} targetNode - first-level of this node will be current\r\n// * @protected\r\n// *\r\n// * @description If targetNode is first-level then we set it as current else we look for parents to find first-level\r\n// */\r\n// content.workingNodeChanged = function (targetNode) {\r\n//\r\n// /** Clear background from previous marked block before we change */\r\n// editor.content.clearMark();\r\n//\r\n// if (!targetNode) {\r\n//\r\n// return;\r\n//\r\n// }\r\n//\r\n// content.currentNode = content.getFirstLevelBlock(targetNode);\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Replaces one redactor block with another\r\n// * @protected\r\n// * @param {Element} targetBlock - block to replace. Mostly currentNode.\r\n// * @param {Element} newBlock\r\n// * @param {string} newBlockType - type of new block; we need to store it to data-attribute\r\n// *\r\n// * [!] Function does not saves old block content.\r\n// * You can get it manually and pass with newBlock.innerHTML\r\n// */\r\n// content.replaceBlock = function (targetBlock, newBlock) {\r\n//\r\n// if (!targetBlock || !newBlock) {\r\n//\r\n// editor.core.log('replaceBlock: missed params');\r\n// return;\r\n//\r\n// }\r\n//\r\n// /** If target-block is not a frist-level block, then we iterate parents to find it */\r\n// while(!targetBlock.classList.contains(editor.ui.className.BLOCK_CLASSNAME)) {\r\n//\r\n// targetBlock = targetBlock.parentNode;\r\n//\r\n// }\r\n//\r\n// /** Replacing */\r\n// editor.nodes.redactor.replaceChild(newBlock, targetBlock);\r\n//\r\n// /**\r\n// * Set new node as current\r\n// */\r\n// editor.content.workingNodeChanged(newBlock);\r\n//\r\n// /**\r\n// * Add block handlers\r\n// */\r\n// editor.ui.addBlockHandlers(newBlock);\r\n//\r\n// /**\r\n// * Save changes\r\n// */\r\n// editor.ui.saveInputs();\r\n//\r\n// };\r\n//\r\n// /**\r\n// * @protected\r\n// *\r\n// * Inserts new block to redactor\r\n// * Wrapps block into a DIV with BLOCK_CLASSNAME class\r\n// *\r\n// * @param blockData {object}\r\n// * @param blockData.block {Element} element with block content\r\n// * @param blockData.type {string} block plugin\r\n// * @param needPlaceCaret {bool} pass true to set caret in new block\r\n// *\r\n// */\r\n// content.insertBlock = function ( blockData, needPlaceCaret ) {\r\n//\r\n// var workingBlock = editor.content.currentNode,\r\n// newBlockContent = blockData.block,\r\n// blockType = blockData.type,\r\n// isStretched = blockData.stretched;\r\n//\r\n// var newBlock = composeNewBlock_(newBlockContent, blockType, isStretched);\r\n//\r\n// if (workingBlock) {\r\n//\r\n// editor.core.insertAfter(workingBlock, newBlock);\r\n//\r\n// } else {\r\n//\r\n// /**\r\n// * If redactor is empty, append as first child\r\n// */\r\n// editor.nodes.redactor.appendChild(newBlock);\r\n//\r\n// }\r\n//\r\n// /**\r\n// * Block handler\r\n// */\r\n// editor.ui.addBlockHandlers(newBlock);\r\n//\r\n// /**\r\n// * Set new node as current\r\n// */\r\n// editor.content.workingNodeChanged(newBlock);\r\n//\r\n// /**\r\n// * Save changes\r\n// */\r\n// editor.ui.saveInputs();\r\n//\r\n//\r\n// if ( needPlaceCaret ) {\r\n//\r\n// /**\r\n// * If we don't know input index then we set default value -1\r\n// */\r\n// var currentInputIndex = editor.caret.getCurrentInputIndex() || -1;\r\n//\r\n//\r\n// if (currentInputIndex == -1) {\r\n//\r\n//\r\n// var editableElement = newBlock.querySelector('[contenteditable]'),\r\n// emptyText = document.createTextNode('');\r\n//\r\n// editableElement.appendChild(emptyText);\r\n// editor.caret.set(editableElement, 0, 0);\r\n//\r\n// editor.toolbar.move();\r\n// editor.toolbar.showPlusButton();\r\n//\r\n//\r\n// } else {\r\n//\r\n// if (currentInputIndex === editor.state.inputs.length - 1)\r\n// return;\r\n//\r\n// /** Timeout for browsers execution */\r\n// window.setTimeout(function () {\r\n//\r\n// /** Setting to the new input */\r\n// editor.caret.setToNextBlock(currentInputIndex);\r\n// editor.toolbar.move();\r\n// editor.toolbar.open();\r\n//\r\n// }, 10);\r\n//\r\n// }\r\n//\r\n// }\r\n//\r\n// /**\r\n// * Block is inserted, wait for new click that defined focusing on editors area\r\n// * @type {boolean}\r\n// */\r\n// content.editorAreaHightlighted = false;\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Replaces blocks with saving content\r\n// * @protected\r\n// * @param {Element} noteToReplace\r\n// * @param {Element} newNode\r\n// * @param {Element} blockType\r\n// */\r\n// content.switchBlock = function (blockToReplace, newBlock, tool) {\r\n//\r\n// tool = tool || editor.content.currentNode.dataset.tool;\r\n// var newBlockComposed = composeNewBlock_(newBlock, tool);\r\n//\r\n// /** Replacing */\r\n// editor.content.replaceBlock(blockToReplace, newBlockComposed);\r\n//\r\n// /** Save new Inputs when block is changed */\r\n// editor.ui.saveInputs();\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Iterates between child noted and looking for #text node on deepest level\r\n// * @protected\r\n// *\r\n// * @param {Element} block - node where find\r\n// * @param {int} postiton - starting postion\r\n// * Example: childNodex.length to find from the end\r\n// * or 0 to find from the start\r\n// * @return {Text} block\r\n// * @uses DFS\r\n// */\r\n// content.getDeepestTextNodeFromPosition = function (block, position) {\r\n//\r\n// /**\r\n// * Clear Block from empty and useless spaces with trim.\r\n// * Such nodes we should remove\r\n// */\r\n// var blockChilds = block.childNodes,\r\n// index,\r\n// node,\r\n// text;\r\n//\r\n// for(index = 0; index < blockChilds.length; index++) {\r\n//\r\n// node = blockChilds[index];\r\n//\r\n// if (node.nodeType == editor.core.nodeTypes.TEXT) {\r\n//\r\n// text = node.textContent.trim();\r\n//\r\n// /** Text is empty. We should remove this child from node before we start DFS\r\n// * decrease the quantity of childs.\r\n// */\r\n// if (text === '') {\r\n//\r\n// block.removeChild(node);\r\n// position--;\r\n//\r\n// }\r\n//\r\n// }\r\n//\r\n// }\r\n//\r\n// if (block.childNodes.length === 0) {\r\n//\r\n// return document.createTextNode('');\r\n//\r\n// }\r\n//\r\n// /** Setting default position when we deleted all empty nodes */\r\n// if ( position < 0 )\r\n// position = 1;\r\n//\r\n// var lookingFromStart = false;\r\n//\r\n// /** For looking from START */\r\n// if (position === 0) {\r\n//\r\n// lookingFromStart = true;\r\n// position = 1;\r\n//\r\n// }\r\n//\r\n// while ( position ) {\r\n//\r\n// /** initial verticle of node. */\r\n// if ( lookingFromStart ) {\r\n//\r\n// block = block.childNodes[0];\r\n//\r\n// } else {\r\n//\r\n// block = block.childNodes[position - 1];\r\n//\r\n// }\r\n//\r\n// if ( block.nodeType == editor.core.nodeTypes.TAG ) {\r\n//\r\n// position = block.childNodes.length;\r\n//\r\n// } else if (block.nodeType == editor.core.nodeTypes.TEXT ) {\r\n//\r\n// position = 0;\r\n//\r\n// }\r\n//\r\n// }\r\n//\r\n// return block;\r\n//\r\n// };\r\n//\r\n// /**\r\n// * @private\r\n// * @param {Element} block - current plugins render\r\n// * @param {String} tool - plugins name\r\n// * @param {Boolean} isStretched - make stretched block or not\r\n// *\r\n// * @description adds necessary information to wrap new created block by first-level holder\r\n// */\r\n// var composeNewBlock_ = function (block, tool, isStretched) {\r\n//\r\n// var newBlock = editor.draw.node('DIV', editor.ui.className.BLOCK_CLASSNAME, {}),\r\n// blockContent = editor.draw.node('DIV', editor.ui.className.BLOCK_CONTENT, {});\r\n//\r\n// blockContent.appendChild(block);\r\n// newBlock.appendChild(blockContent);\r\n//\r\n// if (isStretched) {\r\n//\r\n// blockContent.classList.add(editor.ui.className.BLOCK_STRETCHED);\r\n//\r\n// }\r\n//\r\n// newBlock.dataset.tool = tool;\r\n// return newBlock;\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Returns Range object of current selection\r\n// * @protected\r\n// */\r\n// content.getRange = function () {\r\n//\r\n// var selection = window.getSelection().getRangeAt(0);\r\n//\r\n// return selection;\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Divides block in two blocks (after and before caret)\r\n// *\r\n// * @protected\r\n// * @param {int} inputIndex - target input index\r\n// *\r\n// * @description splits current input content to the separate blocks\r\n// * When enter is pressed among the words, that text will be splited.\r\n// */\r\n// content.splitBlock = function (inputIndex) {\r\n//\r\n// var selection = window.getSelection(),\r\n// anchorNode = selection.anchorNode,\r\n// anchorNodeText = anchorNode.textContent,\r\n// caretOffset = selection.anchorOffset,\r\n// textBeforeCaret,\r\n// textNodeBeforeCaret,\r\n// textAfterCaret,\r\n// textNodeAfterCaret;\r\n//\r\n// var currentBlock = editor.content.currentNode.querySelector('[contentEditable]');\r\n//\r\n//\r\n// textBeforeCaret = anchorNodeText.substring(0, caretOffset);\r\n// textAfterCaret = anchorNodeText.substring(caretOffset);\r\n//\r\n// textNodeBeforeCaret = document.createTextNode(textBeforeCaret);\r\n//\r\n// if (textAfterCaret) {\r\n//\r\n// textNodeAfterCaret = document.createTextNode(textAfterCaret);\r\n//\r\n// }\r\n//\r\n// var previousChilds = [],\r\n// nextChilds = [],\r\n// reachedCurrent = false;\r\n//\r\n// if (textNodeAfterCaret) {\r\n//\r\n// nextChilds.push(textNodeAfterCaret);\r\n//\r\n// }\r\n//\r\n// for ( var i = 0, child; !!(child = currentBlock.childNodes[i]); i++) {\r\n//\r\n// if ( child != anchorNode ) {\r\n//\r\n// if ( !reachedCurrent ) {\r\n//\r\n// previousChilds.push(child);\r\n//\r\n// } else {\r\n//\r\n// nextChilds.push(child);\r\n//\r\n// }\r\n//\r\n// } else {\r\n//\r\n// reachedCurrent = true;\r\n//\r\n// }\r\n//\r\n// }\r\n//\r\n// /** Clear current input */\r\n// editor.state.inputs[inputIndex].innerHTML = '';\r\n//\r\n// /**\r\n// * Append all childs founded before anchorNode\r\n// */\r\n// var previousChildsLength = previousChilds.length;\r\n//\r\n// for(i = 0; i < previousChildsLength; i++) {\r\n//\r\n// editor.state.inputs[inputIndex].appendChild(previousChilds[i]);\r\n//\r\n// }\r\n//\r\n// editor.state.inputs[inputIndex].appendChild(textNodeBeforeCaret);\r\n//\r\n// /**\r\n// * Append text node which is after caret\r\n// */\r\n// var nextChildsLength = nextChilds.length,\r\n// newNode = document.createElement('div');\r\n//\r\n// for(i = 0; i < nextChildsLength; i++) {\r\n//\r\n// newNode.appendChild(nextChilds[i]);\r\n//\r\n// }\r\n//\r\n// newNode = newNode.innerHTML;\r\n//\r\n// /** This type of block creates when enter is pressed */\r\n// var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\r\n//\r\n// /**\r\n// * Make new paragraph with text after caret\r\n// */\r\n// editor.content.insertBlock({\r\n// type : NEW_BLOCK_TYPE,\r\n// block : editor.tools[NEW_BLOCK_TYPE].render({\r\n// text : newNode\r\n// })\r\n// }, true );\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Merges two blocks — current and target\r\n// * If target index is not exist, then previous will be as target\r\n// *\r\n// * @protected\r\n// * @param {int} currentInputIndex\r\n// * @param {int} targetInputIndex\r\n// *\r\n// * @description gets two inputs indexes and merges into one\r\n// */\r\n// content.mergeBlocks = function (currentInputIndex, targetInputIndex) {\r\n//\r\n// /** If current input index is zero, then prevent method execution */\r\n// if (currentInputIndex === 0) {\r\n//\r\n// return;\r\n//\r\n// }\r\n//\r\n// var targetInput,\r\n// currentInputContent = editor.state.inputs[currentInputIndex].innerHTML;\r\n//\r\n// if (!targetInputIndex) {\r\n//\r\n// targetInput = editor.state.inputs[currentInputIndex - 1];\r\n//\r\n// } else {\r\n//\r\n// targetInput = editor.state.inputs[targetInputIndex];\r\n//\r\n// }\r\n//\r\n// targetInput.innerHTML += currentInputContent;\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Iterates all right siblings and parents, which has right siblings\r\n// * while it does not reached the first-level block\r\n// *\r\n// * @param {Element} node\r\n// * @return {boolean}\r\n// */\r\n// content.isLastNode = function (node) {\r\n//\r\n// // console.log('погнали перебор родителей');\r\n//\r\n// var allChecked = false;\r\n//\r\n// while ( !allChecked ) {\r\n//\r\n// // console.log('Смотрим на %o', node);\r\n// // console.log('Проверим, пустые ли соседи справа');\r\n//\r\n// if ( !allSiblingsEmpty_(node) ) {\r\n//\r\n// // console.log('Есть непустые соседи. Узел не последний. Выходим.');\r\n// return false;\r\n//\r\n// }\r\n//\r\n// node = node.parentNode;\r\n//\r\n// /**\r\n// * Проверяем родителей до тех пор, пока не найдем блок первого уровня\r\n// */\r\n// if ( node.classList.contains(editor.ui.className.BLOCK_CONTENT) ) {\r\n//\r\n// allChecked = true;\r\n//\r\n// }\r\n//\r\n// }\r\n//\r\n// return true;\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Checks if all element right siblings is empty\r\n// * @param node\r\n// */\r\n// var allSiblingsEmpty_ = function (node) {\r\n//\r\n// /**\r\n// * Нужно убедиться, что после пустого соседа ничего нет\r\n// */\r\n// var sibling = node.nextSibling;\r\n//\r\n// while ( sibling ) {\r\n//\r\n// if (sibling.textContent.length) {\r\n//\r\n// return false;\r\n//\r\n// }\r\n//\r\n// sibling = sibling.nextSibling;\r\n//\r\n// }\r\n//\r\n// return true;\r\n//\r\n// };\r\n//\r\n// /**\r\n// * @public\r\n// *\r\n// * @param {string} htmlData - html content as string\r\n// * @param {string} plainData - plain text\r\n// * @return {string} - html content as string\r\n// */\r\n// content.wrapTextWithParagraphs = function (htmlData, plainData) {\r\n//\r\n// if (!htmlData.trim()) {\r\n//\r\n// return wrapPlainTextWithParagraphs(plainData);\r\n//\r\n// }\r\n//\r\n// var wrapper = document.createElement('DIV'),\r\n// newWrapper = document.createElement('DIV'),\r\n// i,\r\n// paragraph,\r\n// firstLevelBlocks = ['DIV', 'P'],\r\n// blockTyped,\r\n// node;\r\n//\r\n// /**\r\n// * Make HTML Element to Wrap Text\r\n// * It allows us to work with input data as HTML content\r\n// */\r\n// wrapper.innerHTML = htmlData;\r\n// paragraph = document.createElement('P');\r\n//\r\n// for (i = 0; i < wrapper.childNodes.length; i++) {\r\n//\r\n// node = wrapper.childNodes[i];\r\n//\r\n// blockTyped = firstLevelBlocks.indexOf(node.tagName) != -1;\r\n//\r\n// /**\r\n// * If node is first-levet\r\n// * we add this node to our new wrapper\r\n// */\r\n// if ( blockTyped ) {\r\n//\r\n// /**\r\n// * If we had splitted inline nodes to paragraph before\r\n// */\r\n// if ( paragraph.childNodes.length ) {\r\n//\r\n// newWrapper.appendChild(paragraph.cloneNode(true));\r\n//\r\n// /** empty paragraph */\r\n// paragraph = null;\r\n// paragraph = document.createElement('P');\r\n//\r\n// }\r\n//\r\n// newWrapper.appendChild(node.cloneNode(true));\r\n//\r\n// } else {\r\n//\r\n// /** Collect all inline nodes to one as paragraph */\r\n// paragraph.appendChild(node.cloneNode(true));\r\n//\r\n// /** if node is last we should append this node to paragraph and paragraph to new wrapper */\r\n// if ( i == wrapper.childNodes.length - 1 ) {\r\n//\r\n// newWrapper.appendChild(paragraph.cloneNode(true));\r\n//\r\n// }\r\n//\r\n// }\r\n//\r\n// }\r\n//\r\n// return newWrapper.innerHTML;\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Splits strings on new line and wraps paragraphs with

    tag\r\n// * @param plainText\r\n// * @returns {string}\r\n// */\r\n// var wrapPlainTextWithParagraphs = function (plainText) {\r\n//\r\n// if (!plainText) return '';\r\n//\r\n// return '

    ' + plainText.split('\\n\\n').join('

    ') + '

    ';\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Finds closest Contenteditable parent from Element\r\n// * @param {Element} node element looking from\r\n// * @return {Element} node contenteditable\r\n// */\r\n// content.getEditableParent = function (node) {\r\n//\r\n// while (node && node.contentEditable != 'true') {\r\n//\r\n// node = node.parentNode;\r\n//\r\n// }\r\n//\r\n// return node;\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Clear editors content\r\n// *\r\n// * @param {Boolean} all — if true, delete all article data (content, id, etc.)\r\n// */\r\n// content.clear = function (all) {\r\n//\r\n// editor.nodes.redactor.innerHTML = '';\r\n// editor.content.sync();\r\n// editor.ui.saveInputs();\r\n// if (all) {\r\n//\r\n// editor.state.blocks = {};\r\n//\r\n// } else if (editor.state.blocks) {\r\n//\r\n// editor.state.blocks.items = [];\r\n//\r\n// }\r\n//\r\n// editor.content.currentNode = null;\r\n//\r\n// };\r\n//\r\n// /**\r\n// *\r\n// * Load new data to editor\r\n// * If editor is not empty, just append articleData.items\r\n// *\r\n// * @param articleData.items\r\n// */\r\n// content.load = function (articleData) {\r\n//\r\n// var currentContent = Object.assign({}, editor.state.blocks);\r\n//\r\n// editor.content.clear();\r\n//\r\n// if (!Object.keys(currentContent).length) {\r\n//\r\n// editor.state.blocks = articleData;\r\n//\r\n// } else if (!currentContent.items) {\r\n//\r\n// currentContent.items = articleData.items;\r\n// editor.state.blocks = currentContent;\r\n//\r\n// } else {\r\n//\r\n// currentContent.items = currentContent.items.concat(articleData.items);\r\n// editor.state.blocks = currentContent;\r\n//\r\n// }\r\n//\r\n// editor.renderer.makeBlocksFromData();\r\n//\r\n// };\r\n//\r\n// return content;\r\n//\r\n// })({});","/**\r\n * Codex Editor Destroyer module\r\n *\r\n * @auhor Codex Team\r\n * @version 1.0\r\n */\r\n\r\nmodule.exports = function (destroyer) {\r\n let editor = codex.editor;\r\n\r\n destroyer.removeNodes = function () {\r\n editor.nodes.wrapper.remove();\r\n editor.nodes.notifications.remove();\r\n };\r\n\r\n destroyer.destroyPlugins = function () {\r\n for (var tool in editor.tools) {\r\n if (typeof editor.tools[tool].destroy === 'function') {\r\n editor.tools[tool].destroy();\r\n }\r\n }\r\n };\r\n\r\n destroyer.destroyScripts = function () {\r\n var scripts = document.getElementsByTagName('SCRIPT');\r\n\r\n for (var i = 0; i < scripts.length; i++) {\r\n if (scripts[i].id.indexOf(editor.scriptPrefix) + 1) {\r\n scripts[i].remove();\r\n i--;\r\n }\r\n }\r\n };\r\n\r\n\r\n /**\r\n * Delete editor data from webpage.\r\n * You should send settings argument with boolean flags:\r\n * @param settings.ui- remove redactor event listeners and DOM nodes\r\n * @param settings.scripts - remove redactor scripts from DOM\r\n * @param settings.plugins - remove plugin's objects\r\n * @param settings.core - remove editor core. You can remove core only if UI and scripts flags is true\r\n * }\r\n *\r\n */\r\n destroyer.destroy = function (settings) {\r\n if (!settings || typeof settings !== 'object') {\r\n return;\r\n }\r\n\r\n if (settings.ui) {\r\n destroyer.removeNodes();\r\n editor.listeners.removeAll();\r\n }\r\n\r\n if (settings.scripts) {\r\n destroyer.destroyScripts();\r\n }\r\n\r\n if (settings.plugins) {\r\n destroyer.destroyPlugins();\r\n }\r\n\r\n if (settings.ui && settings.scripts && settings.core) {\r\n delete codex.editor;\r\n }\r\n };\r\n\r\n return destroyer;\r\n}({});","/**\r\n * Codex Editor Notification Module\r\n *\r\n * @author Codex Team\r\n * @version 1.0\r\n */\r\n\r\nmodule.exports = (function (notifications) {\r\n let editor = codex.editor;\r\n\r\n var queue = [];\r\n\r\n var addToQueue = function (settings) {\r\n queue.push(settings);\r\n\r\n var index = 0;\r\n\r\n while ( index < queue.length && queue.length > 5) {\r\n if (queue[index].type == 'confirm' || queue[index].type == 'prompt') {\r\n index++;\r\n continue;\r\n }\r\n\r\n queue[index].close();\r\n queue.splice(index, 1);\r\n }\r\n };\r\n\r\n notifications.createHolder = function () {\r\n var holder = editor.draw.node('DIV', 'cdx-notifications-block');\r\n\r\n editor.nodes.notifications = document.body.appendChild(holder);\r\n\r\n return holder;\r\n };\r\n\r\n\r\n /**\r\n * Error notificator. Shows block with message\r\n * @protected\r\n */\r\n notifications.errorThrown = function (errorMsg, event) {\r\n editor.notifications.notification({message: 'This action is not available currently', type: event.type});\r\n };\r\n\r\n /**\r\n *\r\n * Appends notification\r\n *\r\n * settings = {\r\n * type - notification type (reserved types: alert, confirm, prompt). Just add class 'cdx-notification-'+type\r\n * message - notification message\r\n * okMsg - confirm button text (default - 'Ok')\r\n * cancelBtn - cancel button text (default - 'Cancel'). Only for confirm and prompt types\r\n * confirm - function-handler for ok button click\r\n * cancel - function-handler for cancel button click. Only for confirm and prompt types\r\n * time - time (in seconds) after which notification will close (default - 10s)\r\n * }\r\n *\r\n * @param settings\r\n */\r\n notifications.notification = function (constructorSettings) {\r\n /** Private vars and methods */\r\n var notification = null,\r\n cancel = null,\r\n type = null,\r\n confirm = null,\r\n inputField = null;\r\n\r\n var confirmHandler = function () {\r\n close();\r\n\r\n if (typeof confirm !== 'function' ) {\r\n return;\r\n }\r\n\r\n if (type == 'prompt') {\r\n confirm(inputField.value);\r\n return;\r\n }\r\n\r\n confirm();\r\n };\r\n\r\n var cancelHandler = function () {\r\n close();\r\n\r\n if (typeof cancel !== 'function' ) {\r\n return;\r\n }\r\n\r\n cancel();\r\n };\r\n\r\n\r\n /** Public methods */\r\n function create(settings) {\r\n if (!(settings && settings.message)) {\r\n editor.core.log('Can\\'t create notification. Message is missed');\r\n return;\r\n }\r\n\r\n settings.type = settings.type || 'alert';\r\n settings.time = settings.time*1000 || 10000;\r\n\r\n var wrapper = editor.draw.node('DIV', 'cdx-notification'),\r\n message = editor.draw.node('DIV', 'cdx-notification__message'),\r\n input = editor.draw.node('INPUT', 'cdx-notification__input'),\r\n okBtn = editor.draw.node('SPAN', 'cdx-notification__ok-btn'),\r\n cancelBtn = editor.draw.node('SPAN', 'cdx-notification__cancel-btn');\r\n\r\n message.textContent = settings.message;\r\n okBtn.textContent = settings.okMsg || 'ОК';\r\n cancelBtn.textContent = settings.cancelMsg || 'Отмена';\r\n\r\n editor.listeners.add(okBtn, 'click', confirmHandler);\r\n editor.listeners.add(cancelBtn, 'click', cancelHandler);\r\n\r\n wrapper.appendChild(message);\r\n\r\n if (settings.type == 'prompt') {\r\n wrapper.appendChild(input);\r\n }\r\n\r\n wrapper.appendChild(okBtn);\r\n\r\n if (settings.type == 'prompt' || settings.type == 'confirm') {\r\n wrapper.appendChild(cancelBtn);\r\n }\r\n\r\n wrapper.classList.add('cdx-notification-' + settings.type);\r\n wrapper.dataset.type = settings.type;\r\n\r\n notification = wrapper;\r\n type = settings.type;\r\n confirm = settings.confirm;\r\n cancel = settings.cancel;\r\n inputField = input;\r\n\r\n if (settings.type != 'prompt' && settings.type != 'confirm') {\r\n window.setTimeout(close, settings.time);\r\n }\r\n };\r\n\r\n /**\r\n * Show notification block\r\n */\r\n function send() {\r\n editor.nodes.notifications.appendChild(notification);\r\n inputField.focus();\r\n\r\n editor.nodes.notifications.classList.add('cdx-notification__notification-appending');\r\n\r\n window.setTimeout(function () {\r\n editor.nodes.notifications.classList.remove('cdx-notification__notification-appending');\r\n }, 100);\r\n\r\n addToQueue({type: type, close: close});\r\n };\r\n\r\n /**\r\n * Remove notification block\r\n */\r\n function close() {\r\n notification.remove();\r\n };\r\n\r\n\r\n if (constructorSettings) {\r\n create(constructorSettings);\r\n send();\r\n }\r\n\r\n return {\r\n create: create,\r\n send: send,\r\n close: close\r\n };\r\n };\r\n\r\n notifications.clear = function () {\r\n editor.nodes.notifications.innerHTML = '';\r\n queue = [];\r\n };\r\n\r\n return notifications;\r\n})({});","/**\r\n * Codex Editor Parser Module\r\n *\r\n * @author Codex Team\r\n * @version 1.1\r\n */\r\n\r\nmodule.exports = (function (parser) {\r\n let editor = codex.editor;\r\n\r\n /** inserting text */\r\n parser.insertPastedContent = function (blockType, tag) {\r\n editor.content.insertBlock({\r\n type : blockType.type,\r\n block : blockType.render({\r\n text : tag.innerHTML\r\n })\r\n });\r\n };\r\n\r\n /**\r\n * Check DOM node for display style: separated block or child-view\r\n */\r\n parser.isFirstLevelBlock = function (node) {\r\n return node.nodeType == editor.core.nodeTypes.TAG &&\r\n node.classList.contains(editor.ui.className.BLOCK_CLASSNAME);\r\n };\r\n\r\n return parser;\r\n})({});\r\n","/**\r\n * Codex Editor Paste module\r\n *\r\n * @author Codex Team\r\n * @version 1.1.1\r\n */\r\n\r\nmodule.exports = function (paste) {\r\n let editor = codex.editor;\r\n\r\n var patterns = [];\r\n\r\n paste.prepare = function () {\r\n var tools = editor.tools;\r\n\r\n for (var tool in tools) {\r\n if (!tools[tool].renderOnPastePatterns || !Array.isArray(tools[tool].renderOnPastePatterns)) {\r\n continue;\r\n }\r\n\r\n tools[tool].renderOnPastePatterns.map(function (pattern) {\r\n patterns.push(pattern);\r\n });\r\n }\r\n\r\n return Promise.resolve();\r\n };\r\n\r\n /**\r\n * Saves data\r\n * @param event\r\n */\r\n paste.pasted = function (event) {\r\n var clipBoardData = event.clipboardData || window.clipboardData,\r\n content = clipBoardData.getData('Text');\r\n\r\n var result = analize(content);\r\n\r\n if (result) {\r\n event.preventDefault();\r\n event.stopImmediatePropagation();\r\n }\r\n\r\n return result;\r\n };\r\n\r\n /**\r\n * Analizes pated string and calls necessary method\r\n */\r\n\r\n var analize = function (string) {\r\n var result = false,\r\n content = editor.content.currentNode,\r\n plugin = content.dataset.tool;\r\n\r\n patterns.map( function (pattern) {\r\n var execArray = pattern.regex.exec(string),\r\n match = execArray && execArray[0];\r\n\r\n if ( match && match === string.trim()) {\r\n /** current block is not empty */\r\n if ( content.textContent.trim() && plugin == editor.settings.initialBlockPlugin ) {\r\n pasteToNewBlock_();\r\n }\r\n\r\n pattern.callback(string, pattern);\r\n result = true;\r\n }\r\n });\r\n\r\n return result;\r\n };\r\n\r\n var pasteToNewBlock_ = function () {\r\n /** Create new initial block */\r\n editor.content.insertBlock({\r\n\r\n type : editor.settings.initialBlockPlugin,\r\n block : editor.tools[editor.settings.initialBlockPlugin].render({\r\n text : ''\r\n })\r\n\r\n }, false);\r\n };\r\n\r\n /**\r\n * This method prevents default behaviour.\r\n *\r\n * @param {Object} event\r\n * @protected\r\n *\r\n * @description We get from clipboard pasted data, sanitize, make a fragment that contains of this sanitized nodes.\r\n * Firstly, we need to memorize the caret position. We can do that by getting the range of selection.\r\n * After all, we insert clear fragment into caret placed position. Then, we should move the caret to the last node\r\n */\r\n paste.blockPasteCallback = function (event) {\r\n if (!needsToHandlePasteEvent(event.target)) {\r\n return;\r\n }\r\n\r\n /** Prevent default behaviour */\r\n event.preventDefault();\r\n\r\n /** get html pasted data - dirty data */\r\n var htmlData = event.clipboardData.getData('text/html'),\r\n plainData = event.clipboardData.getData('text/plain');\r\n\r\n /** Temporary DIV that is used to work with text's paragraphs as DOM-elements*/\r\n var paragraphs = editor.draw.node('DIV', '', {}),\r\n cleanData,\r\n wrappedData;\r\n\r\n /** Create fragment, that we paste to range after proccesing */\r\n cleanData = editor.sanitizer.clean(htmlData);\r\n\r\n /**\r\n * We wrap pasted text with

    tags to split it logically\r\n * @type {string}\r\n */\r\n wrappedData = editor.content.wrapTextWithParagraphs(cleanData, plainData);\r\n paragraphs.innerHTML = wrappedData;\r\n\r\n /**\r\n * If there only one paragraph, just insert in at the caret location\r\n */\r\n if (paragraphs.childNodes.length == 1) {\r\n emulateUserAgentBehaviour(paragraphs.firstChild);\r\n return;\r\n }\r\n\r\n insertPastedParagraphs(paragraphs.childNodes);\r\n };\r\n\r\n /**\r\n * Checks if we should handle paste event on block\r\n * @param block\r\n *\r\n * @return {boolean}\r\n */\r\n var needsToHandlePasteEvent = function (block) {\r\n /** If area is input or textarea then allow default behaviour */\r\n if ( editor.core.isNativeInput(block) ) {\r\n return false;\r\n }\r\n\r\n var editableParent = editor.content.getEditableParent(block);\r\n\r\n /** Allow paste when event target placed in Editable element */\r\n if (!editableParent) {\r\n return false;\r\n }\r\n\r\n return true;\r\n };\r\n\r\n /**\r\n * Inserts new initial plugin blocks with data in paragraphs\r\n *\r\n * @param {Array} paragraphs - array of paragraphs (

    ) whit content, that should be inserted\r\n */\r\n var insertPastedParagraphs = function (paragraphs) {\r\n var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin,\r\n currentNode = editor.content.currentNode;\r\n\r\n\r\n paragraphs.forEach(function (paragraph) {\r\n /** Don't allow empty paragraphs */\r\n if (editor.core.isBlockEmpty(paragraph)) {\r\n return;\r\n }\r\n\r\n editor.content.insertBlock({\r\n type : NEW_BLOCK_TYPE,\r\n block : editor.tools[NEW_BLOCK_TYPE].render({\r\n text : paragraph.innerHTML\r\n })\r\n });\r\n\r\n editor.caret.inputIndex++;\r\n });\r\n\r\n editor.caret.setToPreviousBlock(editor.caret.getCurrentInputIndex() + 1);\r\n\r\n\r\n /**\r\n * If there was no data in working node, remove it\r\n */\r\n if (editor.core.isBlockEmpty(currentNode)) {\r\n currentNode.remove();\r\n editor.ui.saveInputs();\r\n }\r\n };\r\n\r\n /**\r\n * Inserts node content at the caret position\r\n *\r\n * @param {Node} node - DOM node (could be DocumentFragment), that should be inserted at the caret location\r\n */\r\n var emulateUserAgentBehaviour = function (node) {\r\n var newNode;\r\n\r\n if (node.childElementCount) {\r\n newNode = document.createDocumentFragment();\r\n\r\n node.childNodes.forEach(function (current) {\r\n if (!editor.core.isDomNode(current) && current.data.trim() === '') {\r\n return;\r\n }\r\n\r\n newNode.appendChild(current.cloneNode(true));\r\n });\r\n } else {\r\n newNode = document.createTextNode(node.textContent);\r\n }\r\n\r\n editor.caret.insertNode(newNode);\r\n };\r\n\r\n\r\n return paste;\r\n}({});","/**\r\n *\r\n * Codex.Editor Transport Module\r\n *\r\n * @copyright 2017 Codex-Team\r\n * @version 1.2.0\r\n */\r\n\r\nmodule.exports = (function (transport) {\r\n let editor = codex.editor;\r\n\r\n\r\n /**\r\n * @private {Object} current XmlHttpRequest instance\r\n */\r\n var currentRequest = null;\r\n\r\n\r\n /**\r\n * @type {null} | {DOMElement} input - keeps input element in memory\r\n */\r\n transport.input = null;\r\n\r\n /**\r\n * @property {Object} arguments - keep plugin settings and defined callbacks\r\n */\r\n transport.arguments = null;\r\n\r\n /**\r\n * Prepares input element where will be files\r\n */\r\n transport.prepare = function () {\r\n let input = editor.draw.node( 'INPUT', '', { type : 'file' } );\r\n\r\n editor.listeners.add(input, 'change', editor.transport.fileSelected);\r\n editor.transport.input = input;\r\n };\r\n\r\n /** Clear input when files is uploaded */\r\n transport.clearInput = function () {\r\n /** Remove old input */\r\n transport.input = null;\r\n\r\n /** Prepare new one */\r\n transport.prepare();\r\n };\r\n\r\n /**\r\n * Callback for file selection\r\n * @param {Event} event\r\n */\r\n transport.fileSelected = function () {\r\n var input = this,\r\n i,\r\n files = input.files,\r\n formData = new FormData();\r\n\r\n if (editor.transport.arguments.multiple === true) {\r\n for ( i = 0; i < files.length; i++) {\r\n formData.append('files[]', files[i], files[i].name);\r\n }\r\n } else {\r\n formData.append('files', files[0], files[0].name);\r\n }\r\n\r\n currentRequest = editor.core.ajax({\r\n type : 'POST',\r\n data : formData,\r\n url : editor.transport.arguments.url,\r\n beforeSend : editor.transport.arguments.beforeSend,\r\n success : editor.transport.arguments.success,\r\n error : editor.transport.arguments.error,\r\n progress : editor.transport.arguments.progress\r\n });\r\n\r\n /** Clear input */\r\n transport.clearInput();\r\n };\r\n\r\n /**\r\n * Use plugin callbacks\r\n * @protected\r\n *\r\n * @param {Object} args - can have :\r\n * @param {String} args.url - fetch URL\r\n * @param {Function} args.beforeSend - function calls before sending ajax\r\n * @param {Function} args.success - success callback\r\n * @param {Function} args.error - on error handler\r\n * @param {Function} args.progress - xhr onprogress handler\r\n * @param {Boolean} args.multiple - allow select several files\r\n * @param {String} args.accept - adds accept attribute\r\n */\r\n transport.selectAndUpload = function (args) {\r\n transport.arguments = args;\r\n\r\n if ( args.multiple === true) {\r\n transport.input.setAttribute('multiple', 'multiple');\r\n }\r\n\r\n if ( args.accept ) {\r\n transport.input.setAttribute('accept', args.accept);\r\n }\r\n\r\n transport.input.click();\r\n };\r\n\r\n transport.abort = function () {\r\n currentRequest.abort();\r\n\r\n currentRequest = null;\r\n };\r\n\r\n return transport;\r\n})({});","declare var Module: any;\r\n\r\nimport { IBlocksAPI } from '../interfaces/api';\r\nimport IInputOutputData from '../interfaces/input-output-data';\r\nimport IModuleConfig from '../interfaces/module-config';\r\n\r\n/**\r\n * @class BlocksAPI\r\n * provides with methods working with Block\r\n */\r\nexport default class BlocksAPI extends Module implements IBlocksAPI {\r\n\r\n /**\r\n * Save Editor config. API provides passed configuration to the Blocks\r\n */\r\n constructor({config}: IModuleConfig) {\r\n super({config});\r\n }\r\n\r\n /**\r\n * Available methods\r\n * @return {IBlocksAPI}\r\n */\r\n get methods(): IBlocksAPI {\r\n return {\r\n clear: () => this.clear(),\r\n render: (data: IInputOutputData) => this.render(data),\r\n delete: () => this.delete(),\r\n swap: (fromIndex: number, toIndex: number) => this.swap(fromIndex, toIndex),\r\n getBlockByIndex: (index: number) => this.getBlockByIndex(index),\r\n getCurrentBlockIndex: () => this.getCurrentBlockIndex(),\r\n getBlocksCount: () => this.getBlocksCount(),\r\n };\r\n }\r\n\r\n /**\r\n * Returns Blocks count\r\n * @return {number}\r\n */\r\n public getBlocksCount(): number {\r\n return this.Editor.BlockManager.blocks.length;\r\n }\r\n\r\n /**\r\n * Returns current block index\r\n * @return {number}\r\n */\r\n public getCurrentBlockIndex(): number {\r\n return this.Editor.BlockManager.currentBlockIndex;\r\n }\r\n\r\n /**\r\n * Returns Current Block\r\n * @param {Number} index\r\n *\r\n * @return {Object}\r\n */\r\n public getBlockByIndex(index: number): object {\r\n return this.Editor.BlockManager.getBlockByIndex(index);\r\n }\r\n\r\n /**\r\n * Call Block Manager method that swap Blocks\r\n * @param {number} fromIndex - position of first Block\r\n * @param {number} toIndex - position of second Block\r\n */\r\n public swap(fromIndex: number, toIndex: number): void {\r\n this.Editor.BlockManager.swap(fromIndex, toIndex);\r\n\r\n /**\r\n * Move toolbar\r\n * DO not close the settings\r\n */\r\n this.Editor.Toolbar.move(false);\r\n }\r\n\r\n /**\r\n * Deletes Block\r\n * @param blockIndex\r\n */\r\n public delete(blockIndex?: number): void {\r\n this.Editor.BlockManager.removeBlock(blockIndex);\r\n\r\n /**\r\n * in case of last block deletion\r\n * Insert new initial empty block\r\n */\r\n if (this.Editor.BlockManager.blocks.length === 0) {\r\n this.Editor.BlockManager.insert();\r\n }\r\n\r\n /**\r\n * In case of deletion first block we need to set caret to the current Block\r\n */\r\n if (this.Editor.BlockManager.currentBlockIndex === 0) {\r\n this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock);\r\n } else {\r\n this.Editor.Caret.navigatePrevious(true);\r\n }\r\n\r\n this.Editor.Toolbar.close();\r\n }\r\n\r\n /**\r\n * Clear Editor's area\r\n */\r\n public clear(): void {\r\n this.Editor.BlockManager.clear(true);\r\n }\r\n\r\n /**\r\n * Fills Editor with Blocks data\r\n * @param {IInputOutputData} data — Saved Editor data\r\n */\r\n public render(data: IInputOutputData): void {\r\n this.Editor.BlockManager.clear();\r\n this.Editor.Renderer.render(data.items);\r\n }\r\n\r\n}\r\n","declare var Module: any;\r\n\r\nimport {IEventsAPI} from '../interfaces/api';\r\nimport IModuleConfig from '../interfaces/module-config';\r\n\r\n/**\r\n * @class EventsAPI\r\n * provides with methods working with Toolbar\r\n */\r\nexport default class EventsAPI extends Module implements IEventsAPI {\r\n\r\n /**\r\n * Save Editor config. API provides passed configuration to the Blocks\r\n */\r\n constructor({config}: IModuleConfig) {\r\n super({config});\r\n }\r\n\r\n /**\r\n * Available methods\r\n * @return {IEventsAPI}\r\n */\r\n get methods(): IEventsAPI {\r\n return {\r\n emit: (eventName: string, data: object) => this.emit(eventName, data),\r\n off: (eventName: string, callback: () => void) => this.off(eventName, callback),\r\n on: (eventName: string, callback: () => void) => this.on(eventName, callback),\r\n };\r\n }\r\n\r\n /**\r\n * Subscribe on Events\r\n * @param {String} eventName\r\n * @param {Function} callback\r\n */\r\n public on(eventName, callback): void {\r\n this.Editor.Events.on(eventName, callback);\r\n }\r\n\r\n /**\r\n * Emit event with data\r\n * @param {String} eventName\r\n * @param {Object} data\r\n */\r\n public emit(eventName, data): void {\r\n this.Editor.Events.emit(eventName, data);\r\n }\r\n\r\n /**\r\n * Unsubscribe from Event\r\n * @param {String} eventName\r\n * @param {Function} callback\r\n */\r\n public off(eventName, callback): void {\r\n this.Editor.Events.off(eventName, callback);\r\n }\r\n\r\n}\r\n","declare var Module: any;\r\n\r\nimport {IListenerAPI} from '../interfaces/api';\r\nimport IModuleConfig from '../interfaces/module-config';\r\n\r\n/**\r\n * @class API\r\n * Provides with methods working with DOM Listener\r\n */\r\nexport default class ListenerAPI extends Module implements IListenerAPI {\r\n\r\n /**\r\n * Save Editor config. API provides passed configuration to the Blocks\r\n */\r\n constructor({config}: IModuleConfig) {\r\n super({config});\r\n }\r\n\r\n /**\r\n * Available methods\r\n * @return {IToolbarAPI}\r\n */\r\n get methods(): IListenerAPI {\r\n return {\r\n on: (element, eventType, handler, useCapture) => this.on(element, eventType, handler, useCapture),\r\n off: (element, eventType, handler) => this.off(element, eventType, handler),\r\n };\r\n }\r\n\r\n /**\r\n * adds DOM event listener\r\n *\r\n * @param {HTMLElement} element\r\n * @param {string} eventType\r\n * @param {() => void} handler\r\n * @param {boolean} useCapture\r\n */\r\n public on(element: HTMLElement, eventType: string, handler: () => void, useCapture?: boolean): void {\r\n this.Editor.Listeners.on(element, eventType, handler, useCapture);\r\n }\r\n\r\n /**\r\n * Removes DOM listener from element\r\n *\r\n * @param element\r\n * @param eventType\r\n * @param handler\r\n */\r\n public off(element, eventType, handler): void {\r\n this.Editor.Listeners.off(element, eventType, handler);\r\n }\r\n}\r\n","declare var Module: any;\r\n\r\nimport {ISanitizerAPI} from '../interfaces/api';\r\nimport IModuleConfig from '../interfaces/module-config';\r\n\r\n/**\r\n * @class API\r\n * Provides CodeX Editor Sanitizer that allows developers to clean their HTML\r\n */\r\nexport default class SanitizerAPI extends Module implements ISanitizerAPI {\r\n\r\n /**\r\n * Save Editor config. API provides passed configuration to the Blocks\r\n */\r\n constructor({config}: IModuleConfig) {\r\n super({config});\r\n }\r\n\r\n /**\r\n * Available methods\r\n * @return {ISanitizerAPI}\r\n */\r\n get methods(): ISanitizerAPI {\r\n return {\r\n clean: (taintString, config) => this.clean(taintString, config),\r\n };\r\n }\r\n\r\n public clean(taintString, config) {\r\n return this.Editor.Sanitizer.clean(taintString, config);\r\n }\r\n\r\n}\r\n","declare var Module: any;\r\n\r\nimport {ISaverAPI} from '../interfaces/api';\r\nimport IInputOutputData from '../interfaces/input-output-data';\r\nimport IModuleConfig from '../interfaces/module-config';\r\n\r\n/**\r\n * @class SaverAPI\r\n * provides with methods to save data\r\n */\r\nexport default class SaverAPI extends Module implements ISaverAPI {\r\n\r\n /**\r\n * Save Editor config. API provides passed configuration to the Blocks\r\n */\r\n constructor({config}: IModuleConfig) {\r\n super({config});\r\n }\r\n\r\n /**\r\n * Available methods\r\n * @return {ISaverAPI}\r\n */\r\n get methods(): ISaverAPI {\r\n return {\r\n save: () => this.save(),\r\n };\r\n }\r\n\r\n /**\r\n * Return Editor's data\r\n */\r\n public save(): IInputOutputData {\r\n return this.Editor.Saver.save();\r\n }\r\n}\r\n","declare var Module: any;\r\n\r\nimport {ISelectionAPI} from '../interfaces/api';\r\nimport IModuleConfig from '../interfaces/module-config';\r\nimport Selection from '../selection';\r\n\r\n/**\r\n * @class API\r\n * Provides with methods working with Selection\r\n */\r\nexport default class SelectionAPI extends Module implements ISelectionAPI {\r\n\r\n /**\r\n * Save Editor config. API provides passed configuration to the Blocks\r\n */\r\n constructor({config}: IModuleConfig) {\r\n super({config});\r\n }\r\n\r\n /**\r\n * Available methods\r\n * @return {ISelectionAPI}\r\n */\r\n get methods(): ISelectionAPI {\r\n return {\r\n findParentTag: (tagName: string, className: string) => this.findParentTag(tagName, className),\r\n expandToTag: (node: HTMLElement) => this.expandToTag(node),\r\n };\r\n }\r\n\r\n /**\r\n * Looks ahead from selection and find passed tag with class name\r\n * @param {string} tagName - tag to find\r\n * @param {string} className - tag's class name\r\n * @return {HTMLElement|null}\r\n */\r\n public findParentTag(tagName: string, className: string): HTMLElement|null {\r\n return new Selection().findParentTag(tagName, className);\r\n }\r\n\r\n /**\r\n * Expand selection to passed tag\r\n * @param {HTMLElement} node - tag that should contain selection\r\n */\r\n public expandToTag(node: HTMLElement): void {\r\n new Selection().expandToTag(node);\r\n }\r\n\r\n}\r\n","declare var Module: any;\r\n\r\nimport {IToolbarAPI} from '../interfaces/api';\r\nimport IModuleConfig from '../interfaces/module-config';\r\n\r\n/**\r\n * @class ToolbarsAPI\r\n * provides with methods working with Toolbar\r\n */\r\nexport default class ToolbarAPI extends Module implements IToolbarAPI {\r\n\r\n /**\r\n * Save Editor config. API provides passed configuration to the Blocks\r\n */\r\n constructor({config}: IModuleConfig) {\r\n super({config});\r\n }\r\n\r\n /**\r\n * Available methods\r\n * @return {IToolbarAPI}\r\n */\r\n get methods(): IToolbarAPI {\r\n return {\r\n close: () => this.close(),\r\n open: () => this.open(),\r\n };\r\n }\r\n\r\n /**\r\n * Open toolbar\r\n */\r\n public open(): void {\r\n this.Editor.Toolbar.open();\r\n }\r\n\r\n /**\r\n * Close toolbar and all included elements\r\n */\r\n public close(): void {\r\n this.Editor.Toolbar.close();\r\n }\r\n\r\n}\r\n","/**\r\n * @module API\r\n * @copyright 2018\r\n *\r\n * Each block has an Editor API instance to use provided public methods\r\n * if you cant to read more about how API works, please see docs\r\n */\r\ndeclare var Module: any;\r\ndeclare var $: any;\r\ndeclare var _: any;\r\n\r\nimport { IAPI } from '../interfaces/api';\r\n\r\n/**\r\n * @class API\r\n */\r\nexport default class API extends Module {\r\n\r\n /**\r\n * Save Editor config. API provides passed configuration to the Blocks\r\n * @param {EditorConfig} config\r\n */\r\n constructor({config}) {\r\n super({config});\r\n }\r\n\r\n public get methods(): IAPI {\r\n return {\r\n blocks: this.Editor.BlocksAPI.methods,\r\n caret: {},\r\n events: this.Editor.EventsAPI.methods,\r\n listener: this.Editor.ListenerAPI.methods,\r\n sanitizer: this.Editor.SanitizerAPI.methods,\r\n saver: this.Editor.SaverAPI.methods,\r\n selection: this.Editor.SelectionAPI.methods,\r\n toolbar: this.Editor.ToolbarAPI.methods,\r\n };\r\n }\r\n}\r\n","/**\r\n * Contains keyboard and mouse events binded on each Block by Block Manager\r\n */\r\ndeclare var Module: any;\r\ndeclare var $: any;\r\ndeclare var _: any;\r\n\r\nexport default class BlockEvents extends Module {\r\n /**\r\n * @constructor\r\n */\r\n constructor({config}) {\r\n super({config});\r\n }\r\n\r\n /**\r\n * All keydowns on Block\r\n * @param {KeyboardEvent} event - keydown\r\n */\r\n public keydown(event: KeyboardEvent): void {\r\n /**\r\n * Run common method for all keydown events\r\n */\r\n this.beforeKeydownProcessing();\r\n\r\n /**\r\n * Fire keydown processor by event.keyCode\r\n */\r\n switch (event.keyCode) {\r\n case _.keyCodes.BACKSPACE:\r\n this.backspace(event);\r\n break;\r\n\r\n case _.keyCodes.ENTER:\r\n this.enter(event);\r\n break;\r\n\r\n case _.keyCodes.DOWN:\r\n case _.keyCodes.RIGHT:\r\n this.arrowRightAndDown();\r\n break;\r\n\r\n case _.keyCodes.UP:\r\n case _.keyCodes.LEFT:\r\n this.arrowLeftAndUp();\r\n break;\r\n\r\n default:\r\n this.defaultHandler();\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * Fires on keydown before event processing\r\n */\r\n public beforeKeydownProcessing(): void {\r\n /**\r\n * Clear all highlightings\r\n */\r\n this.Editor.BlockManager.clearHighlightings();\r\n\r\n /**\r\n * Hide Toolbar\r\n */\r\n this.Editor.Toolbar.close();\r\n }\r\n\r\n /**\r\n * Key up on Block:\r\n * - shows Inline Toolbar if something selected\r\n */\r\n public keyup(event): void {\r\n this.Editor.InlineToolbar.handleShowingEvent(event);\r\n }\r\n\r\n /**\r\n * Mouse up on Block:\r\n * - shows Inline Toolbar if something selected\r\n */\r\n public mouseUp(event): void {\r\n this.Editor.InlineToolbar.handleShowingEvent(event);\r\n }\r\n\r\n /**\r\n * ENTER pressed on block\r\n * @param {KeyboardEvent} event - keydown\r\n */\r\n private enter(event: KeyboardEvent): void {\r\n const currentBlock = this.Editor.BlockManager.currentBlock,\r\n toolsConfig = this.config.toolsConfig[currentBlock.name];\r\n\r\n /**\r\n * Don't handle Enter keydowns when Tool sets enableLineBreaks to true.\r\n * Uses for Tools like where line breaks should be handled by default behaviour.\r\n */\r\n if (toolsConfig && toolsConfig[this.Editor.Tools.apiSettings.IS_ENABLED_LINE_BREAKS]) {\r\n return;\r\n }\r\n\r\n /**\r\n * Allow to create linebreaks by Shift+Enter\r\n */\r\n if (event.shiftKey) {\r\n return;\r\n }\r\n\r\n /**\r\n * Split the Current Block into two blocks\r\n */\r\n this.Editor.BlockManager.split();\r\n\r\n /**\r\n * Renew local current node after split\r\n */\r\n const newCurrent = this.Editor.BlockManager.currentBlock;\r\n\r\n this.Editor.Toolbar.move();\r\n\r\n /**\r\n * If new Block is empty\r\n */\r\n if (this.Editor.Tools.isInitial(newCurrent.tool) && newCurrent.isEmpty) {\r\n /**\r\n * Show Toolbar\r\n */\r\n this.Editor.Toolbar.open();\r\n\r\n /**\r\n * Show Plus Button\r\n */\r\n this.Editor.Toolbar.plusButton.show();\r\n }\r\n\r\n event.preventDefault();\r\n }\r\n\r\n /**\r\n * Handle backspace keydown on Block\r\n * @param {KeyboardEvent} event - keydown\r\n */\r\n private backspace(event: KeyboardEvent): void {\r\n const BM = this.Editor.BlockManager;\r\n\r\n const isFirstBlock = BM.currentBlockIndex === 0,\r\n canMergeBlocks = this.Editor.Caret.isAtStart && !isFirstBlock;\r\n\r\n /** If current Block is empty just remove this Block */\r\n if (this.Editor.BlockManager.currentBlock.isEmpty) {\r\n this.Editor.BlockManager.removeBlock();\r\n if (this.Editor.Caret.navigatePrevious(true)) {\r\n this.Editor.Toolbar.close();\r\n }\r\n return;\r\n }\r\n\r\n if (!canMergeBlocks) {\r\n return;\r\n }\r\n\r\n // preventing browser default behaviour\r\n event.preventDefault();\r\n\r\n const targetBlock = BM.getBlockByIndex(BM.currentBlockIndex - 1),\r\n blockToMerge = BM.currentBlock;\r\n\r\n /**\r\n * Blocks that can be merged:\r\n * 1) with the same Name\r\n * 2) Tool has 'merge' method\r\n *\r\n * other case will handle as usual ARROW LEFT behaviour\r\n */\r\n if (blockToMerge.name !== targetBlock.name || !targetBlock.mergeable) {\r\n if (this.Editor.Caret.navigatePrevious()) {\r\n this.Editor.Toolbar.close();\r\n }\r\n\r\n return;\r\n }\r\n\r\n this.Editor.Caret.createShadow(targetBlock.pluginsContent);\r\n BM.mergeBlocks(targetBlock, blockToMerge)\r\n .then( () => {\r\n /** Restore caret position after merge */\r\n this.Editor.Caret.restoreCaret(targetBlock.pluginsContent);\r\n targetBlock.pluginsContent.normalize();\r\n this.Editor.Toolbar.close();\r\n });\r\n }\r\n\r\n /**\r\n * Handle right and down keyboard keys\r\n */\r\n private arrowRightAndDown(): void {\r\n this.Editor.Caret.navigateNext();\r\n }\r\n\r\n /**\r\n * Handle left and up keyboard keys\r\n */\r\n private arrowLeftAndUp(): void {\r\n this.Editor.Caret.navigatePrevious();\r\n }\r\n\r\n /**\r\n * Default keydown handler\r\n */\r\n private defaultHandler(): void {}\r\n}\r\n","/**\n * @class BlockManager\n * @classdesc Manage editor`s blocks storage and appearance\n *\n * @module BlockManager\n *\n * @version 2.0.0\n */\n\nimport Block from '../block';\n\n/**\n * @typedef {BlockManager} BlockManager\n * @property {Number} currentBlockIndex - Index of current working block\n * @property {Proxy} _blocks - Proxy for Blocks instance {@link Blocks}\n */\nexport default class BlockManager extends Module {\n /**\n * @constructor\n * @param {EditorConfig} config\n */\n constructor({config}) {\n super({config});\n\n /**\n * Proxy for Blocks instance {@link Blocks}\n *\n * @type {Proxy}\n * @private\n */\n this._blocks = null;\n\n /**\n * Index of current working block\n *\n * @type {number}\n * @private\n */\n this.currentBlockIndex = -1;\n }\n\n /**\n * Should be called after Editor.UI preparation\n * Define this._blocks property\n *\n * @returns {Promise}\n */\n prepare() {\n return new Promise(resolve => {\n let blocks = new Blocks(this.Editor.UI.nodes.redactor);\n\n /**\n * We need to use Proxy to overload set/get [] operator.\n * So we can use array-like syntax to access blocks\n *\n * @example\n * this._blocks[0] = new Block(...);\n *\n * block = this._blocks[0];\n *\n * @todo proxy the enumerate method\n *\n * @type {Proxy}\n * @private\n */\n this._blocks = new Proxy(blocks, {\n set: Blocks.set,\n get: Blocks.get\n });\n\n resolve();\n });\n }\n\n /**\n * Creates Block instance by tool name\n *\n * @param {String} toolName - tools passed in editor config {@link EditorConfig#tools}\n * @param {Object} data - constructor params\n * @param {Object} settings - block settings\n *\n * @return {Block}\n */\n composeBlock(toolName, data, settings) {\n let toolInstance = this.Editor.Tools.construct(toolName, data),\n block = new Block(toolName, toolInstance, settings, this.Editor.API.methods);\n\n this.bindEvents(block);\n /**\n * Apply callback before inserting html\n */\n block.call('appendCallback', {});\n\n return block;\n }\n\n /**\n * Bind Events\n * @param {Object} block\n */\n bindEvents(block) {\n this.Editor.Listeners.on(block.holder, 'keydown', (event) => this.Editor.BlockEvents.keydown(event));\n this.Editor.Listeners.on(block.holder, 'mouseup', (event) => this.Editor.BlockEvents.mouseUp(event));\n this.Editor.Listeners.on(block.holder, 'keyup', (event) => this.Editor.BlockEvents.keyup(event));\n }\n\n /**\n * Insert new block into _blocks\n *\n * @param {String} toolName — plugin name, by default method inserts initial block type\n * @param {Object} data — plugin data\n * @param {Object} settings - default settings\n *\n * @return {Block}\n */\n insert(toolName = this.config.initialBlock, data = {}, settings = {}) {\n let block = this.composeBlock(toolName, data, settings);\n\n\n this._blocks[++this.currentBlockIndex] = block;\n this.Editor.Caret.setToBlock(block);\n\n return block;\n }\n\n /**\n * Always inserts at the end\n */\n insertAtEnd() {\n /**\n * Define new value for current block index\n */\n this.currentBlockIndex = this.blocks.length - 1;\n\n /**\n * Insert initial typed block\n */\n this.insert();\n }\n\n /**\n * Merge two blocks\n * @param {Block} targetBlock - previous block will be append to this block\n * @param {Block} blockToMerge - block that will be merged with target block\n *\n * @return {Promise} - the sequence that can be continued\n */\n mergeBlocks(targetBlock, blockToMerge) {\n let blockToMergeIndex = this._blocks.indexOf(blockToMerge);\n\n return Promise.resolve()\n .then( () => {\n if (blockToMerge.isEmpty) {\n return;\n }\n\n return blockToMerge.data\n .then((blockToMergeInfo) => {\n targetBlock.mergeWith(blockToMergeInfo.data);\n });\n })\n .then( () => {\n this.removeBlock(blockToMergeIndex);\n this.currentBlockIndex = this._blocks.indexOf(targetBlock);\n });\n }\n\n /**\n * Remove block with passed index or remove last\n * @param {Number|null} index\n */\n removeBlock(index) {\n if (!index) {\n index = this.currentBlockIndex;\n }\n this._blocks.remove(index);\n }\n\n /**\n * Split current Block\n * 1. Extract content from Caret position to the Block`s end\n * 2. Insert a new Block below current one with extracted content\n */\n split() {\n let extractedFragment = this.Editor.Caret.extractFragmentFromCaretPosition(),\n wrapper = $.make('div');\n\n wrapper.append(extractedFragment);\n\n /**\n * @todo make object in accordance with Tool\n */\n let data = {\n text: $.isEmpty(wrapper) ? '' : wrapper.innerHTML,\n };\n\n /**\n * Renew current Block\n * @type {Block}\n */\n const blockInserted = this.insert(this.config.initialBlock, data);\n\n this.currentNode = blockInserted.pluginsContent;\n }\n\n /**\n * Replace current working block\n *\n * @param {String} toolName — plugin name\n * @param {Object} data — plugin data\n */\n replace(toolName, data = {}) {\n let block = this.composeBlock(toolName, data);\n\n this._blocks.insert(this.currentBlockIndex, block, true);\n }\n\n /**\n * returns last Block\n * @return {Block}\n */\n get lastBlock() {\n return this._blocks[this._blocks.length - 1];\n }\n\n /**\n * Returns Block by passed index\n * @param {Number} index\n * @return {Block}\n */\n getBlockByIndex(index) {\n return this._blocks[index];\n }\n\n /**\n * Get Block instance by html element\n * @param {Node} element\n * @returns {Block}\n */\n getBlock(element) {\n if (!$.isElement(element)) {\n element = element.parentNode;\n }\n\n let nodes = this._blocks.nodes,\n firstLevelBlock = element.closest(`.${Block.CSS.wrapper}`),\n index = nodes.indexOf(firstLevelBlock);\n\n if (index >= 0) {\n return this._blocks[index];\n }\n }\n\n /**\n * Get current Block instance\n *\n * @return {Block}\n */\n get currentBlock() {\n return this._blocks[this.currentBlockIndex];\n }\n\n /**\n * Returns next Block instance\n * @return {Block|null}\n */\n get nextBlock() {\n let isLastBlock = this.currentBlockIndex === (this._blocks.length - 1);\n\n if (isLastBlock) {\n return null;\n }\n\n return this._blocks[this.currentBlockIndex + 1];\n }\n\n /**\n * Returns previous Block instance\n * @return {Block|null}\n */\n get previousBlock() {\n let isFirstBlock = this.currentBlockIndex === 0;\n\n if (isFirstBlock) {\n return null;\n }\n\n return this._blocks[this.currentBlockIndex - 1];\n }\n\n /**\n * Get working html element\n *\n * @return {HTMLElement}\n */\n get currentNode() {\n return this._blocks.nodes[this.currentBlockIndex];\n }\n\n /**\n * Set currentBlockIndex to passed block\n * @param {Node} element\n */\n set currentNode(element) {\n if (!$.isElement(element)) {\n element = element.parentNode;\n }\n\n let nodes = this._blocks.nodes,\n firstLevelBlock = element.closest(`.${Block.CSS.wrapper}`);\n\n if (!firstLevelBlock) {\n throw Error('Passed element is not a Block.');\n }\n\n\n /**\n * Update current Block's index\n * @type {number}\n */\n this.currentBlockIndex = nodes.indexOf(firstLevelBlock);\n }\n\n /**\n * Remove selection from all Blocks then highlight only Current Block\n */\n highlightCurrentNode() {\n /**\n * Remove previous selected Block's state\n */\n this.clearHighlightings();\n\n /**\n * Mark current Block as selected\n * @type {boolean}\n */\n this.currentBlock.selected = true;\n }\n\n /**\n * Remove selection from all Blocks\n */\n clearHighlightings() {\n this.blocks.forEach( block => block.selected = false);\n }\n\n /**\n * Get array of Block instances\n *\n * @returns {Block[]} {@link Blocks#array}\n */\n get blocks() {\n return this._blocks.array;\n }\n\n /**\n * 1) Find first-level Block from passed child Node\n * 2) Mark it as current\n *\n * @param {Element|Text} childNode - look ahead from this node.\n * @throws Error - when passed Node is not included at the Block\n */\n setCurrentBlockByChildNode(childNode) {\n /**\n * If node is Text TextNode\n */\n if (!$.isElement(childNode)) {\n childNode = childNode.parentNode;\n }\n\n let parentFirstLevelBlock = childNode.closest(`.${Block.CSS.wrapper}`);\n\n if (parentFirstLevelBlock) {\n this.currentNode = parentFirstLevelBlock;\n } else {\n throw new Error('Can not find a Block from this child Node');\n }\n }\n\n /**\n * Swap Blocks Position\n * @param {Number} fromIndex\n * @param {Number} toIndex\n */\n swap(fromIndex, toIndex) {\n /** Move up current Block */\n this._blocks.swap(fromIndex, toIndex);\n\n /** Now actual block moved up so that current block index decreased */\n this.currentBlockIndex = toIndex;\n }\n\n /**\n * Sets current Block Index -1 which means unknown\n * and clear highlightings\n */\n dropPointer() {\n this.currentBlockIndex = -1;\n this.clearHighlightings();\n }\n\n /**\n * Clears Editor\n * @param {boolean} needAddInitialBlock - 1) in internal calls (for example, in api.blocks.render)\n * we don't need to add empty initial block\n * 2) in api.blocks.clear we should add empty block\n */\n clear(needAddInitialBlock = false) {\n this._blocks.removeAll();\n this.dropPointer();\n\n if (needAddInitialBlock) {\n this.insert(this.config.initialBlock);\n }\n }\n};\n\n/**\n * @class Blocks\n * @classdesc Class to work with Block instances array\n *\n * @private\n *\n * @property {HTMLElement} workingArea — editor`s working node\n *\n */\nclass Blocks {\n /**\n * @constructor\n *\n * @param {HTMLElement} workingArea — editor`s working node\n */\n constructor(workingArea) {\n this.blocks = [];\n this.workingArea = workingArea;\n }\n\n /**\n * Push back new Block\n *\n * @param {Block} block\n */\n push(block) {\n this.blocks.push(block);\n this.workingArea.appendChild(block.holder);\n }\n\n /**\n * Swaps blocks with indexes first and second\n * @param {Number} first - first block index\n * @param {Number} second - second block index\n */\n swap(first, second) {\n let secondBlock = this.blocks[second];\n\n /**\n * Change in DOM\n */\n $.swap(this.blocks[first].holder, secondBlock.holder);\n\n /**\n * Change in array\n */\n this.blocks[second] = this.blocks[first];\n this.blocks[first] = secondBlock;\n }\n\n /**\n * Insert new Block at passed index\n *\n * @param {Number} index — index to insert Block\n * @param {Block} block — Block to insert\n * @param {Boolean} replace — it true, replace block on given index\n */\n insert(index, block, replace = false) {\n if (!this.length) {\n this.push(block);\n return;\n }\n\n if (index > this.length) {\n index = this.length;\n }\n\n if (replace) {\n this.blocks[index].holder.remove();\n }\n\n let deleteCount = replace ? 1 : 0;\n\n this.blocks.splice(index, deleteCount, block);\n\n if (index > 0) {\n let previousBlock = this.blocks[index - 1];\n\n previousBlock.holder.insertAdjacentElement('afterend', block.holder);\n } else {\n let nextBlock = this.blocks[index + 1];\n\n if (nextBlock) {\n nextBlock.holder.insertAdjacentElement('beforebegin', block.holder);\n } else {\n this.workingArea.appendChild(block.holder);\n }\n }\n }\n\n /**\n * Remove block\n * @param {Number|null} index\n */\n remove(index) {\n if (isNaN(index)) {\n index = this.length - 1;\n }\n\n this.blocks[index].holder.remove();\n this.blocks.splice(index, 1);\n }\n\n /**\n * Remove all blocks\n */\n removeAll() {\n this.workingArea.innerHTML = '';\n this.blocks.length = 0;\n }\n\n /**\n * Insert Block after passed target\n *\n * @todo decide if this method is necessary\n *\n * @param {Block} targetBlock — target after wich Block should be inserted\n * @param {Block} newBlock — Block to insert\n */\n insertAfter(targetBlock, newBlock) {\n let index = this.blocks.indexOf(targetBlock);\n\n this.insert(index + 1, newBlock);\n }\n\n /**\n * Get Block by index\n *\n * @param {Number} index — Block index\n * @returns {Block}\n */\n get(index) {\n return this.blocks[index];\n }\n\n /**\n * Return index of passed Block\n *\n * @param {Block} block\n * @returns {Number}\n */\n indexOf(block) {\n return this.blocks.indexOf(block);\n }\n\n /**\n * Get length of Block instances array\n *\n * @returns {Number}\n */\n get length() {\n return this.blocks.length;\n }\n\n /**\n * Get Block instances array\n *\n * @returns {Block[]}\n */\n get array() {\n return this.blocks;\n }\n\n /**\n * Get blocks html elements array\n *\n * @returns {HTMLElement[]}\n */\n get nodes() {\n return _.array(this.workingArea.children);\n }\n\n /**\n * Proxy trap to implement array-like setter\n *\n * @example\n * blocks[0] = new Block(...)\n *\n * @param {Blocks} instance — Blocks instance\n * @param {Number|String} index — block index\n * @param {Block} block — Block to set\n * @returns {Boolean}\n */\n static set(instance, index, block) {\n if (isNaN(Number(index))) {\n return false;\n }\n\n instance.insert(index, block);\n\n return true;\n }\n\n /**\n * Proxy trap to implement array-like getter\n *\n * @param {Blocks} instance — Blocks instance\n * @param {Number|String} index — Block index\n * @returns {Block|*}\n */\n static get(instance, index) {\n if (isNaN(Number(index))) {\n return instance[index];\n }\n\n return instance.get(index);\n }\n}\n","/**\r\n * @class Caret\r\n * @classdesc Contains methods for working Caret\r\n *\r\n * Uses Range methods to manipulate with caret\r\n *\r\n * @module Caret\r\n *\r\n * @version 2.0.0\r\n */\r\n\r\nimport Selection from '../selection';\r\n\r\n/**\r\n * @typedef {Caret} Caret\r\n */\r\nexport default class Caret extends Module {\r\n /**\r\n * @constructor\r\n */\r\n constructor({config}) {\r\n super({config});\r\n }\r\n\r\n /**\r\n * Elements styles that can be useful for Caret Module\r\n */\r\n static get CSS() {\r\n return {\r\n shadowCaret: 'cdx-shadow-caret'\r\n };\r\n };\r\n\r\n /**\r\n * Method gets Block instance and puts caret to the text node with offset\r\n * There two ways that method applies caret position:\r\n * - first found text node: sets at the beginning, but you can pass an offset\r\n * - last found text node: sets at the end of the node. Also, you can customize the behaviour\r\n *\r\n * @param {Block} block - Block class\r\n * @param {Number} offset - caret offset regarding to the text node\r\n * @param {Boolean} atEnd - put caret at the end of the text node or not\r\n */\r\n setToBlock(block, offset = 0, atEnd = false) {\r\n let element = block.pluginsContent;\r\n\r\n /** If Element is INPUT */\r\n if ($.isNativeInput(element)) {\r\n element.focus();\r\n return;\r\n }\r\n\r\n let nodeToSet = $.getDeepestNode(element, atEnd);\r\n\r\n if (atEnd || offset > nodeToSet.length) {\r\n offset = nodeToSet.length;\r\n }\r\n\r\n /** if found deepest node is native input */\r\n if ($.isNativeInput(nodeToSet)) {\r\n nodeToSet.focus();\r\n return;\r\n }\r\n\r\n /**\r\n * @todo try to fix via Promises or use querySelectorAll to not to use timeout\r\n */\r\n _.delay( () => {\r\n this.set(nodeToSet, offset);\r\n }, 20)();\r\n\r\n this.Editor.BlockManager.currentNode = block.holder;\r\n }\r\n\r\n /**\r\n * Creates Document Range and sets caret to the element with offset\r\n * @param {Element} element - target node.\r\n * @param {Number} offset - offset\r\n */\r\n set( element, offset = 0) {\r\n let range = document.createRange(),\r\n selection = Selection.get();\r\n\r\n range.setStart(element, offset);\r\n range.setEnd(element, offset);\r\n\r\n selection.removeAllRanges();\r\n selection.addRange(range);\r\n };\r\n\r\n /**\r\n * Set Caret to the last Block\r\n * If last block is not empty, append another empty block\r\n */\r\n setToTheLastBlock() {\r\n let lastBlock = this.Editor.BlockManager.lastBlock;\r\n\r\n if (!lastBlock) return;\r\n\r\n /**\r\n * If last block is empty and it is an initialBlock, set to that.\r\n * Otherwise, append new empty block and set to that\r\n */\r\n if (lastBlock.isEmpty) {\r\n this.setToBlock(lastBlock);\r\n } else {\r\n this.Editor.BlockManager.insertAtEnd();\r\n }\r\n }\r\n\r\n /**\r\n * Extract content fragment of current Block from Caret position to the end of the Block\r\n */\r\n extractFragmentFromCaretPosition() {\r\n let selection = Selection.get();\r\n\r\n if (selection.rangeCount) {\r\n let selectRange = selection.getRangeAt(0),\r\n blockElem = this.Editor.BlockManager.currentBlock.pluginsContent;\r\n\r\n selectRange.deleteContents();\r\n\r\n if (blockElem) {\r\n let range = selectRange.cloneRange(true);\r\n\r\n range.selectNodeContents(blockElem);\r\n range.setStart(selectRange.endContainer, selectRange.endOffset);\r\n return range.extractContents();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Get all first-level (first child of [contenteditabel]) siblings from passed node\r\n * Then you can check it for emptiness\r\n *\r\n * @example\r\n *
    \r\n *\r\n * @return {Element[]}\r\n */\r\n getHigherLevelSiblings(from, direction ) {\r\n let current = from,\r\n siblings = [];\r\n\r\n /**\r\n * Find passed node's firs-level parent (in example - blockquote)\r\n */\r\n while (current.parentNode && current.parentNode.contentEditable !== 'true') {\r\n current = current.parentNode;\r\n }\r\n\r\n let sibling = direction === 'left' ? 'previousSibling' : 'nextSibling';\r\n\r\n /**\r\n * Find all left/right siblings\r\n */\r\n while (current[sibling]) {\r\n current = current[sibling];\r\n siblings.push(current);\r\n }\r\n\r\n return siblings;\r\n }\r\n\r\n /**\r\n * Set's caret to the next Block\r\n * Before moving caret, we should check if caret position is at the end of Plugins node\r\n * Using {@link Dom#getDeepestNode} to get a last node and match with current selection\r\n *\r\n * @param {Boolean} force - force navigation even if caret is not at the end\r\n *\r\n * @return {Boolean}\r\n */\r\n navigateNext(force = false) {\r\n let nextBlock = this.Editor.BlockManager.nextBlock;\r\n\r\n if (!nextBlock) {\r\n return false;\r\n }\r\n\r\n if (force || this.isAtEnd) {\r\n this.setToBlock(nextBlock);\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Set's caret to the previous Block\r\n * Before moving caret, we should check if caret position is start of the Plugins node\r\n * Using {@link Dom#getDeepestNode} to get a last node and match with current selection\r\n *\r\n * @param {Boolean} force - force navigation even if caret is not at the start\r\n *\r\n * @return {Boolean}\r\n */\r\n navigatePrevious(force = false) {\r\n let previousBlock = this.Editor.BlockManager.previousBlock;\r\n\r\n if (!previousBlock) {\r\n return false;\r\n }\r\n\r\n if (force || this.isAtStart) {\r\n this.setToBlock( previousBlock, 0, true );\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Get's deepest first node and checks if offset is zero\r\n * @return {boolean}\r\n */\r\n get isAtStart() {\r\n /**\r\n * Don't handle ranges\r\n */\r\n if (!Selection.isCollapsed) {\r\n return false;\r\n }\r\n\r\n let selection = Selection.get(),\r\n anchorNode = selection.anchorNode,\r\n firstNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent);\r\n\r\n /**\r\n * Workaround case when caret in the text like \" |Hello!\"\r\n * selection.anchorOffset is 1, but real caret visible position is 0\r\n * @type {number}\r\n */\r\n let firstLetterPosition = anchorNode.textContent.search(/\\S/);\r\n\r\n if (firstLetterPosition === -1) { // empty text\r\n firstLetterPosition = 0;\r\n }\r\n\r\n /**\r\n * In case of\r\n *
    \r\n *

    <-- first (and deepest) node is \r\n * |adaddad <-- anchor node\r\n *
    \r\n */\r\n if ($.isEmpty(firstNode)) {\r\n let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'left'),\r\n nothingAtLeft = leftSiblings.every( node => $.isEmpty(node) );\r\n\r\n\r\n\r\n if (nothingAtLeft && selection.anchorOffset === firstLetterPosition) {\r\n return true;\r\n }\r\n }\r\n\r\n /**\r\n * We use <= comparison for case:\r\n * \"| Hello\" <--- selection.anchorOffset is 0, but firstLetterPosition is 1\r\n */\r\n return firstNode === null || anchorNode === firstNode && selection.anchorOffset <= firstLetterPosition;\r\n }\r\n\r\n /**\r\n * Get's deepest last node and checks if offset is last node text length\r\n * @return {boolean}\r\n */\r\n get isAtEnd() {\r\n /**\r\n * Don't handle ranges\r\n */\r\n if (!Selection.isCollapsed) {\r\n return false;\r\n }\r\n\r\n let selection = Selection.get(),\r\n anchorNode = selection.anchorNode,\r\n lastNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent, true);\r\n\r\n /**\r\n * In case of\r\n *
    \r\n * adaddad| <-- anchor node\r\n *

    <-- first (and deepest) node is \r\n *
    \r\n */\r\n if ($.isEmpty(lastNode)) {\r\n let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'right'),\r\n nothingAtRight = leftSiblings.every( node => $.isEmpty(node) );\r\n\r\n if (nothingAtRight && selection.anchorOffset === anchorNode.textContent.length) {\r\n return true;\r\n }\r\n }\r\n\r\n /**\r\n * Workaround case:\r\n * hello | <--- anchorOffset will be 5, but textContent.length will be 6.\r\n * Why not regular .trim():\r\n * in case of ' hello |' trim() will also remove space at the beginning, so length will be lower than anchorOffset\r\n */\r\n let rightTrimmedText = lastNode.textContent.replace(/\\s+$/, '');\r\n\r\n /**\r\n * We use >= comparison for case:\r\n * \"Hello |\" <--- selection.anchorOffset is 7, but rightTrimmedText is 6\r\n */\r\n return anchorNode === lastNode && selection.anchorOffset >= rightTrimmedText.length;\r\n }\r\n\r\n /**\r\n * Inserts shadow element after passed element where caret can be placed\r\n * @param {Node} element\r\n */\r\n createShadow(element) {\r\n let shadowCaret = document.createElement('span');\r\n\r\n shadowCaret.classList.add(Caret.CSS.shadowCaret);\r\n element.insertAdjacentElement('beforeEnd', shadowCaret);\r\n }\r\n\r\n /**\r\n * Restores caret position\r\n * @param {Node} element\r\n */\r\n restoreCaret(element) {\r\n let shadowCaret = element.querySelector(`.${Caret.CSS.shadowCaret}`);\r\n\r\n if (!shadowCaret) {\r\n return;\r\n }\r\n\r\n /**\r\n * After we set the caret to the required place\r\n * we need to clear shadow caret\r\n *\r\n * - make new range\r\n * - select shadowed span\r\n * - use extractContent to remove it from DOM\r\n */\r\n let sel = new Selection();\r\n\r\n sel.expandToTag(shadowCaret);\r\n\r\n setTimeout(() => {\r\n let newRange = document.createRange();\r\n\r\n newRange.selectNode(shadowCaret);\r\n newRange.extractContents();\r\n }, 50);\r\n }\r\n}\r\n","/**\r\n * @module eventDispatcher\r\n *\r\n * Has two important methods:\r\n * - {Function} on - appends subscriber to the event. If event doesn't exist - creates new one\r\n * - {Function} emit - fires all subscribers with data\r\n * - {Function off - unsubsribes callback\r\n *\r\n * @version 1.0.0\r\n *\r\n * @typedef {Events} Events\r\n * @property {Object} subscribers - all subscribers grouped by event name\r\n */\r\nexport default class Events extends Module {\r\n /**\r\n * @constructor\r\n */\r\n constructor({config}) {\r\n super({config});\r\n this.subscribers = {};\r\n }\r\n\r\n /**\r\n * Subscribe any event on callback\r\n *\r\n * @param {String} eventName - event name\r\n * @param {Function} callback - subscriber\r\n */\r\n on(eventName, callback) {\r\n if (!(eventName in this.subscribers)) {\r\n this.subscribers[eventName] = [];\r\n }\r\n\r\n // group by events\r\n this.subscribers[eventName].push(callback);\r\n }\r\n\r\n /**\r\n * Emit callbacks with passed data\r\n *\r\n * @param {String} eventName - event name\r\n * @param {Object} data - subscribers get this data when they were fired\r\n */\r\n emit(eventName, data) {\r\n if (!this.subscribers[eventName]) {\r\n return;\r\n }\r\n\r\n this.subscribers[eventName].reduce(function (previousData, currentHandler) {\r\n let newData = currentHandler(previousData);\r\n\r\n return newData ? newData : previousData;\r\n }, data);\r\n }\r\n\r\n /**\r\n * Unsubsribe callback from event\r\n *\r\n * @param eventName\r\n * @param callback\r\n */\r\n off(eventName, callback) {\r\n for(let i = 0; i < this.subscribers[eventName].length; i++) {\r\n if (this.subscribers[eventName][i] === callback) {\r\n delete this.subscribers[eventName][i];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Destroyer\r\n * clears subsribers list\r\n */\r\n destroy() {\r\n this.subscribers = null;\r\n }\r\n}\r\n","/**\r\n * Codex Editor Listeners module\r\n *\r\n * @module Listeners\r\n *\r\n * Module-decorator for event listeners assignment\r\n *\r\n * @author Codex Team\r\n * @version 2.0.0\r\n */\r\n\r\n/**\r\n * @typedef {Listeners} Listeners\r\n * @property {Array} allListeners\r\n */\r\nexport default class Listeners extends Module {\r\n /**\r\n * @constructor\r\n * @param {EditorConfig} config\r\n */\r\n constructor({config}) {\r\n super({config});\r\n this.allListeners = [];\r\n }\r\n\r\n /**\r\n * Assigns event listener on element\r\n *\r\n * @param {Element} element - DOM element that needs to be listened\r\n * @param {String} eventType - event type\r\n * @param {Function} handler - method that will be fired on event\r\n * @param {Boolean} useCapture - use event bubbling\r\n */\r\n on(element, eventType, handler, useCapture = false) {\r\n let assignedEventData = {\r\n element,\r\n eventType,\r\n handler,\r\n useCapture\r\n };\r\n\r\n let alreadyExist = this.findOne(element, eventType, handler);\r\n\r\n if (alreadyExist) return;\r\n\r\n this.allListeners.push(assignedEventData);\r\n element.addEventListener(eventType, handler, useCapture);\r\n }\r\n\r\n /**\r\n * Removes event listener from element\r\n *\r\n * @param {Element} element - DOM element that we removing listener\r\n * @param {String} eventType - event type\r\n * @param {Function} handler - remove handler, if element listens several handlers on the same event type\r\n * @param {Boolean} useCapture - use event bubbling\r\n */\r\n off(element, eventType, handler, useCapture = false) {\r\n let existingListeners = this.findAll(element, eventType, handler);\r\n\r\n for (let i = 0; i < existingListeners.length; i++) {\r\n let index = this.allListeners.indexOf(existingListeners[i]);\r\n\r\n if (index > 0) {\r\n this.allListeners.splice(index, 1);\r\n }\r\n }\r\n\r\n element.removeEventListener(eventType, handler, useCapture);\r\n }\r\n\r\n /**\r\n * Search method: looks for listener by passed element\r\n * @param {Element} element - searching element\r\n * @returns {Array} listeners that found on element\r\n */\r\n findByElement(element) {\r\n let listenersOnElement = [];\r\n\r\n for (let i = 0; i < this.allListeners.length; i++) {\r\n let listener = this.allListeners[i];\r\n\r\n if (listener.element === element) {\r\n listenersOnElement.push(listener);\r\n }\r\n }\r\n\r\n return listenersOnElement;\r\n }\r\n\r\n /**\r\n * Search method: looks for listener by passed event type\r\n * @param {String} eventType\r\n * @return {Array} listeners that found on element\r\n */\r\n findByType(eventType) {\r\n let listenersWithType = [];\r\n\r\n for (let i = 0; i < this.allListeners.length; i++) {\r\n let listener = this.allListeners[i];\r\n\r\n if (listener.type === eventType) {\r\n listenersWithType.push(listener);\r\n }\r\n }\r\n\r\n return listenersWithType;\r\n }\r\n\r\n /**\r\n * Search method: looks for listener by passed handler\r\n * @param {Function} handler\r\n * @return {Array} listeners that found on element\r\n */\r\n findByHandler(handler) {\r\n let listenersWithHandler = [];\r\n\r\n for (let i = 0; i < this.allListeners.length; i++) {\r\n let listener = this.allListeners[i];\r\n\r\n if (listener.handler === handler) {\r\n listenersWithHandler.push(listener);\r\n }\r\n }\r\n\r\n return listenersWithHandler;\r\n }\r\n\r\n /**\r\n * @param {Element} element\r\n * @param {String} eventType\r\n * @param {Function} handler\r\n * @return {Element|null}\r\n */\r\n findOne(element, eventType, handler) {\r\n let foundListeners = this.findAll(element, eventType, handler);\r\n\r\n return foundListeners.length > 0 ? foundListeners[0] : null;\r\n }\r\n\r\n /**\r\n * @param {Element} element\r\n * @param {String} eventType\r\n * @param {Function} handler\r\n * @return {Array}\r\n */\r\n findAll(element, eventType, handler) {\r\n let found,\r\n foundByElements = element ? this.findByElement(element) : [];\r\n // foundByEventType = eventType ? this.findByType(eventType) : [],\r\n // foundByHandler = handler ? this.findByHandler(handler) : [];\r\n\r\n if (element && eventType && handler) {\r\n found = foundByElements.filter( event => event.eventType === eventType && event.handler === handler );\r\n } else if (element && eventType) {\r\n found = foundByElements.filter( event => event.eventType === eventType);\r\n } else {\r\n found = foundByElements;\r\n }\r\n\r\n return found;\r\n }\r\n\r\n /**\r\n * Removes all listeners\r\n */\r\n removeAll() {\r\n this.allListeners.map( (current) => {\r\n current.element.removeEventListener(current.eventType, current.handler);\r\n });\r\n\r\n this.allListeners = [];\r\n }\r\n}\r\n","/**\n * @class Paste\n * @classdesc Contains methods to handle paste on editor\n *\n * @module Paste\n *\n * @version 2.0.0\n */\n\nimport {IBlockToolData} from '../interfaces/block-tool';\n\ndeclare const Module: any;\ndeclare const $: any;\ndeclare const _: any;\n\n/**\n * Tag substitute object.\n *\n * @param {string} tool - name of related Tool\n * @param {Function} handler - callback to handle pasted element\n */\ninterface ITagSubstitute {\n tool: string;\n handler: (element: HTMLElement) => IBlockToolData;\n}\n\n/**\n * Pattern substitute object.\n *\n * @param {string} key - pattern`s key\n * @param {RegExp} pattern - pasted pattern\n * @param {Function} handler - callback to handle pasted pattern\n * @param {string} tool - name of related Tool\n */\ninterface IPatternSubstitute {\n key: string;\n pattern: RegExp;\n handler: (text: string, key: string) => IBlockToolData;\n tool: string;\n}\n\n/**\n * Processed paste data object.\n *\n * @param {string} tool - name of related Tool\n * @param {HTMLElement} content - processed pasted content\n * @param {boolean} isBlock - true if content should be inserted as new Block\n * @param {Function} handler - callback that returns pasted data in IBlockToolData format\n */\ninterface IPasteData {\n tool: string;\n content: HTMLElement;\n isBlock: boolean;\n handler: (content: HTMLElement|string, patten?: RegExp) => IBlockToolData;\n}\n\nexport default class Paste extends Module {\n\n /** If string`s length is greater than this number we don't check paste patterns */\n public static readonly PATTERN_PROCESSING_MAX_LENGTH = 450;\n\n /**\n * Tags` substitutions parameters\n */\n private toolsTags: {[tag: string]: ITagSubstitute} = {};\n\n /** Patterns` substitutions parameters */\n private toolsPatterns: IPatternSubstitute[] = [];\n\n /**\n * @constructor\n */\n constructor({config}) {\n super({config});\n }\n\n public async prepare(): Promise {\n this.setCallback();\n this.processTools();\n }\n\n /**\n * Set onPaste callback handler\n */\n private setCallback(): void {\n const {Listeners, UI} = this.Editor;\n Listeners.on(UI.nodes.redactor, 'paste', this.processPastedData);\n }\n\n /**\n * Get and process tool`s paste configs\n */\n private processTools(): void {\n const tools = this.Editor.Tools.blockTools;\n Object.entries(tools).forEach(this.processTool);\n }\n\n /**\n * Process paste config for each tools\n *\n * @param {string} tool\n */\n private processTool = ([name, tool]) => {\n\n const toolPasteConfig = tool.onPaste || {};\n\n if (!toolPasteConfig.handler) {\n _.log(\n `\"${name}\" Tool MUST provide paste handler.`,\n 'warn',\n );\n }\n\n if (typeof toolPasteConfig.handler !== 'function') {\n _.log(\n `Paste handler for \"${name}\" Tool should be a function.`,\n 'warn',\n );\n } else {\n const tags = toolPasteConfig.tags || [];\n\n tags.forEach((tag) => {\n if (this.toolsTags.hasOwnProperty(tag)) {\n _.log(\n `Paste handler for \"${name}\" Tool on \"${tag}\" tag is skipped ` +\n `because it is already used by \"${this.toolsTags[tag].tool}\" Tool.`,\n 'warn',\n );\n return;\n }\n\n this.toolsTags[tag] = {\n handler: toolPasteConfig.handler,\n tool: name,\n };\n });\n }\n\n if (!toolPasteConfig.patternHandler || _.isEmpty(toolPasteConfig.patterns)) {\n return;\n }\n\n if (typeof toolPasteConfig.patternHandler !== 'function') {\n _.log(\n `Pattern parser for \"${name}\" Tool should be a function.`,\n 'warn',\n );\n } else {\n Object.entries(toolPasteConfig.patterns).forEach(([key, pattern]: [string, RegExp]) => {\n /** Still need to validate pattern as it provided by user */\n if (!(pattern instanceof RegExp)) {\n _.log(\n `Pattern ${pattern} for \"${tool}\" Tool is skipped because it should be a Regexp instance.`,\n 'warn',\n );\n }\n\n this.toolsPatterns.push({\n key,\n pattern,\n handler: toolPasteConfig.patternHandler,\n tool: name,\n });\n });\n }\n }\n\n /**\n * Check if browser behavior suits better\n *\n * @param {EventTarget} element - element where content has been pasted\n * @returns {boolean}\n */\n private isNativeBehaviour(element: EventTarget): boolean {\n const {Editor: {BlockManager}} = this;\n\n if ( $.isNativeInput(element) ) {\n return true;\n }\n\n const block = BlockManager.getBlock(element);\n\n return !block;\n }\n\n /**\n * Get pasted data, process it and insert into editor\n *\n * @param {ClipboardEvent} event\n */\n private processPastedData = async (event: ClipboardEvent): Promise => {\n const {\n Editor: {Tools, Sanitizer, BlockManager, Caret},\n config: {toolsConfig},\n } = this;\n\n /** If target is native input or is not Block, use browser behaviour */\n if (this.isNativeBehaviour(event.target)) {\n return;\n }\n\n event.preventDefault();\n\n const block = BlockManager.getBlock(event.target);\n const toolConfig = toolsConfig[block.name];\n\n /** If paste is dissalowed in block do nothing */\n if (toolConfig && toolConfig[Tools.apiSettings.IS_PASTE_DISALLOWED]) {\n return;\n }\n\n const htmlData = event.clipboardData.getData('text/html'),\n plainData = event.clipboardData.getData('text/plain');\n\n /** Add all block tags and tags can be substituted to sanitizer configuration */\n const blockTags = $.blockElements.reduce((result, tag) => {\n result[tag.toLowerCase()] = {};\n\n return result;\n }, {});\n const toolsTags = Object.keys(this.toolsTags).reduce((result, tag) => {\n result[tag.toLowerCase()] = {};\n\n return result;\n }, {});\n\n const customConfig = {tags: Object.assign({}, blockTags, toolsTags, Sanitizer.defaultConfig.tags)};\n const cleanData = Sanitizer.clean(htmlData, customConfig);\n\n let dataToInsert = [];\n\n /** If there is no HTML or HTML string is equal to plain one, process it as plain text */\n if (!cleanData.trim() || cleanData.trim() === plainData || !$.isHTMLString(cleanData)) {\n dataToInsert = this.processPlain(plainData);\n } else {\n dataToInsert = this.processHTML(htmlData);\n }\n\n if (dataToInsert.length === 1 && !dataToInsert[0].isBlock) {\n this.processSingleBlock(dataToInsert.pop());\n return;\n }\n\n this.splitBlock();\n\n await Promise.all(dataToInsert.map(\n async (data, i) => await this.insertBlock(data, i === 0),\n ));\n\n Caret.setToBlock(BlockManager.currentBlock, 0, true);\n }\n\n /**\n * Process paste to single Block:\n * 1. Find patterns` matches\n * 2. Insert new block if it is not the same type as current one\n * 3. Just insert text if there is no substitutions\n *\n * @param {IPasteData} dataToInsert\n */\n private async processSingleBlock(dataToInsert: IPasteData): Promise {\n const initialTool = this.config.initialBlock;\n const {BlockManager} = this.Editor;\n const {content, tool} = dataToInsert;\n\n if (tool === initialTool && content.textContent.length < Paste.PATTERN_PROCESSING_MAX_LENGTH) {\n const blockData = await this.processPattern(content.textContent);\n\n if (blockData) {\n this.splitBlock();\n\n if (BlockManager.currentBlock.isEmpty) {\n BlockManager.replace(blockData.tool, blockData.data);\n } else {\n BlockManager.insert(blockData.tool, blockData.data);\n }\n return;\n }\n }\n\n /** If there is no pattern substitute - insert string as it is */\n document.execCommand('insertHTML', false, content.innerHTML);\n }\n\n /**\n * Get patterns` matches\n *\n * @param {string} text\n * @returns Promise<{data: IBlockToolData, tool: string}>\n */\n private async processPattern(text: string): Promise<{data: IBlockToolData, tool: string}> {\n const pattern = this.toolsPatterns.find((substitute) => {\n const execResult = substitute.pattern.exec(text);\n\n if (!execResult) {\n return false;\n }\n\n return text === execResult.shift();\n });\n\n const data = pattern && await pattern.handler(text, pattern.key);\n\n return data && {\n data,\n tool: pattern.tool,\n };\n }\n\n /**\n *\n * @param {IPasteData} data\n * @param {Boolean} canReplaceCurrentBlock - if true and is current Block is empty, will replace current Block\n * @returns {Promise}\n */\n private async insertBlock(data: IPasteData, canReplaceCurrentBlock: boolean = false): Promise {\n const blockData = await data.handler(data.content);\n const {BlockManager} = this.Editor;\n const {currentBlock} = BlockManager;\n\n if (canReplaceCurrentBlock && currentBlock.isEmpty) {\n BlockManager.replace(data.tool, blockData);\n return;\n }\n\n BlockManager.insert(data.tool, blockData);\n }\n\n /**\n * Split current block if paste isn't in the end of the block\n */\n private splitBlock() {\n const {BlockManager, Caret} = this.Editor;\n\n /** If we paste into middle of the current block:\n * 1. Split\n * 2. Navigate to the first part\n */\n if (!BlockManager.currentBlock.isEmpty && !Caret.isAtEnd) {\n BlockManager.split();\n BlockManager.currentBlockIndex--;\n }\n }\n\n /**\n * Split HTML string to blocks and return it as array of Block data\n *\n * @param {string} innerHTML\n * @returns {IPasteData[]}\n */\n private processHTML(innerHTML: string): IPasteData[] {\n const {Tools, Sanitizer} = this.Editor;\n const initialTool = this.config.initialBlock;\n const wrapper = $.make('DIV');\n\n wrapper.innerHTML = innerHTML;\n\n const nodes = this.getNodes(wrapper);\n\n return nodes\n .map((node) => {\n let content, tool = initialTool, isBlock = false;\n\n switch (node.nodeType) {\n /** If node is a document fragment, use temp wrapper to get innerHTML */\n case Node.DOCUMENT_FRAGMENT_NODE:\n content = $.make('div');\n content.appendChild(node);\n content.innerHTML = Sanitizer.clean(content.innerHTML);\n break;\n\n /** If node is an element, then there might be a substitution */\n case Node.ELEMENT_NODE:\n content = node as HTMLElement;\n isBlock = true;\n content.innerHTML = Sanitizer.clean(content.innerHTML);\n\n if (this.toolsTags[content.tagName]) {\n tool = this.toolsTags[content.tagName].tool;\n }\n break;\n }\n\n const handler = Tools.blockTools[tool].onPaste.handler;\n\n return {content, isBlock, handler, tool};\n })\n .filter((data) => !$.isNodeEmpty(data.content));\n }\n\n /**\n * Split plain text by new line symbols and return it as array of Block data\n *\n * @param {string} plain\n * @returns {IPasteData[]}\n */\n private processPlain(plain: string): IPasteData[] {\n const {initialBlock} = this.config as {initialBlock: string};\n const {Tools} = this.Editor;\n\n if (!plain) {\n return [];\n }\n const tool = initialBlock;\n const handler = Tools.blockTools[tool].onPaste.handler;\n\n return plain.split('\\n\\n').map((text) => {\n const content = $.make('div');\n\n content.innerHTML = plain;\n return {content, tool, isBlock: false, handler};\n });\n }\n\n /**\n * Recursively divide HTML string to two types of nodes:\n * 1. Block element\n * 2. Document Fragments contained text and markup tags like a, b, i etc.\n *\n * @param {Node} wrapper\n * @returns {Node[]}\n */\n private getNodes(wrapper: Node): Node[] {\n const children = Array.from(wrapper.childNodes);\n const tags = Object.keys(this.toolsTags);\n\n const reducer = (nodes: Node[], node: Node): Node[] => {\n if ($.isEmpty(node)) {\n return nodes;\n }\n\n const lastNode = nodes[nodes.length - 1];\n let destNode: Node = new DocumentFragment();\n\n if (lastNode && $.isFragment(lastNode)) {\n destNode = nodes.pop();\n }\n\n switch (node.nodeType) {\n /**\n * If node is HTML element:\n * 1. Check if it is inline element\n * 2. Check if it contains another block or substitutable elements\n */\n case Node.ELEMENT_NODE:\n const element = node as HTMLElement;\n /** Append inline elements to previous fragment */\n if (\n !$.blockElements.includes(element.tagName.toLowerCase()) &&\n !tags.includes(element.tagName.toLowerCase())\n ) {\n destNode.appendChild(element);\n return [...nodes, destNode];\n }\n\n if (\n (\n tags.includes(element.tagName.toLowerCase()) &&\n Array.from(element.children).every(({tagName}) => !tags.includes(tagName.toLowerCase()))\n ) || (\n $.blockElements.includes(element.tagName.toLowerCase()) &&\n Array.from(element.children).every(\n ({tagName}) => !$.blockElements.includes(tagName.toLowerCase()),\n )\n )\n ) {\n return [...nodes, element];\n }\n break;\n\n /**\n * If node is text node, wrap it with DocumentFragment\n */\n case Node.TEXT_NODE:\n destNode.appendChild(node);\n return [...nodes, destNode];\n\n default:\n return [...nodes, destNode];\n }\n\n return [...nodes, ...Array.from(node.childNodes).reduce(reducer, [])];\n };\n\n return children.reduce(reducer, []);\n }\n}\n","/**\r\n * Codex Editor Renderer Module\r\n *\r\n * @module Renderer\r\n * @author CodeX Team\r\n *\r\n * @version 2.0.0\r\n */\r\nexport default class Renderer extends Module {\r\n /**\r\n * @constructor\r\n * @param {EditorConfig} config\r\n */\r\n constructor({config}) {\r\n super({config});\r\n }\r\n\r\n /**\r\n * @typedef {Object} RendererItems\r\n * @property {String} type - tool name\r\n * @property {Object} data - tool data\r\n */\r\n\r\n /**\r\n * @example\r\n *\r\n * items: [\r\n * {\r\n * type : 'paragraph',\r\n * data : {\r\n * text : 'Hello from Codex!'\r\n * }\r\n * },\r\n * {\r\n * type : 'paragraph',\r\n * data : {\r\n * text : 'Leave feedback if you like it!'\r\n * }\r\n * },\r\n * ]\r\n *\r\n */\r\n\r\n /**\r\n * Make plugin blocks from array of plugin`s data\r\n * @param {RendererItems[]} items\r\n */\r\n render(items) {\r\n let chainData = [];\r\n\r\n for (let i = 0; i < items.length; i++) {\r\n chainData.push({\r\n function: () => this.insertBlock(items[i])\r\n });\r\n }\r\n\r\n return _.sequence(chainData);\r\n }\r\n\r\n /**\r\n * Get plugin instance\r\n * Add plugin instance to BlockManager\r\n * Insert block to working zone\r\n *\r\n * @param {Object} item\r\n * @returns {Promise.}\r\n * @private\r\n */\r\n insertBlock(item) {\r\n let tool = item.type,\r\n data = item.data,\r\n settings = item.settings;\r\n\r\n if (tool in this.Editor.Tools.available) {\r\n this.Editor.BlockManager.insert(tool, data, settings);\r\n } else {\r\n /**\r\n * @todo show warning notification message\r\n *\r\n * `${tool} blocks was skipped.`\r\n */\r\n\r\n _.log(`Tool «${tool}» is not found. Check 'tools' property at your initial CodeX Editor config.`, 'warn');\r\n }\r\n\r\n return Promise.resolve();\r\n }\r\n}\r\n","/**\r\n * CodeX Sanitizer\r\n *\r\n * @module Sanitizer\r\n * Clears HTML from taint tags\r\n *\r\n * @version 2.0.0\r\n *\r\n * @example\r\n * Module can be used within two ways:\r\n * 1) When you have an instance\r\n * - this.Editor.Sanitizer.clean(yourTaintString);\r\n * 2) As static method\r\n * - CodexEditor.Sanitizer.clean(yourTaintString, yourCustomConfiguration);\r\n *\r\n * {@link SanitizerConfig}\r\n */\r\n\r\n\r\n/**\r\n * @typedef {Object} SanitizerConfig\r\n * @property {Object} tags - define tags restrictions\r\n *\r\n * @example\r\n *\r\n * tags : {\r\n * p: true,\r\n * a: {\r\n * href: true,\r\n * rel: \"nofollow\",\r\n * target: \"_blank\"\r\n * }\r\n * }\r\n */\r\nexport default class Sanitizer extends Module {\r\n /**\r\n * Initializes Sanitizer module\r\n * Sets default configuration if custom not exists\r\n *\r\n * @property {SanitizerConfig} this.defaultConfig\r\n * @property {HTMLJanitor} this._sanitizerInstance - Sanitizer library\r\n *\r\n * @param {SanitizerConfig} config\r\n */\r\n constructor({config}) {\r\n super({config});\r\n\r\n // default config\r\n this.defaultConfig = null;\r\n this._sanitizerInstance = null;\r\n\r\n /** Custom configuration */\r\n this.sanitizerConfig = config.settings ? config.settings.sanitizer : {};\r\n\r\n /** HTML Janitor library */\r\n this.sanitizerInstance = require('html-janitor');\r\n }\r\n\r\n /**\r\n * If developer uses editor's API, then he can customize sanitize restrictions.\r\n * Or, sanitizing config can be defined globally in editors initialization. That config will be used everywhere\r\n * At least, if there is no config overrides, that API uses Default configuration\r\n *\r\n * @uses https://www.npmjs.com/package/html-janitor\r\n *\r\n * @param {HTMLJanitor} library - sanitizer extension\r\n */\r\n set sanitizerInstance(library) {\r\n this._sanitizerInstance = new library(this.defaultConfig);\r\n }\r\n\r\n /**\r\n * Sets sanitizer configuration. Uses default config if user didn't pass the restriction\r\n * @param {SanitizerConfig} config\r\n */\r\n set sanitizerConfig(config) {\r\n if (_.isEmpty(config)) {\r\n this.defaultConfig = {\r\n tags: {\r\n p: {},\r\n a: {\r\n href: true,\r\n target: '_blank',\r\n rel: 'nofollow'\r\n },\r\n b: {},\r\n i: {}\r\n }\r\n };\r\n } else {\r\n this.defaultConfig = config;\r\n }\r\n }\r\n\r\n /**\r\n * Cleans string from unwanted tags\r\n * @param {String} taintString - HTML string\r\n * @param {Object} customConfig - custom sanitizer configuration. Method uses default if param is empty\r\n * @return {String} clean HTML\r\n */\r\n clean(taintString, customConfig = {}) {\r\n if (_.isEmpty(customConfig)) {\r\n return this._sanitizerInstance.clean(taintString);\r\n } else {\r\n return Sanitizer.clean(taintString, customConfig);\r\n }\r\n }\r\n\r\n /**\r\n * Cleans string from unwanted tags\r\n * @static\r\n *\r\n * Method allows to use default config\r\n *\r\n * @param {String} taintString - taint string\r\n * @param {SanitizerConfig} customConfig - allowed tags\r\n *\r\n * @return {String} clean HTML\r\n */\r\n static clean(taintString, customConfig) {\r\n let newInstance = new Sanitizer({\r\n config: {\r\n settings: {\r\n sanitizer: customConfig\r\n }\r\n }\r\n });\r\n\r\n return newInstance.clean(taintString);\r\n }\r\n}\r\n","/**\r\n * Codex Editor Saver\r\n *\r\n * @module Saver\r\n * @author Codex Team\r\n * @version 2.0.0\r\n */\r\n\r\n/**\r\n * @typedef {Object} SavedData\r\n * @property {Date} time - saving proccess time\r\n * @property {Object} items - extracted data\r\n * @property {String} version - CodexEditor version\r\n */\r\n\r\n/**\r\n * @classdesc This method reduces all Blocks asyncronically and calls Block's save method to extract data\r\n *\r\n * @typedef {Saver} Saver\r\n * @property {Element} html - Editor HTML content\r\n * @property {String} json - Editor JSON output\r\n */\r\nexport default class Saver extends Module {\r\n /**\r\n * @constructor\r\n * @param config\r\n */\r\n constructor({config}) {\r\n super({config});\r\n\r\n this.output = null;\r\n this.blocksData = [];\r\n }\r\n\r\n /**\r\n * Composes new chain of Promises to fire them alternatelly\r\n * @return {SavedData}\r\n */\r\n save() {\r\n let blocks = this.Editor.BlockManager.blocks,\r\n chainData = [];\r\n\r\n blocks.forEach((block) => {\r\n chainData.push(block.data);\r\n });\r\n\r\n return Promise.all(chainData)\r\n .then((allExtractedData) => this.makeOutput(allExtractedData))\r\n .then((outputData) => {\r\n return outputData;\r\n });\r\n }\r\n\r\n /**\r\n * Creates output object with saved data, time and version of editor\r\n * @param {Object} allExtractedData\r\n * @return {SavedData}\r\n */\r\n makeOutput(allExtractedData) {\r\n let items = [],\r\n totalTime = 0;\r\n\r\n console.groupCollapsed('[CodexEditor saving]:');\r\n\r\n allExtractedData.forEach((extraction) => {\r\n /** Group process info */\r\n console.log(`«${extraction.tool}» saving info`, extraction);\r\n totalTime += extraction.time;\r\n items.push({\r\n type: extraction.tool,\r\n data: extraction.data\r\n });\r\n });\r\n\r\n console.log('Total', totalTime);\r\n console.groupEnd();\r\n\r\n return {\r\n time : +new Date(),\r\n items : items,\r\n version : VERSION,\r\n };\r\n }\r\n}\r\n\r\n// module.exports = (function (saver) {\r\n//\r\n// let editor = codex.editor;\r\n//\r\n// /**\r\n// * @public\r\n// * Save blocks\r\n// */\r\n// saver.save = function () {\r\n//\r\n// /** Save html content of redactor to memory */\r\n// editor.state.html = editor.nodes.redactor.innerHTML;\r\n//\r\n// /** Clean jsonOutput state */\r\n// editor.state.jsonOutput = [];\r\n//\r\n// return saveBlocks(editor.nodes.redactor.childNodes);\r\n//\r\n// };\r\n//\r\n// /**\r\n// * @private\r\n// * Save each block data\r\n// *\r\n// * @param blocks\r\n// * @returns {Promise.}\r\n// */\r\n// let saveBlocks = function (blocks) {\r\n//\r\n// let data = [];\r\n//\r\n// for(let index = 0; index < blocks.length; index++) {\r\n//\r\n// data.push(getBlockData(blocks[index]));\r\n//\r\n// }\r\n//\r\n// return Promise.all(data)\r\n// .then(makeOutput)\r\n// .catch(editor.core.log);\r\n//\r\n// };\r\n//\r\n// /** Save and validate block data */\r\n// let getBlockData = function (block) {\r\n//\r\n// return saveBlockData(block)\r\n// .then(validateBlockData)\r\n// .catch(editor.core.log);\r\n//\r\n// };\r\n//\r\n// /**\r\n// * @private\r\n// * Call block`s plugin save method and return saved data\r\n// *\r\n// * @param block\r\n// * @returns {Object}\r\n// */\r\n// let saveBlockData = function (block) {\r\n//\r\n// let pluginName = block.dataset.tool;\r\n//\r\n// /** Check for plugin existence */\r\n// if (!editor.tools[pluginName]) {\r\n//\r\n// editor.core.log(`Plugin «${pluginName}» not found`, 'error');\r\n// return {data: null, pluginName: null};\r\n//\r\n// }\r\n//\r\n// /** Check for plugin having save method */\r\n// if (typeof editor.tools[pluginName].save !== 'function') {\r\n//\r\n// editor.core.log(`Plugin «${pluginName}» must have save method`, 'error');\r\n// return {data: null, pluginName: null};\r\n//\r\n// }\r\n//\r\n// /** Result saver */\r\n// let blockContent = block.childNodes[0],\r\n// pluginsContent = blockContent.childNodes[0],\r\n// position = pluginsContent.dataset.inputPosition;\r\n//\r\n// /** If plugin wasn't available then return data from cache */\r\n// if ( editor.tools[pluginName].available === false ) {\r\n//\r\n// return Promise.resolve({data: codex.editor.state.blocks.items[position].data, pluginName});\r\n//\r\n// }\r\n//\r\n// return Promise.resolve(pluginsContent)\r\n// .then(editor.tools[pluginName].save)\r\n// .then(data => Object({data, pluginName}));\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Call plugin`s validate method. Return false if validation failed\r\n// *\r\n// * @param data\r\n// * @param pluginName\r\n// * @returns {Object|Boolean}\r\n// */\r\n// let validateBlockData = function ({data, pluginName}) {\r\n//\r\n// if (!data || !pluginName) {\r\n//\r\n// return false;\r\n//\r\n// }\r\n//\r\n// if (editor.tools[pluginName].validate) {\r\n//\r\n// let result = editor.tools[pluginName].validate(data);\r\n//\r\n// /**\r\n// * Do not allow invalid data\r\n// */\r\n// if (!result) {\r\n//\r\n// return false;\r\n//\r\n// }\r\n//\r\n// }\r\n//\r\n// return {data, pluginName};\r\n//\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Compile article output\r\n// *\r\n// * @param savedData\r\n// * @returns {{time: number, version, items: (*|Array)}}\r\n// */\r\n// let makeOutput = function (savedData) {\r\n//\r\n// savedData = savedData.filter(blockData => blockData);\r\n//\r\n// let items = savedData.map(blockData => Object({type: blockData.pluginName, data: blockData.data}));\r\n//\r\n// editor.state.jsonOutput = items;\r\n//\r\n// return {\r\n// id: editor.state.blocks.id || null,\r\n// time: +new Date(),\r\n// version: editor.version,\r\n// items\r\n// };\r\n//\r\n// };\r\n//\r\n// return saver;\r\n//\r\n// })({});\r\n","/**\r\n * Block Settings\r\n *\r\n * ____ Settings Panel ____\r\n * | ...................... |\r\n * | . Tool Settings . |\r\n * | ...................... |\r\n * | . Default Settings . |\r\n * | ...................... |\r\n * |________________________|\r\n */\r\nexport default class BlockSettings extends Module {\r\n /**\r\n * @constructor\r\n */\r\n constructor({config}) {\r\n super({config});\r\n\r\n this.nodes = {\r\n wrapper: null,\r\n toolSettings: null,\r\n defaultSettings: null\r\n };\r\n }\r\n\r\n /**\r\n * Module Events\r\n * @return {{opened: string, closed: string}}\r\n */\r\n get events() {\r\n return {\r\n opened: 'block-settings-opened',\r\n closed: 'block-settings-closed',\r\n };\r\n }\r\n\r\n /**\r\n * Block Settings CSS\r\n * @return {{wrapper, wrapperOpened, toolSettings, defaultSettings, button}}\r\n */\r\n static get CSS() {\r\n return {\r\n // Settings Panel\r\n wrapper: 'ce-settings',\r\n wrapperOpened: 'ce-settings--opened',\r\n toolSettings: 'ce-settings__plugin-zone',\r\n defaultSettings: 'ce-settings__default-zone',\r\n\r\n button: 'ce-settings__button'\r\n };\r\n }\r\n\r\n /**\r\n * Panel with block settings with 2 sections:\r\n * - Tool's Settings\r\n * - Default Settings [Move, Remove, etc]\r\n *\r\n * @return {Element}\r\n */\r\n make() {\r\n this.nodes.wrapper = $.make('div', BlockSettings.CSS.wrapper);\r\n\r\n this.nodes.toolSettings = $.make('div', BlockSettings.CSS.toolSettings);\r\n this.nodes.defaultSettings = $.make('div', BlockSettings.CSS.defaultSettings);\r\n\r\n $.append(this.nodes.wrapper, [this.nodes.toolSettings, this.nodes.defaultSettings]);\r\n }\r\n\r\n /**\r\n * Add Tool's settings\r\n */\r\n addToolSettings() {\r\n if (typeof this.Editor.BlockManager.currentBlock.tool.renderSettings === 'function') {\r\n $.append(this.nodes.toolSettings, this.Editor.BlockManager.currentBlock.tool.renderSettings());\r\n }\r\n }\r\n\r\n /**\r\n * Add default settings\r\n */\r\n addDefaultSettings() {\r\n $.append(this.nodes.defaultSettings, this.Editor.BlockManager.currentBlock.renderTunes());\r\n }\r\n\r\n /**\r\n * Is Block Settings opened or not\r\n * @returns {boolean}\r\n */\r\n get opened() {\r\n return this.nodes.wrapper.classList.contains(BlockSettings.CSS.wrapperOpened);\r\n }\r\n\r\n /**\r\n * Open Block Settings pane\r\n */\r\n open() {\r\n this.nodes.wrapper.classList.add(BlockSettings.CSS.wrapperOpened);\r\n\r\n /**\r\n * Fill Tool's settings\r\n */\r\n this.addToolSettings();\r\n\r\n /**\r\n * Add default settings that presents for all Blocks\r\n */\r\n this.addDefaultSettings();\r\n\r\n /** Tell to subscribers that block settings is opened */\r\n this.Editor.Events.emit(this.events.opened);\r\n }\r\n\r\n /**\r\n * Close Block Settings pane\r\n */\r\n close() {\r\n this.nodes.wrapper.classList.remove(BlockSettings.CSS.wrapperOpened);\r\n\r\n /** Clear settings */\r\n this.nodes.toolSettings.innerHTML = '';\r\n this.nodes.defaultSettings.innerHTML = '';\r\n\r\n /** Tell to subscribers that block settings is closed */\r\n this.Editor.Events.emit(this.events.closed);\r\n }\r\n}\r\n","/**\r\n * Inline toolbar with actions that modifies selected text fragment\r\n *\r\n * |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|\r\n * | B i [link] [mark] |\r\n * | _______________________|\r\n */\r\ndeclare var Module: any;\r\ndeclare var $: any;\r\ndeclare var _: any;\r\nimport BoldInlineTool from '../inline-tools/inline-tool-bold';\r\nimport ItalicInlineTool from '../inline-tools/inline-tool-italic';\r\nimport LinkInlineTool from '../inline-tools/inline-tool-link';\r\nimport InlineTool from '../interfaces/inline-tool';\r\nimport Selection from '../selection';\r\n\r\nexport default class InlineToolbar extends Module {\r\n\r\n /**\r\n * CSS styles\r\n */\r\n public CSS = {\r\n inlineToolbar: 'ce-inline-toolbar',\r\n inlineToolbarShowed: 'ce-inline-toolbar--showed',\r\n buttonsWrapper: 'ce-inline-toolbar__buttons',\r\n actionsWrapper: 'ce-inline-toolbar__actions',\r\n };\r\n\r\n /**\r\n * Inline Toolbar elements\r\n */\r\n private nodes = {\r\n wrapper: null,\r\n buttons: null,\r\n /**\r\n * Zone below the buttons where Tools can create additional actions by 'renderActions()' method\r\n * For example, input for the 'link' tool or textarea for the 'comment' tool\r\n */\r\n actions: null,\r\n };\r\n\r\n /**\r\n * Margin above/below the Toolbar\r\n */\r\n private readonly toolbarVerticalMargin: number = 20;\r\n\r\n /**\r\n * Tools instances\r\n */\r\n private toolsInstances: InlineTool[];\r\n\r\n /**\r\n * @constructor\r\n */\r\n constructor({config}) {\r\n super({config});\r\n }\r\n\r\n /**\r\n * Inline Toolbar Tools\r\n * @todo Merge internal tools with external\r\n */\r\n get tools(): InlineTool[] {\r\n if (!this.toolsInstances) {\r\n this.toolsInstances = [\r\n new BoldInlineTool(this.Editor.API.methods),\r\n new ItalicInlineTool(this.Editor.API.methods),\r\n new LinkInlineTool(this.Editor.API.methods),\r\n ...this.Editor.Tools.inline.map( (Tool) => new Tool(this.Editor.API.methods) ),\r\n ];\r\n }\r\n return this.toolsInstances;\r\n }\r\n\r\n /**\r\n * Making DOM\r\n */\r\n public make() {\r\n\r\n this.nodes.wrapper = $.make('div', this.CSS.inlineToolbar);\r\n this.nodes.buttons = $.make('div', this.CSS.buttonsWrapper);\r\n this.nodes.actions = $.make('div', this.CSS.actionsWrapper);\r\n\r\n /**\r\n * Append Inline Toolbar to the Editor\r\n */\r\n $.append(this.nodes.wrapper, [this.nodes.buttons, this.nodes.actions]);\r\n $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper);\r\n\r\n /**\r\n * Append Inline Toolbar Tools\r\n */\r\n this.addTools();\r\n\r\n }\r\n\r\n /**\r\n *\r\n *\r\n * Moving / appearance\r\n * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n *\r\n */\r\n\r\n /**\r\n * Shows Inline Toolbar by keyup/mouseup\r\n * @param {KeyboardEvent|MouseEvent} event\r\n */\r\n public handleShowingEvent(event): void {\r\n if (!this.allowedToShow(event)) {\r\n this.close();\r\n return;\r\n }\r\n\r\n this.move();\r\n this.open();\r\n\r\n /** Check Tools state for selected fragment */\r\n this.checkToolsState();\r\n }\r\n\r\n /**\r\n * Move Toolbar to the selected text\r\n */\r\n public move(): void {\r\n\r\n const selectionRect = Selection.rect;\r\n const wrapperOffset = this.Editor.UI.nodes.wrapper.getBoundingClientRect();\r\n\r\n const newCoords = {\r\n x: selectionRect.x - wrapperOffset.left,\r\n y: selectionRect.y\r\n + selectionRect.height\r\n // + window.scrollY\r\n - wrapperOffset.top\r\n + this.toolbarVerticalMargin,\r\n };\r\n\r\n /**\r\n * If we know selections width, place InlineToolbar to center\r\n */\r\n if (selectionRect.width) {\r\n newCoords.x += Math.floor(selectionRect.width / 2);\r\n }\r\n\r\n this.nodes.wrapper.style.left = Math.floor(newCoords.x) + 'px';\r\n this.nodes.wrapper.style.top = Math.floor(newCoords.y) + 'px';\r\n }\r\n\r\n /**\r\n * Shows Inline Toolbar\r\n */\r\n private open() {\r\n this.nodes.wrapper.classList.add(this.CSS.inlineToolbarShowed);\r\n\r\n this.tools.forEach( (tool) => {\r\n if (typeof tool.clear === 'function') {\r\n tool.clear();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Hides Inline Toolbar\r\n */\r\n private close() {\r\n this.nodes.wrapper.classList.remove(this.CSS.inlineToolbarShowed);\r\n\r\n this.tools.forEach( (tool) => {\r\n if (typeof tool.clear === 'function') {\r\n tool.clear();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Need to show Inline Toolbar or not\r\n * @param {KeyboardEvent|MouseEvent} event\r\n */\r\n private allowedToShow(event): boolean {\r\n /**\r\n * Tags conflicts with window.selection function.\r\n * Ex. IMG tag returns null (Firefox) or Redactors wrapper (Chrome)\r\n */\r\n const tagsConflictsWithSelection = ['IMG', 'INPUT'];\r\n if (event && tagsConflictsWithSelection.includes(event.target.tagName)) {\r\n return false;\r\n }\r\n\r\n const currentSelection = Selection.get(),\r\n selectedText = Selection.text;\r\n\r\n // old browsers\r\n if (!currentSelection || !currentSelection.anchorNode) {\r\n return false;\r\n }\r\n\r\n // empty selection\r\n if (currentSelection.isCollapsed || selectedText.length < 1) {\r\n return false;\r\n }\r\n\r\n // is enabled by current Block's Tool\r\n const currentBlock = this.Editor.BlockManager.getBlock(currentSelection.anchorNode);\r\n\r\n if (!currentBlock) {\r\n return false;\r\n }\r\n\r\n const toolConfig = this.config.toolsConfig[currentBlock.name];\r\n\r\n return toolConfig && toolConfig[this.Editor.Tools.apiSettings.IS_ENABLED_INLINE_TOOLBAR];\r\n }\r\n\r\n /**\r\n *\r\n *\r\n * Working with Tools\r\n * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n *\r\n */\r\n\r\n /**\r\n * Fill Inline Toolbar with Tools\r\n */\r\n private addTools(): void {\r\n this.tools.forEach( (tool) => {\r\n this.addTool(tool);\r\n });\r\n }\r\n\r\n /**\r\n * Add tool button and activate clicks\r\n * @param {InlineTool} tool - Tool's instance\r\n */\r\n private addTool(tool: InlineTool): void {\r\n const button = tool.render();\r\n\r\n if (!button) {\r\n _.log('Render method must return an instance of Node', 'warn', tool);\r\n return;\r\n }\r\n\r\n this.nodes.buttons.appendChild(button);\r\n\r\n if (typeof tool.renderActions === 'function') {\r\n const actions = tool.renderActions();\r\n this.nodes.actions.appendChild(actions);\r\n }\r\n\r\n this.Editor.Listeners.on(button, 'click', () => {\r\n this.toolClicked(tool);\r\n });\r\n }\r\n\r\n /**\r\n * Inline Tool button clicks\r\n * @param {InlineTool} tool - Tool's instance\r\n */\r\n private toolClicked(tool: InlineTool): void {\r\n const range = Selection.range;\r\n\r\n tool.surround(range);\r\n this.checkToolsState();\r\n\r\n }\r\n\r\n /**\r\n * Check Tools` state by selection\r\n */\r\n private checkToolsState(): void {\r\n this.tools.forEach( (tool) => {\r\n tool.checkState(Selection.get());\r\n });\r\n }\r\n}\r\n","/**\r\n * @class Toolbox\r\n * @classdesc Holder for Tools\r\n *\r\n * @typedef {Toolbox} Toolbox\r\n * @property {Boolean} opened - opening state\r\n * @property {Object} nodes - Toolbox nodes\r\n * @property {Object} CSS - CSS class names\r\n *\r\n */\r\nexport default class Toolbox extends Module {\r\n /**\r\n * @constructor\r\n */\r\n constructor({config}) {\r\n super({config});\r\n\r\n this.nodes = {\r\n toolbox: null,\r\n buttons: []\r\n };\r\n\r\n /**\r\n * Opening state\r\n * @type {boolean}\r\n */\r\n this.opened = false;\r\n }\r\n\r\n /**\r\n * CSS styles\r\n * @return {{toolbox: string, toolboxButton: string, toolboxOpened: string}}\r\n */\r\n static get CSS() {\r\n return {\r\n toolbox: 'ce-toolbox',\r\n toolboxButton: 'ce-toolbox__button',\r\n toolboxOpened: 'ce-toolbox--opened',\r\n };\r\n }\r\n\r\n /**\r\n * Makes the Toolbox\r\n */\r\n make() {\r\n this.nodes.toolbox = $.make('div', Toolbox.CSS.toolbox);\r\n $.append(this.Editor.Toolbar.nodes.content, this.nodes.toolbox);\r\n\r\n this.addTools();\r\n }\r\n\r\n /**\r\n * Iterates available tools and appends them to the Toolbox\r\n */\r\n addTools() {\r\n let tools = this.Editor.Tools.toolsAvailable;\r\n\r\n for (let toolName in tools) {\r\n this.addTool(toolName, tools[toolName]);\r\n }\r\n }\r\n\r\n /**\r\n * Append Tool to the Toolbox\r\n *\r\n * @param {string} toolName - tool name\r\n * @param {IBlockTool} tool - tool class\r\n */\r\n addTool(toolName, tool) {\r\n const api = this.Editor.Tools.apiSettings;\r\n\r\n if (tool[api.IS_DISPLAYED_IN_TOOLBOX] && !tool[api.TOOLBAR_ICON_CLASS]) {\r\n _.log('Toolbar icon class name is missed. Tool %o skipped', 'warn', toolName);\r\n return;\r\n }\r\n\r\n /**\r\n * @todo Add checkup for the render method\r\n */\r\n // if (typeof tool.render !== 'function') {\r\n //\r\n // _.log('render method missed. Tool %o skipped', 'warn', tool);\r\n // return;\r\n //\r\n // }\r\n\r\n /**\r\n * Skip tools that pass 'displayInToolbox=false'\r\n */\r\n if (!tool[api.IS_DISPLAYED_IN_TOOLBOX]) {\r\n return;\r\n }\r\n\r\n let button = $.make('li', [Toolbox.CSS.toolboxButton, tool[api.TOOLBAR_ICON_CLASS]], {\r\n title: toolName\r\n });\r\n\r\n button.innerHTML = tool.toolboxIcon;\r\n\r\n /**\r\n * Save tool's name in the button data-name\r\n */\r\n button.dataset.name = toolName;\r\n\r\n $.append(this.nodes.toolbox, button);\r\n\r\n this.nodes.toolbox.appendChild(button);\r\n this.nodes.buttons.push(button);\r\n\r\n /**\r\n * @todo add event with module Listeners\r\n */\r\n // this.Editor.Listeners.add();\r\n button.addEventListener('click', event => {\r\n this.buttonClicked(event);\r\n }, false);\r\n }\r\n\r\n /**\r\n * Toolbox button click listener\r\n * 1) if block is empty -> replace\r\n * 2) if block is not empty -> add new block below\r\n *\r\n * @param {MouseEvent} event\r\n */\r\n buttonClicked(event) {\r\n let toolButton = event.target;\r\n\r\n toolButton = toolButton.closest(`.${Toolbox.CSS.toolboxButton}`);\r\n\r\n if (!toolButton) {\r\n return;\r\n }\r\n\r\n let toolName = toolButton.dataset.name,\r\n tool = this.Editor.Tools.toolClasses[toolName];\r\n\r\n /**\r\n * @type {Block}\r\n */\r\n let currentBlock = this.Editor.BlockManager.currentBlock;\r\n\r\n /**\r\n * We do replace if:\r\n * - block is empty\r\n * - block is not irreplaceable\r\n * @type {Array}\r\n */\r\n if (!tool[this.Editor.Tools.apiSettings.IS_IRREPLACEBLE_TOOL] && currentBlock.isEmpty) {\r\n this.Editor.BlockManager.replace(toolName);\r\n } else {\r\n this.Editor.BlockManager.insert(toolName);\r\n }\r\n\r\n /**\r\n * @todo set caret to the new block\r\n */\r\n\r\n // window.setTimeout(function () {\r\n\r\n /** Set caret to current block */\r\n // editor.caret.setToBlock(currentInputIndex);\r\n\r\n // }, 10);\r\n\r\n /**\r\n * Move toolbar when node is changed\r\n */\r\n this.Editor.Toolbar.move();\r\n }\r\n\r\n /**\r\n * Open Toolbox with Tools\r\n */\r\n open() {\r\n this.nodes.toolbox.classList.add(Toolbox.CSS.toolboxOpened);\r\n this.opened = true;\r\n }\r\n\r\n /**\r\n * Close Toolbox\r\n */\r\n close() {\r\n this.nodes.toolbox.classList.remove(Toolbox.CSS.toolboxOpened);\r\n this.opened = false;\r\n }\r\n\r\n /**\r\n * Close Toolbox\r\n */\r\n toggle() {\r\n if (!this.opened) {\r\n this.open();\r\n } else {\r\n this.close();\r\n }\r\n }\r\n}\r\n","/**\r\n *\r\n * «Toolbar» is the node that moves up/down over current block\r\n *\r\n * ______________________________________ Toolbar ____________________________________________\r\n * | |\r\n * | ..................... Content .................... ......... Block Actions .......... |\r\n * | . . . . |\r\n * | . . . [Open Settings] . |\r\n * | . [Plus Button] [Toolbox: {Tool1}, {Tool2}] . . . |\r\n * | . . . [Settings Panel] . |\r\n * | .................................................. .................................. |\r\n * | |\r\n * |___________________________________________________________________________________________|\r\n *\r\n *\r\n * Toolbox — its an Element contains tools buttons. Can be shown by Plus Button.\r\n *\r\n * _______________ Toolbox _______________\r\n * | |\r\n * | [Header] [Image] [List] [Quote] ... |\r\n * |_______________________________________|\r\n *\r\n *\r\n * Settings Panel — is an Element with block settings:\r\n *\r\n * ____ Settings Panel ____\r\n * | ...................... |\r\n * | . Tool Settings . |\r\n * | ...................... |\r\n * | . Default Settings . |\r\n * | ...................... |\r\n * |________________________|\r\n *\r\n *\r\n * @class\r\n * @classdesc Toolbar module\r\n *\r\n * @typedef {Toolbar} Toolbar\r\n * @property {Object} nodes\r\n * @property {Element} nodes.wrapper - Toolbar main element\r\n * @property {Element} nodes.content - Zone with Plus button and toolbox.\r\n * @property {Element} nodes.actions - Zone with Block Settings and Remove Button\r\n * @property {Element} nodes.blockActionsButtons - Zone with Block Buttons: [Settings]\r\n * @property {Element} nodes.plusButton - Button that opens or closes Toolbox\r\n * @property {Element} nodes.toolbox - Container for tools\r\n * @property {Element} nodes.settingsToggler - open/close Settings Panel button\r\n * @property {Element} nodes.settings - Settings Panel\r\n * @property {Element} nodes.pluginSettings - Plugin Settings section of Settings Panel\r\n * @property {Element} nodes.defaultSettings - Default Settings section of Settings Panel\r\n */\r\nexport default class Toolbar extends Module {\r\n /**\r\n * @constructor\r\n */\r\n constructor({config}) {\r\n super({config});\r\n\r\n this.nodes = {\r\n wrapper : null,\r\n content : null,\r\n actions : null,\r\n\r\n // Content Zone\r\n plusButton : null,\r\n\r\n // Actions Zone\r\n blockActionsButtons: null,\r\n settingsToggler : null,\r\n };\r\n }\r\n\r\n /**\r\n * CSS styles\r\n * @return {Object}\r\n * @constructor\r\n */\r\n static get CSS() {\r\n return {\r\n toolbar: 'ce-toolbar',\r\n content: 'ce-toolbar__content',\r\n actions: 'ce-toolbar__actions',\r\n\r\n toolbarOpened: 'ce-toolbar--opened',\r\n\r\n // Content Zone\r\n plusButton: 'ce-toolbar__plus',\r\n plusButtonHidden: 'ce-toolbar__plus--hidden',\r\n\r\n // Actions Zone\r\n blockActionsButtons: 'ce-toolbar__actions-buttons',\r\n settingsToggler: 'ce-toolbar__settings-btn',\r\n };\r\n }\r\n\r\n /**\r\n * Makes toolbar\r\n */\r\n make() {\r\n this.nodes.wrapper = $.make('div', Toolbar.CSS.toolbar);\r\n\r\n /**\r\n * Make Content Zone and Actions Zone\r\n */\r\n ['content', 'actions'].forEach( el => {\r\n this.nodes[el] = $.make('div', Toolbar.CSS[el]);\r\n $.append(this.nodes.wrapper, this.nodes[el]);\r\n });\r\n\r\n\r\n /**\r\n * Fill Content Zone:\r\n * - Plus Button\r\n * - Toolbox\r\n */\r\n this.nodes.plusButton = $.make('div', Toolbar.CSS.plusButton);\r\n $.append(this.nodes.plusButton, $.svg('plus', 14, 14));\r\n $.append(this.nodes.content, this.nodes.plusButton);\r\n this.nodes.plusButton.addEventListener('click', event => this.plusButtonClicked(event), false);\r\n\r\n\r\n /**\r\n * Make a Toolbox\r\n */\r\n this.Editor.Toolbox.make();\r\n\r\n /**\r\n * Fill Actions Zone:\r\n * - Settings Toggler\r\n * - Remove Block Button\r\n * - Settings Panel\r\n */\r\n this.nodes.blockActionsButtons = $.make('div', Toolbar.CSS.blockActionsButtons);\r\n this.nodes.settingsToggler = $.make('span', Toolbar.CSS.settingsToggler);\r\n const settingsIcon = $.svg('dots', 18, 4);\r\n\r\n $.append(this.nodes.settingsToggler, settingsIcon);\r\n $.append(this.nodes.blockActionsButtons, this.nodes.settingsToggler);\r\n $.append(this.nodes.actions, this.nodes.blockActionsButtons);\r\n\r\n /**\r\n * Make and append Settings Panel\r\n */\r\n this.Editor.BlockSettings.make();\r\n $.append(this.nodes.actions, this.Editor.BlockSettings.nodes.wrapper);\r\n\r\n /**\r\n * Append toolbar to the Editor\r\n */\r\n $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper);\r\n\r\n /**\r\n * Bind events on the Toolbar elements\r\n */\r\n this.bindEvents();\r\n }\r\n\r\n /**\r\n * Move Toolbar to the Current Block\r\n * @param {Boolean} forceClose - force close Toolbar Settings and Toolbar\r\n */\r\n move(forceClose = true) {\r\n if (forceClose) {\r\n /** Close Toolbox when we move toolbar */\r\n this.Editor.Toolbox.close();\r\n this.Editor.BlockSettings.close();\r\n }\r\n\r\n let currentNode = this.Editor.BlockManager.currentNode;\r\n\r\n /**\r\n * If no one Block selected as a Current\r\n */\r\n if (!currentNode) {\r\n return;\r\n }\r\n\r\n /**\r\n * @todo Compute dynamically on prepare\r\n * @type {number}\r\n */\r\n const defaultToolbarHeight = 49;\r\n const defaultOffset = 34;\r\n\r\n var newYCoordinate = currentNode.offsetTop - (defaultToolbarHeight / 2) + defaultOffset;\r\n\r\n this.nodes.wrapper.style.transform = `translate3D(0, ${Math.floor(newYCoordinate)}px, 0)`;\r\n }\r\n\r\n /**\r\n * Open Toolbar with Plus Button\r\n */\r\n open() {\r\n this.nodes.wrapper.classList.add(Toolbar.CSS.toolbarOpened);\r\n }\r\n\r\n /**\r\n * Close the Toolbar\r\n */\r\n close() {\r\n this.nodes.wrapper.classList.remove(Toolbar.CSS.toolbarOpened);\r\n }\r\n\r\n /**\r\n * Plus Button public methods\r\n * @return {{hide: function(): void, show: function(): void}}\r\n */\r\n get plusButton() {\r\n return {\r\n hide: () => this.nodes.plusButton.classList.add(Toolbar.CSS.plusButtonHidden),\r\n show: () => this.nodes.plusButton.classList.remove(Toolbar.CSS.plusButtonHidden)\r\n };\r\n }\r\n\r\n /**\r\n * Handler for Plus Button\r\n * @param {MouseEvent} event\r\n */\r\n plusButtonClicked() {\r\n this.Editor.Toolbox.toggle();\r\n }\r\n\r\n /**\r\n * Bind events on the Toolbar Elements:\r\n * - Block Settings\r\n */\r\n bindEvents() {\r\n /**\r\n * Settings toggler\r\n */\r\n this.Editor.Listeners.on(this.nodes.settingsToggler, 'click', (event) => {\r\n this.settingsTogglerClicked(event);\r\n });\r\n }\r\n\r\n /**\r\n * Clicks on the Block Settings toggler\r\n */\r\n settingsTogglerClicked() {\r\n if (this.Editor.BlockSettings.opened) {\r\n this.Editor.BlockSettings.close();\r\n } else {\r\n this.Editor.BlockSettings.open();\r\n }\r\n }\r\n}\r\n","/**\r\n * Inline toolbar\r\n *\r\n * Contains from tools:\r\n * Bold, Italic, Underline and Anchor\r\n *\r\n * @author Codex Team\r\n * @version 1.0\r\n */\r\n\r\nmodule.exports = (function (inline) {\r\n let editor = codex.editor;\r\n\r\n inline.buttonsOpened = null;\r\n inline.actionsOpened = null;\r\n inline.wrappersOffset = null;\r\n\r\n /**\r\n * saving selection that need for execCommand for styling\r\n *\r\n */\r\n inline.storedSelection = null;\r\n\r\n /**\r\n * @protected\r\n *\r\n * Open inline toobar\r\n */\r\n inline.show = function () {\r\n var currentNode = editor.content.currentNode,\r\n tool = currentNode.dataset.tool,\r\n plugin;\r\n\r\n /**\r\n * tool allowed to open inline toolbar\r\n */\r\n plugin = editor.tools[tool];\r\n\r\n if (!plugin.showInlineToolbar)\r\n return;\r\n\r\n var selectedText = inline.getSelectionText(),\r\n toolbar = editor.nodes.inlineToolbar.wrapper;\r\n\r\n if (selectedText.length > 0) {\r\n /** Move toolbar and open */\r\n editor.toolbar.inline.move();\r\n\r\n /** Open inline toolbar */\r\n toolbar.classList.add('opened');\r\n\r\n /** show buttons of inline toolbar */\r\n editor.toolbar.inline.showButtons();\r\n }\r\n };\r\n\r\n /**\r\n * @protected\r\n *\r\n * Closes inline toolbar\r\n */\r\n inline.close = function () {\r\n var toolbar = editor.nodes.inlineToolbar.wrapper;\r\n\r\n toolbar.classList.remove('opened');\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * Moving toolbar\r\n */\r\n inline.move = function () {\r\n if (!this.wrappersOffset) {\r\n this.wrappersOffset = this.getWrappersOffset();\r\n }\r\n\r\n var coords = this.getSelectionCoords(),\r\n defaultOffset = 0,\r\n toolbar = editor.nodes.inlineToolbar.wrapper,\r\n newCoordinateX,\r\n newCoordinateY;\r\n\r\n if (toolbar.offsetHeight === 0) {\r\n defaultOffset = 40;\r\n }\r\n\r\n newCoordinateX = coords.x - this.wrappersOffset.left;\r\n newCoordinateY = coords.y + window.scrollY - this.wrappersOffset.top - defaultOffset - toolbar.offsetHeight;\r\n\r\n toolbar.style.transform = `translate3D(${Math.floor(newCoordinateX)}px, ${Math.floor(newCoordinateY)}px, 0)`;\r\n\r\n /** Close everything */\r\n editor.toolbar.inline.closeButtons();\r\n editor.toolbar.inline.closeAction();\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * Tool Clicked\r\n */\r\n\r\n inline.toolClicked = function (event, type) {\r\n /**\r\n * For simple tools we use default browser function\r\n * For more complicated tools, we should write our own behavior\r\n */\r\n switch (type) {\r\n case 'createLink' : editor.toolbar.inline.createLinkAction(event, type); break;\r\n default : editor.toolbar.inline.defaultToolAction(type); break;\r\n }\r\n\r\n /**\r\n * highlight buttons\r\n * after making some action\r\n */\r\n editor.nodes.inlineToolbar.buttons.childNodes.forEach(editor.toolbar.inline.hightlight);\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * Saving wrappers offset in DOM\r\n */\r\n inline.getWrappersOffset = function () {\r\n var wrapper = editor.nodes.wrapper,\r\n offset = this.getOffset(wrapper);\r\n\r\n this.wrappersOffset = offset;\r\n return offset;\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * Calculates offset of DOM element\r\n *\r\n * @param el\r\n * @returns {{top: number, left: number}}\r\n */\r\n inline.getOffset = function ( el ) {\r\n var _x = 0;\r\n var _y = 0;\r\n\r\n while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) {\r\n _x += (el.offsetLeft + el.clientLeft);\r\n _y += (el.offsetTop + el.clientTop);\r\n el = el.offsetParent;\r\n }\r\n return { top: _y, left: _x };\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * Calculates position of selected text\r\n * @returns {{x: number, y: number}}\r\n */\r\n inline.getSelectionCoords = function () {\r\n var sel = document.selection, range;\r\n var x = 0, y = 0;\r\n\r\n if (sel) {\r\n if (sel.type != 'Control') {\r\n range = sel.createRange();\r\n range.collapse(true);\r\n x = range.boundingLeft;\r\n y = range.boundingTop;\r\n }\r\n } else if (window.getSelection) {\r\n sel = window.getSelection();\r\n\r\n if (sel.rangeCount) {\r\n range = sel.getRangeAt(0).cloneRange();\r\n if (range.getClientRects) {\r\n range.collapse(true);\r\n var rect = range.getClientRects()[0];\r\n\r\n if (!rect) {\r\n return;\r\n }\r\n\r\n x = rect.left;\r\n y = rect.top;\r\n }\r\n }\r\n }\r\n return { x: x, y: y };\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * Returns selected text as String\r\n * @returns {string}\r\n */\r\n inline.getSelectionText = function () {\r\n var selectedText = '';\r\n\r\n // all modern browsers and IE9+\r\n if (window.getSelection) {\r\n selectedText = window.getSelection().toString();\r\n }\r\n\r\n return selectedText;\r\n };\r\n\r\n /** Opens buttons block */\r\n inline.showButtons = function () {\r\n var buttons = editor.nodes.inlineToolbar.buttons;\r\n\r\n buttons.classList.add('opened');\r\n\r\n editor.toolbar.inline.buttonsOpened = true;\r\n\r\n /** highlight buttons */\r\n editor.nodes.inlineToolbar.buttons.childNodes.forEach(editor.toolbar.inline.hightlight);\r\n };\r\n\r\n /** Makes buttons disappear */\r\n inline.closeButtons = function () {\r\n var buttons = editor.nodes.inlineToolbar.buttons;\r\n\r\n buttons.classList.remove('opened');\r\n\r\n editor.toolbar.inline.buttonsOpened = false;\r\n };\r\n\r\n /** Open buttons defined action if exist */\r\n inline.showActions = function () {\r\n var action = editor.nodes.inlineToolbar.actions;\r\n\r\n action.classList.add('opened');\r\n\r\n editor.toolbar.inline.actionsOpened = true;\r\n };\r\n\r\n /** Close actions block */\r\n inline.closeAction = function () {\r\n var action = editor.nodes.inlineToolbar.actions;\r\n\r\n action.innerHTML = '';\r\n action.classList.remove('opened');\r\n editor.toolbar.inline.actionsOpened = false;\r\n };\r\n\r\n\r\n /**\r\n * Callback for keydowns in inline toolbar \"Insert link...\" input\r\n */\r\n let inlineToolbarAnchorInputKeydown_ = function (event) {\r\n if (event.keyCode != editor.core.keys.ENTER) {\r\n return;\r\n }\r\n\r\n let editable = editor.content.currentNode,\r\n storedSelection = editor.toolbar.inline.storedSelection;\r\n\r\n editor.toolbar.inline.restoreSelection(editable, storedSelection);\r\n editor.toolbar.inline.setAnchor(this.value);\r\n\r\n /**\r\n * Preventing events that will be able to happen\r\n */\r\n event.preventDefault();\r\n event.stopImmediatePropagation();\r\n\r\n editor.toolbar.inline.clearRange();\r\n };\r\n\r\n /** Action for link creation or for setting anchor */\r\n inline.createLinkAction = function (event) {\r\n var isActive = this.isLinkActive();\r\n\r\n var editable = editor.content.currentNode,\r\n storedSelection = editor.toolbar.inline.saveSelection(editable);\r\n\r\n /** Save globally selection */\r\n editor.toolbar.inline.storedSelection = storedSelection;\r\n\r\n if (isActive) {\r\n /**\r\n * Changing stored selection. if we want to remove anchor from word\r\n * we should remove anchor from whole word, not only selected part.\r\n * The solution is than we get the length of current link\r\n * Change start position to - end of selection minus length of anchor\r\n */\r\n editor.toolbar.inline.restoreSelection(editable, storedSelection);\r\n\r\n editor.toolbar.inline.defaultToolAction('unlink');\r\n } else {\r\n /** Create input and close buttons */\r\n var action = editor.draw.inputForLink();\r\n\r\n editor.nodes.inlineToolbar.actions.appendChild(action);\r\n\r\n editor.toolbar.inline.closeButtons();\r\n editor.toolbar.inline.showActions();\r\n\r\n /**\r\n * focus to input\r\n * Solution: https://developer.mozilla.org/ru/docs/Web/API/HTMLElement/focus\r\n * Prevents event after showing input and when we need to focus an input which is in unexisted form\r\n */\r\n action.focus();\r\n event.preventDefault();\r\n\r\n /** Callback to link action */\r\n editor.listeners.add(action, 'keydown', inlineToolbarAnchorInputKeydown_, false);\r\n }\r\n };\r\n\r\n inline.isLinkActive = function () {\r\n var isActive = false;\r\n\r\n editor.nodes.inlineToolbar.buttons.childNodes.forEach(function (tool) {\r\n var dataType = tool.dataset.type;\r\n\r\n if (dataType == 'link' && tool.classList.contains('hightlighted')) {\r\n isActive = true;\r\n }\r\n });\r\n\r\n return isActive;\r\n };\r\n\r\n /** default action behavior of tool */\r\n inline.defaultToolAction = function (type) {\r\n document.execCommand(type, false, null);\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * Sets URL\r\n *\r\n * @param {String} url - URL\r\n */\r\n inline.setAnchor = function (url) {\r\n document.execCommand('createLink', false, url);\r\n\r\n /** Close after URL inserting */\r\n editor.toolbar.inline.closeAction();\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * Saves selection\r\n */\r\n inline.saveSelection = function (containerEl) {\r\n var range = window.getSelection().getRangeAt(0),\r\n preSelectionRange = range.cloneRange(),\r\n start;\r\n\r\n preSelectionRange.selectNodeContents(containerEl);\r\n preSelectionRange.setEnd(range.startContainer, range.startOffset);\r\n\r\n start = preSelectionRange.toString().length;\r\n\r\n return {\r\n start: start,\r\n end: start + range.toString().length\r\n };\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * Sets to previous selection (Range)\r\n *\r\n * @param {Element} containerEl - editable element where we restore range\r\n * @param {Object} savedSel - range basic information to restore\r\n */\r\n inline.restoreSelection = function (containerEl, savedSel) {\r\n var range = document.createRange(),\r\n charIndex = 0;\r\n\r\n range.setStart(containerEl, 0);\r\n range.collapse(true);\r\n\r\n var nodeStack = [ containerEl ],\r\n node,\r\n foundStart = false,\r\n stop = false,\r\n nextCharIndex;\r\n\r\n while (!stop && (node = nodeStack.pop())) {\r\n if (node.nodeType == 3) {\r\n nextCharIndex = charIndex + node.length;\r\n\r\n if (!foundStart && savedSel.start >= charIndex && savedSel.start <= nextCharIndex) {\r\n range.setStart(node, savedSel.start - charIndex);\r\n foundStart = true;\r\n }\r\n if (foundStart && savedSel.end >= charIndex && savedSel.end <= nextCharIndex) {\r\n range.setEnd(node, savedSel.end - charIndex);\r\n stop = true;\r\n }\r\n charIndex = nextCharIndex;\r\n } else {\r\n var i = node.childNodes.length;\r\n\r\n while (i--) {\r\n nodeStack.push(node.childNodes[i]);\r\n }\r\n }\r\n }\r\n\r\n var sel = window.getSelection();\r\n\r\n sel.removeAllRanges();\r\n sel.addRange(range);\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * Removes all ranges from window selection\r\n */\r\n inline.clearRange = function () {\r\n var selection = window.getSelection();\r\n\r\n selection.removeAllRanges();\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * sets or removes hightlight\r\n */\r\n inline.hightlight = function (tool) {\r\n var dataType = tool.dataset.type;\r\n\r\n if (document.queryCommandState(dataType)) {\r\n editor.toolbar.inline.setButtonHighlighted(tool);\r\n } else {\r\n editor.toolbar.inline.removeButtonsHighLight(tool);\r\n }\r\n\r\n /**\r\n *\r\n * hightlight for anchors\r\n */\r\n var selection = window.getSelection(),\r\n tag = selection.anchorNode.parentNode;\r\n\r\n if (tag.tagName == 'A' && dataType == 'link') {\r\n editor.toolbar.inline.setButtonHighlighted(tool);\r\n }\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * Mark button if text is already executed\r\n */\r\n inline.setButtonHighlighted = function (button) {\r\n button.classList.add('hightlighted');\r\n\r\n /** At link tool we also change icon */\r\n if (button.dataset.type == 'link') {\r\n var icon = button.childNodes[0];\r\n\r\n icon.classList.remove('ce-icon-link');\r\n icon.classList.add('ce-icon-unlink');\r\n }\r\n };\r\n\r\n /**\r\n * @private\r\n *\r\n * Removes hightlight\r\n */\r\n inline.removeButtonsHighLight = function (button) {\r\n button.classList.remove('hightlighted');\r\n\r\n /** At link tool we also change icon */\r\n if (button.dataset.type == 'link') {\r\n var icon = button.childNodes[0];\r\n\r\n icon.classList.remove('ce-icon-unlink');\r\n icon.classList.add('ce-icon-link');\r\n }\r\n };\r\n\r\n\r\n return inline;\r\n})({});","/**\r\n * Toolbar settings\r\n *\r\n * @version 1.0.5\r\n */\r\n\r\nmodule.exports = (function (settings) {\r\n let editor = codex.editor;\r\n\r\n settings.opened = false;\r\n\r\n settings.setting = null;\r\n settings.actions = null;\r\n\r\n /**\r\n * Append and open settings\r\n */\r\n settings.open = function (toolType) {\r\n /**\r\n * Append settings content\r\n * It's stored in tool.settings\r\n */\r\n if ( !editor.tools[toolType] || !editor.tools[toolType].renderSettings ) {\r\n return;\r\n }\r\n\r\n /**\r\n * Draw settings block\r\n */\r\n var settingsBlock = editor.tools[toolType].renderSettings();\r\n\r\n editor.nodes.pluginSettings.appendChild(settingsBlock);\r\n\r\n\r\n /** Open settings block */\r\n editor.nodes.blockSettings.classList.add('opened');\r\n this.opened = true;\r\n };\r\n\r\n /**\r\n * Close and clear settings\r\n */\r\n settings.close = function () {\r\n editor.nodes.blockSettings.classList.remove('opened');\r\n editor.nodes.pluginSettings.innerHTML = '';\r\n\r\n this.opened = false;\r\n };\r\n\r\n /**\r\n * @param {string} toolType - plugin type\r\n */\r\n settings.toggle = function ( toolType ) {\r\n if ( !this.opened ) {\r\n this.open(toolType);\r\n } else {\r\n this.close();\r\n }\r\n };\r\n\r\n /**\r\n * Here we will draw buttons and add listeners to components\r\n */\r\n settings.makeRemoveBlockButton = function () {\r\n var removeBlockWrapper = editor.draw.node('SPAN', 'ce-toolbar__remove-btn', {}),\r\n settingButton = editor.draw.node('SPAN', 'ce-toolbar__remove-setting', { innerHTML : '' }),\r\n actionWrapper = editor.draw.node('DIV', 'ce-toolbar__remove-confirmation', {}),\r\n confirmAction = editor.draw.node('DIV', 'ce-toolbar__remove-confirm', { textContent : 'Удалить блок' }),\r\n cancelAction = editor.draw.node('DIV', 'ce-toolbar__remove-cancel', { textContent : 'Отмена' });\r\n\r\n editor.listeners.add(settingButton, 'click', editor.toolbar.settings.removeButtonClicked, false);\r\n\r\n editor.listeners.add(confirmAction, 'click', editor.toolbar.settings.confirmRemovingRequest, false);\r\n\r\n editor.listeners.add(cancelAction, 'click', editor.toolbar.settings.cancelRemovingRequest, false);\r\n\r\n actionWrapper.appendChild(confirmAction);\r\n actionWrapper.appendChild(cancelAction);\r\n\r\n removeBlockWrapper.appendChild(settingButton);\r\n removeBlockWrapper.appendChild(actionWrapper);\r\n\r\n /** Save setting */\r\n editor.toolbar.settings.setting = settingButton;\r\n editor.toolbar.settings.actions = actionWrapper;\r\n\r\n return removeBlockWrapper;\r\n };\r\n\r\n settings.removeButtonClicked = function () {\r\n var action = editor.toolbar.settings.actions;\r\n\r\n if (action.classList.contains('opened')) {\r\n editor.toolbar.settings.hideRemoveActions();\r\n } else {\r\n editor.toolbar.settings.showRemoveActions();\r\n }\r\n\r\n editor.toolbar.toolbox.close();\r\n editor.toolbar.settings.close();\r\n };\r\n\r\n settings.cancelRemovingRequest = function () {\r\n editor.toolbar.settings.actions.classList.remove('opened');\r\n };\r\n\r\n settings.confirmRemovingRequest = function () {\r\n var currentBlock = editor.content.currentNode,\r\n firstLevelBlocksCount;\r\n\r\n currentBlock.remove();\r\n\r\n firstLevelBlocksCount = editor.nodes.redactor.childNodes.length;\r\n\r\n /**\r\n * If all blocks are removed\r\n */\r\n if (firstLevelBlocksCount === 0) {\r\n /** update currentNode variable */\r\n editor.content.currentNode = null;\r\n\r\n /** Inserting new empty initial block */\r\n editor.ui.addInitialBlock();\r\n }\r\n\r\n editor.ui.saveInputs();\r\n\r\n editor.toolbar.close();\r\n };\r\n\r\n settings.showRemoveActions = function () {\r\n editor.toolbar.settings.actions.classList.add('opened');\r\n };\r\n\r\n settings.hideRemoveActions = function () {\r\n editor.toolbar.settings.actions.classList.remove('opened');\r\n };\r\n\r\n return settings;\r\n})({});\r\n","/**\r\n * Codex Editor toolbar module\r\n *\r\n * Contains:\r\n * - Inline toolbox\r\n * - Toolbox within plus button\r\n * - Settings section\r\n *\r\n * @author Codex Team\r\n * @version 1.0\r\n */\r\n\r\nmodule.exports = (function (toolbar) {\r\n let editor = codex.editor;\r\n\r\n toolbar.settings = require('./settings');\r\n toolbar.inline = require('./inline');\r\n toolbar.toolbox = require('./toolbox');\r\n\r\n /**\r\n * Margin between focused node and toolbar\r\n */\r\n toolbar.defaultToolbarHeight = 49;\r\n\r\n toolbar.defaultOffset = 34;\r\n\r\n toolbar.opened = false;\r\n\r\n toolbar.current = null;\r\n\r\n /**\r\n * @protected\r\n */\r\n toolbar.open = function () {\r\n if (editor.hideToolbar) {\r\n return;\r\n }\r\n\r\n let toolType = editor.content.currentNode.dataset.tool;\r\n\r\n if (!editor.tools[toolType] || !editor.tools[toolType].renderSettings ) {\r\n editor.nodes.showSettingsButton.classList.add('hide');\r\n } else {\r\n editor.nodes.showSettingsButton.classList.remove('hide');\r\n }\r\n\r\n editor.nodes.toolbar.classList.add('opened');\r\n this.opened = true;\r\n };\r\n\r\n /**\r\n * @protected\r\n */\r\n toolbar.close = function () {\r\n editor.nodes.toolbar.classList.remove('opened');\r\n\r\n toolbar.opened = false;\r\n toolbar.current = null;\r\n\r\n for (var button in editor.nodes.toolbarButtons) {\r\n editor.nodes.toolbarButtons[button].classList.remove('selected');\r\n }\r\n\r\n /** Close toolbox when toolbar is not displayed */\r\n editor.toolbar.toolbox.close();\r\n editor.toolbar.settings.close();\r\n };\r\n\r\n toolbar.toggle = function () {\r\n if ( !this.opened ) {\r\n this.open();\r\n } else {\r\n this.close();\r\n }\r\n };\r\n\r\n toolbar.hidePlusButton = function () {\r\n editor.nodes.plusButton.classList.add('hide');\r\n };\r\n\r\n toolbar.showPlusButton = function () {\r\n editor.nodes.plusButton.classList.remove('hide');\r\n };\r\n\r\n /**\r\n * Moving toolbar to the specified node\r\n */\r\n toolbar.move = function () {\r\n /** Close Toolbox when we move toolbar */\r\n editor.toolbar.toolbox.close();\r\n\r\n if (!editor.content.currentNode) {\r\n return;\r\n }\r\n\r\n var newYCoordinate = editor.content.currentNode.offsetTop - (editor.toolbar.defaultToolbarHeight / 2) + editor.toolbar.defaultOffset;\r\n\r\n editor.nodes.toolbar.style.transform = `translate3D(0, ${Math.floor(newYCoordinate)}px, 0)`;\r\n\r\n /** Close trash actions */\r\n editor.toolbar.settings.hideRemoveActions();\r\n };\r\n\r\n return toolbar;\r\n})({});\r\n","/**\r\n * Codex Editor toolbox\r\n *\r\n * All tools be able to appended here\r\n *\r\n * @author Codex Team\r\n * @version 1.0\r\n */\r\n\r\nmodule.exports = (function (toolbox) {\r\n let editor = codex.editor;\r\n\r\n toolbox.opened = false;\r\n toolbox.openedOnBlock = null;\r\n\r\n /** Shows toolbox */\r\n toolbox.open = function () {\r\n /** Close setting if toolbox is opened */\r\n if (editor.toolbar.settings.opened) {\r\n editor.toolbar.settings.close();\r\n }\r\n\r\n /** Add 'toolbar-opened' class for current block **/\r\n toolbox.openedOnBlock = editor.content.currentNode;\r\n toolbox.openedOnBlock.classList.add('toolbar-opened');\r\n\r\n /** display toolbox */\r\n editor.nodes.toolbox.classList.add('opened');\r\n\r\n /** Animate plus button */\r\n editor.nodes.plusButton.classList.add('clicked');\r\n\r\n /** toolbox state */\r\n editor.toolbar.toolbox.opened = true;\r\n };\r\n\r\n /** Closes toolbox */\r\n toolbox.close = function () {\r\n /** Remove 'toolbar-opened' class from current block **/\r\n if (toolbox.openedOnBlock) toolbox.openedOnBlock.classList.remove('toolbar-opened');\r\n toolbox.openedOnBlock = null;\r\n\r\n /** Makes toolbox disappear */\r\n editor.nodes.toolbox.classList.remove('opened');\r\n\r\n /** Rotate plus button */\r\n editor.nodes.plusButton.classList.remove('clicked');\r\n\r\n /** toolbox state */\r\n editor.toolbar.toolbox.opened = false;\r\n\r\n editor.toolbar.current = null;\r\n };\r\n\r\n toolbox.leaf = function () {\r\n let currentTool = editor.toolbar.current,\r\n tools = Object.keys(editor.tools),\r\n barButtons = editor.nodes.toolbarButtons,\r\n nextToolIndex = 0,\r\n toolToSelect,\r\n visibleTool,\r\n tool;\r\n\r\n if ( !currentTool ) {\r\n /** Get first tool from object*/\r\n for(tool in editor.tools) {\r\n if (editor.tools[tool].displayInToolbox) {\r\n break;\r\n }\r\n\r\n nextToolIndex ++;\r\n }\r\n } else {\r\n nextToolIndex = (tools.indexOf(currentTool) + 1) % tools.length;\r\n visibleTool = tools[nextToolIndex];\r\n\r\n while (!editor.tools[visibleTool].displayInToolbox) {\r\n nextToolIndex = (nextToolIndex + 1) % tools.length;\r\n visibleTool = tools[nextToolIndex];\r\n }\r\n }\r\n\r\n toolToSelect = tools[nextToolIndex];\r\n\r\n for ( var button in barButtons ) {\r\n barButtons[button].classList.remove('selected');\r\n }\r\n\r\n barButtons[toolToSelect].classList.add('selected');\r\n editor.toolbar.current = toolToSelect;\r\n };\r\n\r\n /**\r\n * Transforming selected node type into selected toolbar element type\r\n * @param {event} event\r\n */\r\n toolbox.toolClicked = function (event) {\r\n /**\r\n * UNREPLACEBLE_TOOLS this types of tools are forbidden to replace even they are empty\r\n */\r\n var UNREPLACEBLE_TOOLS = ['image', 'link', 'list', 'instagram', 'twitter', 'embed'],\r\n tool = editor.tools[editor.toolbar.current],\r\n workingNode = editor.content.currentNode,\r\n currentInputIndex = editor.caret.inputIndex,\r\n newBlockContent,\r\n appendCallback,\r\n blockData;\r\n\r\n /** Make block from plugin */\r\n newBlockContent = tool.render();\r\n\r\n /** information about block */\r\n blockData = {\r\n block : newBlockContent,\r\n type : tool.type,\r\n stretched : false\r\n };\r\n\r\n if (\r\n workingNode &&\r\n UNREPLACEBLE_TOOLS.indexOf(workingNode.dataset.tool) === -1 &&\r\n workingNode.textContent.trim() === ''\r\n ) {\r\n /** Replace current block */\r\n editor.content.switchBlock(workingNode, newBlockContent, tool.type);\r\n } else {\r\n /** Insert new Block from plugin */\r\n editor.content.insertBlock(blockData);\r\n\r\n /** increase input index */\r\n currentInputIndex++;\r\n }\r\n\r\n /** Fire tool append callback */\r\n appendCallback = tool.appendCallback;\r\n\r\n if (appendCallback && typeof appendCallback == 'function') {\r\n appendCallback.call(event);\r\n }\r\n\r\n window.setTimeout(function () {\r\n /** Set caret to current block */\r\n editor.caret.setToBlock(currentInputIndex);\r\n }, 10);\r\n\r\n\r\n /**\r\n * Changing current Node\r\n */\r\n editor.content.workingNodeChanged();\r\n\r\n /**\r\n * Move toolbar when node is changed\r\n */\r\n editor.toolbar.move();\r\n };\r\n\r\n return toolbox;\r\n})({});","/**\r\n * @module Codex Editor Tools Submodule\r\n *\r\n * Creates Instances from Plugins and binds external config to the instances\r\n */\r\n\r\n/**\r\n * Each Tool must contain the following important objects:\r\n *\r\n * @typedef {Object} ToolConfig {@link docs/tools.md}\r\n * @property {String} iconClassname - this a icon in toolbar\r\n * @property {Boolean} displayInToolbox - will be displayed in toolbox. Default value is TRUE\r\n * @property {Boolean} enableLineBreaks - inserts new block or break lines. Default value is FALSE\r\n * @property {Boolean|String[]} inlineToolbar - Pass `true` to enable the Inline Toolbar with all Tools, all pass an array with specified Tools list |\r\n * @property render @todo add description\r\n * @property save @todo add description\r\n * @property settings @todo add description\r\n * @property validate - method that validates output data before saving\r\n */\r\n\r\n/**\r\n * @typedef {Function} Tool {@link docs/tools.md}\r\n * @property {Boolean} displayInToolbox - By default, tools won't be added in the Toolbox. Pass true to add.\r\n * @property {String} iconClassName - CSS class name for the Toolbox button\r\n * @property {Boolean} irreplaceable - Toolbox behaviour: replace or add new block below\r\n * @property render\r\n * @property save\r\n * @property settings\r\n * @property validate\r\n *\r\n * @todo update according to current API\r\n * @todo describe Tool in the {@link docs/tools.md}\r\n */\r\n\r\n/**\r\n * Class properties:\r\n *\r\n * @typedef {Tools} Tools\r\n * @property {Tools[]} toolsAvailable - available Tools\r\n * @property {Tools[]} toolsUnavailable - unavailable Tools\r\n * @property {Object} toolsClasses - all classes\r\n * @property {EditorConfig} config - Editor config\r\n */\r\nexport default class Tools extends Module {\r\n /**\r\n * Returns available Tools\r\n * @return {Tool[]}\r\n */\r\n get available() {\r\n return this.toolsAvailable;\r\n }\r\n\r\n /**\r\n * Returns unavailable Tools\r\n * @return {Tool[]}\r\n */\r\n get unavailable() {\r\n return this.toolsUnavailable;\r\n }\r\n\r\n /**\r\n * Return Tools for the Inline Toolbar\r\n * @return {Array} - array of Inline Tool's classes\r\n */\r\n get inline() {\r\n return Object.values(this.available).filter( tool => {\r\n if (!tool[this.apiSettings.IS_INLINE]) {\r\n return false;\r\n }\r\n\r\n /**\r\n * Some Tools validation\r\n */\r\n const inlineToolRequiredMethods = ['render', 'surround', 'checkState'];\r\n const notImplementedMethods = inlineToolRequiredMethods.filter( method => !new tool()[method] );\r\n\r\n if (notImplementedMethods.length) {\r\n _.log(`Incorrect Inline Tool: ${tool.name}. Some of required methods is not implemented %o`, 'warn', notImplementedMethods);\r\n return false;\r\n }\r\n\r\n return true;\r\n });\r\n }\r\n\r\n /**\r\n * Return editor block tools\r\n */\r\n get blockTools() {\r\n // eslint-disable-next-line no-unused-vars\r\n const tools = Object.entries(this.available).filter( ([name, tool]) => {\r\n if (tool[this.apiSettings.IS_INLINE]) {\r\n return false;\r\n }\r\n\r\n return true;\r\n });\r\n\r\n const result = {};\r\n\r\n tools.forEach(([name, tool]) => result[name] = tool);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Constant for available Tools Settings\r\n * @return {object}\r\n */\r\n get apiSettings() {\r\n return {\r\n IS_INLINE: 'isInline',\r\n TOOLBAR_ICON_CLASS: 'iconClassName',\r\n IS_DISPLAYED_IN_TOOLBOX: 'displayInToolbox',\r\n IS_ENABLED_LINE_BREAKS: 'enableLineBreaks',\r\n IS_IRREPLACEBLE_TOOL: 'irreplaceable',\r\n IS_ENABLED_INLINE_TOOLBAR: 'inlineToolbar',\r\n IS_PASTE_DISALLOWED: 'disallowPaste'\r\n };\r\n }\r\n\r\n /**\r\n * Static getter for default Tool config fields\r\n * @return {ToolConfig}\r\n */\r\n get defaultConfig() {\r\n return {\r\n [this.apiSettings.TOOLBAR_ICON_CLASS] : false,\r\n [this.apiSettings.IS_DISPLAYED_IN_TOOLBOX] : false,\r\n [this.apiSettings.IS_ENABLED_LINE_BREAKS] : false,\r\n [this.apiSettings.IS_IRREPLACEBLE_TOOL] : false,\r\n [this.apiSettings.IS_ENABLED_INLINE_TOOLBAR]: false,\r\n };\r\n }\r\n\r\n /**\r\n * @constructor\r\n *\r\n * @param {EditorConfig} config\r\n */\r\n constructor({config}) {\r\n super({config});\r\n\r\n /**\r\n * Map {name: Class, ...} where:\r\n * name — block type name in JSON. Got from EditorConfig.tools keys\r\n * @type {Object}\r\n */\r\n this.toolClasses = {};\r\n\r\n /**\r\n * Available tools list\r\n * {name: Class, ...}\r\n * @type {Object}\r\n */\r\n this.toolsAvailable = {};\r\n\r\n /**\r\n * Tools that rejected a prepare method\r\n * {name: Class, ... }\r\n * @type {Object}\r\n */\r\n this.toolsUnavailable = {};\r\n }\r\n\r\n /**\r\n * Creates instances via passed or default configuration\r\n * @return {Promise}\r\n */\r\n prepare() {\r\n if (!this.config.hasOwnProperty('tools')) {\r\n return Promise.reject(\"Can't start without tools\");\r\n }\r\n\r\n for(let toolName in this.config.tools) {\r\n this.toolClasses[toolName] = this.config.tools[toolName];\r\n }\r\n\r\n /**\r\n * getting classes that has prepare method\r\n */\r\n let sequenceData = this.getListOfPrepareFunctions();\r\n\r\n /**\r\n * if sequence data contains nothing then resolve current chain and run other module prepare\r\n */\r\n if (sequenceData.length === 0) {\r\n return Promise.resolve();\r\n }\r\n\r\n /**\r\n * to see how it works {@link Util#sequence}\r\n */\r\n return _.sequence(sequenceData, (data) => {\r\n this.success(data);\r\n }, (data) => {\r\n this.fallback(data);\r\n });\r\n }\r\n\r\n /**\r\n * Binds prepare function of plugins with user or default config\r\n * @return {Array} list of functions that needs to be fired sequentially\r\n */\r\n getListOfPrepareFunctions() {\r\n let toolPreparationList = [];\r\n\r\n for(let toolName in this.toolClasses) {\r\n let toolClass = this.toolClasses[toolName];\r\n\r\n if (typeof toolClass.prepare === 'function') {\r\n toolPreparationList.push({\r\n function : toolClass.prepare,\r\n data : {\r\n toolName\r\n }\r\n });\r\n } else {\r\n /**\r\n * If Tool hasn't a prepare method, mark it as available\r\n */\r\n this.toolsAvailable[toolName] = toolClass;\r\n }\r\n }\r\n\r\n return toolPreparationList;\r\n }\r\n\r\n /**\r\n * @param {ChainData.data} data - append tool to available list\r\n */\r\n success(data) {\r\n this.toolsAvailable[data.toolName] = this.toolClasses[data.toolName];\r\n }\r\n\r\n /**\r\n * @param {ChainData.data} data - append tool to unavailable list\r\n */\r\n fallback(data) {\r\n this.toolsUnavailable[data.toolName] = this.toolClasses[data.toolName];\r\n }\r\n\r\n /**\r\n * Return tool`a instance\r\n *\r\n * @param {String} tool — tool name\r\n * @param {Object} data — initial data\r\n *\r\n * @todo throw exceptions if tool doesnt exist\r\n *\r\n */\r\n construct(tool, data) {\r\n let plugin = this.toolClasses[tool],\r\n config = this.config.toolsConfig[tool];\r\n\r\n let instance = new plugin(data, config || {});\r\n\r\n return instance;\r\n }\r\n\r\n /**\r\n * Check if passed Tool is an instance of Initial Block Tool\r\n * @param {Tool} tool - Tool to check\r\n * @return {Boolean}\r\n */\r\n isInitial(tool) {\r\n return tool instanceof this.available[this.config.initialBlock];\r\n }\r\n}\r\n","/**\r\n * Module UI\r\n *\r\n * @type {UI}\r\n */\r\n\r\n/**\r\n * Prebuilded sprite of SVG icons\r\n */\r\nimport sprite from '../../../build/sprite.svg';\r\nimport Selection from '../selection';\r\n\r\n/**\r\n * @class\r\n *\r\n * @classdesc Makes CodeX Editor UI:\r\n * \r\n * \r\n * \r\n * \r\n * \r\n *\r\n * @typedef {UI} UI\r\n * @property {EditorConfig} config - editor configuration {@link CodexEditor#configuration}\r\n * @property {Object} Editor - available editor modules {@link CodexEditor#moduleInstances}\r\n * @property {Object} nodes -\r\n * @property {Element} nodes.holder - element where we need to append redactor\r\n * @property {Element} nodes.wrapper - \r\n * @property {Element} nodes.redactor - \r\n */\r\nexport default class UI extends Module {\r\n /**\r\n * @constructor\r\n *\r\n * @param {EditorConfig} config\r\n */\r\n constructor({config}) {\r\n super({config});\r\n\r\n this.nodes = {\r\n holder: null,\r\n wrapper: null,\r\n redactor: null\r\n };\r\n }\r\n\r\n /**\r\n * Making main interface\r\n */\r\n async prepare() {\r\n await this.make();\r\n\r\n /**\r\n * Append SVG sprite\r\n */\r\n await this.appendSVGSprite();\r\n\r\n /**\r\n * Make toolbar\r\n */\r\n await this.Editor.Toolbar.make();\r\n\r\n /**\r\n * Make the Inline toolbar\r\n */\r\n await this.Editor.InlineToolbar.make();\r\n\r\n /**\r\n * Load and append CSS\r\n */\r\n await this.loadStyles();\r\n\r\n /**\r\n * Bind events for the UI elements\r\n */\r\n await this.bindEvents();\r\n }\r\n\r\n /**\r\n * CodeX Editor UI CSS class names\r\n * @return {{editorWrapper: string, editorZone: string, block: string}}\r\n */\r\n get CSS() {\r\n return {\r\n editorWrapper : 'codex-editor',\r\n editorZone : 'codex-editor__redactor',\r\n };\r\n }\r\n\r\n /**\r\n * Makes CodeX Editor interface\r\n * @return {Promise}\r\n */\r\n async make() {\r\n /**\r\n * Element where we need to append CodeX Editor\r\n * @type {Element}\r\n */\r\n this.nodes.holder = document.getElementById(this.config.holderId);\r\n\r\n if (!this.nodes.holder) {\r\n throw Error(\"Holder wasn't found by ID: #\" + this.config.holderId);\r\n }\r\n\r\n /**\r\n * Create and save main UI elements\r\n */\r\n this.nodes.wrapper = $.make('div', this.CSS.editorWrapper);\r\n this.nodes.redactor = $.make('div', this.CSS.editorZone);\r\n\r\n this.nodes.wrapper.appendChild(this.nodes.redactor);\r\n this.nodes.holder.appendChild(this.nodes.wrapper);\r\n }\r\n\r\n /**\r\n * Appends CSS\r\n */\r\n loadStyles() {\r\n /**\r\n * Load CSS\r\n */\r\n let styles = require('../../styles/main.css');\r\n\r\n /**\r\n * Make tag\r\n */\r\n let tag = $.make('style', null, {\r\n textContent: styles.toString()\r\n });\r\n\r\n /**\r\n * Append styles\r\n */\r\n $.append(document.head, tag);\r\n }\r\n\r\n /**\r\n * Bind events on the CodeX Editor interface\r\n */\r\n bindEvents() {\r\n this.Editor.Listeners.on(this.nodes.redactor, 'click', event => this.redactorClicked(event), false );\r\n this.Editor.Listeners.on(document, 'keydown', event => this.documentKeydown(event), true );\r\n this.Editor.Listeners.on(document, 'click', event => this.documentClicked(event), false );\r\n }\r\n\r\n /**\r\n * All keydowns on document\r\n * @param event\r\n */\r\n documentKeydown(event) {\r\n switch (event.keyCode) {\r\n case _.keyCodes.ENTER:\r\n this.enterPressed(event);\r\n break;\r\n\r\n default:\r\n this.defaultBehaviour(event);\r\n break;\r\n }\r\n }\r\n\r\n /**\r\n * Ignore all other document's keydown events\r\n * @param {KeyboardEvent} event\r\n */\r\n defaultBehaviour(event) {\r\n const keyDownOnEditor = event.target.closest(`.${this.CSS.editorWrapper}`);\r\n\r\n /**\r\n * Ignore keydowns on document\r\n * clear pointer and close toolbar\r\n */\r\n if (!keyDownOnEditor) {\r\n /**\r\n * Remove all highlights and remove caret\r\n */\r\n this.Editor.BlockManager.dropPointer();\r\n\r\n /**\r\n * Close Toolbar\r\n */\r\n this.Editor.Toolbar.close();\r\n }\r\n }\r\n\r\n /**\r\n * Enter pressed on document\r\n * @param event\r\n */\r\n enterPressed(event) {\r\n let hasPointerToBlock = this.Editor.BlockManager.currentBlockIndex >= 0;\r\n\r\n /**\r\n * If Selection is out of Editor and document has some selection\r\n */\r\n if (!Selection.isAtEditor && Selection.anchorNode) {\r\n return;\r\n }\r\n\r\n /**\r\n * If there is no selection (caret is not placed) and BlockManager points some to Block\r\n */\r\n if (hasPointerToBlock && !Selection.anchorNode) {\r\n /**\r\n * Insert initial typed Block\r\n */\r\n this.Editor.BlockManager.insert();\r\n this.Editor.BlockManager.highlightCurrentNode();\r\n\r\n /**\r\n * Move toolbar and show plus button because new Block is empty\r\n */\r\n this.Editor.Toolbar.move();\r\n this.Editor.Toolbar.plusButton.show();\r\n }\r\n }\r\n\r\n /**\r\n * All clicks on document\r\n * @param {MouseEvent} event - Click\r\n */\r\n documentClicked(event) {\r\n /**\r\n * Close Inline Toolbar when nothing selected\r\n * Do not fire check on clicks at the Inline Toolbar buttons\r\n */\r\n const clickedOnInlineToolbarButton = event.target.closest(`.${this.Editor.InlineToolbar.CSS.inlineToolbar}`);\r\n const clickedInsideofEditor = event.target.closest(`.${this.CSS.editorWrapper}`);\r\n\r\n /** Clear highlightings and pointer on BlockManager */\r\n if (!clickedInsideofEditor) {\r\n this.Editor.BlockManager.dropPointer();\r\n this.Editor.Toolbar.close();\r\n }\r\n\r\n if (!clickedOnInlineToolbarButton) {\r\n this.Editor.InlineToolbar.handleShowingEvent(event);\r\n }\r\n }\r\n\r\n /**\r\n * All clicks on the redactor zone\r\n *\r\n * @param {MouseEvent} event\r\n *\r\n * @description\r\n * 1. Save clicked Block as a current {@link BlockManager#currentNode}\r\n * it uses for the following:\r\n * - add CSS modifier for the selected Block\r\n * - on Enter press, we make a new Block under that\r\n *\r\n * 2. Move and show the Toolbar\r\n *\r\n * 3. Set a Caret\r\n *\r\n * 4. By clicks on the Editor's bottom zone:\r\n * - if last Block is empty, set a Caret to this\r\n * - otherwise, add a new empty Block and set a Caret to that\r\n *\r\n * 5. Hide the Inline Toolbar\r\n *\r\n * @see selectClickedBlock\r\n *\r\n */\r\n redactorClicked(event) {\r\n let clickedNode = event.target;\r\n\r\n /**\r\n * Select clicked Block as Current\r\n */\r\n try {\r\n /**\r\n * Renew Current Block\r\n */\r\n this.Editor.BlockManager.setCurrentBlockByChildNode(clickedNode);\r\n\r\n /**\r\n * Highlight Current Node\r\n */\r\n this.Editor.BlockManager.highlightCurrentNode();\r\n } catch (e) {\r\n /**\r\n * If clicked outside first-level Blocks, set Caret to the last empty Block\r\n */\r\n this.Editor.Caret.setToTheLastBlock();\r\n }\r\n\r\n /**\r\n * Move toolbar and open\r\n */\r\n this.Editor.Toolbar.move();\r\n this.Editor.Toolbar.open();\r\n\r\n /**\r\n * Hide the Plus Button\r\n * */\r\n this.Editor.Toolbar.plusButton.hide();\r\n\r\n /**\r\n * Show the Plus Button if:\r\n * - Block is an initial-block (Text)\r\n * - Block is empty\r\n */\r\n let isInitialBlock = this.Editor.Tools.isInitial(this.Editor.BlockManager.currentBlock.tool),\r\n isEmptyBlock = this.Editor.BlockManager.currentBlock.isEmpty;\r\n\r\n if (isInitialBlock && isEmptyBlock) {\r\n this.Editor.Toolbar.plusButton.show();\r\n }\r\n }\r\n\r\n /**\r\n * Append prebuilded sprite with SVG icons\r\n */\r\n appendSVGSprite() {\r\n let spriteHolder = $.make('div');\r\n\r\n spriteHolder.innerHTML = sprite;\r\n\r\n $.append(this.nodes.wrapper, spriteHolder);\r\n }\r\n}\r\n\r\n// /**\r\n// * Codex Editor UI module\r\n// *\r\n// * @author Codex Team\r\n// * @version 1.2.0\r\n// */\r\n//\r\n// module.exports = (function (ui) {\r\n//\r\n// let editor = codex.editor;\r\n//\r\n// /**\r\n// * Basic editor classnames\r\n// */\r\n// ui.prepare = function () {\r\n//\r\n\r\n//\r\n// };\r\n//\r\n// /** Draw notifications holder */\r\n// var makeNotificationHolder_ = function () {\r\n//\r\n// /** Append block with notifications to the document */\r\n// editor.nodes.notifications = editor.notifications.createHolder();\r\n//\r\n// };\r\n//\r\n//\r\n// var addInlineToolbarTools_ = function () {\r\n//\r\n// var tools = {\r\n//\r\n// bold: {\r\n// icon : 'ce-icon-bold',\r\n// command : 'bold'\r\n// },\r\n//\r\n// italic: {\r\n// icon : 'ce-icon-italic',\r\n// command : 'italic'\r\n// },\r\n//\r\n// link: {\r\n// icon : 'ce-icon-link',\r\n// command : 'createLink'\r\n// }\r\n// };\r\n//\r\n// var toolButton,\r\n// tool;\r\n//\r\n// for(var name in tools) {\r\n//\r\n// tool = tools[name];\r\n//\r\n// toolButton = editor.draw.toolbarButtonInline(name, tool.icon);\r\n//\r\n// editor.nodes.inlineToolbar.buttons.appendChild(toolButton);\r\n// /**\r\n// * Add callbacks to this buttons\r\n// */\r\n// editor.ui.setInlineToolbarButtonBehaviour(toolButton, tool.command);\r\n//\r\n// }\r\n//\r\n// };\r\n//\r\n// /**\r\n// * @private\r\n// * Bind editor UI events\r\n// */\r\n// var bindEvents_ = function () {\r\n//\r\n// editor.core.log('ui.bindEvents fired', 'info');\r\n//\r\n// // window.addEventListener('error', function (errorMsg, url, lineNumber) {\r\n// // editor.notifications.errorThrown(errorMsg, event);\r\n// // }, false );\r\n//\r\n// /** All keydowns on Document */\r\n// editor.listeners.add(document, 'keydown', editor.callback.globalKeydown, false);\r\n//\r\n// /** All keydowns on Redactor zone */\r\n// editor.listeners.add(editor.nodes.redactor, 'keydown', editor.callback.redactorKeyDown, false);\r\n//\r\n// /** All keydowns on Document */\r\n// editor.listeners.add(document, 'keyup', editor.callback.globalKeyup, false );\r\n//\r\n// /**\r\n// * Mouse click to radactor\r\n// */\r\n// editor.listeners.add(editor.nodes.redactor, 'click', editor.callback.redactorClicked, false );\r\n//\r\n// /**\r\n// * Clicks to the Plus button\r\n// */\r\n// editor.listeners.add(editor.nodes.plusButton, 'click', editor.callback.plusButtonClicked, false);\r\n//\r\n// /**\r\n// * Clicks to SETTINGS button in toolbar\r\n// */\r\n// editor.listeners.add(editor.nodes.showSettingsButton, 'click', editor.callback.showSettingsButtonClicked, false );\r\n//\r\n// /** Bind click listeners on toolbar buttons */\r\n// for (var button in editor.nodes.toolbarButtons) {\r\n//\r\n// editor.listeners.add(editor.nodes.toolbarButtons[button], 'click', editor.callback.toolbarButtonClicked, false);\r\n//\r\n// }\r\n//\r\n// };\r\n//\r\n// ui.addBlockHandlers = function (block) {\r\n//\r\n// if (!block) return;\r\n//\r\n// /**\r\n// * Block keydowns\r\n// */\r\n// editor.listeners.add(block, 'keydown', editor.callback.blockKeydown, false);\r\n//\r\n// /**\r\n// * Pasting content from another source\r\n// * We have two type of sanitization\r\n// * First - uses deep-first search algorithm to get sub nodes,\r\n// * sanitizes whole Block_content and replaces cleared nodes\r\n// * This method is deprecated\r\n// * Method is used in editor.callback.blockPaste(event)\r\n// *\r\n// * Secont - uses Mutation observer.\r\n// * Observer \"observe\" DOM changes and send changings to callback.\r\n// * Callback gets changed node, not whole Block_content.\r\n// * Inserted or changed node, which we've gotten have been cleared and replaced with diry node\r\n// *\r\n// * Method is used in editor.callback.blockPasteViaSanitize(event)\r\n// *\r\n// * @uses html-janitor\r\n// * @example editor.callback.blockPasteViaSanitize(event), the second method.\r\n// *\r\n// */\r\n// editor.listeners.add(block, 'paste', editor.paste.blockPasteCallback, false);\r\n//\r\n// /**\r\n// * Show inline toolbar for selected text\r\n// */\r\n// editor.listeners.add(block, 'mouseup', editor.toolbar.inline.show, false);\r\n// editor.listeners.add(block, 'keyup', editor.toolbar.inline.show, false);\r\n//\r\n// };\r\n//\r\n// /** getting all contenteditable elements */\r\n// ui.saveInputs = function () {\r\n//\r\n// var redactor = editor.nodes.redactor;\r\n//\r\n// editor.state.inputs = [];\r\n//\r\n// /** Save all inputs in global variable state */\r\n// var inputs = redactor.querySelectorAll('[contenteditable], input, textarea');\r\n//\r\n// Array.prototype.map.call(inputs, function (current) {\r\n//\r\n// if (!current.type || current.type == 'text' || current.type == 'textarea') {\r\n//\r\n// editor.state.inputs.push(current);\r\n//\r\n// }\r\n//\r\n// });\r\n//\r\n// };\r\n//\r\n// /**\r\n// * Adds first initial block on empty redactor\r\n// */\r\n// ui.addInitialBlock = function () {\r\n//\r\n// var initialBlockType = editor.settings.initialBlockPlugin,\r\n// initialBlock;\r\n//\r\n// if ( !editor.tools[initialBlockType] ) {\r\n//\r\n// editor.core.log('Plugin %o was not implemented and can\\'t be used as initial block', 'warn', initialBlockType);\r\n// return;\r\n//\r\n// }\r\n//\r\n// initialBlock = editor.tools[initialBlockType].render();\r\n//\r\n// initialBlock.setAttribute('data-placeholder', editor.settings.placeholder);\r\n//\r\n// editor.content.insertBlock({\r\n// type : initialBlockType,\r\n// block : initialBlock\r\n// });\r\n//\r\n// editor.content.workingNodeChanged(initialBlock);\r\n//\r\n// };\r\n//\r\n// ui.setInlineToolbarButtonBehaviour = function (button, type) {\r\n//\r\n// editor.listeners.add(button, 'mousedown', function (event) {\r\n//\r\n// editor.toolbar.inline.toolClicked(event, type);\r\n//\r\n// }, false);\r\n//\r\n// };\r\n//\r\n// return ui;\r\n//\r\n// })({});\r\n","/**\r\n * Element.closest()\r\n *\r\n * https://developer.mozilla.org/en-US/docs/Web/API/Element/closest\r\n */\r\nif (!Element.prototype.matches)\r\n Element.prototype.matches = Element.prototype.msMatchesSelector ||\r\n Element.prototype.webkitMatchesSelector;\r\n\r\nif (!Element.prototype.closest)\r\n Element.prototype.closest = function (s) {\r\n var el = this;\r\n\r\n if (!document.documentElement.contains(el)) return null;\r\n do {\r\n if (el.matches(s)) return el;\r\n el = el.parentElement || el.parentNode;\r\n } while (el !== null);\r\n return null;\r\n };\r\n","/**\r\n * Working with selection\r\n * @typedef {Selection} Selection\r\n */\r\nexport default class Selection {\r\n /**\r\n * @constructor\r\n */\r\n constructor() {\r\n this.instance = null;\r\n this.selection = null;\r\n\r\n /**\r\n * This property can store Selection's range for restoring later\r\n * @type {Range|null}\r\n */\r\n this.savedSelectionRange = null;\r\n }\r\n\r\n /**\r\n * Editor styles\r\n * @return {{editorWrapper: string, editorZone: string}}\r\n * @constructor\r\n */\r\n static get CSS() {\r\n return {\r\n editorWrapper : 'codex-editor',\r\n editorZone : 'codex-editor__redactor',\r\n };\r\n }\r\n\r\n /**\r\n * Returns window Selection\r\n * {@link https://developer.mozilla.org/ru/docs/Web/API/Window/getSelection}\r\n * @return {Selection}\r\n */\r\n static get() {\r\n return window.getSelection();\r\n }\r\n\r\n /**\r\n * Returns selected anchor\r\n * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorNode}\r\n * @return {Node|null}\r\n */\r\n static get anchorNode() {\r\n const selection = window.getSelection();\r\n\r\n return selection ? selection.anchorNode : null;\r\n }\r\n\r\n /**\r\n * Returns selection offset according to the anchor node\r\n * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorOffset}\r\n * @return {Number|null}\r\n */\r\n static get anchorOffset() {\r\n const selection = window.getSelection();\r\n\r\n return selection ? selection.anchorOffset : null;\r\n }\r\n\r\n /**\r\n * Is current selection range collapsed\r\n * @return {boolean|null}\r\n */\r\n static get isCollapsed() {\r\n const selection = window.getSelection();\r\n\r\n return selection ? selection.isCollapsed : null;\r\n }\r\n\r\n /**\r\n * Check current selection if it is at Editor's zone\r\n * @return {boolean}\r\n */\r\n static get isAtEditor() {\r\n let selection = Selection.get(),\r\n selectedNode,\r\n editorZone = false;\r\n\r\n /**\r\n * Something selected on document\r\n */\r\n selectedNode = selection.anchorNode || selection.focusNode;\r\n\r\n if (selectedNode && selectedNode.nodeType === Node.TEXT_NODE) {\r\n selectedNode = selectedNode.parentNode;\r\n }\r\n\r\n if (selectedNode) {\r\n editorZone = selectedNode.closest(`.${Selection.CSS.editorZone}`);\r\n }\r\n\r\n /**\r\n * Selection is not out of Editor because Editor's wrapper was found\r\n */\r\n return editorZone && editorZone.nodeType === Node.ELEMENT_NODE;\r\n }\r\n\r\n /**\r\n * Return first range\r\n * @return {Range|null}\r\n */\r\n static get range() {\r\n const selection = window.getSelection();\r\n\r\n return selection && selection.rangeCount ? selection.getRangeAt(0) : null;\r\n }\r\n\r\n /**\r\n * Calculates position and size of selected text\r\n * @return {{x, y, width, height, top?, left?, bottom?, right?}}\r\n */\r\n static get rect() {\r\n let sel = document.selection, range;\r\n let rect = {\r\n x: 0,\r\n y: 0,\r\n width: 0,\r\n height: 0\r\n };\r\n\r\n if (sel && sel.type !== 'Control') {\r\n range = sel.createRange();\r\n rect.x = range.boundingLeft;\r\n rect.y = range.boundingTop;\r\n rect.width = range.boundingWidth;\r\n rect.height = range.boundingHeight;\r\n\r\n return rect;\r\n }\r\n\r\n if (!window.getSelection) {\r\n _.log('Method window.getSelection is not supported', 'warn');\r\n return rect;\r\n }\r\n\r\n sel = window.getSelection();\r\n\r\n if (!sel.rangeCount) {\r\n _.log('Method Selection.rangeCount() is not supported', 'warn');\r\n return rect;\r\n }\r\n\r\n range = sel.getRangeAt(0).cloneRange();\r\n\r\n if (range.getBoundingClientRect) {\r\n rect = range.getBoundingClientRect();\r\n }\r\n // Fall back to inserting a temporary element\r\n if (rect.x === 0 && rect.y === 0) {\r\n let span = document.createElement('span');\r\n\r\n if (span.getBoundingClientRect) {\r\n // Ensure span has dimensions and position by\r\n // adding a zero-width space character\r\n span.appendChild( document.createTextNode('\\u200b') );\r\n range.insertNode(span);\r\n rect = span.getBoundingClientRect();\r\n\r\n let spanParent = span.parentNode;\r\n\r\n spanParent.removeChild(span);\r\n\r\n // Glue any broken text nodes back together\r\n spanParent.normalize();\r\n }\r\n }\r\n\r\n return rect;\r\n }\r\n\r\n /**\r\n * Returns selected text as String\r\n * @returns {string}\r\n */\r\n static get text() {\r\n return window.getSelection ? window.getSelection().toString() : '';\r\n };\r\n\r\n /**\r\n * Save Selection's range\r\n */\r\n save() {\r\n this.savedSelectionRange = Selection.range;\r\n }\r\n\r\n /**\r\n * Restore saved Selection's range\r\n */\r\n restore() {\r\n if (!this.savedSelectionRange) {\r\n return;\r\n }\r\n\r\n const sel = window.getSelection();\r\n\r\n sel.removeAllRanges();\r\n sel.addRange(this.savedSelectionRange);\r\n }\r\n\r\n /**\r\n * Clears saved selection\r\n */\r\n clearSaved() {\r\n this.savedSelectionRange = null;\r\n }\r\n\r\n /**\r\n * Looks ahead to find passed tag from current selection\r\n *\r\n * @param {String} tagName - tag to found\r\n * @param {String} [className] - tag's class name\r\n * @param {Number} [searchDepth] - count of tags that can be included. For better performance.\r\n * @return {HTMLElement|null}\r\n */\r\n findParentTag(tagName, className, searchDepth = 10) {\r\n let selection = window.getSelection(),\r\n parentTag = null;\r\n\r\n /**\r\n * If selection is missing or no anchorNode or focusNode were found then return null\r\n */\r\n if (!selection || !selection.anchorNode || !selection.focusNode) {\r\n return null;\r\n }\r\n\r\n /**\r\n * Define Nodes for start and end of selection\r\n */\r\n let boundNodes = [\r\n /** the Node in which the selection begins */\r\n selection.anchorNode,\r\n /** the Node in which the selection ends */\r\n selection.focusNode\r\n ];\r\n\r\n /**\r\n * For each selection parent Nodes we try to find target tag [with target class name]\r\n * It would be saved in parentTag variable\r\n */\r\n boundNodes.forEach(parent => {\r\n /** Reset tags limit */\r\n let searchDepthIterable = searchDepth;\r\n\r\n while (searchDepthIterable > 0 && parent.parentNode) {\r\n /**\r\n * Check tag's name\r\n */\r\n if (parent.tagName === tagName) {\r\n /**\r\n * Optional additional check for class-name matching\r\n */\r\n if (className && parent.classList && !parent.classList.contains(className)) {\r\n continue;\r\n }\r\n\r\n /**\r\n * If we have found required tag with class then save the result and go out from cycle\r\n */\r\n parentTag = parent;\r\n break;\r\n }\r\n\r\n /**\r\n * Target tag was not found. Go up to the parent and check it\r\n */\r\n parent = parent.parentNode;\r\n searchDepthIterable--;\r\n }\r\n });\r\n\r\n /**\r\n * Return found tag or null\r\n */\r\n return parentTag;\r\n }\r\n\r\n /**\r\n * Expands selection range to the passed parent node\r\n *\r\n * @param {HTMLElement} node\r\n */\r\n expandToTag(node) {\r\n let selection = window.getSelection();\r\n\r\n selection.removeAllRanges();\r\n let range = document.createRange();\r\n\r\n range.selectNodeContents(node);\r\n selection.addRange(range);\r\n }\r\n}\r\n","/**\r\n * Codex Editor Util\r\n */\r\nexport default class Util {\r\n /**\r\n * Custom logger\r\n *\r\n * @param {string} msg - message\r\n * @param {string} type - logging type 'log'|'warn'|'error'|'info'\r\n * @param {*} args - argument to log with a message\r\n */\r\n static log(msg, type, args) {\r\n type = type || 'log';\r\n\r\n if (!args) {\r\n if (['time', 'timeEnd'].includes(type)) {\r\n msg = `[codex-editor]: ${msg}`;\r\n } else {\r\n args = msg || 'undefined';\r\n msg = '[codex-editor]: %o';\r\n }\r\n } else {\r\n msg = '[codex-editor]: ' + msg;\r\n }\r\n\r\n try{\r\n if ( 'console' in window && window.console[ type ] ) {\r\n if ( args ) window.console[ type ]( msg, args );\r\n else window.console[ type ]( msg );\r\n }\r\n } catch(e) {\r\n // do nothing\r\n }\r\n }\r\n\r\n /**\r\n * Returns basic keycodes as constants\r\n * @return {{}}\r\n */\r\n static get keyCodes() {\r\n return {\r\n BACKSPACE: 8,\r\n TAB: 9,\r\n ENTER: 13,\r\n SHIFT: 16,\r\n CTRL: 17,\r\n ALT: 18,\r\n ESC: 27,\r\n SPACE: 32,\r\n LEFT: 37,\r\n UP: 38,\r\n DOWN: 40,\r\n RIGHT: 39,\r\n DELETE: 46,\r\n META: 91\r\n };\r\n }\r\n\r\n /**\r\n * @typedef {Object} ChainData\r\n * @property {Object} data - data that will be passed to the success or fallback\r\n * @property {Function} function - function's that must be called asynchronically\r\n */\r\n\r\n /**\r\n * Fires a promise sequence asyncronically\r\n *\r\n * @param {Object[]} chains - list or ChainData's\r\n * @param {Function} success - success callback\r\n * @param {Function} fallback - callback that fires in case of errors\r\n *\r\n * @return {Promise}\r\n */\r\n static sequence(chains, success = () => {}, fallback = () => {}) {\r\n return new Promise(function (resolve) {\r\n /**\r\n * pluck each element from queue\r\n * First, send resolved Promise as previous value\r\n * Each plugins \"prepare\" method returns a Promise, that's why\r\n * reduce current element will not be able to continue while can't get\r\n * a resolved Promise\r\n */\r\n chains.reduce(function (previousValue, currentValue, iteration) {\r\n return previousValue\r\n .then(() => waitNextBlock(currentValue, success, fallback))\r\n .then(() => {\r\n // finished\r\n if (iteration === chains.length - 1) {\r\n resolve();\r\n }\r\n });\r\n }, Promise.resolve());\r\n });\r\n\r\n /**\r\n * Decorator\r\n *\r\n * @param {ChainData} chainData\r\n *\r\n * @param {Function} successCallback\r\n * @param {Function} fallbackCallback\r\n *\r\n * @return {Promise}\r\n */\r\n function waitNextBlock(chainData, successCallback, fallbackCallback) {\r\n return new Promise(function (resolve) {\r\n chainData.function()\r\n .then(() => {\r\n successCallback(chainData.data || {});\r\n })\r\n .then(resolve)\r\n .catch(function () {\r\n fallbackCallback(chainData.data || {});\r\n\r\n // anyway, go ahead even it falls\r\n resolve();\r\n });\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Make array from array-like collection\r\n *\r\n * @param {*} collection\r\n *\r\n * @return {Array}\r\n */\r\n static array(collection) {\r\n return Array.prototype.slice.call(collection);\r\n }\r\n\r\n /**\r\n * Checks if object is empty\r\n *\r\n * @param {Object} object\r\n * @return {boolean}\r\n */\r\n static isEmpty(object) {\r\n return Object.keys(object).length === 0 && object.constructor === Object;\r\n }\r\n\r\n /**\r\n * Check if passed object is a Promise\r\n * @param {*} object - object to check\r\n * @return {Boolean}\r\n */\r\n static isPromise(object) {\r\n return Promise.resolve(object) === object;\r\n }\r\n\r\n /**\r\n * Check if passed element is contenteditable\r\n * @param element\r\n * @return {boolean}\r\n */\r\n static isContentEditable(element) {\r\n return element.contentEditable === 'true';\r\n }\r\n\r\n /**\r\n * Delays method execution\r\n *\r\n * @param method\r\n * @param timeout\r\n */\r\n static delay(method, timeout) {\r\n return function () {\r\n let context = this,\r\n args = arguments;\r\n\r\n window.setTimeout(() => method.apply(context, args), timeout);\r\n };\r\n }\r\n};\r\n","exports = module.exports = require(\"../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \":root {\\r\\n /**\\r\\n * Selection color\\r\\n */\\r\\n --selectionColor: rgba(61,166,239,0.63);\\r\\n\\r\\n /**\\r\\n * Toolbar buttons\\r\\n */\\r\\n --bg-light: #eff2f5;\\r\\n\\r\\n /**\\r\\n * All gray texts: placeholders, settings\\r\\n */\\r\\n --grayText: #707684;\\r\\n\\r\\n /** Blue icons */\\r\\n --color-active-icon: #388AE5;\\r\\n\\r\\n /**\\r\\n * Block content width\\r\\n */\\r\\n --content-width: 650px;\\r\\n\\r\\n /**\\r\\n * Toolbar buttons height and width\\r\\n */\\r\\n --toolbar-buttons-size: 34px;\\r\\n\\r\\n /**\\r\\n * Toolbar Plus Button and Toolbox buttons height and width\\r\\n */\\r\\n --toolbox-buttons-size: 20px;\\r\\n\\r\\n /**\\r\\n * Confirm deletion bg\\r\\n */\\r\\n --color-confirm: #E24A4A;\\r\\n}\\r\\n/**\\r\\n* Editor wrapper\\r\\n*/\\r\\n.codex-editor {\\r\\n position: relative;\\r\\n box-sizing: border-box;\\r\\n}\\r\\n.codex-editor .hide {\\r\\n display: none;\\r\\n }\\r\\n.codex-editor__redactor {\\r\\n padding-bottom: 300px;\\r\\n }\\r\\n.codex-editor svg {\\r\\n fill: currentColor;\\r\\n vertical-align: middle;\\r\\n max-height: 100%;\\r\\n }\\r\\n/**\\r\\n * Set color for native selection\\r\\n */\\r\\n::-moz-selection{\\r\\n background-color: rgba(61,166,239,0.63);\\r\\n background-color: var(--selectionColor);\\r\\n}\\r\\n::selection{\\r\\n background-color: rgba(61,166,239,0.63);\\r\\n background-color: var(--selectionColor);\\r\\n}\\r\\n/**\\r\\n * Add placeholder to content editable elements with data attribute\\r\\n * data-placeholder=\\\"Hello world!\\\"\\r\\n */\\r\\n[contentEditable=true][data-placeholder]:empty:not(:focus):before{\\r\\n content: attr(data-placeholder);\\r\\n color: #707684;\\r\\n color: var(--grayText);\\r\\n}\\r\\n.ce-toolbar {\\r\\n position: absolute;\\r\\n left: 0;\\r\\n right: 0;\\r\\n top: 0;\\r\\n /*opacity: 0;*/\\r\\n /*visibility: hidden;*/\\r\\n transition: opacity 100ms ease;\\r\\n will-change: opacity, transform;\\r\\n display: none;\\r\\n}\\r\\n.ce-toolbar--opened {\\r\\n display: block;\\r\\n /*opacity: 1;*/\\r\\n /*visibility: visible;*/\\r\\n }\\r\\n.ce-toolbar__content {\\r\\n max-width: 650px;\\r\\n max-width: var(--content-width);\\r\\n margin: 0 auto;\\r\\n position: relative;\\r\\n }\\r\\n.ce-toolbar__plus {\\r\\n color: #707684;\\r\\n color: var(--grayText);\\r\\n cursor: pointer;\\r\\n display: inline-block;\\r\\n width: 20px;\\r\\n width: var(--toolbox-buttons-size);\\r\\n height: 20px;\\r\\n height: var(--toolbox-buttons-size);\\r\\n /*line-height: var(--toolbox-buttons-size);*/\\r\\n display: -ms-flexbox;\\r\\n display: flex;\\r\\n -ms-flex-pack: center;\\r\\n justify-content: center;\\r\\n -ms-flex-align: center;\\r\\n align-items: center\\r\\n }\\r\\n.ce-toolbar__plus:not(:last-of-type){\\r\\n margin-right: 3px;\\r\\n }\\r\\n.ce-toolbar__plus:hover {\\r\\n color: #388AE5;\\r\\n color: var(--color-active-icon);\\r\\n }\\r\\n.ce-toolbar__plus {\\r\\n\\r\\n position: absolute;\\r\\n left: calc(calc(20px + 10px) * -1);\\r\\n left: calc(calc(var(--toolbox-buttons-size) + 10px) * -1);\\r\\n }\\r\\n.ce-toolbar__plus--hidden {\\r\\n display: none;\\r\\n }\\r\\n/**\\r\\n * Block actions Zone\\r\\n * -------------------------\\r\\n */\\r\\n.ce-toolbar__actions {\\r\\n position: absolute;\\r\\n right: 0;\\r\\n top: 0;\\r\\n padding-right: 16px;\\r\\n }\\r\\n.ce-toolbar__actions-buttons {\\r\\n text-align: right;\\r\\n }\\r\\n.ce-toolbar__settings-btn {\\r\\n display: inline-block;\\r\\n width: 24px;\\r\\n height: 24px;\\r\\n color: #707684;\\r\\n color: var(--grayText);\\r\\n cursor: pointer;\\r\\n }\\r\\n.ce-toolbox {\\r\\n position: absolute;\\r\\n visibility: hidden;\\r\\n transition: opacity 100ms ease;\\r\\n will-change: opacity;\\r\\n}\\r\\n.ce-toolbox--opened {\\r\\n opacity: 1;\\r\\n visibility: visible;\\r\\n }\\r\\n.ce-toolbox__button {\\r\\n color: #707684;\\r\\n color: var(--grayText);\\r\\n cursor: pointer;\\r\\n display: inline-block;\\r\\n width: 20px;\\r\\n width: var(--toolbox-buttons-size);\\r\\n height: 20px;\\r\\n height: var(--toolbox-buttons-size);\\r\\n /*line-height: var(--toolbox-buttons-size);*/\\r\\n display: -ms-flexbox;\\r\\n display: flex;\\r\\n -ms-flex-pack: center;\\r\\n justify-content: center;\\r\\n -ms-flex-align: center;\\r\\n align-items: center;\\r\\n }\\r\\n.ce-toolbox__button:not(:last-of-type){\\r\\n margin-right: 3px;\\r\\n }\\r\\n.ce-toolbox__button:hover {\\r\\n color: #388AE5;\\r\\n color: var(--color-active-icon);\\r\\n }\\r\\n.ce-inline-toolbar {\\r\\n position: absolute;\\r\\n background-color: #FFFFFF;\\r\\n box-shadow: 0 8px 23px -6px rgba(21,40,54,0.31), 22px -14px 34px -18px rgba(33,48,73,0.26);\\r\\n border-radius: 4px;\\r\\n z-index: 2\\r\\n}\\r\\n.ce-inline-toolbar::before {\\r\\n content: '';\\r\\n width: 15px;\\r\\n height: 15px;\\r\\n position: absolute;\\r\\n top: -7px;\\r\\n left: 50%;\\r\\n margin-left: -7px;\\r\\n transform: rotate(-45deg);\\r\\n background-color: #fff;\\r\\n z-index: -1;\\r\\n }\\r\\n.ce-inline-toolbar {\\r\\n padding: 6px;\\r\\n transform: translateX(-50%);\\r\\n display: none;\\r\\n box-shadow: 0 6px 12px -6px rgba(131, 147, 173, 0.46),\\r\\n 5px -12px 34px -13px rgba(97, 105, 134, 0.6),\\r\\n 0 26px 52px 3px rgba(147, 165, 186, 0.24);\\r\\n}\\r\\n.ce-inline-toolbar--showed {\\r\\n display: block;\\r\\n }\\r\\n.ce-inline-tool {\\r\\n display: inline-block;\\r\\n width: 34px;\\r\\n height: 34px;\\r\\n line-height: 34px;\\r\\n text-align: center;\\r\\n border-radius: 3px;\\r\\n cursor: pointer;\\r\\n border: 0;\\r\\n outline: none;\\r\\n background-color: transparent;\\r\\n vertical-align: bottom;\\r\\n color: #707684;\\r\\n color: var(--grayText)\\r\\n}\\r\\n.ce-inline-tool:not(:last-of-type){\\r\\n margin-right: 5px;\\r\\n }\\r\\n.ce-inline-tool:hover {\\r\\n background-color: #eff2f5;\\r\\n background-color: var(--bg-light);\\r\\n }\\r\\n.ce-inline-tool {\\r\\n line-height: normal;\\r\\n}\\r\\n.ce-inline-tool--active {\\r\\n color: #388AE5;\\r\\n color: var(--color-active-icon);\\r\\n }\\r\\n.ce-inline-tool--link .icon {\\r\\n margin-top: -2px;\\r\\n }\\r\\n.ce-inline-tool--link .icon--unlink {\\r\\n display: none;\\r\\n }\\r\\n.ce-inline-tool--unlink .icon--link {\\r\\n display: none;\\r\\n }\\r\\n.ce-inline-tool--unlink .icon--unlink {\\r\\n display: inline-block;\\r\\n }\\r\\n.ce-inline-tool-input {\\r\\n background-color: #eff2f5;\\r\\n background-color: var(--bg-light);\\r\\n outline: none;\\r\\n border: 0;\\r\\n border-radius: 3px;\\r\\n margin: 6px 0 0;\\r\\n font-size: 13px;\\r\\n padding: 8px;\\r\\n width: 100%;\\r\\n box-sizing: border-box;\\r\\n display: none\\r\\n }\\r\\n.ce-inline-tool-input::-webkit-input-placeholder {\\r\\n color: #707684;\\r\\n color: var(--grayText);\\r\\n }\\r\\n.ce-inline-tool-input:-ms-input-placeholder {\\r\\n color: #707684;\\r\\n color: var(--grayText);\\r\\n }\\r\\n.ce-inline-tool-input::placeholder {\\r\\n color: #707684;\\r\\n color: var(--grayText);\\r\\n }\\r\\n.ce-inline-tool-input--showed {\\r\\n display: block;\\r\\n }\\r\\n.ce-settings {\\r\\n position: absolute;\\r\\n background-color: #FFFFFF;\\r\\n box-shadow: 0 8px 23px -6px rgba(21,40,54,0.31), 22px -14px 34px -18px rgba(33,48,73,0.26);\\r\\n border-radius: 4px;\\r\\n z-index: 2\\r\\n}\\r\\n.ce-settings::before {\\r\\n content: '';\\r\\n width: 15px;\\r\\n height: 15px;\\r\\n position: absolute;\\r\\n top: -7px;\\r\\n left: 50%;\\r\\n margin-left: -7px;\\r\\n transform: rotate(-45deg);\\r\\n background-color: #fff;\\r\\n z-index: -1;\\r\\n }\\r\\n.ce-settings {\\r\\n right: 5px;\\r\\n top: 35px;\\r\\n min-width: 124px\\r\\n}\\r\\n.ce-settings::before{\\r\\n left: auto;\\r\\n right: 12px;\\r\\n }\\r\\n.ce-settings {\\r\\n\\r\\n display: none;\\r\\n}\\r\\n.ce-settings--opened {\\r\\n display: block;\\r\\n }\\r\\n.ce-settings__plugin-zone:not(:empty){\\r\\n padding: 6px 6px 0;\\r\\n }\\r\\n.ce-settings__default-zone:not(:empty){\\r\\n padding: 6px;\\r\\n }\\r\\n.ce-settings__button {\\r\\n display: inline-block;\\r\\n width: 34px;\\r\\n height: 34px;\\r\\n line-height: 34px;\\r\\n text-align: center;\\r\\n border-radius: 3px;\\r\\n cursor: pointer;\\r\\n border: 0;\\r\\n outline: none;\\r\\n background-color: transparent;\\r\\n vertical-align: bottom;\\r\\n color: #707684;\\r\\n color: var(--grayText)\\r\\n }\\r\\n.ce-settings__button:not(:last-of-type){\\r\\n margin-right: 5px;\\r\\n }\\r\\n.ce-settings__button:hover {\\r\\n background-color: #eff2f5;\\r\\n background-color: var(--bg-light);\\r\\n }\\r\\n.ce-settings__button--active {\\r\\n color: #388AE5;\\r\\n color: var(--color-active-icon);\\r\\n }\\r\\n.ce-settings__button--disabled {\\r\\n cursor: not-allowed !important;\\r\\n opacity: .3;\\r\\n }\\r\\n.ce-settings__button--selected {\\r\\n color: #388AE5;\\r\\n color: var(--color-active-icon);\\r\\n }\\r\\n.ce-settings__button--delete {\\r\\n transition: background-color 300ms ease;\\r\\n will-change: background-color;\\r\\n }\\r\\n.ce-settings__button--delete .icon {\\r\\n transition: transform 200ms ease-out;\\r\\n will-change: transform;\\r\\n }\\r\\n.ce-settings__button--confirm {\\r\\n background-color: #E24A4A;\\r\\n background-color: var(--color-confirm);\\r\\n color: #fff\\r\\n }\\r\\n.ce-settings__button--confirm:hover {\\r\\n background-color: rgb(213, 74, 74) !important;\\r\\n background-color: rgb(213, 74, 74) !important;\\r\\n }\\r\\n.ce-settings__button--confirm .icon {\\r\\n transform: rotate(90deg);\\r\\n }\\r\\n.ce-block:first-of-type {\\r\\n margin-top: 0;\\r\\n }\\r\\n.ce-block--selected {\\r\\n background-image: linear-gradient(17deg, rgba(243, 248, 255, 0.03) 63.45%, rgba(207, 214, 229, 0.27) 98%);\\r\\n border-radius: 3px;\\r\\n }\\r\\n.ce-block__content {\\r\\n max-width: 650px;\\r\\n max-width: var(--content-width);\\r\\n margin: 0 auto;\\r\\n }\\r\\n.wobble {\\r\\n animation-name: wobble;\\r\\n animation-duration: 400ms;\\r\\n}\\r\\n/**\\r\\n * @author Nick Pettit - https://github.com/nickpettit/glide\\r\\n */\\r\\n@keyframes wobble {\\r\\n from {\\r\\n transform: translate3d(0, 0, 0);\\r\\n }\\r\\n\\r\\n 15% {\\r\\n transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -5deg);\\r\\n }\\r\\n\\r\\n 30% {\\r\\n transform: translate3d(2%, 0, 0) rotate3d(0, 0, 1, 3deg);\\r\\n }\\r\\n\\r\\n 45% {\\r\\n transform: translate3d(-3%, 0, 0) rotate3d(0, 0, 1, -3deg);\\r\\n }\\r\\n\\r\\n 60% {\\r\\n transform: translate3d(2%, 0, 0) rotate3d(0, 0, 1, 2deg);\\r\\n }\\r\\n\\r\\n 75% {\\r\\n transform: translate3d(-1%, 0, 0) rotate3d(0, 0, 1, -1deg);\\r\\n }\\r\\n\\r\\n to {\\r\\n transform: translate3d(0, 0, 0);\\r\\n }\\r\\n}\\r\\n\", \"\"]);\n\n// exports\n"],"sourceRoot":""} \ No newline at end of file diff --git a/build/sprite.svg b/build/sprite.svg new file mode 100644 index 00000000..db2abc22 --- /dev/null +++ b/build/sprite.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/codex-editor.js b/codex-editor.js deleted file mode 100644 index ea31f8af..00000000 --- a/codex-editor.js +++ /dev/null @@ -1,3 +0,0 @@ -var codex=codex||{};codex.editor=function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return e[o].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";e.exports=function(e){e.version="1.7.8",e.scriptPrefix="cdx-script-";var t=function(){e.core=n(1),e.tools=n(2),e.ui=n(3),e.transport=n(4),e.renderer=n(5),e.saver=n(6),e.content=n(7),e.toolbar=n(8),e.callback=n(12),e.draw=n(13),e.caret=n(14),e.notifications=n(15),e.parser=n(16),e.sanitizer=n(17),e.listeners=n(19),e.destroyer=n(20),e.paste=n(21)};return e.settings={tools:["paragraph","header","picture","list","quote","code","twitter","instagram","smile"],holderId:"codex-editor",initialBlockPlugin:"paragraph"},e.nodes={holder:null,wrapper:null,toolbar:null,inlineToolbar:{wrapper:null,buttons:null,actions:null},toolbox:null,notifications:null,plusButton:null,showSettingsButton:null,showTrashButton:null,blockSettings:null,pluginSettings:null,defaultSettings:null,toolbarButtons:{},redactor:null},e.state={jsonOutput:[],blocks:[],inputs:[]},e.tools={},e.start=function(n){t(),e.core.prepare(n).then(e.ui.prepare).then(e.tools.prepare).then(e.sanitizer.prepare).then(e.paste.prepare).then(e.transport.prepare).then(e.renderer.makeBlocksFromData).then(e.ui.saveInputs).catch(function(t){e.core.log("Initialization failed with error: %o","warn",t)})},e}({})},function(e,t){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){var t=codex.editor;e.prepare=function(e){return new Promise(function(o,r){e&&(t.settings.tools=e.tools||t.settings.tools),e.data&&(t.state.blocks=e.data),e.initialBlockPlugin&&(t.settings.initialBlockPlugin=e.initialBlockPlugin),e.sanitizer&&(t.settings.sanitizer=e.sanitizer),t.hideToolbar=e.hideToolbar,t.settings.placeholder=e.placeholder||"",t.nodes.holder=document.getElementById(e.holderId||t.settings.holderId),void 0===n(t.nodes.holder)||null===t.nodes.holder?r(Error("Holder wasn't found by ID: #"+e.holderId)):o()})},e.log=function(e,t,n){t=t||"log",n?e="[codex-editor]: "+e:(n=e||"undefined",e="[codex-editor]: %o");try{"console"in window&&window.console[t]&&(n?window.console[t](e,n):window.console[t](e))}catch(e){}},e.insertAfter=function(e,t){e.parentNode.insertBefore(t,e.nextSibling)},e.nodeTypes={TAG:1,TEXT:3,COMMENT:8,DOCUMENT_FRAGMENT:11},e.keys={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,LEFT:37,UP:38,DOWN:40,RIGHT:39,DELETE:46,META:91},e.isDomNode=function(e){return e&&"object"===("undefined"==typeof e?"undefined":n(e))&&e.nodeType&&e.nodeType==this.nodeTypes.TAG},e.isEmpty=function(e){return 0===Object.keys(e).length},e.ajax=function(e){if(e&&e.url){var t,n,r,i=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");if(e.async=!0,e.type=e.type||"GET",e.data=e.data||"",e["content-type"]=e["content-type"]||"application/json; charset=utf-8","GET"==e.type&&e.data)e.url=/\?/.test(e.url)?e.url+"&"+e.data:e.url+"?"+e.data;else{t="";for(r in e.data)t+=r+"="+encodeURIComponent(e.data[r])+"&"}e.withCredentials&&(i.withCredentials=!0);var a=void 0,s=void 0;if("function"!=typeof e.beforeSend||(s=e.beforeSend.call(),s!==!1))return i.open(e.type,e.url,e.async),n=o(e.data),n||("POST"!==e.type?i.setRequestHeader("Content-type",e["content-type"]):i.setRequestHeader("Content-type","application/x-www-form-urlencoded")),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),a=s||i,"function"==typeof e.progress&&(i.upload.onprogress=e.progress.bind(a)),i.onreadystatechange=function(){4===i.readyState&&(200===i.status?"function"==typeof e.success&&e.success.call(a,i.responseText):"function"==typeof e.error&&e.error.call(a,i.responseText,i.status))},n?i.send(e.data):i.send(t),i}},e.importScript=function(e,n){return new Promise(function(o,r){var i=void 0;n?document.getElementById(t.scriptPrefix+n)&&o(e):r("Instance name is missed"),i=document.createElement("SCRIPT"),i.async=!0,i.defer=!0,i.id=t.scriptPrefix+n,i.onload=function(){o(e)},i.onerror=function(){r(e)},i.src=e,document.head.appendChild(i)})};var o=function(e){return e instanceof FormData};return e.isNativeInput=function(e){var t=["INPUT","TEXTAREA"];return t.indexOf(e.tagName)!=-1},e.isBlockEmpty=function(e){var t=["IMG","IFRAME"],n=e.querySelectorAll("textarea, input"),o=!0,r=!e.textContent.trim();return Array.prototype.forEach.call(n,function(e){"textarea"!=e.type&&"text"!=e.type||(o=o&&!e.value.trim())}),r&&o&&!t.includes(e.tagName)},e}({})},function(e,t){"use strict";e.exports=function(){function e(){return new Promise(function(e,o){Promise.resolve().then(function(){var t=[],o=n.tools;for(var r in o){var i=o[r];i.prepare&&"function"!=typeof i.prepare||!i.prepare||t.push(i)}return t.length||e(),t}).then(t).then(function(){n.core.log("Plugins loaded","info"),e()}).catch(function(e){o(e)})})}function t(e){return new Promise(function(t){e.reduce(function(r,i,a){return r.then(function(){return new Promise(function(r){o(i).then(r).then(function(){i.available=!0}).catch(function(e){n.core.log("Plugin «"+i.type+"» was not loaded. Preparation failed because %o","warn",e),i.available=!1,i.loadingMessage=e,r()}).then(function(){a==e.length-1&&t()})})})},Promise.resolve())})}var n=codex.editor,o=function(e){return e.prepare(e.config||{})};return{prepare:e}}()},function(e,t){"use strict";e.exports=function(e){var t=codex.editor;e.className={BLOCK_CLASSNAME:"ce-block",BLOCK_CONTENT:"ce-block__content",BLOCK_STRETCHED:"ce-block--stretched",BLOCK_HIGHLIGHTED:"ce-block--focused",SETTINGS_ITEM:"ce-settings__item"},e.prepare=function(){return new Promise(function(e){var n=t.draw.wrapper(),r=t.draw.redactor(),i=o();n.appendChild(i),n.appendChild(r),t.nodes.wrapper=n,t.nodes.redactor=r,t.nodes.holder.appendChild(n),e()}).then(s).then(n).then(l).then(a).then(c).catch(function(){t.core.log("Can't draw editor interface")})};var n=function(){var e=t.draw.inlineToolbar();t.nodes.inlineToolbar.wrapper=e,t.nodes.inlineToolbar.buttons=t.draw.inlineToolbarButtons(),t.nodes.inlineToolbar.actions=t.draw.inlineToolbarActions(),t.nodes.inlineToolbar.wrapper.appendChild(t.nodes.inlineToolbar.buttons),t.nodes.inlineToolbar.wrapper.appendChild(t.nodes.inlineToolbar.actions),t.nodes.wrapper.appendChild(t.nodes.inlineToolbar.wrapper)},o=function(){var e=t.draw.toolbar(),n=i(),o=r();return e.appendChild(n),e.appendChild(o),t.nodes.toolbar=e,e},r=function(){var e=t.draw.toolbarContent(),n=t.draw.toolbox(),o=t.draw.plusButton();return e.appendChild(o),e.appendChild(n),t.nodes.toolbox=n,t.nodes.plusButton=o,e},i=function(){var e=t.draw.blockSettings(),n=t.draw.blockButtons(),o=t.draw.defaultSettings(),r=t.draw.settingsButton(),i=t.toolbar.settings.makeRemoveBlockButton(),a=t.draw.pluginsSettings();return e.appendChild(a),e.appendChild(o),n.appendChild(r),n.appendChild(i),n.appendChild(e),t.nodes.blockSettings=e,t.nodes.pluginSettings=a,t.nodes.defaultSettings=o,t.nodes.showSettingsButton=r,t.nodes.showTrashButton=i,n},a=function(){t.nodes.notifications=t.notifications.createHolder()},s=function(){var e,n,o;for(n in t.settings.tools)e=t.settings.tools[n],t.tools[n]=e,e.iconClassname||!e.displayInToolbox?"function"==typeof e.render?e.displayInToolbox&&(o=t.draw.toolbarButton(n,e.iconClassname),t.nodes.toolbox.appendChild(o),t.nodes.toolbarButtons[n]=o):t.core.log("render method missed. Tool %o skipped","warn",n):t.core.log("Toolbar icon classname missed. Tool %o skipped","warn",n)},l=function(){var e,n,o={bold:{icon:"ce-icon-bold",command:"bold"},italic:{icon:"ce-icon-italic",command:"italic"},link:{icon:"ce-icon-link",command:"createLink"}};for(var r in o)n=o[r],e=t.draw.toolbarButtonInline(r,n.icon),t.nodes.inlineToolbar.buttons.appendChild(e),t.ui.setInlineToolbarButtonBehaviour(e,n.command)},c=function(){t.core.log("ui.bindEvents fired","info"),t.listeners.add(document,"keydown",t.callback.globalKeydown,!1),t.listeners.add(t.nodes.redactor,"keydown",t.callback.redactorKeyDown,!1),t.listeners.add(document,"keyup",t.callback.globalKeyup,!1),t.listeners.add(t.nodes.redactor,"click",t.callback.redactorClicked,!1),t.listeners.add(t.nodes.plusButton,"click",t.callback.plusButtonClicked,!1),t.listeners.add(t.nodes.showSettingsButton,"click",t.callback.showSettingsButtonClicked,!1);for(var e in t.nodes.toolbarButtons)t.listeners.add(t.nodes.toolbarButtons[e],"click",t.callback.toolbarButtonClicked,!1)};return e.addBlockHandlers=function(e){e&&(t.listeners.add(e,"keydown",t.callback.blockKeydown,!1),t.listeners.add(e,"paste",t.paste.blockPasteCallback,!1),t.listeners.add(e,"mouseup",t.toolbar.inline.show,!1),t.listeners.add(e,"keyup",t.toolbar.inline.show,!1))},e.saveInputs=function(){var e=t.nodes.redactor;t.state.inputs=[];var n=e.querySelectorAll("[contenteditable], input, textarea");Array.prototype.map.call(n,function(e){e.type&&"text"!=e.type&&"textarea"!=e.type||t.state.inputs.push(e)})},e.addInitialBlock=function(){var e,n=t.settings.initialBlockPlugin;return t.tools[n]?(e=t.tools[n].render(),e.setAttribute("data-placeholder",t.settings.placeholder),t.content.insertBlock({type:n,block:e}),void t.content.workingNodeChanged(e)):void t.core.log("Plugin %o was not implemented and can't be used as initial block","warn",n)},e.setInlineToolbarButtonBehaviour=function(e,n){t.listeners.add(e,"mousedown",function(e){t.toolbar.inline.toolClicked(e,n)},!1)},e}({})},function(e,t){"use strict";e.exports=function(e){var t=codex.editor,n=null;return e.input=null,e.arguments=null,e.prepare=function(){var e=t.draw.node("INPUT","",{type:"file"});t.listeners.add(e,"change",t.transport.fileSelected),t.transport.input=e},e.clearInput=function(){e.input=null,e.prepare()},e.fileSelected=function(){var o,r=this,i=r.files,a=new FormData;if(t.transport.arguments.multiple===!0)for(o=0;o"+e.split("\n\n").join("

    ")+"

    ":""};return e.getEditableParent=function(e){for(;e&&"true"!=e.contentEditable;)e=e.parentNode;return e},e.clear=function(e){t.nodes.redactor.innerHTML="",t.content.sync(),t.ui.saveInputs(),e?t.state.blocks={}:t.state.blocks&&(t.state.blocks.items=[]),t.content.currentNode=null},e.load=function(e){var n=Object.assign({},t.state.blocks);t.content.clear(),Object.keys(n).length?n.items?(n.items=n.items.concat(e.items),t.state.blocks=n):(n.items=e.items,t.state.blocks=n):t.state.blocks=e,t.renderer.makeBlocksFromData()},e}({})},function(e,t,n){"use strict";e.exports=function(e){var t=codex.editor;return e.settings=n(9),e.inline=n(10),e.toolbox=n(11),e.defaultToolbarHeight=49,e.defaultOffset=34,e.opened=!1,e.current=null,e.open=function(){if(!t.hideToolbar){var e=t.content.currentNode.dataset.tool;t.tools[e]&&t.tools[e].makeSettings?t.nodes.showSettingsButton.classList.remove("hide"):t.nodes.showSettingsButton.classList.add("hide"),t.nodes.toolbar.classList.add("opened"),this.opened=!0}},e.close=function(){t.nodes.toolbar.classList.remove("opened"),e.opened=!1,e.current=null;for(var n in t.nodes.toolbarButtons)t.nodes.toolbarButtons[n].classList.remove("selected");t.toolbar.toolbox.close(),t.toolbar.settings.close()},e.toggle=function(){this.opened?this.close():this.open()},e.hidePlusButton=function(){t.nodes.plusButton.classList.add("hide")},e.showPlusButton=function(){t.nodes.plusButton.classList.remove("hide")},e.move=function(){if(t.toolbar.toolbox.close(),t.content.currentNode){var e=t.content.currentNode.offsetTop-t.toolbar.defaultToolbarHeight/2+t.toolbar.defaultOffset;t.nodes.toolbar.style.transform="translate3D(0, "+Math.floor(e)+"px, 0)",t.toolbar.settings.hideRemoveActions()}},e}({})},function(e,t){"use strict";e.exports=function(e){var t=codex.editor;return e.opened=!1,e.setting=null,e.actions=null,e.open=function(e){if(t.tools[e]&&t.tools[e].makeSettings){var n=t.tools[e].makeSettings();t.nodes.pluginSettings.appendChild(n),t.nodes.blockSettings.classList.add("opened"),this.opened=!0}},e.close=function(){t.nodes.blockSettings.classList.remove("opened"),t.nodes.pluginSettings.innerHTML="",this.opened=!1},e.toggle=function(e){this.opened?this.close():this.open(e)},e.makeRemoveBlockButton=function(){var e=t.draw.node("SPAN","ce-toolbar__remove-btn",{}),n=t.draw.node("SPAN","ce-toolbar__remove-setting",{innerHTML:''}),o=t.draw.node("DIV","ce-toolbar__remove-confirmation",{}),r=t.draw.node("DIV","ce-toolbar__remove-confirm",{textContent:"Удалить блок"}),i=t.draw.node("DIV","ce-toolbar__remove-cancel",{textContent:"Отмена"});return t.listeners.add(n,"click",t.toolbar.settings.removeButtonClicked,!1),t.listeners.add(r,"click",t.toolbar.settings.confirmRemovingRequest,!1),t.listeners.add(i,"click",t.toolbar.settings.cancelRemovingRequest,!1),o.appendChild(r),o.appendChild(i),e.appendChild(n),e.appendChild(o),t.toolbar.settings.setting=n,t.toolbar.settings.actions=o,e},e.removeButtonClicked=function(){var e=t.toolbar.settings.actions;e.classList.contains("opened")?t.toolbar.settings.hideRemoveActions():t.toolbar.settings.showRemoveActions(),t.toolbar.toolbox.close(),t.toolbar.settings.close()},e.cancelRemovingRequest=function(){t.toolbar.settings.actions.classList.remove("opened")},e.confirmRemovingRequest=function(){var e,n=t.content.currentNode;n.remove(),e=t.nodes.redactor.childNodes.length,0===e&&(t.content.currentNode=null,t.ui.addInitialBlock()),t.ui.saveInputs(),t.toolbar.close()},e.showRemoveActions=function(){t.toolbar.settings.actions.classList.add("opened")},e.hideRemoveActions=function(){t.toolbar.settings.actions.classList.remove("opened")},e}({})},function(e,t){"use strict";e.exports=function(e){var t=codex.editor;e.buttonsOpened=null,e.actionsOpened=null,e.wrappersOffset=null,e.storedSelection=null,e.show=function(){var n,o=t.content.currentNode,r=o.dataset.tool;if(n=t.tools[r],n.showInlineToolbar){var i=e.getSelectionText(),a=t.nodes.inlineToolbar.wrapper;i.length>0&&(t.toolbar.inline.move(),a.classList.add("opened"),t.toolbar.inline.showButtons())}},e.close=function(){var e=t.nodes.inlineToolbar.wrapper;e.classList.remove("opened")},e.move=function(){this.wrappersOffset||(this.wrappersOffset=this.getWrappersOffset());var e,n,o=this.getSelectionCoords(),r=0,i=t.nodes.inlineToolbar.wrapper;0===i.offsetHeight&&(r=40),e=o.x-this.wrappersOffset.left,n=o.y+window.scrollY-this.wrappersOffset.top-r-i.offsetHeight,i.style.transform="translate3D("+Math.floor(e)+"px, "+Math.floor(n)+"px, 0)",t.toolbar.inline.closeButtons(),t.toolbar.inline.closeAction()},e.toolClicked=function(e,n){switch(n){case"createLink":t.toolbar.inline.createLinkAction(e,n);break;default:t.toolbar.inline.defaultToolAction(n)}t.nodes.inlineToolbar.buttons.childNodes.forEach(t.toolbar.inline.hightlight)},e.getWrappersOffset=function(){var e=t.nodes.wrapper,n=this.getOffset(e);return this.wrappersOffset=n,n},e.getOffset=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft+e.clientLeft,n+=e.offsetTop+e.clientTop,e=e.offsetParent;return{top:n,left:t}},e.getSelectionCoords=function(){var e,t=document.selection,n=0,o=0;if(t)"Control"!=t.type&&(e=t.createRange(),e.collapse(!0),n=e.boundingLeft,o=e.boundingTop);else if(window.getSelection&&(t=window.getSelection(),t.rangeCount&&(e=t.getRangeAt(0).cloneRange(),e.getClientRects))){e.collapse(!0);var r=e.getClientRects()[0];if(!r)return;n=r.left,o=r.top}return{x:n,y:o}},e.getSelectionText=function(){var e="";return window.getSelection&&(e=window.getSelection().toString()),e},e.showButtons=function(){var e=t.nodes.inlineToolbar.buttons;e.classList.add("opened"),t.toolbar.inline.buttonsOpened=!0,t.nodes.inlineToolbar.buttons.childNodes.forEach(t.toolbar.inline.hightlight)},e.closeButtons=function(){var e=t.nodes.inlineToolbar.buttons;e.classList.remove("opened"),t.toolbar.inline.buttonsOpened=!1},e.showActions=function(){var e=t.nodes.inlineToolbar.actions;e.classList.add("opened"),t.toolbar.inline.actionsOpened=!0},e.closeAction=function(){var e=t.nodes.inlineToolbar.actions;e.innerHTML="",e.classList.remove("opened"),t.toolbar.inline.actionsOpened=!1};var n=function(e){if(e.keyCode==t.core.keys.ENTER){var n=t.content.currentNode,o=t.toolbar.inline.storedSelection;t.toolbar.inline.restoreSelection(n,o),t.toolbar.inline.setAnchor(this.value),e.preventDefault(),e.stopImmediatePropagation(),t.toolbar.inline.clearRange()}};return e.createLinkAction=function(e){var o=this.isLinkActive(),r=t.content.currentNode,i=t.toolbar.inline.saveSelection(r);if(t.toolbar.inline.storedSelection=i,o)t.toolbar.inline.restoreSelection(r,i),t.toolbar.inline.defaultToolAction("unlink");else{var a=t.draw.inputForLink();t.nodes.inlineToolbar.actions.appendChild(a),t.toolbar.inline.closeButtons(),t.toolbar.inline.showActions(),a.focus(),e.preventDefault(),t.listeners.add(a,"keydown",n,!1)}},e.isLinkActive=function(){var e=!1;return t.nodes.inlineToolbar.buttons.childNodes.forEach(function(t){var n=t.dataset.type;"link"==n&&t.classList.contains("hightlighted")&&(e=!0)}),e},e.defaultToolAction=function(e){document.execCommand(e,!1,null)},e.setAnchor=function(e){document.execCommand("createLink",!1,e),t.toolbar.inline.closeAction()},e.saveSelection=function(e){var t,n=window.getSelection().getRangeAt(0),o=n.cloneRange();return o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),t=o.toString().length,{start:t,end:t+n.toString().length}},e.restoreSelection=function(e,t){var n=document.createRange(),o=0;n.setStart(e,0),n.collapse(!0);for(var r,i,a=[e],s=!1,l=!1;!l&&(r=a.pop());)if(3==r.nodeType)i=o+r.length,!s&&t.start>=o&&t.start<=i&&(n.setStart(r,t.start-o),s=!0),s&&t.end>=o&&t.end<=i&&(n.setEnd(r,t.end-o),l=!0),o=i;else for(var c=r.childNodes.length;c--;)a.push(r.childNodes[c]);var d=window.getSelection();d.removeAllRanges(),d.addRange(n)},e.clearRange=function(){var e=window.getSelection();e.removeAllRanges()},e.hightlight=function(e){var n=e.dataset.type;document.queryCommandState(n)?t.toolbar.inline.setButtonHighlighted(e):t.toolbar.inline.removeButtonsHighLight(e);var o=window.getSelection(),r=o.anchorNode.parentNode;"A"==r.tagName&&"link"==n&&t.toolbar.inline.setButtonHighlighted(e)},e.setButtonHighlighted=function(e){if(e.classList.add("hightlighted"),"link"==e.dataset.type){var t=e.childNodes[0];t.classList.remove("ce-icon-link"),t.classList.add("ce-icon-unlink")}},e.removeButtonsHighLight=function(e){if(e.classList.remove("hightlighted"),"link"==e.dataset.type){var t=e.childNodes[0];t.classList.remove("ce-icon-unlink"),t.classList.add("ce-icon-link")}},e}({})},function(e,t){"use strict";e.exports=function(e){var t=codex.editor;return e.opened=!1,e.openedOnBlock=null,e.open=function(){t.toolbar.settings.opened&&t.toolbar.settings.close(),e.openedOnBlock=t.content.currentNode,e.openedOnBlock.classList.add("toolbar-opened"),t.nodes.toolbox.classList.add("opened"),t.nodes.plusButton.classList.add("clicked"),t.toolbar.toolbox.opened=!0},e.close=function(){e.openedOnBlock&&e.openedOnBlock.classList.remove("toolbar-opened"),e.openedOnBlock=null,t.nodes.toolbox.classList.remove("opened"),t.nodes.plusButton.classList.remove("clicked"),t.toolbar.toolbox.opened=!1,t.toolbar.current=null},e.leaf=function(){var e=t.toolbar.current,n=Object.keys(t.tools),o=t.nodes.toolbarButtons,r=0,i=void 0,a=void 0,s=void 0;if(e)for(r=(n.indexOf(e)+1)%n.length,a=n[r];!t.tools[a].displayInToolbox;)r=(r+1)%n.length,a=n[r];else for(s in t.tools){if(t.tools[s].displayInToolbox)break;r++}i=n[r];for(var l in o)o[l].classList.remove("selected");o[i].classList.add("selected"),t.toolbar.current=i},e.toolClicked=function(e){var n,o,r,i=["image","link","list","instagram","twitter","embed"],a=t.tools[t.toolbar.current],s=t.content.currentNode,l=t.caret.inputIndex;n=a.render(),r={block:n,type:a.type,stretched:!1},s&&i.indexOf(s.dataset.tool)===-1&&""===s.textContent.trim()?t.content.switchBlock(s,n,a.type):(t.content.insertBlock(r),l++),o=a.appendCallback,o&&"function"==typeof o&&o.call(e),window.setTimeout(function(){t.caret.setToBlock(l)},10),t.content.workingNodeChanged(),t.toolbar.move()},e}({})},function(e,t){"use strict";e.exports=function(e){var t=codex.editor;e.globalKeydown=function(e){switch(e.keyCode){case t.core.keys.ENTER:o(e)}},e.redactorKeyDown=function(e){switch(e.keyCode){case t.core.keys.TAB:n(e);break;case t.core.keys.ENTER:i(e);break;case t.core.keys.ESC:a(e);break;default:l(e)}},e.globalKeyup=function(e){switch(e.keyCode){case t.core.keys.UP:case t.core.keys.LEFT:case t.core.keys.RIGHT:case t.core.keys.DOWN:s(e)}};var n=function(e){e.preventDefault(),t.core.isBlockEmpty(t.content.currentNode)&&(t.toolbar.opened||t.toolbar.open(),t.toolbar.opened&&!t.toolbar.toolbox.opened?t.toolbar.toolbox.open():t.toolbar.toolbox.leaf())},o=function(){t.content.editorAreaHightlighted&&(t.caret.inputIndex=-1,r())},r=function(){var e=t.settings.initialBlockPlugin;t.content.insertBlock({type:e,block:t.tools[e].render()},!0),t.toolbar.move(),t.toolbar.open()},i=function(e){"true"==e.target.contentEditable&&t.caret.saveCurrentInputIndex();var n=t.caret.getCurrentInputIndex()||0,o=t.content.currentNode,r=o.dataset.tool,i=t.toolbar.opened&&t.toolbar.current&&e.target==t.state.inputs[n],a=t.tools[r].enableLineBreaks,s=t.settings.initialBlockPlugin;if(i)return e.preventDefault(),t.toolbar.toolbox.toolClicked(e),t.toolbar.close(),e.stopPropagation(),void e.stopImmediatePropagation();if(e.shiftKey||a)return e.stopPropagation(),void e.stopImmediatePropagation();var l=window.getSelection(),c=l.anchorNode,d=t.caret.position.atTheEnd(),u=!1;if(e.shiftKey&&!a)return t.callback.enterPressedOnBlock(t.content.currentBlock,e),void e.preventDefault();if(u=c&&"true"!=c.parentNode.contentEditable,c.nodeType!=t.core.nodeTypes.TEXT||u||d){var p=t.content.isLastNode(c);p&&d&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t.core.log("ENTER clicked in last textNode. Create new BLOCK"),t.content.insertBlock({type:s,block:t.tools[s].render()},!0),t.toolbar.move(),t.toolbar.open(),t.toolbar.showPlusButton())}else e.preventDefault(),t.core.log("Splitting Text node..."),t.content.splitBlock(n),t.state.inputs[n+1].textContent.trim()||t.toolbar.showPlusButton();t.ui.saveInputs()},a=function(e){t.toolbar.close(),t.toolbar.toolbox.close(),e.preventDefault()},s=function(e){t.content.workingNodeChanged(),t.toolbar.close(),t.toolbar.move()},l=function(){t.toolbar.close(),t.toolbar.inline.actionsOpened||(t.toolbar.inline.close(),t.content.clearMark())};e.redactorClicked=function(e){c(),t.content.workingNodeChanged(e.target),t.ui.saveInputs();var n,o=t.toolbar.inline.getSelectionText();if(0===o.length&&t.toolbar.inline.close(),"true"==e.target.contentEditable&&t.caret.saveCurrentInputIndex(),null===t.content.currentNode){var r=t.state.inputs.length>0?t.state.inputs.length-1:0;if(t.state.inputs.length&&(n=t.content.getFirstLevelBlock(t.state.inputs[r])),t.state.inputs.length&&""===t.state.inputs[r].textContent&&n.dataset.tool==t.settings.initialBlockPlugin)t.caret.setToBlock(r);else{var i=t.settings.initialBlockPlugin;t.content.insertBlock({type:i,block:t.tools[i].render()}),1===t.state.inputs.length?t.caret.setToBlock(r):t.caret.setToNextBlock(r)}}else t.toolbar.settings.close(),t.toolbar.toolbox.close();t.toolbar.move(),t.toolbar.open();var a=!t.content.currentNode.textContent.trim(),s=t.content.currentNode.dataset.tool,l=s==t.settings.initialBlockPlugin;t.toolbar.hidePlusButton(),a||t.content.markBlock(),l&&a&&t.toolbar.showPlusButton()};var c=function(){var e=window.getSelection(),n=e.anchorNode,o=!1;if(0===e.rangeCount)t.content.editorAreaHightlighted=!0;else{for(t.core.isDomNode(n)||(n=n.parentNode),"true"==n.contentEditable&&(o=!0);"true"!=n.contentEditable&&(n=n.parentNode,"true"==n.contentEditable&&(o=!0),n!=document.body););t.content.editorAreaHightlighted=!o}};e.toolbarButtonClicked=function(e){var n=this;t.toolbar.current=n.dataset.type,t.toolbar.toolbox.toolClicked(e),t.toolbar.close()},e.plusButtonClicked=function(){t.nodes.toolbox.classList.contains("opened")?t.toolbar.toolbox.close():t.toolbar.toolbox.open()},e.blockKeydown=function(e){var n=e.target;switch(e.keyCode){case t.core.keys.DOWN:case t.core.keys.RIGHT:d(e);break;case t.core.keys.BACKSPACE:p(n,e);break;case t.core.keys.UP:case t.core.keys.LEFT:u(e)}};var d=function(e){var n,o=window.getSelection(),r=t.state.inputs,i=o.anchorNode;if(!i)return!1;for(;"true"!=i.contentEditable;)n=i.parentNode,i=n;for(var a=0;i!=r[a];)a++;if(!i.textContent)return void t.caret.setToNextBlock(a);var s,l,c=!1,d=!1;return s=i.childNodes[i.childNodes.length-1],l=t.core.isDomNode(s)?t.content.getDeepestTextNodeFromPosition(s,s.childNodes.length):s,c=o.anchorNode==l,d=l.length==o.anchorOffset, -c&&d?void t.caret.setToNextBlock(a):(t.core.log("arrow [down|right] : caret does not reached the end"),!1)},u=function(e){var n,o=window.getSelection(),r=t.state.inputs,i=o.anchorNode;if(!i)return!1;if(0!==o.anchorOffset)return!1;for(;"true"!=i.contentEditable;)n=i.parentNode,i=n;for(var a=0;i!=r[a];)a++;var s,l,c=!1,d=!1;return i.textContent?(s=i.childNodes[0],l=t.core.isDomNode(s)?t.content.getDeepestTextNodeFromPosition(s,0):s,c=o.anchorNode==l,d=0===o.anchorOffset,void(c&&d&&t.caret.setToPreviousBlock(a))):void t.caret.setToPreviousBlock(a)},p=function(e,n){var o,r,i,a=t.caret.getCurrentInputIndex();if(t.core.isNativeInput(n.target)){if(""!=n.target.value.trim())return;e.remove()}if(e.textContent.trim()){if(o=t.content.getRange(),r=o.endOffset-o.startOffset,!t.caret.position.atStart()||r||!t.state.inputs[a-1])return;t.content.mergeBlocks(a)}r||e.remove(),i=t.nodes.redactor.childNodes.length,0===i?(t.content.currentNode=null,t.ui.addInitialBlock(),t.ui.saveInputs(),window.setTimeout(function(){t.caret.setToPreviousBlock(1)},10)):0!==t.caret.inputIndex?t.caret.setToPreviousBlock(t.caret.inputIndex):t.caret.setToNextBlock(t.caret.inputIndex),t.toolbar.move(),t.toolbar.opened||t.toolbar.open(),t.ui.saveInputs(),n.preventDefault()};return e.showSettingsButtonClicked=function(e){var n=t.content.currentNode.dataset.tool;t.toolbar.settings.toggle(n),t.toolbar.toolbox.close(),t.toolbar.settings.hideRemoveActions()},e}({})},function(e,t){"use strict";e.exports=function(e){return e.wrapper=function(){var e=document.createElement("div");return e.className+="codex-editor",e},e.redactor=function(){var e=document.createElement("div");return e.className+="ce-redactor",e},e.ceBlock=function(){var e=document.createElement("DIV");return e.className+="ce_block",e},e.toolbar=function(){var e=document.createElement("div");return e.className+="ce-toolbar",e},e.toolbarContent=function(){var e=document.createElement("DIV");return e.classList.add("ce-toolbar__content"),e},e.inlineToolbar=function(){var e=document.createElement("DIV");return e.className+="ce-toolbar-inline",e},e.inlineToolbarButtons=function(){var e=document.createElement("DIV");return e.className+="ce-toolbar-inline__buttons",e},e.inlineToolbarActions=function(){var e=document.createElement("DIV");return e.className+="ce-toolbar-inline__actions",e},e.inputForLink=function(){var e=document.createElement("INPUT");return e.type="input",e.className+="inputForLink",e.placeholder="Вставьте ссылку ...",e.setAttribute("form","defaultForm"),e.setAttribute("autofocus","autofocus"),e},e.blockButtons=function(){var e=document.createElement("div");return e.className+="ce-toolbar__actions",e},e.blockSettings=function(){var e=document.createElement("div");return e.className+="ce-settings",e},e.defaultSettings=function(){var e=document.createElement("div");return e.classList.add("ce-settings_default"),e},e.pluginsSettings=function(){var e=document.createElement("div");return e.classList.add("ce-settings_plugin"),e},e.plusButton=function(){var e=document.createElement("span");return e.className="ce-toolbar__plus",e},e.settingsButton=function(){var e=document.createElement("span");return e.className="ce-toolbar__settings-btn",e.innerHTML='',e},e.toolbox=function(){var e=document.createElement("div");return e.className="ce-toolbar__tools",e},e.toolbarButton=function(e,t){var n=document.createElement("li"),o=document.createElement("i"),r=document.createElement("span");return n.dataset.type=e,n.setAttribute("title",e),o.classList.add(t),r.classList.add("ce_toolbar_tools--title"),n.appendChild(o),n.appendChild(r),n},e.toolbarButtonInline=function(e,t){var n=document.createElement("BUTTON"),o=document.createElement("I");return n.type="button",n.dataset.type=e,o.classList.add(t),n.appendChild(o),n},e.block=function(e,t){var n=document.createElement(e);return n.innerHTML=t||"",n},e.node=function(e,t,n){var o=document.createElement(e);if(t&&(o.className=t),n)for(var r in n)o[r]=n[r];return o},e.unavailableBlock=function(){var e=document.createElement("DIV");return e.classList.add("cdx-unavailable-block"),e},e}({})},function(e,t){"use strict";e.exports=function(e){var t=codex.editor;return e.inputIndex=null,e.offset=null,e.focusedNodeIndex=null,e.set=function(n,o,r){r=r||e.offset||0,o=o||e.focusedNodeIndex||0;var i,a=n.childNodes;if(i=0===a.length?n:a[o],"true"!=n.contentEditable)return void n.focus();t.core.isDomNode(i)&&(i=t.content.getDeepestTextNodeFromPosition(i,i.childNodes.length));var s=document.createRange(),l=window.getSelection();window.setTimeout(function(){s.setStart(i,r),s.setEnd(i,r),l.removeAllRanges(),l.addRange(s),t.caret.saveCurrentInputIndex()},20)},e.saveCurrentInputIndex=function(){var n,o=window.getSelection(),r=t.state.inputs,i=o.anchorNode;if(i){for(;"true"!=i.contentEditable;)n=i.parentNode,i=n;for(var a=0;i!=r[a];)a++;e.inputIndex=a}},e.getCurrentInputIndex=function(){return e.inputIndex},e.setToNextBlock=function(e){var n=t.state.inputs,o=n[e+1];if(!o)return void t.core.log("We are reached the end");if(!o.childNodes.length){var r=document.createTextNode("");o.appendChild(r)}t.caret.inputIndex=e+1,t.caret.set(o,0,0),t.content.workingNodeChanged(o)},e.setToBlock=function(e){var n=t.state.inputs,o=n[e];if(o){if(!o.childNodes.length){var r=document.createTextNode("");o.appendChild(r)}t.caret.inputIndex=e,t.caret.set(o,0,0),t.content.workingNodeChanged(o)}},e.setToPreviousBlock=function(e){e=e||0;var n,o,r,i=t.state.inputs,a=i[e-1];return a?(n=t.content.getDeepestTextNodeFromPosition(a,a.childNodes.length),o=n.length,a.childNodes.length||(r=document.createTextNode(""),a.appendChild(r)),t.caret.inputIndex=e-1,t.caret.set(a,a.childNodes.length-1,o),void t.content.workingNodeChanged(i[e-1])):void t.core.log("We are reached first node")},e.position={atStart:function(){var e=window.getSelection(),n=e.anchorOffset,o=e.anchorNode,r=t.content.getFirstLevelBlock(o),i=r.childNodes[0];t.core.isDomNode(o)||(o=o.parentNode);var a=o===i.childNodes[0],s=0===n;return a&&s},atTheEnd:function(){var e=window.getSelection(),t=e.anchorOffset,n=e.anchorNode;return!n||!n.length||t===n.length}},e.insertNode=function(e){var n,o,r=e;e.nodeType==t.core.nodeTypes.DOCUMENT_FRAGMENT&&(r=e.lastChild),n=window.getSelection(),o=n.getRangeAt(0),o.deleteContents(),o.insertNode(e),o.setStartAfter(r),o.collapse(!0),n.removeAllRanges(),n.addRange(o)},e}({})},function(e,t){"use strict";e.exports=function(e){var t=codex.editor,n=[],o=function(e){n.push(e);for(var t=0;t5;)"confirm"!=n[t].type&&"prompt"!=n[t].type?(n[t].close(),n.splice(t,1)):t++};return e.createHolder=function(){var e=t.draw.node("DIV","cdx-notifications-block");return t.nodes.notifications=document.body.appendChild(e),e},e.errorThrown=function(e,n){t.notifications.notification({message:"This action is not available currently",type:n.type})},e.notification=function(e){function n(e){if(!e||!e.message)return void t.core.log("Can't create notification. Message is missed");e.type=e.type||"alert",e.time=1e3*e.time||1e4;var n=t.draw.node("DIV","cdx-notification"),o=t.draw.node("DIV","cdx-notification__message"),r=t.draw.node("INPUT","cdx-notification__input"),f=t.draw.node("SPAN","cdx-notification__ok-btn"),g=t.draw.node("SPAN","cdx-notification__cancel-btn");o.textContent=e.message,f.textContent=e.okMsg||"ОК",g.textContent=e.cancelMsg||"Отмена",t.listeners.add(f,"click",u),t.listeners.add(g,"click",p),n.appendChild(o),"prompt"==e.type&&n.appendChild(r),n.appendChild(f),"prompt"!=e.type&&"confirm"!=e.type||n.appendChild(g),n.classList.add("cdx-notification-"+e.type),n.dataset.type=e.type,a=n,l=e.type,c=e.confirm,s=e.cancel,d=r,"prompt"!=e.type&&"confirm"!=e.type&&window.setTimeout(i,e.time)}function r(){t.nodes.notifications.appendChild(a),d.focus(),t.nodes.notifications.classList.add("cdx-notification__notification-appending"),window.setTimeout(function(){t.nodes.notifications.classList.remove("cdx-notification__notification-appending")},100),o({type:l,close:i})}function i(){a.remove()}var a=null,s=null,l=null,c=null,d=null,u=function(){if(i(),"function"==typeof c)return"prompt"==l?void c(d.value):void c()},p=function(){i(),"function"==typeof s&&s()};return e&&(n(e),r()),{create:n,send:r,close:i}},e.clear=function(){t.nodes.notifications.innerHTML="",n=[]},e}({})},function(e,t){"use strict";e.exports=function(e){var t=codex.editor;return e.insertPastedContent=function(e,n){t.content.insertBlock({type:e.type,block:e.render({text:n.innerHTML})})},e.isFirstLevelBlock=function(e){return e.nodeType==t.core.nodeTypes.TAG&&e.classList.contains(t.ui.className.BLOCK_CLASSNAME)},e}({})},function(e,t,n){"use strict";e.exports=function(e){var t=n(18),o=codex.editor;e.prepare=function(){o.settings.sanitizer&&!o.core.isEmpty(o.settings.sanitizer)&&(r.CUSTOM=o.settings.sanitizer)};var r={CUSTOM:null,BASIC:{tags:{p:{},a:{href:!0,target:"_blank",rel:"nofollow"}}}};e.Config=r;var i=function(e){var n=e||r.CUSTOM||r.BASIC;return new t(n)};return e.clean=function(e,t){var n=i(t);return n.clean(e)},e}({})},function(e,t,n){var o,r;!function(i,a){o=a,r="function"==typeof o?o.call(t,n,t,e):o,!(void 0!==r&&(e.exports=r))}(this,function(){function e(e){var t=e.tags,n=Object.keys(t),o=n.map(function(e){return typeof t[e]}).every(function(e){return"object"===e||"boolean"===e||"function"===e});if(!o)throw new Error("The configuration was invalid");this.config=e}function t(e){return s.indexOf(e.nodeName)!==-1}function n(e){return l.indexOf(e.nodeName)!==-1}function o(e){return document.createTreeWalker(e,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null,!1)}function r(e,t,n){return"function"==typeof e.tags[t]?e.tags[t](n):e.tags[t]}function i(e,t){return"undefined"==typeof t||"boolean"==typeof t&&!t}function a(e,t,n){var o=e.name.toLowerCase();return t!==!0&&("function"==typeof t[o]?!t[o](e.value,n):"undefined"==typeof t[o]||(t[o]===!1||"string"==typeof t[o]&&t[o]!==e.value))}var s=["P","LI","TD","TH","DIV","H1","H2","H3","H4","H5","H6","PRE"],l=["A","B","STRONG","I","EM","SUB","SUP","U","STRIKE"];return e.prototype.clean=function(e){var t=document.createElement("div");return t.innerHTML=e,this._sanitize(t),t.innerHTML},e.prototype._sanitize=function(e){var s=o(e),l=s.firstChild();if(l)do if(!l._sanitized)if(l.nodeType!==Node.TEXT_NODE){if(l.nodeType===Node.COMMENT_NODE){e.removeChild(l),this._sanitize(e);break}var c,d=n(l);d&&(c=Array.prototype.some.call(l.childNodes,t));var u=!!e.parentNode,p=t(e)&&t(l)&&u,f=l.nodeName.toLowerCase(),g=r(this.config,f,l),h=d&&c;if(h||i(l,g)||!this.config.keepNestedBlockElements&&p){if("SCRIPT"!==l.nodeName&&"STYLE"!==l.nodeName)for(;l.childNodes.length>0;)e.insertBefore(l.childNodes[0],l);e.removeChild(l),this._sanitize(e);break}for(var v=0;v0&&t.splice(s,1)}},e.removeAll=function(){t.map(function(t){e.remove(t.element,t.type,t.handler)})},e.get=function(t,n,o){return e.search.all(t,n,o)},e}({})},function(e,t){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){var t=codex.editor;return e.removeNodes=function(){t.nodes.wrapper.remove(),t.nodes.notifications.remove()},e.destroyPlugins=function(){for(var e in t.tools)"function"==typeof t.tools[e].destroy&&t.tools[e].destroy()},e.destroyScripts=function(){for(var e=document.getElementsByTagName("SCRIPT"),n=0;n nodeList\n\t */\n\t renderer.appendBlocks = function (data) {\n\t\n\t var blocks = data.items;\n\t\n\t /**\n\t * Sequence of one-by-one blocks appending\n\t * Uses to save blocks order after async-handler\n\t */\n\t var nodeSequence = Promise.resolve();\n\t\n\t for (var index = 0; index < blocks.length; index++) {\n\t\n\t /** Add node to sequence at specified index */\n\t editor.renderer.appendNodeAtIndex(nodeSequence, blocks, index);\n\t }\n\t };\n\t\n\t /**\n\t * Append node at specified index\n\t */\n\t renderer.appendNodeAtIndex = function (nodeSequence, blocks, index) {\n\t\n\t /** We need to append node to sequence */\n\t nodeSequence\n\t\n\t /** first, get node async-aware */\n\t .then(function () {\n\t\n\t return editor.renderer.getNodeAsync(blocks, index);\n\t })\n\t\n\t /**\n\t * second, compose editor-block from JSON object\n\t */\n\t .then(editor.renderer.createBlockFromData)\n\t\n\t /**\n\t * now insert block to redactor\n\t */\n\t .then(function (blockData) {\n\t\n\t /**\n\t * blockData has 'block', 'type' and 'stretched' information\n\t */\n\t editor.content.insertBlock(blockData);\n\t\n\t /** Pass created block to next step */\n\t return blockData.block;\n\t })\n\t\n\t /** Log if something wrong with node */\n\t .catch(function (error) {\n\t\n\t editor.core.log('Node skipped while parsing because %o', 'error', error);\n\t });\n\t };\n\t\n\t /**\n\t * Asynchronously returns block data from blocksList by index\n\t * @return Promise to node\n\t */\n\t renderer.getNodeAsync = function (blocksList, index) {\n\t\n\t return Promise.resolve().then(function () {\n\t\n\t return {\n\t tool: blocksList[index],\n\t position: index\n\t };\n\t });\n\t };\n\t\n\t /**\n\t * Creates editor block by JSON-data\n\t *\n\t * @uses render method of each plugin\n\t *\n\t * @param {Object} toolData.tool\n\t * { header : {\n\t * text: '',\n\t * type: 'H3', ...\n\t * }\n\t * }\n\t * @param {Number} toolData.position - index in input-blocks array\n\t * @return {Object} with type and Element\n\t */\n\t renderer.createBlockFromData = function (toolData) {\n\t\n\t /** New parser */\n\t var block,\n\t tool = toolData.tool,\n\t pluginName = tool.type;\n\t\n\t /** Get first key of object that stores plugin name */\n\t // for (var pluginName in blockData) break;\n\t\n\t /** Check for plugin existance */\n\t if (!editor.tools[pluginName]) {\n\t\n\t throw Error('Plugin \\xAB' + pluginName + '\\xBB not found');\n\t }\n\t\n\t /** Check for plugin having render method */\n\t if (typeof editor.tools[pluginName].render != 'function') {\n\t\n\t throw Error('Plugin \\xAB' + pluginName + '\\xBB must have \\xABrender\\xBB method');\n\t }\n\t\n\t if (editor.tools[pluginName].available === false) {\n\t\n\t block = editor.draw.unavailableBlock();\n\t\n\t block.innerHTML = editor.tools[pluginName].loadingMessage;\n\t\n\t /**\n\t * Saver will extract data from initial block data by position in array\n\t */\n\t block.dataset.inputPosition = toolData.position;\n\t } else {\n\t\n\t /** New Parser */\n\t block = editor.tools[pluginName].render(tool.data);\n\t }\n\t\n\t /** is first-level block stretched */\n\t var stretched = editor.tools[pluginName].isStretched || false;\n\t\n\t /** Retrun type and block */\n\t return {\n\t type: pluginName,\n\t block: block,\n\t stretched: stretched\n\t };\n\t };\n\t\n\t return renderer;\n\t}({});\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Codex Editor Saver\n\t *\n\t * @author Codex Team\n\t * @version 1.1.0\n\t */\n\t\n\tmodule.exports = function (saver) {\n\t\n\t var editor = codex.editor;\n\t\n\t /**\n\t * @public\n\t * Save blocks\n\t */\n\t saver.save = function () {\n\t\n\t /** Save html content of redactor to memory */\n\t editor.state.html = editor.nodes.redactor.innerHTML;\n\t\n\t /** Clean jsonOutput state */\n\t editor.state.jsonOutput = [];\n\t\n\t return saveBlocks(editor.nodes.redactor.childNodes);\n\t };\n\t\n\t /**\n\t * @private\n\t * Save each block data\n\t *\n\t * @param blocks\n\t * @returns {Promise.}\n\t */\n\t var saveBlocks = function saveBlocks(blocks) {\n\t\n\t var data = [];\n\t\n\t for (var index = 0; index < blocks.length; index++) {\n\t\n\t data.push(getBlockData(blocks[index]));\n\t }\n\t\n\t return Promise.all(data).then(makeOutput).catch(editor.core.log);\n\t };\n\t\n\t /** Save and validate block data */\n\t var getBlockData = function getBlockData(block) {\n\t\n\t return saveBlockData(block).then(validateBlockData).catch(editor.core.log);\n\t };\n\t\n\t /**\n\t * @private\n\t * Call block`s plugin save method and return saved data\n\t *\n\t * @param block\n\t * @returns {Object}\n\t */\n\t var saveBlockData = function saveBlockData(block) {\n\t\n\t var pluginName = block.dataset.tool;\n\t\n\t /** Check for plugin existence */\n\t if (!editor.tools[pluginName]) {\n\t\n\t editor.core.log('Plugin \\xAB' + pluginName + '\\xBB not found', 'error');\n\t return { data: null, pluginName: null };\n\t }\n\t\n\t /** Check for plugin having save method */\n\t if (typeof editor.tools[pluginName].save !== 'function') {\n\t\n\t editor.core.log('Plugin \\xAB' + pluginName + '\\xBB must have save method', 'error');\n\t return { data: null, pluginName: null };\n\t }\n\t\n\t /** Result saver */\n\t var blockContent = block.childNodes[0],\n\t pluginsContent = blockContent.childNodes[0],\n\t position = pluginsContent.dataset.inputPosition;\n\t\n\t /** If plugin wasn't available then return data from cache */\n\t if (editor.tools[pluginName].available === false) {\n\t\n\t return Promise.resolve({ data: codex.editor.state.blocks.items[position].data, pluginName: pluginName });\n\t }\n\t\n\t return Promise.resolve(pluginsContent).then(editor.tools[pluginName].save).then(function (data) {\n\t return Object({ data: data, pluginName: pluginName });\n\t });\n\t };\n\t\n\t /**\n\t * Call plugin`s validate method. Return false if validation failed\n\t *\n\t * @param data\n\t * @param pluginName\n\t * @returns {Object|Boolean}\n\t */\n\t var validateBlockData = function validateBlockData(_ref) {\n\t var data = _ref.data,\n\t pluginName = _ref.pluginName;\n\t\n\t\n\t if (!data || !pluginName) {\n\t\n\t return false;\n\t }\n\t\n\t if (editor.tools[pluginName].validate) {\n\t\n\t var result = editor.tools[pluginName].validate(data);\n\t\n\t /**\n\t * Do not allow invalid data\n\t */\n\t if (!result) {\n\t\n\t return false;\n\t }\n\t }\n\t\n\t return { data: data, pluginName: pluginName };\n\t };\n\t\n\t /**\n\t * Compile article output\n\t *\n\t * @param savedData\n\t * @returns {{time: number, version, items: (*|Array)}}\n\t */\n\t var makeOutput = function makeOutput(savedData) {\n\t\n\t savedData = savedData.filter(function (blockData) {\n\t return blockData;\n\t });\n\t\n\t var items = savedData.map(function (blockData) {\n\t return Object({ type: blockData.pluginName, data: blockData.data });\n\t });\n\t\n\t editor.state.jsonOutput = items;\n\t\n\t return {\n\t id: editor.state.blocks.id || null,\n\t time: +new Date(),\n\t version: editor.version,\n\t items: items\n\t };\n\t };\n\t\n\t return saver;\n\t}({});\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Codex Editor Content Module\n\t * Works with DOM\n\t *\n\t * @module Codex Editor content module\n\t *\n\t * @author Codex Team\n\t * @version 1.3.13\n\t *\n\t * @description Module works with Elements that have been appended to the main DOM\n\t */\n\t\n\tmodule.exports = function (content) {\n\t\n\t var editor = codex.editor;\n\t\n\t /**\n\t * Links to current active block\n\t * @type {null | Element}\n\t */\n\t content.currentNode = null;\n\t\n\t /**\n\t * clicked in redactor area\n\t * @type {null | Boolean}\n\t */\n\t content.editorAreaHightlighted = null;\n\t\n\t /**\n\t * @deprecated\n\t * Synchronizes redactor with original textarea\n\t */\n\t content.sync = function () {\n\t\n\t editor.core.log('syncing...');\n\t\n\t /**\n\t * Save redactor content to editor.state\n\t */\n\t editor.state.html = editor.nodes.redactor.innerHTML;\n\t };\n\t\n\t /**\n\t * Appends background to the block\n\t *\n\t * @description add CSS class to highlight visually first-level block area\n\t */\n\t content.markBlock = function () {\n\t\n\t editor.content.currentNode.classList.add(editor.ui.className.BLOCK_HIGHLIGHTED);\n\t };\n\t\n\t /**\n\t * Clear background\n\t *\n\t * @description clears styles that highlights block\n\t */\n\t content.clearMark = function () {\n\t\n\t if (editor.content.currentNode) {\n\t\n\t editor.content.currentNode.classList.remove(editor.ui.className.BLOCK_HIGHLIGHTED);\n\t }\n\t };\n\t\n\t /**\n\t * Finds first-level block\n\t *\n\t * @param {Element} node - selected or clicked in redactors area node\n\t * @protected\n\t *\n\t * @description looks for first-level block.\n\t * gets parent while node is not first-level\n\t */\n\t content.getFirstLevelBlock = function (node) {\n\t\n\t if (!editor.core.isDomNode(node)) {\n\t\n\t node = node.parentNode;\n\t }\n\t\n\t if (node === editor.nodes.redactor || node === document.body) {\n\t\n\t return null;\n\t } else {\n\t\n\t while (!node.classList.contains(editor.ui.className.BLOCK_CLASSNAME)) {\n\t\n\t node = node.parentNode;\n\t }\n\t\n\t return node;\n\t }\n\t };\n\t\n\t /**\n\t * Trigger this event when working node changed\n\t * @param {Element} targetNode - first-level of this node will be current\n\t * @protected\n\t *\n\t * @description If targetNode is first-level then we set it as current else we look for parents to find first-level\n\t */\n\t content.workingNodeChanged = function (targetNode) {\n\t\n\t /** Clear background from previous marked block before we change */\n\t editor.content.clearMark();\n\t\n\t if (!targetNode) {\n\t\n\t return;\n\t }\n\t\n\t content.currentNode = content.getFirstLevelBlock(targetNode);\n\t };\n\t\n\t /**\n\t * Replaces one redactor block with another\n\t * @protected\n\t * @param {Element} targetBlock - block to replace. Mostly currentNode.\n\t * @param {Element} newBlock\n\t * @param {string} newBlockType - type of new block; we need to store it to data-attribute\n\t *\n\t * [!] Function does not saves old block content.\n\t * You can get it manually and pass with newBlock.innerHTML\n\t */\n\t content.replaceBlock = function (targetBlock, newBlock) {\n\t\n\t if (!targetBlock || !newBlock) {\n\t\n\t editor.core.log('replaceBlock: missed params');\n\t return;\n\t }\n\t\n\t /** If target-block is not a frist-level block, then we iterate parents to find it */\n\t while (!targetBlock.classList.contains(editor.ui.className.BLOCK_CLASSNAME)) {\n\t\n\t targetBlock = targetBlock.parentNode;\n\t }\n\t\n\t /** Replacing */\n\t editor.nodes.redactor.replaceChild(newBlock, targetBlock);\n\t\n\t /**\n\t * Set new node as current\n\t */\n\t editor.content.workingNodeChanged(newBlock);\n\t\n\t /**\n\t * Add block handlers\n\t */\n\t editor.ui.addBlockHandlers(newBlock);\n\t\n\t /**\n\t * Save changes\n\t */\n\t editor.ui.saveInputs();\n\t };\n\t\n\t /**\n\t * @protected\n\t *\n\t * Inserts new block to redactor\n\t * Wrapps block into a DIV with BLOCK_CLASSNAME class\n\t *\n\t * @param blockData {object}\n\t * @param blockData.block {Element} element with block content\n\t * @param blockData.type {string} block plugin\n\t * @param needPlaceCaret {bool} pass true to set caret in new block\n\t *\n\t */\n\t content.insertBlock = function (blockData, needPlaceCaret) {\n\t\n\t var workingBlock = editor.content.currentNode,\n\t newBlockContent = blockData.block,\n\t blockType = blockData.type,\n\t isStretched = blockData.stretched;\n\t\n\t var newBlock = composeNewBlock_(newBlockContent, blockType, isStretched);\n\t\n\t if (workingBlock) {\n\t\n\t editor.core.insertAfter(workingBlock, newBlock);\n\t } else {\n\t\n\t /**\n\t * If redactor is empty, append as first child\n\t */\n\t editor.nodes.redactor.appendChild(newBlock);\n\t }\n\t\n\t /**\n\t * Block handler\n\t */\n\t editor.ui.addBlockHandlers(newBlock);\n\t\n\t /**\n\t * Set new node as current\n\t */\n\t editor.content.workingNodeChanged(newBlock);\n\t\n\t /**\n\t * Save changes\n\t */\n\t editor.ui.saveInputs();\n\t\n\t if (needPlaceCaret) {\n\t\n\t /**\n\t * If we don't know input index then we set default value -1\n\t */\n\t var currentInputIndex = editor.caret.getCurrentInputIndex() || -1;\n\t\n\t if (currentInputIndex == -1) {\n\t\n\t var editableElement = newBlock.querySelector('[contenteditable]'),\n\t emptyText = document.createTextNode('');\n\t\n\t editableElement.appendChild(emptyText);\n\t editor.caret.set(editableElement, 0, 0);\n\t\n\t editor.toolbar.move();\n\t editor.toolbar.showPlusButton();\n\t } else {\n\t\n\t if (currentInputIndex === editor.state.inputs.length - 1) return;\n\t\n\t /** Timeout for browsers execution */\n\t window.setTimeout(function () {\n\t\n\t /** Setting to the new input */\n\t editor.caret.setToNextBlock(currentInputIndex);\n\t editor.toolbar.move();\n\t editor.toolbar.open();\n\t }, 10);\n\t }\n\t }\n\t\n\t /**\n\t * Block is inserted, wait for new click that defined focusing on editors area\n\t * @type {boolean}\n\t */\n\t content.editorAreaHightlighted = false;\n\t };\n\t\n\t /**\n\t * Replaces blocks with saving content\n\t * @protected\n\t * @param {Element} noteToReplace\n\t * @param {Element} newNode\n\t * @param {Element} blockType\n\t */\n\t content.switchBlock = function (blockToReplace, newBlock, tool) {\n\t\n\t tool = tool || editor.content.currentNode.dataset.tool;\n\t var newBlockComposed = composeNewBlock_(newBlock, tool);\n\t\n\t /** Replacing */\n\t editor.content.replaceBlock(blockToReplace, newBlockComposed);\n\t\n\t /** Save new Inputs when block is changed */\n\t editor.ui.saveInputs();\n\t };\n\t\n\t /**\n\t * Iterates between child noted and looking for #text node on deepest level\n\t * @protected\n\t *\n\t * @param {Element} block - node where find\n\t * @param {int} postiton - starting postion\n\t * Example: childNodex.length to find from the end\n\t * or 0 to find from the start\n\t * @return {Text} block\n\t * @uses DFS\n\t */\n\t content.getDeepestTextNodeFromPosition = function (block, position) {\n\t\n\t /**\n\t * Clear Block from empty and useless spaces with trim.\n\t * Such nodes we should remove\n\t */\n\t var blockChilds = block.childNodes,\n\t index,\n\t node,\n\t text;\n\t\n\t for (index = 0; index < blockChilds.length; index++) {\n\t\n\t node = blockChilds[index];\n\t\n\t if (node.nodeType == editor.core.nodeTypes.TEXT) {\n\t\n\t text = node.textContent.trim();\n\t\n\t /** Text is empty. We should remove this child from node before we start DFS\n\t * decrease the quantity of childs.\n\t */\n\t if (text === '') {\n\t\n\t block.removeChild(node);\n\t position--;\n\t }\n\t }\n\t }\n\t\n\t if (block.childNodes.length === 0) {\n\t\n\t return document.createTextNode('');\n\t }\n\t\n\t /** Setting default position when we deleted all empty nodes */\n\t if (position < 0) position = 1;\n\t\n\t var lookingFromStart = false;\n\t\n\t /** For looking from START */\n\t if (position === 0) {\n\t\n\t lookingFromStart = true;\n\t position = 1;\n\t }\n\t\n\t while (position) {\n\t\n\t /** initial verticle of node. */\n\t if (lookingFromStart) {\n\t\n\t block = block.childNodes[0];\n\t } else {\n\t\n\t block = block.childNodes[position - 1];\n\t }\n\t\n\t if (block.nodeType == editor.core.nodeTypes.TAG) {\n\t\n\t position = block.childNodes.length;\n\t } else if (block.nodeType == editor.core.nodeTypes.TEXT) {\n\t\n\t position = 0;\n\t }\n\t }\n\t\n\t return block;\n\t };\n\t\n\t /**\n\t * @private\n\t * @param {Element} block - current plugins render\n\t * @param {String} tool - plugins name\n\t * @param {Boolean} isStretched - make stretched block or not\n\t *\n\t * @description adds necessary information to wrap new created block by first-level holder\n\t */\n\t var composeNewBlock_ = function composeNewBlock_(block, tool, isStretched) {\n\t\n\t var newBlock = editor.draw.node('DIV', editor.ui.className.BLOCK_CLASSNAME, {}),\n\t blockContent = editor.draw.node('DIV', editor.ui.className.BLOCK_CONTENT, {});\n\t\n\t blockContent.appendChild(block);\n\t newBlock.appendChild(blockContent);\n\t\n\t if (isStretched) {\n\t\n\t blockContent.classList.add(editor.ui.className.BLOCK_STRETCHED);\n\t }\n\t\n\t newBlock.dataset.tool = tool;\n\t return newBlock;\n\t };\n\t\n\t /**\n\t * Returns Range object of current selection\n\t * @protected\n\t */\n\t content.getRange = function () {\n\t\n\t var selection = window.getSelection().getRangeAt(0);\n\t\n\t return selection;\n\t };\n\t\n\t /**\n\t * Divides block in two blocks (after and before caret)\n\t *\n\t * @protected\n\t * @param {int} inputIndex - target input index\n\t *\n\t * @description splits current input content to the separate blocks\n\t * When enter is pressed among the words, that text will be splited.\n\t */\n\t content.splitBlock = function (inputIndex) {\n\t\n\t var selection = window.getSelection(),\n\t anchorNode = selection.anchorNode,\n\t anchorNodeText = anchorNode.textContent,\n\t caretOffset = selection.anchorOffset,\n\t textBeforeCaret,\n\t textNodeBeforeCaret,\n\t textAfterCaret,\n\t textNodeAfterCaret;\n\t\n\t var currentBlock = editor.content.currentNode.querySelector('[contentEditable]');\n\t\n\t textBeforeCaret = anchorNodeText.substring(0, caretOffset);\n\t textAfterCaret = anchorNodeText.substring(caretOffset);\n\t\n\t textNodeBeforeCaret = document.createTextNode(textBeforeCaret);\n\t\n\t if (textAfterCaret) {\n\t\n\t textNodeAfterCaret = document.createTextNode(textAfterCaret);\n\t }\n\t\n\t var previousChilds = [],\n\t nextChilds = [],\n\t reachedCurrent = false;\n\t\n\t if (textNodeAfterCaret) {\n\t\n\t nextChilds.push(textNodeAfterCaret);\n\t }\n\t\n\t for (var i = 0, child; !!(child = currentBlock.childNodes[i]); i++) {\n\t\n\t if (child != anchorNode) {\n\t\n\t if (!reachedCurrent) {\n\t\n\t previousChilds.push(child);\n\t } else {\n\t\n\t nextChilds.push(child);\n\t }\n\t } else {\n\t\n\t reachedCurrent = true;\n\t }\n\t }\n\t\n\t /** Clear current input */\n\t editor.state.inputs[inputIndex].innerHTML = '';\n\t\n\t /**\n\t * Append all childs founded before anchorNode\n\t */\n\t var previousChildsLength = previousChilds.length;\n\t\n\t for (i = 0; i < previousChildsLength; i++) {\n\t\n\t editor.state.inputs[inputIndex].appendChild(previousChilds[i]);\n\t }\n\t\n\t editor.state.inputs[inputIndex].appendChild(textNodeBeforeCaret);\n\t\n\t /**\n\t * Append text node which is after caret\n\t */\n\t var nextChildsLength = nextChilds.length,\n\t newNode = document.createElement('div');\n\t\n\t for (i = 0; i < nextChildsLength; i++) {\n\t\n\t newNode.appendChild(nextChilds[i]);\n\t }\n\t\n\t newNode = newNode.innerHTML;\n\t\n\t /** This type of block creates when enter is pressed */\n\t var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\n\t\n\t /**\n\t * Make new paragraph with text after caret\n\t */\n\t editor.content.insertBlock({\n\t type: NEW_BLOCK_TYPE,\n\t block: editor.tools[NEW_BLOCK_TYPE].render({\n\t text: newNode\n\t })\n\t }, true);\n\t };\n\t\n\t /**\n\t * Merges two blocks — current and target\n\t * If target index is not exist, then previous will be as target\n\t *\n\t * @protected\n\t * @param {int} currentInputIndex\n\t * @param {int} targetInputIndex\n\t *\n\t * @description gets two inputs indexes and merges into one\n\t */\n\t content.mergeBlocks = function (currentInputIndex, targetInputIndex) {\n\t\n\t /** If current input index is zero, then prevent method execution */\n\t if (currentInputIndex === 0) {\n\t\n\t return;\n\t }\n\t\n\t var targetInput,\n\t currentInputContent = editor.state.inputs[currentInputIndex].innerHTML;\n\t\n\t if (!targetInputIndex) {\n\t\n\t targetInput = editor.state.inputs[currentInputIndex - 1];\n\t } else {\n\t\n\t targetInput = editor.state.inputs[targetInputIndex];\n\t }\n\t\n\t targetInput.innerHTML += currentInputContent;\n\t };\n\t\n\t /**\n\t * Iterates all right siblings and parents, which has right siblings\n\t * while it does not reached the first-level block\n\t *\n\t * @param {Element} node\n\t * @return {boolean}\n\t */\n\t content.isLastNode = function (node) {\n\t\n\t // console.log('погнали перебор родителей');\n\t\n\t var allChecked = false;\n\t\n\t while (!allChecked) {\n\t\n\t // console.log('Смотрим на %o', node);\n\t // console.log('Проверим, пустые ли соседи справа');\n\t\n\t if (!allSiblingsEmpty_(node)) {\n\t\n\t // console.log('Есть непустые соседи. Узел не последний. Выходим.');\n\t return false;\n\t }\n\t\n\t node = node.parentNode;\n\t\n\t /**\n\t * Проверяем родителей до тех пор, пока не найдем блок первого уровня\n\t */\n\t if (node.classList.contains(editor.ui.className.BLOCK_CONTENT)) {\n\t\n\t allChecked = true;\n\t }\n\t }\n\t\n\t return true;\n\t };\n\t\n\t /**\n\t * Checks if all element right siblings is empty\n\t * @param node\n\t */\n\t var allSiblingsEmpty_ = function allSiblingsEmpty_(node) {\n\t\n\t /**\n\t * Нужно убедиться, что после пустого соседа ничего нет\n\t */\n\t var sibling = node.nextSibling;\n\t\n\t while (sibling) {\n\t\n\t if (sibling.textContent.length) {\n\t\n\t return false;\n\t }\n\t\n\t sibling = sibling.nextSibling;\n\t }\n\t\n\t return true;\n\t };\n\t\n\t /**\n\t * @public\n\t *\n\t * @param {string} htmlData - html content as string\n\t * @param {string} plainData - plain text\n\t * @return {string} - html content as string\n\t */\n\t content.wrapTextWithParagraphs = function (htmlData, plainData) {\n\t\n\t if (!htmlData.trim()) {\n\t\n\t return wrapPlainTextWithParagraphs(plainData);\n\t }\n\t\n\t var wrapper = document.createElement('DIV'),\n\t newWrapper = document.createElement('DIV'),\n\t i,\n\t paragraph,\n\t firstLevelBlocks = ['DIV', 'P'],\n\t blockTyped,\n\t node;\n\t\n\t /**\n\t * Make HTML Element to Wrap Text\n\t * It allows us to work with input data as HTML content\n\t */\n\t wrapper.innerHTML = htmlData;\n\t paragraph = document.createElement('P');\n\t\n\t for (i = 0; i < wrapper.childNodes.length; i++) {\n\t\n\t node = wrapper.childNodes[i];\n\t\n\t blockTyped = firstLevelBlocks.indexOf(node.tagName) != -1;\n\t\n\t /**\n\t * If node is first-levet\n\t * we add this node to our new wrapper\n\t */\n\t if (blockTyped) {\n\t\n\t /**\n\t * If we had splitted inline nodes to paragraph before\n\t */\n\t if (paragraph.childNodes.length) {\n\t\n\t newWrapper.appendChild(paragraph.cloneNode(true));\n\t\n\t /** empty paragraph */\n\t paragraph = null;\n\t paragraph = document.createElement('P');\n\t }\n\t\n\t newWrapper.appendChild(node.cloneNode(true));\n\t } else {\n\t\n\t /** Collect all inline nodes to one as paragraph */\n\t paragraph.appendChild(node.cloneNode(true));\n\t\n\t /** if node is last we should append this node to paragraph and paragraph to new wrapper */\n\t if (i == wrapper.childNodes.length - 1) {\n\t\n\t newWrapper.appendChild(paragraph.cloneNode(true));\n\t }\n\t }\n\t }\n\t\n\t return newWrapper.innerHTML;\n\t };\n\t\n\t /**\n\t * Splits strings on new line and wraps paragraphs with

    tag\n\t * @param plainText\n\t * @returns {string}\n\t */\n\t var wrapPlainTextWithParagraphs = function wrapPlainTextWithParagraphs(plainText) {\n\t\n\t if (!plainText) return '';\n\t\n\t return '

    ' + plainText.split('\\n\\n').join('

    ') + '

    ';\n\t };\n\t\n\t /**\n\t * Finds closest Contenteditable parent from Element\n\t * @param {Element} node element looking from\n\t * @return {Element} node contenteditable\n\t */\n\t content.getEditableParent = function (node) {\n\t\n\t while (node && node.contentEditable != 'true') {\n\t\n\t node = node.parentNode;\n\t }\n\t\n\t return node;\n\t };\n\t\n\t /**\n\t * Clear editors content\n\t *\n\t * @param {Boolean} all — if true, delete all article data (content, id, etc.)\n\t */\n\t content.clear = function (all) {\n\t\n\t editor.nodes.redactor.innerHTML = '';\n\t editor.content.sync();\n\t editor.ui.saveInputs();\n\t if (all) {\n\t\n\t editor.state.blocks = {};\n\t } else if (editor.state.blocks) {\n\t\n\t editor.state.blocks.items = [];\n\t }\n\t\n\t editor.content.currentNode = null;\n\t };\n\t\n\t /**\n\t *\n\t * Load new data to editor\n\t * If editor is not empty, just append articleData.items\n\t *\n\t * @param articleData.items\n\t */\n\t content.load = function (articleData) {\n\t\n\t var currentContent = Object.assign({}, editor.state.blocks);\n\t\n\t editor.content.clear();\n\t\n\t if (!Object.keys(currentContent).length) {\n\t\n\t editor.state.blocks = articleData;\n\t } else if (!currentContent.items) {\n\t\n\t currentContent.items = articleData.items;\n\t editor.state.blocks = currentContent;\n\t } else {\n\t\n\t currentContent.items = currentContent.items.concat(articleData.items);\n\t editor.state.blocks = currentContent;\n\t }\n\t\n\t editor.renderer.makeBlocksFromData();\n\t };\n\t\n\t return content;\n\t}({});\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t/**\n\t * Codex Editor toolbar module\n\t *\n\t * Contains:\n\t * - Inline toolbox\n\t * - Toolbox within plus button\n\t * - Settings section\n\t *\n\t * @author Codex Team\n\t * @version 1.0\n\t */\n\t\n\tmodule.exports = function (toolbar) {\n\t\n\t var editor = codex.editor;\n\t\n\t toolbar.settings = __webpack_require__(9);\n\t toolbar.inline = __webpack_require__(10);\n\t toolbar.toolbox = __webpack_require__(11);\n\t\n\t /**\n\t * Margin between focused node and toolbar\n\t */\n\t toolbar.defaultToolbarHeight = 49;\n\t\n\t toolbar.defaultOffset = 34;\n\t\n\t toolbar.opened = false;\n\t\n\t toolbar.current = null;\n\t\n\t /**\n\t * @protected\n\t */\n\t toolbar.open = function () {\n\t\n\t if (editor.hideToolbar) {\n\t\n\t return;\n\t }\n\t\n\t var toolType = editor.content.currentNode.dataset.tool;\n\t\n\t if (!editor.tools[toolType] || !editor.tools[toolType].makeSettings) {\n\t\n\t editor.nodes.showSettingsButton.classList.add('hide');\n\t } else {\n\t\n\t editor.nodes.showSettingsButton.classList.remove('hide');\n\t }\n\t\n\t editor.nodes.toolbar.classList.add('opened');\n\t this.opened = true;\n\t };\n\t\n\t /**\n\t * @protected\n\t */\n\t toolbar.close = function () {\n\t\n\t editor.nodes.toolbar.classList.remove('opened');\n\t\n\t toolbar.opened = false;\n\t toolbar.current = null;\n\t\n\t for (var button in editor.nodes.toolbarButtons) {\n\t\n\t editor.nodes.toolbarButtons[button].classList.remove('selected');\n\t }\n\t\n\t /** Close toolbox when toolbar is not displayed */\n\t editor.toolbar.toolbox.close();\n\t editor.toolbar.settings.close();\n\t };\n\t\n\t toolbar.toggle = function () {\n\t\n\t if (!this.opened) {\n\t\n\t this.open();\n\t } else {\n\t\n\t this.close();\n\t }\n\t };\n\t\n\t toolbar.hidePlusButton = function () {\n\t\n\t editor.nodes.plusButton.classList.add('hide');\n\t };\n\t\n\t toolbar.showPlusButton = function () {\n\t\n\t editor.nodes.plusButton.classList.remove('hide');\n\t };\n\t\n\t /**\n\t * Moving toolbar to the specified node\n\t */\n\t toolbar.move = function () {\n\t\n\t /** Close Toolbox when we move toolbar */\n\t editor.toolbar.toolbox.close();\n\t\n\t if (!editor.content.currentNode) {\n\t\n\t return;\n\t }\n\t\n\t var newYCoordinate = editor.content.currentNode.offsetTop - editor.toolbar.defaultToolbarHeight / 2 + editor.toolbar.defaultOffset;\n\t\n\t editor.nodes.toolbar.style.transform = 'translate3D(0, ' + Math.floor(newYCoordinate) + 'px, 0)';\n\t\n\t /** Close trash actions */\n\t editor.toolbar.settings.hideRemoveActions();\n\t };\n\t\n\t return toolbar;\n\t}({});\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Toolbar settings\n\t *\n\t * @version 1.0.5\n\t */\n\t\n\tmodule.exports = function (settings) {\n\t\n\t var editor = codex.editor;\n\t\n\t settings.opened = false;\n\t\n\t settings.setting = null;\n\t settings.actions = null;\n\t\n\t /**\n\t * Append and open settings\n\t */\n\t settings.open = function (toolType) {\n\t\n\t /**\n\t * Append settings content\n\t * It's stored in tool.settings\n\t */\n\t if (!editor.tools[toolType] || !editor.tools[toolType].makeSettings) {\n\t\n\t return;\n\t }\n\t\n\t /**\n\t * Draw settings block\n\t */\n\t var settingsBlock = editor.tools[toolType].makeSettings();\n\t\n\t editor.nodes.pluginSettings.appendChild(settingsBlock);\n\t\n\t /** Open settings block */\n\t editor.nodes.blockSettings.classList.add('opened');\n\t this.opened = true;\n\t };\n\t\n\t /**\n\t * Close and clear settings\n\t */\n\t settings.close = function () {\n\t\n\t editor.nodes.blockSettings.classList.remove('opened');\n\t editor.nodes.pluginSettings.innerHTML = '';\n\t\n\t this.opened = false;\n\t };\n\t\n\t /**\n\t * @param {string} toolType - plugin type\n\t */\n\t settings.toggle = function (toolType) {\n\t\n\t if (!this.opened) {\n\t\n\t this.open(toolType);\n\t } else {\n\t\n\t this.close();\n\t }\n\t };\n\t\n\t /**\n\t * Here we will draw buttons and add listeners to components\n\t */\n\t settings.makeRemoveBlockButton = function () {\n\t\n\t var removeBlockWrapper = editor.draw.node('SPAN', 'ce-toolbar__remove-btn', {}),\n\t settingButton = editor.draw.node('SPAN', 'ce-toolbar__remove-setting', { innerHTML: '' }),\n\t actionWrapper = editor.draw.node('DIV', 'ce-toolbar__remove-confirmation', {}),\n\t confirmAction = editor.draw.node('DIV', 'ce-toolbar__remove-confirm', { textContent: 'Удалить блок' }),\n\t cancelAction = editor.draw.node('DIV', 'ce-toolbar__remove-cancel', { textContent: 'Отмена' });\n\t\n\t editor.listeners.add(settingButton, 'click', editor.toolbar.settings.removeButtonClicked, false);\n\t\n\t editor.listeners.add(confirmAction, 'click', editor.toolbar.settings.confirmRemovingRequest, false);\n\t\n\t editor.listeners.add(cancelAction, 'click', editor.toolbar.settings.cancelRemovingRequest, false);\n\t\n\t actionWrapper.appendChild(confirmAction);\n\t actionWrapper.appendChild(cancelAction);\n\t\n\t removeBlockWrapper.appendChild(settingButton);\n\t removeBlockWrapper.appendChild(actionWrapper);\n\t\n\t /** Save setting */\n\t editor.toolbar.settings.setting = settingButton;\n\t editor.toolbar.settings.actions = actionWrapper;\n\t\n\t return removeBlockWrapper;\n\t };\n\t\n\t settings.removeButtonClicked = function () {\n\t\n\t var action = editor.toolbar.settings.actions;\n\t\n\t if (action.classList.contains('opened')) {\n\t\n\t editor.toolbar.settings.hideRemoveActions();\n\t } else {\n\t\n\t editor.toolbar.settings.showRemoveActions();\n\t }\n\t\n\t editor.toolbar.toolbox.close();\n\t editor.toolbar.settings.close();\n\t };\n\t\n\t settings.cancelRemovingRequest = function () {\n\t\n\t editor.toolbar.settings.actions.classList.remove('opened');\n\t };\n\t\n\t settings.confirmRemovingRequest = function () {\n\t\n\t var currentBlock = editor.content.currentNode,\n\t firstLevelBlocksCount;\n\t\n\t currentBlock.remove();\n\t\n\t firstLevelBlocksCount = editor.nodes.redactor.childNodes.length;\n\t\n\t /**\n\t * If all blocks are removed\n\t */\n\t if (firstLevelBlocksCount === 0) {\n\t\n\t /** update currentNode variable */\n\t editor.content.currentNode = null;\n\t\n\t /** Inserting new empty initial block */\n\t editor.ui.addInitialBlock();\n\t }\n\t\n\t editor.ui.saveInputs();\n\t\n\t editor.toolbar.close();\n\t };\n\t\n\t settings.showRemoveActions = function () {\n\t\n\t editor.toolbar.settings.actions.classList.add('opened');\n\t };\n\t\n\t settings.hideRemoveActions = function () {\n\t\n\t editor.toolbar.settings.actions.classList.remove('opened');\n\t };\n\t\n\t return settings;\n\t}({});\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Inline toolbar\n\t *\n\t * Contains from tools:\n\t * Bold, Italic, Underline and Anchor\n\t *\n\t * @author Codex Team\n\t * @version 1.0\n\t */\n\t\n\tmodule.exports = function (inline) {\n\t\n\t var editor = codex.editor;\n\t\n\t inline.buttonsOpened = null;\n\t inline.actionsOpened = null;\n\t inline.wrappersOffset = null;\n\t\n\t /**\n\t * saving selection that need for execCommand for styling\n\t *\n\t */\n\t inline.storedSelection = null;\n\t\n\t /**\n\t * @protected\n\t *\n\t * Open inline toobar\n\t */\n\t inline.show = function () {\n\t\n\t var currentNode = editor.content.currentNode,\n\t tool = currentNode.dataset.tool,\n\t plugin;\n\t\n\t /**\n\t * tool allowed to open inline toolbar\n\t */\n\t plugin = editor.tools[tool];\n\t\n\t if (!plugin.showInlineToolbar) return;\n\t\n\t var selectedText = inline.getSelectionText(),\n\t toolbar = editor.nodes.inlineToolbar.wrapper;\n\t\n\t if (selectedText.length > 0) {\n\t\n\t /** Move toolbar and open */\n\t editor.toolbar.inline.move();\n\t\n\t /** Open inline toolbar */\n\t toolbar.classList.add('opened');\n\t\n\t /** show buttons of inline toolbar */\n\t editor.toolbar.inline.showButtons();\n\t }\n\t };\n\t\n\t /**\n\t * @protected\n\t *\n\t * Closes inline toolbar\n\t */\n\t inline.close = function () {\n\t\n\t var toolbar = editor.nodes.inlineToolbar.wrapper;\n\t\n\t toolbar.classList.remove('opened');\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * Moving toolbar\n\t */\n\t inline.move = function () {\n\t\n\t if (!this.wrappersOffset) {\n\t\n\t this.wrappersOffset = this.getWrappersOffset();\n\t }\n\t\n\t var coords = this.getSelectionCoords(),\n\t defaultOffset = 0,\n\t toolbar = editor.nodes.inlineToolbar.wrapper,\n\t newCoordinateX,\n\t newCoordinateY;\n\t\n\t if (toolbar.offsetHeight === 0) {\n\t\n\t defaultOffset = 40;\n\t }\n\t\n\t newCoordinateX = coords.x - this.wrappersOffset.left;\n\t newCoordinateY = coords.y + window.scrollY - this.wrappersOffset.top - defaultOffset - toolbar.offsetHeight;\n\t\n\t toolbar.style.transform = 'translate3D(' + Math.floor(newCoordinateX) + 'px, ' + Math.floor(newCoordinateY) + 'px, 0)';\n\t\n\t /** Close everything */\n\t editor.toolbar.inline.closeButtons();\n\t editor.toolbar.inline.closeAction();\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * Tool Clicked\n\t */\n\t\n\t inline.toolClicked = function (event, type) {\n\t\n\t /**\n\t * For simple tools we use default browser function\n\t * For more complicated tools, we should write our own behavior\n\t */\n\t switch (type) {\n\t case 'createLink':\n\t editor.toolbar.inline.createLinkAction(event, type);break;\n\t default:\n\t editor.toolbar.inline.defaultToolAction(type);break;\n\t }\n\t\n\t /**\n\t * highlight buttons\n\t * after making some action\n\t */\n\t editor.nodes.inlineToolbar.buttons.childNodes.forEach(editor.toolbar.inline.hightlight);\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * Saving wrappers offset in DOM\n\t */\n\t inline.getWrappersOffset = function () {\n\t\n\t var wrapper = editor.nodes.wrapper,\n\t offset = this.getOffset(wrapper);\n\t\n\t this.wrappersOffset = offset;\n\t return offset;\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * Calculates offset of DOM element\n\t *\n\t * @param el\n\t * @returns {{top: number, left: number}}\n\t */\n\t inline.getOffset = function (el) {\n\t\n\t var _x = 0;\n\t var _y = 0;\n\t\n\t while (el && !isNaN(el.offsetLeft) && !isNaN(el.offsetTop)) {\n\t\n\t _x += el.offsetLeft + el.clientLeft;\n\t _y += el.offsetTop + el.clientTop;\n\t el = el.offsetParent;\n\t }\n\t return { top: _y, left: _x };\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * Calculates position of selected text\n\t * @returns {{x: number, y: number}}\n\t */\n\t inline.getSelectionCoords = function () {\n\t\n\t var sel = document.selection,\n\t range;\n\t var x = 0,\n\t y = 0;\n\t\n\t if (sel) {\n\t\n\t if (sel.type != 'Control') {\n\t\n\t range = sel.createRange();\n\t range.collapse(true);\n\t x = range.boundingLeft;\n\t y = range.boundingTop;\n\t }\n\t } else if (window.getSelection) {\n\t\n\t sel = window.getSelection();\n\t\n\t if (sel.rangeCount) {\n\t\n\t range = sel.getRangeAt(0).cloneRange();\n\t if (range.getClientRects) {\n\t\n\t range.collapse(true);\n\t var rect = range.getClientRects()[0];\n\t\n\t if (!rect) {\n\t\n\t return;\n\t }\n\t\n\t x = rect.left;\n\t y = rect.top;\n\t }\n\t }\n\t }\n\t return { x: x, y: y };\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * Returns selected text as String\n\t * @returns {string}\n\t */\n\t inline.getSelectionText = function () {\n\t\n\t var selectedText = '';\n\t\n\t // all modern browsers and IE9+\n\t if (window.getSelection) {\n\t\n\t selectedText = window.getSelection().toString();\n\t }\n\t\n\t return selectedText;\n\t };\n\t\n\t /** Opens buttons block */\n\t inline.showButtons = function () {\n\t\n\t var buttons = editor.nodes.inlineToolbar.buttons;\n\t\n\t buttons.classList.add('opened');\n\t\n\t editor.toolbar.inline.buttonsOpened = true;\n\t\n\t /** highlight buttons */\n\t editor.nodes.inlineToolbar.buttons.childNodes.forEach(editor.toolbar.inline.hightlight);\n\t };\n\t\n\t /** Makes buttons disappear */\n\t inline.closeButtons = function () {\n\t\n\t var buttons = editor.nodes.inlineToolbar.buttons;\n\t\n\t buttons.classList.remove('opened');\n\t\n\t editor.toolbar.inline.buttonsOpened = false;\n\t };\n\t\n\t /** Open buttons defined action if exist */\n\t inline.showActions = function () {\n\t\n\t var action = editor.nodes.inlineToolbar.actions;\n\t\n\t action.classList.add('opened');\n\t\n\t editor.toolbar.inline.actionsOpened = true;\n\t };\n\t\n\t /** Close actions block */\n\t inline.closeAction = function () {\n\t\n\t var action = editor.nodes.inlineToolbar.actions;\n\t\n\t action.innerHTML = '';\n\t action.classList.remove('opened');\n\t editor.toolbar.inline.actionsOpened = false;\n\t };\n\t\n\t /**\n\t * Callback for keydowns in inline toolbar \"Insert link...\" input\n\t */\n\t var inlineToolbarAnchorInputKeydown_ = function inlineToolbarAnchorInputKeydown_(event) {\n\t\n\t if (event.keyCode != editor.core.keys.ENTER) {\n\t\n\t return;\n\t }\n\t\n\t var editable = editor.content.currentNode,\n\t storedSelection = editor.toolbar.inline.storedSelection;\n\t\n\t editor.toolbar.inline.restoreSelection(editable, storedSelection);\n\t editor.toolbar.inline.setAnchor(this.value);\n\t\n\t /**\n\t * Preventing events that will be able to happen\n\t */\n\t event.preventDefault();\n\t event.stopImmediatePropagation();\n\t\n\t editor.toolbar.inline.clearRange();\n\t };\n\t\n\t /** Action for link creation or for setting anchor */\n\t inline.createLinkAction = function (event) {\n\t\n\t var isActive = this.isLinkActive();\n\t\n\t var editable = editor.content.currentNode,\n\t storedSelection = editor.toolbar.inline.saveSelection(editable);\n\t\n\t /** Save globally selection */\n\t editor.toolbar.inline.storedSelection = storedSelection;\n\t\n\t if (isActive) {\n\t\n\t /**\n\t * Changing stored selection. if we want to remove anchor from word\n\t * we should remove anchor from whole word, not only selected part.\n\t * The solution is than we get the length of current link\n\t * Change start position to - end of selection minus length of anchor\n\t */\n\t editor.toolbar.inline.restoreSelection(editable, storedSelection);\n\t\n\t editor.toolbar.inline.defaultToolAction('unlink');\n\t } else {\n\t\n\t /** Create input and close buttons */\n\t var action = editor.draw.inputForLink();\n\t\n\t editor.nodes.inlineToolbar.actions.appendChild(action);\n\t\n\t editor.toolbar.inline.closeButtons();\n\t editor.toolbar.inline.showActions();\n\t\n\t /**\n\t * focus to input\n\t * Solution: https://developer.mozilla.org/ru/docs/Web/API/HTMLElement/focus\n\t * Prevents event after showing input and when we need to focus an input which is in unexisted form\n\t */\n\t action.focus();\n\t event.preventDefault();\n\t\n\t /** Callback to link action */\n\t editor.listeners.add(action, 'keydown', inlineToolbarAnchorInputKeydown_, false);\n\t }\n\t };\n\t\n\t inline.isLinkActive = function () {\n\t\n\t var isActive = false;\n\t\n\t editor.nodes.inlineToolbar.buttons.childNodes.forEach(function (tool) {\n\t\n\t var dataType = tool.dataset.type;\n\t\n\t if (dataType == 'link' && tool.classList.contains('hightlighted')) {\n\t\n\t isActive = true;\n\t }\n\t });\n\t\n\t return isActive;\n\t };\n\t\n\t /** default action behavior of tool */\n\t inline.defaultToolAction = function (type) {\n\t\n\t document.execCommand(type, false, null);\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * Sets URL\n\t *\n\t * @param {String} url - URL\n\t */\n\t inline.setAnchor = function (url) {\n\t\n\t document.execCommand('createLink', false, url);\n\t\n\t /** Close after URL inserting */\n\t editor.toolbar.inline.closeAction();\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * Saves selection\n\t */\n\t inline.saveSelection = function (containerEl) {\n\t\n\t var range = window.getSelection().getRangeAt(0),\n\t preSelectionRange = range.cloneRange(),\n\t start;\n\t\n\t preSelectionRange.selectNodeContents(containerEl);\n\t preSelectionRange.setEnd(range.startContainer, range.startOffset);\n\t\n\t start = preSelectionRange.toString().length;\n\t\n\t return {\n\t start: start,\n\t end: start + range.toString().length\n\t };\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * Sets to previous selection (Range)\n\t *\n\t * @param {Element} containerEl - editable element where we restore range\n\t * @param {Object} savedSel - range basic information to restore\n\t */\n\t inline.restoreSelection = function (containerEl, savedSel) {\n\t\n\t var range = document.createRange(),\n\t charIndex = 0;\n\t\n\t range.setStart(containerEl, 0);\n\t range.collapse(true);\n\t\n\t var nodeStack = [containerEl],\n\t node,\n\t foundStart = false,\n\t stop = false,\n\t nextCharIndex;\n\t\n\t while (!stop && (node = nodeStack.pop())) {\n\t\n\t if (node.nodeType == 3) {\n\t\n\t nextCharIndex = charIndex + node.length;\n\t\n\t if (!foundStart && savedSel.start >= charIndex && savedSel.start <= nextCharIndex) {\n\t\n\t range.setStart(node, savedSel.start - charIndex);\n\t foundStart = true;\n\t }\n\t if (foundStart && savedSel.end >= charIndex && savedSel.end <= nextCharIndex) {\n\t\n\t range.setEnd(node, savedSel.end - charIndex);\n\t stop = true;\n\t }\n\t charIndex = nextCharIndex;\n\t } else {\n\t\n\t var i = node.childNodes.length;\n\t\n\t while (i--) {\n\t\n\t nodeStack.push(node.childNodes[i]);\n\t }\n\t }\n\t }\n\t\n\t var sel = window.getSelection();\n\t\n\t sel.removeAllRanges();\n\t sel.addRange(range);\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * Removes all ranges from window selection\n\t */\n\t inline.clearRange = function () {\n\t\n\t var selection = window.getSelection();\n\t\n\t selection.removeAllRanges();\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * sets or removes hightlight\n\t */\n\t inline.hightlight = function (tool) {\n\t\n\t var dataType = tool.dataset.type;\n\t\n\t if (document.queryCommandState(dataType)) {\n\t\n\t editor.toolbar.inline.setButtonHighlighted(tool);\n\t } else {\n\t\n\t editor.toolbar.inline.removeButtonsHighLight(tool);\n\t }\n\t\n\t /**\n\t *\n\t * hightlight for anchors\n\t */\n\t var selection = window.getSelection(),\n\t tag = selection.anchorNode.parentNode;\n\t\n\t if (tag.tagName == 'A' && dataType == 'link') {\n\t\n\t editor.toolbar.inline.setButtonHighlighted(tool);\n\t }\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * Mark button if text is already executed\n\t */\n\t inline.setButtonHighlighted = function (button) {\n\t\n\t button.classList.add('hightlighted');\n\t\n\t /** At link tool we also change icon */\n\t if (button.dataset.type == 'link') {\n\t\n\t var icon = button.childNodes[0];\n\t\n\t icon.classList.remove('ce-icon-link');\n\t icon.classList.add('ce-icon-unlink');\n\t }\n\t };\n\t\n\t /**\n\t * @private\n\t *\n\t * Removes hightlight\n\t */\n\t inline.removeButtonsHighLight = function (button) {\n\t\n\t button.classList.remove('hightlighted');\n\t\n\t /** At link tool we also change icon */\n\t if (button.dataset.type == 'link') {\n\t\n\t var icon = button.childNodes[0];\n\t\n\t icon.classList.remove('ce-icon-unlink');\n\t icon.classList.add('ce-icon-link');\n\t }\n\t };\n\t\n\t return inline;\n\t}({});\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Codex Editor toolbox\n\t *\n\t * All tools be able to appended here\n\t *\n\t * @author Codex Team\n\t * @version 1.0\n\t */\n\t\n\tmodule.exports = function (toolbox) {\n\t\n\t var editor = codex.editor;\n\t\n\t toolbox.opened = false;\n\t toolbox.openedOnBlock = null;\n\t\n\t /** Shows toolbox */\n\t toolbox.open = function () {\n\t\n\t /** Close setting if toolbox is opened */\n\t if (editor.toolbar.settings.opened) {\n\t\n\t editor.toolbar.settings.close();\n\t }\n\t\n\t /** Add 'toolbar-opened' class for current block **/\n\t toolbox.openedOnBlock = editor.content.currentNode;\n\t toolbox.openedOnBlock.classList.add('toolbar-opened');\n\t\n\t /** display toolbox */\n\t editor.nodes.toolbox.classList.add('opened');\n\t\n\t /** Animate plus button */\n\t editor.nodes.plusButton.classList.add('clicked');\n\t\n\t /** toolbox state */\n\t editor.toolbar.toolbox.opened = true;\n\t };\n\t\n\t /** Closes toolbox */\n\t toolbox.close = function () {\n\t\n\t /** Remove 'toolbar-opened' class from current block **/\n\t if (toolbox.openedOnBlock) toolbox.openedOnBlock.classList.remove('toolbar-opened');\n\t toolbox.openedOnBlock = null;\n\t\n\t /** Makes toolbox disappear */\n\t editor.nodes.toolbox.classList.remove('opened');\n\t\n\t /** Rotate plus button */\n\t editor.nodes.plusButton.classList.remove('clicked');\n\t\n\t /** toolbox state */\n\t editor.toolbar.toolbox.opened = false;\n\t\n\t editor.toolbar.current = null;\n\t };\n\t\n\t toolbox.leaf = function () {\n\t\n\t var currentTool = editor.toolbar.current,\n\t tools = Object.keys(editor.tools),\n\t barButtons = editor.nodes.toolbarButtons,\n\t nextToolIndex = 0,\n\t toolToSelect = void 0,\n\t visibleTool = void 0,\n\t tool = void 0;\n\t\n\t if (!currentTool) {\n\t\n\t /** Get first tool from object*/\n\t for (tool in editor.tools) {\n\t\n\t if (editor.tools[tool].displayInToolbox) {\n\t\n\t break;\n\t }\n\t\n\t nextToolIndex++;\n\t }\n\t } else {\n\t\n\t nextToolIndex = (tools.indexOf(currentTool) + 1) % tools.length;\n\t visibleTool = tools[nextToolIndex];\n\t\n\t while (!editor.tools[visibleTool].displayInToolbox) {\n\t\n\t nextToolIndex = (nextToolIndex + 1) % tools.length;\n\t visibleTool = tools[nextToolIndex];\n\t }\n\t }\n\t\n\t toolToSelect = tools[nextToolIndex];\n\t\n\t for (var button in barButtons) {\n\t\n\t barButtons[button].classList.remove('selected');\n\t }\n\t\n\t barButtons[toolToSelect].classList.add('selected');\n\t editor.toolbar.current = toolToSelect;\n\t };\n\t\n\t /**\n\t * Transforming selected node type into selected toolbar element type\n\t * @param {event} event\n\t */\n\t toolbox.toolClicked = function (event) {\n\t\n\t /**\n\t * UNREPLACEBLE_TOOLS this types of tools are forbidden to replace even they are empty\n\t */\n\t var UNREPLACEBLE_TOOLS = ['image', 'link', 'list', 'instagram', 'twitter', 'embed'],\n\t tool = editor.tools[editor.toolbar.current],\n\t workingNode = editor.content.currentNode,\n\t currentInputIndex = editor.caret.inputIndex,\n\t newBlockContent,\n\t appendCallback,\n\t blockData;\n\t\n\t /** Make block from plugin */\n\t newBlockContent = tool.render();\n\t\n\t /** information about block */\n\t blockData = {\n\t block: newBlockContent,\n\t type: tool.type,\n\t stretched: false\n\t };\n\t\n\t if (workingNode && UNREPLACEBLE_TOOLS.indexOf(workingNode.dataset.tool) === -1 && workingNode.textContent.trim() === '') {\n\t\n\t /** Replace current block */\n\t editor.content.switchBlock(workingNode, newBlockContent, tool.type);\n\t } else {\n\t\n\t /** Insert new Block from plugin */\n\t editor.content.insertBlock(blockData);\n\t\n\t /** increase input index */\n\t currentInputIndex++;\n\t }\n\t\n\t /** Fire tool append callback */\n\t appendCallback = tool.appendCallback;\n\t\n\t if (appendCallback && typeof appendCallback == 'function') {\n\t\n\t appendCallback.call(event);\n\t }\n\t\n\t window.setTimeout(function () {\n\t\n\t /** Set caret to current block */\n\t editor.caret.setToBlock(currentInputIndex);\n\t }, 10);\n\t\n\t /**\n\t * Changing current Node\n\t */\n\t editor.content.workingNodeChanged();\n\t\n\t /**\n\t * Move toolbar when node is changed\n\t */\n\t editor.toolbar.move();\n\t };\n\t\n\t return toolbox;\n\t}({});\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * @module Codex Editor Callbacks module\n\t * @description Module works with editor added Elements\n\t *\n\t * @author Codex Team\n\t * @version 1.4.0\n\t */\n\t\n\tmodule.exports = function (callbacks) {\n\t\n\t var editor = codex.editor;\n\t\n\t /**\n\t * used by UI module\n\t * @description Routes all keydowns on document\n\t * @param {Object} event\n\t */\n\t callbacks.globalKeydown = function (event) {\n\t\n\t switch (event.keyCode) {\n\t case editor.core.keys.ENTER:\n\t enterKeyPressed_(event);break;\n\t }\n\t };\n\t\n\t /**\n\t * used by UI module\n\t * @description Routes all keydowns on redactors area\n\t * @param {Object} event\n\t */\n\t callbacks.redactorKeyDown = function (event) {\n\t\n\t switch (event.keyCode) {\n\t case editor.core.keys.TAB:\n\t tabKeyPressedOnRedactorsZone_(event);break;\n\t case editor.core.keys.ENTER:\n\t enterKeyPressedOnRedactorsZone_(event);break;\n\t case editor.core.keys.ESC:\n\t escapeKeyPressedOnRedactorsZone_(event);break;\n\t default:\n\t defaultKeyPressedOnRedactorsZone_(event);break;\n\t }\n\t };\n\t\n\t /**\n\t * used by UI module\n\t * @description Routes all keyup events\n\t * @param {Object} event\n\t */\n\t callbacks.globalKeyup = function (event) {\n\t\n\t switch (event.keyCode) {\n\t case editor.core.keys.UP:\n\t case editor.core.keys.LEFT:\n\t case editor.core.keys.RIGHT:\n\t case editor.core.keys.DOWN:\n\t arrowKeyPressed_(event);break;\n\t }\n\t };\n\t\n\t /**\n\t * @param {Object} event\n\t * @private\n\t *\n\t * Handles behaviour when tab pressed\n\t * @description if Content is empty show toolbox (if it is closed) or leaf tools\n\t * uses Toolbars toolbox module to handle the situation\n\t */\n\t var tabKeyPressedOnRedactorsZone_ = function tabKeyPressedOnRedactorsZone_(event) {\n\t\n\t /**\n\t * Wait for solution. Would like to know the behaviour\n\t * @todo Add spaces\n\t */\n\t event.preventDefault();\n\t\n\t if (!editor.core.isBlockEmpty(editor.content.currentNode)) {\n\t\n\t return;\n\t }\n\t\n\t if (!editor.toolbar.opened) {\n\t\n\t editor.toolbar.open();\n\t }\n\t\n\t if (editor.toolbar.opened && !editor.toolbar.toolbox.opened) {\n\t\n\t editor.toolbar.toolbox.open();\n\t } else {\n\t\n\t editor.toolbar.toolbox.leaf();\n\t }\n\t };\n\t\n\t /**\n\t * Handles global EnterKey Press\n\t * @see enterPressedOnBlock_\n\t * @param {Object} event\n\t */\n\t var enterKeyPressed_ = function enterKeyPressed_() {\n\t\n\t if (editor.content.editorAreaHightlighted) {\n\t\n\t /**\n\t * it means that we lose input index, saved index before is not correct\n\t * therefore we need to set caret when we insert new block\n\t */\n\t editor.caret.inputIndex = -1;\n\t\n\t enterPressedOnBlock_();\n\t }\n\t };\n\t\n\t /**\n\t * Callback for enter key pressing in first-level block area\n\t *\n\t * @param {Event} event\n\t * @private\n\t *\n\t * @description Inserts new block with initial type from settings\n\t */\n\t var enterPressedOnBlock_ = function enterPressedOnBlock_() {\n\t\n\t var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\n\t\n\t editor.content.insertBlock({\n\t type: NEW_BLOCK_TYPE,\n\t block: editor.tools[NEW_BLOCK_TYPE].render()\n\t }, true);\n\t\n\t editor.toolbar.move();\n\t editor.toolbar.open();\n\t };\n\t\n\t /**\n\t * ENTER key handler\n\t *\n\t * @param {Object} event\n\t * @private\n\t *\n\t * @description Makes new block with initial type from settings\n\t */\n\t var enterKeyPressedOnRedactorsZone_ = function enterKeyPressedOnRedactorsZone_(event) {\n\t\n\t if (event.target.contentEditable == 'true') {\n\t\n\t /** Update input index */\n\t editor.caret.saveCurrentInputIndex();\n\t }\n\t\n\t var currentInputIndex = editor.caret.getCurrentInputIndex() || 0,\n\t workingNode = editor.content.currentNode,\n\t tool = workingNode.dataset.tool,\n\t isEnterPressedOnToolbar = editor.toolbar.opened && editor.toolbar.current && event.target == editor.state.inputs[currentInputIndex];\n\t\n\t /** The list of tools which needs the default browser behaviour */\n\t var enableLineBreaks = editor.tools[tool].enableLineBreaks;\n\t\n\t /** This type of block creates when enter is pressed */\n\t var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\n\t\n\t /**\n\t * When toolbar is opened, select tool instead of making new paragraph\n\t */\n\t if (isEnterPressedOnToolbar) {\n\t\n\t event.preventDefault();\n\t\n\t editor.toolbar.toolbox.toolClicked(event);\n\t\n\t editor.toolbar.close();\n\t\n\t /**\n\t * Stop other listeners callback executions\n\t */\n\t event.stopPropagation();\n\t event.stopImmediatePropagation();\n\t\n\t return;\n\t }\n\t\n\t /**\n\t * Allow paragraph lineBreaks with shift enter\n\t * Or if shiftkey pressed and enter and enabledLineBreaks, the let new block creation\n\t */\n\t if (event.shiftKey || enableLineBreaks) {\n\t\n\t event.stopPropagation();\n\t event.stopImmediatePropagation();\n\t return;\n\t }\n\t\n\t var currentSelection = window.getSelection(),\n\t currentSelectedNode = currentSelection.anchorNode,\n\t caretAtTheEndOfText = editor.caret.position.atTheEnd(),\n\t isTextNodeHasParentBetweenContenteditable = false;\n\t\n\t /**\n\t * Allow making new

    in same block by SHIFT+ENTER and forbids to prevent default browser behaviour\n\t */\n\t if (event.shiftKey && !enableLineBreaks) {\n\t\n\t editor.callback.enterPressedOnBlock(editor.content.currentBlock, event);\n\t event.preventDefault();\n\t return;\n\t }\n\t\n\t /**\n\t * Workaround situation when caret at the Text node that has some wrapper Elements\n\t * Split block cant handle this.\n\t * We need to save default behavior\n\t */\n\t isTextNodeHasParentBetweenContenteditable = currentSelectedNode && currentSelectedNode.parentNode.contentEditable != 'true';\n\t\n\t /**\n\t * Split blocks when input has several nodes and caret placed in textNode\n\t */\n\t if (currentSelectedNode.nodeType == editor.core.nodeTypes.TEXT && !isTextNodeHasParentBetweenContenteditable && !caretAtTheEndOfText) {\n\t\n\t event.preventDefault();\n\t\n\t editor.core.log('Splitting Text node...');\n\t\n\t editor.content.splitBlock(currentInputIndex);\n\t\n\t /** Show plus button when next input after split is empty*/\n\t if (!editor.state.inputs[currentInputIndex + 1].textContent.trim()) {\n\t\n\t editor.toolbar.showPlusButton();\n\t }\n\t } else {\n\t\n\t var islastNode = editor.content.isLastNode(currentSelectedNode);\n\t\n\t if (islastNode && caretAtTheEndOfText) {\n\t\n\t event.preventDefault();\n\t event.stopPropagation();\n\t event.stopImmediatePropagation();\n\t\n\t editor.core.log('ENTER clicked in last textNode. Create new BLOCK');\n\t\n\t editor.content.insertBlock({\n\t type: NEW_BLOCK_TYPE,\n\t block: editor.tools[NEW_BLOCK_TYPE].render()\n\t }, true);\n\t\n\t editor.toolbar.move();\n\t editor.toolbar.open();\n\t\n\t /** Show plus button with empty block */\n\t editor.toolbar.showPlusButton();\n\t }\n\t }\n\t\n\t /** get all inputs after new appending block */\n\t editor.ui.saveInputs();\n\t };\n\t\n\t /**\n\t * Escape behaviour\n\t * @param event\n\t * @private\n\t *\n\t * @description Closes toolbox and toolbar. Prevents default behaviour\n\t */\n\t var escapeKeyPressedOnRedactorsZone_ = function escapeKeyPressedOnRedactorsZone_(event) {\n\t\n\t /** Close all toolbar */\n\t editor.toolbar.close();\n\t\n\t /** Close toolbox */\n\t editor.toolbar.toolbox.close();\n\t\n\t event.preventDefault();\n\t };\n\t\n\t /**\n\t * @param {Event} event\n\t * @private\n\t *\n\t * closes and moves toolbar\n\t */\n\t var arrowKeyPressed_ = function arrowKeyPressed_(event) {\n\t\n\t editor.content.workingNodeChanged();\n\t\n\t /* Closing toolbar */\n\t editor.toolbar.close();\n\t editor.toolbar.move();\n\t };\n\t\n\t /**\n\t * @private\n\t * @param {Event} event\n\t *\n\t * @description Closes all opened bars from toolbar.\n\t * If block is mark, clears highlightning\n\t */\n\t var defaultKeyPressedOnRedactorsZone_ = function defaultKeyPressedOnRedactorsZone_() {\n\t\n\t editor.toolbar.close();\n\t\n\t if (!editor.toolbar.inline.actionsOpened) {\n\t\n\t editor.toolbar.inline.close();\n\t editor.content.clearMark();\n\t }\n\t };\n\t\n\t /**\n\t * Handler when clicked on redactors area\n\t *\n\t * @protected\n\t * @param event\n\t *\n\t * @description Detects clicked area. If it is first-level block area, marks as detected and\n\t * on next enter press will be inserted new block\n\t * Otherwise, save carets position (input index) and put caret to the editable zone.\n\t *\n\t * @see detectWhenClickedOnFirstLevelBlockArea_\n\t *\n\t */\n\t callbacks.redactorClicked = function (event) {\n\t\n\t detectWhenClickedOnFirstLevelBlockArea_();\n\t\n\t editor.content.workingNodeChanged(event.target);\n\t editor.ui.saveInputs();\n\t\n\t var selectedText = editor.toolbar.inline.getSelectionText(),\n\t firstLevelBlock;\n\t\n\t /** If selection range took off, then we hide inline toolbar */\n\t if (selectedText.length === 0) {\n\t\n\t editor.toolbar.inline.close();\n\t }\n\t\n\t /** Update current input index in memory when caret focused into existed input */\n\t if (event.target.contentEditable == 'true') {\n\t\n\t editor.caret.saveCurrentInputIndex();\n\t }\n\t\n\t if (editor.content.currentNode === null) {\n\t\n\t /**\n\t * If inputs in redactor does not exits, then we put input index 0 not -1\n\t */\n\t var indexOfLastInput = editor.state.inputs.length > 0 ? editor.state.inputs.length - 1 : 0;\n\t\n\t /** If we have any inputs */\n\t if (editor.state.inputs.length) {\n\t\n\t /** getting firstlevel parent of input */\n\t firstLevelBlock = editor.content.getFirstLevelBlock(editor.state.inputs[indexOfLastInput]);\n\t }\n\t\n\t /** If input is empty, then we set caret to the last input */\n\t if (editor.state.inputs.length && editor.state.inputs[indexOfLastInput].textContent === '' && firstLevelBlock.dataset.tool == editor.settings.initialBlockPlugin) {\n\t\n\t editor.caret.setToBlock(indexOfLastInput);\n\t } else {\n\t\n\t /** Create new input when caret clicked in redactors area */\n\t var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\n\t\n\t editor.content.insertBlock({\n\t type: NEW_BLOCK_TYPE,\n\t block: editor.tools[NEW_BLOCK_TYPE].render()\n\t });\n\t\n\t /** If there is no inputs except inserted */\n\t if (editor.state.inputs.length === 1) {\n\t\n\t editor.caret.setToBlock(indexOfLastInput);\n\t } else {\n\t\n\t /** Set caret to this appended input */\n\t editor.caret.setToNextBlock(indexOfLastInput);\n\t }\n\t }\n\t } else {\n\t\n\t /** Close all panels */\n\t editor.toolbar.settings.close();\n\t editor.toolbar.toolbox.close();\n\t }\n\t\n\t /**\n\t * Move toolbar and open\n\t */\n\t editor.toolbar.move();\n\t editor.toolbar.open();\n\t\n\t var inputIsEmpty = !editor.content.currentNode.textContent.trim(),\n\t currentNodeType = editor.content.currentNode.dataset.tool,\n\t isInitialType = currentNodeType == editor.settings.initialBlockPlugin;\n\t\n\t /** Hide plus buttons */\n\t editor.toolbar.hidePlusButton();\n\t\n\t if (!inputIsEmpty) {\n\t\n\t /** Mark current block */\n\t editor.content.markBlock();\n\t }\n\t\n\t if (isInitialType && inputIsEmpty) {\n\t\n\t /** Show plus button */\n\t editor.toolbar.showPlusButton();\n\t }\n\t };\n\t\n\t /**\n\t * This method allows to define, is caret in contenteditable element or not.\n\t *\n\t * @private\n\t *\n\t * @description Otherwise, if we get TEXT node from range container, that will means we have input index.\n\t * In this case we use default browsers behaviour (if plugin allows that) or overwritten action.\n\t * Therefore, to be sure that we've clicked first-level block area, we should have currentNode, which always\n\t * specifies to the first-level block. Other cases we just ignore.\n\t */\n\t var detectWhenClickedOnFirstLevelBlockArea_ = function detectWhenClickedOnFirstLevelBlockArea_() {\n\t\n\t var selection = window.getSelection(),\n\t anchorNode = selection.anchorNode,\n\t flag = false;\n\t\n\t if (selection.rangeCount === 0) {\n\t\n\t editor.content.editorAreaHightlighted = true;\n\t } else {\n\t\n\t if (!editor.core.isDomNode(anchorNode)) {\n\t\n\t anchorNode = anchorNode.parentNode;\n\t }\n\t\n\t /** Already founded, without loop */\n\t if (anchorNode.contentEditable == 'true') {\n\t\n\t flag = true;\n\t }\n\t\n\t while (anchorNode.contentEditable != 'true') {\n\t\n\t anchorNode = anchorNode.parentNode;\n\t\n\t if (anchorNode.contentEditable == 'true') {\n\t\n\t flag = true;\n\t }\n\t\n\t if (anchorNode == document.body) {\n\t\n\t break;\n\t }\n\t }\n\t\n\t /** If editable element founded, flag is \"TRUE\", Therefore we return \"FALSE\" */\n\t editor.content.editorAreaHightlighted = !flag;\n\t }\n\t };\n\t\n\t /**\n\t * Toolbar button click handler\n\t *\n\t * @param {Object} event - cursor to the button\n\t * @protected\n\t *\n\t * @description gets current tool and calls render method\n\t */\n\t callbacks.toolbarButtonClicked = function (event) {\n\t\n\t var button = this;\n\t\n\t editor.toolbar.current = button.dataset.type;\n\t\n\t editor.toolbar.toolbox.toolClicked(event);\n\t editor.toolbar.close();\n\t };\n\t\n\t /**\n\t * Show or Hide toolbox when plus button is clicked\n\t */\n\t callbacks.plusButtonClicked = function () {\n\t\n\t if (!editor.nodes.toolbox.classList.contains('opened')) {\n\t\n\t editor.toolbar.toolbox.open();\n\t } else {\n\t\n\t editor.toolbar.toolbox.close();\n\t }\n\t };\n\t\n\t /**\n\t * Block handlers for KeyDown events\n\t *\n\t * @protected\n\t * @param {Object} event\n\t *\n\t * Handles keydowns on block\n\t * @see blockRightOrDownArrowPressed_\n\t * @see backspacePressed_\n\t * @see blockLeftOrUpArrowPressed_\n\t */\n\t callbacks.blockKeydown = function (event) {\n\t\n\t var block = event.target; // event.target is input\n\t\n\t switch (event.keyCode) {\n\t\n\t case editor.core.keys.DOWN:\n\t case editor.core.keys.RIGHT:\n\t blockRightOrDownArrowPressed_(event);\n\t break;\n\t\n\t case editor.core.keys.BACKSPACE:\n\t backspacePressed_(block, event);\n\t break;\n\t\n\t case editor.core.keys.UP:\n\t case editor.core.keys.LEFT:\n\t blockLeftOrUpArrowPressed_(event);\n\t break;\n\t\n\t }\n\t };\n\t\n\t /**\n\t * RIGHT or DOWN keydowns on block\n\t *\n\t * @param {Object} event\n\t * @private\n\t *\n\t * @description watches the selection and gets closest editable element.\n\t * Uses method getDeepestTextNodeFromPosition to get the last node of next block\n\t * Sets caret if it is contenteditable\n\t */\n\t var blockRightOrDownArrowPressed_ = function blockRightOrDownArrowPressed_(event) {\n\t\n\t var selection = window.getSelection(),\n\t inputs = editor.state.inputs,\n\t focusedNode = selection.anchorNode,\n\t focusedNodeHolder;\n\t\n\t /** Check for caret existance */\n\t if (!focusedNode) {\n\t\n\t return false;\n\t }\n\t\n\t /** Looking for closest (parent) contentEditable element of focused node */\n\t while (focusedNode.contentEditable != 'true') {\n\t\n\t focusedNodeHolder = focusedNode.parentNode;\n\t focusedNode = focusedNodeHolder;\n\t }\n\t\n\t /** Input index in DOM level */\n\t var editableElementIndex = 0;\n\t\n\t while (focusedNode != inputs[editableElementIndex]) {\n\t\n\t editableElementIndex++;\n\t }\n\t\n\t /**\n\t * Founded contentEditable element doesn't have childs\n\t * Or maybe New created block\n\t */\n\t if (!focusedNode.textContent) {\n\t\n\t editor.caret.setToNextBlock(editableElementIndex);\n\t return;\n\t }\n\t\n\t /**\n\t * Do nothing when caret doesn not reaches the end of last child\n\t */\n\t var caretInLastChild = false,\n\t caretAtTheEndOfText = false;\n\t\n\t var lastChild, deepestTextnode;\n\t\n\t lastChild = focusedNode.childNodes[focusedNode.childNodes.length - 1];\n\t\n\t if (editor.core.isDomNode(lastChild)) {\n\t\n\t deepestTextnode = editor.content.getDeepestTextNodeFromPosition(lastChild, lastChild.childNodes.length);\n\t } else {\n\t\n\t deepestTextnode = lastChild;\n\t }\n\t\n\t caretInLastChild = selection.anchorNode == deepestTextnode;\n\t caretAtTheEndOfText = deepestTextnode.length == selection.anchorOffset;\n\t\n\t if (!caretInLastChild || !caretAtTheEndOfText) {\n\t\n\t editor.core.log('arrow [down|right] : caret does not reached the end');\n\t return false;\n\t }\n\t\n\t editor.caret.setToNextBlock(editableElementIndex);\n\t };\n\t\n\t /**\n\t * LEFT or UP keydowns on block\n\t *\n\t * @param {Object} event\n\t * @private\n\t *\n\t * watches the selection and gets closest editable element.\n\t * Uses method getDeepestTextNodeFromPosition to get the last node of previous block\n\t * Sets caret if it is contenteditable\n\t *\n\t */\n\t var blockLeftOrUpArrowPressed_ = function blockLeftOrUpArrowPressed_(event) {\n\t\n\t var selection = window.getSelection(),\n\t inputs = editor.state.inputs,\n\t focusedNode = selection.anchorNode,\n\t focusedNodeHolder;\n\t\n\t /** Check for caret existance */\n\t if (!focusedNode) {\n\t\n\t return false;\n\t }\n\t\n\t /**\n\t * LEFT or UP not at the beginning\n\t */\n\t if (selection.anchorOffset !== 0) {\n\t\n\t return false;\n\t }\n\t\n\t /** Looking for parent contentEditable block */\n\t while (focusedNode.contentEditable != 'true') {\n\t\n\t focusedNodeHolder = focusedNode.parentNode;\n\t focusedNode = focusedNodeHolder;\n\t }\n\t\n\t /** Input index in DOM level */\n\t var editableElementIndex = 0;\n\t\n\t while (focusedNode != inputs[editableElementIndex]) {\n\t\n\t editableElementIndex++;\n\t }\n\t\n\t /**\n\t * Do nothing if caret is not at the beginning of first child\n\t */\n\t var caretInFirstChild = false,\n\t caretAtTheBeginning = false;\n\t\n\t var firstChild, deepestTextnode;\n\t\n\t /**\n\t * Founded contentEditable element doesn't have childs\n\t * Or maybe New created block\n\t */\n\t if (!focusedNode.textContent) {\n\t\n\t editor.caret.setToPreviousBlock(editableElementIndex);\n\t return;\n\t }\n\t\n\t firstChild = focusedNode.childNodes[0];\n\t\n\t if (editor.core.isDomNode(firstChild)) {\n\t\n\t deepestTextnode = editor.content.getDeepestTextNodeFromPosition(firstChild, 0);\n\t } else {\n\t\n\t deepestTextnode = firstChild;\n\t }\n\t\n\t caretInFirstChild = selection.anchorNode == deepestTextnode;\n\t caretAtTheBeginning = selection.anchorOffset === 0;\n\t\n\t if (caretInFirstChild && caretAtTheBeginning) {\n\t\n\t editor.caret.setToPreviousBlock(editableElementIndex);\n\t }\n\t };\n\t\n\t /**\n\t * Handles backspace keydown\n\t *\n\t * @param {Element} block\n\t * @param {Object} event\n\t * @private\n\t *\n\t * @description if block is empty, delete the block and set caret to the previous block\n\t * If block is not empty, try to merge two blocks - current and previous\n\t * But it we try'n to remove first block, then we should set caret to the next block, not previous.\n\t * If we removed the last block, create new one\n\t */\n\t var backspacePressed_ = function backspacePressed_(block, event) {\n\t\n\t var currentInputIndex = editor.caret.getCurrentInputIndex(),\n\t range,\n\t selectionLength,\n\t firstLevelBlocksCount;\n\t\n\t if (editor.core.isNativeInput(event.target)) {\n\t\n\t /** If input value is empty - remove block */\n\t if (event.target.value.trim() == '') {\n\t\n\t block.remove();\n\t } else {\n\t\n\t return;\n\t }\n\t }\n\t\n\t if (block.textContent.trim()) {\n\t\n\t range = editor.content.getRange();\n\t selectionLength = range.endOffset - range.startOffset;\n\t\n\t if (editor.caret.position.atStart() && !selectionLength && editor.state.inputs[currentInputIndex - 1]) {\n\t\n\t editor.content.mergeBlocks(currentInputIndex);\n\t } else {\n\t\n\t return;\n\t }\n\t }\n\t\n\t if (!selectionLength) {\n\t\n\t block.remove();\n\t }\n\t\n\t firstLevelBlocksCount = editor.nodes.redactor.childNodes.length;\n\t\n\t /**\n\t * If all blocks are removed\n\t */\n\t if (firstLevelBlocksCount === 0) {\n\t\n\t /** update currentNode variable */\n\t editor.content.currentNode = null;\n\t\n\t /** Inserting new empty initial block */\n\t editor.ui.addInitialBlock();\n\t\n\t /** Updating inputs state after deleting last block */\n\t editor.ui.saveInputs();\n\t\n\t /** Set to current appended block */\n\t window.setTimeout(function () {\n\t\n\t editor.caret.setToPreviousBlock(1);\n\t }, 10);\n\t } else {\n\t\n\t if (editor.caret.inputIndex !== 0) {\n\t\n\t /** Target block is not first */\n\t editor.caret.setToPreviousBlock(editor.caret.inputIndex);\n\t } else {\n\t\n\t /** If we try to delete first block */\n\t editor.caret.setToNextBlock(editor.caret.inputIndex);\n\t }\n\t }\n\t\n\t editor.toolbar.move();\n\t\n\t if (!editor.toolbar.opened) {\n\t\n\t editor.toolbar.open();\n\t }\n\t\n\t /** Updating inputs state */\n\t editor.ui.saveInputs();\n\t\n\t /** Prevent default browser behaviour */\n\t event.preventDefault();\n\t };\n\t\n\t /**\n\t * used by UI module\n\t * Clicks on block settings button\n\t *\n\t * @param {Object} event\n\t * @protected\n\t * @description Opens toolbar settings\n\t */\n\t callbacks.showSettingsButtonClicked = function (event) {\n\t\n\t /**\n\t * Get type of current block\n\t * It uses to append settings from tool.settings property.\n\t * ...\n\t * Type is stored in data-type attribute on block\n\t */\n\t var currentToolType = editor.content.currentNode.dataset.tool;\n\t\n\t editor.toolbar.settings.toggle(currentToolType);\n\t\n\t /** Close toolbox when settings button is active */\n\t editor.toolbar.toolbox.close();\n\t editor.toolbar.settings.hideRemoveActions();\n\t };\n\t\n\t return callbacks;\n\t}({});\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Codex Editor Draw module\n\t *\n\t * @author Codex Team\n\t * @version 1.0.\n\t */\n\t\n\tmodule.exports = function (draw) {\n\t\n\t /**\n\t * Base editor wrapper\n\t */\n\t draw.wrapper = function () {\n\t\n\t var wrapper = document.createElement('div');\n\t\n\t wrapper.className += 'codex-editor';\n\t\n\t return wrapper;\n\t };\n\t\n\t /**\n\t * Content-editable holder\n\t */\n\t draw.redactor = function () {\n\t\n\t var redactor = document.createElement('div');\n\t\n\t redactor.className += 'ce-redactor';\n\t\n\t return redactor;\n\t };\n\t\n\t draw.ceBlock = function () {\n\t\n\t var block = document.createElement('DIV');\n\t\n\t block.className += 'ce_block';\n\t\n\t return block;\n\t };\n\t\n\t /**\n\t * Empty toolbar with toggler\n\t */\n\t draw.toolbar = function () {\n\t\n\t var bar = document.createElement('div');\n\t\n\t bar.className += 'ce-toolbar';\n\t\n\t return bar;\n\t };\n\t\n\t draw.toolbarContent = function () {\n\t\n\t var wrapper = document.createElement('DIV');\n\t\n\t wrapper.classList.add('ce-toolbar__content');\n\t\n\t return wrapper;\n\t };\n\t\n\t /**\n\t * Inline toolbar\n\t */\n\t draw.inlineToolbar = function () {\n\t\n\t var bar = document.createElement('DIV');\n\t\n\t bar.className += 'ce-toolbar-inline';\n\t\n\t return bar;\n\t };\n\t\n\t /**\n\t * Wrapper for inline toobar buttons\n\t */\n\t draw.inlineToolbarButtons = function () {\n\t\n\t var wrapper = document.createElement('DIV');\n\t\n\t wrapper.className += 'ce-toolbar-inline__buttons';\n\t\n\t return wrapper;\n\t };\n\t\n\t /**\n\t * For some actions\n\t */\n\t draw.inlineToolbarActions = function () {\n\t\n\t var wrapper = document.createElement('DIV');\n\t\n\t wrapper.className += 'ce-toolbar-inline__actions';\n\t\n\t return wrapper;\n\t };\n\t\n\t draw.inputForLink = function () {\n\t\n\t var input = document.createElement('INPUT');\n\t\n\t input.type = 'input';\n\t input.className += 'inputForLink';\n\t input.placeholder = 'Вставьте ссылку ...';\n\t input.setAttribute('form', 'defaultForm');\n\t\n\t input.setAttribute('autofocus', 'autofocus');\n\t\n\t return input;\n\t };\n\t\n\t /**\n\t * @todo Desc\n\t */\n\t draw.blockButtons = function () {\n\t\n\t var block = document.createElement('div');\n\t\n\t block.className += 'ce-toolbar__actions';\n\t\n\t return block;\n\t };\n\t\n\t /**\n\t * Block settings panel\n\t */\n\t draw.blockSettings = function () {\n\t\n\t var settings = document.createElement('div');\n\t\n\t settings.className += 'ce-settings';\n\t\n\t return settings;\n\t };\n\t\n\t draw.defaultSettings = function () {\n\t\n\t var div = document.createElement('div');\n\t\n\t div.classList.add('ce-settings_default');\n\t\n\t return div;\n\t };\n\t\n\t draw.pluginsSettings = function () {\n\t\n\t var div = document.createElement('div');\n\t\n\t div.classList.add('ce-settings_plugin');\n\t\n\t return div;\n\t };\n\t\n\t draw.plusButton = function () {\n\t\n\t var button = document.createElement('span');\n\t\n\t button.className = 'ce-toolbar__plus';\n\t // button.innerHTML = '';\n\t\n\t return button;\n\t };\n\t\n\t /**\n\t * Settings button in toolbar\n\t */\n\t draw.settingsButton = function () {\n\t\n\t var toggler = document.createElement('span');\n\t\n\t toggler.className = 'ce-toolbar__settings-btn';\n\t\n\t /** Toggler button*/\n\t toggler.innerHTML = '';\n\t\n\t return toggler;\n\t };\n\t\n\t /**\n\t * Redactor tools wrapper\n\t */\n\t\n\t draw.toolbox = function () {\n\t\n\t var wrapper = document.createElement('div');\n\t\n\t wrapper.className = 'ce-toolbar__tools';\n\t\n\t return wrapper;\n\t };\n\t\n\t /**\n\t * @protected\n\t *\n\t * Draws tool buttons for toolbox\n\t *\n\t * @param {String} type\n\t * @param {String} classname\n\t * @returns {Element}\n\t */\n\t draw.toolbarButton = function (type, classname) {\n\t\n\t var button = document.createElement('li'),\n\t toolIcon = document.createElement('i'),\n\t toolTitle = document.createElement('span');\n\t\n\t button.dataset.type = type;\n\t button.setAttribute('title', type);\n\t\n\t toolIcon.classList.add(classname);\n\t toolTitle.classList.add('ce_toolbar_tools--title');\n\t\n\t button.appendChild(toolIcon);\n\t button.appendChild(toolTitle);\n\t\n\t return button;\n\t };\n\t\n\t /**\n\t * @protected\n\t *\n\t * Draws tools for inline toolbar\n\t *\n\t * @param {String} type\n\t * @param {String} classname\n\t */\n\t draw.toolbarButtonInline = function (type, classname) {\n\t\n\t var button = document.createElement('BUTTON'),\n\t toolIcon = document.createElement('I');\n\t\n\t button.type = 'button';\n\t button.dataset.type = type;\n\t toolIcon.classList.add(classname);\n\t\n\t button.appendChild(toolIcon);\n\t\n\t return button;\n\t };\n\t\n\t /**\n\t * Redactor block\n\t */\n\t draw.block = function (tagName, content) {\n\t\n\t var node = document.createElement(tagName);\n\t\n\t node.innerHTML = content || '';\n\t\n\t return node;\n\t };\n\t\n\t /**\n\t * Creates Node with passed tagName and className\n\t * @param {string} tagName\n\t * @param {string} className\n\t * @param {object} properties - allow to assign properties\n\t */\n\t draw.node = function (tagName, className, properties) {\n\t\n\t var el = document.createElement(tagName);\n\t\n\t if (className) el.className = className;\n\t\n\t if (properties) {\n\t\n\t for (var name in properties) {\n\t\n\t el[name] = properties[name];\n\t }\n\t }\n\t\n\t return el;\n\t };\n\t\n\t /**\n\t * Unavailable plugin block\n\t */\n\t draw.unavailableBlock = function () {\n\t\n\t var wrapper = document.createElement('DIV');\n\t\n\t wrapper.classList.add('cdx-unavailable-block');\n\t\n\t return wrapper;\n\t };\n\t\n\t return draw;\n\t}({});\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Codex Editor Caret Module\n\t *\n\t * @author Codex Team\n\t * @version 1.0\n\t */\n\t\n\tmodule.exports = function (caret) {\n\t\n\t var editor = codex.editor;\n\t\n\t /**\n\t * @var {int} InputIndex - editable element in DOM\n\t */\n\t caret.inputIndex = null;\n\t\n\t /**\n\t * @var {int} offset - caret position in a text node.\n\t */\n\t caret.offset = null;\n\t\n\t /**\n\t * @var {int} focusedNodeIndex - we get index of child node from first-level block\n\t */\n\t caret.focusedNodeIndex = null;\n\t\n\t /**\n\t * Creates Document Range and sets caret to the element.\n\t * @protected\n\t * @uses caret.save — if you need to save caret position\n\t * @param {Element} el - Changed Node.\n\t */\n\t caret.set = function (el, index, offset) {\n\t\n\t offset = offset || caret.offset || 0;\n\t index = index || caret.focusedNodeIndex || 0;\n\t\n\t var childs = el.childNodes,\n\t nodeToSet;\n\t\n\t if (childs.length === 0) {\n\t\n\t nodeToSet = el;\n\t } else {\n\t\n\t nodeToSet = childs[index];\n\t }\n\t\n\t /** If Element is INPUT */\n\t if (el.contentEditable != 'true') {\n\t\n\t el.focus();\n\t return;\n\t }\n\t\n\t if (editor.core.isDomNode(nodeToSet)) {\n\t\n\t nodeToSet = editor.content.getDeepestTextNodeFromPosition(nodeToSet, nodeToSet.childNodes.length);\n\t }\n\t\n\t var range = document.createRange(),\n\t selection = window.getSelection();\n\t\n\t window.setTimeout(function () {\n\t\n\t range.setStart(nodeToSet, offset);\n\t range.setEnd(nodeToSet, offset);\n\t\n\t selection.removeAllRanges();\n\t selection.addRange(range);\n\t\n\t editor.caret.saveCurrentInputIndex();\n\t }, 20);\n\t };\n\t\n\t /**\n\t * @protected\n\t * Updates index of input and saves it in caret object\n\t */\n\t caret.saveCurrentInputIndex = function () {\n\t\n\t /** Index of Input that we paste sanitized content */\n\t var selection = window.getSelection(),\n\t inputs = editor.state.inputs,\n\t focusedNode = selection.anchorNode,\n\t focusedNodeHolder;\n\t\n\t if (!focusedNode) {\n\t\n\t return;\n\t }\n\t\n\t /** Looking for parent contentEditable block */\n\t while (focusedNode.contentEditable != 'true') {\n\t\n\t focusedNodeHolder = focusedNode.parentNode;\n\t focusedNode = focusedNodeHolder;\n\t }\n\t\n\t /** Input index in DOM level */\n\t var editableElementIndex = 0;\n\t\n\t while (focusedNode != inputs[editableElementIndex]) {\n\t\n\t editableElementIndex++;\n\t }\n\t\n\t caret.inputIndex = editableElementIndex;\n\t };\n\t\n\t /**\n\t * Returns current input index (caret object)\n\t */\n\t caret.getCurrentInputIndex = function () {\n\t\n\t return caret.inputIndex;\n\t };\n\t\n\t /**\n\t * @param {int} index - index of first-level block after that we set caret into next input\n\t */\n\t caret.setToNextBlock = function (index) {\n\t\n\t var inputs = editor.state.inputs,\n\t nextInput = inputs[index + 1];\n\t\n\t if (!nextInput) {\n\t\n\t editor.core.log('We are reached the end');\n\t return;\n\t }\n\t\n\t /**\n\t * When new Block created or deleted content of input\n\t * We should add some text node to set caret\n\t */\n\t if (!nextInput.childNodes.length) {\n\t\n\t var emptyTextElement = document.createTextNode('');\n\t\n\t nextInput.appendChild(emptyTextElement);\n\t }\n\t\n\t editor.caret.inputIndex = index + 1;\n\t editor.caret.set(nextInput, 0, 0);\n\t editor.content.workingNodeChanged(nextInput);\n\t };\n\t\n\t /**\n\t * @param {int} index - index of target input.\n\t * Sets caret to input with this index\n\t */\n\t caret.setToBlock = function (index) {\n\t\n\t var inputs = editor.state.inputs,\n\t targetInput = inputs[index];\n\t\n\t if (!targetInput) {\n\t\n\t return;\n\t }\n\t\n\t /**\n\t * When new Block created or deleted content of input\n\t * We should add some text node to set caret\n\t */\n\t if (!targetInput.childNodes.length) {\n\t\n\t var emptyTextElement = document.createTextNode('');\n\t\n\t targetInput.appendChild(emptyTextElement);\n\t }\n\t\n\t editor.caret.inputIndex = index;\n\t editor.caret.set(targetInput, 0, 0);\n\t editor.content.workingNodeChanged(targetInput);\n\t };\n\t\n\t /**\n\t * @param {int} index - index of input\n\t */\n\t caret.setToPreviousBlock = function (index) {\n\t\n\t index = index || 0;\n\t\n\t var inputs = editor.state.inputs,\n\t previousInput = inputs[index - 1],\n\t lastChildNode,\n\t lengthOfLastChildNode,\n\t emptyTextElement;\n\t\n\t if (!previousInput) {\n\t\n\t editor.core.log('We are reached first node');\n\t return;\n\t }\n\t\n\t lastChildNode = editor.content.getDeepestTextNodeFromPosition(previousInput, previousInput.childNodes.length);\n\t lengthOfLastChildNode = lastChildNode.length;\n\t\n\t /**\n\t * When new Block created or deleted content of input\n\t * We should add some text node to set caret\n\t */\n\t if (!previousInput.childNodes.length) {\n\t\n\t emptyTextElement = document.createTextNode('');\n\t previousInput.appendChild(emptyTextElement);\n\t }\n\t editor.caret.inputIndex = index - 1;\n\t editor.caret.set(previousInput, previousInput.childNodes.length - 1, lengthOfLastChildNode);\n\t editor.content.workingNodeChanged(inputs[index - 1]);\n\t };\n\t\n\t caret.position = {\n\t\n\t atStart: function atStart() {\n\t\n\t var selection = window.getSelection(),\n\t anchorOffset = selection.anchorOffset,\n\t anchorNode = selection.anchorNode,\n\t firstLevelBlock = editor.content.getFirstLevelBlock(anchorNode),\n\t pluginsRender = firstLevelBlock.childNodes[0];\n\t\n\t if (!editor.core.isDomNode(anchorNode)) {\n\t\n\t anchorNode = anchorNode.parentNode;\n\t }\n\t\n\t var isFirstNode = anchorNode === pluginsRender.childNodes[0],\n\t isOffsetZero = anchorOffset === 0;\n\t\n\t return isFirstNode && isOffsetZero;\n\t },\n\t\n\t atTheEnd: function atTheEnd() {\n\t\n\t var selection = window.getSelection(),\n\t anchorOffset = selection.anchorOffset,\n\t anchorNode = selection.anchorNode;\n\t\n\t /** Caret is at the end of input */\n\t return !anchorNode || !anchorNode.length || anchorOffset === anchorNode.length;\n\t }\n\t };\n\t\n\t /**\n\t * Inserts node at the caret location\n\t * @param {HTMLElement|DocumentFragment} node\n\t */\n\t caret.insertNode = function (node) {\n\t\n\t var selection,\n\t range,\n\t lastNode = node;\n\t\n\t if (node.nodeType == editor.core.nodeTypes.DOCUMENT_FRAGMENT) {\n\t\n\t lastNode = node.lastChild;\n\t }\n\t\n\t selection = window.getSelection();\n\t\n\t range = selection.getRangeAt(0);\n\t range.deleteContents();\n\t\n\t range.insertNode(node);\n\t\n\t range.setStartAfter(lastNode);\n\t range.collapse(true);\n\t\n\t selection.removeAllRanges();\n\t selection.addRange(range);\n\t };\n\t\n\t return caret;\n\t}({});\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Codex Editor Notification Module\n\t *\n\t * @author Codex Team\n\t * @version 1.0\n\t */\n\t\n\tmodule.exports = function (notifications) {\n\t\n\t var editor = codex.editor;\n\t\n\t var queue = [];\n\t\n\t var addToQueue = function addToQueue(settings) {\n\t\n\t queue.push(settings);\n\t\n\t var index = 0;\n\t\n\t while (index < queue.length && queue.length > 5) {\n\t\n\t if (queue[index].type == 'confirm' || queue[index].type == 'prompt') {\n\t\n\t index++;\n\t continue;\n\t }\n\t\n\t queue[index].close();\n\t queue.splice(index, 1);\n\t }\n\t };\n\t\n\t notifications.createHolder = function () {\n\t\n\t var holder = editor.draw.node('DIV', 'cdx-notifications-block');\n\t\n\t editor.nodes.notifications = document.body.appendChild(holder);\n\t\n\t return holder;\n\t };\n\t\n\t /**\n\t * Error notificator. Shows block with message\n\t * @protected\n\t */\n\t notifications.errorThrown = function (errorMsg, event) {\n\t\n\t editor.notifications.notification({ message: 'This action is not available currently', type: event.type });\n\t };\n\t\n\t /**\n\t *\n\t * Appends notification\n\t *\n\t * settings = {\n\t * type - notification type (reserved types: alert, confirm, prompt). Just add class 'cdx-notification-'+type\n\t * message - notification message\n\t * okMsg - confirm button text (default - 'Ok')\n\t * cancelBtn - cancel button text (default - 'Cancel'). Only for confirm and prompt types\n\t * confirm - function-handler for ok button click\n\t * cancel - function-handler for cancel button click. Only for confirm and prompt types\n\t * time - time (in seconds) after which notification will close (default - 10s)\n\t * }\n\t *\n\t * @param settings\n\t */\n\t notifications.notification = function (constructorSettings) {\n\t\n\t /** Private vars and methods */\n\t var notification = null,\n\t cancel = null,\n\t type = null,\n\t confirm = null,\n\t inputField = null;\n\t\n\t var confirmHandler = function confirmHandler() {\n\t\n\t close();\n\t\n\t if (typeof confirm !== 'function') {\n\t\n\t return;\n\t }\n\t\n\t if (type == 'prompt') {\n\t\n\t confirm(inputField.value);\n\t return;\n\t }\n\t\n\t confirm();\n\t };\n\t\n\t var cancelHandler = function cancelHandler() {\n\t\n\t close();\n\t\n\t if (typeof cancel !== 'function') {\n\t\n\t return;\n\t }\n\t\n\t cancel();\n\t };\n\t\n\t /** Public methods */\n\t function create(settings) {\n\t\n\t if (!(settings && settings.message)) {\n\t\n\t editor.core.log('Can\\'t create notification. Message is missed');\n\t return;\n\t }\n\t\n\t settings.type = settings.type || 'alert';\n\t settings.time = settings.time * 1000 || 10000;\n\t\n\t var wrapper = editor.draw.node('DIV', 'cdx-notification'),\n\t message = editor.draw.node('DIV', 'cdx-notification__message'),\n\t input = editor.draw.node('INPUT', 'cdx-notification__input'),\n\t okBtn = editor.draw.node('SPAN', 'cdx-notification__ok-btn'),\n\t cancelBtn = editor.draw.node('SPAN', 'cdx-notification__cancel-btn');\n\t\n\t message.textContent = settings.message;\n\t okBtn.textContent = settings.okMsg || 'ОК';\n\t cancelBtn.textContent = settings.cancelMsg || 'Отмена';\n\t\n\t editor.listeners.add(okBtn, 'click', confirmHandler);\n\t editor.listeners.add(cancelBtn, 'click', cancelHandler);\n\t\n\t wrapper.appendChild(message);\n\t\n\t if (settings.type == 'prompt') {\n\t\n\t wrapper.appendChild(input);\n\t }\n\t\n\t wrapper.appendChild(okBtn);\n\t\n\t if (settings.type == 'prompt' || settings.type == 'confirm') {\n\t\n\t wrapper.appendChild(cancelBtn);\n\t }\n\t\n\t wrapper.classList.add('cdx-notification-' + settings.type);\n\t wrapper.dataset.type = settings.type;\n\t\n\t notification = wrapper;\n\t type = settings.type;\n\t confirm = settings.confirm;\n\t cancel = settings.cancel;\n\t inputField = input;\n\t\n\t if (settings.type != 'prompt' && settings.type != 'confirm') {\n\t\n\t window.setTimeout(close, settings.time);\n\t }\n\t };\n\t\n\t /**\n\t * Show notification block\n\t */\n\t function send() {\n\t\n\t editor.nodes.notifications.appendChild(notification);\n\t inputField.focus();\n\t\n\t editor.nodes.notifications.classList.add('cdx-notification__notification-appending');\n\t\n\t window.setTimeout(function () {\n\t\n\t editor.nodes.notifications.classList.remove('cdx-notification__notification-appending');\n\t }, 100);\n\t\n\t addToQueue({ type: type, close: close });\n\t };\n\t\n\t /**\n\t * Remove notification block\n\t */\n\t function close() {\n\t\n\t notification.remove();\n\t };\n\t\n\t if (constructorSettings) {\n\t\n\t create(constructorSettings);\n\t send();\n\t }\n\t\n\t return {\n\t create: create,\n\t send: send,\n\t close: close\n\t };\n\t };\n\t\n\t notifications.clear = function () {\n\t\n\t editor.nodes.notifications.innerHTML = '';\n\t queue = [];\n\t };\n\t\n\t return notifications;\n\t}({});\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\t/**\n\t * Codex Editor Parser Module\n\t *\n\t * @author Codex Team\n\t * @version 1.1\n\t */\n\t\n\tmodule.exports = function (parser) {\n\t\n\t var editor = codex.editor;\n\t\n\t /** inserting text */\n\t parser.insertPastedContent = function (blockType, tag) {\n\t\n\t editor.content.insertBlock({\n\t type: blockType.type,\n\t block: blockType.render({\n\t text: tag.innerHTML\n\t })\n\t });\n\t };\n\t\n\t /**\n\t * Check DOM node for display style: separated block or child-view\n\t */\n\t parser.isFirstLevelBlock = function (node) {\n\t\n\t return node.nodeType == editor.core.nodeTypes.TAG && node.classList.contains(editor.ui.className.BLOCK_CLASSNAME);\n\t };\n\t\n\t return parser;\n\t}({});\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\t/**\n\t * Codex Sanitizer\n\t */\n\t\n\tmodule.exports = function (sanitizer) {\n\t\n\t /** HTML Janitor library */\n\t var janitor = __webpack_require__(18);\n\t\n\t /** Codex Editor */\n\t var editor = codex.editor;\n\t\n\t sanitizer.prepare = function () {\n\t\n\t if (editor.settings.sanitizer && !editor.core.isEmpty(editor.settings.sanitizer)) {\n\t\n\t Config.CUSTOM = editor.settings.sanitizer;\n\t }\n\t };\n\t\n\t /**\n\t * Basic config\n\t */\n\t var Config = {\n\t\n\t /** User configuration */\n\t CUSTOM: null,\n\t\n\t BASIC: {\n\t\n\t tags: {\n\t p: {},\n\t a: {\n\t href: true,\n\t target: '_blank',\n\t rel: 'nofollow'\n\t }\n\t }\n\t }\n\t };\n\t\n\t sanitizer.Config = Config;\n\t\n\t /**\n\t *\n\t * @param userCustomConfig\n\t * @returns {*}\n\t * @private\n\t *\n\t * @description If developer uses editor's API, then he can customize sane restrictions.\n\t * Or, sane config can be defined globally in editors initialization. That config will be used everywhere\n\t * At least, if there is no config overrides, that API uses BASIC Default configation\n\t */\n\t var init_ = function init_(userCustomConfig) {\n\t\n\t var configuration = userCustomConfig || Config.CUSTOM || Config.BASIC;\n\t\n\t return new janitor(configuration);\n\t };\n\t\n\t /**\n\t * Cleans string from unwanted tags\n\t * @protected\n\t * @param {String} dirtyString - taint string\n\t * @param {Object} customConfig - allowed tags\n\t */\n\t sanitizer.clean = function (dirtyString, customConfig) {\n\t\n\t var janitorInstance = init_(customConfig);\n\t\n\t return janitorInstance.clean(dirtyString);\n\t };\n\t\n\t return sanitizer;\n\t}({});\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) {\n\t if (true) {\n\t !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t } else if (typeof exports === 'object') {\n\t module.exports = factory();\n\t } else {\n\t root.HTMLJanitor = factory();\n\t }\n\t}(this, function () {\n\t\n\t /**\n\t * @param {Object} config.tags Dictionary of allowed tags.\n\t * @param {boolean} config.keepNestedBlockElements Default false.\n\t */\n\t function HTMLJanitor(config) {\n\t\n\t var tagDefinitions = config['tags'];\n\t var tags = Object.keys(tagDefinitions);\n\t\n\t var validConfigValues = tags\n\t .map(function(k) { return typeof tagDefinitions[k]; })\n\t .every(function(type) { return type === 'object' || type === 'boolean' || type === 'function'; });\n\t\n\t if(!validConfigValues) {\n\t throw new Error(\"The configuration was invalid\");\n\t }\n\t\n\t this.config = config;\n\t }\n\t\n\t // TODO: not exhaustive?\n\t var blockElementNames = ['P', 'LI', 'TD', 'TH', 'DIV', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'PRE'];\n\t function isBlockElement(node) {\n\t return blockElementNames.indexOf(node.nodeName) !== -1;\n\t }\n\t\n\t var inlineElementNames = ['A', 'B', 'STRONG', 'I', 'EM', 'SUB', 'SUP', 'U', 'STRIKE'];\n\t function isInlineElement(node) {\n\t return inlineElementNames.indexOf(node.nodeName) !== -1;\n\t }\n\t\n\t HTMLJanitor.prototype.clean = function (html) {\n\t var sandbox = document.createElement('div');\n\t sandbox.innerHTML = html;\n\t\n\t this._sanitize(sandbox);\n\t\n\t return sandbox.innerHTML;\n\t };\n\t\n\t HTMLJanitor.prototype._sanitize = function (parentNode) {\n\t var treeWalker = createTreeWalker(parentNode);\n\t var node = treeWalker.firstChild();\n\t if (!node) { return; }\n\t\n\t do {\n\t // Ignore nodes that have already been sanitized\n\t if (node._sanitized) {\n\t continue;\n\t }\n\t\n\t if (node.nodeType === Node.TEXT_NODE) {\n\t // If this text node is just whitespace and the previous or next element\n\t // sibling is a block element, remove it\n\t // N.B.: This heuristic could change. Very specific to a bug with\n\t // `contenteditable` in Firefox: http://jsbin.com/EyuKase/1/edit?js,output\n\t // FIXME: make this an option?\n\t if (node.data.trim() === ''\n\t && ((node.previousElementSibling && isBlockElement(node.previousElementSibling))\n\t || (node.nextElementSibling && isBlockElement(node.nextElementSibling)))) {\n\t parentNode.removeChild(node);\n\t this._sanitize(parentNode);\n\t break;\n\t } else {\n\t continue;\n\t }\n\t }\n\t\n\t // Remove all comments\n\t if (node.nodeType === Node.COMMENT_NODE) {\n\t parentNode.removeChild(node);\n\t this._sanitize(parentNode);\n\t break;\n\t }\n\t\n\t var isInline = isInlineElement(node);\n\t var containsBlockElement;\n\t if (isInline) {\n\t containsBlockElement = Array.prototype.some.call(node.childNodes, isBlockElement);\n\t }\n\t\n\t // Block elements should not be nested (e.g.

  • ...); if\n\t // they are, we want to unwrap the inner block element.\n\t var isNotTopContainer = !! parentNode.parentNode;\n\t var isNestedBlockElement =\n\t isBlockElement(parentNode) &&\n\t isBlockElement(node) &&\n\t isNotTopContainer;\n\t\n\t var nodeName = node.nodeName.toLowerCase();\n\t\n\t var allowedAttrs = getAllowedAttrs(this.config, nodeName, node);\n\t\n\t var isInvalid = isInline && containsBlockElement;\n\t\n\t // Drop tag entirely according to the whitelist *and* if the markup\n\t // is invalid.\n\t if (isInvalid || shouldRejectNode(node, allowedAttrs)\n\t || (!this.config.keepNestedBlockElements && isNestedBlockElement)) {\n\t // Do not keep the inner text of SCRIPT/STYLE elements.\n\t if (! (node.nodeName === 'SCRIPT' || node.nodeName === 'STYLE')) {\n\t while (node.childNodes.length > 0) {\n\t parentNode.insertBefore(node.childNodes[0], node);\n\t }\n\t }\n\t parentNode.removeChild(node);\n\t\n\t this._sanitize(parentNode);\n\t break;\n\t }\n\t\n\t // Sanitize attributes\n\t for (var a = 0; a < node.attributes.length; a += 1) {\n\t var attr = node.attributes[a];\n\t\n\t if (shouldRejectAttr(attr, allowedAttrs, node)) {\n\t node.removeAttribute(attr.name);\n\t // Shift the array to continue looping.\n\t a = a - 1;\n\t }\n\t }\n\t\n\t // Sanitize children\n\t this._sanitize(node);\n\t\n\t // Mark node as sanitized so it's ignored in future runs\n\t node._sanitized = true;\n\t } while ((node = treeWalker.nextSibling()));\n\t };\n\t\n\t function createTreeWalker(node) {\n\t return document.createTreeWalker(node,\n\t NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT,\n\t null, false);\n\t }\n\t\n\t function getAllowedAttrs(config, nodeName, node){\n\t if (typeof config.tags[nodeName] === 'function') {\n\t return config.tags[nodeName](node);\n\t } else {\n\t return config.tags[nodeName];\n\t }\n\t }\n\t\n\t function shouldRejectNode(node, allowedAttrs){\n\t if (typeof allowedAttrs === 'undefined') {\n\t return true;\n\t } else if (typeof allowedAttrs === 'boolean') {\n\t return !allowedAttrs;\n\t }\n\t\n\t return false;\n\t }\n\t\n\t function shouldRejectAttr(attr, allowedAttrs, node){\n\t var attrName = attr.name.toLowerCase();\n\t\n\t if (allowedAttrs === true){\n\t return false;\n\t } else if (typeof allowedAttrs[attrName] === 'function'){\n\t return !allowedAttrs[attrName](attr.value, node);\n\t } else if (typeof allowedAttrs[attrName] === 'undefined'){\n\t return true;\n\t } else if (allowedAttrs[attrName] === false) {\n\t return true;\n\t } else if (typeof allowedAttrs[attrName] === 'string') {\n\t return (allowedAttrs[attrName] !== attr.value);\n\t }\n\t\n\t return false;\n\t }\n\t\n\t return HTMLJanitor;\n\t\n\t}));\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\t/**\n\t * Codex Editor Listeners module\n\t *\n\t * @author Codex Team\n\t * @version 1.0\n\t */\n\t\n\t/**\n\t * Module-decorator for event listeners assignment\n\t */\n\tmodule.exports = function (listeners) {\n\t\n\t var allListeners = [];\n\t\n\t /**\n\t * Search methods\n\t *\n\t * byElement, byType and byHandler returns array of suitable listeners\n\t * one and all takes element, eventType, and handler and returns first (all) suitable listener\n\t *\n\t */\n\t listeners.search = function () {\n\t\n\t var byElement = function byElement(element, context) {\n\t\n\t var listenersOnElement = [];\n\t\n\t context = context || allListeners;\n\t\n\t for (var i = 0; i < context.length; i++) {\n\t\n\t var listener = context[i];\n\t\n\t if (listener.element === element) {\n\t\n\t listenersOnElement.push(listener);\n\t }\n\t }\n\t\n\t return listenersOnElement;\n\t };\n\t\n\t var byType = function byType(eventType, context) {\n\t\n\t var listenersWithType = [];\n\t\n\t context = context || allListeners;\n\t\n\t for (var i = 0; i < context.length; i++) {\n\t\n\t var listener = context[i];\n\t\n\t if (listener.type === eventType) {\n\t\n\t listenersWithType.push(listener);\n\t }\n\t }\n\t\n\t return listenersWithType;\n\t };\n\t\n\t var byHandler = function byHandler(handler, context) {\n\t\n\t var listenersWithHandler = [];\n\t\n\t context = context || allListeners;\n\t\n\t for (var i = 0; i < context.length; i++) {\n\t\n\t var listener = context[i];\n\t\n\t if (listener.handler === handler) {\n\t\n\t listenersWithHandler.push(listener);\n\t }\n\t }\n\t\n\t return listenersWithHandler;\n\t };\n\t\n\t var one = function one(element, eventType, handler) {\n\t\n\t var result = allListeners;\n\t\n\t if (element) result = byElement(element, result);\n\t\n\t if (eventType) result = byType(eventType, result);\n\t\n\t if (handler) result = byHandler(handler, result);\n\t\n\t return result[0];\n\t };\n\t\n\t var all = function all(element, eventType, handler) {\n\t\n\t var result = allListeners;\n\t\n\t if (element) result = byElement(element, result);\n\t\n\t if (eventType) result = byType(eventType, result);\n\t\n\t if (handler) result = byHandler(handler, result);\n\t\n\t return result;\n\t };\n\t\n\t return {\n\t byElement: byElement,\n\t byType: byType,\n\t byHandler: byHandler,\n\t one: one,\n\t all: all\n\t };\n\t }();\n\t\n\t listeners.add = function (element, eventType, handler, isCapture) {\n\t\n\t element.addEventListener(eventType, handler, isCapture);\n\t\n\t var data = {\n\t element: element,\n\t type: eventType,\n\t handler: handler\n\t };\n\t\n\t var alreadyAddedListener = listeners.search.one(element, eventType, handler);\n\t\n\t if (!alreadyAddedListener) {\n\t\n\t allListeners.push(data);\n\t }\n\t };\n\t\n\t listeners.remove = function (element, eventType, handler) {\n\t\n\t element.removeEventListener(eventType, handler);\n\t\n\t var existingListeners = listeners.search.all(element, eventType, handler);\n\t\n\t for (var i = 0; i < existingListeners.length; i++) {\n\t\n\t var index = allListeners.indexOf(existingListeners[i]);\n\t\n\t if (index > 0) {\n\t\n\t allListeners.splice(index, 1);\n\t }\n\t }\n\t };\n\t\n\t listeners.removeAll = function () {\n\t\n\t allListeners.map(function (current) {\n\t\n\t listeners.remove(current.element, current.type, current.handler);\n\t });\n\t };\n\t\n\t listeners.get = function (element, eventType, handler) {\n\t\n\t return listeners.search.all(element, eventType, handler);\n\t };\n\t\n\t return listeners;\n\t}({});\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\t\n\t/**\n\t * Codex Editor Destroyer module\n\t *\n\t * @auhor Codex Team\n\t * @version 1.0\n\t */\n\t\n\tmodule.exports = function (destroyer) {\n\t\n\t var editor = codex.editor;\n\t\n\t destroyer.removeNodes = function () {\n\t\n\t editor.nodes.wrapper.remove();\n\t editor.nodes.notifications.remove();\n\t };\n\t\n\t destroyer.destroyPlugins = function () {\n\t\n\t for (var tool in editor.tools) {\n\t\n\t if (typeof editor.tools[tool].destroy === 'function') {\n\t\n\t editor.tools[tool].destroy();\n\t }\n\t }\n\t };\n\t\n\t destroyer.destroyScripts = function () {\n\t\n\t var scripts = document.getElementsByTagName('SCRIPT');\n\t\n\t for (var i = 0; i < scripts.length; i++) {\n\t\n\t if (scripts[i].id.indexOf(editor.scriptPrefix) + 1) {\n\t\n\t scripts[i].remove();\n\t i--;\n\t }\n\t }\n\t };\n\t\n\t /**\n\t * Delete editor data from webpage.\n\t * You should send settings argument with boolean flags:\n\t * @param settings.ui- remove redactor event listeners and DOM nodes\n\t * @param settings.scripts - remove redactor scripts from DOM\n\t * @param settings.plugins - remove plugin's objects\n\t * @param settings.core - remove editor core. You can remove core only if UI and scripts flags is true\n\t * }\n\t *\n\t */\n\t destroyer.destroy = function (settings) {\n\t\n\t if (!settings || (typeof settings === 'undefined' ? 'undefined' : _typeof(settings)) !== 'object') {\n\t\n\t return;\n\t }\n\t\n\t if (settings.ui) {\n\t\n\t destroyer.removeNodes();\n\t editor.listeners.removeAll();\n\t }\n\t\n\t if (settings.scripts) {\n\t\n\t destroyer.destroyScripts();\n\t }\n\t\n\t if (settings.plugins) {\n\t\n\t destroyer.destroyPlugins();\n\t }\n\t\n\t if (settings.ui && settings.scripts && settings.core) {\n\t\n\t delete codex.editor;\n\t }\n\t };\n\t\n\t return destroyer;\n\t}({});\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Codex Editor Paste module\n\t *\n\t * @author Codex Team\n\t * @version 1.1.1\n\t */\n\t\n\tmodule.exports = function (paste) {\n\t\n\t var editor = codex.editor;\n\t\n\t var patterns = [];\n\t\n\t paste.prepare = function () {\n\t\n\t var tools = editor.tools;\n\t\n\t for (var tool in tools) {\n\t\n\t if (!tools[tool].renderOnPastePatterns || !Array.isArray(tools[tool].renderOnPastePatterns)) {\n\t\n\t continue;\n\t }\n\t\n\t tools[tool].renderOnPastePatterns.map(function (pattern) {\n\t\n\t patterns.push(pattern);\n\t });\n\t }\n\t\n\t return Promise.resolve();\n\t };\n\t\n\t /**\n\t * Saves data\n\t * @param event\n\t */\n\t paste.pasted = function (event) {\n\t\n\t var clipBoardData = event.clipboardData || window.clipboardData,\n\t content = clipBoardData.getData('Text');\n\t\n\t var result = analize(content);\n\t\n\t if (result) {\n\t\n\t event.preventDefault();\n\t event.stopImmediatePropagation();\n\t }\n\t\n\t return result;\n\t };\n\t\n\t /**\n\t * Analizes pated string and calls necessary method\n\t */\n\t\n\t var analize = function analize(string) {\n\t\n\t var result = false,\n\t content = editor.content.currentNode,\n\t plugin = content.dataset.tool;\n\t\n\t patterns.map(function (pattern) {\n\t\n\t var execArray = pattern.regex.exec(string),\n\t match = execArray && execArray[0];\n\t\n\t if (match && match === string.trim()) {\n\t\n\t /** current block is not empty */\n\t if (content.textContent.trim() && plugin == editor.settings.initialBlockPlugin) {\n\t\n\t pasteToNewBlock_();\n\t }\n\t\n\t pattern.callback(string, pattern);\n\t result = true;\n\t }\n\t });\n\t\n\t return result;\n\t };\n\t\n\t var pasteToNewBlock_ = function pasteToNewBlock_() {\n\t\n\t /** Create new initial block */\n\t editor.content.insertBlock({\n\t\n\t type: editor.settings.initialBlockPlugin,\n\t block: editor.tools[editor.settings.initialBlockPlugin].render({\n\t text: ''\n\t })\n\t\n\t }, false);\n\t };\n\t\n\t /**\n\t * This method prevents default behaviour.\n\t *\n\t * @param {Object} event\n\t * @protected\n\t *\n\t * @description We get from clipboard pasted data, sanitize, make a fragment that contains of this sanitized nodes.\n\t * Firstly, we need to memorize the caret position. We can do that by getting the range of selection.\n\t * After all, we insert clear fragment into caret placed position. Then, we should move the caret to the last node\n\t */\n\t paste.blockPasteCallback = function (event) {\n\t\n\t if (!needsToHandlePasteEvent(event.target)) {\n\t\n\t return;\n\t }\n\t\n\t /** Prevent default behaviour */\n\t event.preventDefault();\n\t\n\t /** get html pasted data - dirty data */\n\t var htmlData = event.clipboardData.getData('text/html'),\n\t plainData = event.clipboardData.getData('text/plain');\n\t\n\t /** Temporary DIV that is used to work with text's paragraphs as DOM-elements*/\n\t var paragraphs = editor.draw.node('DIV', '', {}),\n\t cleanData,\n\t wrappedData;\n\t\n\t /** Create fragment, that we paste to range after proccesing */\n\t cleanData = editor.sanitizer.clean(htmlData);\n\t\n\t /**\n\t * We wrap pasted text with

    tags to split it logically\n\t * @type {string}\n\t */\n\t wrappedData = editor.content.wrapTextWithParagraphs(cleanData, plainData);\n\t paragraphs.innerHTML = wrappedData;\n\t\n\t /**\n\t * If there only one paragraph, just insert in at the caret location\n\t */\n\t if (paragraphs.childNodes.length == 1) {\n\t\n\t emulateUserAgentBehaviour(paragraphs.firstChild);\n\t return;\n\t }\n\t\n\t insertPastedParagraphs(paragraphs.childNodes);\n\t };\n\t\n\t /**\n\t * Checks if we should handle paste event on block\n\t * @param block\n\t *\n\t * @return {boolean}\n\t */\n\t var needsToHandlePasteEvent = function needsToHandlePasteEvent(block) {\n\t\n\t /** If area is input or textarea then allow default behaviour */\n\t if (editor.core.isNativeInput(block)) {\n\t\n\t return false;\n\t }\n\t\n\t var editableParent = editor.content.getEditableParent(block);\n\t\n\t /** Allow paste when event target placed in Editable element */\n\t if (!editableParent) {\n\t\n\t return false;\n\t }\n\t\n\t return true;\n\t };\n\t\n\t /**\n\t * Inserts new initial plugin blocks with data in paragraphs\n\t *\n\t * @param {Array} paragraphs - array of paragraphs (

    ) whit content, that should be inserted\n\t */\n\t var insertPastedParagraphs = function insertPastedParagraphs(paragraphs) {\n\t\n\t var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin,\n\t currentNode = editor.content.currentNode;\n\t\n\t paragraphs.forEach(function (paragraph) {\n\t\n\t /** Don't allow empty paragraphs */\n\t if (editor.core.isBlockEmpty(paragraph)) {\n\t\n\t return;\n\t }\n\t\n\t editor.content.insertBlock({\n\t type: NEW_BLOCK_TYPE,\n\t block: editor.tools[NEW_BLOCK_TYPE].render({\n\t text: paragraph.innerHTML\n\t })\n\t });\n\t\n\t editor.caret.inputIndex++;\n\t });\n\t\n\t editor.caret.setToPreviousBlock(editor.caret.getCurrentInputIndex() + 1);\n\t\n\t /**\n\t * If there was no data in working node, remove it\n\t */\n\t if (editor.core.isBlockEmpty(currentNode)) {\n\t\n\t currentNode.remove();\n\t editor.ui.saveInputs();\n\t }\n\t };\n\t\n\t /**\n\t * Inserts node content at the caret position\n\t *\n\t * @param {Node} node - DOM node (could be DocumentFragment), that should be inserted at the caret location\n\t */\n\t var emulateUserAgentBehaviour = function emulateUserAgentBehaviour(node) {\n\t\n\t var newNode;\n\t\n\t if (node.childElementCount) {\n\t\n\t newNode = document.createDocumentFragment();\n\t\n\t node.childNodes.forEach(function (current) {\n\t\n\t if (!editor.core.isDomNode(current) && current.data.trim() === '') {\n\t\n\t return;\n\t }\n\t\n\t newNode.appendChild(current.cloneNode(true));\n\t });\n\t } else {\n\t\n\t newNode = document.createTextNode(node.textContent);\n\t }\n\t\n\t editor.caret.insertNode(newNode);\n\t };\n\t\n\t return paste;\n\t}({});\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// codex-editor.js"," \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\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\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.loaded = 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// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap e0115ab21dbe1447c691","/**\n *\n * Codex Editor\n *\n * @author Codex Team\n */\n\nmodule.exports = (function (editor) {\n\n 'use strict';\n\n editor.version = VERSION;\n editor.scriptPrefix = 'cdx-script-';\n\n var init = function () {\n\n editor.core = require('./modules/core');\n editor.tools = require('./modules/tools');\n editor.ui = require('./modules/ui');\n editor.transport = require('./modules/transport');\n editor.renderer = require('./modules/renderer');\n editor.saver = require('./modules/saver');\n editor.content = require('./modules/content');\n editor.toolbar = require('./modules/toolbar/toolbar');\n editor.callback = require('./modules/callbacks');\n editor.draw = require('./modules/draw');\n editor.caret = require('./modules/caret');\n editor.notifications = require('./modules/notifications');\n editor.parser = require('./modules/parser');\n editor.sanitizer = require('./modules/sanitizer');\n editor.listeners = require('./modules/listeners');\n editor.destroyer = require('./modules/destroyer');\n editor.paste = require('./modules/paste');\n\n };\n\n /**\n * @public\n * holds initial settings\n */\n editor.settings = {\n tools : ['paragraph', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'],\n holderId : 'codex-editor',\n\n // Type of block showing on empty editor\n initialBlockPlugin: 'paragraph'\n };\n\n /**\n * public\n *\n * Static nodes\n */\n editor.nodes = {\n holder : null,\n wrapper : null,\n toolbar : null,\n inlineToolbar : {\n wrapper : null,\n buttons : null,\n actions : null\n },\n toolbox : null,\n notifications : null,\n plusButton : null,\n showSettingsButton: null,\n showTrashButton : null,\n blockSettings : null,\n pluginSettings : null,\n defaultSettings : null,\n toolbarButtons : {}, // { type : DomEl, ... }\n redactor : null\n };\n\n /**\n * @public\n *\n * Output state\n */\n editor.state = {\n jsonOutput : [],\n blocks : [],\n inputs : []\n };\n\n /**\n * @public\n * Editor plugins\n */\n editor.tools = {};\n\n /**\n * Initialization\n * @uses Promise cEditor.core.prepare\n * @param {Object} userSettings\n * @param {Array} userSettings.tools list of plugins\n * @param {String} userSettings.holderId Element's id to append editor\n *\n * Load user defined tools\n * Tools must contain this important objects :\n * @param {String} type - this is a type of plugin. It can be used as plugin name\n * @param {String} iconClassname - this a icon in toolbar\n * @param {Object} make - what should plugin do, when it is clicked\n * @param {Object} appendCallback - callback after clicking\n * @param {Element} settings - what settings does it have\n * @param {Object} render - plugin get JSON, and should return HTML\n * @param {Object} save - plugin gets HTML content, returns JSON\n * @param {Boolean} displayInToolbox - will be displayed in toolbox. Default value is TRUE\n * @param {Boolean} enableLineBreaks - inserts new block or break lines. Default value is FALSE\n *\n * @example\n * - type : 'header',\n * - iconClassname : 'ce-icon-header',\n * - make : headerTool.make,\n * - appendCallback : headerTool.appendCallback,\n * - settings : headerTool.makeSettings(),\n * - render : headerTool.render,\n * - save : headerTool.save,\n * - displayInToolbox : true,\n * - enableLineBreaks : false\n */\n editor.start = function (userSettings) {\n\n init();\n\n editor.core.prepare(userSettings)\n\n // If all ok, make UI, bind events and parse initial-content\n .then(editor.ui.prepare)\n .then(editor.tools.prepare)\n .then(editor.sanitizer.prepare)\n .then(editor.paste.prepare)\n .then(editor.transport.prepare)\n .then(editor.renderer.makeBlocksFromData)\n .then(editor.ui.saveInputs)\n .catch(function (error) {\n\n editor.core.log('Initialization failed with error: %o', 'warn', error);\n\n });\n\n };\n\n return editor;\n\n})({});\n\n\n\n// WEBPACK FOOTER //\n// ./codex.js","/**\n * Codex Editor Core\n *\n * @author Codex Team\n * @version 1.1.3\n */\n\nmodule.exports = (function (core) {\n\n let editor = codex.editor;\n\n /**\n * @public\n *\n * Editor preparing method\n * @return Promise\n */\n core.prepare = function (userSettings) {\n\n return new Promise(function (resolve, reject) {\n\n if ( userSettings ) {\n\n editor.settings.tools = userSettings.tools || editor.settings.tools;\n\n }\n\n if (userSettings.data) {\n\n editor.state.blocks = userSettings.data;\n\n }\n\n if (userSettings.initialBlockPlugin) {\n\n editor.settings.initialBlockPlugin = userSettings.initialBlockPlugin;\n\n }\n\n if (userSettings.sanitizer) {\n\n editor.settings.sanitizer = userSettings.sanitizer;\n\n }\n\n editor.hideToolbar = userSettings.hideToolbar;\n\n editor.settings.placeholder = userSettings.placeholder || '';\n\n editor.nodes.holder = document.getElementById(userSettings.holderId || editor.settings.holderId);\n\n if (typeof editor.nodes.holder === undefined || editor.nodes.holder === null) {\n\n reject(Error(\"Holder wasn't found by ID: #\" + userSettings.holderId));\n\n } else {\n\n resolve();\n\n }\n\n });\n\n };\n\n /**\n * Logging method\n * @param type = ['log', 'info', 'warn']\n */\n core.log = function (msg, type, arg) {\n\n type = type || 'log';\n\n if (!arg) {\n\n arg = msg || 'undefined';\n msg = '[codex-editor]: %o';\n\n } else {\n\n msg = '[codex-editor]: ' + msg;\n\n }\n\n try{\n\n if ( 'console' in window && window.console[ type ] ) {\n\n if ( arg ) window.console[ type ]( msg, arg );\n else window.console[ type ]( msg );\n\n }\n\n }catch(e) {}\n\n };\n\n /**\n * @protected\n *\n * Helper for insert one element after another\n */\n core.insertAfter = function (target, element) {\n\n target.parentNode.insertBefore(element, target.nextSibling);\n\n };\n\n /**\n * @const\n *\n * Readable DOM-node types map\n */\n core.nodeTypes = {\n TAG : 1,\n TEXT : 3,\n COMMENT : 8,\n DOCUMENT_FRAGMENT: 11\n };\n\n /**\n * @const\n * Readable keys map\n */\n core.keys = { BACKSPACE: 8, TAB: 9, ENTER: 13, SHIFT: 16, CTRL: 17, ALT: 18, ESC: 27, SPACE: 32, LEFT: 37, UP: 38, DOWN: 40, RIGHT: 39, DELETE: 46, META: 91 };\n\n /**\n * @protected\n *\n * Check object for DOM node\n */\n core.isDomNode = function (el) {\n\n return el && typeof el === 'object' && el.nodeType && el.nodeType == this.nodeTypes.TAG;\n\n };\n\n /**\n * Checks passed object for emptiness\n * @require ES5 - Object.keys\n * @param {object}\n */\n core.isEmpty = function ( obj ) {\n\n return Object.keys(obj).length === 0;\n\n };\n\n /**\n * Native Ajax\n * @param {String} settings.url - request URL\n * @param {function} settings.beforeSend - returned value will be passed as context to the Success, Error and Progress callbacks\n * @param {function} settings.success\n * @param {function} settings.progress\n */\n core.ajax = function (settings) {\n\n if (!settings || !settings.url) {\n\n return;\n\n }\n\n var XMLHTTP = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'),\n encodedString,\n isFormData,\n prop;\n\n\n settings.async = true;\n settings.type = settings.type || 'GET';\n settings.data = settings.data || '';\n settings['content-type'] = settings['content-type'] || 'application/json; charset=utf-8';\n\n if (settings.type == 'GET' && settings.data) {\n\n settings.url = /\\?/.test(settings.url) ? settings.url + '&' + settings.data : settings.url + '?' + settings.data;\n\n } else {\n\n encodedString = '';\n for(prop in settings.data) {\n\n encodedString += (prop + '=' + encodeURIComponent(settings.data[prop]) + '&');\n\n }\n\n }\n\n if (settings.withCredentials) {\n\n XMLHTTP.withCredentials = true;\n\n }\n\n /**\n * Value returned in beforeSend funtion will be passed as context to the other response callbacks\n * If beforeSend returns false, AJAX will be blocked\n */\n let responseContext,\n beforeSendResult;\n\n if (typeof settings.beforeSend === 'function') {\n\n beforeSendResult = settings.beforeSend.call();\n\n if (beforeSendResult === false) {\n\n return;\n\n }\n\n }\n\n XMLHTTP.open( settings.type, settings.url, settings.async );\n\n /**\n * If we send FormData, we need no content-type header\n */\n isFormData = isFormData_(settings.data);\n\n if (!isFormData) {\n\n if (settings.type !== 'POST') {\n\n XMLHTTP.setRequestHeader('Content-type', settings['content-type']);\n\n } else {\n\n XMLHTTP.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\n }\n\n }\n\n XMLHTTP.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n responseContext = beforeSendResult || XMLHTTP;\n\n if (typeof settings.progress === 'function') {\n\n XMLHTTP.upload.onprogress = settings.progress.bind(responseContext);\n\n }\n\n XMLHTTP.onreadystatechange = function () {\n\n if (XMLHTTP.readyState === 4) {\n\n if (XMLHTTP.status === 200) {\n\n if (typeof settings.success === 'function') {\n\n settings.success.call(responseContext, XMLHTTP.responseText);\n\n }\n\n } else {\n\n if (typeof settings.error === 'function') {\n\n settings.error.call(responseContext, XMLHTTP.responseText, XMLHTTP.status);\n\n }\n\n }\n\n }\n\n };\n\n if (isFormData) {\n\n // Sending FormData\n XMLHTTP.send(settings.data);\n\n } else {\n\n // POST requests\n XMLHTTP.send(encodedString);\n\n }\n\n return XMLHTTP;\n\n };\n\n /**\n * Appends script to head of document\n * @return Promise\n */\n core.importScript = function (scriptPath, instanceName) {\n\n return new Promise(function (resolve, reject) {\n\n let script;\n\n /** Script is already loaded */\n if ( !instanceName ) {\n\n reject('Instance name is missed');\n\n } else if ( document.getElementById(editor.scriptPrefix + instanceName) ) {\n\n resolve(scriptPath);\n\n }\n\n script = document.createElement('SCRIPT');\n script.async = true;\n script.defer = true;\n script.id = editor.scriptPrefix + instanceName;\n\n script.onload = function () {\n\n resolve(scriptPath);\n\n };\n\n script.onerror = function () {\n\n reject(scriptPath);\n\n };\n\n script.src = scriptPath;\n document.head.appendChild(script);\n\n });\n\n };\n\n /**\n * Function for checking is it FormData object to send.\n * @param {Object} object to check\n * @return boolean\n */\n var isFormData_ = function (object) {\n\n return object instanceof FormData;\n\n };\n\n /**\n * Check block\n * @param target\n * @description Checks target is it native input\n */\n core.isNativeInput = function (target) {\n\n var nativeInputAreas = ['INPUT', 'TEXTAREA'];\n\n return nativeInputAreas.indexOf(target.tagName) != -1;\n\n };\n\n /**\n * Check if block is empty\n * We should check block textContent, child native inputs and some exceptions like IMG and IFRAME\n *\n * @param block\n * @returns {boolean}\n */\n core.isBlockEmpty = function (block) {\n\n const EXCEPTION_TAGS = ['IMG', 'IFRAME'];\n\n var nativeInputs = block.querySelectorAll('textarea, input'),\n nativeInputsAreEmpty = true,\n textContentIsEmpty = !block.textContent.trim();\n\n Array.prototype.forEach.call(nativeInputs, function (input) {\n\n if (input.type == 'textarea' || input.type == 'text') {\n\n nativeInputsAreEmpty = nativeInputsAreEmpty && !input.value.trim();\n\n }\n\n });\n\n return textContentIsEmpty && nativeInputsAreEmpty && !EXCEPTION_TAGS.includes(block.tagName);\n\n };\n\n\n return core;\n\n})({});\n\n\n\n// WEBPACK FOOTER //\n// ./modules/core.js","/**\n* Module working with plugins\n*/\nmodule.exports = (function () {\n\n let editor = codex.editor;\n\n /**\n * Initialize plugins before using\n * Ex. Load scripts or call some internal methods\n * @return Promise\n */\n function prepare() {\n\n return new Promise(function (resolve_, reject_) {\n\n Promise.resolve()\n\n /**\n * Compose a sequence of plugins that requires preparation\n */\n .then(function () {\n\n let pluginsRequiresPreparation = [],\n allPlugins = editor.tools;\n\n for ( let pluginName in allPlugins ) {\n\n let plugin = allPlugins[pluginName];\n\n if (plugin.prepare && typeof plugin.prepare != 'function' || !plugin.prepare) {\n\n continue;\n\n }\n\n pluginsRequiresPreparation.push(plugin);\n\n }\n\n /**\n * If no one passed plugins requires preparation, finish prepare() and go ahead\n */\n if (!pluginsRequiresPreparation.length) {\n\n resolve_();\n\n }\n\n return pluginsRequiresPreparation;\n\n })\n\n /** Wait plugins while they prepares */\n .then(waitAllPluginsPreparation_)\n\n .then(function () {\n\n editor.core.log('Plugins loaded', 'info');\n resolve_();\n\n }).catch(function (error) {\n\n reject_(error);\n\n });\n\n });\n\n }\n\n /**\n * @param {array} plugins - list of tools that requires preparation\n * @return {Promise} resolved while all plugins will be ready or failed\n */\n function waitAllPluginsPreparation_(plugins) {\n\n /**\n * @calls allPluginsProcessed__ when all plugins prepared or failed\n */\n return new Promise (function (allPluginsProcessed__) {\n\n /**\n * pluck each element from queue\n * First, send resolved Promise as previous value\n * Each plugins \"prepare\" method returns a Promise, that's why\n * reduce current element will not be able to continue while can't get\n * a resolved Promise\n *\n * If last plugin is \"prepared\" then go to the next stage of initialization\n */\n plugins.reduce(function (previousValue, plugin, iteration) {\n\n return previousValue.then(function () {\n\n /**\n * Wait till plugins prepared\n * @calls pluginIsReady__ when plugin is ready or failed\n */\n return new Promise ( function (pluginIsReady__) {\n\n callPluginsPrepareMethod_( plugin )\n\n .then( pluginIsReady__ )\n .then( function () {\n\n plugin.available = true;\n\n })\n\n .catch(function (error) {\n\n editor.core.log(`Plugin «${plugin.type}» was not loaded. Preparation failed because %o`, 'warn', error);\n plugin.available = false;\n plugin.loadingMessage = error;\n\n /** Go ahead even some plugin has problems */\n pluginIsReady__();\n\n })\n\n .then(function () {\n\n /** If last plugin has problems then just ignore and continue */\n if (iteration == plugins.length - 1) {\n\n allPluginsProcessed__();\n\n }\n\n });\n\n });\n\n });\n\n }, Promise.resolve() );\n\n });\n\n }\n\n var callPluginsPrepareMethod_ = function (plugin) {\n\n return plugin.prepare( plugin.config || {} );\n\n };\n\n return {\n prepare: prepare\n };\n\n}());\n\n\n// WEBPACK FOOTER //\n// ./modules/tools.js","/**\n * Codex Editor UI module\n *\n * @author Codex Team\n * @version 1.2.0\n */\n\nmodule.exports = (function (ui) {\n\n let editor = codex.editor;\n\n /**\n * Basic editor classnames\n */\n ui.className = {\n\n /**\n * @const {string} BLOCK_CLASSNAME - redactor blocks name\n */\n BLOCK_CLASSNAME : 'ce-block',\n\n /**\n * @const {String} wrapper for plugins content\n */\n BLOCK_CONTENT : 'ce-block__content',\n\n /**\n * @const {String} BLOCK_STRETCHED - makes block stretched\n */\n BLOCK_STRETCHED : 'ce-block--stretched',\n\n /**\n * @const {String} BLOCK_HIGHLIGHTED - adds background\n */\n BLOCK_HIGHLIGHTED : 'ce-block--focused',\n\n /**\n * @const {String} - for all default settings\n */\n SETTINGS_ITEM : 'ce-settings__item'\n\n };\n\n /**\n * @protected\n *\n * Making main interface\n */\n ui.prepare = function () {\n\n return new Promise(function (resolve) {\n\n let wrapper = editor.draw.wrapper(),\n redactor = editor.draw.redactor(),\n toolbar = makeToolBar_();\n\n wrapper.appendChild(toolbar);\n wrapper.appendChild(redactor);\n\n /** Save created ui-elements to static nodes state */\n editor.nodes.wrapper = wrapper;\n editor.nodes.redactor = redactor;\n\n /** Append editor wrapper with redactor zone into holder */\n editor.nodes.holder.appendChild(wrapper);\n\n resolve();\n\n })\n\n /** Add toolbox tools */\n .then(addTools_)\n\n /** Make container for inline toolbar */\n .then(makeInlineToolbar_)\n\n /** Add inline toolbar tools */\n .then(addInlineToolbarTools_)\n\n /** Draw wrapper for notifications */\n .then(makeNotificationHolder_)\n\n /** Add eventlisteners to redactor elements */\n .then(bindEvents_)\n\n .catch( function () {\n\n editor.core.log(\"Can't draw editor interface\");\n\n });\n\n };\n\n /**\n * @private\n * Draws inline toolbar zone\n */\n var makeInlineToolbar_ = function () {\n\n var container = editor.draw.inlineToolbar();\n\n /** Append to redactor new inline block */\n editor.nodes.inlineToolbar.wrapper = container;\n\n /** Draw toolbar buttons */\n editor.nodes.inlineToolbar.buttons = editor.draw.inlineToolbarButtons();\n\n /** Buttons action or settings */\n editor.nodes.inlineToolbar.actions = editor.draw.inlineToolbarActions();\n\n /** Append to inline toolbar buttons as part of it */\n editor.nodes.inlineToolbar.wrapper.appendChild(editor.nodes.inlineToolbar.buttons);\n editor.nodes.inlineToolbar.wrapper.appendChild(editor.nodes.inlineToolbar.actions);\n\n editor.nodes.wrapper.appendChild(editor.nodes.inlineToolbar.wrapper);\n\n };\n\n var makeToolBar_ = function () {\n\n let toolbar = editor.draw.toolbar(),\n blockButtons = makeToolbarSettings_(),\n toolbarContent = makeToolbarContent_();\n\n /** Appending first-level block buttons */\n toolbar.appendChild(blockButtons);\n\n /** Append toolbarContent to toolbar */\n toolbar.appendChild(toolbarContent);\n\n /** Make toolbar global */\n editor.nodes.toolbar = toolbar;\n\n return toolbar;\n\n };\n\n var makeToolbarContent_ = function () {\n\n let toolbarContent = editor.draw.toolbarContent(),\n toolbox = editor.draw.toolbox(),\n plusButton = editor.draw.plusButton();\n\n /** Append plus button */\n toolbarContent.appendChild(plusButton);\n\n /** Appending toolbar tools */\n toolbarContent.appendChild(toolbox);\n\n /** Make Toolbox and plusButton global */\n editor.nodes.toolbox = toolbox;\n editor.nodes.plusButton = plusButton;\n\n return toolbarContent;\n\n };\n\n var makeToolbarSettings_ = function () {\n\n let blockSettings = editor.draw.blockSettings(),\n blockButtons = editor.draw.blockButtons(),\n defaultSettings = editor.draw.defaultSettings(),\n showSettingsButton = editor.draw.settingsButton(),\n showTrashButton = editor.toolbar.settings.makeRemoveBlockButton(),\n pluginSettings = editor.draw.pluginsSettings();\n\n /** Add default and plugins settings */\n blockSettings.appendChild(pluginSettings);\n blockSettings.appendChild(defaultSettings);\n\n /**\n * Make blocks buttons\n * This block contains settings button and remove block button\n */\n blockButtons.appendChild(showSettingsButton);\n blockButtons.appendChild(showTrashButton);\n blockButtons.appendChild(blockSettings);\n\n /** Make BlockSettings, PluginSettings, DefaultSettings global */\n editor.nodes.blockSettings = blockSettings;\n editor.nodes.pluginSettings = pluginSettings;\n editor.nodes.defaultSettings = defaultSettings;\n editor.nodes.showSettingsButton = showSettingsButton;\n editor.nodes.showTrashButton = showTrashButton;\n\n return blockButtons;\n\n };\n\n /** Draw notifications holder */\n var makeNotificationHolder_ = function () {\n\n /** Append block with notifications to the document */\n editor.nodes.notifications = editor.notifications.createHolder();\n\n };\n\n /**\n * @private\n * Append tools passed in editor.tools\n */\n var addTools_ = function () {\n\n var tool,\n toolName,\n toolButton;\n\n for ( toolName in editor.settings.tools ) {\n\n tool = editor.settings.tools[toolName];\n\n editor.tools[toolName] = tool;\n\n if (!tool.iconClassname && tool.displayInToolbox) {\n\n editor.core.log('Toolbar icon classname missed. Tool %o skipped', 'warn', toolName);\n continue;\n\n }\n\n if (typeof tool.render != 'function') {\n\n editor.core.log('render method missed. Tool %o skipped', 'warn', toolName);\n continue;\n\n }\n\n if (!tool.displayInToolbox) {\n\n continue;\n\n } else {\n\n /** if tools is for toolbox */\n toolButton = editor.draw.toolbarButton(toolName, tool.iconClassname);\n\n editor.nodes.toolbox.appendChild(toolButton);\n\n editor.nodes.toolbarButtons[toolName] = toolButton;\n\n }\n\n }\n\n };\n\n var addInlineToolbarTools_ = function () {\n\n var tools = {\n\n bold: {\n icon : 'ce-icon-bold',\n command : 'bold'\n },\n\n italic: {\n icon : 'ce-icon-italic',\n command : 'italic'\n },\n\n link: {\n icon : 'ce-icon-link',\n command : 'createLink'\n }\n };\n\n var toolButton,\n tool;\n\n for(var name in tools) {\n\n tool = tools[name];\n\n toolButton = editor.draw.toolbarButtonInline(name, tool.icon);\n\n editor.nodes.inlineToolbar.buttons.appendChild(toolButton);\n /**\n * Add callbacks to this buttons\n */\n editor.ui.setInlineToolbarButtonBehaviour(toolButton, tool.command);\n\n }\n\n };\n\n /**\n * @private\n * Bind editor UI events\n */\n var bindEvents_ = function () {\n\n editor.core.log('ui.bindEvents fired', 'info');\n\n // window.addEventListener('error', function (errorMsg, url, lineNumber) {\n // editor.notifications.errorThrown(errorMsg, event);\n // }, false );\n\n /** All keydowns on Document */\n editor.listeners.add(document, 'keydown', editor.callback.globalKeydown, false);\n\n /** All keydowns on Redactor zone */\n editor.listeners.add(editor.nodes.redactor, 'keydown', editor.callback.redactorKeyDown, false);\n\n /** All keydowns on Document */\n editor.listeners.add(document, 'keyup', editor.callback.globalKeyup, false );\n\n /**\n * Mouse click to radactor\n */\n editor.listeners.add(editor.nodes.redactor, 'click', editor.callback.redactorClicked, false );\n\n /**\n * Clicks to the Plus button\n */\n editor.listeners.add(editor.nodes.plusButton, 'click', editor.callback.plusButtonClicked, false);\n\n /**\n * Clicks to SETTINGS button in toolbar\n */\n editor.listeners.add(editor.nodes.showSettingsButton, 'click', editor.callback.showSettingsButtonClicked, false );\n\n /** Bind click listeners on toolbar buttons */\n for (var button in editor.nodes.toolbarButtons) {\n\n editor.listeners.add(editor.nodes.toolbarButtons[button], 'click', editor.callback.toolbarButtonClicked, false);\n\n }\n\n };\n\n ui.addBlockHandlers = function (block) {\n\n if (!block) return;\n\n /**\n * Block keydowns\n */\n editor.listeners.add(block, 'keydown', editor.callback.blockKeydown, false);\n\n /**\n * Pasting content from another source\n * We have two type of sanitization\n * First - uses deep-first search algorithm to get sub nodes,\n * sanitizes whole Block_content and replaces cleared nodes\n * This method is deprecated\n * Method is used in editor.callback.blockPaste(event)\n *\n * Secont - uses Mutation observer.\n * Observer \"observe\" DOM changes and send changings to callback.\n * Callback gets changed node, not whole Block_content.\n * Inserted or changed node, which we've gotten have been cleared and replaced with diry node\n *\n * Method is used in editor.callback.blockPasteViaSanitize(event)\n *\n * @uses html-janitor\n * @example editor.callback.blockPasteViaSanitize(event), the second method.\n *\n */\n editor.listeners.add(block, 'paste', editor.paste.blockPasteCallback, false);\n\n /**\n * Show inline toolbar for selected text\n */\n editor.listeners.add(block, 'mouseup', editor.toolbar.inline.show, false);\n editor.listeners.add(block, 'keyup', editor.toolbar.inline.show, false);\n\n };\n\n /** getting all contenteditable elements */\n ui.saveInputs = function () {\n\n var redactor = editor.nodes.redactor;\n\n editor.state.inputs = [];\n\n /** Save all inputs in global variable state */\n var inputs = redactor.querySelectorAll('[contenteditable], input, textarea');\n\n Array.prototype.map.call(inputs, function (current) {\n\n if (!current.type || current.type == 'text' || current.type == 'textarea') {\n\n editor.state.inputs.push(current);\n\n }\n\n });\n\n };\n\n /**\n * Adds first initial block on empty redactor\n */\n ui.addInitialBlock = function () {\n\n var initialBlockType = editor.settings.initialBlockPlugin,\n initialBlock;\n\n if ( !editor.tools[initialBlockType] ) {\n\n editor.core.log('Plugin %o was not implemented and can\\'t be used as initial block', 'warn', initialBlockType);\n return;\n\n }\n\n initialBlock = editor.tools[initialBlockType].render();\n\n initialBlock.setAttribute('data-placeholder', editor.settings.placeholder);\n\n editor.content.insertBlock({\n type : initialBlockType,\n block : initialBlock\n });\n\n editor.content.workingNodeChanged(initialBlock);\n\n };\n\n ui.setInlineToolbarButtonBehaviour = function (button, type) {\n\n editor.listeners.add(button, 'mousedown', function (event) {\n\n editor.toolbar.inline.toolClicked(event, type);\n\n }, false);\n\n };\n\n return ui;\n\n})({});\n\n\n\n// WEBPACK FOOTER //\n// ./modules/ui.js","/**\n *\n * Codex.Editor Transport Module\n *\n * @copyright 2017 Codex-Team\n * @version 1.2.0\n */\n\nmodule.exports = (function (transport) {\n\n let editor = codex.editor;\n\n\n /**\n * @private {Object} current XmlHttpRequest instance\n */\n var currentRequest = null;\n\n\n /**\n * @type {null} | {DOMElement} input - keeps input element in memory\n */\n transport.input = null;\n\n /**\n * @property {Object} arguments - keep plugin settings and defined callbacks\n */\n transport.arguments = null;\n\n /**\n * Prepares input element where will be files\n */\n transport.prepare = function () {\n\n let input = editor.draw.node( 'INPUT', '', { type : 'file' } );\n\n editor.listeners.add(input, 'change', editor.transport.fileSelected);\n editor.transport.input = input;\n\n };\n\n /** Clear input when files is uploaded */\n transport.clearInput = function () {\n\n /** Remove old input */\n transport.input = null;\n\n /** Prepare new one */\n transport.prepare();\n\n };\n\n /**\n * Callback for file selection\n * @param {Event} event\n */\n transport.fileSelected = function () {\n\n var input = this,\n i,\n files = input.files,\n formData = new FormData();\n\n if (editor.transport.arguments.multiple === true) {\n\n for ( i = 0; i < files.length; i++) {\n\n formData.append('files[]', files[i], files[i].name);\n\n }\n\n } else {\n\n formData.append('files', files[0], files[0].name);\n\n }\n\n currentRequest = editor.core.ajax({\n type : 'POST',\n data : formData,\n url : editor.transport.arguments.url,\n beforeSend : editor.transport.arguments.beforeSend,\n success : editor.transport.arguments.success,\n error : editor.transport.arguments.error,\n progress : editor.transport.arguments.progress\n });\n\n /** Clear input */\n transport.clearInput();\n\n };\n\n /**\n * Use plugin callbacks\n * @protected\n *\n * @param {Object} args - can have :\n * @param {String} args.url - fetch URL\n * @param {Function} args.beforeSend - function calls before sending ajax\n * @param {Function} args.success - success callback\n * @param {Function} args.error - on error handler\n * @param {Function} args.progress - xhr onprogress handler\n * @param {Boolean} args.multiple - allow select several files\n * @param {String} args.accept - adds accept attribute\n */\n transport.selectAndUpload = function (args) {\n\n transport.arguments = args;\n\n if ( args.multiple === true) {\n\n transport.input.setAttribute('multiple', 'multiple');\n\n }\n\n if ( args.accept ) {\n\n transport.input.setAttribute('accept', args.accept);\n\n }\n\n transport.input.click();\n\n };\n\n transport.abort = function () {\n\n currentRequest.abort();\n\n currentRequest = null;\n\n };\n\n return transport;\n\n})({});\n\n\n// WEBPACK FOOTER //\n// ./modules/transport.js","/**\n * Codex Editor Renderer Module\n *\n * @author Codex Team\n * @version 1.0\n */\n\nmodule.exports = (function (renderer) {\n\n let editor = codex.editor;\n\n /**\n * Asyncronously parses input JSON to redactor blocks\n */\n renderer.makeBlocksFromData = function () {\n\n /**\n * If redactor is empty, add first paragraph to start writing\n */\n if (editor.core.isEmpty(editor.state.blocks) || !editor.state.blocks.items.length) {\n\n editor.ui.addInitialBlock();\n return;\n\n }\n\n Promise.resolve()\n\n /** First, get JSON from state */\n .then(function () {\n\n return editor.state.blocks;\n\n })\n\n /** Then, start to iterate they */\n .then(editor.renderer.appendBlocks)\n\n /** Write log if something goes wrong */\n .catch(function (error) {\n\n editor.core.log('Error while parsing JSON: %o', 'error', error);\n\n });\n\n };\n\n /**\n * Parses JSON to blocks\n * @param {object} data\n * @return Primise -> nodeList\n */\n renderer.appendBlocks = function (data) {\n\n var blocks = data.items;\n\n /**\n * Sequence of one-by-one blocks appending\n * Uses to save blocks order after async-handler\n */\n var nodeSequence = Promise.resolve();\n\n for (var index = 0; index < blocks.length ; index++ ) {\n\n /** Add node to sequence at specified index */\n editor.renderer.appendNodeAtIndex(nodeSequence, blocks, index);\n\n }\n\n };\n\n /**\n * Append node at specified index\n */\n renderer.appendNodeAtIndex = function (nodeSequence, blocks, index) {\n\n /** We need to append node to sequence */\n nodeSequence\n\n /** first, get node async-aware */\n .then(function () {\n\n return editor.renderer.getNodeAsync(blocks, index);\n\n })\n\n /**\n * second, compose editor-block from JSON object\n */\n .then(editor.renderer.createBlockFromData)\n\n /**\n * now insert block to redactor\n */\n .then(function (blockData) {\n\n /**\n * blockData has 'block', 'type' and 'stretched' information\n */\n editor.content.insertBlock(blockData);\n\n /** Pass created block to next step */\n return blockData.block;\n\n })\n\n /** Log if something wrong with node */\n .catch(function (error) {\n\n editor.core.log('Node skipped while parsing because %o', 'error', error);\n\n });\n\n };\n\n /**\n * Asynchronously returns block data from blocksList by index\n * @return Promise to node\n */\n renderer.getNodeAsync = function (blocksList, index) {\n\n return Promise.resolve().then(function () {\n\n return {\n tool : blocksList[index],\n position : index\n };\n\n });\n\n };\n\n /**\n * Creates editor block by JSON-data\n *\n * @uses render method of each plugin\n *\n * @param {Object} toolData.tool\n * { header : {\n * text: '',\n * type: 'H3', ...\n * }\n * }\n * @param {Number} toolData.position - index in input-blocks array\n * @return {Object} with type and Element\n */\n renderer.createBlockFromData = function ( toolData ) {\n\n /** New parser */\n var block,\n tool = toolData.tool,\n pluginName = tool.type;\n\n /** Get first key of object that stores plugin name */\n // for (var pluginName in blockData) break;\n\n /** Check for plugin existance */\n if (!editor.tools[pluginName]) {\n\n throw Error(`Plugin «${pluginName}» not found`);\n\n }\n\n /** Check for plugin having render method */\n if (typeof editor.tools[pluginName].render != 'function') {\n\n throw Error(`Plugin «${pluginName}» must have «render» method`);\n\n }\n\n if ( editor.tools[pluginName].available === false ) {\n\n block = editor.draw.unavailableBlock();\n\n block.innerHTML = editor.tools[pluginName].loadingMessage;\n\n /**\n * Saver will extract data from initial block data by position in array\n */\n block.dataset.inputPosition = toolData.position;\n\n } else {\n\n /** New Parser */\n block = editor.tools[pluginName].render(tool.data);\n\n }\n\n /** is first-level block stretched */\n var stretched = editor.tools[pluginName].isStretched || false;\n\n /** Retrun type and block */\n return {\n type : pluginName,\n block : block,\n stretched : stretched\n };\n\n };\n\n return renderer;\n\n})({});\n\n\n// WEBPACK FOOTER //\n// ./modules/renderer.js","/**\n * Codex Editor Saver\n *\n * @author Codex Team\n * @version 1.1.0\n */\n\nmodule.exports = (function (saver) {\n\n let editor = codex.editor;\n\n /**\n * @public\n * Save blocks\n */\n saver.save = function () {\n\n /** Save html content of redactor to memory */\n editor.state.html = editor.nodes.redactor.innerHTML;\n\n /** Clean jsonOutput state */\n editor.state.jsonOutput = [];\n\n return saveBlocks(editor.nodes.redactor.childNodes);\n\n };\n\n /**\n * @private\n * Save each block data\n *\n * @param blocks\n * @returns {Promise.}\n */\n let saveBlocks = function (blocks) {\n\n let data = [];\n\n for(let index = 0; index < blocks.length; index++) {\n\n data.push(getBlockData(blocks[index]));\n\n }\n\n return Promise.all(data)\n .then(makeOutput)\n .catch(editor.core.log);\n\n };\n\n /** Save and validate block data */\n let getBlockData = function (block) {\n\n return saveBlockData(block)\n .then(validateBlockData)\n .catch(editor.core.log);\n\n };\n\n /**\n * @private\n * Call block`s plugin save method and return saved data\n *\n * @param block\n * @returns {Object}\n */\n let saveBlockData = function (block) {\n\n let pluginName = block.dataset.tool;\n\n /** Check for plugin existence */\n if (!editor.tools[pluginName]) {\n\n editor.core.log(`Plugin «${pluginName}» not found`, 'error');\n return {data: null, pluginName: null};\n\n }\n\n /** Check for plugin having save method */\n if (typeof editor.tools[pluginName].save !== 'function') {\n\n editor.core.log(`Plugin «${pluginName}» must have save method`, 'error');\n return {data: null, pluginName: null};\n\n }\n\n /** Result saver */\n let blockContent = block.childNodes[0],\n pluginsContent = blockContent.childNodes[0],\n position = pluginsContent.dataset.inputPosition;\n\n /** If plugin wasn't available then return data from cache */\n if ( editor.tools[pluginName].available === false ) {\n\n return Promise.resolve({data: codex.editor.state.blocks.items[position].data, pluginName});\n\n }\n\n return Promise.resolve(pluginsContent)\n .then(editor.tools[pluginName].save)\n .then(data => Object({data, pluginName}));\n\n };\n\n /**\n * Call plugin`s validate method. Return false if validation failed\n *\n * @param data\n * @param pluginName\n * @returns {Object|Boolean}\n */\n let validateBlockData = function ({data, pluginName}) {\n\n if (!data || !pluginName) {\n\n return false;\n\n }\n\n if (editor.tools[pluginName].validate) {\n\n let result = editor.tools[pluginName].validate(data);\n\n /**\n * Do not allow invalid data\n */\n if (!result) {\n\n return false;\n\n }\n\n }\n\n return {data, pluginName};\n\n\n };\n\n /**\n * Compile article output\n *\n * @param savedData\n * @returns {{time: number, version, items: (*|Array)}}\n */\n let makeOutput = function (savedData) {\n\n savedData = savedData.filter(blockData => blockData);\n\n let items = savedData.map(blockData => Object({type: blockData.pluginName, data: blockData.data}));\n\n editor.state.jsonOutput = items;\n\n return {\n id: editor.state.blocks.id || null,\n time: +new Date(),\n version: editor.version,\n items\n };\n\n };\n\n return saver;\n\n})({});\n\n\n\n// WEBPACK FOOTER //\n// ./modules/saver.js","/**\n * Codex Editor Content Module\n * Works with DOM\n *\n * @module Codex Editor content module\n *\n * @author Codex Team\n * @version 1.3.13\n *\n * @description Module works with Elements that have been appended to the main DOM\n */\n\nmodule.exports = (function (content) {\n\n let editor = codex.editor;\n\n /**\n * Links to current active block\n * @type {null | Element}\n */\n content.currentNode = null;\n\n /**\n * clicked in redactor area\n * @type {null | Boolean}\n */\n content.editorAreaHightlighted = null;\n\n /**\n * @deprecated\n * Synchronizes redactor with original textarea\n */\n content.sync = function () {\n\n editor.core.log('syncing...');\n\n /**\n * Save redactor content to editor.state\n */\n editor.state.html = editor.nodes.redactor.innerHTML;\n\n };\n\n /**\n * Appends background to the block\n *\n * @description add CSS class to highlight visually first-level block area\n */\n content.markBlock = function () {\n\n editor.content.currentNode.classList.add(editor.ui.className.BLOCK_HIGHLIGHTED);\n\n };\n\n /**\n * Clear background\n *\n * @description clears styles that highlights block\n */\n content.clearMark = function () {\n\n if (editor.content.currentNode) {\n\n editor.content.currentNode.classList.remove(editor.ui.className.BLOCK_HIGHLIGHTED);\n\n }\n\n };\n\n /**\n * Finds first-level block\n *\n * @param {Element} node - selected or clicked in redactors area node\n * @protected\n *\n * @description looks for first-level block.\n * gets parent while node is not first-level\n */\n content.getFirstLevelBlock = function (node) {\n\n if (!editor.core.isDomNode(node)) {\n\n node = node.parentNode;\n\n }\n\n if (node === editor.nodes.redactor || node === document.body) {\n\n return null;\n\n } else {\n\n while(!node.classList.contains(editor.ui.className.BLOCK_CLASSNAME)) {\n\n node = node.parentNode;\n\n }\n\n return node;\n\n }\n\n };\n\n /**\n * Trigger this event when working node changed\n * @param {Element} targetNode - first-level of this node will be current\n * @protected\n *\n * @description If targetNode is first-level then we set it as current else we look for parents to find first-level\n */\n content.workingNodeChanged = function (targetNode) {\n\n /** Clear background from previous marked block before we change */\n editor.content.clearMark();\n\n if (!targetNode) {\n\n return;\n\n }\n\n content.currentNode = content.getFirstLevelBlock(targetNode);\n\n };\n\n /**\n * Replaces one redactor block with another\n * @protected\n * @param {Element} targetBlock - block to replace. Mostly currentNode.\n * @param {Element} newBlock\n * @param {string} newBlockType - type of new block; we need to store it to data-attribute\n *\n * [!] Function does not saves old block content.\n * You can get it manually and pass with newBlock.innerHTML\n */\n content.replaceBlock = function (targetBlock, newBlock) {\n\n if (!targetBlock || !newBlock) {\n\n editor.core.log('replaceBlock: missed params');\n return;\n\n }\n\n /** If target-block is not a frist-level block, then we iterate parents to find it */\n while(!targetBlock.classList.contains(editor.ui.className.BLOCK_CLASSNAME)) {\n\n targetBlock = targetBlock.parentNode;\n\n }\n\n /** Replacing */\n editor.nodes.redactor.replaceChild(newBlock, targetBlock);\n\n /**\n * Set new node as current\n */\n editor.content.workingNodeChanged(newBlock);\n\n /**\n * Add block handlers\n */\n editor.ui.addBlockHandlers(newBlock);\n\n /**\n * Save changes\n */\n editor.ui.saveInputs();\n\n };\n\n /**\n * @protected\n *\n * Inserts new block to redactor\n * Wrapps block into a DIV with BLOCK_CLASSNAME class\n *\n * @param blockData {object}\n * @param blockData.block {Element} element with block content\n * @param blockData.type {string} block plugin\n * @param needPlaceCaret {bool} pass true to set caret in new block\n *\n */\n content.insertBlock = function ( blockData, needPlaceCaret ) {\n\n var workingBlock = editor.content.currentNode,\n newBlockContent = blockData.block,\n blockType = blockData.type,\n isStretched = blockData.stretched;\n\n var newBlock = composeNewBlock_(newBlockContent, blockType, isStretched);\n\n if (workingBlock) {\n\n editor.core.insertAfter(workingBlock, newBlock);\n\n } else {\n\n /**\n * If redactor is empty, append as first child\n */\n editor.nodes.redactor.appendChild(newBlock);\n\n }\n\n /**\n * Block handler\n */\n editor.ui.addBlockHandlers(newBlock);\n\n /**\n * Set new node as current\n */\n editor.content.workingNodeChanged(newBlock);\n\n /**\n * Save changes\n */\n editor.ui.saveInputs();\n\n\n if ( needPlaceCaret ) {\n\n /**\n * If we don't know input index then we set default value -1\n */\n var currentInputIndex = editor.caret.getCurrentInputIndex() || -1;\n\n\n if (currentInputIndex == -1) {\n\n\n var editableElement = newBlock.querySelector('[contenteditable]'),\n emptyText = document.createTextNode('');\n\n editableElement.appendChild(emptyText);\n editor.caret.set(editableElement, 0, 0);\n\n editor.toolbar.move();\n editor.toolbar.showPlusButton();\n\n\n } else {\n\n if (currentInputIndex === editor.state.inputs.length - 1)\n return;\n\n /** Timeout for browsers execution */\n window.setTimeout(function () {\n\n /** Setting to the new input */\n editor.caret.setToNextBlock(currentInputIndex);\n editor.toolbar.move();\n editor.toolbar.open();\n\n }, 10);\n\n }\n\n }\n\n /**\n * Block is inserted, wait for new click that defined focusing on editors area\n * @type {boolean}\n */\n content.editorAreaHightlighted = false;\n\n };\n\n /**\n * Replaces blocks with saving content\n * @protected\n * @param {Element} noteToReplace\n * @param {Element} newNode\n * @param {Element} blockType\n */\n content.switchBlock = function (blockToReplace, newBlock, tool) {\n\n tool = tool || editor.content.currentNode.dataset.tool;\n var newBlockComposed = composeNewBlock_(newBlock, tool);\n\n /** Replacing */\n editor.content.replaceBlock(blockToReplace, newBlockComposed);\n\n /** Save new Inputs when block is changed */\n editor.ui.saveInputs();\n\n };\n\n /**\n * Iterates between child noted and looking for #text node on deepest level\n * @protected\n *\n * @param {Element} block - node where find\n * @param {int} postiton - starting postion\n * Example: childNodex.length to find from the end\n * or 0 to find from the start\n * @return {Text} block\n * @uses DFS\n */\n content.getDeepestTextNodeFromPosition = function (block, position) {\n\n /**\n * Clear Block from empty and useless spaces with trim.\n * Such nodes we should remove\n */\n var blockChilds = block.childNodes,\n index,\n node,\n text;\n\n for(index = 0; index < blockChilds.length; index++) {\n\n node = blockChilds[index];\n\n if (node.nodeType == editor.core.nodeTypes.TEXT) {\n\n text = node.textContent.trim();\n\n /** Text is empty. We should remove this child from node before we start DFS\n * decrease the quantity of childs.\n */\n if (text === '') {\n\n block.removeChild(node);\n position--;\n\n }\n\n }\n\n }\n\n if (block.childNodes.length === 0) {\n\n return document.createTextNode('');\n\n }\n\n /** Setting default position when we deleted all empty nodes */\n if ( position < 0 )\n position = 1;\n\n var lookingFromStart = false;\n\n /** For looking from START */\n if (position === 0) {\n\n lookingFromStart = true;\n position = 1;\n\n }\n\n while ( position ) {\n\n /** initial verticle of node. */\n if ( lookingFromStart ) {\n\n block = block.childNodes[0];\n\n } else {\n\n block = block.childNodes[position - 1];\n\n }\n\n if ( block.nodeType == editor.core.nodeTypes.TAG ) {\n\n position = block.childNodes.length;\n\n } else if (block.nodeType == editor.core.nodeTypes.TEXT ) {\n\n position = 0;\n\n }\n\n }\n\n return block;\n\n };\n\n /**\n * @private\n * @param {Element} block - current plugins render\n * @param {String} tool - plugins name\n * @param {Boolean} isStretched - make stretched block or not\n *\n * @description adds necessary information to wrap new created block by first-level holder\n */\n var composeNewBlock_ = function (block, tool, isStretched) {\n\n var newBlock = editor.draw.node('DIV', editor.ui.className.BLOCK_CLASSNAME, {}),\n blockContent = editor.draw.node('DIV', editor.ui.className.BLOCK_CONTENT, {});\n\n blockContent.appendChild(block);\n newBlock.appendChild(blockContent);\n\n if (isStretched) {\n\n blockContent.classList.add(editor.ui.className.BLOCK_STRETCHED);\n\n }\n\n newBlock.dataset.tool = tool;\n return newBlock;\n\n };\n\n /**\n * Returns Range object of current selection\n * @protected\n */\n content.getRange = function () {\n\n var selection = window.getSelection().getRangeAt(0);\n\n return selection;\n\n };\n\n /**\n * Divides block in two blocks (after and before caret)\n *\n * @protected\n * @param {int} inputIndex - target input index\n *\n * @description splits current input content to the separate blocks\n * When enter is pressed among the words, that text will be splited.\n */\n content.splitBlock = function (inputIndex) {\n\n var selection = window.getSelection(),\n anchorNode = selection.anchorNode,\n anchorNodeText = anchorNode.textContent,\n caretOffset = selection.anchorOffset,\n textBeforeCaret,\n textNodeBeforeCaret,\n textAfterCaret,\n textNodeAfterCaret;\n\n var currentBlock = editor.content.currentNode.querySelector('[contentEditable]');\n\n\n textBeforeCaret = anchorNodeText.substring(0, caretOffset);\n textAfterCaret = anchorNodeText.substring(caretOffset);\n\n textNodeBeforeCaret = document.createTextNode(textBeforeCaret);\n\n if (textAfterCaret) {\n\n textNodeAfterCaret = document.createTextNode(textAfterCaret);\n\n }\n\n var previousChilds = [],\n nextChilds = [],\n reachedCurrent = false;\n\n if (textNodeAfterCaret) {\n\n nextChilds.push(textNodeAfterCaret);\n\n }\n\n for ( var i = 0, child; !!(child = currentBlock.childNodes[i]); i++) {\n\n if ( child != anchorNode ) {\n\n if ( !reachedCurrent ) {\n\n previousChilds.push(child);\n\n } else {\n\n nextChilds.push(child);\n\n }\n\n } else {\n\n reachedCurrent = true;\n\n }\n\n }\n\n /** Clear current input */\n editor.state.inputs[inputIndex].innerHTML = '';\n\n /**\n * Append all childs founded before anchorNode\n */\n var previousChildsLength = previousChilds.length;\n\n for(i = 0; i < previousChildsLength; i++) {\n\n editor.state.inputs[inputIndex].appendChild(previousChilds[i]);\n\n }\n\n editor.state.inputs[inputIndex].appendChild(textNodeBeforeCaret);\n\n /**\n * Append text node which is after caret\n */\n var nextChildsLength = nextChilds.length,\n newNode = document.createElement('div');\n\n for(i = 0; i < nextChildsLength; i++) {\n\n newNode.appendChild(nextChilds[i]);\n\n }\n\n newNode = newNode.innerHTML;\n\n /** This type of block creates when enter is pressed */\n var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\n\n /**\n * Make new paragraph with text after caret\n */\n editor.content.insertBlock({\n type : NEW_BLOCK_TYPE,\n block : editor.tools[NEW_BLOCK_TYPE].render({\n text : newNode\n })\n }, true );\n\n };\n\n /**\n * Merges two blocks — current and target\n * If target index is not exist, then previous will be as target\n *\n * @protected\n * @param {int} currentInputIndex\n * @param {int} targetInputIndex\n *\n * @description gets two inputs indexes and merges into one\n */\n content.mergeBlocks = function (currentInputIndex, targetInputIndex) {\n\n /** If current input index is zero, then prevent method execution */\n if (currentInputIndex === 0) {\n\n return;\n\n }\n\n var targetInput,\n currentInputContent = editor.state.inputs[currentInputIndex].innerHTML;\n\n if (!targetInputIndex) {\n\n targetInput = editor.state.inputs[currentInputIndex - 1];\n\n } else {\n\n targetInput = editor.state.inputs[targetInputIndex];\n\n }\n\n targetInput.innerHTML += currentInputContent;\n\n };\n\n /**\n * Iterates all right siblings and parents, which has right siblings\n * while it does not reached the first-level block\n *\n * @param {Element} node\n * @return {boolean}\n */\n content.isLastNode = function (node) {\n\n // console.log('погнали перебор родителей');\n\n var allChecked = false;\n\n while ( !allChecked ) {\n\n // console.log('Смотрим на %o', node);\n // console.log('Проверим, пустые ли соседи справа');\n\n if ( !allSiblingsEmpty_(node) ) {\n\n // console.log('Есть непустые соседи. Узел не последний. Выходим.');\n return false;\n\n }\n\n node = node.parentNode;\n\n /**\n * Проверяем родителей до тех пор, пока не найдем блок первого уровня\n */\n if ( node.classList.contains(editor.ui.className.BLOCK_CONTENT) ) {\n\n allChecked = true;\n\n }\n\n }\n\n return true;\n\n };\n\n /**\n * Checks if all element right siblings is empty\n * @param node\n */\n var allSiblingsEmpty_ = function (node) {\n\n /**\n * Нужно убедиться, что после пустого соседа ничего нет\n */\n var sibling = node.nextSibling;\n\n while ( sibling ) {\n\n if (sibling.textContent.length) {\n\n return false;\n\n }\n\n sibling = sibling.nextSibling;\n\n }\n\n return true;\n\n };\n\n /**\n * @public\n *\n * @param {string} htmlData - html content as string\n * @param {string} plainData - plain text\n * @return {string} - html content as string\n */\n content.wrapTextWithParagraphs = function (htmlData, plainData) {\n\n if (!htmlData.trim()) {\n\n return wrapPlainTextWithParagraphs(plainData);\n\n }\n\n var wrapper = document.createElement('DIV'),\n newWrapper = document.createElement('DIV'),\n i,\n paragraph,\n firstLevelBlocks = ['DIV', 'P'],\n blockTyped,\n node;\n\n /**\n * Make HTML Element to Wrap Text\n * It allows us to work with input data as HTML content\n */\n wrapper.innerHTML = htmlData;\n paragraph = document.createElement('P');\n\n for (i = 0; i < wrapper.childNodes.length; i++) {\n\n node = wrapper.childNodes[i];\n\n blockTyped = firstLevelBlocks.indexOf(node.tagName) != -1;\n\n /**\n * If node is first-levet\n * we add this node to our new wrapper\n */\n if ( blockTyped ) {\n\n /**\n * If we had splitted inline nodes to paragraph before\n */\n if ( paragraph.childNodes.length ) {\n\n newWrapper.appendChild(paragraph.cloneNode(true));\n\n /** empty paragraph */\n paragraph = null;\n paragraph = document.createElement('P');\n\n }\n\n newWrapper.appendChild(node.cloneNode(true));\n\n } else {\n\n /** Collect all inline nodes to one as paragraph */\n paragraph.appendChild(node.cloneNode(true));\n\n /** if node is last we should append this node to paragraph and paragraph to new wrapper */\n if ( i == wrapper.childNodes.length - 1 ) {\n\n newWrapper.appendChild(paragraph.cloneNode(true));\n\n }\n\n }\n\n }\n\n return newWrapper.innerHTML;\n\n };\n\n /**\n * Splits strings on new line and wraps paragraphs with

    tag\n * @param plainText\n * @returns {string}\n */\n var wrapPlainTextWithParagraphs = function (plainText) {\n\n if (!plainText) return '';\n\n return '

    ' + plainText.split('\\n\\n').join('

    ') + '

    ';\n\n };\n\n /**\n * Finds closest Contenteditable parent from Element\n * @param {Element} node element looking from\n * @return {Element} node contenteditable\n */\n content.getEditableParent = function (node) {\n\n while (node && node.contentEditable != 'true') {\n\n node = node.parentNode;\n\n }\n\n return node;\n\n };\n\n /**\n * Clear editors content\n *\n * @param {Boolean} all — if true, delete all article data (content, id, etc.)\n */\n content.clear = function (all) {\n\n editor.nodes.redactor.innerHTML = '';\n editor.content.sync();\n editor.ui.saveInputs();\n if (all) {\n\n editor.state.blocks = {};\n\n } else if (editor.state.blocks) {\n\n editor.state.blocks.items = [];\n\n }\n\n editor.content.currentNode = null;\n\n };\n\n /**\n *\n * Load new data to editor\n * If editor is not empty, just append articleData.items\n *\n * @param articleData.items\n */\n content.load = function (articleData) {\n\n var currentContent = Object.assign({}, editor.state.blocks);\n\n editor.content.clear();\n\n if (!Object.keys(currentContent).length) {\n\n editor.state.blocks = articleData;\n\n } else if (!currentContent.items) {\n\n currentContent.items = articleData.items;\n editor.state.blocks = currentContent;\n\n } else {\n\n currentContent.items = currentContent.items.concat(articleData.items);\n editor.state.blocks = currentContent;\n\n }\n\n editor.renderer.makeBlocksFromData();\n\n };\n\n return content;\n\n})({});\n\n\n// WEBPACK FOOTER //\n// ./modules/content.js","/**\n * Codex Editor toolbar module\n *\n * Contains:\n * - Inline toolbox\n * - Toolbox within plus button\n * - Settings section\n *\n * @author Codex Team\n * @version 1.0\n */\n\nmodule.exports = (function (toolbar) {\n\n let editor = codex.editor;\n\n toolbar.settings = require('./settings');\n toolbar.inline = require('./inline');\n toolbar.toolbox = require('./toolbox');\n\n /**\n * Margin between focused node and toolbar\n */\n toolbar.defaultToolbarHeight = 49;\n\n toolbar.defaultOffset = 34;\n\n toolbar.opened = false;\n\n toolbar.current = null;\n\n /**\n * @protected\n */\n toolbar.open = function () {\n\n if (editor.hideToolbar) {\n\n return;\n\n }\n\n let toolType = editor.content.currentNode.dataset.tool;\n\n if (!editor.tools[toolType] || !editor.tools[toolType].makeSettings ) {\n\n editor.nodes.showSettingsButton.classList.add('hide');\n\n } else {\n\n editor.nodes.showSettingsButton.classList.remove('hide');\n\n }\n\n editor.nodes.toolbar.classList.add('opened');\n this.opened = true;\n\n };\n\n /**\n * @protected\n */\n toolbar.close = function () {\n\n editor.nodes.toolbar.classList.remove('opened');\n\n toolbar.opened = false;\n toolbar.current = null;\n\n for (var button in editor.nodes.toolbarButtons) {\n\n editor.nodes.toolbarButtons[button].classList.remove('selected');\n\n }\n\n /** Close toolbox when toolbar is not displayed */\n editor.toolbar.toolbox.close();\n editor.toolbar.settings.close();\n\n };\n\n toolbar.toggle = function () {\n\n if ( !this.opened ) {\n\n this.open();\n\n } else {\n\n this.close();\n\n }\n\n };\n\n toolbar.hidePlusButton = function () {\n\n editor.nodes.plusButton.classList.add('hide');\n\n };\n\n toolbar.showPlusButton = function () {\n\n editor.nodes.plusButton.classList.remove('hide');\n\n };\n\n /**\n * Moving toolbar to the specified node\n */\n toolbar.move = function () {\n\n /** Close Toolbox when we move toolbar */\n editor.toolbar.toolbox.close();\n\n if (!editor.content.currentNode) {\n\n return;\n\n }\n\n var newYCoordinate = editor.content.currentNode.offsetTop - (editor.toolbar.defaultToolbarHeight / 2) + editor.toolbar.defaultOffset;\n\n editor.nodes.toolbar.style.transform = `translate3D(0, ${Math.floor(newYCoordinate)}px, 0)`;\n\n /** Close trash actions */\n editor.toolbar.settings.hideRemoveActions();\n\n };\n\n return toolbar;\n\n})({});\n\n\n\n// WEBPACK FOOTER //\n// ./modules/toolbar/toolbar.js","/**\n * Toolbar settings\n *\n * @version 1.0.5\n */\n\nmodule.exports = (function (settings) {\n\n let editor = codex.editor;\n\n settings.opened = false;\n\n settings.setting = null;\n settings.actions = null;\n\n /**\n * Append and open settings\n */\n settings.open = function (toolType) {\n\n /**\n * Append settings content\n * It's stored in tool.settings\n */\n if ( !editor.tools[toolType] || !editor.tools[toolType].makeSettings ) {\n\n return;\n\n }\n\n /**\n * Draw settings block\n */\n var settingsBlock = editor.tools[toolType].makeSettings();\n\n editor.nodes.pluginSettings.appendChild(settingsBlock);\n\n\n /** Open settings block */\n editor.nodes.blockSettings.classList.add('opened');\n this.opened = true;\n\n };\n\n /**\n * Close and clear settings\n */\n settings.close = function () {\n\n editor.nodes.blockSettings.classList.remove('opened');\n editor.nodes.pluginSettings.innerHTML = '';\n\n this.opened = false;\n\n };\n\n /**\n * @param {string} toolType - plugin type\n */\n settings.toggle = function ( toolType ) {\n\n if ( !this.opened ) {\n\n this.open(toolType);\n\n } else {\n\n this.close();\n\n }\n\n };\n\n /**\n * Here we will draw buttons and add listeners to components\n */\n settings.makeRemoveBlockButton = function () {\n\n var removeBlockWrapper = editor.draw.node('SPAN', 'ce-toolbar__remove-btn', {}),\n settingButton = editor.draw.node('SPAN', 'ce-toolbar__remove-setting', { innerHTML : '' }),\n actionWrapper = editor.draw.node('DIV', 'ce-toolbar__remove-confirmation', {}),\n confirmAction = editor.draw.node('DIV', 'ce-toolbar__remove-confirm', { textContent : 'Удалить блок' }),\n cancelAction = editor.draw.node('DIV', 'ce-toolbar__remove-cancel', { textContent : 'Отмена' });\n\n editor.listeners.add(settingButton, 'click', editor.toolbar.settings.removeButtonClicked, false);\n\n editor.listeners.add(confirmAction, 'click', editor.toolbar.settings.confirmRemovingRequest, false);\n\n editor.listeners.add(cancelAction, 'click', editor.toolbar.settings.cancelRemovingRequest, false);\n\n actionWrapper.appendChild(confirmAction);\n actionWrapper.appendChild(cancelAction);\n\n removeBlockWrapper.appendChild(settingButton);\n removeBlockWrapper.appendChild(actionWrapper);\n\n /** Save setting */\n editor.toolbar.settings.setting = settingButton;\n editor.toolbar.settings.actions = actionWrapper;\n\n return removeBlockWrapper;\n\n };\n\n settings.removeButtonClicked = function () {\n\n var action = editor.toolbar.settings.actions;\n\n if (action.classList.contains('opened')) {\n\n editor.toolbar.settings.hideRemoveActions();\n\n } else {\n\n editor.toolbar.settings.showRemoveActions();\n\n }\n\n editor.toolbar.toolbox.close();\n editor.toolbar.settings.close();\n\n };\n\n settings.cancelRemovingRequest = function () {\n\n editor.toolbar.settings.actions.classList.remove('opened');\n\n };\n\n settings.confirmRemovingRequest = function () {\n\n var currentBlock = editor.content.currentNode,\n firstLevelBlocksCount;\n\n currentBlock.remove();\n\n firstLevelBlocksCount = editor.nodes.redactor.childNodes.length;\n\n /**\n * If all blocks are removed\n */\n if (firstLevelBlocksCount === 0) {\n\n /** update currentNode variable */\n editor.content.currentNode = null;\n\n /** Inserting new empty initial block */\n editor.ui.addInitialBlock();\n\n }\n\n editor.ui.saveInputs();\n\n editor.toolbar.close();\n\n };\n\n settings.showRemoveActions = function () {\n\n editor.toolbar.settings.actions.classList.add('opened');\n\n };\n\n settings.hideRemoveActions = function () {\n\n editor.toolbar.settings.actions.classList.remove('opened');\n\n };\n\n return settings;\n\n})({});\n\n\n\n// WEBPACK FOOTER //\n// ./modules/toolbar/settings.js","/**\n * Inline toolbar\n *\n * Contains from tools:\n * Bold, Italic, Underline and Anchor\n *\n * @author Codex Team\n * @version 1.0\n */\n\nmodule.exports = (function (inline) {\n\n let editor = codex.editor;\n\n inline.buttonsOpened = null;\n inline.actionsOpened = null;\n inline.wrappersOffset = null;\n\n /**\n * saving selection that need for execCommand for styling\n *\n */\n inline.storedSelection = null;\n\n /**\n * @protected\n *\n * Open inline toobar\n */\n inline.show = function () {\n\n var currentNode = editor.content.currentNode,\n tool = currentNode.dataset.tool,\n plugin;\n\n /**\n * tool allowed to open inline toolbar\n */\n plugin = editor.tools[tool];\n\n if (!plugin.showInlineToolbar)\n return;\n\n var selectedText = inline.getSelectionText(),\n toolbar = editor.nodes.inlineToolbar.wrapper;\n\n if (selectedText.length > 0) {\n\n /** Move toolbar and open */\n editor.toolbar.inline.move();\n\n /** Open inline toolbar */\n toolbar.classList.add('opened');\n\n /** show buttons of inline toolbar */\n editor.toolbar.inline.showButtons();\n\n }\n\n };\n\n /**\n * @protected\n *\n * Closes inline toolbar\n */\n inline.close = function () {\n\n var toolbar = editor.nodes.inlineToolbar.wrapper;\n\n toolbar.classList.remove('opened');\n\n };\n\n /**\n * @private\n *\n * Moving toolbar\n */\n inline.move = function () {\n\n if (!this.wrappersOffset) {\n\n this.wrappersOffset = this.getWrappersOffset();\n\n }\n\n var coords = this.getSelectionCoords(),\n defaultOffset = 0,\n toolbar = editor.nodes.inlineToolbar.wrapper,\n newCoordinateX,\n newCoordinateY;\n\n if (toolbar.offsetHeight === 0) {\n\n defaultOffset = 40;\n\n }\n\n newCoordinateX = coords.x - this.wrappersOffset.left;\n newCoordinateY = coords.y + window.scrollY - this.wrappersOffset.top - defaultOffset - toolbar.offsetHeight;\n\n toolbar.style.transform = `translate3D(${Math.floor(newCoordinateX)}px, ${Math.floor(newCoordinateY)}px, 0)`;\n\n /** Close everything */\n editor.toolbar.inline.closeButtons();\n editor.toolbar.inline.closeAction();\n\n };\n\n /**\n * @private\n *\n * Tool Clicked\n */\n\n inline.toolClicked = function (event, type) {\n\n /**\n * For simple tools we use default browser function\n * For more complicated tools, we should write our own behavior\n */\n switch (type) {\n case 'createLink' : editor.toolbar.inline.createLinkAction(event, type); break;\n default : editor.toolbar.inline.defaultToolAction(type); break;\n }\n\n /**\n * highlight buttons\n * after making some action\n */\n editor.nodes.inlineToolbar.buttons.childNodes.forEach(editor.toolbar.inline.hightlight);\n\n };\n\n /**\n * @private\n *\n * Saving wrappers offset in DOM\n */\n inline.getWrappersOffset = function () {\n\n var wrapper = editor.nodes.wrapper,\n offset = this.getOffset(wrapper);\n\n this.wrappersOffset = offset;\n return offset;\n\n };\n\n /**\n * @private\n *\n * Calculates offset of DOM element\n *\n * @param el\n * @returns {{top: number, left: number}}\n */\n inline.getOffset = function ( el ) {\n\n var _x = 0;\n var _y = 0;\n\n while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) {\n\n _x += (el.offsetLeft + el.clientLeft);\n _y += (el.offsetTop + el.clientTop);\n el = el.offsetParent;\n\n }\n return { top: _y, left: _x };\n\n };\n\n /**\n * @private\n *\n * Calculates position of selected text\n * @returns {{x: number, y: number}}\n */\n inline.getSelectionCoords = function () {\n\n var sel = document.selection, range;\n var x = 0, y = 0;\n\n if (sel) {\n\n if (sel.type != 'Control') {\n\n range = sel.createRange();\n range.collapse(true);\n x = range.boundingLeft;\n y = range.boundingTop;\n\n }\n\n } else if (window.getSelection) {\n\n sel = window.getSelection();\n\n if (sel.rangeCount) {\n\n range = sel.getRangeAt(0).cloneRange();\n if (range.getClientRects) {\n\n range.collapse(true);\n var rect = range.getClientRects()[0];\n\n if (!rect) {\n\n return;\n\n }\n\n x = rect.left;\n y = rect.top;\n\n }\n\n }\n\n }\n return { x: x, y: y };\n\n };\n\n /**\n * @private\n *\n * Returns selected text as String\n * @returns {string}\n */\n inline.getSelectionText = function () {\n\n var selectedText = '';\n\n // all modern browsers and IE9+\n if (window.getSelection) {\n\n selectedText = window.getSelection().toString();\n\n }\n\n return selectedText;\n\n };\n\n /** Opens buttons block */\n inline.showButtons = function () {\n\n var buttons = editor.nodes.inlineToolbar.buttons;\n\n buttons.classList.add('opened');\n\n editor.toolbar.inline.buttonsOpened = true;\n\n /** highlight buttons */\n editor.nodes.inlineToolbar.buttons.childNodes.forEach(editor.toolbar.inline.hightlight);\n\n };\n\n /** Makes buttons disappear */\n inline.closeButtons = function () {\n\n var buttons = editor.nodes.inlineToolbar.buttons;\n\n buttons.classList.remove('opened');\n\n editor.toolbar.inline.buttonsOpened = false;\n\n };\n\n /** Open buttons defined action if exist */\n inline.showActions = function () {\n\n var action = editor.nodes.inlineToolbar.actions;\n\n action.classList.add('opened');\n\n editor.toolbar.inline.actionsOpened = true;\n\n };\n\n /** Close actions block */\n inline.closeAction = function () {\n\n var action = editor.nodes.inlineToolbar.actions;\n\n action.innerHTML = '';\n action.classList.remove('opened');\n editor.toolbar.inline.actionsOpened = false;\n\n };\n\n\n /**\n * Callback for keydowns in inline toolbar \"Insert link...\" input\n */\n let inlineToolbarAnchorInputKeydown_ = function (event) {\n\n if (event.keyCode != editor.core.keys.ENTER) {\n\n return;\n\n }\n\n let editable = editor.content.currentNode,\n storedSelection = editor.toolbar.inline.storedSelection;\n\n editor.toolbar.inline.restoreSelection(editable, storedSelection);\n editor.toolbar.inline.setAnchor(this.value);\n\n /**\n * Preventing events that will be able to happen\n */\n event.preventDefault();\n event.stopImmediatePropagation();\n\n editor.toolbar.inline.clearRange();\n\n };\n\n /** Action for link creation or for setting anchor */\n inline.createLinkAction = function (event) {\n\n var isActive = this.isLinkActive();\n\n var editable = editor.content.currentNode,\n storedSelection = editor.toolbar.inline.saveSelection(editable);\n\n /** Save globally selection */\n editor.toolbar.inline.storedSelection = storedSelection;\n\n if (isActive) {\n\n\n /**\n * Changing stored selection. if we want to remove anchor from word\n * we should remove anchor from whole word, not only selected part.\n * The solution is than we get the length of current link\n * Change start position to - end of selection minus length of anchor\n */\n editor.toolbar.inline.restoreSelection(editable, storedSelection);\n\n editor.toolbar.inline.defaultToolAction('unlink');\n\n } else {\n\n /** Create input and close buttons */\n var action = editor.draw.inputForLink();\n\n editor.nodes.inlineToolbar.actions.appendChild(action);\n\n editor.toolbar.inline.closeButtons();\n editor.toolbar.inline.showActions();\n\n /**\n * focus to input\n * Solution: https://developer.mozilla.org/ru/docs/Web/API/HTMLElement/focus\n * Prevents event after showing input and when we need to focus an input which is in unexisted form\n */\n action.focus();\n event.preventDefault();\n\n /** Callback to link action */\n editor.listeners.add(action, 'keydown', inlineToolbarAnchorInputKeydown_, false);\n\n }\n\n };\n\n inline.isLinkActive = function () {\n\n var isActive = false;\n\n editor.nodes.inlineToolbar.buttons.childNodes.forEach(function (tool) {\n\n var dataType = tool.dataset.type;\n\n if (dataType == 'link' && tool.classList.contains('hightlighted')) {\n\n isActive = true;\n\n }\n\n });\n\n return isActive;\n\n };\n\n /** default action behavior of tool */\n inline.defaultToolAction = function (type) {\n\n document.execCommand(type, false, null);\n\n };\n\n /**\n * @private\n *\n * Sets URL\n *\n * @param {String} url - URL\n */\n inline.setAnchor = function (url) {\n\n document.execCommand('createLink', false, url);\n\n /** Close after URL inserting */\n editor.toolbar.inline.closeAction();\n\n };\n\n /**\n * @private\n *\n * Saves selection\n */\n inline.saveSelection = function (containerEl) {\n\n var range = window.getSelection().getRangeAt(0),\n preSelectionRange = range.cloneRange(),\n start;\n\n preSelectionRange.selectNodeContents(containerEl);\n preSelectionRange.setEnd(range.startContainer, range.startOffset);\n\n start = preSelectionRange.toString().length;\n\n return {\n start: start,\n end: start + range.toString().length\n };\n\n };\n\n /**\n * @private\n *\n * Sets to previous selection (Range)\n *\n * @param {Element} containerEl - editable element where we restore range\n * @param {Object} savedSel - range basic information to restore\n */\n inline.restoreSelection = function (containerEl, savedSel) {\n\n var range = document.createRange(),\n charIndex = 0;\n\n range.setStart(containerEl, 0);\n range.collapse(true);\n\n var nodeStack = [ containerEl ],\n node,\n foundStart = false,\n stop = false,\n nextCharIndex;\n\n while (!stop && (node = nodeStack.pop())) {\n\n if (node.nodeType == 3) {\n\n nextCharIndex = charIndex + node.length;\n\n if (!foundStart && savedSel.start >= charIndex && savedSel.start <= nextCharIndex) {\n\n range.setStart(node, savedSel.start - charIndex);\n foundStart = true;\n\n }\n if (foundStart && savedSel.end >= charIndex && savedSel.end <= nextCharIndex) {\n\n range.setEnd(node, savedSel.end - charIndex);\n stop = true;\n\n }\n charIndex = nextCharIndex;\n\n } else {\n\n var i = node.childNodes.length;\n\n while (i--) {\n\n nodeStack.push(node.childNodes[i]);\n\n }\n\n }\n\n }\n\n var sel = window.getSelection();\n\n sel.removeAllRanges();\n sel.addRange(range);\n\n };\n\n /**\n * @private\n *\n * Removes all ranges from window selection\n */\n inline.clearRange = function () {\n\n var selection = window.getSelection();\n\n selection.removeAllRanges();\n\n };\n\n /**\n * @private\n *\n * sets or removes hightlight\n */\n inline.hightlight = function (tool) {\n\n var dataType = tool.dataset.type;\n\n if (document.queryCommandState(dataType)) {\n\n editor.toolbar.inline.setButtonHighlighted(tool);\n\n } else {\n\n editor.toolbar.inline.removeButtonsHighLight(tool);\n\n }\n\n /**\n *\n * hightlight for anchors\n */\n var selection = window.getSelection(),\n tag = selection.anchorNode.parentNode;\n\n if (tag.tagName == 'A' && dataType == 'link') {\n\n editor.toolbar.inline.setButtonHighlighted(tool);\n\n }\n\n };\n\n /**\n * @private\n *\n * Mark button if text is already executed\n */\n inline.setButtonHighlighted = function (button) {\n\n button.classList.add('hightlighted');\n\n /** At link tool we also change icon */\n if (button.dataset.type == 'link') {\n\n var icon = button.childNodes[0];\n\n icon.classList.remove('ce-icon-link');\n icon.classList.add('ce-icon-unlink');\n\n }\n\n };\n\n /**\n * @private\n *\n * Removes hightlight\n */\n inline.removeButtonsHighLight = function (button) {\n\n button.classList.remove('hightlighted');\n\n /** At link tool we also change icon */\n if (button.dataset.type == 'link') {\n\n var icon = button.childNodes[0];\n\n icon.classList.remove('ce-icon-unlink');\n icon.classList.add('ce-icon-link');\n\n }\n\n };\n\n\n return inline;\n\n})({});\n\n\n// WEBPACK FOOTER //\n// ./modules/toolbar/inline.js","/**\n * Codex Editor toolbox\n *\n * All tools be able to appended here\n *\n * @author Codex Team\n * @version 1.0\n */\n\nmodule.exports = (function (toolbox) {\n\n let editor = codex.editor;\n\n toolbox.opened = false;\n toolbox.openedOnBlock = null;\n\n /** Shows toolbox */\n toolbox.open = function () {\n\n /** Close setting if toolbox is opened */\n if (editor.toolbar.settings.opened) {\n\n editor.toolbar.settings.close();\n\n }\n\n /** Add 'toolbar-opened' class for current block **/\n toolbox.openedOnBlock = editor.content.currentNode;\n toolbox.openedOnBlock.classList.add('toolbar-opened');\n\n /** display toolbox */\n editor.nodes.toolbox.classList.add('opened');\n\n /** Animate plus button */\n editor.nodes.plusButton.classList.add('clicked');\n\n /** toolbox state */\n editor.toolbar.toolbox.opened = true;\n\n };\n\n /** Closes toolbox */\n toolbox.close = function () {\n\n /** Remove 'toolbar-opened' class from current block **/\n if (toolbox.openedOnBlock) toolbox.openedOnBlock.classList.remove('toolbar-opened');\n toolbox.openedOnBlock = null;\n\n /** Makes toolbox disappear */\n editor.nodes.toolbox.classList.remove('opened');\n\n /** Rotate plus button */\n editor.nodes.plusButton.classList.remove('clicked');\n\n /** toolbox state */\n editor.toolbar.toolbox.opened = false;\n\n editor.toolbar.current = null;\n\n };\n\n toolbox.leaf = function () {\n\n let currentTool = editor.toolbar.current,\n tools = Object.keys(editor.tools),\n barButtons = editor.nodes.toolbarButtons,\n nextToolIndex = 0,\n toolToSelect,\n visibleTool,\n tool;\n\n if ( !currentTool ) {\n\n /** Get first tool from object*/\n for(tool in editor.tools) {\n\n if (editor.tools[tool].displayInToolbox) {\n\n break;\n\n }\n\n nextToolIndex ++;\n\n }\n\n } else {\n\n nextToolIndex = (tools.indexOf(currentTool) + 1) % tools.length;\n visibleTool = tools[nextToolIndex];\n\n while (!editor.tools[visibleTool].displayInToolbox) {\n\n nextToolIndex = (nextToolIndex + 1) % tools.length;\n visibleTool = tools[nextToolIndex];\n\n }\n\n }\n\n toolToSelect = tools[nextToolIndex];\n\n for ( var button in barButtons ) {\n\n barButtons[button].classList.remove('selected');\n\n }\n\n barButtons[toolToSelect].classList.add('selected');\n editor.toolbar.current = toolToSelect;\n\n };\n\n /**\n * Transforming selected node type into selected toolbar element type\n * @param {event} event\n */\n toolbox.toolClicked = function (event) {\n\n /**\n * UNREPLACEBLE_TOOLS this types of tools are forbidden to replace even they are empty\n */\n var UNREPLACEBLE_TOOLS = ['image', 'link', 'list', 'instagram', 'twitter', 'embed'],\n tool = editor.tools[editor.toolbar.current],\n workingNode = editor.content.currentNode,\n currentInputIndex = editor.caret.inputIndex,\n newBlockContent,\n appendCallback,\n blockData;\n\n /** Make block from plugin */\n newBlockContent = tool.render();\n\n /** information about block */\n blockData = {\n block : newBlockContent,\n type : tool.type,\n stretched : false\n };\n\n if (\n workingNode &&\n UNREPLACEBLE_TOOLS.indexOf(workingNode.dataset.tool) === -1 &&\n workingNode.textContent.trim() === ''\n ) {\n\n /** Replace current block */\n editor.content.switchBlock(workingNode, newBlockContent, tool.type);\n\n } else {\n\n /** Insert new Block from plugin */\n editor.content.insertBlock(blockData);\n\n /** increase input index */\n currentInputIndex++;\n\n }\n\n /** Fire tool append callback */\n appendCallback = tool.appendCallback;\n\n if (appendCallback && typeof appendCallback == 'function') {\n\n appendCallback.call(event);\n\n }\n\n window.setTimeout(function () {\n\n /** Set caret to current block */\n editor.caret.setToBlock(currentInputIndex);\n\n }, 10);\n\n\n /**\n * Changing current Node\n */\n editor.content.workingNodeChanged();\n\n /**\n * Move toolbar when node is changed\n */\n editor.toolbar.move();\n\n };\n\n return toolbox;\n\n})({});\n\n\n// WEBPACK FOOTER //\n// ./modules/toolbar/toolbox.js","/**\n * @module Codex Editor Callbacks module\n * @description Module works with editor added Elements\n *\n * @author Codex Team\n * @version 1.4.0\n */\n\nmodule.exports = (function (callbacks) {\n\n let editor = codex.editor;\n\n /**\n * used by UI module\n * @description Routes all keydowns on document\n * @param {Object} event\n */\n callbacks.globalKeydown = function (event) {\n\n switch (event.keyCode) {\n case editor.core.keys.ENTER : enterKeyPressed_(event); break;\n }\n\n };\n\n /**\n * used by UI module\n * @description Routes all keydowns on redactors area\n * @param {Object} event\n */\n callbacks.redactorKeyDown = function (event) {\n\n switch (event.keyCode) {\n case editor.core.keys.TAB : tabKeyPressedOnRedactorsZone_(event); break;\n case editor.core.keys.ENTER : enterKeyPressedOnRedactorsZone_(event); break;\n case editor.core.keys.ESC : escapeKeyPressedOnRedactorsZone_(event); break;\n default : defaultKeyPressedOnRedactorsZone_(event); break;\n }\n\n };\n\n /**\n * used by UI module\n * @description Routes all keyup events\n * @param {Object} event\n */\n callbacks.globalKeyup = function (event) {\n\n switch (event.keyCode) {\n case editor.core.keys.UP :\n case editor.core.keys.LEFT :\n case editor.core.keys.RIGHT :\n case editor.core.keys.DOWN : arrowKeyPressed_(event); break;\n }\n\n };\n\n /**\n * @param {Object} event\n * @private\n *\n * Handles behaviour when tab pressed\n * @description if Content is empty show toolbox (if it is closed) or leaf tools\n * uses Toolbars toolbox module to handle the situation\n */\n var tabKeyPressedOnRedactorsZone_ = function (event) {\n\n /**\n * Wait for solution. Would like to know the behaviour\n * @todo Add spaces\n */\n event.preventDefault();\n\n\n if (!editor.core.isBlockEmpty(editor.content.currentNode)) {\n\n return;\n\n }\n\n if ( !editor.toolbar.opened ) {\n\n editor.toolbar.open();\n\n }\n\n if (editor.toolbar.opened && !editor.toolbar.toolbox.opened) {\n\n editor.toolbar.toolbox.open();\n\n } else {\n\n editor.toolbar.toolbox.leaf();\n\n }\n\n };\n\n /**\n * Handles global EnterKey Press\n * @see enterPressedOnBlock_\n * @param {Object} event\n */\n var enterKeyPressed_ = function () {\n\n if (editor.content.editorAreaHightlighted) {\n\n /**\n * it means that we lose input index, saved index before is not correct\n * therefore we need to set caret when we insert new block\n */\n editor.caret.inputIndex = -1;\n\n enterPressedOnBlock_();\n\n }\n\n };\n\n /**\n * Callback for enter key pressing in first-level block area\n *\n * @param {Event} event\n * @private\n *\n * @description Inserts new block with initial type from settings\n */\n var enterPressedOnBlock_ = function () {\n\n var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\n\n editor.content.insertBlock({\n type : NEW_BLOCK_TYPE,\n block : editor.tools[NEW_BLOCK_TYPE].render()\n }, true );\n\n editor.toolbar.move();\n editor.toolbar.open();\n\n };\n\n\n /**\n * ENTER key handler\n *\n * @param {Object} event\n * @private\n *\n * @description Makes new block with initial type from settings\n */\n var enterKeyPressedOnRedactorsZone_ = function (event) {\n\n if (event.target.contentEditable == 'true') {\n\n /** Update input index */\n editor.caret.saveCurrentInputIndex();\n\n }\n\n var currentInputIndex = editor.caret.getCurrentInputIndex() || 0,\n workingNode = editor.content.currentNode,\n tool = workingNode.dataset.tool,\n isEnterPressedOnToolbar = editor.toolbar.opened &&\n editor.toolbar.current &&\n event.target == editor.state.inputs[currentInputIndex];\n\n /** The list of tools which needs the default browser behaviour */\n var enableLineBreaks = editor.tools[tool].enableLineBreaks;\n\n /** This type of block creates when enter is pressed */\n var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\n\n /**\n * When toolbar is opened, select tool instead of making new paragraph\n */\n if ( isEnterPressedOnToolbar ) {\n\n event.preventDefault();\n\n editor.toolbar.toolbox.toolClicked(event);\n\n editor.toolbar.close();\n\n /**\n * Stop other listeners callback executions\n */\n event.stopPropagation();\n event.stopImmediatePropagation();\n\n return;\n\n }\n\n /**\n * Allow paragraph lineBreaks with shift enter\n * Or if shiftkey pressed and enter and enabledLineBreaks, the let new block creation\n */\n if ( event.shiftKey || enableLineBreaks ) {\n\n event.stopPropagation();\n event.stopImmediatePropagation();\n return;\n\n }\n\n var currentSelection = window.getSelection(),\n currentSelectedNode = currentSelection.anchorNode,\n caretAtTheEndOfText = editor.caret.position.atTheEnd(),\n isTextNodeHasParentBetweenContenteditable = false;\n\n /**\n * Allow making new

    in same block by SHIFT+ENTER and forbids to prevent default browser behaviour\n */\n if ( event.shiftKey && !enableLineBreaks ) {\n\n editor.callback.enterPressedOnBlock(editor.content.currentBlock, event);\n event.preventDefault();\n return;\n\n }\n\n /**\n * Workaround situation when caret at the Text node that has some wrapper Elements\n * Split block cant handle this.\n * We need to save default behavior\n */\n isTextNodeHasParentBetweenContenteditable = currentSelectedNode && currentSelectedNode.parentNode.contentEditable != 'true';\n\n /**\n * Split blocks when input has several nodes and caret placed in textNode\n */\n if (\n currentSelectedNode.nodeType == editor.core.nodeTypes.TEXT &&\n !isTextNodeHasParentBetweenContenteditable &&\n !caretAtTheEndOfText\n ) {\n\n event.preventDefault();\n\n editor.core.log('Splitting Text node...');\n\n editor.content.splitBlock(currentInputIndex);\n\n /** Show plus button when next input after split is empty*/\n if (!editor.state.inputs[currentInputIndex + 1].textContent.trim()) {\n\n editor.toolbar.showPlusButton();\n\n }\n\n } else {\n\n var islastNode = editor.content.isLastNode(currentSelectedNode);\n\n if ( islastNode && caretAtTheEndOfText ) {\n\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n\n editor.core.log('ENTER clicked in last textNode. Create new BLOCK');\n\n editor.content.insertBlock({\n type: NEW_BLOCK_TYPE,\n block: editor.tools[NEW_BLOCK_TYPE].render()\n }, true);\n\n editor.toolbar.move();\n editor.toolbar.open();\n\n /** Show plus button with empty block */\n editor.toolbar.showPlusButton();\n\n }\n\n }\n\n /** get all inputs after new appending block */\n editor.ui.saveInputs();\n\n };\n\n /**\n * Escape behaviour\n * @param event\n * @private\n *\n * @description Closes toolbox and toolbar. Prevents default behaviour\n */\n var escapeKeyPressedOnRedactorsZone_ = function (event) {\n\n /** Close all toolbar */\n editor.toolbar.close();\n\n /** Close toolbox */\n editor.toolbar.toolbox.close();\n\n event.preventDefault();\n\n };\n\n /**\n * @param {Event} event\n * @private\n *\n * closes and moves toolbar\n */\n var arrowKeyPressed_ = function (event) {\n\n editor.content.workingNodeChanged();\n\n /* Closing toolbar */\n editor.toolbar.close();\n editor.toolbar.move();\n\n };\n\n /**\n * @private\n * @param {Event} event\n *\n * @description Closes all opened bars from toolbar.\n * If block is mark, clears highlightning\n */\n var defaultKeyPressedOnRedactorsZone_ = function () {\n\n editor.toolbar.close();\n\n if (!editor.toolbar.inline.actionsOpened) {\n\n editor.toolbar.inline.close();\n editor.content.clearMark();\n\n }\n\n };\n\n /**\n * Handler when clicked on redactors area\n *\n * @protected\n * @param event\n *\n * @description Detects clicked area. If it is first-level block area, marks as detected and\n * on next enter press will be inserted new block\n * Otherwise, save carets position (input index) and put caret to the editable zone.\n *\n * @see detectWhenClickedOnFirstLevelBlockArea_\n *\n */\n callbacks.redactorClicked = function (event) {\n\n detectWhenClickedOnFirstLevelBlockArea_();\n\n editor.content.workingNodeChanged(event.target);\n editor.ui.saveInputs();\n\n var selectedText = editor.toolbar.inline.getSelectionText(),\n firstLevelBlock;\n\n /** If selection range took off, then we hide inline toolbar */\n if (selectedText.length === 0) {\n\n editor.toolbar.inline.close();\n\n }\n\n /** Update current input index in memory when caret focused into existed input */\n if (event.target.contentEditable == 'true') {\n\n editor.caret.saveCurrentInputIndex();\n\n }\n\n if (editor.content.currentNode === null) {\n\n /**\n * If inputs in redactor does not exits, then we put input index 0 not -1\n */\n var indexOfLastInput = editor.state.inputs.length > 0 ? editor.state.inputs.length - 1 : 0;\n\n /** If we have any inputs */\n if (editor.state.inputs.length) {\n\n /** getting firstlevel parent of input */\n firstLevelBlock = editor.content.getFirstLevelBlock(editor.state.inputs[indexOfLastInput]);\n\n }\n\n /** If input is empty, then we set caret to the last input */\n if (editor.state.inputs.length && editor.state.inputs[indexOfLastInput].textContent === '' && firstLevelBlock.dataset.tool == editor.settings.initialBlockPlugin) {\n\n editor.caret.setToBlock(indexOfLastInput);\n\n } else {\n\n /** Create new input when caret clicked in redactors area */\n var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;\n\n editor.content.insertBlock({\n type : NEW_BLOCK_TYPE,\n block : editor.tools[NEW_BLOCK_TYPE].render()\n });\n\n /** If there is no inputs except inserted */\n if (editor.state.inputs.length === 1) {\n\n editor.caret.setToBlock(indexOfLastInput);\n\n } else {\n\n /** Set caret to this appended input */\n editor.caret.setToNextBlock(indexOfLastInput);\n\n }\n\n }\n\n } else {\n\n /** Close all panels */\n editor.toolbar.settings.close();\n editor.toolbar.toolbox.close();\n\n }\n\n /**\n * Move toolbar and open\n */\n editor.toolbar.move();\n editor.toolbar.open();\n\n var inputIsEmpty = !editor.content.currentNode.textContent.trim(),\n currentNodeType = editor.content.currentNode.dataset.tool,\n isInitialType = currentNodeType == editor.settings.initialBlockPlugin;\n\n\n /** Hide plus buttons */\n editor.toolbar.hidePlusButton();\n\n if (!inputIsEmpty) {\n\n /** Mark current block */\n editor.content.markBlock();\n\n }\n\n if ( isInitialType && inputIsEmpty ) {\n\n /** Show plus button */\n editor.toolbar.showPlusButton();\n\n }\n\n\n };\n\n /**\n * This method allows to define, is caret in contenteditable element or not.\n *\n * @private\n *\n * @description Otherwise, if we get TEXT node from range container, that will means we have input index.\n * In this case we use default browsers behaviour (if plugin allows that) or overwritten action.\n * Therefore, to be sure that we've clicked first-level block area, we should have currentNode, which always\n * specifies to the first-level block. Other cases we just ignore.\n */\n var detectWhenClickedOnFirstLevelBlockArea_ = function () {\n\n var selection = window.getSelection(),\n anchorNode = selection.anchorNode,\n flag = false;\n\n if (selection.rangeCount === 0) {\n\n editor.content.editorAreaHightlighted = true;\n\n } else {\n\n if (!editor.core.isDomNode(anchorNode)) {\n\n anchorNode = anchorNode.parentNode;\n\n }\n\n /** Already founded, without loop */\n if (anchorNode.contentEditable == 'true') {\n\n flag = true;\n\n }\n\n while (anchorNode.contentEditable != 'true') {\n\n anchorNode = anchorNode.parentNode;\n\n if (anchorNode.contentEditable == 'true') {\n\n flag = true;\n\n }\n\n if (anchorNode == document.body) {\n\n break;\n\n }\n\n }\n\n /** If editable element founded, flag is \"TRUE\", Therefore we return \"FALSE\" */\n editor.content.editorAreaHightlighted = !flag;\n\n }\n\n };\n\n /**\n * Toolbar button click handler\n *\n * @param {Object} event - cursor to the button\n * @protected\n *\n * @description gets current tool and calls render method\n */\n callbacks.toolbarButtonClicked = function (event) {\n\n var button = this;\n\n editor.toolbar.current = button.dataset.type;\n\n editor.toolbar.toolbox.toolClicked(event);\n editor.toolbar.close();\n\n };\n\n /**\n * Show or Hide toolbox when plus button is clicked\n */\n callbacks.plusButtonClicked = function () {\n\n if (!editor.nodes.toolbox.classList.contains('opened')) {\n\n editor.toolbar.toolbox.open();\n\n } else {\n\n editor.toolbar.toolbox.close();\n\n }\n\n };\n\n /**\n * Block handlers for KeyDown events\n *\n * @protected\n * @param {Object} event\n *\n * Handles keydowns on block\n * @see blockRightOrDownArrowPressed_\n * @see backspacePressed_\n * @see blockLeftOrUpArrowPressed_\n */\n callbacks.blockKeydown = function (event) {\n\n let block = event.target; // event.target is input\n\n switch (event.keyCode) {\n\n case editor.core.keys.DOWN:\n case editor.core.keys.RIGHT:\n blockRightOrDownArrowPressed_(event);\n break;\n\n case editor.core.keys.BACKSPACE:\n backspacePressed_(block, event);\n break;\n\n case editor.core.keys.UP:\n case editor.core.keys.LEFT:\n blockLeftOrUpArrowPressed_(event);\n break;\n\n }\n\n };\n\n /**\n * RIGHT or DOWN keydowns on block\n *\n * @param {Object} event\n * @private\n *\n * @description watches the selection and gets closest editable element.\n * Uses method getDeepestTextNodeFromPosition to get the last node of next block\n * Sets caret if it is contenteditable\n */\n var blockRightOrDownArrowPressed_ = function (event) {\n\n var selection = window.getSelection(),\n inputs = editor.state.inputs,\n focusedNode = selection.anchorNode,\n focusedNodeHolder;\n\n /** Check for caret existance */\n if (!focusedNode) {\n\n return false;\n\n }\n\n /** Looking for closest (parent) contentEditable element of focused node */\n while (focusedNode.contentEditable != 'true') {\n\n focusedNodeHolder = focusedNode.parentNode;\n focusedNode = focusedNodeHolder;\n\n }\n\n /** Input index in DOM level */\n var editableElementIndex = 0;\n\n while (focusedNode != inputs[editableElementIndex]) {\n\n editableElementIndex ++;\n\n }\n\n /**\n * Founded contentEditable element doesn't have childs\n * Or maybe New created block\n */\n if (!focusedNode.textContent) {\n\n editor.caret.setToNextBlock(editableElementIndex);\n return;\n\n }\n\n /**\n * Do nothing when caret doesn not reaches the end of last child\n */\n var caretInLastChild = false,\n caretAtTheEndOfText = false;\n\n var lastChild,\n deepestTextnode;\n\n lastChild = focusedNode.childNodes[focusedNode.childNodes.length - 1 ];\n\n if (editor.core.isDomNode(lastChild)) {\n\n deepestTextnode = editor.content.getDeepestTextNodeFromPosition(lastChild, lastChild.childNodes.length);\n\n } else {\n\n deepestTextnode = lastChild;\n\n }\n\n caretInLastChild = selection.anchorNode == deepestTextnode;\n caretAtTheEndOfText = deepestTextnode.length == selection.anchorOffset;\n\n if ( !caretInLastChild || !caretAtTheEndOfText ) {\n\n editor.core.log('arrow [down|right] : caret does not reached the end');\n return false;\n\n }\n\n editor.caret.setToNextBlock(editableElementIndex);\n\n };\n\n /**\n * LEFT or UP keydowns on block\n *\n * @param {Object} event\n * @private\n *\n * watches the selection and gets closest editable element.\n * Uses method getDeepestTextNodeFromPosition to get the last node of previous block\n * Sets caret if it is contenteditable\n *\n */\n var blockLeftOrUpArrowPressed_ = function (event) {\n\n var selection = window.getSelection(),\n inputs = editor.state.inputs,\n focusedNode = selection.anchorNode,\n focusedNodeHolder;\n\n /** Check for caret existance */\n if (!focusedNode) {\n\n return false;\n\n }\n\n /**\n * LEFT or UP not at the beginning\n */\n if ( selection.anchorOffset !== 0) {\n\n return false;\n\n }\n\n /** Looking for parent contentEditable block */\n while (focusedNode.contentEditable != 'true') {\n\n focusedNodeHolder = focusedNode.parentNode;\n focusedNode = focusedNodeHolder;\n\n }\n\n /** Input index in DOM level */\n var editableElementIndex = 0;\n\n while (focusedNode != inputs[editableElementIndex]) {\n\n editableElementIndex ++;\n\n }\n\n /**\n * Do nothing if caret is not at the beginning of first child\n */\n var caretInFirstChild = false,\n caretAtTheBeginning = false;\n\n var firstChild,\n deepestTextnode;\n\n /**\n * Founded contentEditable element doesn't have childs\n * Or maybe New created block\n */\n if (!focusedNode.textContent) {\n\n editor.caret.setToPreviousBlock(editableElementIndex);\n return;\n\n }\n\n firstChild = focusedNode.childNodes[0];\n\n if (editor.core.isDomNode(firstChild)) {\n\n deepestTextnode = editor.content.getDeepestTextNodeFromPosition(firstChild, 0);\n\n } else {\n\n deepestTextnode = firstChild;\n\n }\n\n caretInFirstChild = selection.anchorNode == deepestTextnode;\n caretAtTheBeginning = selection.anchorOffset === 0;\n\n if ( caretInFirstChild && caretAtTheBeginning ) {\n\n editor.caret.setToPreviousBlock(editableElementIndex);\n\n }\n\n };\n\n /**\n * Handles backspace keydown\n *\n * @param {Element} block\n * @param {Object} event\n * @private\n *\n * @description if block is empty, delete the block and set caret to the previous block\n * If block is not empty, try to merge two blocks - current and previous\n * But it we try'n to remove first block, then we should set caret to the next block, not previous.\n * If we removed the last block, create new one\n */\n var backspacePressed_ = function (block, event) {\n\n var currentInputIndex = editor.caret.getCurrentInputIndex(),\n range,\n selectionLength,\n firstLevelBlocksCount;\n\n if (editor.core.isNativeInput(event.target)) {\n\n /** If input value is empty - remove block */\n if (event.target.value.trim() == '') {\n\n block.remove();\n\n } else {\n\n return;\n\n }\n\n }\n\n if (block.textContent.trim()) {\n\n range = editor.content.getRange();\n selectionLength = range.endOffset - range.startOffset;\n\n if (editor.caret.position.atStart() && !selectionLength && editor.state.inputs[currentInputIndex - 1]) {\n\n editor.content.mergeBlocks(currentInputIndex);\n\n } else {\n\n return;\n\n }\n\n }\n\n if (!selectionLength) {\n\n block.remove();\n\n }\n\n\n firstLevelBlocksCount = editor.nodes.redactor.childNodes.length;\n\n /**\n * If all blocks are removed\n */\n if (firstLevelBlocksCount === 0) {\n\n /** update currentNode variable */\n editor.content.currentNode = null;\n\n /** Inserting new empty initial block */\n editor.ui.addInitialBlock();\n\n /** Updating inputs state after deleting last block */\n editor.ui.saveInputs();\n\n /** Set to current appended block */\n window.setTimeout(function () {\n\n editor.caret.setToPreviousBlock(1);\n\n }, 10);\n\n } else {\n\n if (editor.caret.inputIndex !== 0) {\n\n /** Target block is not first */\n editor.caret.setToPreviousBlock(editor.caret.inputIndex);\n\n } else {\n\n /** If we try to delete first block */\n editor.caret.setToNextBlock(editor.caret.inputIndex);\n\n }\n\n }\n\n editor.toolbar.move();\n\n if (!editor.toolbar.opened) {\n\n editor.toolbar.open();\n\n }\n\n /** Updating inputs state */\n editor.ui.saveInputs();\n\n /** Prevent default browser behaviour */\n event.preventDefault();\n\n };\n\n /**\n * used by UI module\n * Clicks on block settings button\n *\n * @param {Object} event\n * @protected\n * @description Opens toolbar settings\n */\n callbacks.showSettingsButtonClicked = function (event) {\n\n /**\n * Get type of current block\n * It uses to append settings from tool.settings property.\n * ...\n * Type is stored in data-type attribute on block\n */\n var currentToolType = editor.content.currentNode.dataset.tool;\n\n editor.toolbar.settings.toggle(currentToolType);\n\n /** Close toolbox when settings button is active */\n editor.toolbar.toolbox.close();\n editor.toolbar.settings.hideRemoveActions();\n\n };\n\n return callbacks;\n\n})({});\n\n\n// WEBPACK FOOTER //\n// ./modules/callbacks.js","/**\n * Codex Editor Draw module\n *\n * @author Codex Team\n * @version 1.0.\n */\n\nmodule.exports = (function (draw) {\n\n /**\n * Base editor wrapper\n */\n draw.wrapper = function () {\n\n var wrapper = document.createElement('div');\n\n wrapper.className += 'codex-editor';\n\n return wrapper;\n\n };\n\n /**\n * Content-editable holder\n */\n draw.redactor = function () {\n\n var redactor = document.createElement('div');\n\n redactor.className += 'ce-redactor';\n\n return redactor;\n\n };\n\n draw.ceBlock = function () {\n\n var block = document.createElement('DIV');\n\n block.className += 'ce_block';\n\n return block;\n\n };\n\n /**\n * Empty toolbar with toggler\n */\n draw.toolbar = function () {\n\n var bar = document.createElement('div');\n\n bar.className += 'ce-toolbar';\n\n return bar;\n\n };\n\n draw.toolbarContent = function () {\n\n var wrapper = document.createElement('DIV');\n\n wrapper.classList.add('ce-toolbar__content');\n\n return wrapper;\n\n };\n\n /**\n * Inline toolbar\n */\n draw.inlineToolbar = function () {\n\n var bar = document.createElement('DIV');\n\n bar.className += 'ce-toolbar-inline';\n\n return bar;\n\n };\n\n /**\n * Wrapper for inline toobar buttons\n */\n draw.inlineToolbarButtons = function () {\n\n var wrapper = document.createElement('DIV');\n\n wrapper.className += 'ce-toolbar-inline__buttons';\n\n return wrapper;\n\n };\n\n /**\n * For some actions\n */\n draw.inlineToolbarActions = function () {\n\n var wrapper = document.createElement('DIV');\n\n wrapper.className += 'ce-toolbar-inline__actions';\n\n return wrapper;\n\n };\n\n draw.inputForLink = function () {\n\n var input = document.createElement('INPUT');\n\n input.type = 'input';\n input.className += 'inputForLink';\n input.placeholder = 'Вставьте ссылку ...';\n input.setAttribute('form', 'defaultForm');\n\n input.setAttribute('autofocus', 'autofocus');\n\n return input;\n\n };\n\n /**\n * @todo Desc\n */\n draw.blockButtons = function () {\n\n var block = document.createElement('div');\n\n block.className += 'ce-toolbar__actions';\n\n return block;\n\n };\n\n /**\n * Block settings panel\n */\n draw.blockSettings = function () {\n\n var settings = document.createElement('div');\n\n settings.className += 'ce-settings';\n\n return settings;\n\n };\n\n draw.defaultSettings = function () {\n\n var div = document.createElement('div');\n\n div.classList.add('ce-settings_default');\n\n return div;\n\n };\n\n draw.pluginsSettings = function () {\n\n var div = document.createElement('div');\n\n div.classList.add('ce-settings_plugin');\n\n return div;\n\n };\n\n draw.plusButton = function () {\n\n var button = document.createElement('span');\n\n button.className = 'ce-toolbar__plus';\n // button.innerHTML = '';\n\n return button;\n\n };\n\n /**\n * Settings button in toolbar\n */\n draw.settingsButton = function () {\n\n var toggler = document.createElement('span');\n\n toggler.className = 'ce-toolbar__settings-btn';\n\n /** Toggler button*/\n toggler.innerHTML = '';\n\n return toggler;\n\n };\n\n /**\n * Redactor tools wrapper\n */\n\n draw.toolbox = function () {\n\n var wrapper = document.createElement('div');\n\n wrapper.className = 'ce-toolbar__tools';\n\n return wrapper;\n\n };\n\n /**\n * @protected\n *\n * Draws tool buttons for toolbox\n *\n * @param {String} type\n * @param {String} classname\n * @returns {Element}\n */\n draw.toolbarButton = function (type, classname) {\n\n var button = document.createElement('li'),\n toolIcon = document.createElement('i'),\n toolTitle = document.createElement('span');\n\n button.dataset.type = type;\n button.setAttribute('title', type);\n\n toolIcon.classList.add(classname);\n toolTitle.classList.add('ce_toolbar_tools--title');\n\n\n button.appendChild(toolIcon);\n button.appendChild(toolTitle);\n\n return button;\n\n };\n\n /**\n * @protected\n *\n * Draws tools for inline toolbar\n *\n * @param {String} type\n * @param {String} classname\n */\n draw.toolbarButtonInline = function (type, classname) {\n\n var button = document.createElement('BUTTON'),\n toolIcon = document.createElement('I');\n\n button.type = 'button';\n button.dataset.type = type;\n toolIcon.classList.add(classname);\n\n button.appendChild(toolIcon);\n\n return button;\n\n };\n\n /**\n * Redactor block\n */\n draw.block = function (tagName, content) {\n\n var node = document.createElement(tagName);\n\n node.innerHTML = content || '';\n\n return node;\n\n };\n\n /**\n * Creates Node with passed tagName and className\n * @param {string} tagName\n * @param {string} className\n * @param {object} properties - allow to assign properties\n */\n draw.node = function ( tagName, className, properties ) {\n\n var el = document.createElement( tagName );\n\n if ( className ) el.className = className;\n\n if ( properties ) {\n\n for (var name in properties) {\n\n el[name] = properties[name];\n\n }\n\n }\n\n return el;\n\n };\n\n /**\n * Unavailable plugin block\n */\n draw.unavailableBlock = function () {\n\n var wrapper = document.createElement('DIV');\n\n wrapper.classList.add('cdx-unavailable-block');\n\n return wrapper;\n\n };\n\n return draw;\n\n})({});\n\n\n// WEBPACK FOOTER //\n// ./modules/draw.js","/**\n * Codex Editor Caret Module\n *\n * @author Codex Team\n * @version 1.0\n */\n\nmodule.exports = (function (caret) {\n\n let editor = codex.editor;\n\n /**\n * @var {int} InputIndex - editable element in DOM\n */\n caret.inputIndex = null;\n\n /**\n * @var {int} offset - caret position in a text node.\n */\n caret.offset = null;\n\n /**\n * @var {int} focusedNodeIndex - we get index of child node from first-level block\n */\n caret.focusedNodeIndex = null;\n\n /**\n * Creates Document Range and sets caret to the element.\n * @protected\n * @uses caret.save — if you need to save caret position\n * @param {Element} el - Changed Node.\n */\n caret.set = function ( el, index, offset) {\n\n offset = offset || caret.offset || 0;\n index = index || caret.focusedNodeIndex || 0;\n\n var childs = el.childNodes,\n nodeToSet;\n\n if ( childs.length === 0 ) {\n\n nodeToSet = el;\n\n } else {\n\n nodeToSet = childs[index];\n\n }\n\n /** If Element is INPUT */\n if (el.contentEditable != 'true') {\n\n el.focus();\n return;\n\n }\n\n if (editor.core.isDomNode(nodeToSet)) {\n\n nodeToSet = editor.content.getDeepestTextNodeFromPosition(nodeToSet, nodeToSet.childNodes.length);\n\n }\n\n var range = document.createRange(),\n selection = window.getSelection();\n\n window.setTimeout(function () {\n\n range.setStart(nodeToSet, offset);\n range.setEnd(nodeToSet, offset);\n\n selection.removeAllRanges();\n selection.addRange(range);\n\n editor.caret.saveCurrentInputIndex();\n\n }, 20);\n\n };\n\n /**\n * @protected\n * Updates index of input and saves it in caret object\n */\n caret.saveCurrentInputIndex = function () {\n\n /** Index of Input that we paste sanitized content */\n var selection = window.getSelection(),\n inputs = editor.state.inputs,\n focusedNode = selection.anchorNode,\n focusedNodeHolder;\n\n if (!focusedNode) {\n\n return;\n\n }\n\n /** Looking for parent contentEditable block */\n while (focusedNode.contentEditable != 'true') {\n\n focusedNodeHolder = focusedNode.parentNode;\n focusedNode = focusedNodeHolder;\n\n }\n\n /** Input index in DOM level */\n var editableElementIndex = 0;\n\n while (focusedNode != inputs[editableElementIndex]) {\n\n editableElementIndex ++;\n\n }\n\n caret.inputIndex = editableElementIndex;\n\n };\n\n /**\n * Returns current input index (caret object)\n */\n caret.getCurrentInputIndex = function () {\n\n return caret.inputIndex;\n\n };\n\n /**\n * @param {int} index - index of first-level block after that we set caret into next input\n */\n caret.setToNextBlock = function (index) {\n\n var inputs = editor.state.inputs,\n nextInput = inputs[index + 1];\n\n if (!nextInput) {\n\n editor.core.log('We are reached the end');\n return;\n\n }\n\n /**\n * When new Block created or deleted content of input\n * We should add some text node to set caret\n */\n if (!nextInput.childNodes.length) {\n\n var emptyTextElement = document.createTextNode('');\n\n nextInput.appendChild(emptyTextElement);\n\n }\n\n editor.caret.inputIndex = index + 1;\n editor.caret.set(nextInput, 0, 0);\n editor.content.workingNodeChanged(nextInput);\n\n };\n\n /**\n * @param {int} index - index of target input.\n * Sets caret to input with this index\n */\n caret.setToBlock = function (index) {\n\n var inputs = editor.state.inputs,\n targetInput = inputs[index];\n\n if ( !targetInput ) {\n\n return;\n\n }\n\n /**\n * When new Block created or deleted content of input\n * We should add some text node to set caret\n */\n if (!targetInput.childNodes.length) {\n\n var emptyTextElement = document.createTextNode('');\n\n targetInput.appendChild(emptyTextElement);\n\n }\n\n editor.caret.inputIndex = index;\n editor.caret.set(targetInput, 0, 0);\n editor.content.workingNodeChanged(targetInput);\n\n };\n\n /**\n * @param {int} index - index of input\n */\n caret.setToPreviousBlock = function (index) {\n\n index = index || 0;\n\n var inputs = editor.state.inputs,\n previousInput = inputs[index - 1],\n lastChildNode,\n lengthOfLastChildNode,\n emptyTextElement;\n\n\n if (!previousInput) {\n\n editor.core.log('We are reached first node');\n return;\n\n }\n\n lastChildNode = editor.content.getDeepestTextNodeFromPosition(previousInput, previousInput.childNodes.length);\n lengthOfLastChildNode = lastChildNode.length;\n\n /**\n * When new Block created or deleted content of input\n * We should add some text node to set caret\n */\n if (!previousInput.childNodes.length) {\n\n emptyTextElement = document.createTextNode('');\n previousInput.appendChild(emptyTextElement);\n\n }\n editor.caret.inputIndex = index - 1;\n editor.caret.set(previousInput, previousInput.childNodes.length - 1, lengthOfLastChildNode);\n editor.content.workingNodeChanged(inputs[index - 1]);\n\n };\n\n caret.position = {\n\n atStart : function () {\n\n var selection = window.getSelection(),\n anchorOffset = selection.anchorOffset,\n anchorNode = selection.anchorNode,\n firstLevelBlock = editor.content.getFirstLevelBlock(anchorNode),\n pluginsRender = firstLevelBlock.childNodes[0];\n\n if (!editor.core.isDomNode(anchorNode)) {\n\n anchorNode = anchorNode.parentNode;\n\n }\n\n var isFirstNode = anchorNode === pluginsRender.childNodes[0],\n isOffsetZero = anchorOffset === 0;\n\n return isFirstNode && isOffsetZero;\n\n },\n\n atTheEnd : function () {\n\n var selection = window.getSelection(),\n anchorOffset = selection.anchorOffset,\n anchorNode = selection.anchorNode;\n\n /** Caret is at the end of input */\n return !anchorNode || !anchorNode.length || anchorOffset === anchorNode.length;\n\n }\n };\n\n\n /**\n * Inserts node at the caret location\n * @param {HTMLElement|DocumentFragment} node\n */\n caret.insertNode = function (node) {\n\n var selection, range,\n lastNode = node;\n\n if (node.nodeType == editor.core.nodeTypes.DOCUMENT_FRAGMENT) {\n\n lastNode = node.lastChild;\n\n }\n\n selection = window.getSelection();\n\n range = selection.getRangeAt(0);\n range.deleteContents();\n\n range.insertNode(node);\n\n range.setStartAfter(lastNode);\n range.collapse(true);\n\n selection.removeAllRanges();\n selection.addRange(range);\n\n\n };\n\n return caret;\n\n})({});\n\n\n// WEBPACK FOOTER //\n// ./modules/caret.js","/**\n * Codex Editor Notification Module\n *\n * @author Codex Team\n * @version 1.0\n */\n\nmodule.exports = (function (notifications) {\n\n let editor = codex.editor;\n\n var queue = [];\n\n var addToQueue = function (settings) {\n\n queue.push(settings);\n\n var index = 0;\n\n while ( index < queue.length && queue.length > 5) {\n\n if (queue[index].type == 'confirm' || queue[index].type == 'prompt') {\n\n index++;\n continue;\n\n }\n\n queue[index].close();\n queue.splice(index, 1);\n\n }\n\n };\n\n notifications.createHolder = function () {\n\n var holder = editor.draw.node('DIV', 'cdx-notifications-block');\n\n editor.nodes.notifications = document.body.appendChild(holder);\n\n return holder;\n\n };\n\n\n /**\n * Error notificator. Shows block with message\n * @protected\n */\n notifications.errorThrown = function (errorMsg, event) {\n\n editor.notifications.notification({message: 'This action is not available currently', type: event.type});\n\n };\n\n /**\n *\n * Appends notification\n *\n * settings = {\n * type - notification type (reserved types: alert, confirm, prompt). Just add class 'cdx-notification-'+type\n * message - notification message\n * okMsg - confirm button text (default - 'Ok')\n * cancelBtn - cancel button text (default - 'Cancel'). Only for confirm and prompt types\n * confirm - function-handler for ok button click\n * cancel - function-handler for cancel button click. Only for confirm and prompt types\n * time - time (in seconds) after which notification will close (default - 10s)\n * }\n *\n * @param settings\n */\n notifications.notification = function (constructorSettings) {\n\n /** Private vars and methods */\n var notification = null,\n cancel = null,\n type = null,\n confirm = null,\n inputField = null;\n\n var confirmHandler = function () {\n\n close();\n\n if (typeof confirm !== 'function' ) {\n\n return;\n\n }\n\n if (type == 'prompt') {\n\n confirm(inputField.value);\n return;\n\n }\n\n confirm();\n\n };\n\n var cancelHandler = function () {\n\n close();\n\n if (typeof cancel !== 'function' ) {\n\n return;\n\n }\n\n cancel();\n\n };\n\n\n /** Public methods */\n function create(settings) {\n\n if (!(settings && settings.message)) {\n\n editor.core.log('Can\\'t create notification. Message is missed');\n return;\n\n }\n\n settings.type = settings.type || 'alert';\n settings.time = settings.time*1000 || 10000;\n\n var wrapper = editor.draw.node('DIV', 'cdx-notification'),\n message = editor.draw.node('DIV', 'cdx-notification__message'),\n input = editor.draw.node('INPUT', 'cdx-notification__input'),\n okBtn = editor.draw.node('SPAN', 'cdx-notification__ok-btn'),\n cancelBtn = editor.draw.node('SPAN', 'cdx-notification__cancel-btn');\n\n message.textContent = settings.message;\n okBtn.textContent = settings.okMsg || 'ОК';\n cancelBtn.textContent = settings.cancelMsg || 'Отмена';\n\n editor.listeners.add(okBtn, 'click', confirmHandler);\n editor.listeners.add(cancelBtn, 'click', cancelHandler);\n\n wrapper.appendChild(message);\n\n if (settings.type == 'prompt') {\n\n wrapper.appendChild(input);\n\n }\n\n wrapper.appendChild(okBtn);\n\n if (settings.type == 'prompt' || settings.type == 'confirm') {\n\n wrapper.appendChild(cancelBtn);\n\n }\n\n wrapper.classList.add('cdx-notification-' + settings.type);\n wrapper.dataset.type = settings.type;\n\n notification = wrapper;\n type = settings.type;\n confirm = settings.confirm;\n cancel = settings.cancel;\n inputField = input;\n\n if (settings.type != 'prompt' && settings.type != 'confirm') {\n\n window.setTimeout(close, settings.time);\n\n }\n\n };\n\n /**\n * Show notification block\n */\n function send() {\n\n editor.nodes.notifications.appendChild(notification);\n inputField.focus();\n\n editor.nodes.notifications.classList.add('cdx-notification__notification-appending');\n\n window.setTimeout(function () {\n\n editor.nodes.notifications.classList.remove('cdx-notification__notification-appending');\n\n }, 100);\n\n addToQueue({type: type, close: close});\n\n };\n\n /**\n * Remove notification block\n */\n function close() {\n\n notification.remove();\n\n };\n\n\n if (constructorSettings) {\n\n create(constructorSettings);\n send();\n\n }\n\n return {\n create: create,\n send: send,\n close: close\n };\n\n };\n\n notifications.clear = function () {\n\n editor.nodes.notifications.innerHTML = '';\n queue = [];\n\n };\n\n return notifications;\n\n})({});\n\n\n// WEBPACK FOOTER //\n// ./modules/notifications.js","/**\n * Codex Editor Parser Module\n *\n * @author Codex Team\n * @version 1.1\n */\n\nmodule.exports = (function (parser) {\n\n let editor = codex.editor;\n\n /** inserting text */\n parser.insertPastedContent = function (blockType, tag) {\n\n editor.content.insertBlock({\n type : blockType.type,\n block : blockType.render({\n text : tag.innerHTML\n })\n });\n\n };\n\n /**\n * Check DOM node for display style: separated block or child-view\n */\n parser.isFirstLevelBlock = function (node) {\n\n return node.nodeType == editor.core.nodeTypes.TAG &&\n node.classList.contains(editor.ui.className.BLOCK_CLASSNAME);\n\n };\n\n return parser;\n\n})({});\n\n\n\n// WEBPACK FOOTER //\n// ./modules/parser.js","/**\n * Codex Sanitizer\n */\n\nmodule.exports = (function (sanitizer) {\n\n /** HTML Janitor library */\n let janitor = require('html-janitor');\n\n /** Codex Editor */\n let editor = codex.editor;\n\n sanitizer.prepare = function () {\n\n if (editor.settings.sanitizer && !editor.core.isEmpty(editor.settings.sanitizer)) {\n\n Config.CUSTOM = editor.settings.sanitizer;\n\n }\n\n };\n\n /**\n * Basic config\n */\n var Config = {\n\n /** User configuration */\n CUSTOM : null,\n\n BASIC : {\n\n tags: {\n p: {},\n a: {\n href: true,\n target: '_blank',\n rel: 'nofollow'\n }\n }\n }\n };\n\n sanitizer.Config = Config;\n\n /**\n *\n * @param userCustomConfig\n * @returns {*}\n * @private\n *\n * @description If developer uses editor's API, then he can customize sane restrictions.\n * Or, sane config can be defined globally in editors initialization. That config will be used everywhere\n * At least, if there is no config overrides, that API uses BASIC Default configation\n */\n let init_ = function (userCustomConfig) {\n\n let configuration = userCustomConfig || Config.CUSTOM || Config.BASIC;\n\n return new janitor(configuration);\n\n };\n\n /**\n * Cleans string from unwanted tags\n * @protected\n * @param {String} dirtyString - taint string\n * @param {Object} customConfig - allowed tags\n */\n sanitizer.clean = function (dirtyString, customConfig) {\n\n let janitorInstance = init_(customConfig);\n\n return janitorInstance.clean(dirtyString);\n\n };\n\n return sanitizer;\n\n})({});\n\n\n// WEBPACK FOOTER //\n// ./modules/sanitizer.js","(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define('html-janitor', factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.HTMLJanitor = factory();\n }\n}(this, function () {\n\n /**\n * @param {Object} config.tags Dictionary of allowed tags.\n * @param {boolean} config.keepNestedBlockElements Default false.\n */\n function HTMLJanitor(config) {\n\n var tagDefinitions = config['tags'];\n var tags = Object.keys(tagDefinitions);\n\n var validConfigValues = tags\n .map(function(k) { return typeof tagDefinitions[k]; })\n .every(function(type) { return type === 'object' || type === 'boolean' || type === 'function'; });\n\n if(!validConfigValues) {\n throw new Error(\"The configuration was invalid\");\n }\n\n this.config = config;\n }\n\n // TODO: not exhaustive?\n var blockElementNames = ['P', 'LI', 'TD', 'TH', 'DIV', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'PRE'];\n function isBlockElement(node) {\n return blockElementNames.indexOf(node.nodeName) !== -1;\n }\n\n var inlineElementNames = ['A', 'B', 'STRONG', 'I', 'EM', 'SUB', 'SUP', 'U', 'STRIKE'];\n function isInlineElement(node) {\n return inlineElementNames.indexOf(node.nodeName) !== -1;\n }\n\n HTMLJanitor.prototype.clean = function (html) {\n var sandbox = document.createElement('div');\n sandbox.innerHTML = html;\n\n this._sanitize(sandbox);\n\n return sandbox.innerHTML;\n };\n\n HTMLJanitor.prototype._sanitize = function (parentNode) {\n var treeWalker = createTreeWalker(parentNode);\n var node = treeWalker.firstChild();\n if (!node) { return; }\n\n do {\n // Ignore nodes that have already been sanitized\n if (node._sanitized) {\n continue;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n // If this text node is just whitespace and the previous or next element\n // sibling is a block element, remove it\n // N.B.: This heuristic could change. Very specific to a bug with\n // `contenteditable` in Firefox: http://jsbin.com/EyuKase/1/edit?js,output\n // FIXME: make this an option?\n if (node.data.trim() === ''\n && ((node.previousElementSibling && isBlockElement(node.previousElementSibling))\n || (node.nextElementSibling && isBlockElement(node.nextElementSibling)))) {\n parentNode.removeChild(node);\n this._sanitize(parentNode);\n break;\n } else {\n continue;\n }\n }\n\n // Remove all comments\n if (node.nodeType === Node.COMMENT_NODE) {\n parentNode.removeChild(node);\n this._sanitize(parentNode);\n break;\n }\n\n var isInline = isInlineElement(node);\n var containsBlockElement;\n if (isInline) {\n containsBlockElement = Array.prototype.some.call(node.childNodes, isBlockElement);\n }\n\n // Block elements should not be nested (e.g.

  • ...); if\n // they are, we want to unwrap the inner block element.\n var isNotTopContainer = !! parentNode.parentNode;\n var isNestedBlockElement =\n isBlockElement(parentNode) &&\n isBlockElement(node) &&\n isNotTopContainer;\n\n var nodeName = node.nodeName.toLowerCase();\n\n var allowedAttrs = getAllowedAttrs(this.config, nodeName, node);\n\n var isInvalid = isInline && containsBlockElement;\n\n // Drop tag entirely according to the whitelist *and* if the markup\n // is invalid.\n if (isInvalid || shouldRejectNode(node, allowedAttrs)\n || (!this.config.keepNestedBlockElements && isNestedBlockElement)) {\n // Do not keep the inner text of SCRIPT/STYLE elements.\n if (! (node.nodeName === 'SCRIPT' || node.nodeName === 'STYLE')) {\n while (node.childNodes.length > 0) {\n parentNode.insertBefore(node.childNodes[0], node);\n }\n }\n parentNode.removeChild(node);\n\n this._sanitize(parentNode);\n break;\n }\n\n // Sanitize attributes\n for (var a = 0; a < node.attributes.length; a += 1) {\n var attr = node.attributes[a];\n\n if (shouldRejectAttr(attr, allowedAttrs, node)) {\n node.removeAttribute(attr.name);\n // Shift the array to continue looping.\n a = a - 1;\n }\n }\n\n // Sanitize children\n this._sanitize(node);\n\n // Mark node as sanitized so it's ignored in future runs\n node._sanitized = true;\n } while ((node = treeWalker.nextSibling()));\n };\n\n function createTreeWalker(node) {\n return document.createTreeWalker(node,\n NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT,\n null, false);\n }\n\n function getAllowedAttrs(config, nodeName, node){\n if (typeof config.tags[nodeName] === 'function') {\n return config.tags[nodeName](node);\n } else {\n return config.tags[nodeName];\n }\n }\n\n function shouldRejectNode(node, allowedAttrs){\n if (typeof allowedAttrs === 'undefined') {\n return true;\n } else if (typeof allowedAttrs === 'boolean') {\n return !allowedAttrs;\n }\n\n return false;\n }\n\n function shouldRejectAttr(attr, allowedAttrs, node){\n var attrName = attr.name.toLowerCase();\n\n if (allowedAttrs === true){\n return false;\n } else if (typeof allowedAttrs[attrName] === 'function'){\n return !allowedAttrs[attrName](attr.value, node);\n } else if (typeof allowedAttrs[attrName] === 'undefined'){\n return true;\n } else if (allowedAttrs[attrName] === false) {\n return true;\n } else if (typeof allowedAttrs[attrName] === 'string') {\n return (allowedAttrs[attrName] !== attr.value);\n }\n\n return false;\n }\n\n return HTMLJanitor;\n\n}));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/html-janitor/src/html-janitor.js\n// module id = 18\n// module chunks = 0","/**\n * Codex Editor Listeners module\n *\n * @author Codex Team\n * @version 1.0\n */\n\n/**\n * Module-decorator for event listeners assignment\n */\nmodule.exports = function (listeners) {\n\n var allListeners = [];\n\n /**\n * Search methods\n *\n * byElement, byType and byHandler returns array of suitable listeners\n * one and all takes element, eventType, and handler and returns first (all) suitable listener\n *\n */\n listeners.search = function () {\n\n var byElement = function (element, context) {\n\n var listenersOnElement = [];\n\n context = context || allListeners;\n\n for (var i = 0; i < context.length; i++) {\n\n var listener = context[i];\n\n if (listener.element === element) {\n\n listenersOnElement.push(listener);\n\n }\n\n }\n\n return listenersOnElement;\n\n };\n\n var byType = function (eventType, context) {\n\n var listenersWithType = [];\n\n context = context || allListeners;\n\n for (var i = 0; i < context.length; i++) {\n\n var listener = context[i];\n\n if (listener.type === eventType) {\n\n listenersWithType.push(listener);\n\n }\n\n }\n\n return listenersWithType;\n\n };\n\n var byHandler = function (handler, context) {\n\n var listenersWithHandler = [];\n\n context = context || allListeners;\n\n for (var i = 0; i < context.length; i++) {\n\n var listener = context[i];\n\n if (listener.handler === handler) {\n\n listenersWithHandler.push(listener);\n\n }\n\n }\n\n return listenersWithHandler;\n\n };\n\n var one = function (element, eventType, handler) {\n\n var result = allListeners;\n\n if (element)\n result = byElement(element, result);\n\n if (eventType)\n result = byType(eventType, result);\n\n if (handler)\n result = byHandler(handler, result);\n\n return result[0];\n\n };\n\n var all = function (element, eventType, handler) {\n\n var result = allListeners;\n\n if (element)\n result = byElement(element, result);\n\n if (eventType)\n result = byType(eventType, result);\n\n if (handler)\n result = byHandler(handler, result);\n\n return result;\n\n };\n\n return {\n byElement : byElement,\n byType : byType,\n byHandler : byHandler,\n one : one,\n all : all\n };\n\n }();\n\n listeners.add = function (element, eventType, handler, isCapture) {\n\n element.addEventListener(eventType, handler, isCapture);\n\n var data = {\n element: element,\n type: eventType,\n handler: handler\n };\n\n var alreadyAddedListener = listeners.search.one(element, eventType, handler);\n\n if (!alreadyAddedListener) {\n\n allListeners.push(data);\n\n }\n\n };\n\n listeners.remove = function (element, eventType, handler) {\n\n element.removeEventListener(eventType, handler);\n\n var existingListeners = listeners.search.all(element, eventType, handler);\n\n for (var i = 0; i < existingListeners.length; i++) {\n\n var index = allListeners.indexOf(existingListeners[i]);\n\n if (index > 0) {\n\n allListeners.splice(index, 1);\n\n }\n\n }\n\n };\n\n listeners.removeAll = function () {\n\n allListeners.map(function (current) {\n\n listeners.remove(current.element, current.type, current.handler);\n\n });\n\n };\n\n listeners.get = function (element, eventType, handler) {\n\n return listeners.search.all(element, eventType, handler);\n\n };\n\n return listeners;\n\n}({});\n\n\n// WEBPACK FOOTER //\n// ./modules/listeners.js","/**\n * Codex Editor Destroyer module\n *\n * @auhor Codex Team\n * @version 1.0\n */\n\nmodule.exports = function (destroyer) {\n\n let editor = codex.editor;\n\n destroyer.removeNodes = function () {\n\n editor.nodes.wrapper.remove();\n editor.nodes.notifications.remove();\n\n };\n\n destroyer.destroyPlugins = function () {\n\n for (var tool in editor.tools) {\n\n if (typeof editor.tools[tool].destroy === 'function') {\n\n editor.tools[tool].destroy();\n\n }\n\n }\n\n };\n\n destroyer.destroyScripts = function () {\n\n var scripts = document.getElementsByTagName('SCRIPT');\n\n for (var i = 0; i < scripts.length; i++) {\n\n if (scripts[i].id.indexOf(editor.scriptPrefix) + 1) {\n\n scripts[i].remove();\n i--;\n\n }\n\n }\n\n };\n\n\n /**\n * Delete editor data from webpage.\n * You should send settings argument with boolean flags:\n * @param settings.ui- remove redactor event listeners and DOM nodes\n * @param settings.scripts - remove redactor scripts from DOM\n * @param settings.plugins - remove plugin's objects\n * @param settings.core - remove editor core. You can remove core only if UI and scripts flags is true\n * }\n *\n */\n destroyer.destroy = function (settings) {\n\n if (!settings || typeof settings !== 'object') {\n\n return;\n\n }\n\n if (settings.ui) {\n\n destroyer.removeNodes();\n editor.listeners.removeAll();\n\n }\n\n if (settings.scripts) {\n\n destroyer.destroyScripts();\n\n }\n\n if (settings.plugins) {\n\n destroyer.destroyPlugins();\n\n }\n\n if (settings.ui && settings.scripts && settings.core) {\n\n delete codex.editor;\n\n }\n\n };\n\n return destroyer;\n\n}({});\n\n\n// WEBPACK FOOTER //\n// ./modules/destroyer.js","/**\n * Codex Editor Paste module\n *\n * @author Codex Team\n * @version 1.1.1\n */\n\nmodule.exports = function (paste) {\n\n let editor = codex.editor;\n\n var patterns = [];\n\n paste.prepare = function () {\n\n var tools = editor.tools;\n\n for (var tool in tools) {\n\n if (!tools[tool].renderOnPastePatterns || !Array.isArray(tools[tool].renderOnPastePatterns)) {\n\n continue;\n\n }\n\n tools[tool].renderOnPastePatterns.map(function (pattern) {\n\n\n patterns.push(pattern);\n\n });\n\n }\n\n return Promise.resolve();\n\n };\n\n /**\n * Saves data\n * @param event\n */\n paste.pasted = function (event) {\n\n var clipBoardData = event.clipboardData || window.clipboardData,\n content = clipBoardData.getData('Text');\n\n var result = analize(content);\n\n if (result) {\n\n event.preventDefault();\n event.stopImmediatePropagation();\n\n }\n\n return result;\n\n };\n\n /**\n * Analizes pated string and calls necessary method\n */\n\n var analize = function (string) {\n\n var result = false,\n content = editor.content.currentNode,\n plugin = content.dataset.tool;\n\n patterns.map( function (pattern) {\n\n var execArray = pattern.regex.exec(string),\n match = execArray && execArray[0];\n\n if ( match && match === string.trim()) {\n\n /** current block is not empty */\n if ( content.textContent.trim() && plugin == editor.settings.initialBlockPlugin ) {\n\n pasteToNewBlock_();\n\n }\n\n pattern.callback(string, pattern);\n result = true;\n\n }\n\n });\n\n return result;\n\n };\n\n var pasteToNewBlock_ = function () {\n\n /** Create new initial block */\n editor.content.insertBlock({\n\n type : editor.settings.initialBlockPlugin,\n block : editor.tools[editor.settings.initialBlockPlugin].render({\n text : ''\n })\n\n }, false);\n\n };\n\n /**\n * This method prevents default behaviour.\n *\n * @param {Object} event\n * @protected\n *\n * @description We get from clipboard pasted data, sanitize, make a fragment that contains of this sanitized nodes.\n * Firstly, we need to memorize the caret position. We can do that by getting the range of selection.\n * After all, we insert clear fragment into caret placed position. Then, we should move the caret to the last node\n */\n paste.blockPasteCallback = function (event) {\n\n\n if (!needsToHandlePasteEvent(event.target)) {\n\n return;\n\n }\n\n /** Prevent default behaviour */\n event.preventDefault();\n\n /** get html pasted data - dirty data */\n var htmlData = event.clipboardData.getData('text/html'),\n plainData = event.clipboardData.getData('text/plain');\n\n /** Temporary DIV that is used to work with text's paragraphs as DOM-elements*/\n var paragraphs = editor.draw.node('DIV', '', {}),\n cleanData,\n wrappedData;\n\n /** Create fragment, that we paste to range after proccesing */\n cleanData = editor.sanitizer.clean(htmlData);\n\n /**\n * We wrap pasted text with

    tags to split it logically\n * @type {string}\n */\n wrappedData = editor.content.wrapTextWithParagraphs(cleanData, plainData);\n paragraphs.innerHTML = wrappedData;\n\n /**\n * If there only one paragraph, just insert in at the caret location\n */\n if (paragraphs.childNodes.length == 1) {\n\n emulateUserAgentBehaviour(paragraphs.firstChild);\n return;\n\n }\n\n insertPastedParagraphs(paragraphs.childNodes);\n\n };\n\n /**\n * Checks if we should handle paste event on block\n * @param block\n *\n * @return {boolean}\n */\n var needsToHandlePasteEvent = function (block) {\n\n /** If area is input or textarea then allow default behaviour */\n if ( editor.core.isNativeInput(block) ) {\n\n return false;\n\n }\n\n var editableParent = editor.content.getEditableParent(block);\n\n /** Allow paste when event target placed in Editable element */\n if (!editableParent) {\n\n return false;\n\n }\n\n return true;\n\n };\n\n /**\n * Inserts new initial plugin blocks with data in paragraphs\n *\n * @param {Array} paragraphs - array of paragraphs (

    ) whit content, that should be inserted\n */\n var insertPastedParagraphs = function (paragraphs) {\n\n var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin,\n currentNode = editor.content.currentNode;\n\n\n paragraphs.forEach(function (paragraph) {\n\n /** Don't allow empty paragraphs */\n if (editor.core.isBlockEmpty(paragraph)) {\n\n return;\n\n }\n\n editor.content.insertBlock({\n type : NEW_BLOCK_TYPE,\n block : editor.tools[NEW_BLOCK_TYPE].render({\n text : paragraph.innerHTML\n })\n });\n\n editor.caret.inputIndex++;\n\n });\n\n editor.caret.setToPreviousBlock(editor.caret.getCurrentInputIndex() + 1);\n\n\n /**\n * If there was no data in working node, remove it\n */\n if (editor.core.isBlockEmpty(currentNode)) {\n\n currentNode.remove();\n editor.ui.saveInputs();\n\n }\n\n\n };\n\n /**\n * Inserts node content at the caret position\n *\n * @param {Node} node - DOM node (could be DocumentFragment), that should be inserted at the caret location\n */\n var emulateUserAgentBehaviour = function (node) {\n\n var newNode;\n\n if (node.childElementCount) {\n\n newNode = document.createDocumentFragment();\n\n node.childNodes.forEach(function (current) {\n\n if (!editor.core.isDomNode(current) && current.data.trim() === '') {\n\n return;\n\n }\n\n newNode.appendChild(current.cloneNode(true));\n\n });\n\n } else {\n\n newNode = document.createTextNode(node.textContent);\n\n }\n\n editor.caret.insertNode(newNode);\n\n };\n\n\n return paste;\n\n}({});\n\n\n// WEBPACK FOOTER //\n// ./modules/paste.js"],"sourceRoot":""} \ No newline at end of file diff --git a/codex.js b/codex.js deleted file mode 100644 index 874dc4a0..00000000 --- a/codex.js +++ /dev/null @@ -1,146 +0,0 @@ -/** - * - * Codex Editor - * - * @author Codex Team - */ - -module.exports = (function (editor) { - - 'use strict'; - - editor.version = VERSION; - editor.scriptPrefix = 'cdx-script-'; - - var init = function () { - - editor.core = require('./modules/core'); - editor.tools = require('./modules/tools'); - editor.ui = require('./modules/ui'); - editor.transport = require('./modules/transport'); - editor.renderer = require('./modules/renderer'); - editor.saver = require('./modules/saver'); - editor.content = require('./modules/content'); - editor.toolbar = require('./modules/toolbar/toolbar'); - editor.callback = require('./modules/callbacks'); - editor.draw = require('./modules/draw'); - editor.caret = require('./modules/caret'); - editor.notifications = require('./modules/notifications'); - editor.parser = require('./modules/parser'); - editor.sanitizer = require('./modules/sanitizer'); - editor.listeners = require('./modules/listeners'); - editor.destroyer = require('./modules/destroyer'); - editor.paste = require('./modules/paste'); - - }; - - /** - * @public - * holds initial settings - */ - editor.settings = { - tools : ['paragraph', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'], - holderId : 'codex-editor', - - // Type of block showing on empty editor - initialBlockPlugin: 'paragraph' - }; - - /** - * public - * - * Static nodes - */ - editor.nodes = { - holder : null, - wrapper : null, - toolbar : null, - inlineToolbar : { - wrapper : null, - buttons : null, - actions : null - }, - toolbox : null, - notifications : null, - plusButton : null, - showSettingsButton: null, - showTrashButton : null, - blockSettings : null, - pluginSettings : null, - defaultSettings : null, - toolbarButtons : {}, // { type : DomEl, ... } - redactor : null - }; - - /** - * @public - * - * Output state - */ - editor.state = { - jsonOutput : [], - blocks : [], - inputs : [] - }; - - /** - * @public - * Editor plugins - */ - editor.tools = {}; - - /** - * Initialization - * @uses Promise cEditor.core.prepare - * @param {Object} userSettings - * @param {Array} userSettings.tools list of plugins - * @param {String} userSettings.holderId Element's id to append editor - * - * Load user defined tools - * Tools must contain this important objects : - * @param {String} type - this is a type of plugin. It can be used as plugin name - * @param {String} iconClassname - this a icon in toolbar - * @param {Object} make - what should plugin do, when it is clicked - * @param {Object} appendCallback - callback after clicking - * @param {Element} settings - what settings does it have - * @param {Object} render - plugin get JSON, and should return HTML - * @param {Object} save - plugin gets HTML content, returns JSON - * @param {Boolean} displayInToolbox - will be displayed in toolbox. Default value is TRUE - * @param {Boolean} enableLineBreaks - inserts new block or break lines. Default value is FALSE - * - * @example - * - type : 'header', - * - iconClassname : 'ce-icon-header', - * - make : headerTool.make, - * - appendCallback : headerTool.appendCallback, - * - settings : headerTool.makeSettings(), - * - render : headerTool.render, - * - save : headerTool.save, - * - displayInToolbox : true, - * - enableLineBreaks : false - */ - editor.start = function (userSettings) { - - init(); - - editor.core.prepare(userSettings) - - // If all ok, make UI, bind events and parse initial-content - .then(editor.ui.prepare) - .then(editor.tools.prepare) - .then(editor.sanitizer.prepare) - .then(editor.paste.prepare) - .then(editor.transport.prepare) - .then(editor.renderer.makeBlocksFromData) - .then(editor.ui.saveInputs) - .catch(function (error) { - - editor.core.log('Initialization failed with error: %o', 'warn', error); - - }); - - }; - - return editor; - -})({}); diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 00000000..7fc85086 --- /dev/null +++ b/docs/api.md @@ -0,0 +1,76 @@ +# CodeX Editor API + +Blocks have access to the public methods provided by CodeX Editor API Module. Plugin and Tune Developers +can use Editor API as they want. + +## Api object description + +Common API interface. + +```js +export interface IAPI { + blocks: IBlocksAPI; + caret: ICaretAPI; + sanitizer: ISanitizerAPI; + toolbar: IToolbarAPI; + } + ``` + +#### IBlocksAPI + +Methods that working with Blocks + +```swap(fromIndex, toIndex)``` - swaps two Blocks by their positions + +```delete(blockIndex?: Number)``` - deletes Block with passed index + +```getCurrentBlockIndex()``` - current Block index + +```getBlockByIndex(index: Number)``` - returns Block with passed index + +```getBlocksCount()``` - returns Blocks count + +#### ISanitizerAPI + +```clean(taintString, config)``` - method uses HTMLJanitor to clean taint string. +CodeX Editor provides basic config without attributes, but you can inherit by passing your own config. + +Usage: + +```js +let taintString = '' +let customConfig = { + b: true, + p: { + style: true, + }, +} +this.api.sanitizer.clean(taintString, customConfig); +``` + +### IToolbarAPI + +Methods that working with Toolbar + +```open()``` - Opens toolbar + +```close()``` - Closes toolbar, toolbox and blockSettings if they are opened + +### IEventsAPI + +Methods that allows to subscribe on CodeX Editor events + +```on(eventName: string, callback: Function)``` - subscribe callback on event + +```off(eventName: string, callback: Function)``` - unsubscribe callback from event + +```emit(eventName: string, data: object)``` - fires all subscribed callbacks with passed data + +### IListenerAPI + +Methods that allows to work with DOM listener. Useful when you forgot to remove listener. +Module collects all listeners and destroys automatically + +```on(element: HTMLElement, eventType: string, handler: Function, useCapture?: boolean)``` - add event listener to HTML element + +```off(element: HTMLElement, eventType: string, handler: Function)``` - remove event handler from HTML element diff --git a/docs/caret.md b/docs/caret.md new file mode 100644 index 00000000..de2ac2e0 --- /dev/null +++ b/docs/caret.md @@ -0,0 +1,37 @@ +# CodeX Editor Caret Module + +The `Caret` module contains methods working with caret. Uses [Range](https://developer.mozilla.org/en-US/docs/Web/API/Range) methods to navigate caret +between blocks. + +Caret class implements basic Module class that holds User configuration +and default CodeX Editor instances + +## Properties + +## Methods + +### setToBlock + +```javascript +Caret.setToBlock(block, offset, atEnd) +``` + +> Method gets Block instance and puts caret to the text node with offset + +#### params + +| Param | Type | Description| +| -------------|------ |:-------------:| +| block | Object | Block instance that BlockManager created| +| offset | Number | caret offset regarding to the text node (Default: 0)| +| atEnd | Boolean | puts caret at the end of last text node| + + +### setToTheLastBlock + +```javascript +Caret.setToTheLastBlock() +``` + +> sets Caret at the end of last Block +If last block is not empty, inserts another empty Block which is passed as initial diff --git a/docs/events.md b/docs/events.md new file mode 100644 index 00000000..ee7c0512 --- /dev/null +++ b/docs/events.md @@ -0,0 +1,50 @@ +# CodeX Editor Events Module + +Module allows Developers to subscribe on events or trigger own events + +## Methods + +### On + +```javascript +Events.on(eventName, callback) +``` + +> Method subscribes callback on event. It will be called when CodeX Editor emits this event + +#### params + +| Param | Type | Description| +| -------------|------ |:-------------:| +| eventName | String | event name| +| callback | Function | event callback| + +### Off + +```javascript +Events.off(eventName, callback) +``` + +> Method unsubscribes callback on event + +#### params + +| Param | Type | Description| +| -------------|------ |:-------------:| +| eventName | String | event name| +| callback | Function | event callback| + +### Emit + +```javascript +Events.emit(eventName, data) +``` + +> Method emits data to all subscribed callbacks + +#### params + +| Param | Type | Description| +| -------------|------ |:-------------:| +| eventName | String | event name| +| data | Object | any data| diff --git a/docs/renderer.md b/docs/renderer.md new file mode 100644 index 00000000..6f964020 --- /dev/null +++ b/docs/renderer.md @@ -0,0 +1,7 @@ +# CodeX Editor Renderer + +`Renderer` is a class that is responsible for rendering JSON data to HTML. + + Inside it uses BlockManager to compose block's list bounded to the Tool instance. + + ## Methods diff --git a/docs/sanitizer.md b/docs/sanitizer.md new file mode 100644 index 00000000..31081ac3 --- /dev/null +++ b/docs/sanitizer.md @@ -0,0 +1,45 @@ +# CodeX Editor Sanitizer Module + +The `Sanitizer` module represents a set of methods that clears taint strings. +Uses lightweight npm package with simple API [html-janitor](https://www.npmjs.com/package/html-janitor) + +Sanitizer class implements basic Module class that holds User configuration +and default CodeX Editor instances + +You can read more about Module class [here]() + +## Properties + +Default Editor Sanitizer configuration according to the html-janitor API +```javascript +defaultConfig +``` + +Custom User configuration which passed on Editor initialization. Data type must be according to the html-janitor API +```javascript +sanitizerConfig +``` + + +Property that holds an instance used in Module +```javascript +sanitizerInstance +``` + +## Methods + +### clean + +```javascript +clean(taintString, customConfig) +``` + +> Cleans up the passed taint string + +#### params + +| Param | Type | Description| +| -------------|------ |:-------------:| +| taintString | String | string that needs to be cleaned| +| customConfig | Object | Can be passed new config per usage (Default: uses default configuration)| + diff --git a/docs/saver.md b/docs/saver.md new file mode 100644 index 00000000..c54a6e08 --- /dev/null +++ b/docs/saver.md @@ -0,0 +1,2 @@ +# CodeX Editor Saver Module + diff --git a/docs/toolbar-settings.md b/docs/toolbar-settings.md new file mode 100644 index 00000000..d3082b75 --- /dev/null +++ b/docs/toolbar-settings.md @@ -0,0 +1,91 @@ +# CodeX Editor Toolbar Block Settings Module + +Toolbar Module has space for Block settings. Settings divided into: + - space for plugin's settings, that is described by «Plugin»'s Developer + - space for default settings. This option is also can be implemented and expanded + +They difference between zones is that the first option is specified by plugin +and each Block can have different options, when second option is for every Block +regardless to the plugin's option. + +### Let's look the examples: + +«Plugin»'s Developers need to expand «renderSettings» method that returns HTML. +Every user action will be handled by itself. So, you can easily write +callbacks that switches your content or makes better. For more information +read [Tools](tools.md). + +--- + +«Tune»'s Developers need to implement core-provided interface to develop +tunes that will be appeared in Toolbar default settings zone. + +Tunes must expand two important methods: + - `render()` - returns HTML and it is appended to the default settings zone + - `save()` - extracts important information to be saved + +No restrictions. Handle user action by yourself + +Create Class that implements block-tune.ts + +Your Tune's constructor gets argument as object and it includes: + - {Object} api - object contains public methods from modules. @see [API](api.md) + - {Object} settings - settings contains block default state. +This object could have information about cover, anchor and so on. + +Example on TypeScript: + +```js + +import IBlockTune from './block-tune'; + +export default class YourCustomTune implements IBlockTune { + + public constructor({api, settings}) { + this.api = api; + this.settings = settings; + } + + render() { + let someHTML = '...'; + return someHTML; + } + + save() { + // Return the important data that needs to be saved + return object + } + + someMethod() { + // moves current block down + this.api.blocks.moveDown(); + } +} +``` + +Example on ES6 + +```js +export default class YourCustomTune { + + constructor({api, settings}) { + this.api = api; + this.settings = settings; + } + + render() { + let someHTML = '...'; + return someHTML; + } + + save() { + // Return the important data that needs to be saved + return object + } + + someMethod() { + // moves current block down + this.api.blocks.moveDown(); + } +} +``` diff --git a/docs/tools-inline.md b/docs/tools-inline.md new file mode 100644 index 00000000..ff34d02e --- /dev/null +++ b/docs/tools-inline.md @@ -0,0 +1,105 @@ +# Tools for the Inline Toolbar + +Similar with [Tools](tools.md) represented Blocks, you can create Tools for the Inline Toolbar. It will work with +selected fragment of text. The simplest example is `bold` or `italic` Tools. + +## Base structure + +First of all, Tool's class should have a `isInline` property (static getter) set as `true`. + +After that Inline Tool should implement next methods. + +- `render()` — create a button +- `surround()` — works with selected range +- `checkState()` — get Tool's activated state by selected range + +Also, you can provide optional methods + +- `renderActions()` — create additional element below the buttons +- `clear()` — clear Tool's stuff on opening/closing of Inline Toolbar +- `shortcut()` — shortcut that handles Tool + +At the constructor of Tool's class exemplar you will accept an object with the [API](api.md) as a parameter. + +--- + +### render() + +Method that returns button to append at the Inline Toolbar + +#### Parameters + +Method does not accept any parameters + +#### Return value + +type | description | +-- | -- | +`HTMLElement` | element that will be added to the Inline Toolbar | + +--- + +### surround(range: Range) + +Method that accepts selected range and wrap it somehow + +#### Parameters + +name | type | description | +-- |-- | -- | +range | Range | first range of current Selection | + +#### Return value + +There is no return value + +--- + +### checkState(selection: Selection) + +Get Selection and detect if Tool was applied. For example, after that Tool can highlight button or show some details. + +#### Parameters + +name | type | description | +-- |-- | -- | +selection | Selection | current Selection | + +#### Return value + +type | description | +-- | -- | +`Boolean` | `true` if Tool is active, otherwise `false` | + +--- + +### renderActions() + +Optional method that returns additional Element with actions. +For example, input for the 'link' tool or textarea for the 'comment' tool. +It will be places below the buttons list at Inline Toolbar. + +#### Parameters + +Method does not accept any parameters + +#### Return value + +type | description | +-- | -- | +`HTMLElement` | element that will be added to the Inline Toolbar | + +--- + +### clear() + +Optional method that will be called on opening/closing of Inline Toolbar. +Can contain logic for clearing Tool's stuff, such as inputs, states and other. + +#### Parameters + +Method does not accept any parameters + +#### Return value + +Method should not return a value. diff --git a/docs/tools.md b/docs/tools.md new file mode 100644 index 00000000..423dbb18 --- /dev/null +++ b/docs/tools.md @@ -0,0 +1,144 @@ +# CodeX Editor Tools + +CodeX Editor is a block-oriented editor. It means that entry composed with the list of `Blocks` of different types: `Texts`, `Headers`, `Images`, `Quotes` etc. + +`Tool` — is a class that provide custom `Block` type. All Tools represented by `Plugins`. + +## Tool class structure + +### Constructor + +### Render + +### Save + +### Validate + +### Merge (optional) + +Method that specifies how to merge two `Blocks` of the same type, for example on `Backspace` keypress. +Method does accept data object in same format as the `Render` and it should provide logic how to combine new +data with the currently stored value. + +### Internal Tool Settings + +Options that Tool can specify. All settings should be passed as static properties of Tool's class. + +| Name | Type | Default Value | Description | +| -- | -- | -- | -- | +| `displayInToolbox` | _Boolean_ | `false` | Pass `true` to display this `Tool` in the Editor's `Toolbox` | +| `iconClassName` | _String_ | — | CSS class name for the `Toolbox` icon. Used when `displayInToolbox` is `true` | +| `toolboxIcon` | _String_ | — | Tool's SVG icon for Toolbox | +| `irreplaceable` | _Boolean_ | `false` | By default, **empty** `Blocks` can be **replaced** by other `Blocks` with the `Toolbox`. Some tools with media-content may prefer another behaviour. Pass `true` and `Toolbox` will add a new block below yours. | +| `contentless` | _Boolean_ | `false` | Pass `true` for Tool which represents decorative empty `Blocks` | +| `isInline` | _Boolean_ | `false` | Describes Tool as a [Tool for the Inline Toolbar](tools-inline.md) | + +### User configuration + +All Tools can be configured by users. For this reason, we provide `toolConfig` option at the Editor Initial Settings. +Unlike Internal Tool Settings, this options can be specified outside the Tool class, +so users can set up different configurations for the same Tool. + +```javascript +var editor = new CodexEditor({ + holderId : 'codex-editor', + initialBlock : 'text', + tools: { + text: Text // 'Text' Tool class for Blocks with type 'text' + }, + toolsConfig: { + text: { // user configuration for Blocks with type 'text' + inlineToolbar : true, + } + } +}); +``` + +There are few options available by CodeX Editor. + +| Name | Type | Default Value | Description | +| -- | -- | -- | -- | +| `enableLineBreaks` | _Boolean_ | `false` | With this option, CodeX Editor won't handle Enter keydowns. Can be helpful for Tools like `` where line breaks should be handled by default behaviour. | +| `inlineToolbar` | _Boolean/Array_ | `false` | Pass `true` to enable the Inline Toolbar with all Tools, or pass an array with specified Tools list | +| `disallowPaste` | _Boolean_ | `false` | Pass `true` if you want to prevent any paste into your Tool + +### Paste handling + +CodeX Editor handles paste on Blocks and provides API for Tools to process the pasted data. + +When user pastes content into Editor, pasted content is splitted into blocks. + +1. If plain text has been pasted, it is split by new line characters +2. If HTML string has been pasted, it is split by block tags + +Also Editor API allows you to define RegExp patterns to substitute them by your data. + +To provide paste handling for your Tool you need to define static getter `onPaste` in Tool class. +`onPaste` getter should return object with fields described below. + +##### HTML tags handling + +To handle pasted HTML elements object returned from `onPaste` getter should contain following fields: + +| Name | Type | Description | +| -- | -- | -- | +| `handler(content: HTMLElement)` | `Function` | _Optional_. Pasted HTML elements handler. Gets one argument `content`. `content` is HTML element extracted from pasted data. Handler should return the same object as Tool's `save` method | +| `tags` | `String[]` | _Optional_. Should contain all tag names you want to be extracted from pasted data and be passed to your `handler` method | + + +For correct work you MUST provide `onPaste.handler` at least for `initialBlock` Tool. + +> Example + +Header tool can handle `H1`-`H6` tags using paste handling API + +```javascript +static get onPaste() { + return { + tags: ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'], + handler: (element) => ({ + type: element.tagName, + text: element.innerHTML + }) + } +} +``` + +> One tag can be handled by one Tool only. + +##### Patterns handling + +Your Tool can analyze text by RegExp patterns to substitute pasted string with data you want. Object returned from `onPaste` getter should contain following fields to use patterns: + +| Name | Type | Description | +| -- | -- | -- | +| `patterns` | `Object` | _Optional_. `patterns` object contains RegExp patterns with their names as object's keys | +| `patternHandler(text: string, key: string)` | `Function` | _Optional_. Gets pasted string and pattern name. Should return the same object as Tool `save` method | + + +Pattern will be processed only if paste was on `initialBlock` Tool and pasted string length is less than 450 characters. + +> Example + +You can handle youtube links and insert embeded video instead: + +```javascript +static get onPaste() { + return { + patterns: { + youtube: /http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&(amp;)?[\w\?‌​=]*)?/ + }, + patternHandler: (text, key) => { + const urlData = Youtube.onPaste.patterns[key].exec(text); + + return { + iframe: Youtube.makeEmbededFromURL(urlData) + }; + } + } +} +``` + +> Both `onPaste.handler` and `onPaste.patternHandler` can be `async` or return a `Promise`. + +### Sanitize diff --git a/example.html b/example.html deleted file mode 100644 index 5f4732b3..00000000 --- a/example.html +++ /dev/null @@ -1,244 +0,0 @@ - - - - - CodeX Editor example - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/example/example.html b/example/example.html new file mode 100644 index 00000000..10a9c404 --- /dev/null +++ b/example/example.html @@ -0,0 +1,112 @@ + + + + + CodeX Editor example + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/code/code.css b/example/plugins/code/code.css similarity index 100% rename from plugins/code/code.css rename to example/plugins/code/code.css diff --git a/example/plugins/code/code.js b/example/plugins/code/code.js new file mode 100644 index 00000000..d3fe0112 --- /dev/null +++ b/example/plugins/code/code.js @@ -0,0 +1,71 @@ +/** + * Code Plugin\ + * Creates code tag and adds content to this tag + */ + +var code = (function (code_plugin) { + var baseClass = 'ce-code'; + + /** + * Make initial header block + * @param {object} JSON with block data + * @return {Element} element to append + */ + var make_ = function (data) { + var tag = codex.editor.draw.node('TEXTAREA', [ baseClass ], {}); + + if (data && data.text) { + tag.value = data.text; + } + + return tag; + }; + + /** + * Escapes HTML chars + * + * @param {string} input + * @return {string} — escaped string + */ + var escapeHTML_ = function (input) { + var div = document.createElement('DIV'), + text = document.createTextNode(input); + + div.appendChild(text); + + return div.innerHTML; + }; + + /** + * Method to render HTML block from JSON + */ + code_plugin.render = function (data) { + return make_(data); + }; + + /** + * Method to extract JSON data from HTML block + */ + code_plugin.save = function (blockContent) { + var escaped = escapeHTML_(blockContent.value), + data = { + text : escaped + }; + + + return data; + }; + + code_plugin.validate = function (data) { + if (data.text.trim() == '') + return; + + return true; + }; + + code_plugin.destroy = function () { + code = null; + }; + + return code_plugin; +})({}); diff --git a/plugins/embed/embed.css b/example/plugins/embed/embed.css similarity index 100% rename from plugins/embed/embed.css rename to example/plugins/embed/embed.css diff --git a/example/plugins/embed/embed.js b/example/plugins/embed/embed.js new file mode 100644 index 00000000..d727a623 --- /dev/null +++ b/example/plugins/embed/embed.js @@ -0,0 +1,199 @@ +/** + * Embed plugin by gohabereg + * @version 1.0.0 + */ +var embed = function (embed_plugin) { + var methods = { + + addInternal: function (content) { + codex.editor.content.switchBlock(codex.editor.content.currentNode, content); + + var blockContent = codex.editor.content.currentNode.childNodes[0]; + + blockContent.classList.add('embed__loader'); + + setTimeout(function () { + blockContent.classList.remove('embed__loader'); + }, 1000); + }, + + getHtmlWithEmbedId: function (type, id) { + return services[type].html.replace(/<\%\= remote\_id \%\>/g, id); + }, + + makeElementFromHtml: function (html) { + var wrapper = document.createElement('DIV'); + + wrapper.innerHTML = html; + + return wrapper; + }, + + getRemoteId: function (source, execArray) { + switch(source) { + case 'yandex-music-track': + id = execArray[2]+'/'+execArray[1]; + break; + case 'yandex-music-playlist': + id = execArray[1]+'/'+execArray[2]; + break; + default: + id = execArray[1]; + } + + return id; + } + }; + + var services = { + youtube: { + regex: /^.*(?:(?:youtu\.be\/)|(?:youtube\.com)\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*)(?:[\?\&]t\=(\d*)|)/, + html: '', + height: 320, + width: 580 + } + }; + + + embed_plugin.make = function (data, isInternal) { + if (!data.remote_id) + return; + + var html = methods.getHtmlWithEmbedId(data.source, data.remote_id), + block = methods.makeElementFromHtml(html); + + block.dataset.remoteId = data.remote_id; + block.dataset.source = data.source; + block.dataset.thumbnailUrl = data.thumbnailUrl; + + block.classList.add('embed'); + + // var sidePadding = (600 - services[data.source].width) / 2 + 'px'; + + // block.style.padding = '30px ' + sidePadding; + + if (isInternal) { + methods.addInternal(block); + } + + return block; + }; + + /** + * Saving JSON output. + * Upload data via ajax + */ + embed_plugin.save = function (blockContent) { + if (!blockContent) + return; + + var data, + source = blockContent.dataset.source; + + data = { + source: source, + remote_id: blockContent.dataset.remoteId, + thumbnailUrl: blockContent.dataset.thumbnailUrl, + height: services[source].height, + width: services[source].width + }; + + return data; + }; + + /** + * Render data + */ + embed_plugin.render = function (data) { + return embed_plugin.make(data); + }; + + embed_plugin.urlPastedCallback = function (url, pattern) { + var execArray = pattern.regex.exec(url), + id = methods.getRemoteId(pattern.type, execArray); + + var data = { + source: pattern.type, + remote_id: id, + thumbnailUrl: url + }; + + embed_plugin.make(data, true); + }; + + embed_plugin.validate = function (savedData) { + var source = savedData.source, + execArray = services[source].regex.exec(savedData.thumbnailUrl), + remoteId = methods.getRemoteId(source, execArray); + + return remoteId == savedData.remote_id; + }; + + embed_plugin.pastePatterns = [ + { + type: 'vk', + regex: /https?:\/\/vk\.com\/.*(?:video)([-0-9]+_[0-9]+)/, // /https?.+vk?.com\/feed\?w=wall\d+_\d+/, + callback: embed_plugin.urlPastedCallback + }, + { + type: 'youtube', + regex: /(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/, + callback: embed_plugin.urlPastedCallback + }, + { + type: 'vimeo', + regex: /(?:http[s]?:\/\/)?(?:www.)?vimeo\.co(?:.+\/([^\/]\d+)(?:#t=[\d]+)?s?$)/, + callback: embed_plugin.urlPastedCallback + }, + { + type: 'coub', + regex: /https?:\/\/coub\.com\/view\/([^\/\?\&]+)/, + callback: embed_plugin.urlPastedCallback + }, + { + type: 'vine', + regex: /https?:\/\/vine\.co\/v\/([^\/\?\&]+)/, + callback: embed_plugin.urlPastedCallback + }, + { + type: 'imgur', + regex: /https?:\/\/(?:i\.)?imgur\.com.*\/([a-zA-Z0-9]+)(?:\.gifv)?/, + callback: embed_plugin.urlPastedCallback + }, + { + type: 'gfycat', + regex: /https?:\/\/gfycat\.com(?:\/detail)?\/([a-zA-Z]+)/, + callback: embed_plugin.urlPastedCallback + }, + { + type: 'twitch-channel', + regex: /https?:\/\/www.twitch.tv\/([^\/\?\&]*)/, + callback: embed_plugin.urlPastedCallback + }, + { + type: 'twitch-video', + regex: /https?:\/\/www.twitch.tv\/(?:[^\/\?\&]*\/v|videos)\/([0-9]*)/, + callback: embed_plugin.urlPastedCallback + }, + { + type: 'yandex-music-album', + regex: /https?:\/\/music.yandex.ru\/album\/([0-9]*)/, + callback: embed_plugin.urlPastedCallback + }, + { + type: 'yandex-music-track', + regex: /https?:\/\/music.yandex.ru\/album\/([0-9]*)\/track\/([0-9]*)/, + callback: embed_plugin.urlPastedCallback + }, + { + type: 'yandex-music-playlist', + regex: /https?:\/\/music.yandex.ru\/users\/([^\/\?\&]*)\/playlists\/([0-9]*)/, + callback: embed_plugin.urlPastedCallback + } ]; + + embed_plugin.destroy = function () { + embed = null; + }; + + return embed_plugin; +}({}); \ No newline at end of file diff --git a/plugins/embed/loading.gif b/example/plugins/embed/loading.gif similarity index 100% rename from plugins/embed/loading.gif rename to example/plugins/embed/loading.gif diff --git a/example/plugins/header/header.css b/example/plugins/header/header.css new file mode 100644 index 00000000..55280500 --- /dev/null +++ b/example/plugins/header/header.css @@ -0,0 +1,20 @@ +/** + * Plugin styles + */ +.ce-header { + padding: .7em 0; + margin: 0; + line-height: 1.5em; + outline: none; +} + + .ce-header p, + .ce-header div{ + padding: 0 !important; + margin: 0 !important; + } + +/** + * Styles for Plugin icon in Toolbar + */ +.cdx-header-icon {} diff --git a/example/plugins/header/header.js b/example/plugins/header/header.js new file mode 100644 index 00000000..0d1b9187 --- /dev/null +++ b/example/plugins/header/header.js @@ -0,0 +1,393 @@ +/** + * @typedef {Object} HeaderData + * @description Tool's input and output data format + * @property {String} text — Header's content + * @property {number} level - Header's level from 1 to 3 + */ + +/** + * @typedef {Object} HeaderConfig + * @description Tool's config from Editor + * @property {string} placeholder — Block's placeholder + */ + +/** + * Header block for the CodeX Editor. + * + * @author CodeX Team (team@ifmo.su) + * @copyright CodeX Team 2018 + * @license The MIT License (MIT) + * @version 2.0.0 + */ +class Header { + /** + * Should this tools be displayed at the Editor's Toolbox + * @returns {boolean} + * @public + */ + static get displayInToolbox() { + return true; + } + + /** + * Class for the Toolbox icon + * @returns {string} + * @public + */ + static get iconClassName() { + return 'cdx-header-icon'; + } + + /** + * Render plugin`s main Element and fill it with saved data + * @param {HeaderData} blockData - previously saved data + * @param {HeaderConfig} blockConfig - Tool's config from Editor + */ + constructor(blockData = {}, blockConfig = {}) { + /** + * Styles + * @type {Object} + */ + this._CSS = { + wrapper: 'ce-header', + settingsButton: 'ce-settings__button', + settingsSelected: 'ce-settings__button--selected', + }; + + /** + * Tool's settings passed from Editor + * @type {HeaderConfig} + * @private + */ + this._settings = blockConfig; + + /** + * Block's data + * @type {HeaderData} + * @private + */ + this._data = blockData || {}; + + /** + * List of settings buttons + * @type {HTMLElement[]} + */ + this.settingsButtons = []; + + /** + * Main Block wrapper + * @type {HTMLElement} + * @private + */ + this._element = this.getTag(); + } + + /** + * Return Tool's view + * @returns {HTMLHeadingElement} + * @public + */ + render() { + return this._element; + } + + /** + * Create Block's settings block + * + * @return {HTMLElement} + */ + renderSettings() { + let holder = document.createElement('DIV'); + + /** Add type selectors */ + this.levels.forEach( level => { + let selectTypeButton = document.createElement('SPAN'); + + selectTypeButton.classList.add(this._CSS.settingsButton); + + /** + * Highlight current level button + */ + if (this.currentLevel.number === level.number) { + selectTypeButton.classList.add(this._CSS.settingsSelected); + } + + /** + * Add SVG icon + */ + selectTypeButton.innerHTML = level.svg; + + /** + * Save level to its button + */ + selectTypeButton.dataset.level = level.number; + + /** + * Set up click handler + */ + selectTypeButton.addEventListener('click', () => { + this.setLevel(level.number); + }); + + /** + * Append settings button to holder + */ + holder.appendChild(selectTypeButton); + + /** + * Save settings buttons + */ + this.settingsButtons.push(selectTypeButton); + }); + + return holder; + } + + /** + * Callback for Block's settings buttons + * @param level + */ + setLevel(level) { + this.data = { + level: level + }; + + /** + * Highlight button by selected level + */ + this.settingsButtons.forEach(button => { + button.classList.toggle(this._CSS.settingsSelected, parseInt(button.dataset.level) === level); + }); + } + + /** + * Method that specified how to merge two Text blocks. + * Called by CodeX Editor by backspace at the beginning of the Block + * @param {HeaderData} data + * @public + */ + merge(data) { + let newData = { + text: this.data.text + data.text, + level: this.data.level + }; + + this.data = newData; + } + + /** + * Validate Text block data: + * - check for emptiness + * + * @param {HeaderData} blockData — data received after saving + * @returns {boolean} false if saved data is not correct, otherwise true + * @public + */ + validate(blockData) { + return blockData.text.trim() !== ''; + } + + /** + * Extract Tool's data from the view + * @param {HTMLHeadingElement} toolsContent - Text tools rendered view + * @returns {HeaderData} - saved data + * @public + */ + save(toolsContent) { + /** + * @todo sanitize data + */ + + return { + text: toolsContent.innerHTML, + level: this.currentLevel.number + }; + } + + /** + * Get current Tools`s data + * @returns {HeaderData} Current data + * @private + */ + get data() { + this._data.text = this._element.innerHTML; + this._data.level = this.currentLevel.number; + + return this._data; + } + + /** + * Store data in plugin: + * - at the this._data property + * - at the HTML + * + * @param {HeaderData} data — data to set + * @private + */ + set data(data) { + this._data = data || {}; + + /** + * If level is set and block in DOM + * then replace it to a new block + */ + if (data.level !== undefined && this._element.parentNode) { + /** + * Create a new tag + * @type {HTMLHeadingElement} + */ + let newHeader = this.getTag(); + + /** + * Save Block's content + */ + newHeader.innerHTML = this._element.innerHTML; + + /** + * Replace blocks + */ + this._element.parentNode.replaceChild(newHeader, this._element); + + /** + * Save new block to private variable + * @type {HTMLHeadingElement} + * @private + */ + this._element = newHeader; + } + + /** + * If data.text was passed then update block's content + */ + if (data.text !== undefined) { + this._element.innerHTML = this._data.text || ''; + } + } + + /** + * Get tag for target level + * By default returns second-leveled header + * @return {HTMLElement} + */ + getTag() { + /** + * Create element for current Block's level + */ + let tag = document.createElement(this.currentLevel.tag); + + /** + * Add text to block + */ + tag.innerHTML = this._data.text || ''; + + /** + * Add styles class + */ + tag.classList.add(this._CSS.wrapper); + + /** + * Make tag editable + */ + tag.contentEditable = 'true'; + + /** + * Add Placeholder + */ + tag.dataset.placeholder = this._settings.placeholder || ''; + + return tag; + } + + /** + * Get current level + * @return {level} + */ + get currentLevel() { + let level = this.levels.find( level => level.number === this._data.level); + + if (!level) { + level = this.levels[0]; + } + + return level; + } + + /** + * @typedef {object} level + * @property {number} number - level number + * @property {string} tag - tag correspondes with level number + * @property {string} svg - icon + */ + + /** + * Available header levels + * @return {level[]} + */ + get levels() { + return [ + { + number: 2, + tag: 'H2', + svg: '' + }, + { + number: 3, + tag: 'H3', + svg: '' + }, + { + number: 4, + tag: 'H4', + svg: '' + } + ]; + } + + /** + * Handle H1-H6 tags on paste to substitute it with header Tool + * + * @private + * @param {HTMLElement} content - pasted element + * @returns {{level: number, text: *}} + */ + static onPasteHandler(content) { + let level = 4; + + switch (content.tagName) { + case 'H1': + case 'H2': + level = 2; + break; + + case 'H3': + level = 3; + break; + } + + return { + level, + text: content.innerHTML + }; + } + + /** + * Used by Codex Editor paste handling API. + * Provides configuration to handle H1-H6 tags. + * + * @returns {{handler: (function(HTMLElement): {text: string}), tags: string[]}} + */ + static get onPaste() { + return { + handler: Header.onPasteHandler, + tags: ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'] + }; + } + + /** + * Get Tool icon's SVG + * @return {string} + */ + static get toolboxIcon() { + return ''; + } +} diff --git a/plugins/image/image.css b/example/plugins/image/image.css similarity index 100% rename from plugins/image/image.css rename to example/plugins/image/image.css diff --git a/example/plugins/image/image.js b/example/plugins/image/image.js new file mode 100644 index 00000000..85889122 --- /dev/null +++ b/example/plugins/image/image.js @@ -0,0 +1,647 @@ +/** + * Image plugin for codex-editor + * @author CodeX Team + * + * @version 1.3.0 + */ +var image = (function (image_plugin) { + /** + * @private + * + * CSS classNames + */ + var elementClasses_ = { + + ce_image : 'ce-image', + loading : 'ce-plugin-image__loader', + blockStretched: 'ce-block--stretched', + uploadedImage : { + centered : 'ce-plugin-image__uploaded--centered', + stretched : 'ce-plugin-image__uploaded--stretched' + }, + imageCaption : 'ce-plugin-image__caption', + imageWrapper : 'ce-plugin-image__wrapper', + formHolder : 'ce-plugin-image__holder', + uploadButton : 'ce-plugin-image__button', + imagePreview : 'ce-image__preview', + selectorHolder: 'ce-settings-checkbox', + selectorButton: 'ce-settings-checkbox__toggler', + settingsItem: 'ce-image-settings__item', + imageWrapperBordered : 'ce-image__wrapper--bordered', + toggled : 'ce-image-settings__item--toggled' + + }; + + /** + * + * @private + * + * UI methods + */ + var ui_ = { + + holder : function () { + var element = document.createElement('DIV'); + + element.classList.add(elementClasses_.formHolder); + element.classList.add(elementClasses_.ce_image); + + return element; + }, + + uploadButton : function () { + var button = document.createElement('SPAN'); + + button.classList.add(elementClasses_.uploadButton); + + button.innerHTML = ' '; + button.innerHTML += 'Загрузить фотографию'; + + return button; + }, + + /** + * @param {object} file - file path + * @param {string} style - css class + * @return {object} image - document IMG tag + */ + image : function (file, styles) { + var image = document.createElement('IMG'); + + styles.map(function (item) { + image.classList.add(item); + }); + + image.src = file.url; + image.dataset.bigUrl = file.bigUrl; + + return image; + }, + + wrapper : function () { + var div = document.createElement('div'); + + div.classList.add(elementClasses_.imageWrapper); + + return div; + }, + + caption : function () { + var div = document.createElement('div'); + + div.classList.add(elementClasses_.imageCaption); + div.contentEditable = true; + + return div; + }, + /** + * Draws form for image upload + */ + makeForm : function () { + var holder = ui_.holder(), + uploadButton = ui_.uploadButton(); + + holder.appendChild(uploadButton); + + uploadButton.addEventListener('click', uploadButtonClicked_, false ); + + image.holder = holder; + + return holder; + }, + + + /** + * wraps image and caption + * @param {object} data - image information + * @param {string} imageTypeClass - plugin's style + * @param {boolean} stretched - stretched or not + * @return wrapped block with image and caption + */ + makeImage : function (data, imageTypeClasses, stretched, bordered) { + var file = data, + text = data.caption, + type = data.type, + image = ui_.image(file, imageTypeClasses), + caption = ui_.caption(), + wrapper = ui_.wrapper(); + + caption.innerHTML = text || ''; + + wrapper.dataset.stretched = stretched; + wrapper.dataset.bordered = bordered; + + /** Appeding to the wrapper */ + wrapper.appendChild(image); + wrapper.appendChild(caption); + + return wrapper; + }, + + /** + * @param {HTML} data - Rendered block with image + */ + getImage : function (data) { + var image = data.querySelector('.' + elementClasses_.uploadedImage.centered) || + data.querySelector('.' + elementClasses_.uploadedImage.stretched); + + return image; + }, + + /** + * wraps image and caption + * @deprecated + * @param {object} data - image information + * @return wrapped block with image and caption + */ + centeredImage : function (data) { + var file = data.file, + text = data.caption, + type = data.type, + image = ui_.image(file, elementClasses_.uploadedImage.centered), + caption = ui_.caption(), + wrapper = ui_.wrapper(); + + caption.textContent = text; + + wrapper.dataset.stretched = 'false'; + + /** Appeding to the wrapper */ + wrapper.appendChild(image); + wrapper.appendChild(caption); + + return wrapper; + }, + + /** + * wraps image and caption + * @deprecated + * @param {object} data - image information + * @return stretched image + */ + stretchedImage : function (data) { + var file = data.file, + text = data.caption, + type = data.type, + image = ui_.image(file, elementClasses_.uploadedImage.stretched), + caption = ui_.caption(), + wrapper = ui_.wrapper(); + + caption.textContent = text; + + wrapper.dataset.stretched = 'true'; + + /** Appeding to the wrapper */ + wrapper.appendChild(image); + wrapper.appendChild(caption); + + return wrapper; + } + + }; + + /** + * @private + * + * After render callback + */ + var uploadButtonClicked_ = function (event) { + var url = image_plugin.config.uploadImage, + beforeSend = uploadingCallbacks_.ByClick.beforeSend, + success = uploadingCallbacks_.ByClick.success, + error = uploadingCallbacks_.ByClick.error; + + /** Define callbacks */ + codex.editor.transport.selectAndUpload({ + url : url, + multiple : false, + accept : 'image/*', + beforeSend : beforeSend, + success : success, + error : error + }); + }; + + var methods_ = { + + addSelectTypeClickListener : function (el, type) { + el.addEventListener('click', function () { + // el - settings element + + switch (type) { + case 'bordered': + methods_.toggleBordered(type, this); break; + case 'stretched': + methods_.toggleStretched(type, this); break; + } + }, false); + }, + + toggleBordered : function (type, clickedSettingsItem ) { + var current = codex.editor.content.currentNode, + blockContent = current.childNodes[0], + img = ui_.getImage(current), + wrapper = current.querySelector('.' + elementClasses_.imageWrapper); + + if (!img) { + return; + } + + /** + * Add classes to the IMG tag and to the Settings element + */ + img.classList.toggle(elementClasses_.imageWrapperBordered); + clickedSettingsItem.classList.toggle(elementClasses_.toggled); + + /** + * Save settings in dataset + */ + wrapper.dataset.bordered = img.classList.contains(elementClasses_.imageWrapperBordered); + + setTimeout(function () { + codex.editor.toolbar.settings.close(); + }, 200); + }, + + toggleStretched : function ( type, clickedSettingsItem ) { + var current = codex.editor.content.currentNode, + blockContent = current.childNodes[0], + img = ui_.getImage(current), + wrapper = current.querySelector('.' + elementClasses_.imageWrapper); + + if (!img) { + return; + } + + /** Clear classList */ + blockContent.classList.add(elementClasses_.blockStretched); + img.classList.toggle(elementClasses_.uploadedImage.stretched); + img.classList.toggle(elementClasses_.uploadedImage.centered); + + clickedSettingsItem.classList.toggle(elementClasses_.toggled); + + wrapper.dataset.stretched = img.classList.contains(elementClasses_.uploadedImage.stretched); + + setTimeout(function () { + codex.editor.toolbar.settings.close(); + }, 1000); + } + }; + + /** + * @private + * Callbacks + */ + var uploadingCallbacks_ = { + + ByClick : { + + /** + * Before sending ajax request + */ + beforeSend : function () { + var input = codex.editor.transport.input, + files = input.files; + + var validFileExtensions = ['jpg', 'jpeg', 'bmp', 'gif', 'png']; + + var type = files[0].type.split('/'); + + var result = validFileExtensions.some(function (ext) { + return ext == type[1]; + }); + + if (!result) { + return; + } + + var reader = new FileReader(); + + reader.readAsDataURL(files[0]); + + reader.onload = function (e) { + var data = { + background : false, + border : false, + isstretch : false, + url : e.target.result, + bigUrl : null, + width : null, + height : null, + additionalData : null, + caption : '', + cover : null + }; + + var newImage = make_(data); + + codex.editor.content.switchBlock(image.holder, newImage, 'image'); + newImage.classList.add(elementClasses_.imagePreview); + + /** + * Change holder to image + */ + image.holder = newImage; + }; + }, + + /** Photo was uploaded successfully */ + success : function (result) { + var parsed = JSON.parse(result), + data, + currentBlock = codex.editor.content.currentNode; + + /** + * Preparing {Object} data to draw an image + * @uses ceImage.make method + */ + data = parsed.data; + + image.holder.classList.remove(elementClasses_.imagePreview); + + /** + * Change src of image + */ + var newImage = image.holder.getElementsByTagName('IMG')[0]; + + newImage.src = parsed.data.url; + newImage.dataset.bigUrl = parsed.data.bigUrl; + newImage.dataset.width = parsed.data.width; + newImage.dataset.height = parsed.data.height; + newImage.dataset.additionalData = parsed.data.additionalData; + }, + + /** Error callback. Sends notification to user that something happend or plugin doesn't supports method */ + error : function (result) { + var oldHolder = image.holder; + var form = ui_.makeForm(); + + codex.editor.content.switchBlock(oldHolder, form, 'image'); + } + }, + + ByPaste : { + + /** + * Direct upload + * Any URL that contains image extension + * @param url + */ + uploadImageFromUrl : function (path) { + var image, + current = codex.editor.content.currentNode, + beforeSend, + success_callback; + + /** When image is uploaded to redactors folder */ + success_callback = function (data) { + var imageInfo = JSON.parse(data); + + var newImage = image.getElementsByTagName('IMG')[0]; + + newImage.dataset.stretched = false; + newImage.dataset.src = imageInfo.url; + newImage.dataset.bigUrl = imageInfo.bigUrl; + newImage.dataset.width = imageInfo.width; + newImage.dataset.height = imageInfo.height; + newImage.dataset.additionalData = imageInfo.additionalData; + + image.classList.remove(elementClasses_.imagePreview); + }; + + /** Before sending XMLHTTP request */ + beforeSend = function () { + var content = current.querySelector('.ce-block__content'); + + var data = { + background: false, + border: false, + isStretch: false, + file: { + url: path, + bigUrl: null, + width: null, + height: null, + additionalData: null + }, + caption: '', + cover: null + }; + + image = codex.editor.tools.image_extended.render(data); + + image.classList.add(elementClasses_.imagePreview); + + var img = image.querySelector('img'); + + codex.editor.content.switchBlock(codex.editor.content.currentNode, image, 'image'); + }; + + /** Preparing data for XMLHTTP */ + var data = { + url: image_plugin.config.uploadFromUrl, + type: 'POST', + data : { + url: path + }, + beforeSend : beforeSend, + success : success_callback + }; + + codex.editor.core.ajax(data); + } + + } + }; + + /** + * Image path + * @type {null} + */ + image_plugin.path = null; + + /** + * Plugin configuration + */ + image_plugin.config = null; + + /** + * + * @private + * + * @param data + * @return {*} + * + */ + var make_ = function ( data ) { + var holder, + classes = []; + + if (data) { + if (data.border) { + classes.push(elementClasses_.imageWrapperBordered); + } + + if ( data.isstretch || data.isstretch === 'true') { + classes.push(elementClasses_.uploadedImage.stretched); + holder = ui_.makeImage(data, classes, 'true', data.border); + } else { + classes.push(elementClasses_.uploadedImage.centered); + holder = ui_.makeImage(data, classes, 'false', data.border); + } + + return holder; + } else { + holder = ui_.makeForm(); + + return holder; + } + }; + + /** + * @private + * + * Prepare clear data before save + * + * @param data + */ + var prepareDataForSave_ = function (data) { + + }; + + /** + * @public + * @param config + */ + image_plugin.prepare = function (config) { + image_plugin.config = config; + + return Promise.resolve(); + }; + + /** + * @public + * + * this tool works when tool is clicked in toolbox + */ + image_plugin.appendCallback = function (event) { + /** Upload image and call success callback*/ + uploadButtonClicked_(event); + }; + + /** + * @public + * + * @param data + * @return {*} + */ + image_plugin.render = function ( data ) { + return make_(data); + }; + + /** + * @public + * + * @param block + * @return {{background: boolean, border: boolean, isstretch: boolean, file: {url: (*|string|Object), bigUrl: (null|*), width: *, height: *, additionalData: null}, caption: (string|*|string), cover: null}} + */ + image_plugin.save = function ( block ) { + var content = block, + image = ui_.getImage(content), + caption = content.querySelector('.' + elementClasses_.imageCaption); + + var data = { + background : false, + border : content.dataset.bordered === 'true' ? true : false, + isstretch : content.dataset.stretched === 'true' ? true : false, + // file : { + url : image.dataset.src || image.src, + bigUrl : image.dataset.bigUrl, + width : image.width, + height : image.height, + additionalData :null, + // }, + caption : caption.innerHTML || '', + cover : null + }; + + return data; + }; + + /** + * @public + * + * Settings panel content + * @return {Element} element contains all settings + */ + image_plugin.makeSettings = function () { + var currentNode = codex.editor.content.currentNode, + wrapper = currentNode.querySelector('.' + elementClasses_.imageWrapper), + holder = document.createElement('DIV'), + types = { + stretched : 'На всю ширину', + bordered : 'Добавить рамку' + }, + currentImageWrapper = currentNode.querySelector('.' + elementClasses_.imageWrapper ), + currentImageSettings = currentImageWrapper.dataset; + + /** Add holder classname */ + holder.className = 'ce-image-settings'; + + /** Now add type selectors */ + for (var type in types) { + /** + * Settings template + */ + var settingsItem = document.createElement('DIV'), + selectorsHolder = document.createElement('SPAN'), + selectorsButton = document.createElement('SPAN'); + + settingsItem.classList.add(elementClasses_.settingsItem); + selectorsHolder.classList.add(elementClasses_.selectorHolder); + selectorsButton.classList.add(elementClasses_.selectorButton); + + selectorsHolder.appendChild(selectorsButton); + settingsItem.appendChild(selectorsHolder); + + selectTypeButton = document.createTextNode(types[type]); + settingsItem.appendChild(selectTypeButton); + + /** + * Activate previously selected settings + */ + if ( currentImageSettings[type] == 'true' ) { + settingsItem.classList.add(elementClasses_.toggled); + } + + methods_.addSelectTypeClickListener(settingsItem, type); + + holder.appendChild(settingsItem); + } + + return holder; + }; + + /** + * Share as API + */ + image_plugin.uploadImageFromUri = uploadingCallbacks_.ByPaste.uploadImageFromUrl; + + image_plugin.pastePatterns = [ + { + type: 'image', + regex: /(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*\.(?:jpe?g|gif|png))(?:\?([^#]*))?(?:#(.*))?/i, + callback: image_plugin.uploadImageFromUri + }, + { + type: 'uploadCare', + regex: /^https:\/\/(uploadcare\.cmtt\.ru|ucarecdn\.com|static[0-9]+\.siliconrus\.cmtt\.ru|static[0-9]+\.cmtt\.ru)/i, + callback: image_plugin.uploadImageFromUri + } ]; + + image_plugin.destroy = function () { + image = null; + }; + + return image_plugin; +})({}); \ No newline at end of file diff --git a/plugins/instagram/instagram.css b/example/plugins/instagram/instagram.css similarity index 100% rename from plugins/instagram/instagram.css rename to example/plugins/instagram/instagram.css diff --git a/example/plugins/instagram/instagram.js b/example/plugins/instagram/instagram.js new file mode 100644 index 00000000..093f0220 --- /dev/null +++ b/example/plugins/instagram/instagram.js @@ -0,0 +1,143 @@ +/** + * Instagram plugin + * @version 1.0.0 + */ +var instagram = (function (instagram_plugin) { + var methods = { + + render : function (content) { + codex.editor.content.switchBlock(codex.editor.content.currentNode, content); + + setTimeout(function () { + window.instgrm.Embeds.process(); + }, 200); + }, + + /** + * Drawing html content. + * + * @param url + * @returns {Element} blockquote - HTML template for Instagram Embed JS + */ + instagramBlock : function (url) { + var blockquote = codex.editor.draw.node('BLOCKQUOTE', 'instagram-media instagram', {}), + div = codex.editor.draw.node('DIV', '', {}), + paragraph = codex.editor.draw.node('P', 'ce-paste__instagram--p', {}), + anchor = codex.editor.draw.node('A', '', { href : url }); + + blockquote.dataset.instgrmVersion = 4; + + paragraph.appendChild(anchor); + div.appendChild(paragraph); + blockquote.appendChild(div); + + return blockquote; + } + }; + + /** + * Prepare before usage + * Load important scripts to render embed + */ + instagram_plugin.prepare = function () { + return new Promise(function (resolve, reject) { + codex.editor.core.importScript('https://platform.instagram.com/en_US/embeds.js', 'instagram-api').then(function () { + resolve(); + }).catch(function () { + reject(Error('Instagram API was not loaded')); + }); + }); + }; + + /** + * @private + * + * Make instagram embed via Widgets method + */ + var make_ = function (data, isInternal) { + if (!data.instagram_url) + return; + + var block = methods.instagramBlock(data.instagram_url); + + if (isInternal) { + setTimeout(function () { + /** Render block */ + methods.render(block); + }, 200); + } + + if (!isInternal) { + methods.render(block); + } + + return block; + }; + + instagram_plugin.validate = function (data) { + return true; + }; + + /** + * Saving JSON output. + * Upload data via ajax + */ + instagram_plugin.save = function (blockContent) { + var data; + + if (!blockContent) + return; + + /** Example */ + data = { + instagram_url: blockContent.src + }; + + return data; + }; + + instagram_plugin.validate = function (data) { + var checkUrl = new RegExp('http?.+instagram.com\/p?.'); + + if (!data.instagram_url || checkUrl.exec(data.instagram_url).length == 0) + return; + + return true; + }; + + /** + * Render data + */ + instagram_plugin.render = function (data) { + return make_(data); + }; + + /** + * callback for instagram url's coming from pasteTool + * Using instagram Embed Widgete to render + * @param url + */ + instagram_plugin.urlPastedCallback = function (url) { + var data = { + instagram_url: url + }; + + make_(data, true); + }; + + instagram_plugin.pastePatterns = [ + { + type: 'instagram', + regex: /http?.+instagram.com\/p\/([a-zA-Z0-9]*)\S*/, + callback: instagram_plugin.urlPastedCallback + } + ]; + + instagram_plugin.destroy = function () { + instagram = null; + delete window.instgrm; + }; + + return instagram_plugin; +})({}); + diff --git a/plugins/instagram/loading.gif b/example/plugins/instagram/loading.gif similarity index 100% rename from plugins/instagram/loading.gif rename to example/plugins/instagram/loading.gif diff --git a/plugins/link/link.css b/example/plugins/link/link.css similarity index 100% rename from plugins/link/link.css rename to example/plugins/link/link.css diff --git a/example/plugins/link/link.js b/example/plugins/link/link.js new file mode 100644 index 00000000..9477d637 --- /dev/null +++ b/example/plugins/link/link.js @@ -0,0 +1,301 @@ +/** + * Created by nostr on 29.06.16. + */ + +/** + * Link tool plugin + */ + +var link = (function (link_plugin) { + var settings = { + defaultText : 'Вставьте ссылку ...', + ENTER_KEY : 13, + currentBlock : null, + currentInput : null, + elementClasses : { + link: 'tool-link-link', + image: 'tool-link-image', + title: 'tool-link-title', + description: 'tool-link-description', + loader: 'tool-link-loader', + error: 'tool-link-error' + } + }; + + var ui = { + + make : function (json) { + var wrapper = ui.wrapper(), + siteImage = ui.image(json.image, settings.elementClasses.image), + siteTitle = ui.title(json.title), + siteDescription = ui.description(json.description), + siteLink = ui.link(json.url, json.url); + + wrapper.appendChild(siteImage); + wrapper.appendChild(siteTitle); + wrapper.appendChild(siteLink); + wrapper.appendChild(siteDescription); + + siteTitle.contentEditable = true; + siteDescription.contentEditable = true; + + return wrapper; + }, + + mainBlock : function () { + var wrapper = document.createElement('div'); + + wrapper.classList.add('ceditor-tool-link'); + + return wrapper; + }, + + input : function () { + var inputTag = document.createElement('input'); + + inputTag.classList.add('ceditor-tool-link-input'); + + inputTag.placeholder = settings.defaultText; + + inputTag.contentEditable = false; + + return inputTag; + }, + + wrapper : function () { + var wrapper = document.createElement('div'); + + wrapper.classList.add('tool-link-panel', 'clearfix'); + + return wrapper; + }, + + image : function (imageSrc, imageClass) { + var imageTag = document.createElement('img'); + + imageTag.classList.add(imageClass); + + imageTag.setAttribute('src', imageSrc); + + return imageTag; + }, + + link : function (linkUrl, linkText) { + var linkTag = document.createElement('a'); + + linkTag.classList.add(settings.elementClasses.link); + + linkTag.href = linkUrl; + + linkTag.target = '_blank'; + + linkTag.innerText = linkText; + + return linkTag; + }, + + title : function (titleText) { + var titleTag = document.createElement('div'); + + titleTag.classList.add('tool-link-content', settings.elementClasses.title); + + titleTag.innerHTML = titleText; + + return titleTag; + }, + + description : function (descriptionText) { + var descriptionTag = document.createElement('div'); + + descriptionTag.classList.add('tool-link-content', settings.elementClasses.description); + + descriptionTag.innerHTML = descriptionText; + + return descriptionTag; + } + + }; + + var methods = { + + blockPasteCallback : function (event) { + var clipboardData = event.clipboardData || window.clipboardData, + pastedData = clipboardData.getData('Text'), + block = event.target.parentNode; + + methods.renderLink(pastedData, block); + + event.stopPropagation(); + }, + + blockKeyDownCallback : function (event) { + var inputTag = event.target, + block = inputTag.parentNode, + url; + + if ( block.classList.contains(settings.elementClasses.error) ) { + block.classList.remove(settings.elementClasses.error); + } + + if (event.keyCode == settings.ENTER_KEY) { + url = inputTag.value; + + methods.renderLink(url, block); + + event.preventDefault(); + } + }, + + renderLink : function (url, block) { + Promise.resolve() + + .then(function () { + return methods.urlify(url); + }) + + .then(function (url) { + /* Show loader gif **/ + block.classList.add(settings.elementClasses.loader); + + return fetch( link_plugin.config.fetchUrl + '?url=' + encodeURI(url) ); + }) + + .then(function (response) { + if (response.status == '200') { + return response.json(); + } else { + return Error('Invalid response status: %o', response); + } + }) + + .then(function (json) { + methods.composeLinkPreview(json, block); + }) + + .catch(function (error) { + /* Hide loader gif **/ + block.classList.remove(settings.elementClasses.loader); + + block.classList.add(settings.elementClasses.error); + + codex.editor.core.log('Error while doing things with link paste: %o', 'error', error); + }); + }, + + urlify : function (text) { + var urlRegex = /(https?:\/\/\S+)/g; + + var links = text.match(urlRegex); + + if (links) { + return links[0]; + } + + return Promise.reject(Error('Url is not matched')); + }, + + composeLinkPreview : function (json, currentBlock) { + if (json == {}) { + return; + } + + var previewBlock = ui.make(json); + + settings.currentInput.remove(); + + currentBlock.appendChild(previewBlock); + + currentBlock.classList.remove(settings.elementClasses.loader); + } + }; + + link_plugin.prepare = function (config) { + link_plugin.config = config; + + return Promise.resolve(); + }; + + /** + * Make initial header block + * @param {object} JSON with block data + * @return {Element} element to append + */ + link_plugin.makeNewBlock = function (data) { + var wrapper = ui.mainBlock(), + tag = ui.input(); + + settings.currentInput = tag; + + wrapper.appendChild(tag); + + wrapper.classList.add('ce-link'); + /** + * Bind callbacks + **/ + tag.addEventListener('paste', methods.blockPasteCallback, false); + tag.addEventListener('keydown', methods.blockKeyDownCallback, false); + + return wrapper; + }; + + /** + * Method to render HTML block from JSON + */ + link_plugin.render = function (json) { + if ( json ) { + var block = ui.mainBlock(), + tag = ui.make(json); + + block.classList.add('ce-link'); + block.appendChild(tag); + + return block; + } else { + var wrapper = ui.mainBlock(), + tag = ui.input(); + + settings.currentInput = tag; + + wrapper.appendChild(tag); + + wrapper.classList.add('ce-link'); + /** + * Bind callbacks + **/ + tag.addEventListener('paste', methods.blockPasteCallback, false); + tag.addEventListener('keydown', methods.blockKeyDownCallback, false); + + return wrapper; + } + }; + + link_plugin.validate = function (data) { + if (data.url.trim() == '' || data.title.trim() == '' || data.description.trim() == '') + return; + + return true; + }; + + /** + * Method to extract JSON data from HTML block + */ + link_plugin.save = function (blockContent) { + var linkElement = settings.elementClasses.link; + + var data = { + url : blockContent.querySelector('.' + linkElement).href, + shortLink : blockContent.querySelector('.' + linkElement).textContent || '', + image : blockContent.querySelector('.' + settings.elementClasses.image).src || '', + title : blockContent.querySelector('.' + settings.elementClasses.title).textContent || '', + description : blockContent.querySelector('.' + settings.elementClasses.description).textContent || '' + }; + + return data; + }; + + link_plugin.destroy = function () { + link = null; + }; + + return link_plugin; +})({}); diff --git a/plugins/list/list.css b/example/plugins/list/list.css similarity index 100% rename from plugins/list/list.css rename to example/plugins/list/list.css diff --git a/example/plugins/list/list.js b/example/plugins/list/list.js new file mode 100644 index 00000000..df356968 --- /dev/null +++ b/example/plugins/list/list.js @@ -0,0 +1,209 @@ +/** + * Code Plugin\ + * Creates code tag and adds content to this tag + */ +var list = (function (list_plugin) { + /** + * CSS class names + */ + var elementClasses_ = { + pluginWrapper: 'cdx-plugin-list', + li: 'cdx-plugin-list__li', + settings: 'cdx-plugin-list__settings', + settingsItem: 'cdx-plugin-settings__item' + }; + + var LIST_ITEM_TAG = 'LI'; + + var ui = { + + make: function (blockType) { + var wrapper = this.block(blockType || 'UL', elementClasses_.pluginWrapper); + + wrapper.dataset.type = blockType; + wrapper.contentEditable = true; + + wrapper.addEventListener('keydown', methods_.keyDown); + + return wrapper; + }, + + block: function (blockType, blockClass) { + var block = document.createElement(blockType); + + if (blockClass) block.classList.add(blockClass); + + return block; + }, + + button: function (buttonType) { + var types = { + unordered: 'Обычный', + ordered: 'Нумерованный' + }, + button = document.createElement('DIV'); + + button.innerHTML = types[buttonType]; + + button.classList.add(elementClasses_.settingsItem); + + return button; + } + }; + + var methods_ = { + + /** + * Changes block type => OL or UL + * @param event + * @param blockType + */ + changeBlockStyle : function (event, blockType) { + var currentBlock = codex.editor.content.currentNode, + newEditable = ui.make(blockType), + oldEditable = currentBlock.querySelector('[contenteditable]'); + + newEditable.dataset.type = blockType; + newEditable.innerHTML = oldEditable.innerHTML; + newEditable.classList.add(elementClasses_.pluginWrapper); + + codex.editor.content.switchBlock(currentBlock, newEditable, 'list'); + }, + keyDown: function (e) { + var controlKeyPressed = e.ctrlKey || e.metaKey, + keyCodeForA = 65; + + /** + * If CTRL+A (CMD+A) was pressed, we should select only one list item, + * not all
      or + */ + if (controlKeyPressed && e.keyCode == keyCodeForA) { + e.preventDefault(); + + /** + * Select
    1. content + */ + methods_.selectListItem(); + } + }, + + /** + * Select all content of
    2. with caret + */ + selectListItem : function () { + var selection = window.getSelection(), + currentSelectedNode = selection.anchorNode.parentNode, + range = new Range(); + + /** + * Search for
    3. element + */ + while ( currentSelectedNode && currentSelectedNode.tagName != LIST_ITEM_TAG ) { + currentSelectedNode = currentSelectedNode.parentNode; + } + + range.selectNodeContents(currentSelectedNode); + + selection.removeAllRanges(); + selection.addRange(range); + } + }; + + /** + * Method to render HTML block from JSON + */ + list_plugin.render = function (data) { + var type = data && (data.type == 'ordered' || data.type == 'OL') ? 'OL' : 'UL', + tag = ui.make(type), + newLi; + + if (data && data.items) { + data.items.forEach(function (element, index, array) { + newLi = ui.block('li', elementClasses_.li); + + newLi.innerHTML = element || ''; + + tag.appendChild(newLi); + }); + } else { + newLi = ui.block('li', elementClasses_.li); + + tag.appendChild(newLi); + } + + return tag; + }; + + list_plugin.validate = function (data) { + var isEmpty = data.items.every(function (item) { + return item.trim() === ''; + }); + + if (isEmpty) { + return; + } + + if (data.type != 'UL' && data.type != 'OL') { + console.warn('CodeX Editor List-tool: wrong list type passed %o', data.type); + return; + } + + return true; + }; + + /** + * Method to extract JSON data from HTML block + */ + list_plugin.save = function (blockContent) { + var data = { + type : null, + items : [] + }, + litsItemContent = '', + isEmptyItem = false; + + for (var index = 0; index < blockContent.childNodes.length; index++) { + litsItemContent = blockContent.childNodes[index].innerHTML; + isEmptyItem = !blockContent.childNodes[index].textContent.trim(); + + if (!isEmptyItem) { + data.items.push(litsItemContent); + } + } + + data.type = blockContent.dataset.type; + + return data; + }; + + list_plugin.makeSettings = function () { + var holder = document.createElement('DIV'); + + /** Add holder classname */ + holder.className = elementClasses_.settings; + + var orderedButton = ui.button('ordered'), + unorderedButton = ui.button('unordered'); + + orderedButton.addEventListener('click', function (event) { + methods_.changeBlockStyle(event, 'OL'); + codex.editor.toolbar.settings.close(); + }); + + unorderedButton.addEventListener('click', function (event) { + methods_.changeBlockStyle(event, 'UL'); + codex.editor.toolbar.settings.close(); + }); + + holder.appendChild(orderedButton); + holder.appendChild(unorderedButton); + + return holder; + }; + + list_plugin.destroy = function () { + list = null; + }; + + return list_plugin; +})({}); diff --git a/plugins/quote/img/codex.png b/example/plugins/quote/img/codex.png similarity index 100% rename from plugins/quote/img/codex.png rename to example/plugins/quote/img/codex.png diff --git a/plugins/quote/img/upload.png b/example/plugins/quote/img/upload.png similarity index 100% rename from plugins/quote/img/upload.png rename to example/plugins/quote/img/upload.png diff --git a/plugins/quote/quote.css b/example/plugins/quote/quote.css similarity index 100% rename from plugins/quote/quote.css rename to example/plugins/quote/quote.css diff --git a/example/plugins/quote/quote.js b/example/plugins/quote/quote.js new file mode 100644 index 00000000..61d1fba7 --- /dev/null +++ b/example/plugins/quote/quote.js @@ -0,0 +1,532 @@ +/** + * + * Quote plugin + */ + +var quote = (function (quote_plugin) { + /** + * @private + * + * CSS styles + */ + var elementClasses_ = { + + ce_quote : 'ce-quote', + quoteText : 'ce_quote--text', + quoteAuthor : 'ce_quote--author', + authorsJob : 'ce_quote--job', + authorsPhoto : 'authorsPhoto', + authorsPhotoWrapper : 'authorsPhoto-wrapper', + authorsPhotoWrapper_preview : 'authorsPhotoWrapper_preview', + + simple : { + text : 'quoteStyle-simple--text' + }, + + withCaption : { + blockquote : 'quoteStyle-withCaption--blockquote', + author : 'quoteStyle-withCaption--author' + }, + + withPhoto : { + photo : 'quoteStyle-withPhoto--photo', + author : 'quoteStyle-withPhoto--author', + job : 'quoteStyle-withPhoto--job', + quote : 'quoteStyle-withPhoto--quote', + wrapper : 'quoteStyle-withPhoto--wrapper', + authorHolder : 'quoteStyle-withPhoto--authorWrapper' + }, + + settings : { + holder : 'cdx-plugin-settings--horisontal', + caption : 'ce_plugin_quote--caption', + buttons : 'cdx-plugin-settings__item', + selectedType : 'ce-quote-settings--selected' + } + }; + + /** + * @private + * + * + */ + var methods_ = { + + changeStyleClicked : function () { + var changeStyleButton = this, + quote = codex.editor.content.currentNode.querySelector('.' + elementClasses_.ce_quote), + newStyle = changeStyleButton.dataset.style, + styleSelectors = this.parentNode.childNodes; + + quote.dataset.quoteStyle = newStyle; + + /** + * Mark selected style button + */ + for (var i = styleSelectors.length - 1; i >= 0; i--) { + styleSelectors[i].classList.remove(elementClasses_.settings.selectedType); + } + + this.classList.add(elementClasses_.settings.selectedType); + }, + + /** + * @deprecated + */ + selectTypeQuoteStyle : function (type) { + var quoteStyleFunction; + + /** + * Choose Quote style to replace + */ + switch (type) { + case 'simple': + quoteStyleFunction = methods_.makeSimpleQuote; + break; + case 'withCaption': + quoteStyleFunction = methods_.makeQuoteWithCaption; + break; + case 'withPhoto': + quoteStyleFunction = methods_.makeQuoteWithPhoto; + break; + } + + return quoteStyleFunction; + }, + + /** + * @deprecated + */ + addSelectTypeClickListener : function (el, quoteStyle) { + el.addEventListener('click', function () { + /** + * Parsing currentNode to JSON. + */ + var parsedOldQuote = methods_.parseBlockQuote(), + newStyledQuote = quoteStyle(parsedOldQuote); + + var wrapper = codex.editor.content.composeNewBlock(newStyledQuote, 'quote'); + + wrapper.appendChild(newStyledQuote); + + codex.editor.content.switchBlock(codex.editor.content.currentNode, newStyledQuote, 'quote'); + + /** Close settings after replacing */ + codex.editor.toolbar.settings.close(); + }, false); + }, + + /** + * @deprecated + */ + makeSimpleQuote : function (data) { + var wrapper = ui_.makeBlock('BLOCKQUOTE', [elementClasses_.simple.text, elementClasses_.quoteText]); + + wrapper.innerHTML = data.text || ''; + + wrapper.dataset.quoteStyle = 'simple'; + wrapper.classList.add(elementClasses_.ce_quote); + wrapper.contentEditable = 'true'; + + return wrapper; + }, + + /** + * @deprecated + */ + makeQuoteWithCaption : function (data) { + var wrapper = ui_.blockquote(), + text = ui_.makeBlock('DIV', [elementClasses_.withCaption.blockquote, elementClasses_.quoteText]), + author = ui_.makeBlock('DIV', [elementClasses_.withCaption.author, elementClasses_.quoteAuthor]); + + /* make text block ontentEditable */ + text.contentEditable = 'true'; + + text.innerHTML = data.text || ''; + + /* make Author contentEditable */ + author.contentEditable = 'true'; + + author.innerHTML = data.cite || ''; + + /* Appending created components */ + wrapper.dataset.quoteStyle = 'withCaption'; + wrapper.classList.add(elementClasses_.ce_quote); + + wrapper.appendChild(text); + wrapper.appendChild(author); + + return wrapper; + }, + + makeQuoteWithPhoto : function (data) { + var wrapper = ui_.blockquote(), + photo = ui_.makeBlock('DIV', [ elementClasses_.withPhoto.photo ]), + author = ui_.makeBlock('DIV', [elementClasses_.withPhoto.author, elementClasses_.quoteAuthor]), + job = ui_.makeBlock('DIV', [elementClasses_.withPhoto.job, elementClasses_.authorsJob]), + quote = ui_.makeBlock('DIV', [elementClasses_.withPhoto.quote, elementClasses_.quoteText]); + + /* Default Image src */ + if (!data.image) { + var icon = ui_.makeBlock('SPAN', [ 'ce-icon-picture' ]); + + photo.appendChild(icon); + } else { + var authorsPhoto = ui_.img(elementClasses_.authorsPhoto); + + authorsPhoto.src = data.image; + authorsPhoto.dataset.bigUrl = data.image; + + photo.classList.add(elementClasses_.authorsPhotoWrapper); + photo.appendChild(authorsPhoto); + } + + + photo.addEventListener('click', fileUploadClicked_, false); + + /* make author block contentEditable */ + author.contentEditable = 'true'; + author.innerHTML = data.cite || ''; + + /* Author's position and job */ + job.contentEditable = 'true'; + job.innerHTML = data.caption || ''; + + var authorsWrapper = ui_.makeBlock('DIV', [ elementClasses_.withPhoto.authorHolder ]); + + authorsWrapper.appendChild(author); + authorsWrapper.appendChild(job); + + /* make quote text contentEditable */ + quote.contentEditable = 'true'; + quote.innerHTML = data.text || ''; + + wrapper.classList.add(elementClasses_.ce_quote); + wrapper.classList.add(elementClasses_.withPhoto.wrapper); + wrapper.dataset.quoteStyle = 'withPhoto'; + + wrapper.appendChild(quote); + wrapper.appendChild(photo); + wrapper.appendChild(authorsWrapper); + + return wrapper; + }, + + parseBlockQuote : function (block) { + var currentNode = block || codex.editor.content.currentNode, + photo = currentNode.getElementsByTagName('img')[0], + author = currentNode.querySelector('.' + elementClasses_.quoteAuthor), + job = currentNode.querySelector('.' + elementClasses_.authorsJob), + quote ; + + /** Simple quote text placed in Blockquote tag*/ + if ( currentNode.dataset.quoteStyle == 'simple' ) { + quote = currentNode.innerHTML || ''; + } else { + quote = currentNode.querySelector('.' + elementClasses_.quoteText).innerHTML; + } + + if (job) { + job = job.innerHTML || ''; + } + + if (author) { + author = author.innerHTML || ''; + } + + if (photo) { + photo = photo.dataset.bigUrl; + } + + var data = { + style : currentNode.dataset.quoteStyle, + text : quote, + author : author, + job : job, + photo : photo + }; + + return data; + } + }; + + /** + * @private + * + * Author image Uploader + */ + var fileUploadClicked_ = function () { + var beforeSend = photoUploadingCallbacks_.beforeSend, + success = photoUploadingCallbacks_.success, + error = photoUploadingCallbacks_.error; + + codex.editor.transport.selectAndUpload({ + beforeSend: beforeSend, + success: success, + error: error + }); + }; + + /** + * @private + * + */ + var ui_ = { + + wrapper : function ($classList) { + var el = document.createElement('DIV'); + + el.classList.add($classList); + + return el; + }, + + blockquote : function () { + var el = document.createElement('BLOCKQUOTE'); + + return el; + }, + + img : function (attribute) { + var imageTag = document.createElement('IMG'); + + imageTag.classList.add(attribute); + + return imageTag; + }, + + makeBlock : function (tag, classList) { + var el = document.createElement(tag); + + if ( classList ) { + for( var i = 0; i < classList.length; i++) + el.className += ' ' + classList[i]; + } + + return el; + } + + }; + + + + /** + * @private + * + * Callbacks + */ + var photoUploadingCallbacks_ = { + + preview_ : function (e) { + var uploadImageWrapper = codex.editor.content.currentNode.querySelector('.' + elementClasses_.withPhoto.photo), + authorsPhoto = ui_.img(elementClasses_.authorsPhoto); + + /** Appending uploaded image */ + uploadImageWrapper.classList.add(elementClasses_.authorsPhotoWrapper, elementClasses_.authorsPhotoWrapper_preview); + + authorsPhoto.src = e.target.result; + + /** Remove icon from image wrapper */ + uploadImageWrapper.innerHTML = ''; + + uploadImageWrapper.appendChild(authorsPhoto); + }, + + beforeSend : function () { + var input = codex.editor.transport.input, + files = input.files, + file = files[0], + fileReader = new FileReader(); + + fileReader.readAsDataURL(file); + + fileReader.onload = photoUploadingCallbacks_.preview_; + }, + + /** + * Success callbacks for uploaded photo. + * Replace upload icon with uploaded photo + */ + success : function (result) { + var parsed = JSON.parse(result), + filename = parsed.filename, + uploadImageWrapper = codex.editor.content.currentNode.querySelector('.' + elementClasses_.withPhoto.photo); + + var img = uploadImageWrapper.querySelector('IMG'); + + img.src = parsed.data.file.bigUrl; + img.dataset.bigUrl = parsed.data.file.bigUrl; + + uploadImageWrapper.classList.remove(elementClasses_.authorsPhotoWrapper_preview); + }, + + /** Error callback. Sends notification to user that something happend or plugin doesn't supports method */ + error : function (result) { + console.log('Can\'t upload an image'); + } + + }; + + /** + * @private + * + * Make Quote from JSON datasets + */ + var make_ = function (data) { + var tag; + + if (data && data.size) { + data.style = quote_plugin.config.defaultStyle; + + /** + * Supported types + */ + switch (data.style) { + case 'simple': + tag = methods_.makeSimpleQuote(data); + break; + case 'withCaption': + tag = methods_.makeQuoteWithCaption(data); + break; + case 'withPhoto': + tag = methods_.makeQuoteWithPhoto(data); + break; + } + + tag.dataset.quoteStyle = data.size; + } else { + var settings = { + 'text' : null, + 'format' : 'html', + 'cite' : null, + 'caption': null, + 'size' : null, + 'image' : null + }; + + tag = methods_.makeQuoteWithPhoto(settings); + } + + return tag; + }; + + var prepareDataForSave_ = function (data) { + if (data.size == 'withPhoto') { + data.size = 'small'; + } + + /** Make paragraphs */ + data.text = codex.editor.content.wrapTextWithParagraphs(data.text); + + return data; + }; + + /** + * @public + * + * Renderer + * + * @param data + */ + quote_plugin.render = function (data) { + return make_(data); + }; + + quote_plugin.validate = function (output) { + if (typeof output.text != 'string') { + return; + } + + return output; + }; + + quote_plugin.save = function (blockContent) { + /** + * Extracts JSON quote data from HTML block + * @param {Text} text, {Text} author, {Object} photo + */ + var parsedblock = methods_.parseBlockQuote(blockContent); + + var outputData = { + 'text' : parsedblock.text, + 'format' : 'html', + 'cite' : parsedblock.author || '', + 'caption': parsedblock.job || '', + 'size' : parsedblock.style, + 'image' : parsedblock.photo + }; + + return prepareDataForSave_(outputData); + }; + + /** + * @public + * + * Draws settings + */ + quote_plugin.makeSettings = function (data) { + var holder = document.createElement('DIV'), + types = { + big : 'По центру', + small : 'Врезка' + }, + selectTypeButton; + + /** Add holder classname */ + holder.className = elementClasses_.settings.holder; + + /** Now add type selectors */ + for (var type in types) { + selectTypeButton = document.createElement('SPAN'); + + selectTypeButton.textContent = types[type]; + selectTypeButton.className = elementClasses_.settings.buttons; + + selectTypeButton.dataset.style = type; + + if ( type == quote_plugin.config.defaultStyle ) { + selectTypeButton.classList.add(quoteTools.styles.settings.selectedType); + } + + // var quoteStyle = quoteTools.selectTypeQuoteStyle(type); + + selectTypeButton.addEventListener('click', methods_.changeStyleClicked, false); + // quoteTools.addSelectTypeClickListener(selectTypeButton, quoteStyle); + + holder.appendChild(selectTypeButton); + } + + return holder; + }; + + /** + * @public + * Default path to redactors images + * @type {null} + */ + quote_plugin.path = null; + + /** + * @public + * + * @type {null} + */ + quote_plugin.config = null; + + /** + * @public + * + * @param config + */ + quote_plugin.prepare = function (config) { + quote_plugin.config = config; + + return Promise.resolve(); + }; + + quote_plugin.destroy = function () { + quote = null; + }; + + return quote_plugin; +})({}); \ No newline at end of file diff --git a/plugins/raw/raw-icon-black.svg b/example/plugins/raw/raw-icon-black.svg similarity index 100% rename from plugins/raw/raw-icon-black.svg rename to example/plugins/raw/raw-icon-black.svg diff --git a/plugins/raw/raw-icon-white.svg b/example/plugins/raw/raw-icon-white.svg similarity index 100% rename from plugins/raw/raw-icon-white.svg rename to example/plugins/raw/raw-icon-white.svg diff --git a/plugins/raw/raw.css b/example/plugins/raw/raw.css similarity index 100% rename from plugins/raw/raw.css rename to example/plugins/raw/raw.css diff --git a/example/plugins/raw/raw.js b/example/plugins/raw/raw.js new file mode 100644 index 00000000..1818f409 --- /dev/null +++ b/example/plugins/raw/raw.js @@ -0,0 +1,39 @@ +/** +* Plugin for CodeX.Editor +* Implements RAW-data block +*/ +var rawPlugin = function (plugin) { + var editor = codex.editor; + + plugin.render = function (data) { + var input = editor.draw.node('TEXTAREA', 'raw-plugin__input', {}); + + input.placeholder = 'Вставьте HTML код'; + + if (data && data.raw) { + input.value = data.raw; + } + + return input; + }; + + plugin.save = function (block) { + return { + raw: block.value + }; + }; + + plugin.validate = function (data) { + if (data.raw.trim() === '') { + return; + } + + return true; + }; + + plugin.destroy = function () { + rawPlugin = null; + }; + + return plugin; +}({}); \ No newline at end of file diff --git a/plugins/paragraph/paragraph.css b/example/plugins/text/text.css similarity index 73% rename from plugins/paragraph/paragraph.css rename to example/plugins/text/text.css index 7651db45..61573ed9 100644 --- a/plugins/paragraph/paragraph.css +++ b/example/plugins/text/text.css @@ -2,11 +2,21 @@ * Empty paragraph placeholder */ -.ce-paragraph { - padding: 0.7em 0 !important; - line-height: 1.7em; +.ce-text { + padding: 10px 0; + line-height: 1.6em; + outline: none; } +.ce-text p:first-of-type { + margin-top: 0; +} + +.ce-text p:last-of-type { + margin-bottom: 0; +} + + .ce-paragraph:empty::before, .ce-paragraph p:empty::before{ content : attr(data-placeholder); @@ -31,4 +41,4 @@ } .ce-paragraph p:last-of-type{ margin-bottom: 0; -} \ No newline at end of file +} diff --git a/example/plugins/text/text.js b/example/plugins/text/text.js new file mode 100644 index 00000000..21df6eea --- /dev/null +++ b/example/plugins/text/text.js @@ -0,0 +1,171 @@ +/** + * Base Text block for the CodeX Editor. + * Represents simple paragraph + * + * @author CodeX Team (team@ifmo.su) + * @copyright CodeX Team 2017 + * @license The MIT License (MIT) + * @version 2.0.1 + */ + + /** + * @typedef {Object} TextData + * @description Tool's input and output data format + * @property {String} text — Paragraph's content. Can include HTML tags: + */ +class Text { + /** + * Should this tools be displayed at the Editor's Toolbox + * @returns {boolean} + * @public + */ + static get displayInToolbox() { + return false; + } + + /** + * Class for the Toolbox icon + * @returns {string} + * @public + */ + static get iconClassName() { + return 'cdx-text-icon'; + } + + /** + * Render plugin`s main Element and fill it with saved data + * @param {TextData} savedData — previously saved data + */ + constructor(savedData = {}) { + this._CSS = { + wrapper: 'ce-text' + }; + + this._data = {}; + this._element = this.drawView(); + + this.data = savedData; + } + + /** + * Create Tool's view + * @return {HTMLElement} + * @private + */ + drawView() { + let div = document.createElement('DIV'); + + div.classList.add(this._CSS.wrapper); + div.contentEditable = true; + + return div; + } + + /** + * Return Tool's view + * @returns {HTMLDivElement} + * @public + */ + render() { + return this._element; + } + + /** + * Method that specified how to merge two Text blocks. + * Called by CodeX Editor by backspace at the beginning of the Block + * @param {TextData} data + * @public + */ + merge(data) { + let newData = { + text : this.data.text + data.text + }; + + this.data = newData; + } + + /** + * Validate Text block data: + * - check for emptiness + * + * @param {TextData} savedData — data received after saving + * @returns {boolean} false if saved data is not correct, otherwise true + * @public + */ + validate(savedData) { + if (savedData.text.trim() === '') { + return false; + } + + return true; + } + + /** + * Extract Tool's data from the view + * @param {HTMLDivElement} toolsContent - Text tools rendered view + * @returns {TextData} - saved data + * @public + */ + save(toolsContent) { + /** + * @todo sanitize data + */ + + return { + text: toolsContent.innerHTML + }; + } + + /** + * Get current Tools`s data + * @returns {TextData} Current data + * @private + */ + get data() { + let text = this._element.innerHTML; + + this._data.text = text; + + return this._data; + } + + /** + * Store data in plugin: + * - at the this._data property + * - at the HTML + * + * @param {TextData} data — data to set + * @private + */ + set data(data) { + this._data = data || {}; + + this._element.innerHTML = this._data.text || ''; + } + + /** + * Handle pasted DIV and P tags. + * + * @private + * @param {HTMLElement} content - pasted element + * @returns {{text: string}} + */ + static onPasteHandler(content) { + return { + text: content.innerHTML + }; + } + + /** + * Used by Codex Editor paste handling API. + * Provides configuration to handle DIV and P tags. + * + * @returns {{handler: (function(HTMLElement): {text: string}), tags: string[]}} + */ + static get onPaste() { + return { + handler: Text.onPasteHandler, + tags: ['P', 'DIV'] + }; + } +} diff --git a/plugins/twitter/twitter.css b/example/plugins/twitter/twitter.css similarity index 100% rename from plugins/twitter/twitter.css rename to example/plugins/twitter/twitter.css diff --git a/example/plugins/twitter/twitter.js b/example/plugins/twitter/twitter.js new file mode 100644 index 00000000..84fe5dbe --- /dev/null +++ b/example/plugins/twitter/twitter.js @@ -0,0 +1,259 @@ +/** + * Twitter plugin + * @version 1.0.0 + */ + +var twitter = (function (twitter_plugin) { + /** + * User's configuration object + */ + var config_ = {}; + + /** + * CSS classes + */ + var css_ = { + pluginWrapper : 'cdx-tweet' + }; + + var methods = { + + /** + * Twitter render method appends content after block + * @param tweetId + */ + twitter : function (data, twitterBlock) { + var tweet = methods.drawTwitterHolder(), + twittersCaption = methods.drawTwittersCaptionBlock(); + + if (data.caption) { + twittersCaption.innerHTML = data.caption; + } + + /** + * add created tweet to holder + */ + tweet.appendChild(twitterBlock); + + // setTimeout(function() { + window.twttr.widgets.createTweet(data.id_str, twitterBlock).then(tweetInsertedCallback_); + // }, 1000); + + tweet.classList.add('ce-redactor__loader'); + + if (codex.editor.content.currentNode) { + tweet.dataset.statusUrl = data.status_url; + codex.editor.content.switchBlock(codex.editor.content.currentNode, tweet, 'tweet'); + } + + /** + * in case if we need extra data + */ + if ( !data.user ) { + codex.editor.core.ajax({ + url : config_.fetchUrl + '?tweetId=' + data.id_str, + type: 'GET', + success: function (result) { + methods.saveTwitterData(result, tweet); + } + }); + } else { + tweet.dataset.profileImageUrl = data.user.profile_image_url; + tweet.dataset.profileImageUrlHttps = data.user.profile_image_url_https; + tweet.dataset.screenName = data.user.screen_name; + tweet.dataset.name = data.user.name; + tweet.dataset.id = +data.id; + tweet.dataset.idStr = data.id_str; + tweet.dataset.text = data.text; + tweet.dataset.createdAt = data.created_at; + tweet.dataset.statusUrl = data.status_url; + tweet.dataset.media = data.media; + + tweet.classList.remove('ce-redactor__loader'); + } + + /** + * add caption to tweet + */ + setTimeout(function () { + tweet.appendChild(twittersCaption); + }, 1000); + + return tweet; + }, + + drawTwitterHolder : function () { + var block = document.createElement('DIV'); + + block.classList.add(css_.pluginWrapper); + + return block; + }, + + drawTwitterBlock : function () { + var block = codex.editor.draw.node('DIV', '', { height: '20px' }); + + return block; + }, + + drawTwittersCaptionBlock : function () { + var block = codex.editor.draw.node('DIV', [ 'ce-twitter__caption' ], { contentEditable : true }); + + return block; + }, + + saveTwitterData : function (result, tweet) { + var data = JSON.parse(result), + twitterContent = tweet; + + setTimeout(function () { + /** + * Save twitter data via data-attributes + */ + twitterContent.dataset.profileImageUrl = data.user.profile_image_url; + twitterContent.dataset.profileImageUrlHttps = data.user.profile_image_url_https; + twitterContent.dataset.screenName = data.user.screen_name; + twitterContent.dataset.name = data.user.name; + twitterContent.dataset.id = +data.id; + twitterContent.dataset.idStr = data.id_str; + twitterContent.dataset.text = data.text; + twitterContent.dataset.createdAt = data.created_at; + twitterContent.dataset.media = data.entities.urls.length > 0 ? 'false' : 'true'; + }, 50); + } + }; + + /** + * @private + * Fires after tweet widget rendered + */ + function tweetInsertedCallback_(widget) { + var pluginWrapper = findParent_( widget, css_.pluginWrapper ); + + pluginWrapper.classList.remove('ce-redactor__loader'); + } + + /** + * @private + * Find closiest parent Element with CSS class + */ + function findParent_(el, cls) { + while ((el = el.parentElement) && !el.classList.contains(cls)); + return el; + } + + /** + * Prepare twitter scripts + * @param {object} config + */ + twitter_plugin.prepare = function (config) { + /** + * Save configs + */ + config_ = config; + + return new Promise(function (resolve, reject) { + codex.editor.core.importScript('https://platform.twitter.com/widgets.js', 'twitter-api').then(function () { + resolve(); + }).catch(function () { + reject(Error('Twitter API was not loaded')); + }); + }); + }; + + /** + * @private + * + * @param data + * @returns {*} + */ + make_ = function (data) { + if (!data.id || !data.status_url) + return; + + if (!data.id_str) { + data.id_str = data.status_url.match(/[^\/]+$/)[0]; + } + + var twitterBlock = methods.drawTwitterBlock(); + + var tweet = methods.twitter(data, twitterBlock); + + return tweet; + }; + + twitter_plugin.validate = function (data) { + return true; + }; + + twitter_plugin.save = function (blockContent) { + var data, + caption = blockContent.querySelector('.ce-twitter__caption'); + + data = { + media:blockContent.dataset.media, + conversation:false, + user:{ + profile_image_url: blockContent.dataset.profileImageUrl, + profile_image_url_https: blockContent.dataset.profileImageUrlHttps, + screen_name: blockContent.dataset.screenName, + name: blockContent.dataset.name + }, + id: blockContent.dataset.id || blockContent.dataset.tweetId, + id_str : blockContent.dataset.idStr, + text: blockContent.dataset.text, + created_at: blockContent.dataset.createdAt, + status_url: blockContent.dataset.statusUrl, + caption: caption.innerHTML || '' + }; + + return data; + }; + + twitter_plugin.render = function (data) { + return make_(data); + }; + + twitter_plugin.urlPastedCallback = function (url) { + var tweetId, + arr, + data; + + arr = url.split('/'); + tweetId = arr.pop(); + + /** Example */ + data = { + 'media' : true, + 'conversation' : false, + 'user' : null, + 'id' : +tweetId, + 'text' : null, + 'created_at' : null, + 'status_url' : url, + 'caption' : null + }; + + make_(data); + }; + + twitter_plugin.pastePatterns = [ + { + type: 'twitter', + regex: /http?.+twitter.com?.+\//, + callback: twitter_plugin.urlPastedCallback + } + ]; + + twitter_plugin.destroy = function () { + twitter = null; + delete window.twttr; + }; + + return twitter_plugin; +})({}); + + + + + diff --git a/example/tools-inline/term/term-blue.svg b/example/tools-inline/term/term-blue.svg new file mode 100644 index 00000000..9beceab2 --- /dev/null +++ b/example/tools-inline/term/term-blue.svg @@ -0,0 +1,3 @@ + + + diff --git a/example/tools-inline/term/term.css b/example/tools-inline/term/term.css new file mode 100644 index 00000000..52e1cf7e --- /dev/null +++ b/example/tools-inline/term/term.css @@ -0,0 +1,23 @@ +/** + * Styles for the Term tool + * + * CodeX Editor Inline Toolbar plugin + */ +.ce-term-tool__icon { + background: url('term.svg') no-repeat center center; +} + +.ce-term-tool__icon--active { + background-image: url('term-blue.svg'); +} + + +.marked { + background: rgba(251,241,241,0.78); + color: #C44545; + padding: 4px 6px; + border-radius: 2px; + margin: 0 2px; + font-family: Menlo, Monaco, Consolas, Courier New, monospace; + font-size: 0.9em; +} diff --git a/example/tools-inline/term/term.js b/example/tools-inline/term/term.js new file mode 100644 index 00000000..5cc28ec3 --- /dev/null +++ b/example/tools-inline/term/term.js @@ -0,0 +1,156 @@ +/** + * Term plugin for the CodeX Editor + * + * Allows to wrap inline fragment and style it somehow. + */ +class Term { + /** + * @param {object} api - CodeX Editor API + */ + constructor(api) { + this.api = api; + + /** + * Toolbar Button + * + * @type {HTMLElement|null} + */ + this.button = null; + + /** + * Tag represented the term + * + * @type {string} + */ + this.tag = 'SPAN'; + + /** + * Class name for term-tag + * + * @type {string} + */ + this.CSS = 'marked'; + + /** + * CSS classes + */ + this.iconClasses = { + base: 'ce-inline-tool', + term: 'ce-term-tool__icon', + active: 'ce-term-tool__icon--active' + }; + } + + /** + * Specifies Tool as Inline Toolbar Tool + * + * @return {boolean} + */ + static get isInline() { + return true; + } + + /** + * Create button element for Toolbar + * + * @return {HTMLElement} + */ + render() { + this.button = document.createElement('button'); + this.button.classList.add(this.iconClasses.base, this.iconClasses.term); + + return this.button; + } + + /** + * Wrap/Unwrap selected fragment + * + * @param {Range} range - selected fragment + */ + surround(range) { + if (!range) { + return; + } + + let termWrapper = this.api.selection.findParentTag(this.tag, this.CSS); + + /** + * If start or end of selection is in the highlighted block + */ + if (termWrapper) { + this.unwrap(termWrapper); + } else { + this.wrap(range); + } + } + + /** + * Wrap selection with term-tag + * + * @param {Range} range - selected fragment + */ + wrap(range) { + /** + * Create a wrapper for highlighting + */ + let span = document.createElement(this.tag); + + span.classList.add(this.CSS); + + /** + * SurroundContent throws an error if the Range splits a non-Text node with only one of its boundary points + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Range/surroundContents} + * + * // range.surroundContents(span); + */ + span.appendChild(range.extractContents()); + range.insertNode(span); + + /** + * Expand (add) selection to highlighted block + */ + this.api.selection.expandToTag(span); + } + + /** + * Unwrap term-tag + * + * @param {HTMLElement} termWrapper - term wrapper tag + */ + unwrap(termWrapper) { + /** + * Expand selection to all term-tag + */ + this.api.selection.expandToTag(termWrapper); + + let sel = window.getSelection(); + let range = sel.getRangeAt(0); + + let unwrappedContent = range.extractContents(); + + /** + * Remove empty term-tag + */ + termWrapper.parentNode.removeChild(termWrapper); + + /** + * Insert extracted content + */ + range.insertNode(unwrappedContent); + + /** + * Restore selection + */ + sel.removeAllRanges(); + sel.addRange(range); + } + + /** + * Check and change Term's state for current selection + */ + checkState() { + const termTag = this.api.selection.findParentTag(this.tag, this.CSS); + + this.button.classList.toggle(this.iconClasses.active, !!termTag); + } +} diff --git a/example/tools-inline/term/term.svg b/example/tools-inline/term/term.svg new file mode 100644 index 00000000..6599234e --- /dev/null +++ b/example/tools-inline/term/term.svg @@ -0,0 +1,3 @@ + + + diff --git a/fonts/codex_editor/codex-editor.eot b/fonts/codex_editor/codex-editor.eot deleted file mode 100755 index 723ad6ab..00000000 Binary files a/fonts/codex_editor/codex-editor.eot and /dev/null differ diff --git a/fonts/codex_editor/codex-editor.svg b/fonts/codex_editor/codex-editor.svg deleted file mode 100755 index 1ae6cabc..00000000 --- a/fonts/codex_editor/codex-editor.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - -Copyright (C) 2016 by original authors @ fontello.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fonts/codex_editor/codex-editor.ttf b/fonts/codex_editor/codex-editor.ttf deleted file mode 100755 index e6c70265..00000000 Binary files a/fonts/codex_editor/codex-editor.ttf and /dev/null differ diff --git a/fonts/codex_editor/codex-editor.woff b/fonts/codex_editor/codex-editor.woff deleted file mode 100755 index 5ad5eaa5..00000000 Binary files a/fonts/codex_editor/codex-editor.woff and /dev/null differ diff --git a/fonts/codex_editor/codex-editor.woff2 b/fonts/codex_editor/codex-editor.woff2 deleted file mode 100755 index 15066535..00000000 Binary files a/fonts/codex_editor/codex-editor.woff2 and /dev/null differ diff --git a/fonts/codex_editor/icon-hash.svg b/fonts/codex_editor/icon-hash.svg deleted file mode 100644 index 60790072..00000000 --- a/fonts/codex_editor/icon-hash.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/fonts/codex_editor/icon-plus.svg b/fonts/codex_editor/icon-plus.svg deleted file mode 100644 index fdc0776c..00000000 --- a/fonts/codex_editor/icon-plus.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - Combined Shape - Created with Sketch. - - - - - - - - - - - \ No newline at end of file diff --git a/icons.css b/icons.css deleted file mode 100644 index b8914486..00000000 --- a/icons.css +++ /dev/null @@ -1,63 +0,0 @@ -@font-face { - font-family: 'codex_editor'; - src: url('fonts/codex_editor/codex-editor.eot?20895205'); - src: url('fonts/codex_editor/codex-editor.eot?20895205#iefix') format('embedded-opentype'), - url('fonts/codex_editor/codex-editor.woff?20895205') format('woff'), - url('fonts/codex_editor/codex-editor.ttf?20895205') format('truetype'), - url('fonts/codex_editor/codex-editor.svg?20895205#codex_editor') format('svg'); - font-weight: normal; - font-style: normal; -} -[class^="ce-icon-"]:before, -[class*="ce-icon-"]:before { - font-family: "codex_editor"; - font-style: normal; - font-weight: normal; - speak: none; - - display: inline-block; - text-decoration: inherit; - width: 1em; - margin-right: .2em; - text-align: center; - font-variant: normal; - text-transform: none; - - line-height: 1em; - - /* Animation center compensation - margins should be symmetric */ - margin-left: .2em; - - -moz-osx-font-smoothing: grayscale; -} -.ce-icon-instagram:before { content: '\e800'; } /* '' */ -.ce-icon-picture:before { content: '\e801'; } /* '' */ -.ce-icon-cog:before { content: '\e802'; } /* '' */ -.ce-icon-link:before { content: '\e803'; } /* '' */ -.ce-icon-unlink:before { content: '\e804'; } /* '' */ -.ce-icon-code:before { content: '\e805'; } /* '' */ -.ce-icon-quote:before { content: '\e806'; } /* '' */ -.ce-icon-trash:before { content: '\e807'; } /* '' */ -.ce-icon-down-big:before { content: '\e808'; } /* '' */ -.ce-icon-up-big:before { content: '\e809'; } /* '' */ -.ce-icon-header:before { content: '\e80a'; } /* '' */ -.ce-icon-paragraph:before { content: '\e80b'; } /* '' */ -.ce-icon-align-left:before { content: '\e80c'; } /* '' */ -.ce-icon-align-center:before { content: '\e80d'; } /* '' */ -.ce-icon-align-right:before { content: '\e80e'; } /* '' */ -.ce-icon-font:before { content: '\e80f'; } /* '' */ -.ce-icon-bold:before { content: '\e810'; } /* '' */ -.ce-icon-medium:before { content: '\e811'; } /* '' */ -.ce-icon-italic:before { content: '\e812'; } /* '' */ -.ce-icon-list-bullet:before { content: '\e813'; } /* '' */ -.ce-icon-list-numbered:before { content: '\e814'; } /* '' */ -.ce-icon-strike:before { content: '\e815'; } /* '' */ -.ce-icon-underline:before { content: '\e816'; } /* '' */ -.ce-icon-table:before { content: '\e817'; } /* '' */ -.ce-icon-ellipsis-vert:before { content: '\e818'; } /* '' */ -.ce-icon-columns:before { content: '\e819'; } /* '' */ -.ce-icon-smile:before { content: '\e81a'; } /* '' */ -.ce-icon-newspaper:before { content: '\e81b'; } /* '' */ -.ce-icon-twitter:before { content: '\e81c'; } /* '' */ -.ce-icon-facebook-squared:before { content: '\e81d'; } /* '' */ -.ce-icon-vkontakte:before { content: '\e81e'; } /* '' */ diff --git a/modules/anchors.js b/modules/anchors.js deleted file mode 100644 index d72deaa4..00000000 --- a/modules/anchors.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Codex Editor Anchors module - * - * @author Codex Team - * @version 1.0 - */ - -module.exports = function (anchors) { - - let editor = codex.editor; - - anchors.input = null; - anchors.currentNode = null; - - anchors.settingsOpened = function (currentBlock) { - - anchors.currentNode = currentBlock; - anchors.input.value = anchors.currentNode.dataset.anchor || ''; - - }; - - anchors.anchorChanged = function (e) { - - var newAnchor = e.target.value = anchors.rusToTranslit(e.target.value); - - anchors.currentNode.dataset.anchor = newAnchor; - - if (newAnchor.trim() !== '') { - - anchors.currentNode.classList.add(editor.ui.className.BLOCK_WITH_ANCHOR); - - } else { - - anchors.currentNode.classList.remove(editor.ui.className.BLOCK_WITH_ANCHOR); - - } - - }; - - anchors.keyDownOnAnchorInput = function (e) { - - if (e.keyCode == editor.core.keys.ENTER) { - - e.preventDefault(); - e.stopPropagation(); - - e.target.blur(); - editor.toolbar.settings.close(); - - } - - }; - - anchors.keyUpOnAnchorInput = function (e) { - - if (e.keyCode >= editor.core.keys.LEFT && e.keyCode <= editor.core.keys.DOWN) { - - e.stopPropagation(); - - } - - }; - - anchors.rusToTranslit = function (string) { - - var ru = [ - 'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', - 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', - 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ь', 'Ы', 'Ь', 'Э', 'Ю', 'Я' - ], - en = [ - 'A', 'B', 'V', 'G', 'D', 'E', 'E', 'Zh', 'Z', 'I', 'Y', - 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', - 'H', 'C', 'Ch', 'Sh', 'Sch', '', 'Y', '', 'E', 'Yu', 'Ya' - ]; - - for (var i = 0; i < ru.length; i++) { - - string = string.split(ru[i]).join(en[i]); - string = string.split(ru[i].toLowerCase()).join(en[i].toLowerCase()); - - } - - string = string.replace(/[^0-9a-zA-Z_]+/g, '-'); - - return string; - - }; - - return anchors; - -}({}); \ No newline at end of file diff --git a/modules/callbacks.js b/modules/callbacks.js deleted file mode 100644 index 443759ba..00000000 --- a/modules/callbacks.js +++ /dev/null @@ -1,911 +0,0 @@ -/** - * @module Codex Editor Callbacks module - * @description Module works with editor added Elements - * - * @author Codex Team - * @version 1.4.0 - */ - -module.exports = (function (callbacks) { - - let editor = codex.editor; - - /** - * used by UI module - * @description Routes all keydowns on document - * @param {Object} event - */ - callbacks.globalKeydown = function (event) { - - switch (event.keyCode) { - case editor.core.keys.ENTER : enterKeyPressed_(event); break; - } - - }; - - /** - * used by UI module - * @description Routes all keydowns on redactors area - * @param {Object} event - */ - callbacks.redactorKeyDown = function (event) { - - switch (event.keyCode) { - case editor.core.keys.TAB : tabKeyPressedOnRedactorsZone_(event); break; - case editor.core.keys.ENTER : enterKeyPressedOnRedactorsZone_(event); break; - case editor.core.keys.ESC : escapeKeyPressedOnRedactorsZone_(event); break; - default : defaultKeyPressedOnRedactorsZone_(event); break; - } - - }; - - /** - * used by UI module - * @description Routes all keyup events - * @param {Object} event - */ - callbacks.globalKeyup = function (event) { - - switch (event.keyCode) { - case editor.core.keys.UP : - case editor.core.keys.LEFT : - case editor.core.keys.RIGHT : - case editor.core.keys.DOWN : arrowKeyPressed_(event); break; - } - - }; - - /** - * @param {Object} event - * @private - * - * Handles behaviour when tab pressed - * @description if Content is empty show toolbox (if it is closed) or leaf tools - * uses Toolbars toolbox module to handle the situation - */ - var tabKeyPressedOnRedactorsZone_ = function (event) { - - /** - * Wait for solution. Would like to know the behaviour - * @todo Add spaces - */ - event.preventDefault(); - - - if (!editor.core.isBlockEmpty(editor.content.currentNode)) { - - return; - - } - - if ( !editor.toolbar.opened ) { - - editor.toolbar.open(); - - } - - if (editor.toolbar.opened && !editor.toolbar.toolbox.opened) { - - editor.toolbar.toolbox.open(); - - } else { - - editor.toolbar.toolbox.leaf(); - - } - - }; - - /** - * Handles global EnterKey Press - * @see enterPressedOnBlock_ - * @param {Object} event - */ - var enterKeyPressed_ = function () { - - if (editor.content.editorAreaHightlighted) { - - /** - * it means that we lose input index, saved index before is not correct - * therefore we need to set caret when we insert new block - */ - editor.caret.inputIndex = -1; - - enterPressedOnBlock_(); - - } - - }; - - /** - * Callback for enter key pressing in first-level block area - * - * @param {Event} event - * @private - * - * @description Inserts new block with initial type from settings - */ - var enterPressedOnBlock_ = function () { - - var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; - - editor.content.insertBlock({ - type : NEW_BLOCK_TYPE, - block : editor.tools[NEW_BLOCK_TYPE].render() - }, true ); - - editor.toolbar.move(); - editor.toolbar.open(); - - }; - - - /** - * ENTER key handler - * - * @param {Object} event - * @private - * - * @description Makes new block with initial type from settings - */ - var enterKeyPressedOnRedactorsZone_ = function (event) { - - if (event.target.contentEditable == 'true') { - - /** Update input index */ - editor.caret.saveCurrentInputIndex(); - - } - - var currentInputIndex = editor.caret.getCurrentInputIndex() || 0, - workingNode = editor.content.currentNode, - tool = workingNode.dataset.tool, - isEnterPressedOnToolbar = editor.toolbar.opened && - editor.toolbar.current && - event.target == editor.state.inputs[currentInputIndex]; - - /** The list of tools which needs the default browser behaviour */ - var enableLineBreaks = editor.tools[tool].enableLineBreaks; - - /** This type of block creates when enter is pressed */ - var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; - - /** - * When toolbar is opened, select tool instead of making new paragraph - */ - if ( isEnterPressedOnToolbar ) { - - event.preventDefault(); - - editor.toolbar.toolbox.toolClicked(event); - - editor.toolbar.close(); - - /** - * Stop other listeners callback executions - */ - event.stopPropagation(); - event.stopImmediatePropagation(); - - return; - - } - - /** - * Allow paragraph lineBreaks with shift enter - * Or if shiftkey pressed and enter and enabledLineBreaks, the let new block creation - */ - if ( event.shiftKey || enableLineBreaks ) { - - event.stopPropagation(); - event.stopImmediatePropagation(); - return; - - } - - var currentSelection = window.getSelection(), - currentSelectedNode = currentSelection.anchorNode, - caretAtTheEndOfText = editor.caret.position.atTheEnd(), - isTextNodeHasParentBetweenContenteditable = false; - - /** - * Allow making new

      in same block by SHIFT+ENTER and forbids to prevent default browser behaviour - */ - if ( event.shiftKey && !enableLineBreaks ) { - - editor.callback.enterPressedOnBlock(editor.content.currentBlock, event); - event.preventDefault(); - return; - - } - - /** - * Workaround situation when caret at the Text node that has some wrapper Elements - * Split block cant handle this. - * We need to save default behavior - */ - isTextNodeHasParentBetweenContenteditable = currentSelectedNode && currentSelectedNode.parentNode.contentEditable != 'true'; - - /** - * Split blocks when input has several nodes and caret placed in textNode - */ - if ( - currentSelectedNode.nodeType == editor.core.nodeTypes.TEXT && - !isTextNodeHasParentBetweenContenteditable && - !caretAtTheEndOfText - ) { - - event.preventDefault(); - - editor.core.log('Splitting Text node...'); - - editor.content.splitBlock(currentInputIndex); - - /** Show plus button when next input after split is empty*/ - if (!editor.state.inputs[currentInputIndex + 1].textContent.trim()) { - - editor.toolbar.showPlusButton(); - - } - - } else { - - var islastNode = editor.content.isLastNode(currentSelectedNode); - - if ( islastNode && caretAtTheEndOfText ) { - - event.preventDefault(); - event.stopPropagation(); - event.stopImmediatePropagation(); - - editor.core.log('ENTER clicked in last textNode. Create new BLOCK'); - - editor.content.insertBlock({ - type: NEW_BLOCK_TYPE, - block: editor.tools[NEW_BLOCK_TYPE].render() - }, true); - - editor.toolbar.move(); - editor.toolbar.open(); - - /** Show plus button with empty block */ - editor.toolbar.showPlusButton(); - - } - - } - - /** get all inputs after new appending block */ - editor.ui.saveInputs(); - - }; - - /** - * Escape behaviour - * @param event - * @private - * - * @description Closes toolbox and toolbar. Prevents default behaviour - */ - var escapeKeyPressedOnRedactorsZone_ = function (event) { - - /** Close all toolbar */ - editor.toolbar.close(); - - /** Close toolbox */ - editor.toolbar.toolbox.close(); - - event.preventDefault(); - - }; - - /** - * @param {Event} event - * @private - * - * closes and moves toolbar - */ - var arrowKeyPressed_ = function (event) { - - editor.content.workingNodeChanged(); - - /* Closing toolbar */ - editor.toolbar.close(); - editor.toolbar.move(); - - }; - - /** - * @private - * @param {Event} event - * - * @description Closes all opened bars from toolbar. - * If block is mark, clears highlightning - */ - var defaultKeyPressedOnRedactorsZone_ = function () { - - editor.toolbar.close(); - - if (!editor.toolbar.inline.actionsOpened) { - - editor.toolbar.inline.close(); - editor.content.clearMark(); - - } - - }; - - /** - * Handler when clicked on redactors area - * - * @protected - * @param event - * - * @description Detects clicked area. If it is first-level block area, marks as detected and - * on next enter press will be inserted new block - * Otherwise, save carets position (input index) and put caret to the editable zone. - * - * @see detectWhenClickedOnFirstLevelBlockArea_ - * - */ - callbacks.redactorClicked = function (event) { - - detectWhenClickedOnFirstLevelBlockArea_(); - - editor.content.workingNodeChanged(event.target); - editor.ui.saveInputs(); - - var selectedText = editor.toolbar.inline.getSelectionText(), - firstLevelBlock; - - /** If selection range took off, then we hide inline toolbar */ - if (selectedText.length === 0) { - - editor.toolbar.inline.close(); - - } - - /** Update current input index in memory when caret focused into existed input */ - if (event.target.contentEditable == 'true') { - - editor.caret.saveCurrentInputIndex(); - - } - - if (editor.content.currentNode === null) { - - /** - * If inputs in redactor does not exits, then we put input index 0 not -1 - */ - var indexOfLastInput = editor.state.inputs.length > 0 ? editor.state.inputs.length - 1 : 0; - - /** If we have any inputs */ - if (editor.state.inputs.length) { - - /** getting firstlevel parent of input */ - firstLevelBlock = editor.content.getFirstLevelBlock(editor.state.inputs[indexOfLastInput]); - - } - - /** If input is empty, then we set caret to the last input */ - if (editor.state.inputs.length && editor.state.inputs[indexOfLastInput].textContent === '' && firstLevelBlock.dataset.tool == editor.settings.initialBlockPlugin) { - - editor.caret.setToBlock(indexOfLastInput); - - } else { - - /** Create new input when caret clicked in redactors area */ - var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; - - editor.content.insertBlock({ - type : NEW_BLOCK_TYPE, - block : editor.tools[NEW_BLOCK_TYPE].render() - }); - - /** If there is no inputs except inserted */ - if (editor.state.inputs.length === 1) { - - editor.caret.setToBlock(indexOfLastInput); - - } else { - - /** Set caret to this appended input */ - editor.caret.setToNextBlock(indexOfLastInput); - - } - - } - - } else { - - /** Close all panels */ - editor.toolbar.settings.close(); - editor.toolbar.toolbox.close(); - - } - - /** - * Move toolbar and open - */ - editor.toolbar.move(); - editor.toolbar.open(); - - var inputIsEmpty = !editor.content.currentNode.textContent.trim(), - currentNodeType = editor.content.currentNode.dataset.tool, - isInitialType = currentNodeType == editor.settings.initialBlockPlugin; - - - /** Hide plus buttons */ - editor.toolbar.hidePlusButton(); - - if (!inputIsEmpty) { - - /** Mark current block */ - editor.content.markBlock(); - - } - - if ( isInitialType && inputIsEmpty ) { - - /** Show plus button */ - editor.toolbar.showPlusButton(); - - } - - - }; - - /** - * This method allows to define, is caret in contenteditable element or not. - * - * @private - * - * @description Otherwise, if we get TEXT node from range container, that will means we have input index. - * In this case we use default browsers behaviour (if plugin allows that) or overwritten action. - * Therefore, to be sure that we've clicked first-level block area, we should have currentNode, which always - * specifies to the first-level block. Other cases we just ignore. - */ - var detectWhenClickedOnFirstLevelBlockArea_ = function () { - - var selection = window.getSelection(), - anchorNode = selection.anchorNode, - flag = false; - - if (selection.rangeCount === 0) { - - editor.content.editorAreaHightlighted = true; - - } else { - - if (!editor.core.isDomNode(anchorNode)) { - - anchorNode = anchorNode.parentNode; - - } - - /** Already founded, without loop */ - if (anchorNode.contentEditable == 'true') { - - flag = true; - - } - - while (anchorNode.contentEditable != 'true') { - - anchorNode = anchorNode.parentNode; - - if (anchorNode.contentEditable == 'true') { - - flag = true; - - } - - if (anchorNode == document.body) { - - break; - - } - - } - - /** If editable element founded, flag is "TRUE", Therefore we return "FALSE" */ - editor.content.editorAreaHightlighted = !flag; - - } - - }; - - /** - * Toolbar button click handler - * - * @param {Object} event - cursor to the button - * @protected - * - * @description gets current tool and calls render method - */ - callbacks.toolbarButtonClicked = function (event) { - - var button = this; - - editor.toolbar.current = button.dataset.type; - - editor.toolbar.toolbox.toolClicked(event); - editor.toolbar.close(); - - }; - - /** - * Show or Hide toolbox when plus button is clicked - */ - callbacks.plusButtonClicked = function () { - - if (!editor.nodes.toolbox.classList.contains('opened')) { - - editor.toolbar.toolbox.open(); - - } else { - - editor.toolbar.toolbox.close(); - - } - - }; - - /** - * Block handlers for KeyDown events - * - * @protected - * @param {Object} event - * - * Handles keydowns on block - * @see blockRightOrDownArrowPressed_ - * @see backspacePressed_ - * @see blockLeftOrUpArrowPressed_ - */ - callbacks.blockKeydown = function (event) { - - let block = event.target; // event.target is input - - switch (event.keyCode) { - - case editor.core.keys.DOWN: - case editor.core.keys.RIGHT: - blockRightOrDownArrowPressed_(event); - break; - - case editor.core.keys.BACKSPACE: - backspacePressed_(block, event); - break; - - case editor.core.keys.UP: - case editor.core.keys.LEFT: - blockLeftOrUpArrowPressed_(event); - break; - - } - - }; - - /** - * RIGHT or DOWN keydowns on block - * - * @param {Object} event - * @private - * - * @description watches the selection and gets closest editable element. - * Uses method getDeepestTextNodeFromPosition to get the last node of next block - * Sets caret if it is contenteditable - */ - var blockRightOrDownArrowPressed_ = function (event) { - - var selection = window.getSelection(), - inputs = editor.state.inputs, - focusedNode = selection.anchorNode, - focusedNodeHolder; - - /** Check for caret existance */ - if (!focusedNode) { - - return false; - - } - - /** Looking for closest (parent) contentEditable element of focused node */ - while (focusedNode.contentEditable != 'true') { - - focusedNodeHolder = focusedNode.parentNode; - focusedNode = focusedNodeHolder; - - } - - /** Input index in DOM level */ - var editableElementIndex = 0; - - while (focusedNode != inputs[editableElementIndex]) { - - editableElementIndex ++; - - } - - /** - * Founded contentEditable element doesn't have childs - * Or maybe New created block - */ - if (!focusedNode.textContent) { - - editor.caret.setToNextBlock(editableElementIndex); - return; - - } - - /** - * Do nothing when caret doesn not reaches the end of last child - */ - var caretInLastChild = false, - caretAtTheEndOfText = false; - - var lastChild, - deepestTextnode; - - lastChild = focusedNode.childNodes[focusedNode.childNodes.length - 1 ]; - - if (editor.core.isDomNode(lastChild)) { - - deepestTextnode = editor.content.getDeepestTextNodeFromPosition(lastChild, lastChild.childNodes.length); - - } else { - - deepestTextnode = lastChild; - - } - - caretInLastChild = selection.anchorNode == deepestTextnode; - caretAtTheEndOfText = deepestTextnode.length == selection.anchorOffset; - - if ( !caretInLastChild || !caretAtTheEndOfText ) { - - editor.core.log('arrow [down|right] : caret does not reached the end'); - return false; - - } - - editor.caret.setToNextBlock(editableElementIndex); - - }; - - /** - * LEFT or UP keydowns on block - * - * @param {Object} event - * @private - * - * watches the selection and gets closest editable element. - * Uses method getDeepestTextNodeFromPosition to get the last node of previous block - * Sets caret if it is contenteditable - * - */ - var blockLeftOrUpArrowPressed_ = function (event) { - - var selection = window.getSelection(), - inputs = editor.state.inputs, - focusedNode = selection.anchorNode, - focusedNodeHolder; - - /** Check for caret existance */ - if (!focusedNode) { - - return false; - - } - - /** - * LEFT or UP not at the beginning - */ - if ( selection.anchorOffset !== 0) { - - return false; - - } - - /** Looking for parent contentEditable block */ - while (focusedNode.contentEditable != 'true') { - - focusedNodeHolder = focusedNode.parentNode; - focusedNode = focusedNodeHolder; - - } - - /** Input index in DOM level */ - var editableElementIndex = 0; - - while (focusedNode != inputs[editableElementIndex]) { - - editableElementIndex ++; - - } - - /** - * Do nothing if caret is not at the beginning of first child - */ - var caretInFirstChild = false, - caretAtTheBeginning = false; - - var firstChild, - deepestTextnode; - - /** - * Founded contentEditable element doesn't have childs - * Or maybe New created block - */ - if (!focusedNode.textContent) { - - editor.caret.setToPreviousBlock(editableElementIndex); - return; - - } - - firstChild = focusedNode.childNodes[0]; - - if (editor.core.isDomNode(firstChild)) { - - deepestTextnode = editor.content.getDeepestTextNodeFromPosition(firstChild, 0); - - } else { - - deepestTextnode = firstChild; - - } - - caretInFirstChild = selection.anchorNode == deepestTextnode; - caretAtTheBeginning = selection.anchorOffset === 0; - - if ( caretInFirstChild && caretAtTheBeginning ) { - - editor.caret.setToPreviousBlock(editableElementIndex); - - } - - }; - - /** - * Handles backspace keydown - * - * @param {Element} block - * @param {Object} event - * @private - * - * @description if block is empty, delete the block and set caret to the previous block - * If block is not empty, try to merge two blocks - current and previous - * But it we try'n to remove first block, then we should set caret to the next block, not previous. - * If we removed the last block, create new one - */ - var backspacePressed_ = function (block, event) { - - var currentInputIndex = editor.caret.getCurrentInputIndex(), - range, - selectionLength, - firstLevelBlocksCount; - - if (editor.core.isNativeInput(event.target)) { - - /** If input value is empty - remove block */ - if (event.target.value.trim() == '') { - - block.remove(); - - } else { - - return; - - } - - } - - if (block.textContent.trim()) { - - range = editor.content.getRange(); - selectionLength = range.endOffset - range.startOffset; - - if (editor.caret.position.atStart() && !selectionLength && editor.state.inputs[currentInputIndex - 1]) { - - editor.content.mergeBlocks(currentInputIndex); - - } else { - - return; - - } - - } - - if (!selectionLength) { - - block.remove(); - - } - - - firstLevelBlocksCount = editor.nodes.redactor.childNodes.length; - - /** - * If all blocks are removed - */ - if (firstLevelBlocksCount === 0) { - - /** update currentNode variable */ - editor.content.currentNode = null; - - /** Inserting new empty initial block */ - editor.ui.addInitialBlock(); - - /** Updating inputs state after deleting last block */ - editor.ui.saveInputs(); - - /** Set to current appended block */ - window.setTimeout(function () { - - editor.caret.setToPreviousBlock(1); - - }, 10); - - } else { - - if (editor.caret.inputIndex !== 0) { - - /** Target block is not first */ - editor.caret.setToPreviousBlock(editor.caret.inputIndex); - - } else { - - /** If we try to delete first block */ - editor.caret.setToNextBlock(editor.caret.inputIndex); - - } - - } - - editor.toolbar.move(); - - if (!editor.toolbar.opened) { - - editor.toolbar.open(); - - } - - /** Updating inputs state */ - editor.ui.saveInputs(); - - /** Prevent default browser behaviour */ - event.preventDefault(); - - }; - - /** - * used by UI module - * Clicks on block settings button - * - * @param {Object} event - * @protected - * @description Opens toolbar settings - */ - callbacks.showSettingsButtonClicked = function (event) { - - /** - * Get type of current block - * It uses to append settings from tool.settings property. - * ... - * Type is stored in data-type attribute on block - */ - var currentToolType = editor.content.currentNode.dataset.tool; - - editor.toolbar.settings.toggle(currentToolType); - - /** Close toolbox when settings button is active */ - editor.toolbar.toolbox.close(); - editor.toolbar.settings.hideRemoveActions(); - - }; - - return callbacks; - -})({}); \ No newline at end of file diff --git a/modules/caret.js b/modules/caret.js deleted file mode 100644 index 8c151709..00000000 --- a/modules/caret.js +++ /dev/null @@ -1,305 +0,0 @@ -/** - * Codex Editor Caret Module - * - * @author Codex Team - * @version 1.0 - */ - -module.exports = (function (caret) { - - let editor = codex.editor; - - /** - * @var {int} InputIndex - editable element in DOM - */ - caret.inputIndex = null; - - /** - * @var {int} offset - caret position in a text node. - */ - caret.offset = null; - - /** - * @var {int} focusedNodeIndex - we get index of child node from first-level block - */ - caret.focusedNodeIndex = null; - - /** - * Creates Document Range and sets caret to the element. - * @protected - * @uses caret.save — if you need to save caret position - * @param {Element} el - Changed Node. - */ - caret.set = function ( el, index, offset) { - - offset = offset || caret.offset || 0; - index = index || caret.focusedNodeIndex || 0; - - var childs = el.childNodes, - nodeToSet; - - if ( childs.length === 0 ) { - - nodeToSet = el; - - } else { - - nodeToSet = childs[index]; - - } - - /** If Element is INPUT */ - if (el.contentEditable != 'true') { - - el.focus(); - return; - - } - - if (editor.core.isDomNode(nodeToSet)) { - - nodeToSet = editor.content.getDeepestTextNodeFromPosition(nodeToSet, nodeToSet.childNodes.length); - - } - - var range = document.createRange(), - selection = window.getSelection(); - - window.setTimeout(function () { - - range.setStart(nodeToSet, offset); - range.setEnd(nodeToSet, offset); - - selection.removeAllRanges(); - selection.addRange(range); - - editor.caret.saveCurrentInputIndex(); - - }, 20); - - }; - - /** - * @protected - * Updates index of input and saves it in caret object - */ - caret.saveCurrentInputIndex = function () { - - /** Index of Input that we paste sanitized content */ - var selection = window.getSelection(), - inputs = editor.state.inputs, - focusedNode = selection.anchorNode, - focusedNodeHolder; - - if (!focusedNode) { - - return; - - } - - /** Looking for parent contentEditable block */ - while (focusedNode.contentEditable != 'true') { - - focusedNodeHolder = focusedNode.parentNode; - focusedNode = focusedNodeHolder; - - } - - /** Input index in DOM level */ - var editableElementIndex = 0; - - while (focusedNode != inputs[editableElementIndex]) { - - editableElementIndex ++; - - } - - caret.inputIndex = editableElementIndex; - - }; - - /** - * Returns current input index (caret object) - */ - caret.getCurrentInputIndex = function () { - - return caret.inputIndex; - - }; - - /** - * @param {int} index - index of first-level block after that we set caret into next input - */ - caret.setToNextBlock = function (index) { - - var inputs = editor.state.inputs, - nextInput = inputs[index + 1]; - - if (!nextInput) { - - editor.core.log('We are reached the end'); - return; - - } - - /** - * When new Block created or deleted content of input - * We should add some text node to set caret - */ - if (!nextInput.childNodes.length) { - - var emptyTextElement = document.createTextNode(''); - - nextInput.appendChild(emptyTextElement); - - } - - editor.caret.inputIndex = index + 1; - editor.caret.set(nextInput, 0, 0); - editor.content.workingNodeChanged(nextInput); - - }; - - /** - * @param {int} index - index of target input. - * Sets caret to input with this index - */ - caret.setToBlock = function (index) { - - var inputs = editor.state.inputs, - targetInput = inputs[index]; - - if ( !targetInput ) { - - return; - - } - - /** - * When new Block created or deleted content of input - * We should add some text node to set caret - */ - if (!targetInput.childNodes.length) { - - var emptyTextElement = document.createTextNode(''); - - targetInput.appendChild(emptyTextElement); - - } - - editor.caret.inputIndex = index; - editor.caret.set(targetInput, 0, 0); - editor.content.workingNodeChanged(targetInput); - - }; - - /** - * @param {int} index - index of input - */ - caret.setToPreviousBlock = function (index) { - - index = index || 0; - - var inputs = editor.state.inputs, - previousInput = inputs[index - 1], - lastChildNode, - lengthOfLastChildNode, - emptyTextElement; - - - if (!previousInput) { - - editor.core.log('We are reached first node'); - return; - - } - - lastChildNode = editor.content.getDeepestTextNodeFromPosition(previousInput, previousInput.childNodes.length); - lengthOfLastChildNode = lastChildNode.length; - - /** - * When new Block created or deleted content of input - * We should add some text node to set caret - */ - if (!previousInput.childNodes.length) { - - emptyTextElement = document.createTextNode(''); - previousInput.appendChild(emptyTextElement); - - } - editor.caret.inputIndex = index - 1; - editor.caret.set(previousInput, previousInput.childNodes.length - 1, lengthOfLastChildNode); - editor.content.workingNodeChanged(inputs[index - 1]); - - }; - - caret.position = { - - atStart : function () { - - var selection = window.getSelection(), - anchorOffset = selection.anchorOffset, - anchorNode = selection.anchorNode, - firstLevelBlock = editor.content.getFirstLevelBlock(anchorNode), - pluginsRender = firstLevelBlock.childNodes[0]; - - if (!editor.core.isDomNode(anchorNode)) { - - anchorNode = anchorNode.parentNode; - - } - - var isFirstNode = anchorNode === pluginsRender.childNodes[0], - isOffsetZero = anchorOffset === 0; - - return isFirstNode && isOffsetZero; - - }, - - atTheEnd : function () { - - var selection = window.getSelection(), - anchorOffset = selection.anchorOffset, - anchorNode = selection.anchorNode; - - /** Caret is at the end of input */ - return !anchorNode || !anchorNode.length || anchorOffset === anchorNode.length; - - } - }; - - - /** - * Inserts node at the caret location - * @param {HTMLElement|DocumentFragment} node - */ - caret.insertNode = function (node) { - - var selection, range, - lastNode = node; - - if (node.nodeType == editor.core.nodeTypes.DOCUMENT_FRAGMENT) { - - lastNode = node.lastChild; - - } - - selection = window.getSelection(); - - range = selection.getRangeAt(0); - range.deleteContents(); - - range.insertNode(node); - - range.setStartAfter(lastNode); - range.collapse(true); - - selection.removeAllRanges(); - selection.addRange(range); - - - }; - - return caret; - -})({}); \ No newline at end of file diff --git a/modules/content.js b/modules/content.js deleted file mode 100644 index 1ed1a634..00000000 --- a/modules/content.js +++ /dev/null @@ -1,805 +0,0 @@ -/** - * Codex Editor Content Module - * Works with DOM - * - * @module Codex Editor content module - * - * @author Codex Team - * @version 1.3.13 - * - * @description Module works with Elements that have been appended to the main DOM - */ - -module.exports = (function (content) { - - let editor = codex.editor; - - /** - * Links to current active block - * @type {null | Element} - */ - content.currentNode = null; - - /** - * clicked in redactor area - * @type {null | Boolean} - */ - content.editorAreaHightlighted = null; - - /** - * @deprecated - * Synchronizes redactor with original textarea - */ - content.sync = function () { - - editor.core.log('syncing...'); - - /** - * Save redactor content to editor.state - */ - editor.state.html = editor.nodes.redactor.innerHTML; - - }; - - /** - * Appends background to the block - * - * @description add CSS class to highlight visually first-level block area - */ - content.markBlock = function () { - - editor.content.currentNode.classList.add(editor.ui.className.BLOCK_HIGHLIGHTED); - - }; - - /** - * Clear background - * - * @description clears styles that highlights block - */ - content.clearMark = function () { - - if (editor.content.currentNode) { - - editor.content.currentNode.classList.remove(editor.ui.className.BLOCK_HIGHLIGHTED); - - } - - }; - - /** - * Finds first-level block - * - * @param {Element} node - selected or clicked in redactors area node - * @protected - * - * @description looks for first-level block. - * gets parent while node is not first-level - */ - content.getFirstLevelBlock = function (node) { - - if (!editor.core.isDomNode(node)) { - - node = node.parentNode; - - } - - if (node === editor.nodes.redactor || node === document.body) { - - return null; - - } else { - - while(!node.classList.contains(editor.ui.className.BLOCK_CLASSNAME)) { - - node = node.parentNode; - - } - - return node; - - } - - }; - - /** - * Trigger this event when working node changed - * @param {Element} targetNode - first-level of this node will be current - * @protected - * - * @description If targetNode is first-level then we set it as current else we look for parents to find first-level - */ - content.workingNodeChanged = function (targetNode) { - - /** Clear background from previous marked block before we change */ - editor.content.clearMark(); - - if (!targetNode) { - - return; - - } - - content.currentNode = content.getFirstLevelBlock(targetNode); - - }; - - /** - * Replaces one redactor block with another - * @protected - * @param {Element} targetBlock - block to replace. Mostly currentNode. - * @param {Element} newBlock - * @param {string} newBlockType - type of new block; we need to store it to data-attribute - * - * [!] Function does not saves old block content. - * You can get it manually and pass with newBlock.innerHTML - */ - content.replaceBlock = function (targetBlock, newBlock) { - - if (!targetBlock || !newBlock) { - - editor.core.log('replaceBlock: missed params'); - return; - - } - - /** If target-block is not a frist-level block, then we iterate parents to find it */ - while(!targetBlock.classList.contains(editor.ui.className.BLOCK_CLASSNAME)) { - - targetBlock = targetBlock.parentNode; - - } - - /** Replacing */ - editor.nodes.redactor.replaceChild(newBlock, targetBlock); - - /** - * Set new node as current - */ - editor.content.workingNodeChanged(newBlock); - - /** - * Add block handlers - */ - editor.ui.addBlockHandlers(newBlock); - - /** - * Save changes - */ - editor.ui.saveInputs(); - - }; - - /** - * @protected - * - * Inserts new block to redactor - * Wrapps block into a DIV with BLOCK_CLASSNAME class - * - * @param blockData {object} - * @param blockData.block {Element} element with block content - * @param blockData.type {string} block plugin - * @param needPlaceCaret {bool} pass true to set caret in new block - * - */ - content.insertBlock = function ( blockData, needPlaceCaret ) { - - var workingBlock = editor.content.currentNode, - newBlockContent = blockData.block, - blockType = blockData.type, - isStretched = blockData.stretched; - - var newBlock = composeNewBlock_(newBlockContent, blockType, isStretched); - - if (workingBlock) { - - editor.core.insertAfter(workingBlock, newBlock); - - } else { - - /** - * If redactor is empty, append as first child - */ - editor.nodes.redactor.appendChild(newBlock); - - } - - /** - * Block handler - */ - editor.ui.addBlockHandlers(newBlock); - - /** - * Set new node as current - */ - editor.content.workingNodeChanged(newBlock); - - /** - * Save changes - */ - editor.ui.saveInputs(); - - - if ( needPlaceCaret ) { - - /** - * If we don't know input index then we set default value -1 - */ - var currentInputIndex = editor.caret.getCurrentInputIndex() || -1; - - - if (currentInputIndex == -1) { - - - var editableElement = newBlock.querySelector('[contenteditable]'), - emptyText = document.createTextNode(''); - - editableElement.appendChild(emptyText); - editor.caret.set(editableElement, 0, 0); - - editor.toolbar.move(); - editor.toolbar.showPlusButton(); - - - } else { - - if (currentInputIndex === editor.state.inputs.length - 1) - return; - - /** Timeout for browsers execution */ - window.setTimeout(function () { - - /** Setting to the new input */ - editor.caret.setToNextBlock(currentInputIndex); - editor.toolbar.move(); - editor.toolbar.open(); - - }, 10); - - } - - } - - /** - * Block is inserted, wait for new click that defined focusing on editors area - * @type {boolean} - */ - content.editorAreaHightlighted = false; - - }; - - /** - * Replaces blocks with saving content - * @protected - * @param {Element} noteToReplace - * @param {Element} newNode - * @param {Element} blockType - */ - content.switchBlock = function (blockToReplace, newBlock, tool) { - - tool = tool || editor.content.currentNode.dataset.tool; - var newBlockComposed = composeNewBlock_(newBlock, tool); - - /** Replacing */ - editor.content.replaceBlock(blockToReplace, newBlockComposed); - - /** Save new Inputs when block is changed */ - editor.ui.saveInputs(); - - }; - - /** - * Iterates between child noted and looking for #text node on deepest level - * @protected - * - * @param {Element} block - node where find - * @param {int} postiton - starting postion - * Example: childNodex.length to find from the end - * or 0 to find from the start - * @return {Text} block - * @uses DFS - */ - content.getDeepestTextNodeFromPosition = function (block, position) { - - /** - * Clear Block from empty and useless spaces with trim. - * Such nodes we should remove - */ - var blockChilds = block.childNodes, - index, - node, - text; - - for(index = 0; index < blockChilds.length; index++) { - - node = blockChilds[index]; - - if (node.nodeType == editor.core.nodeTypes.TEXT) { - - text = node.textContent.trim(); - - /** Text is empty. We should remove this child from node before we start DFS - * decrease the quantity of childs. - */ - if (text === '') { - - block.removeChild(node); - position--; - - } - - } - - } - - if (block.childNodes.length === 0) { - - return document.createTextNode(''); - - } - - /** Setting default position when we deleted all empty nodes */ - if ( position < 0 ) - position = 1; - - var lookingFromStart = false; - - /** For looking from START */ - if (position === 0) { - - lookingFromStart = true; - position = 1; - - } - - while ( position ) { - - /** initial verticle of node. */ - if ( lookingFromStart ) { - - block = block.childNodes[0]; - - } else { - - block = block.childNodes[position - 1]; - - } - - if ( block.nodeType == editor.core.nodeTypes.TAG ) { - - position = block.childNodes.length; - - } else if (block.nodeType == editor.core.nodeTypes.TEXT ) { - - position = 0; - - } - - } - - return block; - - }; - - /** - * @private - * @param {Element} block - current plugins render - * @param {String} tool - plugins name - * @param {Boolean} isStretched - make stretched block or not - * - * @description adds necessary information to wrap new created block by first-level holder - */ - var composeNewBlock_ = function (block, tool, isStretched) { - - var newBlock = editor.draw.node('DIV', editor.ui.className.BLOCK_CLASSNAME, {}), - blockContent = editor.draw.node('DIV', editor.ui.className.BLOCK_CONTENT, {}); - - blockContent.appendChild(block); - newBlock.appendChild(blockContent); - - if (isStretched) { - - blockContent.classList.add(editor.ui.className.BLOCK_STRETCHED); - - } - - newBlock.dataset.tool = tool; - return newBlock; - - }; - - /** - * Returns Range object of current selection - * @protected - */ - content.getRange = function () { - - var selection = window.getSelection().getRangeAt(0); - - return selection; - - }; - - /** - * Divides block in two blocks (after and before caret) - * - * @protected - * @param {int} inputIndex - target input index - * - * @description splits current input content to the separate blocks - * When enter is pressed among the words, that text will be splited. - */ - content.splitBlock = function (inputIndex) { - - var selection = window.getSelection(), - anchorNode = selection.anchorNode, - anchorNodeText = anchorNode.textContent, - caretOffset = selection.anchorOffset, - textBeforeCaret, - textNodeBeforeCaret, - textAfterCaret, - textNodeAfterCaret; - - var currentBlock = editor.content.currentNode.querySelector('[contentEditable]'); - - - textBeforeCaret = anchorNodeText.substring(0, caretOffset); - textAfterCaret = anchorNodeText.substring(caretOffset); - - textNodeBeforeCaret = document.createTextNode(textBeforeCaret); - - if (textAfterCaret) { - - textNodeAfterCaret = document.createTextNode(textAfterCaret); - - } - - var previousChilds = [], - nextChilds = [], - reachedCurrent = false; - - if (textNodeAfterCaret) { - - nextChilds.push(textNodeAfterCaret); - - } - - for ( var i = 0, child; !!(child = currentBlock.childNodes[i]); i++) { - - if ( child != anchorNode ) { - - if ( !reachedCurrent ) { - - previousChilds.push(child); - - } else { - - nextChilds.push(child); - - } - - } else { - - reachedCurrent = true; - - } - - } - - /** Clear current input */ - editor.state.inputs[inputIndex].innerHTML = ''; - - /** - * Append all childs founded before anchorNode - */ - var previousChildsLength = previousChilds.length; - - for(i = 0; i < previousChildsLength; i++) { - - editor.state.inputs[inputIndex].appendChild(previousChilds[i]); - - } - - editor.state.inputs[inputIndex].appendChild(textNodeBeforeCaret); - - /** - * Append text node which is after caret - */ - var nextChildsLength = nextChilds.length, - newNode = document.createElement('div'); - - for(i = 0; i < nextChildsLength; i++) { - - newNode.appendChild(nextChilds[i]); - - } - - newNode = newNode.innerHTML; - - /** This type of block creates when enter is pressed */ - var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; - - /** - * Make new paragraph with text after caret - */ - editor.content.insertBlock({ - type : NEW_BLOCK_TYPE, - block : editor.tools[NEW_BLOCK_TYPE].render({ - text : newNode - }) - }, true ); - - }; - - /** - * Merges two blocks — current and target - * If target index is not exist, then previous will be as target - * - * @protected - * @param {int} currentInputIndex - * @param {int} targetInputIndex - * - * @description gets two inputs indexes and merges into one - */ - content.mergeBlocks = function (currentInputIndex, targetInputIndex) { - - /** If current input index is zero, then prevent method execution */ - if (currentInputIndex === 0) { - - return; - - } - - var targetInput, - currentInputContent = editor.state.inputs[currentInputIndex].innerHTML; - - if (!targetInputIndex) { - - targetInput = editor.state.inputs[currentInputIndex - 1]; - - } else { - - targetInput = editor.state.inputs[targetInputIndex]; - - } - - targetInput.innerHTML += currentInputContent; - - }; - - /** - * Iterates all right siblings and parents, which has right siblings - * while it does not reached the first-level block - * - * @param {Element} node - * @return {boolean} - */ - content.isLastNode = function (node) { - - // console.log('погнали перебор родителей'); - - var allChecked = false; - - while ( !allChecked ) { - - // console.log('Смотрим на %o', node); - // console.log('Проверим, пустые ли соседи справа'); - - if ( !allSiblingsEmpty_(node) ) { - - // console.log('Есть непустые соседи. Узел не последний. Выходим.'); - return false; - - } - - node = node.parentNode; - - /** - * Проверяем родителей до тех пор, пока не найдем блок первого уровня - */ - if ( node.classList.contains(editor.ui.className.BLOCK_CONTENT) ) { - - allChecked = true; - - } - - } - - return true; - - }; - - /** - * Checks if all element right siblings is empty - * @param node - */ - var allSiblingsEmpty_ = function (node) { - - /** - * Нужно убедиться, что после пустого соседа ничего нет - */ - var sibling = node.nextSibling; - - while ( sibling ) { - - if (sibling.textContent.length) { - - return false; - - } - - sibling = sibling.nextSibling; - - } - - return true; - - }; - - /** - * @public - * - * @param {string} htmlData - html content as string - * @param {string} plainData - plain text - * @return {string} - html content as string - */ - content.wrapTextWithParagraphs = function (htmlData, plainData) { - - if (!htmlData.trim()) { - - return wrapPlainTextWithParagraphs(plainData); - - } - - var wrapper = document.createElement('DIV'), - newWrapper = document.createElement('DIV'), - i, - paragraph, - firstLevelBlocks = ['DIV', 'P'], - blockTyped, - node; - - /** - * Make HTML Element to Wrap Text - * It allows us to work with input data as HTML content - */ - wrapper.innerHTML = htmlData; - paragraph = document.createElement('P'); - - for (i = 0; i < wrapper.childNodes.length; i++) { - - node = wrapper.childNodes[i]; - - blockTyped = firstLevelBlocks.indexOf(node.tagName) != -1; - - /** - * If node is first-levet - * we add this node to our new wrapper - */ - if ( blockTyped ) { - - /** - * If we had splitted inline nodes to paragraph before - */ - if ( paragraph.childNodes.length ) { - - newWrapper.appendChild(paragraph.cloneNode(true)); - - /** empty paragraph */ - paragraph = null; - paragraph = document.createElement('P'); - - } - - newWrapper.appendChild(node.cloneNode(true)); - - } else { - - /** Collect all inline nodes to one as paragraph */ - paragraph.appendChild(node.cloneNode(true)); - - /** if node is last we should append this node to paragraph and paragraph to new wrapper */ - if ( i == wrapper.childNodes.length - 1 ) { - - newWrapper.appendChild(paragraph.cloneNode(true)); - - } - - } - - } - - return newWrapper.innerHTML; - - }; - - /** - * Splits strings on new line and wraps paragraphs with

      tag - * @param plainText - * @returns {string} - */ - var wrapPlainTextWithParagraphs = function (plainText) { - - if (!plainText) return ''; - - return '

      ' + plainText.split('\n\n').join('

      ') + '

      '; - - }; - - /** - * Finds closest Contenteditable parent from Element - * @param {Element} node element looking from - * @return {Element} node contenteditable - */ - content.getEditableParent = function (node) { - - while (node && node.contentEditable != 'true') { - - node = node.parentNode; - - } - - return node; - - }; - - /** - * Clear editors content - * - * @param {Boolean} all — if true, delete all article data (content, id, etc.) - */ - content.clear = function (all) { - - editor.nodes.redactor.innerHTML = ''; - editor.content.sync(); - editor.ui.saveInputs(); - if (all) { - - editor.state.blocks = {}; - - } else if (editor.state.blocks) { - - editor.state.blocks.items = []; - - } - - editor.content.currentNode = null; - - }; - - /** - * - * Load new data to editor - * If editor is not empty, just append articleData.items - * - * @param articleData.items - */ - content.load = function (articleData) { - - var currentContent = Object.assign({}, editor.state.blocks); - - editor.content.clear(); - - if (!Object.keys(currentContent).length) { - - editor.state.blocks = articleData; - - } else if (!currentContent.items) { - - currentContent.items = articleData.items; - editor.state.blocks = currentContent; - - } else { - - currentContent.items = currentContent.items.concat(articleData.items); - editor.state.blocks = currentContent; - - } - - editor.renderer.makeBlocksFromData(); - - }; - - return content; - -})({}); \ No newline at end of file diff --git a/modules/core.js b/modules/core.js deleted file mode 100644 index ad4a08b8..00000000 --- a/modules/core.js +++ /dev/null @@ -1,389 +0,0 @@ -/** - * Codex Editor Core - * - * @author Codex Team - * @version 1.1.3 - */ - -module.exports = (function (core) { - - let editor = codex.editor; - - /** - * @public - * - * Editor preparing method - * @return Promise - */ - core.prepare = function (userSettings) { - - return new Promise(function (resolve, reject) { - - if ( userSettings ) { - - editor.settings.tools = userSettings.tools || editor.settings.tools; - - } - - if (userSettings.data) { - - editor.state.blocks = userSettings.data; - - } - - if (userSettings.initialBlockPlugin) { - - editor.settings.initialBlockPlugin = userSettings.initialBlockPlugin; - - } - - if (userSettings.sanitizer) { - - editor.settings.sanitizer = userSettings.sanitizer; - - } - - editor.hideToolbar = userSettings.hideToolbar; - - editor.settings.placeholder = userSettings.placeholder || ''; - - editor.nodes.holder = document.getElementById(userSettings.holderId || editor.settings.holderId); - - if (typeof editor.nodes.holder === undefined || editor.nodes.holder === null) { - - reject(Error("Holder wasn't found by ID: #" + userSettings.holderId)); - - } else { - - resolve(); - - } - - }); - - }; - - /** - * Logging method - * @param type = ['log', 'info', 'warn'] - */ - core.log = function (msg, type, arg) { - - type = type || 'log'; - - if (!arg) { - - arg = msg || 'undefined'; - msg = '[codex-editor]: %o'; - - } else { - - msg = '[codex-editor]: ' + msg; - - } - - try{ - - if ( 'console' in window && window.console[ type ] ) { - - if ( arg ) window.console[ type ]( msg, arg ); - else window.console[ type ]( msg ); - - } - - }catch(e) {} - - }; - - /** - * @protected - * - * Helper for insert one element after another - */ - core.insertAfter = function (target, element) { - - target.parentNode.insertBefore(element, target.nextSibling); - - }; - - /** - * @const - * - * Readable DOM-node types map - */ - core.nodeTypes = { - TAG : 1, - TEXT : 3, - COMMENT : 8, - DOCUMENT_FRAGMENT: 11 - }; - - /** - * @const - * Readable keys map - */ - core.keys = { BACKSPACE: 8, TAB: 9, ENTER: 13, SHIFT: 16, CTRL: 17, ALT: 18, ESC: 27, SPACE: 32, LEFT: 37, UP: 38, DOWN: 40, RIGHT: 39, DELETE: 46, META: 91 }; - - /** - * @protected - * - * Check object for DOM node - */ - core.isDomNode = function (el) { - - return el && typeof el === 'object' && el.nodeType && el.nodeType == this.nodeTypes.TAG; - - }; - - /** - * Checks passed object for emptiness - * @require ES5 - Object.keys - * @param {object} - */ - core.isEmpty = function ( obj ) { - - return Object.keys(obj).length === 0; - - }; - - /** - * Native Ajax - * @param {String} settings.url - request URL - * @param {function} settings.beforeSend - returned value will be passed as context to the Success, Error and Progress callbacks - * @param {function} settings.success - * @param {function} settings.progress - */ - core.ajax = function (settings) { - - if (!settings || !settings.url) { - - return; - - } - - var XMLHTTP = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'), - encodedString, - isFormData, - prop; - - - settings.async = true; - settings.type = settings.type || 'GET'; - settings.data = settings.data || ''; - settings['content-type'] = settings['content-type'] || 'application/json; charset=utf-8'; - - if (settings.type == 'GET' && settings.data) { - - settings.url = /\?/.test(settings.url) ? settings.url + '&' + settings.data : settings.url + '?' + settings.data; - - } else { - - encodedString = ''; - for(prop in settings.data) { - - encodedString += (prop + '=' + encodeURIComponent(settings.data[prop]) + '&'); - - } - - } - - if (settings.withCredentials) { - - XMLHTTP.withCredentials = true; - - } - - /** - * Value returned in beforeSend funtion will be passed as context to the other response callbacks - * If beforeSend returns false, AJAX will be blocked - */ - let responseContext, - beforeSendResult; - - if (typeof settings.beforeSend === 'function') { - - beforeSendResult = settings.beforeSend.call(); - - if (beforeSendResult === false) { - - return; - - } - - } - - XMLHTTP.open( settings.type, settings.url, settings.async ); - - /** - * If we send FormData, we need no content-type header - */ - isFormData = isFormData_(settings.data); - - if (!isFormData) { - - if (settings.type !== 'POST') { - - XMLHTTP.setRequestHeader('Content-type', settings['content-type']); - - } else { - - XMLHTTP.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); - - } - - } - - XMLHTTP.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - - responseContext = beforeSendResult || XMLHTTP; - - if (typeof settings.progress === 'function') { - - XMLHTTP.upload.onprogress = settings.progress.bind(responseContext); - - } - - XMLHTTP.onreadystatechange = function () { - - if (XMLHTTP.readyState === 4) { - - if (XMLHTTP.status === 200) { - - if (typeof settings.success === 'function') { - - settings.success.call(responseContext, XMLHTTP.responseText); - - } - - } else { - - if (typeof settings.error === 'function') { - - settings.error.call(responseContext, XMLHTTP.responseText, XMLHTTP.status); - - } - - } - - } - - }; - - if (isFormData) { - - // Sending FormData - XMLHTTP.send(settings.data); - - } else { - - // POST requests - XMLHTTP.send(encodedString); - - } - - return XMLHTTP; - - }; - - /** - * Appends script to head of document - * @return Promise - */ - core.importScript = function (scriptPath, instanceName) { - - return new Promise(function (resolve, reject) { - - let script; - - /** Script is already loaded */ - if ( !instanceName ) { - - reject('Instance name is missed'); - - } else if ( document.getElementById(editor.scriptPrefix + instanceName) ) { - - resolve(scriptPath); - - } - - script = document.createElement('SCRIPT'); - script.async = true; - script.defer = true; - script.id = editor.scriptPrefix + instanceName; - - script.onload = function () { - - resolve(scriptPath); - - }; - - script.onerror = function () { - - reject(scriptPath); - - }; - - script.src = scriptPath; - document.head.appendChild(script); - - }); - - }; - - /** - * Function for checking is it FormData object to send. - * @param {Object} object to check - * @return boolean - */ - var isFormData_ = function (object) { - - return object instanceof FormData; - - }; - - /** - * Check block - * @param target - * @description Checks target is it native input - */ - core.isNativeInput = function (target) { - - var nativeInputAreas = ['INPUT', 'TEXTAREA']; - - return nativeInputAreas.indexOf(target.tagName) != -1; - - }; - - /** - * Check if block is empty - * We should check block textContent, child native inputs and some exceptions like IMG and IFRAME - * - * @param block - * @returns {boolean} - */ - core.isBlockEmpty = function (block) { - - const EXCEPTION_TAGS = ['IMG', 'IFRAME']; - - var nativeInputs = block.querySelectorAll('textarea, input'), - nativeInputsAreEmpty = true, - textContentIsEmpty = !block.textContent.trim(); - - Array.prototype.forEach.call(nativeInputs, function (input) { - - if (input.type == 'textarea' || input.type == 'text') { - - nativeInputsAreEmpty = nativeInputsAreEmpty && !input.value.trim(); - - } - - }); - - return textContentIsEmpty && nativeInputsAreEmpty && !EXCEPTION_TAGS.includes(block.tagName); - - }; - - - return core; - -})({}); diff --git a/modules/destroyer.js b/modules/destroyer.js deleted file mode 100644 index 989f9478..00000000 --- a/modules/destroyer.js +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Codex Editor Destroyer module - * - * @auhor Codex Team - * @version 1.0 - */ - -module.exports = function (destroyer) { - - let editor = codex.editor; - - destroyer.removeNodes = function () { - - editor.nodes.wrapper.remove(); - editor.nodes.notifications.remove(); - - }; - - destroyer.destroyPlugins = function () { - - for (var tool in editor.tools) { - - if (typeof editor.tools[tool].destroy === 'function') { - - editor.tools[tool].destroy(); - - } - - } - - }; - - destroyer.destroyScripts = function () { - - var scripts = document.getElementsByTagName('SCRIPT'); - - for (var i = 0; i < scripts.length; i++) { - - if (scripts[i].id.indexOf(editor.scriptPrefix) + 1) { - - scripts[i].remove(); - i--; - - } - - } - - }; - - - /** - * Delete editor data from webpage. - * You should send settings argument with boolean flags: - * @param settings.ui- remove redactor event listeners and DOM nodes - * @param settings.scripts - remove redactor scripts from DOM - * @param settings.plugins - remove plugin's objects - * @param settings.core - remove editor core. You can remove core only if UI and scripts flags is true - * } - * - */ - destroyer.destroy = function (settings) { - - if (!settings || typeof settings !== 'object') { - - return; - - } - - if (settings.ui) { - - destroyer.removeNodes(); - editor.listeners.removeAll(); - - } - - if (settings.scripts) { - - destroyer.destroyScripts(); - - } - - if (settings.plugins) { - - destroyer.destroyPlugins(); - - } - - if (settings.ui && settings.scripts && settings.core) { - - delete codex.editor; - - } - - }; - - return destroyer; - -}({}); \ No newline at end of file diff --git a/modules/draw.js b/modules/draw.js deleted file mode 100644 index 9c0d87cd..00000000 --- a/modules/draw.js +++ /dev/null @@ -1,316 +0,0 @@ -/** - * Codex Editor Draw module - * - * @author Codex Team - * @version 1.0. - */ - -module.exports = (function (draw) { - - /** - * Base editor wrapper - */ - draw.wrapper = function () { - - var wrapper = document.createElement('div'); - - wrapper.className += 'codex-editor'; - - return wrapper; - - }; - - /** - * Content-editable holder - */ - draw.redactor = function () { - - var redactor = document.createElement('div'); - - redactor.className += 'ce-redactor'; - - return redactor; - - }; - - draw.ceBlock = function () { - - var block = document.createElement('DIV'); - - block.className += 'ce_block'; - - return block; - - }; - - /** - * Empty toolbar with toggler - */ - draw.toolbar = function () { - - var bar = document.createElement('div'); - - bar.className += 'ce-toolbar'; - - return bar; - - }; - - draw.toolbarContent = function () { - - var wrapper = document.createElement('DIV'); - - wrapper.classList.add('ce-toolbar__content'); - - return wrapper; - - }; - - /** - * Inline toolbar - */ - draw.inlineToolbar = function () { - - var bar = document.createElement('DIV'); - - bar.className += 'ce-toolbar-inline'; - - return bar; - - }; - - /** - * Wrapper for inline toobar buttons - */ - draw.inlineToolbarButtons = function () { - - var wrapper = document.createElement('DIV'); - - wrapper.className += 'ce-toolbar-inline__buttons'; - - return wrapper; - - }; - - /** - * For some actions - */ - draw.inlineToolbarActions = function () { - - var wrapper = document.createElement('DIV'); - - wrapper.className += 'ce-toolbar-inline__actions'; - - return wrapper; - - }; - - draw.inputForLink = function () { - - var input = document.createElement('INPUT'); - - input.type = 'input'; - input.className += 'inputForLink'; - input.placeholder = 'Вставьте ссылку ...'; - input.setAttribute('form', 'defaultForm'); - - input.setAttribute('autofocus', 'autofocus'); - - return input; - - }; - - /** - * @todo Desc - */ - draw.blockButtons = function () { - - var block = document.createElement('div'); - - block.className += 'ce-toolbar__actions'; - - return block; - - }; - - /** - * Block settings panel - */ - draw.blockSettings = function () { - - var settings = document.createElement('div'); - - settings.className += 'ce-settings'; - - return settings; - - }; - - draw.defaultSettings = function () { - - var div = document.createElement('div'); - - div.classList.add('ce-settings_default'); - - return div; - - }; - - draw.pluginsSettings = function () { - - var div = document.createElement('div'); - - div.classList.add('ce-settings_plugin'); - - return div; - - }; - - draw.plusButton = function () { - - var button = document.createElement('span'); - - button.className = 'ce-toolbar__plus'; - // button.innerHTML = ''; - - return button; - - }; - - /** - * Settings button in toolbar - */ - draw.settingsButton = function () { - - var toggler = document.createElement('span'); - - toggler.className = 'ce-toolbar__settings-btn'; - - /** Toggler button*/ - toggler.innerHTML = ''; - - return toggler; - - }; - - /** - * Redactor tools wrapper - */ - - draw.toolbox = function () { - - var wrapper = document.createElement('div'); - - wrapper.className = 'ce-toolbar__tools'; - - return wrapper; - - }; - - /** - * @protected - * - * Draws tool buttons for toolbox - * - * @param {String} type - * @param {String} classname - * @returns {Element} - */ - draw.toolbarButton = function (type, classname) { - - var button = document.createElement('li'), - toolIcon = document.createElement('i'), - toolTitle = document.createElement('span'); - - button.dataset.type = type; - button.setAttribute('title', type); - - toolIcon.classList.add(classname); - toolTitle.classList.add('ce_toolbar_tools--title'); - - - button.appendChild(toolIcon); - button.appendChild(toolTitle); - - return button; - - }; - - /** - * @protected - * - * Draws tools for inline toolbar - * - * @param {String} type - * @param {String} classname - */ - draw.toolbarButtonInline = function (type, classname) { - - var button = document.createElement('BUTTON'), - toolIcon = document.createElement('I'); - - button.type = 'button'; - button.dataset.type = type; - toolIcon.classList.add(classname); - - button.appendChild(toolIcon); - - return button; - - }; - - /** - * Redactor block - */ - draw.block = function (tagName, content) { - - var node = document.createElement(tagName); - - node.innerHTML = content || ''; - - return node; - - }; - - /** - * Creates Node with passed tagName and className - * @param {string} tagName - * @param {string} className - * @param {object} properties - allow to assign properties - */ - draw.node = function ( tagName, className, properties ) { - - var el = document.createElement( tagName ); - - if ( className ) el.className = className; - - if ( properties ) { - - for (var name in properties) { - - el[name] = properties[name]; - - } - - } - - return el; - - }; - - /** - * Unavailable plugin block - */ - draw.unavailableBlock = function () { - - var wrapper = document.createElement('DIV'); - - wrapper.classList.add('cdx-unavailable-block'); - - return wrapper; - - }; - - return draw; - -})({}); \ No newline at end of file diff --git a/modules/listeners.js b/modules/listeners.js deleted file mode 100644 index 6b353ae2..00000000 --- a/modules/listeners.js +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Codex Editor Listeners module - * - * @author Codex Team - * @version 1.0 - */ - -/** - * Module-decorator for event listeners assignment - */ -module.exports = function (listeners) { - - var allListeners = []; - - /** - * Search methods - * - * byElement, byType and byHandler returns array of suitable listeners - * one and all takes element, eventType, and handler and returns first (all) suitable listener - * - */ - listeners.search = function () { - - var byElement = function (element, context) { - - var listenersOnElement = []; - - context = context || allListeners; - - for (var i = 0; i < context.length; i++) { - - var listener = context[i]; - - if (listener.element === element) { - - listenersOnElement.push(listener); - - } - - } - - return listenersOnElement; - - }; - - var byType = function (eventType, context) { - - var listenersWithType = []; - - context = context || allListeners; - - for (var i = 0; i < context.length; i++) { - - var listener = context[i]; - - if (listener.type === eventType) { - - listenersWithType.push(listener); - - } - - } - - return listenersWithType; - - }; - - var byHandler = function (handler, context) { - - var listenersWithHandler = []; - - context = context || allListeners; - - for (var i = 0; i < context.length; i++) { - - var listener = context[i]; - - if (listener.handler === handler) { - - listenersWithHandler.push(listener); - - } - - } - - return listenersWithHandler; - - }; - - var one = function (element, eventType, handler) { - - var result = allListeners; - - if (element) - result = byElement(element, result); - - if (eventType) - result = byType(eventType, result); - - if (handler) - result = byHandler(handler, result); - - return result[0]; - - }; - - var all = function (element, eventType, handler) { - - var result = allListeners; - - if (element) - result = byElement(element, result); - - if (eventType) - result = byType(eventType, result); - - if (handler) - result = byHandler(handler, result); - - return result; - - }; - - return { - byElement : byElement, - byType : byType, - byHandler : byHandler, - one : one, - all : all - }; - - }(); - - listeners.add = function (element, eventType, handler, isCapture) { - - element.addEventListener(eventType, handler, isCapture); - - var data = { - element: element, - type: eventType, - handler: handler - }; - - var alreadyAddedListener = listeners.search.one(element, eventType, handler); - - if (!alreadyAddedListener) { - - allListeners.push(data); - - } - - }; - - listeners.remove = function (element, eventType, handler) { - - element.removeEventListener(eventType, handler); - - var existingListeners = listeners.search.all(element, eventType, handler); - - for (var i = 0; i < existingListeners.length; i++) { - - var index = allListeners.indexOf(existingListeners[i]); - - if (index > 0) { - - allListeners.splice(index, 1); - - } - - } - - }; - - listeners.removeAll = function () { - - allListeners.map(function (current) { - - listeners.remove(current.element, current.type, current.handler); - - }); - - }; - - listeners.get = function (element, eventType, handler) { - - return listeners.search.all(element, eventType, handler); - - }; - - return listeners; - -}({}); \ No newline at end of file diff --git a/modules/notifications.js b/modules/notifications.js deleted file mode 100644 index ffeda9b8..00000000 --- a/modules/notifications.js +++ /dev/null @@ -1,231 +0,0 @@ -/** - * Codex Editor Notification Module - * - * @author Codex Team - * @version 1.0 - */ - -module.exports = (function (notifications) { - - let editor = codex.editor; - - var queue = []; - - var addToQueue = function (settings) { - - queue.push(settings); - - var index = 0; - - while ( index < queue.length && queue.length > 5) { - - if (queue[index].type == 'confirm' || queue[index].type == 'prompt') { - - index++; - continue; - - } - - queue[index].close(); - queue.splice(index, 1); - - } - - }; - - notifications.createHolder = function () { - - var holder = editor.draw.node('DIV', 'cdx-notifications-block'); - - editor.nodes.notifications = document.body.appendChild(holder); - - return holder; - - }; - - - /** - * Error notificator. Shows block with message - * @protected - */ - notifications.errorThrown = function (errorMsg, event) { - - editor.notifications.notification({message: 'This action is not available currently', type: event.type}); - - }; - - /** - * - * Appends notification - * - * settings = { - * type - notification type (reserved types: alert, confirm, prompt). Just add class 'cdx-notification-'+type - * message - notification message - * okMsg - confirm button text (default - 'Ok') - * cancelBtn - cancel button text (default - 'Cancel'). Only for confirm and prompt types - * confirm - function-handler for ok button click - * cancel - function-handler for cancel button click. Only for confirm and prompt types - * time - time (in seconds) after which notification will close (default - 10s) - * } - * - * @param settings - */ - notifications.notification = function (constructorSettings) { - - /** Private vars and methods */ - var notification = null, - cancel = null, - type = null, - confirm = null, - inputField = null; - - var confirmHandler = function () { - - close(); - - if (typeof confirm !== 'function' ) { - - return; - - } - - if (type == 'prompt') { - - confirm(inputField.value); - return; - - } - - confirm(); - - }; - - var cancelHandler = function () { - - close(); - - if (typeof cancel !== 'function' ) { - - return; - - } - - cancel(); - - }; - - - /** Public methods */ - function create(settings) { - - if (!(settings && settings.message)) { - - editor.core.log('Can\'t create notification. Message is missed'); - return; - - } - - settings.type = settings.type || 'alert'; - settings.time = settings.time*1000 || 10000; - - var wrapper = editor.draw.node('DIV', 'cdx-notification'), - message = editor.draw.node('DIV', 'cdx-notification__message'), - input = editor.draw.node('INPUT', 'cdx-notification__input'), - okBtn = editor.draw.node('SPAN', 'cdx-notification__ok-btn'), - cancelBtn = editor.draw.node('SPAN', 'cdx-notification__cancel-btn'); - - message.textContent = settings.message; - okBtn.textContent = settings.okMsg || 'ОК'; - cancelBtn.textContent = settings.cancelMsg || 'Отмена'; - - editor.listeners.add(okBtn, 'click', confirmHandler); - editor.listeners.add(cancelBtn, 'click', cancelHandler); - - wrapper.appendChild(message); - - if (settings.type == 'prompt') { - - wrapper.appendChild(input); - - } - - wrapper.appendChild(okBtn); - - if (settings.type == 'prompt' || settings.type == 'confirm') { - - wrapper.appendChild(cancelBtn); - - } - - wrapper.classList.add('cdx-notification-' + settings.type); - wrapper.dataset.type = settings.type; - - notification = wrapper; - type = settings.type; - confirm = settings.confirm; - cancel = settings.cancel; - inputField = input; - - if (settings.type != 'prompt' && settings.type != 'confirm') { - - window.setTimeout(close, settings.time); - - } - - }; - - /** - * Show notification block - */ - function send() { - - editor.nodes.notifications.appendChild(notification); - inputField.focus(); - - editor.nodes.notifications.classList.add('cdx-notification__notification-appending'); - - window.setTimeout(function () { - - editor.nodes.notifications.classList.remove('cdx-notification__notification-appending'); - - }, 100); - - addToQueue({type: type, close: close}); - - }; - - /** - * Remove notification block - */ - function close() { - - notification.remove(); - - }; - - - if (constructorSettings) { - - create(constructorSettings); - send(); - - } - - return { - create: create, - send: send, - close: close - }; - - }; - - notifications.clear = function () { - - editor.nodes.notifications.innerHTML = ''; - queue = []; - - }; - - return notifications; - -})({}); \ No newline at end of file diff --git a/modules/parser.js b/modules/parser.js deleted file mode 100644 index 70debc9c..00000000 --- a/modules/parser.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Codex Editor Parser Module - * - * @author Codex Team - * @version 1.1 - */ - -module.exports = (function (parser) { - - let editor = codex.editor; - - /** inserting text */ - parser.insertPastedContent = function (blockType, tag) { - - editor.content.insertBlock({ - type : blockType.type, - block : blockType.render({ - text : tag.innerHTML - }) - }); - - }; - - /** - * Check DOM node for display style: separated block or child-view - */ - parser.isFirstLevelBlock = function (node) { - - return node.nodeType == editor.core.nodeTypes.TAG && - node.classList.contains(editor.ui.className.BLOCK_CLASSNAME); - - }; - - return parser; - -})({}); diff --git a/modules/paste.js b/modules/paste.js deleted file mode 100644 index ae810185..00000000 --- a/modules/paste.js +++ /dev/null @@ -1,278 +0,0 @@ -/** - * Codex Editor Paste module - * - * @author Codex Team - * @version 1.1.1 - */ - -module.exports = function (paste) { - - let editor = codex.editor; - - var patterns = []; - - paste.prepare = function () { - - var tools = editor.tools; - - for (var tool in tools) { - - if (!tools[tool].renderOnPastePatterns || !Array.isArray(tools[tool].renderOnPastePatterns)) { - - continue; - - } - - tools[tool].renderOnPastePatterns.map(function (pattern) { - - - patterns.push(pattern); - - }); - - } - - return Promise.resolve(); - - }; - - /** - * Saves data - * @param event - */ - paste.pasted = function (event) { - - var clipBoardData = event.clipboardData || window.clipboardData, - content = clipBoardData.getData('Text'); - - var result = analize(content); - - if (result) { - - event.preventDefault(); - event.stopImmediatePropagation(); - - } - - return result; - - }; - - /** - * Analizes pated string and calls necessary method - */ - - var analize = function (string) { - - var result = false, - content = editor.content.currentNode, - plugin = content.dataset.tool; - - patterns.map( function (pattern) { - - var execArray = pattern.regex.exec(string), - match = execArray && execArray[0]; - - if ( match && match === string.trim()) { - - /** current block is not empty */ - if ( content.textContent.trim() && plugin == editor.settings.initialBlockPlugin ) { - - pasteToNewBlock_(); - - } - - pattern.callback(string, pattern); - result = true; - - } - - }); - - return result; - - }; - - var pasteToNewBlock_ = function () { - - /** Create new initial block */ - editor.content.insertBlock({ - - type : editor.settings.initialBlockPlugin, - block : editor.tools[editor.settings.initialBlockPlugin].render({ - text : '' - }) - - }, false); - - }; - - /** - * This method prevents default behaviour. - * - * @param {Object} event - * @protected - * - * @description We get from clipboard pasted data, sanitize, make a fragment that contains of this sanitized nodes. - * Firstly, we need to memorize the caret position. We can do that by getting the range of selection. - * After all, we insert clear fragment into caret placed position. Then, we should move the caret to the last node - */ - paste.blockPasteCallback = function (event) { - - - if (!needsToHandlePasteEvent(event.target)) { - - return; - - } - - /** Prevent default behaviour */ - event.preventDefault(); - - /** get html pasted data - dirty data */ - var htmlData = event.clipboardData.getData('text/html'), - plainData = event.clipboardData.getData('text/plain'); - - /** Temporary DIV that is used to work with text's paragraphs as DOM-elements*/ - var paragraphs = editor.draw.node('DIV', '', {}), - cleanData, - wrappedData; - - /** Create fragment, that we paste to range after proccesing */ - cleanData = editor.sanitizer.clean(htmlData); - - /** - * We wrap pasted text with

      tags to split it logically - * @type {string} - */ - wrappedData = editor.content.wrapTextWithParagraphs(cleanData, plainData); - paragraphs.innerHTML = wrappedData; - - /** - * If there only one paragraph, just insert in at the caret location - */ - if (paragraphs.childNodes.length == 1) { - - emulateUserAgentBehaviour(paragraphs.firstChild); - return; - - } - - insertPastedParagraphs(paragraphs.childNodes); - - }; - - /** - * Checks if we should handle paste event on block - * @param block - * - * @return {boolean} - */ - var needsToHandlePasteEvent = function (block) { - - /** If area is input or textarea then allow default behaviour */ - if ( editor.core.isNativeInput(block) ) { - - return false; - - } - - var editableParent = editor.content.getEditableParent(block); - - /** Allow paste when event target placed in Editable element */ - if (!editableParent) { - - return false; - - } - - return true; - - }; - - /** - * Inserts new initial plugin blocks with data in paragraphs - * - * @param {Array} paragraphs - array of paragraphs (

      ) whit content, that should be inserted - */ - var insertPastedParagraphs = function (paragraphs) { - - var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin, - currentNode = editor.content.currentNode; - - - paragraphs.forEach(function (paragraph) { - - /** Don't allow empty paragraphs */ - if (editor.core.isBlockEmpty(paragraph)) { - - return; - - } - - editor.content.insertBlock({ - type : NEW_BLOCK_TYPE, - block : editor.tools[NEW_BLOCK_TYPE].render({ - text : paragraph.innerHTML - }) - }); - - editor.caret.inputIndex++; - - }); - - editor.caret.setToPreviousBlock(editor.caret.getCurrentInputIndex() + 1); - - - /** - * If there was no data in working node, remove it - */ - if (editor.core.isBlockEmpty(currentNode)) { - - currentNode.remove(); - editor.ui.saveInputs(); - - } - - - }; - - /** - * Inserts node content at the caret position - * - * @param {Node} node - DOM node (could be DocumentFragment), that should be inserted at the caret location - */ - var emulateUserAgentBehaviour = function (node) { - - var newNode; - - if (node.childElementCount) { - - newNode = document.createDocumentFragment(); - - node.childNodes.forEach(function (current) { - - if (!editor.core.isDomNode(current) && current.data.trim() === '') { - - return; - - } - - newNode.appendChild(current.cloneNode(true)); - - }); - - } else { - - newNode = document.createTextNode(node.textContent); - - } - - editor.caret.insertNode(newNode); - - }; - - - return paste; - -}({}); \ No newline at end of file diff --git a/modules/renderer.js b/modules/renderer.js deleted file mode 100644 index 1704755b..00000000 --- a/modules/renderer.js +++ /dev/null @@ -1,203 +0,0 @@ -/** - * Codex Editor Renderer Module - * - * @author Codex Team - * @version 1.0 - */ - -module.exports = (function (renderer) { - - let editor = codex.editor; - - /** - * Asyncronously parses input JSON to redactor blocks - */ - renderer.makeBlocksFromData = function () { - - /** - * If redactor is empty, add first paragraph to start writing - */ - if (editor.core.isEmpty(editor.state.blocks) || !editor.state.blocks.items.length) { - - editor.ui.addInitialBlock(); - return; - - } - - Promise.resolve() - - /** First, get JSON from state */ - .then(function () { - - return editor.state.blocks; - - }) - - /** Then, start to iterate they */ - .then(editor.renderer.appendBlocks) - - /** Write log if something goes wrong */ - .catch(function (error) { - - editor.core.log('Error while parsing JSON: %o', 'error', error); - - }); - - }; - - /** - * Parses JSON to blocks - * @param {object} data - * @return Primise -> nodeList - */ - renderer.appendBlocks = function (data) { - - var blocks = data.items; - - /** - * Sequence of one-by-one blocks appending - * Uses to save blocks order after async-handler - */ - var nodeSequence = Promise.resolve(); - - for (var index = 0; index < blocks.length ; index++ ) { - - /** Add node to sequence at specified index */ - editor.renderer.appendNodeAtIndex(nodeSequence, blocks, index); - - } - - }; - - /** - * Append node at specified index - */ - renderer.appendNodeAtIndex = function (nodeSequence, blocks, index) { - - /** We need to append node to sequence */ - nodeSequence - - /** first, get node async-aware */ - .then(function () { - - return editor.renderer.getNodeAsync(blocks, index); - - }) - - /** - * second, compose editor-block from JSON object - */ - .then(editor.renderer.createBlockFromData) - - /** - * now insert block to redactor - */ - .then(function (blockData) { - - /** - * blockData has 'block', 'type' and 'stretched' information - */ - editor.content.insertBlock(blockData); - - /** Pass created block to next step */ - return blockData.block; - - }) - - /** Log if something wrong with node */ - .catch(function (error) { - - editor.core.log('Node skipped while parsing because %o', 'error', error); - - }); - - }; - - /** - * Asynchronously returns block data from blocksList by index - * @return Promise to node - */ - renderer.getNodeAsync = function (blocksList, index) { - - return Promise.resolve().then(function () { - - return { - tool : blocksList[index], - position : index - }; - - }); - - }; - - /** - * Creates editor block by JSON-data - * - * @uses render method of each plugin - * - * @param {Object} toolData.tool - * { header : { - * text: '', - * type: 'H3', ... - * } - * } - * @param {Number} toolData.position - index in input-blocks array - * @return {Object} with type and Element - */ - renderer.createBlockFromData = function ( toolData ) { - - /** New parser */ - var block, - tool = toolData.tool, - pluginName = tool.type; - - /** Get first key of object that stores plugin name */ - // for (var pluginName in blockData) break; - - /** Check for plugin existance */ - if (!editor.tools[pluginName]) { - - throw Error(`Plugin «${pluginName}» not found`); - - } - - /** Check for plugin having render method */ - if (typeof editor.tools[pluginName].render != 'function') { - - throw Error(`Plugin «${pluginName}» must have «render» method`); - - } - - if ( editor.tools[pluginName].available === false ) { - - block = editor.draw.unavailableBlock(); - - block.innerHTML = editor.tools[pluginName].loadingMessage; - - /** - * Saver will extract data from initial block data by position in array - */ - block.dataset.inputPosition = toolData.position; - - } else { - - /** New Parser */ - block = editor.tools[pluginName].render(tool.data); - - } - - /** is first-level block stretched */ - var stretched = editor.tools[pluginName].isStretched || false; - - /** Retrun type and block */ - return { - type : pluginName, - block : block, - stretched : stretched - }; - - }; - - return renderer; - -})({}); \ No newline at end of file diff --git a/modules/sanitizer.js b/modules/sanitizer.js deleted file mode 100644 index fe7ed7fc..00000000 --- a/modules/sanitizer.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Codex Sanitizer - */ - -module.exports = (function (sanitizer) { - - /** HTML Janitor library */ - let janitor = require('html-janitor'); - - /** Codex Editor */ - let editor = codex.editor; - - sanitizer.prepare = function () { - - if (editor.settings.sanitizer && !editor.core.isEmpty(editor.settings.sanitizer)) { - - Config.CUSTOM = editor.settings.sanitizer; - - } - - }; - - /** - * Basic config - */ - var Config = { - - /** User configuration */ - CUSTOM : null, - - BASIC : { - - tags: { - p: {}, - a: { - href: true, - target: '_blank', - rel: 'nofollow' - } - } - } - }; - - sanitizer.Config = Config; - - /** - * - * @param userCustomConfig - * @returns {*} - * @private - * - * @description If developer uses editor's API, then he can customize sane restrictions. - * Or, sane config can be defined globally in editors initialization. That config will be used everywhere - * At least, if there is no config overrides, that API uses BASIC Default configation - */ - let init_ = function (userCustomConfig) { - - let configuration = userCustomConfig || Config.CUSTOM || Config.BASIC; - - return new janitor(configuration); - - }; - - /** - * Cleans string from unwanted tags - * @protected - * @param {String} dirtyString - taint string - * @param {Object} customConfig - allowed tags - */ - sanitizer.clean = function (dirtyString, customConfig) { - - let janitorInstance = init_(customConfig); - - return janitorInstance.clean(dirtyString); - - }; - - return sanitizer; - -})({}); \ No newline at end of file diff --git a/modules/saver.js b/modules/saver.js deleted file mode 100644 index d3358931..00000000 --- a/modules/saver.js +++ /dev/null @@ -1,165 +0,0 @@ -/** - * Codex Editor Saver - * - * @author Codex Team - * @version 1.1.0 - */ - -module.exports = (function (saver) { - - let editor = codex.editor; - - /** - * @public - * Save blocks - */ - saver.save = function () { - - /** Save html content of redactor to memory */ - editor.state.html = editor.nodes.redactor.innerHTML; - - /** Clean jsonOutput state */ - editor.state.jsonOutput = []; - - return saveBlocks(editor.nodes.redactor.childNodes); - - }; - - /** - * @private - * Save each block data - * - * @param blocks - * @returns {Promise.} - */ - let saveBlocks = function (blocks) { - - let data = []; - - for(let index = 0; index < blocks.length; index++) { - - data.push(getBlockData(blocks[index])); - - } - - return Promise.all(data) - .then(makeOutput) - .catch(editor.core.log); - - }; - - /** Save and validate block data */ - let getBlockData = function (block) { - - return saveBlockData(block) - .then(validateBlockData) - .catch(editor.core.log); - - }; - - /** - * @private - * Call block`s plugin save method and return saved data - * - * @param block - * @returns {Object} - */ - let saveBlockData = function (block) { - - let pluginName = block.dataset.tool; - - /** Check for plugin existence */ - if (!editor.tools[pluginName]) { - - editor.core.log(`Plugin «${pluginName}» not found`, 'error'); - return {data: null, pluginName: null}; - - } - - /** Check for plugin having save method */ - if (typeof editor.tools[pluginName].save !== 'function') { - - editor.core.log(`Plugin «${pluginName}» must have save method`, 'error'); - return {data: null, pluginName: null}; - - } - - /** Result saver */ - let blockContent = block.childNodes[0], - pluginsContent = blockContent.childNodes[0], - position = pluginsContent.dataset.inputPosition; - - /** If plugin wasn't available then return data from cache */ - if ( editor.tools[pluginName].available === false ) { - - return Promise.resolve({data: codex.editor.state.blocks.items[position].data, pluginName}); - - } - - return Promise.resolve(pluginsContent) - .then(editor.tools[pluginName].save) - .then(data => Object({data, pluginName})); - - }; - - /** - * Call plugin`s validate method. Return false if validation failed - * - * @param data - * @param pluginName - * @returns {Object|Boolean} - */ - let validateBlockData = function ({data, pluginName}) { - - if (!data || !pluginName) { - - return false; - - } - - if (editor.tools[pluginName].validate) { - - let result = editor.tools[pluginName].validate(data); - - /** - * Do not allow invalid data - */ - if (!result) { - - return false; - - } - - } - - return {data, pluginName}; - - - }; - - /** - * Compile article output - * - * @param savedData - * @returns {{time: number, version, items: (*|Array)}} - */ - let makeOutput = function (savedData) { - - savedData = savedData.filter(blockData => blockData); - - let items = savedData.map(blockData => Object({type: blockData.pluginName, data: blockData.data})); - - editor.state.jsonOutput = items; - - return { - id: editor.state.blocks.id || null, - time: +new Date(), - version: editor.version, - items - }; - - }; - - return saver; - -})({}); diff --git a/modules/toolbar/inline.js b/modules/toolbar/inline.js deleted file mode 100644 index 0ba41a62..00000000 --- a/modules/toolbar/inline.js +++ /dev/null @@ -1,593 +0,0 @@ -/** - * Inline toolbar - * - * Contains from tools: - * Bold, Italic, Underline and Anchor - * - * @author Codex Team - * @version 1.0 - */ - -module.exports = (function (inline) { - - let editor = codex.editor; - - inline.buttonsOpened = null; - inline.actionsOpened = null; - inline.wrappersOffset = null; - - /** - * saving selection that need for execCommand for styling - * - */ - inline.storedSelection = null; - - /** - * @protected - * - * Open inline toobar - */ - inline.show = function () { - - var currentNode = editor.content.currentNode, - tool = currentNode.dataset.tool, - plugin; - - /** - * tool allowed to open inline toolbar - */ - plugin = editor.tools[tool]; - - if (!plugin.showInlineToolbar) - return; - - var selectedText = inline.getSelectionText(), - toolbar = editor.nodes.inlineToolbar.wrapper; - - if (selectedText.length > 0) { - - /** Move toolbar and open */ - editor.toolbar.inline.move(); - - /** Open inline toolbar */ - toolbar.classList.add('opened'); - - /** show buttons of inline toolbar */ - editor.toolbar.inline.showButtons(); - - } - - }; - - /** - * @protected - * - * Closes inline toolbar - */ - inline.close = function () { - - var toolbar = editor.nodes.inlineToolbar.wrapper; - - toolbar.classList.remove('opened'); - - }; - - /** - * @private - * - * Moving toolbar - */ - inline.move = function () { - - if (!this.wrappersOffset) { - - this.wrappersOffset = this.getWrappersOffset(); - - } - - var coords = this.getSelectionCoords(), - defaultOffset = 0, - toolbar = editor.nodes.inlineToolbar.wrapper, - newCoordinateX, - newCoordinateY; - - if (toolbar.offsetHeight === 0) { - - defaultOffset = 40; - - } - - newCoordinateX = coords.x - this.wrappersOffset.left; - newCoordinateY = coords.y + window.scrollY - this.wrappersOffset.top - defaultOffset - toolbar.offsetHeight; - - toolbar.style.transform = `translate3D(${Math.floor(newCoordinateX)}px, ${Math.floor(newCoordinateY)}px, 0)`; - - /** Close everything */ - editor.toolbar.inline.closeButtons(); - editor.toolbar.inline.closeAction(); - - }; - - /** - * @private - * - * Tool Clicked - */ - - inline.toolClicked = function (event, type) { - - /** - * For simple tools we use default browser function - * For more complicated tools, we should write our own behavior - */ - switch (type) { - case 'createLink' : editor.toolbar.inline.createLinkAction(event, type); break; - default : editor.toolbar.inline.defaultToolAction(type); break; - } - - /** - * highlight buttons - * after making some action - */ - editor.nodes.inlineToolbar.buttons.childNodes.forEach(editor.toolbar.inline.hightlight); - - }; - - /** - * @private - * - * Saving wrappers offset in DOM - */ - inline.getWrappersOffset = function () { - - var wrapper = editor.nodes.wrapper, - offset = this.getOffset(wrapper); - - this.wrappersOffset = offset; - return offset; - - }; - - /** - * @private - * - * Calculates offset of DOM element - * - * @param el - * @returns {{top: number, left: number}} - */ - inline.getOffset = function ( el ) { - - var _x = 0; - var _y = 0; - - while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) { - - _x += (el.offsetLeft + el.clientLeft); - _y += (el.offsetTop + el.clientTop); - el = el.offsetParent; - - } - return { top: _y, left: _x }; - - }; - - /** - * @private - * - * Calculates position of selected text - * @returns {{x: number, y: number}} - */ - inline.getSelectionCoords = function () { - - var sel = document.selection, range; - var x = 0, y = 0; - - if (sel) { - - if (sel.type != 'Control') { - - range = sel.createRange(); - range.collapse(true); - x = range.boundingLeft; - y = range.boundingTop; - - } - - } else if (window.getSelection) { - - sel = window.getSelection(); - - if (sel.rangeCount) { - - range = sel.getRangeAt(0).cloneRange(); - if (range.getClientRects) { - - range.collapse(true); - var rect = range.getClientRects()[0]; - - if (!rect) { - - return; - - } - - x = rect.left; - y = rect.top; - - } - - } - - } - return { x: x, y: y }; - - }; - - /** - * @private - * - * Returns selected text as String - * @returns {string} - */ - inline.getSelectionText = function () { - - var selectedText = ''; - - // all modern browsers and IE9+ - if (window.getSelection) { - - selectedText = window.getSelection().toString(); - - } - - return selectedText; - - }; - - /** Opens buttons block */ - inline.showButtons = function () { - - var buttons = editor.nodes.inlineToolbar.buttons; - - buttons.classList.add('opened'); - - editor.toolbar.inline.buttonsOpened = true; - - /** highlight buttons */ - editor.nodes.inlineToolbar.buttons.childNodes.forEach(editor.toolbar.inline.hightlight); - - }; - - /** Makes buttons disappear */ - inline.closeButtons = function () { - - var buttons = editor.nodes.inlineToolbar.buttons; - - buttons.classList.remove('opened'); - - editor.toolbar.inline.buttonsOpened = false; - - }; - - /** Open buttons defined action if exist */ - inline.showActions = function () { - - var action = editor.nodes.inlineToolbar.actions; - - action.classList.add('opened'); - - editor.toolbar.inline.actionsOpened = true; - - }; - - /** Close actions block */ - inline.closeAction = function () { - - var action = editor.nodes.inlineToolbar.actions; - - action.innerHTML = ''; - action.classList.remove('opened'); - editor.toolbar.inline.actionsOpened = false; - - }; - - - /** - * Callback for keydowns in inline toolbar "Insert link..." input - */ - let inlineToolbarAnchorInputKeydown_ = function (event) { - - if (event.keyCode != editor.core.keys.ENTER) { - - return; - - } - - let editable = editor.content.currentNode, - storedSelection = editor.toolbar.inline.storedSelection; - - editor.toolbar.inline.restoreSelection(editable, storedSelection); - editor.toolbar.inline.setAnchor(this.value); - - /** - * Preventing events that will be able to happen - */ - event.preventDefault(); - event.stopImmediatePropagation(); - - editor.toolbar.inline.clearRange(); - - }; - - /** Action for link creation or for setting anchor */ - inline.createLinkAction = function (event) { - - var isActive = this.isLinkActive(); - - var editable = editor.content.currentNode, - storedSelection = editor.toolbar.inline.saveSelection(editable); - - /** Save globally selection */ - editor.toolbar.inline.storedSelection = storedSelection; - - if (isActive) { - - - /** - * Changing stored selection. if we want to remove anchor from word - * we should remove anchor from whole word, not only selected part. - * The solution is than we get the length of current link - * Change start position to - end of selection minus length of anchor - */ - editor.toolbar.inline.restoreSelection(editable, storedSelection); - - editor.toolbar.inline.defaultToolAction('unlink'); - - } else { - - /** Create input and close buttons */ - var action = editor.draw.inputForLink(); - - editor.nodes.inlineToolbar.actions.appendChild(action); - - editor.toolbar.inline.closeButtons(); - editor.toolbar.inline.showActions(); - - /** - * focus to input - * Solution: https://developer.mozilla.org/ru/docs/Web/API/HTMLElement/focus - * Prevents event after showing input and when we need to focus an input which is in unexisted form - */ - action.focus(); - event.preventDefault(); - - /** Callback to link action */ - editor.listeners.add(action, 'keydown', inlineToolbarAnchorInputKeydown_, false); - - } - - }; - - inline.isLinkActive = function () { - - var isActive = false; - - editor.nodes.inlineToolbar.buttons.childNodes.forEach(function (tool) { - - var dataType = tool.dataset.type; - - if (dataType == 'link' && tool.classList.contains('hightlighted')) { - - isActive = true; - - } - - }); - - return isActive; - - }; - - /** default action behavior of tool */ - inline.defaultToolAction = function (type) { - - document.execCommand(type, false, null); - - }; - - /** - * @private - * - * Sets URL - * - * @param {String} url - URL - */ - inline.setAnchor = function (url) { - - document.execCommand('createLink', false, url); - - /** Close after URL inserting */ - editor.toolbar.inline.closeAction(); - - }; - - /** - * @private - * - * Saves selection - */ - inline.saveSelection = function (containerEl) { - - var range = window.getSelection().getRangeAt(0), - preSelectionRange = range.cloneRange(), - start; - - preSelectionRange.selectNodeContents(containerEl); - preSelectionRange.setEnd(range.startContainer, range.startOffset); - - start = preSelectionRange.toString().length; - - return { - start: start, - end: start + range.toString().length - }; - - }; - - /** - * @private - * - * Sets to previous selection (Range) - * - * @param {Element} containerEl - editable element where we restore range - * @param {Object} savedSel - range basic information to restore - */ - inline.restoreSelection = function (containerEl, savedSel) { - - var range = document.createRange(), - charIndex = 0; - - range.setStart(containerEl, 0); - range.collapse(true); - - var nodeStack = [ containerEl ], - node, - foundStart = false, - stop = false, - nextCharIndex; - - while (!stop && (node = nodeStack.pop())) { - - if (node.nodeType == 3) { - - nextCharIndex = charIndex + node.length; - - if (!foundStart && savedSel.start >= charIndex && savedSel.start <= nextCharIndex) { - - range.setStart(node, savedSel.start - charIndex); - foundStart = true; - - } - if (foundStart && savedSel.end >= charIndex && savedSel.end <= nextCharIndex) { - - range.setEnd(node, savedSel.end - charIndex); - stop = true; - - } - charIndex = nextCharIndex; - - } else { - - var i = node.childNodes.length; - - while (i--) { - - nodeStack.push(node.childNodes[i]); - - } - - } - - } - - var sel = window.getSelection(); - - sel.removeAllRanges(); - sel.addRange(range); - - }; - - /** - * @private - * - * Removes all ranges from window selection - */ - inline.clearRange = function () { - - var selection = window.getSelection(); - - selection.removeAllRanges(); - - }; - - /** - * @private - * - * sets or removes hightlight - */ - inline.hightlight = function (tool) { - - var dataType = tool.dataset.type; - - if (document.queryCommandState(dataType)) { - - editor.toolbar.inline.setButtonHighlighted(tool); - - } else { - - editor.toolbar.inline.removeButtonsHighLight(tool); - - } - - /** - * - * hightlight for anchors - */ - var selection = window.getSelection(), - tag = selection.anchorNode.parentNode; - - if (tag.tagName == 'A' && dataType == 'link') { - - editor.toolbar.inline.setButtonHighlighted(tool); - - } - - }; - - /** - * @private - * - * Mark button if text is already executed - */ - inline.setButtonHighlighted = function (button) { - - button.classList.add('hightlighted'); - - /** At link tool we also change icon */ - if (button.dataset.type == 'link') { - - var icon = button.childNodes[0]; - - icon.classList.remove('ce-icon-link'); - icon.classList.add('ce-icon-unlink'); - - } - - }; - - /** - * @private - * - * Removes hightlight - */ - inline.removeButtonsHighLight = function (button) { - - button.classList.remove('hightlighted'); - - /** At link tool we also change icon */ - if (button.dataset.type == 'link') { - - var icon = button.childNodes[0]; - - icon.classList.remove('ce-icon-unlink'); - icon.classList.add('ce-icon-link'); - - } - - }; - - - return inline; - -})({}); \ No newline at end of file diff --git a/modules/toolbar/settings.js b/modules/toolbar/settings.js deleted file mode 100644 index 307c719d..00000000 --- a/modules/toolbar/settings.js +++ /dev/null @@ -1,172 +0,0 @@ -/** - * Toolbar settings - * - * @version 1.0.5 - */ - -module.exports = (function (settings) { - - let editor = codex.editor; - - settings.opened = false; - - settings.setting = null; - settings.actions = null; - - /** - * Append and open settings - */ - settings.open = function (toolType) { - - /** - * Append settings content - * It's stored in tool.settings - */ - if ( !editor.tools[toolType] || !editor.tools[toolType].makeSettings ) { - - return; - - } - - /** - * Draw settings block - */ - var settingsBlock = editor.tools[toolType].makeSettings(); - - editor.nodes.pluginSettings.appendChild(settingsBlock); - - - /** Open settings block */ - editor.nodes.blockSettings.classList.add('opened'); - this.opened = true; - - }; - - /** - * Close and clear settings - */ - settings.close = function () { - - editor.nodes.blockSettings.classList.remove('opened'); - editor.nodes.pluginSettings.innerHTML = ''; - - this.opened = false; - - }; - - /** - * @param {string} toolType - plugin type - */ - settings.toggle = function ( toolType ) { - - if ( !this.opened ) { - - this.open(toolType); - - } else { - - this.close(); - - } - - }; - - /** - * Here we will draw buttons and add listeners to components - */ - settings.makeRemoveBlockButton = function () { - - var removeBlockWrapper = editor.draw.node('SPAN', 'ce-toolbar__remove-btn', {}), - settingButton = editor.draw.node('SPAN', 'ce-toolbar__remove-setting', { innerHTML : '' }), - actionWrapper = editor.draw.node('DIV', 'ce-toolbar__remove-confirmation', {}), - confirmAction = editor.draw.node('DIV', 'ce-toolbar__remove-confirm', { textContent : 'Удалить блок' }), - cancelAction = editor.draw.node('DIV', 'ce-toolbar__remove-cancel', { textContent : 'Отмена' }); - - editor.listeners.add(settingButton, 'click', editor.toolbar.settings.removeButtonClicked, false); - - editor.listeners.add(confirmAction, 'click', editor.toolbar.settings.confirmRemovingRequest, false); - - editor.listeners.add(cancelAction, 'click', editor.toolbar.settings.cancelRemovingRequest, false); - - actionWrapper.appendChild(confirmAction); - actionWrapper.appendChild(cancelAction); - - removeBlockWrapper.appendChild(settingButton); - removeBlockWrapper.appendChild(actionWrapper); - - /** Save setting */ - editor.toolbar.settings.setting = settingButton; - editor.toolbar.settings.actions = actionWrapper; - - return removeBlockWrapper; - - }; - - settings.removeButtonClicked = function () { - - var action = editor.toolbar.settings.actions; - - if (action.classList.contains('opened')) { - - editor.toolbar.settings.hideRemoveActions(); - - } else { - - editor.toolbar.settings.showRemoveActions(); - - } - - editor.toolbar.toolbox.close(); - editor.toolbar.settings.close(); - - }; - - settings.cancelRemovingRequest = function () { - - editor.toolbar.settings.actions.classList.remove('opened'); - - }; - - settings.confirmRemovingRequest = function () { - - var currentBlock = editor.content.currentNode, - firstLevelBlocksCount; - - currentBlock.remove(); - - firstLevelBlocksCount = editor.nodes.redactor.childNodes.length; - - /** - * If all blocks are removed - */ - if (firstLevelBlocksCount === 0) { - - /** update currentNode variable */ - editor.content.currentNode = null; - - /** Inserting new empty initial block */ - editor.ui.addInitialBlock(); - - } - - editor.ui.saveInputs(); - - editor.toolbar.close(); - - }; - - settings.showRemoveActions = function () { - - editor.toolbar.settings.actions.classList.add('opened'); - - }; - - settings.hideRemoveActions = function () { - - editor.toolbar.settings.actions.classList.remove('opened'); - - }; - - return settings; - -})({}); diff --git a/modules/toolbar/toolbar.js b/modules/toolbar/toolbar.js deleted file mode 100644 index e59b7d68..00000000 --- a/modules/toolbar/toolbar.js +++ /dev/null @@ -1,133 +0,0 @@ -/** - * Codex Editor toolbar module - * - * Contains: - * - Inline toolbox - * - Toolbox within plus button - * - Settings section - * - * @author Codex Team - * @version 1.0 - */ - -module.exports = (function (toolbar) { - - let editor = codex.editor; - - toolbar.settings = require('./settings'); - toolbar.inline = require('./inline'); - toolbar.toolbox = require('./toolbox'); - - /** - * Margin between focused node and toolbar - */ - toolbar.defaultToolbarHeight = 49; - - toolbar.defaultOffset = 34; - - toolbar.opened = false; - - toolbar.current = null; - - /** - * @protected - */ - toolbar.open = function () { - - if (editor.hideToolbar) { - - return; - - } - - let toolType = editor.content.currentNode.dataset.tool; - - if (!editor.tools[toolType] || !editor.tools[toolType].makeSettings ) { - - editor.nodes.showSettingsButton.classList.add('hide'); - - } else { - - editor.nodes.showSettingsButton.classList.remove('hide'); - - } - - editor.nodes.toolbar.classList.add('opened'); - this.opened = true; - - }; - - /** - * @protected - */ - toolbar.close = function () { - - editor.nodes.toolbar.classList.remove('opened'); - - toolbar.opened = false; - toolbar.current = null; - - for (var button in editor.nodes.toolbarButtons) { - - editor.nodes.toolbarButtons[button].classList.remove('selected'); - - } - - /** Close toolbox when toolbar is not displayed */ - editor.toolbar.toolbox.close(); - editor.toolbar.settings.close(); - - }; - - toolbar.toggle = function () { - - if ( !this.opened ) { - - this.open(); - - } else { - - this.close(); - - } - - }; - - toolbar.hidePlusButton = function () { - - editor.nodes.plusButton.classList.add('hide'); - - }; - - toolbar.showPlusButton = function () { - - editor.nodes.plusButton.classList.remove('hide'); - - }; - - /** - * Moving toolbar to the specified node - */ - toolbar.move = function () { - - /** Close Toolbox when we move toolbar */ - editor.toolbar.toolbox.close(); - - if (!editor.content.currentNode) { - - return; - - } - - var newYCoordinate = editor.content.currentNode.offsetTop - (editor.toolbar.defaultToolbarHeight / 2) + editor.toolbar.defaultOffset; - - editor.nodes.toolbar.style.transform = `translate3D(0, ${Math.floor(newYCoordinate)}px, 0)`; - - /** Close trash actions */ - editor.toolbar.settings.hideRemoveActions(); - - }; - - return toolbar; - -})({}); diff --git a/modules/toolbar/toolbox.js b/modules/toolbar/toolbox.js deleted file mode 100644 index cec3e980..00000000 --- a/modules/toolbar/toolbox.js +++ /dev/null @@ -1,191 +0,0 @@ -/** - * Codex Editor toolbox - * - * All tools be able to appended here - * - * @author Codex Team - * @version 1.0 - */ - -module.exports = (function (toolbox) { - - let editor = codex.editor; - - toolbox.opened = false; - toolbox.openedOnBlock = null; - - /** Shows toolbox */ - toolbox.open = function () { - - /** Close setting if toolbox is opened */ - if (editor.toolbar.settings.opened) { - - editor.toolbar.settings.close(); - - } - - /** Add 'toolbar-opened' class for current block **/ - toolbox.openedOnBlock = editor.content.currentNode; - toolbox.openedOnBlock.classList.add('toolbar-opened'); - - /** display toolbox */ - editor.nodes.toolbox.classList.add('opened'); - - /** Animate plus button */ - editor.nodes.plusButton.classList.add('clicked'); - - /** toolbox state */ - editor.toolbar.toolbox.opened = true; - - }; - - /** Closes toolbox */ - toolbox.close = function () { - - /** Remove 'toolbar-opened' class from current block **/ - if (toolbox.openedOnBlock) toolbox.openedOnBlock.classList.remove('toolbar-opened'); - toolbox.openedOnBlock = null; - - /** Makes toolbox disappear */ - editor.nodes.toolbox.classList.remove('opened'); - - /** Rotate plus button */ - editor.nodes.plusButton.classList.remove('clicked'); - - /** toolbox state */ - editor.toolbar.toolbox.opened = false; - - editor.toolbar.current = null; - - }; - - toolbox.leaf = function () { - - let currentTool = editor.toolbar.current, - tools = Object.keys(editor.tools), - barButtons = editor.nodes.toolbarButtons, - nextToolIndex = 0, - toolToSelect, - visibleTool, - tool; - - if ( !currentTool ) { - - /** Get first tool from object*/ - for(tool in editor.tools) { - - if (editor.tools[tool].displayInToolbox) { - - break; - - } - - nextToolIndex ++; - - } - - } else { - - nextToolIndex = (tools.indexOf(currentTool) + 1) % tools.length; - visibleTool = tools[nextToolIndex]; - - while (!editor.tools[visibleTool].displayInToolbox) { - - nextToolIndex = (nextToolIndex + 1) % tools.length; - visibleTool = tools[nextToolIndex]; - - } - - } - - toolToSelect = tools[nextToolIndex]; - - for ( var button in barButtons ) { - - barButtons[button].classList.remove('selected'); - - } - - barButtons[toolToSelect].classList.add('selected'); - editor.toolbar.current = toolToSelect; - - }; - - /** - * Transforming selected node type into selected toolbar element type - * @param {event} event - */ - toolbox.toolClicked = function (event) { - - /** - * UNREPLACEBLE_TOOLS this types of tools are forbidden to replace even they are empty - */ - var UNREPLACEBLE_TOOLS = ['image', 'link', 'list', 'instagram', 'twitter', 'embed'], - tool = editor.tools[editor.toolbar.current], - workingNode = editor.content.currentNode, - currentInputIndex = editor.caret.inputIndex, - newBlockContent, - appendCallback, - blockData; - - /** Make block from plugin */ - newBlockContent = tool.render(); - - /** information about block */ - blockData = { - block : newBlockContent, - type : tool.type, - stretched : false - }; - - if ( - workingNode && - UNREPLACEBLE_TOOLS.indexOf(workingNode.dataset.tool) === -1 && - workingNode.textContent.trim() === '' - ) { - - /** Replace current block */ - editor.content.switchBlock(workingNode, newBlockContent, tool.type); - - } else { - - /** Insert new Block from plugin */ - editor.content.insertBlock(blockData); - - /** increase input index */ - currentInputIndex++; - - } - - /** Fire tool append callback */ - appendCallback = tool.appendCallback; - - if (appendCallback && typeof appendCallback == 'function') { - - appendCallback.call(event); - - } - - window.setTimeout(function () { - - /** Set caret to current block */ - editor.caret.setToBlock(currentInputIndex); - - }, 10); - - - /** - * Changing current Node - */ - editor.content.workingNodeChanged(); - - /** - * Move toolbar when node is changed - */ - editor.toolbar.move(); - - }; - - return toolbox; - -})({}); \ No newline at end of file diff --git a/modules/tools.js b/modules/tools.js deleted file mode 100644 index 044e0674..00000000 --- a/modules/tools.js +++ /dev/null @@ -1,153 +0,0 @@ -/** -* Module working with plugins -*/ -module.exports = (function () { - - let editor = codex.editor; - - /** - * Initialize plugins before using - * Ex. Load scripts or call some internal methods - * @return Promise - */ - function prepare() { - - return new Promise(function (resolve_, reject_) { - - Promise.resolve() - - /** - * Compose a sequence of plugins that requires preparation - */ - .then(function () { - - let pluginsRequiresPreparation = [], - allPlugins = editor.tools; - - for ( let pluginName in allPlugins ) { - - let plugin = allPlugins[pluginName]; - - if (plugin.prepare && typeof plugin.prepare != 'function' || !plugin.prepare) { - - continue; - - } - - pluginsRequiresPreparation.push(plugin); - - } - - /** - * If no one passed plugins requires preparation, finish prepare() and go ahead - */ - if (!pluginsRequiresPreparation.length) { - - resolve_(); - - } - - return pluginsRequiresPreparation; - - }) - - /** Wait plugins while they prepares */ - .then(waitAllPluginsPreparation_) - - .then(function () { - - editor.core.log('Plugins loaded', 'info'); - resolve_(); - - }).catch(function (error) { - - reject_(error); - - }); - - }); - - } - - /** - * @param {array} plugins - list of tools that requires preparation - * @return {Promise} resolved while all plugins will be ready or failed - */ - function waitAllPluginsPreparation_(plugins) { - - /** - * @calls allPluginsProcessed__ when all plugins prepared or failed - */ - return new Promise (function (allPluginsProcessed__) { - - /** - * pluck each element from queue - * First, send resolved Promise as previous value - * Each plugins "prepare" method returns a Promise, that's why - * reduce current element will not be able to continue while can't get - * a resolved Promise - * - * If last plugin is "prepared" then go to the next stage of initialization - */ - plugins.reduce(function (previousValue, plugin, iteration) { - - return previousValue.then(function () { - - /** - * Wait till plugins prepared - * @calls pluginIsReady__ when plugin is ready or failed - */ - return new Promise ( function (pluginIsReady__) { - - callPluginsPrepareMethod_( plugin ) - - .then( pluginIsReady__ ) - .then( function () { - - plugin.available = true; - - }) - - .catch(function (error) { - - editor.core.log(`Plugin «${plugin.type}» was not loaded. Preparation failed because %o`, 'warn', error); - plugin.available = false; - plugin.loadingMessage = error; - - /** Go ahead even some plugin has problems */ - pluginIsReady__(); - - }) - - .then(function () { - - /** If last plugin has problems then just ignore and continue */ - if (iteration == plugins.length - 1) { - - allPluginsProcessed__(); - - } - - }); - - }); - - }); - - }, Promise.resolve() ); - - }); - - } - - var callPluginsPrepareMethod_ = function (plugin) { - - return plugin.prepare( plugin.config || {} ); - - }; - - return { - prepare: prepare - }; - -}()); \ No newline at end of file diff --git a/modules/transport.js b/modules/transport.js deleted file mode 100644 index 7f659e37..00000000 --- a/modules/transport.js +++ /dev/null @@ -1,136 +0,0 @@ -/** - * - * Codex.Editor Transport Module - * - * @copyright 2017 Codex-Team - * @version 1.2.0 - */ - -module.exports = (function (transport) { - - let editor = codex.editor; - - - /** - * @private {Object} current XmlHttpRequest instance - */ - var currentRequest = null; - - - /** - * @type {null} | {DOMElement} input - keeps input element in memory - */ - transport.input = null; - - /** - * @property {Object} arguments - keep plugin settings and defined callbacks - */ - transport.arguments = null; - - /** - * Prepares input element where will be files - */ - transport.prepare = function () { - - let input = editor.draw.node( 'INPUT', '', { type : 'file' } ); - - editor.listeners.add(input, 'change', editor.transport.fileSelected); - editor.transport.input = input; - - }; - - /** Clear input when files is uploaded */ - transport.clearInput = function () { - - /** Remove old input */ - transport.input = null; - - /** Prepare new one */ - transport.prepare(); - - }; - - /** - * Callback for file selection - * @param {Event} event - */ - transport.fileSelected = function () { - - var input = this, - i, - files = input.files, - formData = new FormData(); - - if (editor.transport.arguments.multiple === true) { - - for ( i = 0; i < files.length; i++) { - - formData.append('files[]', files[i], files[i].name); - - } - - } else { - - formData.append('files', files[0], files[0].name); - - } - - currentRequest = editor.core.ajax({ - type : 'POST', - data : formData, - url : editor.transport.arguments.url, - beforeSend : editor.transport.arguments.beforeSend, - success : editor.transport.arguments.success, - error : editor.transport.arguments.error, - progress : editor.transport.arguments.progress - }); - - /** Clear input */ - transport.clearInput(); - - }; - - /** - * Use plugin callbacks - * @protected - * - * @param {Object} args - can have : - * @param {String} args.url - fetch URL - * @param {Function} args.beforeSend - function calls before sending ajax - * @param {Function} args.success - success callback - * @param {Function} args.error - on error handler - * @param {Function} args.progress - xhr onprogress handler - * @param {Boolean} args.multiple - allow select several files - * @param {String} args.accept - adds accept attribute - */ - transport.selectAndUpload = function (args) { - - transport.arguments = args; - - if ( args.multiple === true) { - - transport.input.setAttribute('multiple', 'multiple'); - - } - - if ( args.accept ) { - - transport.input.setAttribute('accept', args.accept); - - } - - transport.input.click(); - - }; - - transport.abort = function () { - - currentRequest.abort(); - - currentRequest = null; - - }; - - return transport; - -})({}); \ No newline at end of file diff --git a/modules/ui.js b/modules/ui.js deleted file mode 100644 index 736e8f1d..00000000 --- a/modules/ui.js +++ /dev/null @@ -1,431 +0,0 @@ -/** - * Codex Editor UI module - * - * @author Codex Team - * @version 1.2.0 - */ - -module.exports = (function (ui) { - - let editor = codex.editor; - - /** - * Basic editor classnames - */ - ui.className = { - - /** - * @const {string} BLOCK_CLASSNAME - redactor blocks name - */ - BLOCK_CLASSNAME : 'ce-block', - - /** - * @const {String} wrapper for plugins content - */ - BLOCK_CONTENT : 'ce-block__content', - - /** - * @const {String} BLOCK_STRETCHED - makes block stretched - */ - BLOCK_STRETCHED : 'ce-block--stretched', - - /** - * @const {String} BLOCK_HIGHLIGHTED - adds background - */ - BLOCK_HIGHLIGHTED : 'ce-block--focused', - - /** - * @const {String} - for all default settings - */ - SETTINGS_ITEM : 'ce-settings__item' - - }; - - /** - * @protected - * - * Making main interface - */ - ui.prepare = function () { - - return new Promise(function (resolve) { - - let wrapper = editor.draw.wrapper(), - redactor = editor.draw.redactor(), - toolbar = makeToolBar_(); - - wrapper.appendChild(toolbar); - wrapper.appendChild(redactor); - - /** Save created ui-elements to static nodes state */ - editor.nodes.wrapper = wrapper; - editor.nodes.redactor = redactor; - - /** Append editor wrapper with redactor zone into holder */ - editor.nodes.holder.appendChild(wrapper); - - resolve(); - - }) - - /** Add toolbox tools */ - .then(addTools_) - - /** Make container for inline toolbar */ - .then(makeInlineToolbar_) - - /** Add inline toolbar tools */ - .then(addInlineToolbarTools_) - - /** Draw wrapper for notifications */ - .then(makeNotificationHolder_) - - /** Add eventlisteners to redactor elements */ - .then(bindEvents_) - - .catch( function () { - - editor.core.log("Can't draw editor interface"); - - }); - - }; - - /** - * @private - * Draws inline toolbar zone - */ - var makeInlineToolbar_ = function () { - - var container = editor.draw.inlineToolbar(); - - /** Append to redactor new inline block */ - editor.nodes.inlineToolbar.wrapper = container; - - /** Draw toolbar buttons */ - editor.nodes.inlineToolbar.buttons = editor.draw.inlineToolbarButtons(); - - /** Buttons action or settings */ - editor.nodes.inlineToolbar.actions = editor.draw.inlineToolbarActions(); - - /** Append to inline toolbar buttons as part of it */ - editor.nodes.inlineToolbar.wrapper.appendChild(editor.nodes.inlineToolbar.buttons); - editor.nodes.inlineToolbar.wrapper.appendChild(editor.nodes.inlineToolbar.actions); - - editor.nodes.wrapper.appendChild(editor.nodes.inlineToolbar.wrapper); - - }; - - var makeToolBar_ = function () { - - let toolbar = editor.draw.toolbar(), - blockButtons = makeToolbarSettings_(), - toolbarContent = makeToolbarContent_(); - - /** Appending first-level block buttons */ - toolbar.appendChild(blockButtons); - - /** Append toolbarContent to toolbar */ - toolbar.appendChild(toolbarContent); - - /** Make toolbar global */ - editor.nodes.toolbar = toolbar; - - return toolbar; - - }; - - var makeToolbarContent_ = function () { - - let toolbarContent = editor.draw.toolbarContent(), - toolbox = editor.draw.toolbox(), - plusButton = editor.draw.plusButton(); - - /** Append plus button */ - toolbarContent.appendChild(plusButton); - - /** Appending toolbar tools */ - toolbarContent.appendChild(toolbox); - - /** Make Toolbox and plusButton global */ - editor.nodes.toolbox = toolbox; - editor.nodes.plusButton = plusButton; - - return toolbarContent; - - }; - - var makeToolbarSettings_ = function () { - - let blockSettings = editor.draw.blockSettings(), - blockButtons = editor.draw.blockButtons(), - defaultSettings = editor.draw.defaultSettings(), - showSettingsButton = editor.draw.settingsButton(), - showTrashButton = editor.toolbar.settings.makeRemoveBlockButton(), - pluginSettings = editor.draw.pluginsSettings(); - - /** Add default and plugins settings */ - blockSettings.appendChild(pluginSettings); - blockSettings.appendChild(defaultSettings); - - /** - * Make blocks buttons - * This block contains settings button and remove block button - */ - blockButtons.appendChild(showSettingsButton); - blockButtons.appendChild(showTrashButton); - blockButtons.appendChild(blockSettings); - - /** Make BlockSettings, PluginSettings, DefaultSettings global */ - editor.nodes.blockSettings = blockSettings; - editor.nodes.pluginSettings = pluginSettings; - editor.nodes.defaultSettings = defaultSettings; - editor.nodes.showSettingsButton = showSettingsButton; - editor.nodes.showTrashButton = showTrashButton; - - return blockButtons; - - }; - - /** Draw notifications holder */ - var makeNotificationHolder_ = function () { - - /** Append block with notifications to the document */ - editor.nodes.notifications = editor.notifications.createHolder(); - - }; - - /** - * @private - * Append tools passed in editor.tools - */ - var addTools_ = function () { - - var tool, - toolName, - toolButton; - - for ( toolName in editor.settings.tools ) { - - tool = editor.settings.tools[toolName]; - - editor.tools[toolName] = tool; - - if (!tool.iconClassname && tool.displayInToolbox) { - - editor.core.log('Toolbar icon classname missed. Tool %o skipped', 'warn', toolName); - continue; - - } - - if (typeof tool.render != 'function') { - - editor.core.log('render method missed. Tool %o skipped', 'warn', toolName); - continue; - - } - - if (!tool.displayInToolbox) { - - continue; - - } else { - - /** if tools is for toolbox */ - toolButton = editor.draw.toolbarButton(toolName, tool.iconClassname); - - editor.nodes.toolbox.appendChild(toolButton); - - editor.nodes.toolbarButtons[toolName] = toolButton; - - } - - } - - }; - - var addInlineToolbarTools_ = function () { - - var tools = { - - bold: { - icon : 'ce-icon-bold', - command : 'bold' - }, - - italic: { - icon : 'ce-icon-italic', - command : 'italic' - }, - - link: { - icon : 'ce-icon-link', - command : 'createLink' - } - }; - - var toolButton, - tool; - - for(var name in tools) { - - tool = tools[name]; - - toolButton = editor.draw.toolbarButtonInline(name, tool.icon); - - editor.nodes.inlineToolbar.buttons.appendChild(toolButton); - /** - * Add callbacks to this buttons - */ - editor.ui.setInlineToolbarButtonBehaviour(toolButton, tool.command); - - } - - }; - - /** - * @private - * Bind editor UI events - */ - var bindEvents_ = function () { - - editor.core.log('ui.bindEvents fired', 'info'); - - // window.addEventListener('error', function (errorMsg, url, lineNumber) { - // editor.notifications.errorThrown(errorMsg, event); - // }, false ); - - /** All keydowns on Document */ - editor.listeners.add(document, 'keydown', editor.callback.globalKeydown, false); - - /** All keydowns on Redactor zone */ - editor.listeners.add(editor.nodes.redactor, 'keydown', editor.callback.redactorKeyDown, false); - - /** All keydowns on Document */ - editor.listeners.add(document, 'keyup', editor.callback.globalKeyup, false ); - - /** - * Mouse click to radactor - */ - editor.listeners.add(editor.nodes.redactor, 'click', editor.callback.redactorClicked, false ); - - /** - * Clicks to the Plus button - */ - editor.listeners.add(editor.nodes.plusButton, 'click', editor.callback.plusButtonClicked, false); - - /** - * Clicks to SETTINGS button in toolbar - */ - editor.listeners.add(editor.nodes.showSettingsButton, 'click', editor.callback.showSettingsButtonClicked, false ); - - /** Bind click listeners on toolbar buttons */ - for (var button in editor.nodes.toolbarButtons) { - - editor.listeners.add(editor.nodes.toolbarButtons[button], 'click', editor.callback.toolbarButtonClicked, false); - - } - - }; - - ui.addBlockHandlers = function (block) { - - if (!block) return; - - /** - * Block keydowns - */ - editor.listeners.add(block, 'keydown', editor.callback.blockKeydown, false); - - /** - * Pasting content from another source - * We have two type of sanitization - * First - uses deep-first search algorithm to get sub nodes, - * sanitizes whole Block_content and replaces cleared nodes - * This method is deprecated - * Method is used in editor.callback.blockPaste(event) - * - * Secont - uses Mutation observer. - * Observer "observe" DOM changes and send changings to callback. - * Callback gets changed node, not whole Block_content. - * Inserted or changed node, which we've gotten have been cleared and replaced with diry node - * - * Method is used in editor.callback.blockPasteViaSanitize(event) - * - * @uses html-janitor - * @example editor.callback.blockPasteViaSanitize(event), the second method. - * - */ - editor.listeners.add(block, 'paste', editor.paste.blockPasteCallback, false); - - /** - * Show inline toolbar for selected text - */ - editor.listeners.add(block, 'mouseup', editor.toolbar.inline.show, false); - editor.listeners.add(block, 'keyup', editor.toolbar.inline.show, false); - - }; - - /** getting all contenteditable elements */ - ui.saveInputs = function () { - - var redactor = editor.nodes.redactor; - - editor.state.inputs = []; - - /** Save all inputs in global variable state */ - var inputs = redactor.querySelectorAll('[contenteditable], input, textarea'); - - Array.prototype.map.call(inputs, function (current) { - - if (!current.type || current.type == 'text' || current.type == 'textarea') { - - editor.state.inputs.push(current); - - } - - }); - - }; - - /** - * Adds first initial block on empty redactor - */ - ui.addInitialBlock = function () { - - var initialBlockType = editor.settings.initialBlockPlugin, - initialBlock; - - if ( !editor.tools[initialBlockType] ) { - - editor.core.log('Plugin %o was not implemented and can\'t be used as initial block', 'warn', initialBlockType); - return; - - } - - initialBlock = editor.tools[initialBlockType].render(); - - initialBlock.setAttribute('data-placeholder', editor.settings.placeholder); - - editor.content.insertBlock({ - type : initialBlockType, - block : initialBlock - }); - - editor.content.workingNodeChanged(initialBlock); - - }; - - ui.setInlineToolbarButtonBehaviour = function (button, type) { - - editor.listeners.add(button, 'mousedown', function (event) { - - editor.toolbar.inline.toolClicked(event, type); - - }, false); - - }; - - return ui; - -})({}); diff --git a/package-lock.json b/package-lock.json index f5d6410d..23e34d9b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,231 @@ { "name": "codex.editor", - "version": "1.7.8", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { - "acorn": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.2.tgz", - "integrity": "sha512-o96FZLJBPY1lvTuJylGA9Bk3t/GKPPJG8H0ydQQl01crzwJgspa4AEIq/pVTXigmK0PHVQhiAtn8WMBLL9D2WA==", + "@csstools/convert-colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@csstools/convert-colors/-/convert-colors-1.4.0.tgz", + "integrity": "sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw==", "dev": true }, + "@mrmlnc/readdir-enhanced": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", + "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", + "dev": true, + "requires": { + "call-me-maybe": "1.0.1", + "glob-to-regexp": "0.3.0" + } + }, + "@nodelib/fs.stat": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-1.1.0.tgz", + "integrity": "sha512-LAQ1d4OPfSJ/BMbI2DuizmYrrkD9JMaTdi2hQTlI53lQ4kRQPyZQRS4CYQ7O66bnBBnP/oYdRxbk++X0xuFU6A==", + "dev": true + }, + "@webassemblyjs/ast": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.5.12.tgz", + "integrity": "sha512-bmTBEKuuhSU6dC95QIW250xO769cdYGx9rWn3uBLTw2pUpud0Z5kVuMw9m9fqbNzGeuOU2HpyuZa+yUt2CTEDA==", + "dev": true, + "requires": { + "@webassemblyjs/helper-module-context": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/wast-parser": "1.5.12", + "debug": "3.1.0", + "mamacro": "0.0.3" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.5.12.tgz", + "integrity": "sha512-epTvkdwOIPpTE9edHS+V+shetYzpTbd91XOzUli1zAS0+NSgSe6ZsNggIqUNzhma1s4bN2f/m8c6B1NMdCERAg==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.5.12.tgz", + "integrity": "sha512-Goxag86JvLq8ucHLXFNSLYzf9wrR+CJr37DsESTAzSnGoqDTgw5eqiXSQVd/D9Biih7+DIn8UIQCxMs8emRRwg==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.5.12.tgz", + "integrity": "sha512-tJNUjttL5CxiiS/KLxT4/Zk0Nbl/poFhztFxktb46zoQEUWaGHR9ZJ0SnvE7DbFX5PY5JNJDMZ0Li4lm246fWw==", + "dev": true, + "requires": { + "debug": "3.1.0" + } + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.5.12.tgz", + "integrity": "sha512-0FrJgiST+MQDMvPigzs+UIk1vslLIqGadkEWdn53Lr0NsUC2JbheG9QaO3Zf6ycK2JwsHiUpGaMFcHYXStTPMA==", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.5.12" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.5.12.tgz", + "integrity": "sha512-QBHZ45VPUJ7UyYKvUFoaxrSS9H5hbkC9U7tdWgFHmnTMutkXSEgDg2gZg3I/QTsiKOCIwx4qJUJwPd7J4D5CNQ==", + "dev": true + }, + "@webassemblyjs/helper-module-context": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.5.12.tgz", + "integrity": "sha512-SCXR8hPI4JOG3cdy9HAO8W5/VQ68YXG/Hfs7qDf1cd64zWuMNshyEour5NYnLMVkrrtc0XzfVS/MdeV94woFHA==", + "dev": true, + "requires": { + "debug": "3.1.0", + "mamacro": "0.0.3" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.5.12.tgz", + "integrity": "sha512-0Gz5lQcyvElNVbOTKwjEmIxGwdWf+zpAW/WGzGo95B7IgMEzyyfZU+PrGHDwiSH9c0knol9G7smQnY0ljrSA6g==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.5.12.tgz", + "integrity": "sha512-ge/CKVKBGpiJhFN9PIOQ7sPtGYJhxm/mW1Y3SpG1L6XBunfRz0YnLjW3TmhcOEFozIVyODPS1HZ9f7VR3GBGow==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-buffer": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/wasm-gen": "1.5.12", + "debug": "3.1.0" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.5.12.tgz", + "integrity": "sha512-F+PEv9QBzPi1ThLBouUJbuxhEr+Sy/oua1ftXFKHiaYYS5Z9tKPvK/hgCxlSdq+RY4MSG15jU2JYb/K5pkoybg==", + "dev": true, + "requires": { + "ieee754": "1.1.12" + } + }, + "@webassemblyjs/leb128": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.5.12.tgz", + "integrity": "sha512-cCOx/LVGiWyCwVrVlvGmTdnwHzIP4+zflLjGkZxWpYCpdNax9krVIJh1Pm7O86Ox/c5PrJpbvZU1cZLxndlPEw==", + "dev": true, + "requires": { + "leb": "0.3.0" + } + }, + "@webassemblyjs/utf8": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.5.12.tgz", + "integrity": "sha512-FX8NYQMiTRU0TfK/tJVntsi9IEKsedSsna8qtsndWVE0x3zLndugiApxdNMIOoElBV9o4j0BUqR+iwU58QfPxQ==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.5.12.tgz", + "integrity": "sha512-r/oZAyC4EZl0ToOYJgvj+b0X6gVEKQMLT34pNNbtvWBehQOnaSXvVUA5FIYlH8ubWjFNAFqYaVGgQTjR1yuJdQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-buffer": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/helper-wasm-section": "1.5.12", + "@webassemblyjs/wasm-gen": "1.5.12", + "@webassemblyjs/wasm-opt": "1.5.12", + "@webassemblyjs/wasm-parser": "1.5.12", + "@webassemblyjs/wast-printer": "1.5.12", + "debug": "3.1.0" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.5.12.tgz", + "integrity": "sha512-LTu+cr1YRxGGiVIXWhei/35lXXEwTnQU18x4V/gE+qCSJN21QcVTMjJuasTUh8WtmBZtOlqJbOQIeN7fGnHWhg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/ieee754": "1.5.12", + "@webassemblyjs/leb128": "1.5.12", + "@webassemblyjs/utf8": "1.5.12" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.5.12.tgz", + "integrity": "sha512-LBwG5KPA9u/uigZVyTsDpS3CVxx3AePCnTItVL+OPkRCp5LqmLsOp4a3/c5CQE0Lecm0Ss9hjUTDcbYFZkXlfQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-buffer": "1.5.12", + "@webassemblyjs/wasm-gen": "1.5.12", + "@webassemblyjs/wasm-parser": "1.5.12", + "debug": "3.1.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.5.12.tgz", + "integrity": "sha512-xset3+1AtoFYEfMg30nzCGBnhKmTBzbIKvMyLhqJT06TvYV+kA884AOUpUvhSmP6XPF3G+HVZPm/PbCGxH4/VQ==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-api-error": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/ieee754": "1.5.12", + "@webassemblyjs/leb128": "1.5.12", + "@webassemblyjs/utf8": "1.5.12" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.5.12.tgz", + "integrity": "sha512-QWUtzhvfY7Ue9GlJ3HeOB6w5g9vNYUUnG+Y96TWPkFHJTxZlcvGfNrUoACCw6eDb9gKaHrjt77aPq41a7y8svg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/floating-point-hex-parser": "1.5.12", + "@webassemblyjs/helper-api-error": "1.5.12", + "@webassemblyjs/helper-code-frame": "1.5.12", + "@webassemblyjs/helper-fsm": "1.5.12", + "long": "3.2.0", + "mamacro": "0.0.3" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.5.12.tgz", + "integrity": "sha512-XF9RTeckFgDyl196uRKZWHFFfbkzsMK96QTXp+TC0R9gsV9DMiDGMSIllgy/WdrZ3y3dsQp4fTA5r4GoaOBchA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/wast-parser": "1.5.12", + "long": "3.2.0" + } + }, + "acorn": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz", + "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", + "dev": true, + "requires": { + "acorn": "5.5.3" + } + }, "acorn-jsx": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", @@ -28,48 +244,33 @@ } }, "ajv": { - "version": "4.11.8", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", - "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.0.tgz", + "integrity": "sha512-VDUX1oSajablmiyFyED9L1DFndg0P9h7p1F+NO8FkIzei6EPrR6Zu1n18rd5P8PqaSRd/FrWv3G1TVBqpM83gA==", "dev": true, "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" + "fast-deep-equal": "2.0.1", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1", + "uri-js": "4.2.2" } }, "ajv-keywords": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-1.5.1.tgz", - "integrity": "sha1-MU3QpLM2j609/NxU7eYXG4htrzw=", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=", "dev": true }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", - "dev": true, - "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" - } - }, "alphanum-sort": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", "dev": true }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true - }, "ansi-escapes": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", - "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "dev": true }, "ansi-regex": { @@ -84,33 +285,42 @@ "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, + "any-promise": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-0.1.0.tgz", + "integrity": "sha1-gwtoCqflbzNFHUsEnzvYBESY7ic=", + "dev": true + }, "anymatch": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "dev": true, "requires": { - "micromatch": "2.3.11", + "micromatch": "3.1.10", "normalize-path": "2.1.1" } }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, "argparse": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", - "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "1.0.3" } }, "arr-diff": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "dev": true, - "requires": { - "arr-flatten": "1.1.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true }, "arr-flatten": { "version": "1.1.0", @@ -118,6 +328,24 @@ "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-iterate": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-1.1.2.tgz", + "integrity": "sha512-1hWSHTIlG/8wtYD+PPX5AOBtKWngpDFjrsrHgZpe+JdgNGz0udYu6ZIkAa/xuenIUEqFv7DvE2Yr60jxweJSrQ==", + "dev": true + }, "array-union": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", @@ -134,9 +362,9 @@ "dev": true }, "array-unique": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, "arrify": { @@ -145,6 +373,17 @@ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" + } + }, "assert": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", @@ -154,18 +393,33 @@ "util": "0.10.3" } }, - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "4.17.10" + } + }, "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", "dev": true }, + "atob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", + "dev": true + }, "autoprefixer": { "version": "6.7.7", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-6.7.7.tgz", @@ -173,11 +427,23 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000746", + "caniuse-db": "1.0.30000846", "normalize-range": "0.1.2", "num2fraction": "1.2.2", "postcss": "5.2.18", "postcss-value-parser": "3.3.0" + }, + "dependencies": { + "browserslist": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", + "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "dev": true, + "requires": { + "caniuse-db": "1.0.30000846", + "electron-to-chromium": "1.3.48" + } + } } }, "babel-code-frame": { @@ -192,13 +458,13 @@ } }, "babel-core": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", - "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", "dev": true, "requires": { "babel-code-frame": "6.26.0", - "babel-generator": "6.26.0", + "babel-generator": "6.26.1", "babel-helpers": "6.24.1", "babel-messages": "6.23.0", "babel-register": "6.26.0", @@ -207,21 +473,32 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "convert-source-map": "1.5.0", + "convert-source-map": "1.5.1", "debug": "2.6.9", "json5": "0.5.1", - "lodash": "4.17.4", + "lodash": "4.17.10", "minimatch": "3.0.4", "path-is-absolute": "1.0.1", - "private": "0.1.7", + "private": "0.1.8", "slash": "1.0.0", "source-map": "0.5.7" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } } }, "babel-generator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz", - "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=", + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "dev": true, "requires": { "babel-messages": "6.23.0", @@ -229,11 +506,33 @@ "babel-types": "6.26.0", "detect-indent": "4.0.0", "jsesc": "1.3.0", - "lodash": "4.17.4", + "lodash": "4.17.10", "source-map": "0.5.7", "trim-right": "1.0.1" } }, + "babel-helper-bindify-decorators": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz", + "integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "dev": true, + "requires": { + "babel-helper-explode-assignable-expression": "6.24.1", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0" + } + }, "babel-helper-call-delegate": { "version": "6.24.1", "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", @@ -255,7 +554,30 @@ "babel-helper-function-name": "6.24.1", "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "lodash": "4.17.4" + "lodash": "4.17.10" + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-helper-explode-class": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz", + "integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=", + "dev": true, + "requires": { + "babel-helper-bindify-decorators": "6.24.1", + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" } }, "babel-helper-function-name": { @@ -309,7 +631,20 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "lodash": "4.17.4" + "lodash": "4.17.10" + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0" } }, "babel-helper-replace-supers": { @@ -337,15 +672,14 @@ } }, "babel-loader": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-6.4.1.tgz", - "integrity": "sha1-CzQRLVsHSKjc2/Uaz2+b1C1QuMo=", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.4.tgz", + "integrity": "sha512-/hbyEvPzBJuGpk9o80R0ZyTej6heEOr59GoEUtn8qFKbnx4cJm9FWES6J/iv644sYgrtVw9JJQkjaLW/bqb5gw==", "dev": true, "requires": { - "find-cache-dir": "0.1.1", - "loader-utils": "0.2.17", - "mkdirp": "0.5.1", - "object-assign": "4.1.1" + "find-cache-dir": "1.0.0", + "loader-utils": "1.1.0", + "mkdirp": "0.5.1" } }, "babel-messages": { @@ -357,6 +691,12 @@ "babel-runtime": "6.26.0" } }, + "babel-plugin-add-module-exports": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/babel-plugin-add-module-exports/-/babel-plugin-add-module-exports-0.2.1.tgz", + "integrity": "sha1-mumh9KjcZ/DN7E9K7aHkOl/2XiU=", + "dev": true + }, "babel-plugin-check-es2015-constants": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", @@ -366,6 +706,152 @@ "babel-runtime": "6.26.0" } }, + "babel-plugin-class-display-name": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-class-display-name/-/babel-plugin-class-display-name-2.1.0.tgz", + "integrity": "sha1-GY/xK56r0z4BHuE/L5iYmFYItNE=", + "dev": true + }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "dev": true + }, + "babel-plugin-syntax-async-generators": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz", + "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=", + "dev": true + }, + "babel-plugin-syntax-class-constructor-call": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz", + "integrity": "sha1-nLnTn+Q8hgC+yBRkVt3L1OGnZBY=", + "dev": true + }, + "babel-plugin-syntax-class-properties": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", + "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", + "dev": true + }, + "babel-plugin-syntax-decorators": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz", + "integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=", + "dev": true + }, + "babel-plugin-syntax-do-expressions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz", + "integrity": "sha1-V0d1YTmqJtOQ0JQQsDdEugfkeW0=", + "dev": true + }, + "babel-plugin-syntax-dynamic-import": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz", + "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=", + "dev": true + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "dev": true + }, + "babel-plugin-syntax-export-extensions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz", + "integrity": "sha1-cKFITw+QiaToStRLrDU8lbmxJyE=", + "dev": true + }, + "babel-plugin-syntax-function-bind": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz", + "integrity": "sha1-SMSV8Xe98xqYHnMvVa3AvdJgH0Y=", + "dev": true + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "dev": true + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "dev": true + }, + "babel-plugin-transform-async-generator-functions": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz", + "integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "6.24.1", + "babel-plugin-syntax-async-generators": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "6.24.1", + "babel-plugin-syntax-async-functions": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-class-constructor-call": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz", + "integrity": "sha1-gNwoVQWsBn3LjWxl4vbxGrd2Xvk=", + "dev": true, + "requires": { + "babel-plugin-syntax-class-constructor-call": "6.18.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-plugin-transform-class-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", + "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", + "dev": true, + "requires": { + "babel-helper-function-name": "6.24.1", + "babel-plugin-syntax-class-properties": "6.13.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0" + } + }, + "babel-plugin-transform-decorators": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz", + "integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=", + "dev": true, + "requires": { + "babel-helper-explode-class": "6.24.1", + "babel-plugin-syntax-decorators": "6.13.0", + "babel-runtime": "6.26.0", + "babel-template": "6.26.0", + "babel-types": "6.26.0" + } + }, + "babel-plugin-transform-do-expressions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz", + "integrity": "sha1-KMyvkoEtlJws0SgfaQyP3EaK6bs=", + "dev": true, + "requires": { + "babel-plugin-syntax-do-expressions": "6.13.0", + "babel-runtime": "6.26.0" + } + }, "babel-plugin-transform-es2015-arrow-functions": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", @@ -394,7 +880,7 @@ "babel-template": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0", - "lodash": "4.17.4" + "lodash": "4.17.10" } }, "babel-plugin-transform-es2015-classes": { @@ -478,15 +964,15 @@ "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", "dev": true, "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", "babel-runtime": "6.26.0", "babel-template": "6.26.0" } }, "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz", - "integrity": "sha1-DYOUApt9xqvhqX7xgeAHWN0uXYo=", + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", "dev": true, "requires": { "babel-plugin-transform-strict-mode": "6.24.1", @@ -600,6 +1086,47 @@ "regexpu-core": "2.0.0" } }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dev": true, + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "6.24.1", + "babel-plugin-syntax-exponentiation-operator": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-export-extensions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz", + "integrity": "sha1-U3OLR+deghhYnuqUbLvTkQm75lM=", + "dev": true, + "requires": { + "babel-plugin-syntax-export-extensions": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-function-bind": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz", + "integrity": "sha1-xvuOlqwpajELjPjqQBRiQH3fapc=", + "dev": true, + "requires": { + "babel-plugin-syntax-function-bind": "6.13.0", + "babel-runtime": "6.26.0" + } + }, + "babel-plugin-transform-object-rest-spread": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", + "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", + "dev": true, + "requires": { + "babel-plugin-syntax-object-rest-spread": "6.13.0", + "babel-runtime": "6.26.0" + } + }, "babel-plugin-transform-regenerator": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", @@ -626,7 +1153,7 @@ "dev": true, "requires": { "babel-runtime": "6.26.0", - "core-js": "2.5.1", + "core-js": "2.5.7", "regenerator-runtime": "0.10.5" }, "dependencies": { @@ -638,13 +1165,15 @@ } } }, - "babel-preset-es2015": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz", - "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", + "babel-preset-env": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", + "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", "dev": true, "requires": { "babel-plugin-check-es2015-constants": "6.22.0", + "babel-plugin-syntax-trailing-function-commas": "6.22.0", + "babel-plugin-transform-async-to-generator": "6.24.1", "babel-plugin-transform-es2015-arrow-functions": "6.22.0", "babel-plugin-transform-es2015-block-scoped-functions": "6.22.0", "babel-plugin-transform-es2015-block-scoping": "6.26.0", @@ -656,7 +1185,7 @@ "babel-plugin-transform-es2015-function-name": "6.24.1", "babel-plugin-transform-es2015-literals": "6.22.0", "babel-plugin-transform-es2015-modules-amd": "6.24.1", - "babel-plugin-transform-es2015-modules-commonjs": "6.26.0", + "babel-plugin-transform-es2015-modules-commonjs": "6.26.2", "babel-plugin-transform-es2015-modules-systemjs": "6.24.1", "babel-plugin-transform-es2015-modules-umd": "6.24.1", "babel-plugin-transform-es2015-object-super": "6.24.1", @@ -667,7 +1196,58 @@ "babel-plugin-transform-es2015-template-literals": "6.22.0", "babel-plugin-transform-es2015-typeof-symbol": "6.23.0", "babel-plugin-transform-es2015-unicode-regex": "6.24.1", - "babel-plugin-transform-regenerator": "6.26.0" + "babel-plugin-transform-exponentiation-operator": "6.24.1", + "babel-plugin-transform-regenerator": "6.26.0", + "browserslist": "3.2.8", + "invariant": "2.2.4", + "semver": "5.5.0" + } + }, + "babel-preset-stage-0": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz", + "integrity": "sha1-VkLRUEL5E4TX5a+LyIsduVsDnmo=", + "dev": true, + "requires": { + "babel-plugin-transform-do-expressions": "6.22.0", + "babel-plugin-transform-function-bind": "6.22.0", + "babel-preset-stage-1": "6.24.1" + } + }, + "babel-preset-stage-1": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz", + "integrity": "sha1-dpLNfc1oSZB+auSgqFWJz7niv7A=", + "dev": true, + "requires": { + "babel-plugin-transform-class-constructor-call": "6.24.1", + "babel-plugin-transform-export-extensions": "6.22.0", + "babel-preset-stage-2": "6.24.1" + } + }, + "babel-preset-stage-2": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz", + "integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=", + "dev": true, + "requires": { + "babel-plugin-syntax-dynamic-import": "6.18.0", + "babel-plugin-transform-class-properties": "6.24.1", + "babel-plugin-transform-decorators": "6.24.1", + "babel-preset-stage-3": "6.24.1" + } + }, + "babel-preset-stage-3": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz", + "integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=", + "dev": true, + "requires": { + "babel-plugin-syntax-trailing-function-commas": "6.22.0", + "babel-plugin-transform-async-generator-functions": "6.24.1", + "babel-plugin-transform-async-to-generator": "6.24.1", + "babel-plugin-transform-exponentiation-operator": "6.24.1", + "babel-plugin-transform-object-rest-spread": "6.26.0" } }, "babel-register": { @@ -676,11 +1256,11 @@ "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", "dev": true, "requires": { - "babel-core": "6.26.0", + "babel-core": "6.26.3", "babel-runtime": "6.26.0", - "core-js": "2.5.1", + "core-js": "2.5.7", "home-or-tmp": "2.0.0", - "lodash": "4.17.4", + "lodash": "4.17.10", "mkdirp": "0.5.1", "source-map-support": "0.4.18" } @@ -691,8 +1271,8 @@ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { - "core-js": "2.5.1", - "regenerator-runtime": "0.11.0" + "core-js": "2.5.7", + "regenerator-runtime": "0.11.1" } }, "babel-template": { @@ -705,7 +1285,7 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "lodash": "4.17.4" + "lodash": "4.17.10" } }, "babel-traverse": { @@ -721,8 +1301,19 @@ "babylon": "6.18.0", "debug": "2.6.9", "globals": "9.18.0", - "invariant": "2.2.2", - "lodash": "4.17.4" + "invariant": "2.2.4", + "lodash": "4.17.10" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } } }, "babel-types": { @@ -733,7 +1324,7 @@ "requires": { "babel-runtime": "6.26.0", "esutils": "2.0.2", - "lodash": "4.17.4", + "lodash": "4.17.10", "to-fast-properties": "1.0.3" } }, @@ -743,16 +1334,77 @@ "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", "dev": true }, + "bail": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.3.tgz", + "integrity": "sha512-1X8CnjFVQ+a+KW36uBNMTU5s8+v5FzeqrP7hTG5aTb4aPreSbZJlhwPon9VKMuEVgV++JM+SQrALY3kr7eswdg==", + "dev": true + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "1.0.1", + "class-utils": "0.3.6", + "component-emitter": "1.2.1", + "define-property": "1.0.0", + "isobject": "3.0.1", + "mixin-deep": "1.3.1", + "pascalcase": "0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, "base64-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", - "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", "dev": true }, "big.js": { @@ -762,15 +1414,33 @@ "dev": true }, "binary-extensions": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz", - "integrity": "sha1-muuabF6IY4qtFx4Wf1kAq+JINdA=", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "dev": true + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", "dev": true }, "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "1.0.0", @@ -778,42 +1448,118 @@ } }, "braces": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.2" + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "repeat-element": "1.1.2", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, "browserify-aes": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-0.4.0.tgz", - "integrity": "sha1-BnFJtmjfMcS1hTPgLQHoBthgjiw=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "1.2.0", + "browserify-des": "1.0.1", + "evp_bytestokey": "1.0.3" + } + }, + "browserify-des": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.1.tgz", + "integrity": "sha512-zy0Cobe3hhgpiOM32Tj7KQ3Vl91m0njwsjzZQK1L+JDf11dzP9qIvjreVinsvXrgfjhStXwUWAEpB9D7Gwmayw==", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "des.js": "1.0.0", "inherits": "2.0.3" } }, - "browserify-zlib": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", - "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { - "pako": "0.2.9" + "bn.js": "4.11.8", + "randombytes": "2.0.6" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "elliptic": "6.4.0", + "inherits": "2.0.3", + "parse-asn1": "5.1.1" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "1.0.6" } }, "browserslist": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", - "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", + "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", "dev": true, "requires": { - "caniuse-db": "1.0.30000746", - "electron-to-chromium": "1.3.26" + "caniuse-lite": "1.0.30000846", + "electron-to-chromium": "1.3.48" } }, "buffer": { @@ -822,17 +1568,79 @@ "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { - "base64-js": "1.2.1", - "ieee754": "1.1.8", + "base64-js": "1.3.0", + "ieee754": "1.1.12", "isarray": "1.0.0" } }, + "buffer-from": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", + "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, "builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", "dev": true }, + "cacache": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", + "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", + "dev": true, + "requires": { + "bluebird": "3.5.1", + "chownr": "1.0.1", + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "lru-cache": "4.1.3", + "mississippi": "2.0.0", + "mkdirp": "0.5.1", + "move-concurrently": "1.0.1", + "promise-inflight": "1.0.1", + "rimraf": "2.6.2", + "ssri": "5.3.0", + "unique-filename": "1.1.0", + "y18n": "4.0.0" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "1.0.0", + "component-emitter": "1.2.1", + "get-value": "2.0.6", + "has-value": "1.0.0", + "isobject": "3.0.1", + "set-value": "2.0.0", + "to-object-path": "0.3.0", + "union-value": "1.0.0", + "unset-value": "1.0.0" + } + }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=", + "dev": true + }, "caller-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", @@ -849,11 +1657,22 @@ "dev": true }, "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", "dev": true }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "4.1.0", + "map-obj": "2.0.0", + "quick-lru": "1.1.0" + } + }, "caniuse-api": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-1.6.1.tgz", @@ -861,26 +1680,40 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000746", + "caniuse-db": "1.0.30000846", "lodash.memoize": "4.1.2", "lodash.uniq": "4.5.0" + }, + "dependencies": { + "browserslist": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", + "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "dev": true, + "requires": { + "caniuse-db": "1.0.30000846", + "electron-to-chromium": "1.3.48" + } + } } }, "caniuse-db": { - "version": "1.0.30000746", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000746.tgz", - "integrity": "sha1-UBCYxm9fu/Y0wC8lUIsF6ICZEPQ=", + "version": "1.0.30000846", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000846.tgz", + "integrity": "sha1-2chvkUc4202gmO7e2ZdBPERWG9I=", "dev": true }, - "center-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", - "dev": true, - "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" - } + "caniuse-lite": { + "version": "1.0.30000846", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000846.tgz", + "integrity": "sha512-qxUOHr5mTaadWH1ap0ueivHd8x42Bnemcn+JutVr7GWmm2bU4zoBhjuv5QdXgALQnnT626lOQros7cCDf8PwCg==", + "dev": true + }, + "ccount": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-1.0.3.tgz", + "integrity": "sha512-Jt9tIBkRc9POUof7QA/VwWd+58fKkEEfI+/t1/eOlxKM7ZhrczNzMFefge7Ai+39y1pR/pP6cI19guHy3FSLmw==", + "dev": true }, "chalk": { "version": "1.1.3", @@ -895,21 +1728,191 @@ "supports-color": "2.0.0" } }, - "chokidar": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "character-entities": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.2.tgz", + "integrity": "sha512-sMoHX6/nBiy3KKfC78dnEalnpn0Az0oSNvqUWYTtYrhRI5iUIYsROU48G+E+kMFQzqXaJ8kHJZ85n7y6/PHgwQ==", + "dev": true + }, + "character-entities-html4": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.2.tgz", + "integrity": "sha512-sIrXwyna2+5b0eB9W149izTPJk/KkJTg6mEzDGibwBUkyH1SbDa+nf515Ppdi3MaH35lW0JFJDWeq9Luzes1Iw==", + "dev": true + }, + "character-entities-legacy": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.2.tgz", + "integrity": "sha512-9NB2VbXtXYWdXzqrvAHykE/f0QJxzaKIpZ5QzNZrrgQ7Iyxr2vnfS8fCBNVW9nUEZE0lo57nxKRqnzY/dKrwlA==", + "dev": true + }, + "character-reference-invalid": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.2.tgz", + "integrity": "sha512-7I/xceXfKyUJmSAn/jw8ve/9DyOP7XxufNYLI9Px7CmsKgEUaZLUTax6nZxGQtaoiZCjpu6cHPj20xC/vqRReQ==", + "dev": true + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "cheerio": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.19.0.tgz", + "integrity": "sha1-dy5wFfLuKZZQltcepBdbdas1SSU=", "dev": true, "requires": { - "anymatch": "1.3.2", + "css-select": "1.0.0", + "dom-serializer": "0.1.0", + "entities": "1.1.1", + "htmlparser2": "3.8.3", + "lodash": "3.10.1" + }, + "dependencies": { + "css-select": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.0.0.tgz", + "integrity": "sha1-sRIcpRhI3SZOIkTQWM7iVN7rRLA=", + "dev": true, + "requires": { + "boolbase": "1.0.0", + "css-what": "1.0.0", + "domutils": "1.4.3", + "nth-check": "1.0.1" + } + }, + "css-what": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-1.0.0.tgz", + "integrity": "sha1-18wt9FGAZm+Z0rFEYmOUaeAPc2w=", + "dev": true + }, + "domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true, + "requires": { + "domelementtype": "1.3.0" + } + }, + "domutils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.4.3.tgz", + "integrity": "sha1-CGVRN5bGswYDGFDhdVFrr4C3Km8=", + "dev": true, + "requires": { + "domelementtype": "1.3.0" + } + }, + "htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "requires": { + "domelementtype": "1.3.0", + "domhandler": "2.3.0", + "domutils": "1.5.1", + "entities": "1.0.0", + "readable-stream": "1.1.14" + }, + "dependencies": { + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" + } + }, + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "dev": true + } + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "chokidar": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz", + "integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==", + "dev": true, + "requires": { + "anymatch": "2.0.0", "async-each": "1.0.1", - "fsevents": "1.1.2", - "glob-parent": "2.0.0", + "braces": "2.3.2", + "fsevents": "1.2.4", + "glob-parent": "3.1.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", - "is-glob": "2.0.1", + "is-glob": "4.0.0", + "normalize-path": "2.1.1", "path-is-absolute": "1.0.1", - "readdirp": "2.1.0" + "readdirp": "2.1.0", + "upath": "1.1.0" + } + }, + "chownr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", + "dev": true + }, + "chrome-trace-event": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz", + "integrity": "sha512-xDbVgyfDTT2piup/h8dK/y4QZfJRSa73bw1WZ8b4XM1o7fsFubUVGYcE+1ANtOzJJELGpYoG2961z0Z6OAld9A==", + "dev": true, + "requires": { + "tslib": "1.9.2" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.2" } }, "circular-json": { @@ -927,13 +1930,36 @@ "chalk": "1.1.3" } }, - "cli-cursor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-1.0.2.tgz", - "integrity": "sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc=", + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, "requires": { - "restore-cursor": "1.0.1" + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.1", + "static-extend": "0.1.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" } }, "cli-width": { @@ -943,30 +1969,49 @@ "dev": true }, "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", - "wordwrap": "0.0.2" + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "wrap-ansi": "2.1.0" }, "dependencies": { - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } } } }, "clone": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", - "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", "dev": true }, + "clone-regexp": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-1.0.1.tgz", + "integrity": "sha512-Fcij9IwRW27XedRIJnSOEupS7RVcXtObJXbcUOX93UCLqqOdRpkvzKywOOSizmEK/Is3S/RHX9dLdfo6R1Q1mw==", + "dev": true, + "requires": { + "is-regexp": "1.0.0", + "is-supported-regexp-flag": "1.0.1" + } + }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -979,7 +2024,7 @@ "integrity": "sha1-qe8VNmDWqGqL3sAomlxoTSF0Mv0=", "dev": true, "requires": { - "q": "1.5.0" + "q": "1.5.1" } }, "code-point-at": { @@ -988,21 +2033,37 @@ "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, + "collapse-white-space": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.4.tgz", + "integrity": "sha512-YfQ1tAUZm561vpYD+5eyWN8+UsceQbSrqqlc/6zDY2gtAE+uZLSdkkovhnGpmCThsvKBFakq4EdY/FF93E8XIw==", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "1.0.0", + "object-visit": "1.0.1" + } + }, "color": { "version": "0.11.4", "resolved": "https://registry.npmjs.org/color/-/color-0.11.4.tgz", "integrity": "sha1-bXtcdPtl6EHNSHkq0e1eB7kE12Q=", "dev": true, "requires": { - "clone": "1.0.2", - "color-convert": "1.9.0", + "clone": "1.0.4", + "color-convert": "1.9.1", "color-string": "0.3.0" } }, "color-convert": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", - "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", "dev": true, "requires": { "color-name": "1.1.3" @@ -1040,12 +2101,24 @@ "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", "dev": true }, + "commander": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "dev": true + }, "commondir": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1053,13 +2126,14 @@ "dev": true }, "concat-stream": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", - "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { + "buffer-from": "1.1.0", "inherits": "2.0.3", - "readable-stream": "2.3.3", + "readable-stream": "2.3.6", "typedarray": "0.0.6" } }, @@ -1079,15 +2153,35 @@ "dev": true }, "convert-source-map": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", - "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", + "dev": true + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "1.2.0", + "fs-write-stream-atomic": "1.0.10", + "iferr": "0.1.5", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "run-queue": "1.0.3" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, "core-js": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz", - "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=", + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==", "dev": true }, "core-util-is": { @@ -1096,16 +2190,114 @@ "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true }, - "crypto-browserify": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.3.0.tgz", - "integrity": "sha1-ufx1u0oO1h3PHNXa6W6zDJw+UGw=", + "cosmiconfig": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-2.2.2.tgz", + "integrity": "sha512-GiNXLwAFPYHy25XmTPpafYvn3CLAkJ8FLsscq78MQd1Kh0OU6Yzhn4eV2MVF4G9WEQZoWEGltatdR+ntGPMl5A==", "dev": true, "requires": { - "browserify-aes": "0.4.0", - "pbkdf2-compat": "2.0.1", - "ripemd160": "0.2.0", - "sha.js": "2.2.6" + "is-directory": "0.3.1", + "js-yaml": "3.7.0", + "minimist": "1.2.0", + "object-assign": "4.1.1", + "os-homedir": "1.0.2", + "parse-json": "2.2.0", + "require-from-string": "1.2.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.4.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "inherits": "2.0.3", + "md5.js": "1.3.4", + "ripemd160": "2.0.2", + "sha.js": "2.4.11" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "create-hash": "1.2.0", + "inherits": "2.0.3", + "ripemd160": "2.0.2", + "safe-buffer": "5.1.2", + "sha.js": "2.4.11" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.3", + "shebang-command": "1.2.0", + "which": "1.3.1" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "1.0.1", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.3", + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "diffie-hellman": "5.0.3", + "inherits": "2.0.3", + "pbkdf2": "3.0.16", + "public-encrypt": "4.0.2", + "randombytes": "2.0.6", + "randomfill": "1.0.4" + } + }, + "css-color-function": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/css-color-function/-/css-color-function-1.3.3.tgz", + "integrity": "sha1-jtJMLAIFBzM5+voAS8jBQfzLKC4=", + "dev": true, + "requires": { + "balanced-match": "0.1.0", + "color": "0.11.4", + "debug": "3.1.0", + "rgb": "0.1.0" + }, + "dependencies": { + "balanced-match": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.1.0.tgz", + "integrity": "sha1-tQS9BYabOSWd0MXvw12EMXbczEo=", + "dev": true + } } }, "css-color-names": { @@ -1115,36 +2307,25 @@ "dev": true }, "css-loader": { - "version": "0.26.4", - "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-0.26.4.tgz", - "integrity": "sha1-th6eMNuUMD5v/IkvEOzQmtAlof0=", + "version": "0.28.11", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-0.28.11.tgz", + "integrity": "sha512-wovHgjAx8ZIMGSL8pTys7edA1ClmzxHeY6n/d97gg5odgsxEgKjULPR0viqyC+FWMCL9sfqoC/QCUBo62tLvPg==", "dev": true, "requires": { "babel-code-frame": "6.26.0", "css-selector-tokenizer": "0.7.0", "cssnano": "3.10.0", + "icss-utils": "2.1.0", "loader-utils": "1.1.0", "lodash.camelcase": "4.3.0", "object-assign": "4.1.1", "postcss": "5.2.18", - "postcss-modules-extract-imports": "1.1.0", + "postcss-modules-extract-imports": "1.2.0", "postcss-modules-local-by-default": "1.2.0", "postcss-modules-scope": "1.1.0", "postcss-modules-values": "1.3.0", - "source-list-map": "0.1.8" - }, - "dependencies": { - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", - "dev": true, - "requires": { - "big.js": "3.2.0", - "emojis-list": "2.1.0", - "json5": "0.5.1" - } - } + "postcss-value-parser": "3.3.0", + "source-list-map": "2.0.0" } }, "css-selector-tokenizer": { @@ -1164,13 +2345,19 @@ "integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=", "dev": true, "requires": { - "regenerate": "1.3.3", + "regenerate": "1.4.0", "regjsgen": "0.2.0", "regjsparser": "0.1.5" } } } }, + "css-unit-converter": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/css-unit-converter/-/css-unit-converter-1.1.1.tgz", + "integrity": "sha1-2bkoGtz9jO2TW9urqDeGiX9k6ZY=", + "dev": true + }, "cssesc": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-0.1.0.tgz", @@ -1197,7 +2384,7 @@ "postcss-discard-empty": "2.1.0", "postcss-discard-overridden": "0.1.1", "postcss-discard-unused": "2.2.3", - "postcss-filter-plugins": "2.0.2", + "postcss-filter-plugins": "2.0.3", "postcss-merge-idents": "2.1.7", "postcss-merge-longhand": "2.0.2", "postcss-merge-rules": "2.1.2", @@ -1227,15 +2414,21 @@ "source-map": "0.5.7" } }, - "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", "dev": true, "requires": { - "es5-ext": "0.10.31" + "array-find-index": "1.0.2" } }, + "cyclist": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", + "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", + "dev": true + }, "date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", @@ -1243,9 +2436,9 @@ "dev": true }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" @@ -1257,12 +2450,77 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "1.2.0", + "map-obj": "1.0.1" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "1.0.2", + "isobject": "3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, "defined": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", @@ -1277,11 +2535,29 @@ "requires": { "globby": "5.0.0", "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", "object-assign": "4.1.1", "pify": "2.3.0", "pinkie-promise": "2.0.1", "rimraf": "2.6.2" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" } }, "detect-indent": { @@ -1293,130 +2569,189 @@ "repeating": "2.0.1" } }, - "doctrine": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.0.tgz", - "integrity": "sha1-xz2NKQnSIpHhoAejlYBNqLZl/mM=", + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" + "bn.js": "4.11.8", + "miller-rabin": "4.0.1", + "randombytes": "2.0.6" + } + }, + "dir-glob": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", + "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", + "dev": true, + "requires": { + "arrify": "1.0.1", + "path-type": "3.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "1.1.3", + "entities": "1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + } } }, "domain-browser": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", - "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", "dev": true }, - "electron-to-chromium": { - "version": "1.3.26", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.26.tgz", - "integrity": "sha1-mWQnKUhhp02cfIK5Jg6jAejALWY=", + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", "dev": true }, + "domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "dev": true, + "requires": { + "domelementtype": "1.3.0" + } + }, + "domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", + "dev": true, + "requires": { + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" + } + }, + "dot-prop": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dev": true, + "requires": { + "is-obj": "1.0.1" + } + }, + "duplexify": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", + "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", + "dev": true, + "requires": { + "end-of-stream": "1.4.1", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "stream-shift": "1.0.0" + } + }, + "electron-to-chromium": { + "version": "1.3.48", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.48.tgz", + "integrity": "sha1-07DYWTgUBE4JLs4hCPw6ya6kuQA=", + "dev": true + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.3", + "hmac-drbg": "1.0.1", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" + } + }, "emojis-list": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", "dev": true }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "1.4.0" + } + }, "enhanced-resolve": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz", - "integrity": "sha1-TW5omzcl+GCQknzMhs2fFjW4ni4=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.0.0.tgz", + "integrity": "sha512-jox/62b2GofV1qTUQTMPEJSDIGycS43evqYzD/KVtEb9OCoki9cnacUPxCrZa7JfPzZSYOCZhu9O9luaMxAX8g==", "dev": true, "requires": { "graceful-fs": "4.1.11", - "memory-fs": "0.2.0", - "tapable": "0.1.10" - }, - "dependencies": { - "memory-fs": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.2.0.tgz", - "integrity": "sha1-8rslNovBIeORwlIN6Slpyu4KApA=", - "dev": true - } + "memory-fs": "0.4.1", + "tapable": "1.0.0" } }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + }, "errno": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", - "integrity": "sha1-uJbiOp5ei6M4cfyZar02NfyaHH0=", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", "dev": true, "requires": { - "prr": "0.0.0" + "prr": "1.0.1" } }, - "es5-ext": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.31.tgz", - "integrity": "sha1-e7k4yVp/G59ygJLcCcQe3MOY7v4=", + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", "dev": true, "requires": { - "es6-iterator": "2.0.1", - "es6-symbol": "3.1.1" - } - }, - "es6-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", - "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.31", - "es6-symbol": "3.1.1" - } - }, - "es6-map": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", - "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.31", - "es6-iterator": "2.0.1", - "es6-set": "0.1.5", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" - } - }, - "es6-set": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", - "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.31", - "es6-iterator": "2.0.1", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" - } - }, - "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.31" - } - }, - "es6-weak-map": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", - "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.31", - "es6-iterator": "2.0.1", - "es6-symbol": "3.1.1" + "is-arrayish": "0.2.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + } } }, "escape-string-regexp": { @@ -1425,94 +2760,180 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "escope": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", - "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", - "dev": true, - "requires": { - "es6-map": "0.1.5", - "es6-weak-map": "2.0.2", - "esrecurse": "4.2.0", - "estraverse": "4.2.0" - } - }, "eslint": { - "version": "3.19.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-3.19.0.tgz", - "integrity": "sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw=", + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", "dev": true, "requires": { + "ajv": "5.5.2", "babel-code-frame": "6.26.0", - "chalk": "1.1.3", - "concat-stream": "1.6.0", - "debug": "2.6.9", - "doctrine": "2.0.0", - "escope": "3.6.0", - "espree": "3.5.1", - "esquery": "1.0.0", - "estraverse": "4.2.0", + "chalk": "2.4.1", + "concat-stream": "1.6.2", + "cross-spawn": "5.1.0", + "debug": "3.1.0", + "doctrine": "2.1.0", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.4", + "esquery": "1.0.1", "esutils": "2.0.2", "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "9.18.0", - "ignore": "3.3.5", + "globals": "11.5.0", + "ignore": "3.3.8", "imurmurhash": "0.1.4", - "inquirer": "0.12.0", - "is-my-json-valid": "2.16.1", - "is-resolvable": "1.0.0", - "js-yaml": "3.7.0", - "json-stable-stringify": "1.0.1", + "inquirer": "3.3.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.11.0", + "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", - "lodash": "4.17.4", + "lodash": "4.17.10", + "minimatch": "3.0.4", "mkdirp": "0.5.1", "natural-compare": "1.4.0", "optionator": "0.8.2", "path-is-inside": "1.0.2", - "pluralize": "1.2.1", - "progress": "1.1.8", + "pluralize": "7.0.0", + "progress": "2.0.0", + "regexpp": "1.1.0", "require-uncached": "1.0.3", - "shelljs": "0.7.8", - "strip-bom": "3.0.0", + "semver": "5.5.0", + "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", - "table": "3.8.3", - "text-table": "0.2.0", - "user-home": "2.0.0" + "table": "4.0.2", + "text-table": "0.2.0" + }, + "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "globals": { + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", + "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "js-yaml": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", + "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } } }, "eslint-loader": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/eslint-loader/-/eslint-loader-1.9.0.tgz", - "integrity": "sha512-40aN976qSNPyb9ejTqjEthZITpls1SVKtwguahmH1dzGCwQU/vySE+xX33VZmD8csU0ahVNCtFlsPgKqRBiqgg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-loader/-/eslint-loader-2.0.0.tgz", + "integrity": "sha512-VxxGDI4bXzLk0+/jMt/0EkGMRKS9ox6Czx+yapMb9WJmcS/ZHhlhqcVUNgUjFBNp02j/2pZLdGOrG7EXyjoz/g==", "dev": true, "requires": { "loader-fs-cache": "1.0.1", "loader-utils": "1.1.0", "object-assign": "4.1.1", - "object-hash": "1.2.0", + "object-hash": "1.3.0", "rimraf": "2.6.2" - }, - "dependencies": { - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", - "dev": true, - "requires": { - "big.js": "3.2.0", - "emojis-list": "2.1.0", - "json5": "0.5.1" - } - } } }, - "espree": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.1.tgz", - "integrity": "sha1-DJiLirRttTEAoZVK5LqZXd0n2H4=", + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", "dev": true, "requires": { - "acorn": "5.1.2", + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "5.5.3", "acorn-jsx": "3.0.1" } }, @@ -1523,22 +2944,21 @@ "dev": true }, "esquery": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.0.tgz", - "integrity": "sha1-z7qLV9f7qT8XKYqKAGoEzaE9gPo=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", "dev": true, "requires": { "estraverse": "4.2.0" } }, "esrecurse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", - "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { - "estraverse": "4.2.0", - "object-assign": "4.1.1" + "estraverse": "4.2.0" } }, "estraverse": { @@ -1553,35 +2973,88 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", - "dev": true, - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.31" - } - }, "events": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", "dev": true }, - "exit-hook": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", - "integrity": "sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g=", - "dev": true - }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { - "is-posix-bracket": "0.1.1" + "md5.js": "1.3.4", + "safe-buffer": "5.1.2" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + } + }, + "execall": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execall/-/execall-1.0.0.tgz", + "integrity": "sha1-c9CQTjlbPKsGWLCNCewlMH8pu3M=", + "dev": true, + "requires": { + "clone-regexp": "1.0.1" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, "expand-range": { @@ -1590,29 +3063,221 @@ "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "dev": true, "requires": { - "fill-range": "2.2.3" + "fill-range": "2.2.4" + }, + "dependencies": { + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "3.0.0", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "1.0.0", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "0.4.2", + "iconv-lite": "0.4.23", + "tmp": "0.0.33" } }, "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "is-extglob": "1.0.0" + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } } }, "extract-text-webpack-plugin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/extract-text-webpack-plugin/-/extract-text-webpack-plugin-1.0.1.tgz", - "integrity": "sha1-yVvzy6rEnclvHcbgclSfu2VMzSw=", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extract-text-webpack-plugin/-/extract-text-webpack-plugin-3.0.2.tgz", + "integrity": "sha512-bt/LZ4m5Rqt/Crl2HiKuAl/oqg0psx1tsTLkvWbJen1CtD+fftkZhMaQ9HOtY2gWsl2Wq+sABmMVi9z3DhKWQQ==", "dev": true, "requires": { - "async": "1.5.2", - "loader-utils": "0.2.17", - "webpack-sources": "0.1.5" + "async": "2.6.1", + "loader-utils": "1.1.0", + "schema-utils": "0.3.0", + "webpack-sources": "1.1.0" + }, + "dependencies": { + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "schema-utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz", + "integrity": "sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8=", + "dev": true, + "requires": { + "ajv": "5.5.2" + } + } } }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-glob": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.2.tgz", + "integrity": "sha512-TR6zxCKftDQnUAPvkrCWdBgDq/gbqx8A3ApnBrR5rMvpp6+KMJI0Igw7fkWPgeVK0uhRXTXdvO3O+YP0CaUX2g==", + "dev": true, + "requires": { + "@mrmlnc/readdir-enhanced": "2.2.1", + "@nodelib/fs.stat": "1.1.0", + "glob-parent": "3.1.0", + "is-glob": "4.0.0", + "merge2": "1.2.2", + "micromatch": "3.1.10" + } + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", @@ -1626,13 +3291,12 @@ "dev": true }, "figures": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", - "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "dev": true, "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" + "escape-string-regexp": "1.0.5" } }, "file-entry-cache": { @@ -1652,37 +3316,46 @@ "dev": true }, "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "1.1.7", - "repeat-element": "1.1.2", - "repeat-string": "1.6.1" + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } } }, "find-cache-dir": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", - "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", "dev": true, "requires": { "commondir": "1.0.1", - "mkdirp": "0.5.1", - "pkg-dir": "1.0.0" + "make-dir": "1.3.0", + "pkg-dir": "2.0.0" } }, "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "locate-path": "2.0.0" } }, "flat-cache": { @@ -1703,6 +3376,16 @@ "integrity": "sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=", "dev": true }, + "flush-write-stream": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", + "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.6" + } + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -1718,6 +3401,37 @@ "for-in": "1.0.2" } }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "0.2.2" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.6" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "iferr": "0.1.5", + "imurmurhash": "0.1.4", + "readable-stream": "2.3.6" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1725,196 +3439,99 @@ "dev": true }, "fsevents": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.2.tgz", - "integrity": "sha512-Sn44E5wQW4bTHXvQmvSHwqbuiXtduD6Rrjm2ZtUEGbyrig+nUH3t/QD4M4/ZXViY556TBpRgZkHLDx3JxPwxiw==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", "dev": true, "optional": true, "requires": { - "nan": "2.7.0", - "node-pre-gyp": "0.6.36" + "nan": "2.10.0", + "node-pre-gyp": "0.10.0" }, "dependencies": { "abbrev": { - "version": "1.1.0", - "bundled": true, + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, - "ajv": { - "version": "4.11.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "co": "4.6.0", - "json-stable-stringify": "1.0.1" - } - }, "ansi-regex": { "version": "2.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "aproba": { - "version": "1.1.1", - "bundled": true, + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", "dev": true, "optional": true, "requires": { "delegates": "1.0.0", - "readable-stream": "2.2.9" + "readable-stream": "2.3.6" } }, - "asn1": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "assert-plus": { - "version": "0.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "asynckit": { - "version": "0.4.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws-sign2": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "aws4": { - "version": "1.6.0", - "bundled": true, - "dev": true, - "optional": true - }, "balanced-match": { - "version": "0.4.2", - "bundled": true, + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "bcrypt-pbkdf": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "tweetnacl": "0.14.5" - } - }, - "block-stream": { - "version": "0.0.9", - "bundled": true, - "dev": true, - "requires": { - "inherits": "2.0.3" - } - }, - "boom": { - "version": "2.10.1", - "bundled": true, - "dev": true, - "requires": { - "hoek": "2.16.3" - } - }, "brace-expansion": { - "version": "1.1.7", - "bundled": true, + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "0.4.2", + "balanced-match": "1.0.0", "concat-map": "0.0.1" } }, - "buffer-shims": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "caseless": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true - }, - "co": { - "version": "4.6.0", - "bundled": true, + "chownr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, - "combined-stream": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "requires": { - "delayed-stream": "1.0.0" - } - }, "concat-map": { "version": "0.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true }, "core-util-is": { "version": "1.0.2", - "bundled": true, - "dev": true - }, - "cryptiles": { - "version": "2.0.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, - "optional": true, - "requires": { - "boom": "2.10.1" - } - }, - "dashdash": { - "version": "1.14.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } + "optional": true }, "debug": { - "version": "2.6.8", - "bundled": true, + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "optional": true, "requires": { @@ -1922,93 +3539,51 @@ } }, "deep-extend": { - "version": "0.4.2", - "bundled": true, + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz", + "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", "dev": true, "optional": true }, - "delayed-stream": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, "delegates": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, - "ecc-jsbn": { - "version": "0.1.1", - "bundled": true, + "detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, "requires": { - "jsbn": "0.1.1" - } - }, - "extend": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "extsprintf": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "bundled": true, - "dev": true, - "optional": true - }, - "form-data": { - "version": "2.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.15" + "minipass": "2.2.4" } }, "fs.realpath": { "version": "1.0.0", - "bundled": true, - "dev": true - }, - "fstream": { - "version": "1.0.11", - "bundled": true, + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.1" - } - }, - "fstream-ignore": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fstream": "1.0.11", - "inherits": "2.0.3", - "minimatch": "3.0.4" - } + "optional": true }, "gauge": { "version": "2.7.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, "requires": { - "aproba": "1.1.1", + "aproba": "1.2.0", "console-control-strings": "1.1.0", "has-unicode": "2.0.1", "object-assign": "4.1.1", @@ -2018,27 +3593,12 @@ "wide-align": "1.1.2" } }, - "getpass": { - "version": "0.1.7", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, "glob": { "version": "7.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, + "optional": true, "requires": { "fs.realpath": "1.0.0", "inflight": "1.0.6", @@ -2048,65 +3608,39 @@ "path-is-absolute": "1.0.1" } }, - "graceful-fs": { - "version": "4.1.11", - "bundled": true, - "dev": true - }, - "har-schema": { - "version": "1.0.5", - "bundled": true, - "dev": true, - "optional": true - }, - "har-validator": { - "version": "4.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ajv": "4.11.8", - "har-schema": "1.0.5" - } - }, "has-unicode": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, - "hawk": { - "version": "3.1.3", - "bundled": true, + "iconv-lite": { + "version": "0.4.21", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.21.tgz", + "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", "dev": true, "optional": true, "requires": { - "boom": "2.10.1", - "cryptiles": "2.0.5", - "hoek": "2.16.3", - "sntp": "1.0.9" + "safer-buffer": "2.1.2" } }, - "hoek": { - "version": "2.16.3", - "bundled": true, - "dev": true - }, - "http-signature": { - "version": "1.1.1", - "bundled": true, + "ignore-walk": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, "requires": { - "assert-plus": "0.2.0", - "jsprim": "1.4.0", - "sshpk": "1.13.0" + "minimatch": "3.0.4" } }, "inflight": { "version": "1.0.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, + "optional": true, "requires": { "once": "1.4.0", "wrappy": "1.0.2" @@ -2114,131 +3648,72 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "ini": { - "version": "1.3.4", - "bundled": true, + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "1.0.1" } }, - "is-typedarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, "isarray": { "version": "1.0.0", - "bundled": true, - "dev": true - }, - "isstream": { - "version": "0.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, - "jodid25519": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsbn": "0.1.1" - } - }, - "jsbn": { - "version": "0.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "json-schema": { - "version": "0.2.3", - "bundled": true, - "dev": true, - "optional": true - }, - "json-stable-stringify": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "jsonify": "0.0.0" - } - }, - "json-stringify-safe": { - "version": "5.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "jsonify": { - "version": "0.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "jsprim": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.0.2", - "json-schema": "0.2.3", - "verror": "1.3.6" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "mime-db": { - "version": "1.27.0", - "bundled": true, - "dev": true - }, - "mime-types": { - "version": "2.1.15", - "bundled": true, - "dev": true, - "requires": { - "mime-db": "1.27.0" - } - }, "minimatch": { "version": "3.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.7" + "brace-expansion": "1.1.11" } }, "minimist": { "version": "0.0.8", - "bundled": true, + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, + "minipass": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz", + "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1", + "yallist": "3.0.2" + } + }, + "minizlib": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.1.0.tgz", + "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", + "dev": true, + "optional": true, + "requires": { + "minipass": "2.2.4" + } + }, "mkdirp": { "version": "0.5.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" @@ -2246,40 +3721,75 @@ }, "ms": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true, "optional": true }, - "node-pre-gyp": { - "version": "0.6.36", - "bundled": true, + "needle": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.0.tgz", + "integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==", "dev": true, "optional": true, "requires": { + "debug": "2.6.9", + "iconv-lite": "0.4.21", + "sax": "1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz", + "integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==", + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.3", "mkdirp": "0.5.1", + "needle": "2.2.0", "nopt": "4.0.1", - "npmlog": "4.1.0", - "rc": "1.2.1", - "request": "2.81.0", - "rimraf": "2.6.1", - "semver": "5.3.0", - "tar": "2.2.1", - "tar-pack": "3.4.0" + "npm-packlist": "1.1.10", + "npmlog": "4.1.2", + "rc": "1.2.7", + "rimraf": "2.6.2", + "semver": "5.5.0", + "tar": "4.4.1" } }, "nopt": { "version": "4.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, "requires": { - "abbrev": "1.1.0", - "osenv": "0.1.4" + "abbrev": "1.1.1", + "osenv": "0.1.5" + } + }, + "npm-bundled": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.3.tgz", + "integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==", + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.1.10.tgz", + "integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==", + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "3.0.1", + "npm-bundled": "1.0.3" } }, "npmlog": { - "version": "4.1.0", - "bundled": true, + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, "requires": { @@ -2291,24 +3801,21 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, - "oauth-sign": { - "version": "0.8.2", - "bundled": true, - "dev": true, - "optional": true - }, "object-assign": { "version": "4.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1.0.2" @@ -2316,19 +3823,22 @@ }, "os-homedir": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { - "version": "0.1.4", - "bundled": true, + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, "requires": { @@ -2338,164 +3848,111 @@ }, "path-is-absolute": { "version": "1.0.1", - "bundled": true, - "dev": true - }, - "performance-now": { - "version": "0.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { - "version": "1.0.7", - "bundled": true, - "dev": true - }, - "punycode": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true - }, - "qs": { - "version": "6.4.0", - "bundled": true, + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { - "version": "1.2.1", - "bundled": true, + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.7.tgz", + "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", "dev": true, "optional": true, "requires": { - "deep-extend": "0.4.2", - "ini": "1.3.4", + "deep-extend": "0.5.1", + "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" }, "dependencies": { "minimist": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true } } }, "readable-stream": { - "version": "2.2.9", - "bundled": true, - "dev": true, - "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "1.0.1", - "util-deprecate": "1.0.2" - } - }, - "request": { - "version": "2.81.0", - "bundled": true, + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, "requires": { - "aws-sign2": "0.6.0", - "aws4": "1.6.0", - "caseless": "0.12.0", - "combined-stream": "1.0.5", - "extend": "3.0.1", - "forever-agent": "0.6.1", - "form-data": "2.1.4", - "har-validator": "4.2.1", - "hawk": "3.1.3", - "http-signature": "1.1.1", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.15", - "oauth-sign": "0.8.2", - "performance-now": "0.2.0", - "qs": "6.4.0", - "safe-buffer": "5.0.1", - "stringstream": "0.0.5", - "tough-cookie": "2.3.2", - "tunnel-agent": "0.6.0", - "uuid": "3.0.1" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" } }, "rimraf": { - "version": "2.6.1", - "bundled": true, + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, + "optional": true, "requires": { "glob": "7.1.2" } }, "safe-buffer": { - "version": "5.0.1", - "bundled": true, + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", "dev": true }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true, + "optional": true + }, "semver": { - "version": "5.3.0", - "bundled": true, + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, - "sntp": { - "version": "1.0.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "hoek": "2.16.3" - } - }, - "sshpk": { - "version": "1.13.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "asn1": "0.2.3", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.1", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.1", - "getpass": "0.1.7", - "jodid25519": "1.0.2", - "jsbn": "0.1.1", - "tweetnacl": "0.14.5" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, "string-width": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { "code-point-at": "1.1.0", @@ -2504,22 +3961,19 @@ } }, "string_decoder": { - "version": "1.0.1", - "bundled": true, + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, + "optional": true, "requires": { - "safe-buffer": "5.0.1" + "safe-buffer": "5.1.1" } }, - "stringstream": { - "version": "0.0.5", - "bundled": true, - "dev": true, - "optional": true - }, "strip-ansi": { "version": "3.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "2.1.1" @@ -2527,89 +3981,38 @@ }, "strip-json-comments": { "version": "2.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-pack": { - "version": "3.4.0", - "bundled": true, + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.1.tgz", + "integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==", "dev": true, "optional": true, "requires": { - "debug": "2.6.8", - "fstream": "1.0.11", - "fstream-ignore": "1.0.5", - "once": "1.4.0", - "readable-stream": "2.2.9", - "rimraf": "2.6.1", - "tar": "2.2.1", - "uid-number": "0.0.6" + "chownr": "1.0.1", + "fs-minipass": "1.2.5", + "minipass": "2.2.4", + "minizlib": "1.1.0", + "mkdirp": "0.5.1", + "safe-buffer": "5.1.1", + "yallist": "3.0.2" } }, - "tough-cookie": { - "version": "2.3.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "punycode": "1.4.1" - } - }, - "tunnel-agent": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "bundled": true, - "dev": true, - "optional": true - }, - "uid-number": { - "version": "0.0.6", - "bundled": true, - "dev": true, - "optional": true - }, "util-deprecate": { "version": "1.0.2", - "bundled": true, - "dev": true - }, - "uuid": { - "version": "3.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, - "verror": { - "version": "1.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "extsprintf": "1.0.2" - } - }, "wide-align": { "version": "1.1.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", + "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", "dev": true, "optional": true, "requires": { @@ -2618,7 +4021,14 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "yallist": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", + "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", "dev": true } } @@ -2629,20 +4039,35 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, - "generate-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", - "dev": true, - "requires": { - "is-property": "1.0.2" - } + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true }, "glob": { "version": "7.1.2", @@ -2666,17 +4091,67 @@ "requires": { "glob-parent": "2.0.0", "is-glob": "2.0.1" + }, + "dependencies": { + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + } } }, "glob-parent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { - "is-glob": "2.0.1" + "is-glob": "3.1.0", + "path-dirname": "1.0.2" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + } } }, + "glob-to-regexp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz", + "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", + "dev": true + }, + "global-modules-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/global-modules-path/-/global-modules-path-2.1.0.tgz", + "integrity": "sha512-3DrmGj2TP+96cABk9TfMp6f3knH/Y46dqvWznTU3Tf6/bDGLDAn15tFluQ7BcloykOcdY16U0WGq0BQblYOxJQ==", + "dev": true + }, "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", @@ -2695,6 +4170,37 @@ "object-assign": "4.1.1", "pify": "2.3.0", "pinkie-promise": "2.0.1" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "globjoin": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/globjoin/-/globjoin-0.1.4.tgz", + "integrity": "sha1-L0SUrIkZ43Z8XLtpHp9GMyQoXUM=", + "dev": true + }, + "gonzales-pe": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.2.3.tgz", + "integrity": "sha512-Kjhohco0esHQnOiqqdJeNz/5fyPkOMD/d6XVjwTAoPGUFh0mCollPUTUTa2OZy4dYNAqlPIQdTiNzJTWdd9Htw==", + "dev": true, + "requires": { + "minimist": "1.1.3" + }, + "dependencies": { + "minimist": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", + "integrity": "sha1-O+39kaktOQFvz6ocaB6Pqhoe/ag=", + "dev": true + } } }, "graceful-fs": { @@ -2727,6 +4233,69 @@ "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", "dev": true }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "2.0.6", + "has-values": "1.0.0", + "isobject": "3.0.1" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "1.1.3", + "minimalistic-assert": "1.0.1", + "minimalistic-crypto-utils": "1.0.1" + } + }, "home-or-tmp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", @@ -2737,6 +4306,12 @@ "os-tmpdir": "1.0.2" } }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, "html-comment-regex": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.1.tgz", @@ -2749,36 +4324,156 @@ "integrity": "sha1-P0VR0j0b6FVOJz+eraK2F8Kzq3A=", "dev": true }, - "https-browserify": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", - "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "html-tags": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/html-tags/-/html-tags-2.0.0.tgz", + "integrity": "sha1-ELMKOGCF9Dzt41PMj6fLDe7qZos=", "dev": true }, + "htmlparser2": { + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", + "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", + "dev": true, + "requires": { + "domelementtype": "1.3.0", + "domhandler": "2.4.2", + "domutils": "1.7.0", + "entities": "1.1.1", + "inherits": "2.0.3", + "readable-stream": "2.3.6" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "dev": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, "icss-replace-symbols": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", "dev": true }, + "icss-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-2.1.0.tgz", + "integrity": "sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI=", + "dev": true, + "requires": { + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, "ieee754": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", - "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", + "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", "dev": true }, "ignore": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.5.tgz", - "integrity": "sha512-JLH93mL8amZQhh/p6mfQgVBH3M6epNq3DfsXsTSuSrInVjwyYlFE1nv2AgfRCC8PoOhM0jwQ5v8s9LgbK7yGDw==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz", + "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==", "dev": true }, + "import-lazy": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-3.1.0.tgz", + "integrity": "sha512-8/gvXvX2JMn0F+CDlSC4l6kOmVaLOO3XLkksI7CI3Ud95KDYJuYur2b9P/PUt/i/pDAMd/DulQsNbbbmRRsDIQ==", + "dev": true + }, + "import-local": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", + "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", + "dev": true, + "requires": { + "pkg-dir": "2.0.0", + "resolve-cwd": "2.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, "indexes-of": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", @@ -2808,60 +4503,227 @@ "dev": true }, "inquirer": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", - "integrity": "sha1-HvK/1jUE3wvHV4X/+MLEHfEvB34=", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "dev": true, "requires": { - "ansi-escapes": "1.4.0", - "ansi-regex": "2.1.1", - "chalk": "1.1.3", - "cli-cursor": "1.0.2", + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", + "cli-cursor": "2.1.0", "cli-width": "2.2.0", - "figures": "1.7.0", - "lodash": "4.17.4", - "readline2": "1.0.1", - "run-async": "0.1.0", - "rx-lite": "3.1.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", + "external-editor": "2.2.0", + "figures": "2.0.0", + "lodash": "4.17.10", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", "through": "2.3.8" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } } }, "interpret": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.4.tgz", - "integrity": "sha1-ggzdWIuGj/sZGoCVBtbJyPISsbA=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=", "dev": true }, "invariant": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", - "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "dev": true, "requires": { "loose-envify": "1.3.1" } }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, "is-absolute-url": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", "dev": true }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-alphabetical": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.2.tgz", + "integrity": "sha512-V0xN4BYezDHcBSKb1QHUFMlR4as/XEuCZBzMJUU4n7+Cbt33SmUnSol+pnXFvLxSHNq2CemUXNdaXV6Flg7+xg==", + "dev": true + }, + "is-alphanumeric": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz", + "integrity": "sha1-Spzvcdr0wAHB2B1j0UDPU/1oifQ=", + "dev": true + }, + "is-alphanumerical": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.2.tgz", + "integrity": "sha512-pyfU/0kHdISIgslFfZN9nfY1Gk3MquQgUm1mJTjdkEPpkAKNWuBTSqFwewOpR7N351VkErCiyV71zX7mlQQqsg==", + "dev": true, + "requires": { + "is-alphabetical": "1.0.2", + "is-decimal": "1.0.2" + } + }, + "is-arrayish": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.1.tgz", + "integrity": "sha1-wt/DhquqDD4zxI2z/ocFnmkGXv0=", + "dev": true + }, "is-binary-path": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { - "binary-extensions": "1.10.0" + "binary-extensions": "1.11.0" } }, "is-buffer": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", - "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-decimal": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.2.tgz", + "integrity": "sha512-TRzl7mOCchnhchN+f3ICUCzYvL9ul7R+TYOsZ8xia++knyZAJfv/uA1FvQXsAnYIl1T3B2X5E/J7Wb1QXiIBXg==", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", "dev": true }, "is-dotfile": { @@ -2886,9 +4748,9 @@ "dev": true }, "is-extglob": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, "is-finite": { @@ -2901,42 +4763,67 @@ } }, "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "1.0.1" - } + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true }, "is-glob": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "2.1.1" } }, - "is-my-json-valid": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.16.1.tgz", - "integrity": "sha512-ochPsqWS1WXj8ZnMIV0vnNXooaMhp7cyL4FMSIPKTtnV0Ha/T19G2b9kkhcNsabV9bxYkze7/aLZJb/bYuFduQ==", - "dev": true, - "requires": { - "generate-function": "2.0.0", - "generate-object-property": "1.2.0", - "jsonpointer": "4.0.1", - "xtend": "4.0.1" - } + "is-hexadecimal": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.2.tgz", + "integrity": "sha512-but/G3sapV3MNyqiDBLrOi4x8uCIw0RY3o/Vb5GT0sMFHrVV7731wFSVy41T5FO1og7G0gXLJh0MkgPRouko/A==", + "dev": true }, "is-number": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "is-odd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", + "dev": true, + "requires": { + "is-number": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + } } }, "is-path-cwd": { @@ -2946,18 +4833,18 @@ "dev": true }, "is-path-in-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", - "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { - "is-path-inside": "1.0.0" + "is-path-inside": "1.0.1" } }, "is-path-inside": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", - "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { "path-is-inside": "1.0.2" @@ -2969,6 +4856,15 @@ "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", "dev": true }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "3.0.1" + } + }, "is-posix-bracket": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", @@ -2981,20 +4877,35 @@ "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", "dev": true }, - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", "dev": true }, "is-resolvable": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.0.tgz", - "integrity": "sha1-jfV8YeouPFAUCNEA+wE8+NbgzGI=", - "dev": true, - "requires": { - "tryit": "1.0.3" - } + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-supported-regexp-flag": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-supported-regexp-flag/-/is-supported-regexp-flag-1.0.1.tgz", + "integrity": "sha512-3vcJecUUrpgCqc/ca0aWeNu64UGgxcvO60K/Fkr1N6RSvfGCTU60UKN68JDmKokgba0rFFJs12EnzOQa14ubKQ==", + "dev": true }, "is-svg": { "version": "2.1.0", @@ -3005,25 +4916,52 @@ "html-comment-regex": "1.1.1" } }, + "is-whitespace-character": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.2.tgz", + "integrity": "sha512-SzM+T5GKUCtLhlHFKt2SDAX2RFzfS6joT91F2/WSi9LxgFdsnhfPK/UIA+JhRR2xuyLdrCys2PiFDrtn1fU5hQ==", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-word-character": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.2.tgz", + "integrity": "sha512-T3FlsX8rCHAH8e7RE7PfOPZVFQlcV3XRF9eOOBQ1uf70OxO7CjjSOjeImMPCADBdYWcStAbVbYvJ1m2D3tb+EA==", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isnumeric": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/isnumeric/-/isnumeric-0.2.0.tgz", + "integrity": "sha1-ojR7o2DeGeM9D/1ZD933dVy/LmQ=", + "dev": true + }, "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "dev": true, - "requires": { - "isarray": "1.0.0" - } + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true }, "js-base64": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.3.2.tgz", - "integrity": "sha512-Y2/+DnfJJXT1/FCwUebUhLWb3QihxiSC42+ctHLGogmW2jPY6LCapMdFZXRvVP2z6qyKW7s6qncE/9gSqZiArw==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.5.tgz", + "integrity": "sha512-aUnNwqMOXw3yvErjMPSQu6qIIzUmT1e5KcU1OZxRDU1g/am6mzBvcrmLAYwzmB59BHPrh5/tKaiF4OPhqRWESQ==", "dev": true }, "js-tokens": { @@ -3038,7 +4976,7 @@ "integrity": "sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A=", "dev": true, "requires": { - "argparse": "1.0.9", + "argparse": "1.0.10", "esprima": "2.7.3" } }, @@ -3048,14 +4986,23 @@ "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", "dev": true }, - "json-stable-stringify": { + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify-without-jsonify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", - "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", - "dev": true, - "requires": { - "jsonify": "0.0.0" - } + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true }, "json5": { "version": "0.5.1", @@ -3063,31 +5010,31 @@ "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "dev": true }, - "jsonify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", - "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, - "jsonpointer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", - "dev": true - }, "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "known-css-properties": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/known-css-properties/-/known-css-properties-0.6.1.tgz", + "integrity": "sha512-nQRpMcHm1cQ6gmztdvLcIvxocznSMqH/y6XtERrWrHaymOYdDGroRqetJvJycxGEr1aakXiigDgn7JnzuXlk6A==", + "dev": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { - "is-buffer": "1.1.5" + "invert-kv": "1.0.0" } }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "leb": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/leb/-/leb-0.3.0.tgz", + "integrity": "sha1-Mr7p+tFoMo1q6oUi2DP0GA7tHaM=", "dev": true }, "levn": { @@ -3100,6 +5047,30 @@ "type-check": "0.3.2" } }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "4.0.0", + "pify": "3.0.0", + "strip-bom": "3.0.0" + }, + "dependencies": { + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.1", + "json-parse-better-errors": "1.0.2" + } + } + } + }, "loader-fs-cache": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/loader-fs-cache/-/loader-fs-cache-1.0.1.tgz", @@ -3108,24 +5079,86 @@ "requires": { "find-cache-dir": "0.1.1", "mkdirp": "0.5.1" + }, + "dependencies": { + "find-cache-dir": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", + "integrity": "sha1-yN765XyKUqinhPnjHFfHQumToLk=", + "dev": true, + "requires": { + "commondir": "1.0.1", + "mkdirp": "0.5.1", + "pkg-dir": "1.0.0" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true, + "requires": { + "find-up": "1.1.2" + } + } } }, + "loader-runner": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz", + "integrity": "sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=", + "dev": true + }, "loader-utils": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", - "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", "dev": true, "requires": { "big.js": "3.2.0", "emojis-list": "2.1.0", - "json5": "0.5.1", - "object-assign": "4.1.1" + "json5": "0.5.1" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" } }, "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", "dev": true }, "lodash.camelcase": { @@ -3140,16 +5173,87 @@ "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", "dev": true }, + "lodash.template": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", + "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", + "dev": true, + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.templatesettings": "4.1.0" + } + }, + "lodash.templatesettings": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", + "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", + "dev": true, + "requires": { + "lodash._reinterpolate": "3.0.0" + } + }, "lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", "dev": true }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "2.4.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "long": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", + "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=", + "dev": true + }, + "longest-streak": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.2.tgz", + "integrity": "sha512-TmYTeEYxiAmSVdpbnQDXGtvYOIRsCMg89CVZzwzc2o7GFL1CjoiRPjH5ec0NFAVlAx3fVof9dX/t6KKRAo2OWA==", "dev": true }, "loose-envify": { @@ -3161,10 +5265,72 @@ "js-tokens": "3.0.2" } }, - "macaddress": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/macaddress/-/macaddress-0.2.8.tgz", - "integrity": "sha1-WQTcU3w57G2+/q6QIycTX6hRHxI=", + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "0.4.1", + "signal-exit": "3.0.2" + } + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "3.0.0" + } + }, + "mamacro": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", + "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==", + "dev": true + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "1.0.1" + } + }, + "markdown-escapes": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.2.tgz", + "integrity": "sha512-lbRZ2mE3Q9RtLjxZBZ9+IMl68DKIXaVAhwvwn9pmjnPLS0h/6kyBMgNhqi1xFJ/2yv6cSyv0jbiZavZv93JkkA==", + "dev": true + }, + "markdown-table": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.2.tgz", + "integrity": "sha512-NcWuJFHDA8V3wkDgR/j4+gZx+YQwstPgfQDV8ndUeWWzta3dnDTBxpVzqS9lkmJAuV5YX35lmyojl6HO5JXAgw==", "dev": true }, "math-expression-evaluator": { @@ -3173,44 +5339,147 @@ "integrity": "sha1-3oGf282E3M2PrlnGrreWFbnSZqw=", "dev": true }, - "memory-fs": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.3.0.tgz", - "integrity": "sha1-e8xrYp46Q+hx1+Kaymrop/FcuyA=", + "math-random": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", + "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "dev": true + }, + "mathml-tag-names": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.0.tgz", + "integrity": "sha512-3Zs9P/0zzwTob2pdgT0CHZuMbnSUSp8MB1bddfm+HDmnFWHGT4jvEZRf+2RuPoa+cjdn/z25SEt5gFTqdhvJAg==", + "dev": true + }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", "dev": true, "requires": { - "errno": "0.1.4", - "readable-stream": "2.3.3" + "hash-base": "3.0.4", + "inherits": "2.0.3" } }, - "micromatch": { - "version": "2.3.11", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "mdast-util-compact": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-1.0.1.tgz", + "integrity": "sha1-zbX4TitqLTEU3zO9BdnLMuPECDo=", "dev": true, "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "unist-util-modify-children": "1.1.2", + "unist-util-visit": "1.3.1" } }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "0.1.7", + "readable-stream": "2.3.6" + } + }, + "meow": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "4.2.0", + "decamelize-keys": "1.1.0", + "loud-rejection": "1.6.0", + "minimist-options": "3.0.2", + "normalize-package-data": "2.4.0", + "read-pkg-up": "3.0.0", + "redent": "2.0.0", + "trim-newlines": "2.0.0", + "yargs-parser": "10.1.0" + }, + "dependencies": { + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "4.1.0" + } + } + } + }, + "merge2": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.2.tgz", + "integrity": "sha512-bgM8twH86rWni21thii6WCMQMRMmwqqdW3sGWi9IipnVAszdLXRjwDwAnyrVXo6DuP3AjRMMttZKUB48QWIFGg==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.9", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -3219,6 +5488,55 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "1.0.1", + "is-plain-obj": "1.1.0" + } + }, + "mississippi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", + "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", + "dev": true, + "requires": { + "concat-stream": "1.6.2", + "duplexify": "3.6.0", + "end-of-stream": "1.4.1", + "flush-write-stream": "1.0.3", + "from2": "2.3.0", + "parallel-transform": "1.1.0", + "pump": "2.0.1", + "pumpify": "1.5.1", + "stream-each": "1.2.2", + "through2": "2.0.3" + } + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "1.0.2", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "2.0.4" + } + } + } + }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -3228,6 +5546,20 @@ "minimist": "0.0.8" } }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "1.2.0", + "copy-concurrently": "1.0.5", + "fs-write-stream-atomic": "1.0.10", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "run-queue": "1.0.3" + } + }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -3235,63 +5567,107 @@ "dev": true }, "mute-stream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", - "integrity": "sha1-j7+rsKmKJT0xhDMfno3rc3L6xsA=", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, "nan": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz", - "integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", "dev": true, "optional": true }, + "nanomatch": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "dev": true, + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "fragment-cache": "0.2.1", + "is-odd": "2.0.0", + "is-windows": "1.0.2", + "kind-of": "6.0.2", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "neo-async": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.5.1.tgz", + "integrity": "sha512-3KL3fvuRkZ7s4IFOMfztb7zJp3QaVWnBeGoJlgB38XnCRPj/0tLzzLG5IB8NYOHbJ8g8UGrgZv44GLDk6CxTxA==", + "dev": true + }, + "nice-try": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", + "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==", + "dev": true + }, "node-libs-browser": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-0.7.0.tgz", - "integrity": "sha1-PicsCBnjCJNeJmdECNevDhSRuDs=", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", + "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", "dev": true, "requires": { "assert": "1.4.1", - "browserify-zlib": "0.1.4", + "browserify-zlib": "0.2.0", "buffer": "4.9.1", "console-browserify": "1.1.0", "constants-browserify": "1.0.0", - "crypto-browserify": "3.3.0", - "domain-browser": "1.1.7", + "crypto-browserify": "3.12.0", + "domain-browser": "1.2.0", "events": "1.1.1", - "https-browserify": "0.0.1", - "os-browserify": "0.2.1", + "https-browserify": "1.0.0", + "os-browserify": "0.3.0", "path-browserify": "0.0.0", "process": "0.11.10", "punycode": "1.4.1", "querystring-es3": "0.2.1", - "readable-stream": "2.3.3", + "readable-stream": "2.3.6", "stream-browserify": "2.0.1", - "stream-http": "2.7.2", - "string_decoder": "0.10.31", - "timers-browserify": "2.0.4", + "stream-http": "2.8.3", + "string_decoder": "1.1.1", + "timers-browserify": "2.0.10", "tty-browserify": "0.0.0", "url": "0.11.0", "util": "0.10.3", "vm-browserify": "0.0.4" }, "dependencies": { - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", "dev": true } } }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "2.7.1", + "is-builtin-module": "1.0.0", + "semver": "5.5.0", + "validate-npm-package-license": "3.0.3" + } + }, "normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", @@ -3307,6 +5683,12 @@ "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", "dev": true }, + "normalize-selector": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/normalize-selector/-/normalize-selector-0.2.0.tgz", + "integrity": "sha1-0LFF62kRicY6eNIB3E/bEpPvDAM=", + "dev": true + }, "normalize-url": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz", @@ -3319,6 +5701,24 @@ "sort-keys": "1.1.2" } }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "2.0.1" + } + }, + "nth-check": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz", + "integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=", + "dev": true, + "requires": { + "boolbase": "1.0.0" + } + }, "num2fraction": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", @@ -3337,12 +5737,52 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, "object-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.2.0.tgz", - "integrity": "sha512-smRWXzkvxw72VquyZ0wggySl7PFUtoDhvhpdwgESXxUrH7vVhhp9asfup1+rVLrhsl7L45Ee1Q/l5R2Ul4MwUg==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-1.3.0.tgz", + "integrity": "sha512-05KzQ70lSeGSrZJQXE5wNDiTkBJDlUT/myi6RX9dVIvz7a7Qh4oH93BQdiPMn27nldYvVQCKMUaM83AfizZlsQ==", "dev": true }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "3.0.1" + } + }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -3353,6 +5793,15 @@ "is-extendable": "0.1.1" } }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "3.0.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -3362,28 +5811,19 @@ "wrappy": "1.0.2" } }, - "onetime": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", - "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=", + "onecolor": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/onecolor/-/onecolor-3.0.5.tgz", + "integrity": "sha1-Nu/zIgE3nv3xGA+0ReUajiQl+fY=", "dev": true }, - "optimist": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "dev": true, "requires": { - "minimist": "0.0.8", - "wordwrap": "0.0.3" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - } + "mimic-fn": "1.2.0" } }, "optionator": { @@ -3401,9 +5841,9 @@ } }, "os-browserify": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz", - "integrity": "sha1-Y/xMzuXS13Y9Jrv4YBB45sLgBE8=", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", "dev": true }, "os-homedir": { @@ -3412,18 +5852,97 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, - "pako": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", - "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true }, + "p-limit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.2.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==", + "dev": true + }, + "parallel-transform": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", + "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "dev": true, + "requires": { + "cyclist": "0.2.2", + "inherits": "2.0.3", + "readable-stream": "2.3.6" + } + }, + "parse-asn1": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", + "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", + "dev": true, + "requires": { + "asn1.js": "4.10.1", + "browserify-aes": "1.2.0", + "create-hash": "1.2.0", + "evp_bytestokey": "1.0.3", + "pbkdf2": "3.0.16" + } + }, + "parse-entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.1.2.tgz", + "integrity": "sha512-5N9lmQ7tmxfXf+hO3X6KRG6w7uYO/HL9fHalSySTdyn63C3WNvTM/1R8tn1u1larNcEbo3Slcy2bsVDQqvEpUg==", + "dev": true, + "requires": { + "character-entities": "1.2.2", + "character-entities-legacy": "1.1.2", + "character-reference-invalid": "1.1.2", + "is-alphanumerical": "1.0.2", + "is-decimal": "1.0.2", + "is-hexadecimal": "1.0.2" + } + }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -3434,8 +5953,40 @@ "is-dotfile": "1.0.3", "is-extglob": "1.0.0", "is-glob": "2.0.1" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + } } }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, "path": { "version": "0.12.7", "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz", @@ -3452,14 +6003,17 @@ "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", "dev": true }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "dev": true, - "requires": { - "pinkie-promise": "2.0.1" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true }, "path-is-absolute": { "version": "1.0.1", @@ -3473,22 +6027,44 @@ "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "path-parse": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", "dev": true }, - "pbkdf2-compat": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pbkdf2-compat/-/pbkdf2-compat-2.0.1.tgz", - "integrity": "sha1-tuDI+plJTZTgURV1gCpZpcFC8og=", - "dev": true + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "3.0.0" + } + }, + "pbkdf2": { + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.16.tgz", + "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==", + "dev": true, + "requires": { + "create-hash": "1.2.0", + "create-hmac": "1.1.7", + "ripemd160": "2.0.2", + "safe-buffer": "5.1.2", + "sha.js": "2.4.11" + } }, "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, "pinkie": { @@ -3506,19 +6082,164 @@ "pinkie": "2.0.4" } }, - "pkg-dir": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", - "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "pixrem": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pixrem/-/pixrem-4.0.1.tgz", + "integrity": "sha1-LaSh3m7EQjxfw3lOkwuB1EkOxoY=", "dev": true, "requires": { - "find-up": "1.1.2" + "browserslist": "2.11.3", + "postcss": "6.0.22", + "reduce-css-calc": "1.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "browserslist": { + "version": "2.11.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.11.3.tgz", + "integrity": "sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA==", + "dev": true, + "requires": { + "caniuse-lite": "1.0.30000846", + "electron-to-chromium": "1.3.48" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "2.1.0" + } + }, + "pleeease-filters": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/pleeease-filters/-/pleeease-filters-4.0.0.tgz", + "integrity": "sha1-ZjKy+wVkjSdY2GU4T7zteeHMrsc=", + "dev": true, + "requires": { + "onecolor": "3.0.5", + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } } }, "pluralize": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", - "integrity": "sha1-0aIUg/0iu0HlihL6NCGCMUCJfEU=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, "postcss": { @@ -3528,7 +6249,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.3.2", + "js-base64": "2.4.5", "source-map": "0.5.7", "supports-color": "3.2.3" }, @@ -3544,6 +6265,135 @@ } } }, + "postcss-apply": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/postcss-apply/-/postcss-apply-0.10.0.tgz", + "integrity": "sha512-h0jVwtwViCo0wu+l3hEa9+RNlFbwpeVBYKRBF1K6Kqwat9egE3dDTZsUrQ9YyNE/AP3WWC5G2/oXQAezWPOJnw==", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "balanced-match": "1.0.0", + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-attribute-case-insensitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-attribute-case-insensitive/-/postcss-attribute-case-insensitive-2.0.0.tgz", + "integrity": "sha1-lNxCLI+QmX8WvTOjZUu77AhJY7Q=", + "dev": true, + "requires": { + "postcss": "6.0.22", + "postcss-selector-parser": "2.2.3" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, "postcss-calc": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-5.3.1.tgz", @@ -3555,6 +6405,652 @@ "reduce-css-calc": "1.3.0" } }, + "postcss-color-function": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-color-function/-/postcss-color-function-4.0.1.tgz", + "integrity": "sha1-QCs/LOvD9pR+YY+2vjZU++zvZEQ=", + "dev": true, + "requires": { + "css-color-function": "1.3.3", + "postcss": "6.0.22", + "postcss-message-helpers": "2.0.0", + "postcss-value-parser": "3.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-color-gray": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-color-gray/-/postcss-color-gray-4.1.0.tgz", + "integrity": "sha512-L4iLKQLdqChz6ZOgGb6dRxkBNw78JFYcJmBz1orHpZoeLtuhDDGegRtX9gSyfoCIM7rWZ3VNOyiqqvk83BEN+w==", + "dev": true, + "requires": { + "color": "2.0.1", + "postcss": "6.0.22", + "postcss-message-helpers": "2.0.0", + "reduce-function-call": "1.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "color": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color/-/color-2.0.1.tgz", + "integrity": "sha512-ubUCVVKfT7r2w2D3qtHakj8mbmKms+tThR8gI8zEYCbUBl8/voqFGt3kgBqGwXAopgXybnkuOq+qMYCRrp4cXw==", + "dev": true, + "requires": { + "color-convert": "1.9.1", + "color-string": "1.5.2" + } + }, + "color-string": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.2.tgz", + "integrity": "sha1-JuRYFLw8mny9Z1FkikFDRRSnc6k=", + "dev": true, + "requires": { + "color-name": "1.1.3", + "simple-swizzle": "0.2.2" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-color-hex-alpha": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-color-hex-alpha/-/postcss-color-hex-alpha-3.0.0.tgz", + "integrity": "sha1-HlPmyKyyN5Vej9CLfs2xuLgwn5U=", + "dev": true, + "requires": { + "color": "1.0.3", + "postcss": "6.0.22", + "postcss-message-helpers": "2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "color": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/color/-/color-1.0.3.tgz", + "integrity": "sha1-5I6DLYXxTvaU+0aIEcLVz+cptV0=", + "dev": true, + "requires": { + "color-convert": "1.9.1", + "color-string": "1.5.2" + } + }, + "color-string": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.2.tgz", + "integrity": "sha1-JuRYFLw8mny9Z1FkikFDRRSnc6k=", + "dev": true, + "requires": { + "color-name": "1.1.3", + "simple-swizzle": "0.2.2" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-color-hsl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-color-hsl/-/postcss-color-hsl-2.0.0.tgz", + "integrity": "sha1-EnA2ZvoxBDDj8wpFTawThjF9WEQ=", + "dev": true, + "requires": { + "postcss": "6.0.22", + "postcss-value-parser": "3.3.0", + "units-css": "0.4.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-color-hwb": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-color-hwb/-/postcss-color-hwb-3.0.0.tgz", + "integrity": "sha1-NAKxnvTYSXVAwftQcr6YY8qVVx4=", + "dev": true, + "requires": { + "color": "1.0.3", + "postcss": "6.0.22", + "postcss-message-helpers": "2.0.0", + "reduce-function-call": "1.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "color": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/color/-/color-1.0.3.tgz", + "integrity": "sha1-5I6DLYXxTvaU+0aIEcLVz+cptV0=", + "dev": true, + "requires": { + "color-convert": "1.9.1", + "color-string": "1.5.2" + } + }, + "color-string": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.2.tgz", + "integrity": "sha1-JuRYFLw8mny9Z1FkikFDRRSnc6k=", + "dev": true, + "requires": { + "color-name": "1.1.3", + "simple-swizzle": "0.2.2" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-color-mod-function": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/postcss-color-mod-function/-/postcss-color-mod-function-2.4.2.tgz", + "integrity": "sha512-j9RM33ybsEJUvIc22Y5I4ucvSJVHMliiW0I34JDLV0gVdvCo7/Y+zW6QMBANj+M4VZJLmyGz2mafIK4Tb5GVyg==", + "dev": true, + "requires": { + "@csstools/convert-colors": "1.4.0", + "postcss": "6.0.23", + "postcss-values-parser": "1.5.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-color-rebeccapurple": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/postcss-color-rebeccapurple/-/postcss-color-rebeccapurple-3.1.0.tgz", + "integrity": "sha512-212hJUk9uSsbwO5ECqVjmh/iLsmiVL1xy9ce9TVf+X3cK/ZlUIlaMdoxje/YpsL9cmUH3I7io+/G2LyWx5rg1g==", + "dev": true, + "requires": { + "postcss": "6.0.22", + "postcss-values-parser": "1.5.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-color-rgb": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-color-rgb/-/postcss-color-rgb-2.0.0.tgz", + "integrity": "sha1-FFOcinExSUtILg3RzCZf9lFLUmM=", + "dev": true, + "requires": { + "postcss": "6.0.22", + "postcss-value-parser": "3.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-color-rgba-fallback": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-color-rgba-fallback/-/postcss-color-rgba-fallback-3.0.0.tgz", + "integrity": "sha1-N9XJNToHoJJwkSqCYGu0Kg1wLAQ=", + "dev": true, + "requires": { + "postcss": "6.0.22", + "postcss-value-parser": "3.3.0", + "rgb-hex": "2.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, "postcss-colormin": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-2.2.2.tgz", @@ -3576,6 +7072,401 @@ "postcss-value-parser": "3.3.0" } }, + "postcss-cssnext": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/postcss-cssnext/-/postcss-cssnext-3.1.0.tgz", + "integrity": "sha512-awPDhI4OKetcHCr560iVCoDuP6e/vn0r6EAqdWPpAavJMvkBSZ6kDpSN4b3mB3Ti57hQMunHHM8Wvx9PeuYXtA==", + "dev": true, + "requires": { + "autoprefixer": "7.2.6", + "caniuse-api": "2.0.0", + "chalk": "2.4.1", + "pixrem": "4.0.1", + "pleeease-filters": "4.0.0", + "postcss": "6.0.22", + "postcss-apply": "0.8.0", + "postcss-attribute-case-insensitive": "2.0.0", + "postcss-calc": "6.0.1", + "postcss-color-function": "4.0.1", + "postcss-color-gray": "4.1.0", + "postcss-color-hex-alpha": "3.0.0", + "postcss-color-hsl": "2.0.0", + "postcss-color-hwb": "3.0.0", + "postcss-color-rebeccapurple": "3.1.0", + "postcss-color-rgb": "2.0.0", + "postcss-color-rgba-fallback": "3.0.0", + "postcss-custom-media": "6.0.0", + "postcss-custom-properties": "6.3.1", + "postcss-custom-selectors": "4.0.1", + "postcss-font-family-system-ui": "3.0.0", + "postcss-font-variant": "3.0.0", + "postcss-image-set-polyfill": "0.3.5", + "postcss-initial": "2.0.0", + "postcss-media-minmax": "3.0.0", + "postcss-nesting": "4.2.1", + "postcss-pseudo-class-any-link": "4.0.0", + "postcss-pseudoelements": "5.0.0", + "postcss-replace-overflow-wrap": "2.0.0", + "postcss-selector-matches": "3.0.1", + "postcss-selector-not": "3.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "autoprefixer": { + "version": "7.2.6", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-7.2.6.tgz", + "integrity": "sha512-Iq8TRIB+/9eQ8rbGhcP7ct5cYb/3qjNYAR2SnzLCEcwF6rvVOax8+9+fccgXk4bEhQGjOZd5TLhsksmAdsbGqQ==", + "dev": true, + "requires": { + "browserslist": "2.11.3", + "caniuse-lite": "1.0.30000846", + "normalize-range": "0.1.2", + "num2fraction": "1.2.2", + "postcss": "6.0.22", + "postcss-value-parser": "3.3.0" + } + }, + "balanced-match": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + }, + "browserslist": { + "version": "2.11.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-2.11.3.tgz", + "integrity": "sha512-yWu5cXT7Av6mVwzWc8lMsJMHWn4xyjSuGYi4IozbVTLUOEYPSagUB8kiMDUHA1fS3zjr8nkxkn9jdvug4BBRmA==", + "dev": true, + "requires": { + "caniuse-lite": "1.0.30000846", + "electron-to-chromium": "1.3.48" + } + }, + "caniuse-api": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-2.0.0.tgz", + "integrity": "sha1-sd21pZZrFvSNxJmERNS7xsfZ2DQ=", + "dev": true, + "requires": { + "browserslist": "2.11.3", + "caniuse-lite": "1.0.30000846", + "lodash.memoize": "4.1.2", + "lodash.uniq": "4.5.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "postcss-apply": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/postcss-apply/-/postcss-apply-0.8.0.tgz", + "integrity": "sha1-FOVEu7XLbxweBIhXll15rgZrE0M=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "balanced-match": "0.4.2", + "postcss": "6.0.22" + } + }, + "postcss-calc": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-6.0.1.tgz", + "integrity": "sha1-PSQXG79udinUIqQ26/5t2VEfQzA=", + "dev": true, + "requires": { + "css-unit-converter": "1.1.1", + "postcss": "6.0.22", + "postcss-selector-parser": "2.2.3", + "reduce-css-calc": "2.1.4" + } + }, + "postcss-custom-properties": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-6.3.1.tgz", + "integrity": "sha512-zoiwn4sCiUFbr4KcgcNZLFkR6gVQom647L+z1p/KBVHZ1OYwT87apnS42atJtx6XlX2yI7N5fjXbFixShQO2QQ==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "postcss": "6.0.22" + }, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + } + } + }, + "postcss-font-family-system-ui": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-font-family-system-ui/-/postcss-font-family-system-ui-3.0.0.tgz", + "integrity": "sha512-58G/hTxMSSKlIRpcPUjlyo6hV2MEzvcVO2m4L/T7Bb2fJTG4DYYfQjQeRvuimKQh1V1sOzCIz99g+H2aFNtlQw==", + "dev": true, + "requires": { + "postcss": "6.0.22" + } + }, + "postcss-nesting": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-4.2.1.tgz", + "integrity": "sha512-IkyWXICwagCnlaviRexi7qOdwPw3+xVVjgFfGsxmztvRVaNxAlrypOIKqDE5mxY+BVxnId1rnUKBRQoNE2VDaA==", + "dev": true, + "requires": { + "postcss": "6.0.22" + } + }, + "reduce-css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/reduce-css-calc/-/reduce-css-calc-2.1.4.tgz", + "integrity": "sha512-i/vWQbyd3aJRmip9OVSN9V6nIjLf/gg/ctxb0CpvHWtcRysFl/ngDBQD+rqavxdw/doScA3GMBXhzkHQ4GCzFQ==", + "dev": true, + "requires": { + "css-unit-converter": "1.1.1", + "postcss-value-parser": "3.3.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-custom-media": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-custom-media/-/postcss-custom-media-6.0.0.tgz", + "integrity": "sha1-vlMnhBEOyylQRPtTlaGABushpzc=", + "dev": true, + "requires": { + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-custom-properties": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-7.0.0.tgz", + "integrity": "sha512-dl/CNaM6z2RBa0vZZqsV6Hunj4HD6Spu7FcAkiVp5B2tgm6xReKKYzI7x7QNx3wTMBNj5v+ylfVcQGMW4xdkHw==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-custom-selectors": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-custom-selectors/-/postcss-custom-selectors-4.0.1.tgz", + "integrity": "sha1-eBOC+UxS5yfvXKR3bqKt9JphE4I=", + "dev": true, + "requires": { + "postcss": "6.0.22", + "postcss-selector-matches": "3.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, "postcss-discard-comments": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz", @@ -3623,15 +7514,463 @@ } }, "postcss-filter-plugins": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.2.tgz", - "integrity": "sha1-bYWGJTTXNaxCDkqFgG4fXUKG2Ew=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.3.tgz", + "integrity": "sha512-T53GVFsdinJhgwm7rg1BzbeBRomOg9y5MBVhGcsV0CxurUdVj1UlPdKtn7aqYA/c/QVkzKMjq2bSV5dKG5+AwQ==", "dev": true, "requires": { - "postcss": "5.2.18", - "uniqid": "4.1.1" + "postcss": "5.2.18" } }, + "postcss-font-family-system-ui": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-font-family-system-ui/-/postcss-font-family-system-ui-3.0.0.tgz", + "integrity": "sha512-58G/hTxMSSKlIRpcPUjlyo6hV2MEzvcVO2m4L/T7Bb2fJTG4DYYfQjQeRvuimKQh1V1sOzCIz99g+H2aFNtlQw==", + "dev": true, + "requires": { + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-font-variant": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-font-variant/-/postcss-font-variant-3.0.0.tgz", + "integrity": "sha1-CMzIj2BQuoLtjvLMdsDGprQfGD4=", + "dev": true, + "requires": { + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-html": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/postcss-html/-/postcss-html-0.28.0.tgz", + "integrity": "sha512-H+ucbGVR+lsZySspOApeQU9yC6Q3t75lwJYa3Im93fKAUt5DScKOSErShC0aC7USdn2jsT1LxubcC5vYu/VJYw==", + "dev": true, + "requires": { + "htmlparser2": "3.9.2" + } + }, + "postcss-image-set-polyfill": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/postcss-image-set-polyfill/-/postcss-image-set-polyfill-0.3.5.tgz", + "integrity": "sha1-Dxk0E3AM8fgr05Bm7wFtZaShgYE=", + "dev": true, + "requires": { + "postcss": "6.0.22", + "postcss-media-query-parser": "0.2.3" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-initial": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-initial/-/postcss-initial-2.0.0.tgz", + "integrity": "sha1-cnFfczbgu3k1HZnuZcSiU6hEG6Q=", + "dev": true, + "requires": { + "lodash.template": "4.4.0", + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-less": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-less/-/postcss-less-2.0.0.tgz", + "integrity": "sha512-pPNsVnpCB13nBMOcl5GVh8JGmB0JGFjqkLUDzKdVpptFFKEe9wFdEzvh2j4lD2AD+7qcrUfw9Ta+oi5+Fw7jjQ==", + "dev": true, + "requires": { + "postcss": "5.2.18" + } + }, + "postcss-load-config": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-1.2.0.tgz", + "integrity": "sha1-U56a/J3chiASHr+djDZz4M5Q0oo=", + "dev": true, + "requires": { + "cosmiconfig": "2.2.2", + "object-assign": "4.1.1", + "postcss-load-options": "1.2.0", + "postcss-load-plugins": "2.3.0" + } + }, + "postcss-load-options": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postcss-load-options/-/postcss-load-options-1.2.0.tgz", + "integrity": "sha1-sJixVZ3awt8EvAuzdfmaXP4rbYw=", + "dev": true, + "requires": { + "cosmiconfig": "2.2.2", + "object-assign": "4.1.1" + } + }, + "postcss-load-plugins": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/postcss-load-plugins/-/postcss-load-plugins-2.3.0.tgz", + "integrity": "sha1-dFdoEWWZrKLwCfrUJrABdQSdjZI=", + "dev": true, + "requires": { + "cosmiconfig": "2.2.2", + "object-assign": "4.1.1" + } + }, + "postcss-loader": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-2.1.5.tgz", + "integrity": "sha512-pV7kB5neJ0/1tZ8L1uGOBNTVBCSCXQoIsZMsrwvO8V2rKGa2tBl/f80GGVxow2jJnRJ2w1ocx693EKhZAb9Isg==", + "dev": true, + "requires": { + "loader-utils": "1.1.0", + "postcss": "6.0.22", + "postcss-load-config": "1.2.0", + "schema-utils": "0.4.5" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-markdown": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/postcss-markdown/-/postcss-markdown-0.28.0.tgz", + "integrity": "sha512-F0Vc8eHKDKTmensntXpd35LSAoXXtykhPY+IRfn4AnN4m+irav3QawmtSWLhsmbElKna8l1/HObYnbiM/Wok9Q==", + "dev": true, + "requires": { + "remark": "9.0.0", + "unist-util-find-all-after": "1.0.2" + } + }, + "postcss-media-minmax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-media-minmax/-/postcss-media-minmax-3.0.0.tgz", + "integrity": "sha1-Z1JWA3pD70C8Twdgv9BtTcadSNI=", + "dev": true, + "requires": { + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-media-query-parser": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", + "integrity": "sha1-J7Ocb02U+Bsac7j3Y1HGCeXO8kQ=", + "dev": true + }, "postcss-merge-idents": { "version": "2.1.7", "resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz", @@ -3662,7 +8001,19 @@ "caniuse-api": "1.6.1", "postcss": "5.2.18", "postcss-selector-parser": "2.2.3", - "vendors": "1.0.1" + "vendors": "1.0.2" + }, + "dependencies": { + "browserslist": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", + "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "dev": true, + "requires": { + "caniuse-db": "1.0.30000846", + "electron-to-chromium": "1.3.48" + } + } } }, "postcss-message-helpers": { @@ -3717,49 +8068,49 @@ } }, "postcss-modules-extract-imports": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.1.0.tgz", - "integrity": "sha1-thTJcgvmgW6u41+zpfqh26agXds=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.0.tgz", + "integrity": "sha1-ZhQOzs447wa/DT41XWm/WdFB6oU=", "dev": true, "requires": { - "postcss": "6.0.13" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.0" + "color-convert": "1.9.1" } }, "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.4.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.13", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz", - "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.1.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.4.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -3769,12 +8120,12 @@ "dev": true }, "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -3786,44 +8137,44 @@ "dev": true, "requires": { "css-selector-tokenizer": "0.7.0", - "postcss": "6.0.13" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.0" + "color-convert": "1.9.1" } }, "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.4.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.13", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz", - "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.1.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.4.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -3833,12 +8184,12 @@ "dev": true }, "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -3850,44 +8201,44 @@ "dev": true, "requires": { "css-selector-tokenizer": "0.7.0", - "postcss": "6.0.13" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.0" + "color-convert": "1.9.1" } }, "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.4.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.13", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz", - "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.1.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.4.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -3897,12 +8248,12 @@ "dev": true }, "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -3914,44 +8265,44 @@ "dev": true, "requires": { "icss-replace-symbols": "1.1.0", - "postcss": "6.0.13" + "postcss": "6.0.22" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.0" + "color-convert": "1.9.1" } }, "chalk": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.4.0" + "supports-color": "5.4.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.13", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.13.tgz", - "integrity": "sha512-nHsrD1PPTMSJDfU+osVsLtPkSP9YGeoOz4FDLN4r1DW4N5vqL1J+gACzTQHsfwIiWG/0/nV4yCzjTMo1zD8U1g==", + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", "dev": true, "requires": { - "chalk": "2.1.0", + "chalk": "2.4.1", "source-map": "0.6.1", - "supports-color": "4.4.0" + "supports-color": "5.4.0" } }, "source-map": { @@ -3961,12 +8312,215 @@ "dev": true }, "supports-color": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" + } + } + } + }, + "postcss-nested": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-3.0.0.tgz", + "integrity": "sha512-1xxmLHSfubuUi6xZZ0zLsNoiKfk3BWQj6fkNMaBJC529wKKLcdeCxXt6KJmDLva+trNyQNwEaE/ZWMA7cve1fA==", + "dev": true, + "requires": { + "postcss": "6.0.22", + "postcss-selector-parser": "3.1.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "postcss-selector-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", + "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "dev": true, + "requires": { + "dot-prop": "4.2.0", + "indexes-of": "1.0.1", + "uniq": "1.0.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-nested-ancestors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-nested-ancestors/-/postcss-nested-ancestors-2.0.0.tgz", + "integrity": "sha512-r8WbA1XLqbDuOGdCWpQ5nXdHvL4eKdnCEcDAnUlIAUHk7ZIQAESqPdxrWGPlq70ZB+FKw4wPbX1850dgFuxUKQ==", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5", + "postcss": "6.0.22", + "postcss-resolve-nested-selector": "0.1.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-nesting": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/postcss-nesting/-/postcss-nesting-6.0.0.tgz", + "integrity": "sha512-Yoglsy6eZbDCbRIXoYSmnIt9ao4xyg07iFwVBd7WyIkDzMSeRxIqUk8xEAdkeJQ7eGfWo6RufrTU7FSUjZ22fg==", + "dev": true, + "requires": { + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" } } } @@ -4002,6 +8556,133 @@ "postcss-value-parser": "3.3.0" } }, + "postcss-pseudo-class-any-link": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-pseudo-class-any-link/-/postcss-pseudo-class-any-link-4.0.0.tgz", + "integrity": "sha1-kVKgYT00UHIFE+iJKFS65C0O5o4=", + "dev": true, + "requires": { + "postcss": "6.0.22", + "postcss-selector-parser": "2.2.3" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-pseudoelements": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/postcss-pseudoelements/-/postcss-pseudoelements-5.0.0.tgz", + "integrity": "sha1-7vGU6NUkZFylIKlJ6V5RjoEkAss=", + "dev": true, + "requires": { + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, "postcss-reduce-idents": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-2.4.0.tgz", @@ -4032,6 +8713,471 @@ "postcss-value-parser": "3.3.0" } }, + "postcss-replace-overflow-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-replace-overflow-wrap/-/postcss-replace-overflow-wrap-2.0.0.tgz", + "integrity": "sha1-eU22+qVPjbEAhUOSqTr0V2i04ls=", + "dev": true, + "requires": { + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-reporter": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-5.0.0.tgz", + "integrity": "sha512-rBkDbaHAu5uywbCR2XE8a25tats3xSOsGNx6mppK6Q9kSFGKc/FyAzfci+fWM2l+K402p1D0pNcfDGxeje5IKg==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "lodash": "4.17.10", + "log-symbols": "2.2.0", + "postcss": "6.0.23" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-resolve-nested-selector": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", + "integrity": "sha1-Kcy8fDfe36wwTp//C/FZaz9qDk4=", + "dev": true + }, + "postcss-safe-parser": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/postcss-safe-parser/-/postcss-safe-parser-3.0.1.tgz", + "integrity": "sha1-t1Pv9sfArqXoN1++TN6L+QY/8UI=", + "dev": true, + "requires": { + "postcss": "6.0.23" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-sass": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/postcss-sass/-/postcss-sass-0.2.0.tgz", + "integrity": "sha512-cUmYzkP747fPCQE6d+CH2l1L4VSyIlAzZsok3HPjb5Gzsq3jE+VjpAdGlPsnQ310WKWI42sw+ar0UNN59/f3hg==", + "dev": true, + "requires": { + "gonzales-pe": "4.2.3", + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-scss": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/postcss-scss/-/postcss-scss-1.0.5.tgz", + "integrity": "sha512-gJB1tKYMkBy0MU+COt6WXA4ZiRctAKoWLa6qD7a6bbEbBMqrpa/BhfQdN80eYMV+JkKddZVEpZlOggnGShpvyg==", + "dev": true, + "requires": { + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-selector-matches": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/postcss-selector-matches/-/postcss-selector-matches-3.0.1.tgz", + "integrity": "sha1-5WNAEeE5UIgYYbvdWMLQER/8lqs=", + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "balanced-match": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "postcss-selector-not": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/postcss-selector-not/-/postcss-selector-not-3.0.1.tgz", + "integrity": "sha1-Lk2y8JZTNsAefOx9tsYN/3ZzNdk=", + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "balanced-match": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, "postcss-selector-parser": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz", @@ -4043,6 +9189,79 @@ "uniq": "1.0.1" } }, + "postcss-smart-import": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/postcss-smart-import/-/postcss-smart-import-0.7.6.tgz", + "integrity": "sha512-9OpXaQ1uMMHWafUh0RWIpAKa3xxUDC2yyxicUPpGffH33nzbZG4/z+nk5Ocw5gGZ+3qkXV91iDV23Cmxf2Jhew==", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "lodash": "4.17.10", + "object-assign": "4.1.1", + "postcss": "6.0.22", + "postcss-sass": "0.2.0", + "postcss-scss": "1.0.5", + "postcss-value-parser": "3.3.0", + "promise-each": "2.2.0", + "read-cache": "1.0.0", + "resolve": "1.7.1", + "sugarss": "1.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, "postcss-svgo": { "version": "2.1.6", "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-2.1.6.tgz", @@ -4055,6 +9274,12 @@ "svgo": "0.7.2" } }, + "postcss-syntax": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/postcss-syntax/-/postcss-syntax-0.28.0.tgz", + "integrity": "sha512-9W3T1fSE9QWKyW6s84kZapv0BP5uvj7mNBp34kwI93uGWULzZjaKv4xR4phubBD53cRgaM/qnvquVK1KLsl+Kg==", + "dev": true + }, "postcss-unique-selectors": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz", @@ -4072,6 +9297,17 @@ "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=", "dev": true }, + "postcss-values-parser": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/postcss-values-parser/-/postcss-values-parser-1.5.0.tgz", + "integrity": "sha512-3M3p+2gMp0AH3da530TlX8kiO1nxdTnc3C6vr8dMxRLIlh8UYkz0/wcwptSXjhtx2Fr0TySI7a+BHDQ8NL7LaQ==", + "dev": true, + "requires": { + "flatten": "1.0.2", + "indexes-of": "1.0.1", + "uniq": "1.0.1" + } + }, "postcss-zindex": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-2.2.0.tgz", @@ -4102,9 +9338,9 @@ "dev": true }, "private": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.7.tgz", - "integrity": "sha1-aM5eih7woju1cMwoU3tTMqumPvE=", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", "dev": true }, "process": { @@ -4114,33 +9350,88 @@ "dev": true }, "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, "progress": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", - "integrity": "sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "promise-each": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/promise-each/-/promise-each-2.2.0.tgz", + "integrity": "sha1-M1MXTv8mlEgQN+BOAfd6oPttG2A=", + "dev": true, + "requires": { + "any-promise": "0.1.0" + } + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", "dev": true }, "prr": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz", - "integrity": "sha1-GoS4WQgyVQFBGFPQCB7j+obikmo=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", "dev": true }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.2.tgz", + "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.2.0", + "parse-asn1": "5.1.1", + "randombytes": "2.0.6" + } + }, + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "1.4.1", + "once": "1.4.0" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "3.6.0", + "inherits": "2.0.3", + "pump": "2.0.1" + } + }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "q": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.0.tgz", - "integrity": "sha1-3QG6ydBtMObyGa7LglPunr3DCPE=", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", "dev": true }, "query-string": { @@ -4165,59 +9456,106 @@ "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", "dev": true }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", + "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", "dev": true, "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "4.0.0", + "kind-of": "6.0.2", + "math-random": "1.0.1" }, "dependencies": { "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "3.2.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "1.1.5" - } - } - } - }, - "kind-of": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "1.1.5" - } + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true } } }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "2.0.6", + "safe-buffer": "5.1.2" + } + }, + "raw-loader": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz", + "integrity": "sha1-DD0L6u2KAclm2Xh793goElKpeao=", + "dev": true + }, + "read-cache": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", + "integrity": "sha1-5mTvMRYRZsl1HNvo28+GtftY93Q=", + "dev": true, + "requires": { + "pify": "2.3.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "4.0.0", + "normalize-package-data": "2.4.0", + "path-type": "3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "3.0.0" + } + }, "readable-stream": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "safe-buffer": "5.1.1", - "string_decoder": "1.0.3", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", "util-deprecate": "1.0.2" } }, @@ -4229,28 +9567,18 @@ "requires": { "graceful-fs": "4.1.11", "minimatch": "3.0.4", - "readable-stream": "2.3.3", + "readable-stream": "2.3.6", "set-immediate-shim": "1.0.1" } }, - "readline2": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", - "integrity": "sha1-QQWWCP/BVHV7cV2ZidGZ/783LjU=", + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "mute-stream": "0.0.5" - } - }, - "rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", - "dev": true, - "requires": { - "resolve": "1.4.0" + "indent-string": "3.2.0", + "strip-indent": "2.0.0" } }, "reduce-css-calc": { @@ -4290,15 +9618,15 @@ } }, "regenerate": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz", - "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", "dev": true }, "regenerator-runtime": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", - "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==", + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, "regenerator-transform": { @@ -4309,7 +9637,7 @@ "requires": { "babel-runtime": "6.26.0", "babel-types": "6.26.0", - "private": "0.1.7" + "private": "0.1.8" } }, "regex-cache": { @@ -4321,13 +9649,29 @@ "is-equal-shallow": "0.1.3" } }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "3.0.2", + "safe-regex": "1.1.0" + } + }, + "regexpp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", + "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "dev": true + }, "regexpu-core": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", "dev": true, "requires": { - "regenerate": "1.3.3", + "regenerate": "1.4.0", "regjsgen": "0.2.0", "regjsparser": "0.1.5" } @@ -4355,6 +9699,62 @@ } } }, + "remark": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/remark/-/remark-9.0.0.tgz", + "integrity": "sha512-amw8rGdD5lHbMEakiEsllmkdBP+/KpjW/PRK6NSGPZKCQowh0BT4IWXDAkRMyG3SB9dKPXWMviFjNusXzXNn3A==", + "dev": true, + "requires": { + "remark-parse": "5.0.0", + "remark-stringify": "5.0.0", + "unified": "6.2.0" + } + }, + "remark-parse": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-5.0.0.tgz", + "integrity": "sha512-b3iXszZLH1TLoyUzrATcTQUZrwNl1rE70rVdSruJFlDaJ9z5aMkhrG43Pp68OgfHndL/ADz6V69Zow8cTQu+JA==", + "dev": true, + "requires": { + "collapse-white-space": "1.0.4", + "is-alphabetical": "1.0.2", + "is-decimal": "1.0.2", + "is-whitespace-character": "1.0.2", + "is-word-character": "1.0.2", + "markdown-escapes": "1.0.2", + "parse-entities": "1.1.2", + "repeat-string": "1.6.1", + "state-toggle": "1.0.1", + "trim": "0.0.1", + "trim-trailing-lines": "1.1.1", + "unherit": "1.1.1", + "unist-util-remove-position": "1.1.2", + "vfile-location": "2.0.3", + "xtend": "4.0.1" + } + }, + "remark-stringify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-5.0.0.tgz", + "integrity": "sha512-Ws5MdA69ftqQ/yhRF9XhVV29mhxbfGhbz0Rx5bQH+oJcNhhSM6nCu1EpLod+DjrFGrU0BMPs+czVmJZU7xiS7w==", + "dev": true, + "requires": { + "ccount": "1.0.3", + "is-alphanumeric": "1.0.0", + "is-decimal": "1.0.2", + "is-whitespace-character": "1.0.2", + "longest-streak": "2.0.2", + "markdown-escapes": "1.0.2", + "markdown-table": "1.1.2", + "mdast-util-compact": "1.0.1", + "parse-entities": "1.1.2", + "repeat-string": "1.6.1", + "state-toggle": "1.0.1", + "stringify-entities": "1.3.2", + "unherit": "1.1.1", + "xtend": "4.0.1" + } + }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -4382,6 +9782,30 @@ "is-finite": "1.0.2" } }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-from-string": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", + "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, "require-uncached": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", @@ -4393,38 +9817,70 @@ } }, "resolve": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", - "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", + "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", "dev": true, "requires": { "path-parse": "1.0.5" } }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "3.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + } + } + }, "resolve-from": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", "dev": true }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, "restore-cursor": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-1.0.1.tgz", - "integrity": "sha1-NGYfRohjJ/7SmRR5FSJS35LapUE=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "dev": true, "requires": { - "exit-hook": "1.1.1", - "onetime": "1.1.0" + "onetime": "2.0.1", + "signal-exit": "3.0.2" } }, - "right-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", - "dev": true, - "requires": { - "align-text": "0.1.4" - } + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rgb": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/rgb/-/rgb-0.1.0.tgz", + "integrity": "sha1-vieykej+/+rBvZlylyG/pA/AN7U=", + "dev": true + }, + "rgb-hex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/rgb-hex/-/rgb-hex-2.1.0.tgz", + "integrity": "sha1-x3PF/iJoolV42SU5qCp6XOU77aY=", + "dev": true }, "rimraf": { "version": "2.6.2", @@ -4436,30 +9892,76 @@ } }, "ripemd160": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-0.2.0.tgz", - "integrity": "sha1-K/GYveFnys+lHAqSjoS2i74XH84=", - "dev": true - }, - "run-async": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", - "integrity": "sha1-yK1KXhEGYeQCp9IbUw4AnyX444k=", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, "requires": { - "once": "1.4.0" + "hash-base": "3.0.4", + "inherits": "2.0.3" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "1.2.0" } }, "rx-lite": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-3.1.2.tgz", - "integrity": "sha1-Gc5QLKVyZl87ZHsQk5+X/RYV8QI=", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", "dev": true }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "4.0.8" + } + }, + "rxjs": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.0.tgz", + "integrity": "sha512-qBzf5uu6eOKiCZuAE0SgZ0/Qp+l54oeVxFfC2t+mJ2SFI6IB8gmMdJHs5DUMu5kqifqcCtsKS2XHjhZu6RKvAw==", + "dev": true, + "requires": { + "tslib": "1.9.2" + } + }, "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "0.1.15" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "sax": { @@ -4468,12 +9970,63 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true }, + "schema-utils": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.5.tgz", + "integrity": "sha512-yYrjb9TX2k/J1Y5UNy3KYdZq10xhYcF8nMpAW6o3hy6Q8WSIEf9lJHG/ePnOBfziPM3fvQwfOwa13U/Fh8qTfA==", + "dev": true, + "requires": { + "ajv": "6.5.0", + "ajv-keywords": "3.2.0" + } + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "serialize-javascript": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.5.0.tgz", + "integrity": "sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ==", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, "set-immediate-shim": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", "dev": true }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "split-string": "3.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -4481,20 +10034,43 @@ "dev": true }, "sha.js": { - "version": "2.2.6", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.2.6.tgz", - "integrity": "sha1-F93t3F9yL7ZlAWWIlUYZd4ZzFbo=", - "dev": true - }, - "shelljs": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.7.8.tgz", - "integrity": "sha1-3svPh0sNHl+3LhSxZKloMEjprLM=", + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { - "glob": "7.1.2", - "interpret": "1.0.4", - "rechoir": "0.6.2" + "inherits": "2.0.3", + "safe-buffer": "5.1.2" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=", + "dev": true, + "requires": { + "is-arrayish": "0.3.1" } }, "slash": { @@ -4504,10 +10080,129 @@ "dev": true }, "slice-ansi": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-0.0.4.tgz", - "integrity": "sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU=", - "dev": true + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "0.11.2", + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.7", + "source-map-resolve": "0.5.2", + "use": "3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "1.0.0", + "isobject": "3.0.1", + "snapdragon-util": "3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } }, "sort-keys": { "version": "1.1.2", @@ -4519,9 +10214,9 @@ } }, "source-list-map": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-0.1.8.tgz", - "integrity": "sha1-xVCyq1Qn9rPyH1r+rYjE9Vh7IQY=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", + "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==", "dev": true }, "source-map": { @@ -4530,6 +10225,19 @@ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "2.1.1", + "decode-uri-component": "0.2.0", + "resolve-url": "0.2.1", + "source-map-url": "0.4.0", + "urix": "0.1.0" + } + }, "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", @@ -4539,12 +10247,101 @@ "source-map": "0.5.7" } }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spdx-correct": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "dev": true, + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "dev": true + }, + "specificity": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/specificity/-/specificity-0.3.2.tgz", + "integrity": "sha512-Nc/QN/A425Qog7j9aHmwOrlwX2e7pNI47ciwxwy4jOlvbbMHkNNJchit+FX+UjF3IAdiaaV5BKeWuDUnws6G1A==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "3.0.2" + } + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "ssri": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", + "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "state-toggle": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.1.tgz", + "integrity": "sha512-Qe8QntFrrpWTnHwvwj2FZTgv+PKIsp0B9VxLzLLbSpPXWOgRgc5LVj/aTiSfK1RqIeF9jeC1UeOH8Q8y60A7og==", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "0.2.5", + "object-copy": "0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, "stream-browserify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", @@ -4552,22 +10349,38 @@ "dev": true, "requires": { "inherits": "2.0.3", - "readable-stream": "2.3.3" + "readable-stream": "2.3.6" + } + }, + "stream-each": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.2.tgz", + "integrity": "sha512-mc1dbFhGBxvTM3bIWmAAINbqiuAk9TATcfIQC8P+/+HJefgaiTlMn2dHvkX8qlI12KeYKSQ1Ua9RrIqrn1VPoA==", + "dev": true, + "requires": { + "end-of-stream": "1.4.1", + "stream-shift": "1.0.0" } }, "stream-http": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", - "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", "dev": true, "requires": { "builtin-status-codes": "3.0.0", "inherits": "2.0.3", - "readable-stream": "2.3.3", + "readable-stream": "2.3.6", "to-arraybuffer": "1.0.1", "xtend": "4.0.1" } }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, "strict-uri-encode": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", @@ -4575,23 +10388,51 @@ "dev": true }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } } }, "string_decoder": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { - "safe-buffer": "5.1.1" + "safe-buffer": "5.1.2" + } + }, + "stringify-entities": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-1.3.2.tgz", + "integrity": "sha512-nrBAQClJAPN2p+uGCVJRPIPakKeKWZ9GtBCmormE7pWOSlHat7+x5A8gx85M7HM5Dt0BP3pP5RhVW77WdbJJ3A==", + "dev": true, + "requires": { + "character-entities-html4": "1.1.2", + "character-entities-legacy": "1.1.2", + "is-alphanumerical": "1.0.2", + "is-hexadecimal": "1.0.2" } }, "strip-ansi": { @@ -4609,18 +10450,437 @@ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true }, + "style-search": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/style-search/-/style-search-0.1.0.tgz", + "integrity": "sha1-eVjHk+R+MuB9K1yv5cC/jhLneQI=", + "dev": true + }, + "stylelint": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-9.3.0.tgz", + "integrity": "sha512-u59pWTlrdwjqriJtTvO1a0wRK1mfbQQp7jLt27SX4zl2HmtVHOM/I1wd43xHTvUJZDKp1PTOpqRAamU3gFvmOA==", + "dev": true, + "requires": { + "autoprefixer": "8.6.5", + "balanced-match": "1.0.0", + "chalk": "2.4.1", + "cosmiconfig": "5.0.5", + "debug": "3.1.0", + "execall": "1.0.0", + "file-entry-cache": "2.0.0", + "get-stdin": "6.0.0", + "globby": "8.0.1", + "globjoin": "0.1.4", + "html-tags": "2.0.0", + "ignore": "3.3.8", + "import-lazy": "3.1.0", + "imurmurhash": "0.1.4", + "known-css-properties": "0.6.1", + "lodash": "4.17.10", + "log-symbols": "2.2.0", + "mathml-tag-names": "2.1.0", + "meow": "5.0.0", + "micromatch": "2.3.11", + "normalize-selector": "0.2.0", + "pify": "3.0.0", + "postcss": "6.0.23", + "postcss-html": "0.28.0", + "postcss-less": "2.0.0", + "postcss-markdown": "0.28.0", + "postcss-media-query-parser": "0.2.3", + "postcss-reporter": "5.0.0", + "postcss-resolve-nested-selector": "0.1.1", + "postcss-safe-parser": "3.0.1", + "postcss-sass": "0.3.2", + "postcss-scss": "1.0.5", + "postcss-selector-parser": "3.1.1", + "postcss-syntax": "0.28.0", + "postcss-value-parser": "3.3.0", + "resolve-from": "4.0.0", + "signal-exit": "3.0.2", + "specificity": "0.3.2", + "string-width": "2.1.1", + "style-search": "0.1.0", + "sugarss": "1.0.1", + "svg-tags": "1.0.0", + "table": "4.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "autoprefixer": { + "version": "8.6.5", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-8.6.5.tgz", + "integrity": "sha512-PLWJN3Xo/rycNkx+mp8iBDMTm3FeWe4VmYaZDSqL5QQB9sLsQkG5k8n+LNDFnhh9kdq2K+egL/icpctOmDHwig==", + "dev": true, + "requires": { + "browserslist": "3.2.8", + "caniuse-lite": "1.0.30000865", + "normalize-range": "0.1.2", + "num2fraction": "1.2.2", + "postcss": "6.0.23", + "postcss-value-parser": "3.3.0" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "caniuse-lite": { + "version": "1.0.30000865", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000865.tgz", + "integrity": "sha512-vs79o1mOSKRGv/1pSkp4EXgl4ZviWeYReXw60XfacPU64uQWZwJT6vZNmxRF9O+6zu71sJwMxLK5JXxbzuVrLw==", + "dev": true + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "cosmiconfig": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.0.5.tgz", + "integrity": "sha512-94j37OtvxS5w7qr7Ta6dt67tWdnOxigBVN4VnSxNXFez9o18PGQ0D33SchKP17r9LAcWVTYV72G6vDayAUBFIg==", + "dev": true, + "requires": { + "is-directory": "0.3.1", + "js-yaml": "3.12.0", + "parse-json": "4.0.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "globby": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", + "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", + "dev": true, + "requires": { + "array-union": "1.0.2", + "dir-glob": "2.0.0", + "fast-glob": "2.2.2", + "glob": "7.1.2", + "ignore": "3.3.8", + "pify": "3.0.0", + "slash": "1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.1" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "1.3.1", + "json-parse-better-errors": "1.0.2" + } + }, + "postcss": { + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "postcss-sass": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/postcss-sass/-/postcss-sass-0.3.2.tgz", + "integrity": "sha512-0HgxikiZ07VKYr98KT+k7/rAzyMgZlP+3+R8vUti56T2dPdhW0OhPGDQzddxY/N2iDtBVZQqCHRDA09j5I6EWg==", + "dev": true, + "requires": { + "gonzales-pe": "4.2.3", + "postcss": "6.0.22" + }, + "dependencies": { + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + } + } + }, + "postcss-selector-parser": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz", + "integrity": "sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU=", + "dev": true, + "requires": { + "dot-prop": "4.2.0", + "indexes-of": "1.0.1", + "uniq": "1.0.1" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "sugarss": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sugarss/-/sugarss-1.0.1.tgz", + "integrity": "sha512-3qgLZytikQQEVn1/FrhY7B68gPUUGY3R1Q1vTiD5xT+Ti1DP/8iZuwFet9ONs5+bmL8pZoDQ6JrQHVgrNlK6mA==", + "dev": true, + "requires": { + "postcss": "6.0.22" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "postcss": { + "version": "6.0.22", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", + "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "source-map": "0.6.1", + "supports-color": "5.4.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, + "svg-sprite-generator": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/svg-sprite-generator/-/svg-sprite-generator-0.0.7.tgz", + "integrity": "sha1-FZd3zj6D6ADyVc7dMR2nYUkhY+k=", + "dev": true, + "requires": { + "async": "1.5.2", + "cheerio": "0.19.0", + "commander": "2.13.0", + "es6-promise": "2.3.0" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "es6-promise": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-2.3.0.tgz", + "integrity": "sha1-lu258v2wGZWCKyY92KratnSBgbw=", + "dev": true + } + } + }, + "svg-tags": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/svg-tags/-/svg-tags-1.0.0.tgz", + "integrity": "sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=", + "dev": true + }, "svgo": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/svgo/-/svgo-0.7.2.tgz", @@ -4637,56 +10897,84 @@ } }, "table": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/table/-/table-3.8.3.tgz", - "integrity": "sha1-K7xULw/amGGnVdOUf+/Ys/UThV8=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", "dev": true, "requires": { - "ajv": "4.11.8", - "ajv-keywords": "1.5.1", - "chalk": "1.1.3", - "lodash": "4.17.4", - "slice-ansi": "0.0.4", + "ajv": "5.5.2", + "ajv-keywords": "2.1.1", + "chalk": "2.4.1", + "lodash": "4.17.10", + "slice-ansi": "1.0.0", "string-width": "2.1.1" }, "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" } }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" } } } }, "tapable": { - "version": "0.1.10", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz", - "integrity": "sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q=", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.0.0.tgz", + "integrity": "sha512-dQRhbNQkRnaqauC7WqSJ21EEksgT0fYZX2lqXzGkpo8JNig9zGZTYoMGvyI2nWmXlE2VSVXVDu7wLVGu/mQEsg==", "dev": true }, "text-table": { @@ -4701,15 +10989,34 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.6", + "xtend": "4.0.1" + } + }, "timers-browserify": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.4.tgz", - "integrity": "sha512-uZYhyU3EX8O7HQP+J9fTVYwsq90Vr68xPEFo7yrVImIxYvHgukBEgOB/SgGoorWVTzGM/3Z+wUNnboA4M8jWrg==", + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", + "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", "dev": true, "requires": { "setimmediate": "1.0.5" } }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, "to-arraybuffer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", @@ -4722,18 +11029,213 @@ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", "dev": true }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "regex-not": "1.0.2", + "safe-regex": "1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "3.0.0", + "repeat-string": "1.6.1" + } + }, + "trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=", + "dev": true + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, - "tryit": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.3.tgz", - "integrity": "sha1-OTvnMKlEb9Hq1tpZoBQwjzbCics=", + "trim-trailing-lines": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-1.1.1.tgz", + "integrity": "sha512-bWLv9BbWbbd7mlqqs2oQYnLD/U/ZqeJeJwbO0FG2zA1aTq+HTvxfHNKFa/HGCVyJpDiioUYaBhfiT6rgk+l4mg==", "dev": true }, + "trough": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.2.tgz", + "integrity": "sha512-FHkoUZvG6Egrv9XZAyYGKEyb1JMsFphgPjoczkZC2y6W93U1jswcVURB8MUvtsahEPEVACyxD47JAL63vF4JsQ==", + "dev": true + }, + "ts-loader": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-4.4.1.tgz", + "integrity": "sha512-PvL6jgVEt4RurczrTOR8uI6uRmKRfRXiv3CyMRX8+MSQLlbedfbXtbJIdkhdpbqrsumb+Lc3qrxfmXHCmODyAg==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "enhanced-resolve": "4.0.0", + "loader-utils": "1.1.0", + "micromatch": "3.1.10", + "semver": "5.5.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "tslib": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.2.tgz", + "integrity": "sha512-AVP5Xol3WivEr7hnssHDsaM+lVrVXWUvd1cfXTRkTj80b//6g2wIFEH6hZG0muGZRnHGrfttpdzRk3YlBkWjKw==", + "dev": true + }, + "tslint": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.10.0.tgz", + "integrity": "sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "builtin-modules": "1.1.1", + "chalk": "2.4.1", + "commander": "2.13.0", + "diff": "3.5.0", + "glob": "7.1.2", + "js-yaml": "3.7.0", + "minimatch": "3.0.4", + "resolve": "1.7.1", + "semver": "5.5.0", + "tslib": "1.9.2", + "tsutils": "2.27.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "tslint-loader": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/tslint-loader/-/tslint-loader-3.6.0.tgz", + "integrity": "sha512-Me9Qf/87BOfCY8uJJw+J7VMF4U8WiMXKLhKKKugMydF0xMhMOt9wo2mjYTNhwbF9H7SHh8PAIwRG8roisTNekQ==", + "dev": true, + "requires": { + "loader-utils": "1.1.0", + "mkdirp": "0.5.1", + "object-assign": "4.1.1", + "rimraf": "2.6.2", + "semver": "5.5.0" + } + }, + "tsutils": { + "version": "2.27.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.27.1.tgz", + "integrity": "sha512-AE/7uzp32MmaHvNNFES85hhUDHFdFZp6OAiZcd6y4ZKKIg6orJTm8keYWBhIhrJQH3a4LzNKat7ZPXZt5aTf6w==", + "dev": true, + "requires": { + "tslib": "1.9.2" + } + }, "tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", @@ -4755,31 +11257,112 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, - "uglify-js": { - "version": "2.7.5", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.7.5.tgz", - "integrity": "sha1-RhLAx7qu4rp8SH3kkErhIgefLKg=", + "typescript": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.1.tgz", + "integrity": "sha512-h6pM2f/GDchCFlldnriOhs1QHuwbnmj6/v7499eMHqPeW4V2G0elua2eIc2nu8v2NdHV0Gm+tzX83Hr6nUFjQA==", + "dev": true + }, + "uglify-es": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", + "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", "dev": true, "requires": { - "async": "0.2.10", - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" + "commander": "2.13.0", + "source-map": "0.6.1" }, "dependencies": { - "async": { - "version": "0.2.10", - "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", - "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true + "uglifyjs-webpack-plugin": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.5.tgz", + "integrity": "sha512-hIQJ1yxAPhEA2yW/i7Fr+SXZVMp+VEI3d42RTHBgQd2yhp/1UdBcR3QEWPV5ahBxlqQDMEMTuTEvDHSFINfwSw==", + "dev": true, + "requires": { + "cacache": "10.0.4", + "find-cache-dir": "1.0.0", + "schema-utils": "0.4.5", + "serialize-javascript": "1.5.0", + "source-map": "0.6.1", + "uglify-es": "3.3.9", + "webpack-sources": "1.1.0", + "worker-farm": "1.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "unherit": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.1.tgz", + "integrity": "sha512-+XZuV691Cn4zHsK0vkKYwBEwB74T3IZIcxrgn2E4rKwTfFyI1zCh7X7grwh9Re08fdPlarIdyWgI8aVB3F5A5g==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "xtend": "4.0.1" + } + }, + "unified": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/unified/-/unified-6.2.0.tgz", + "integrity": "sha512-1k+KPhlVtqmG99RaTbAv/usu85fcSRu3wY8X+vnsEhIxNP5VbVIDiXnLqyKIG+UMdyTg0ZX9EI6k2AfjJkHPtA==", + "dev": true, + "requires": { + "bail": "1.0.3", + "extend": "3.0.1", + "is-plain-obj": "1.1.0", + "trough": "1.0.2", + "vfile": "2.3.0", + "x-is-string": "0.1.0" + } + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + } + } }, "uniq": { "version": "1.0.1", @@ -4787,21 +11370,149 @@ "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", "dev": true }, - "uniqid": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-4.1.1.tgz", - "integrity": "sha1-iSIN32t1GuUrX3JISGNShZa7hME=", - "dev": true, - "requires": { - "macaddress": "0.2.8" - } - }, "uniqs": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz", "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=", "dev": true }, + "unique-filename": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.0.tgz", + "integrity": "sha1-0F8v5AMlYIcfMOk8vnNe6iAVFPM=", + "dev": true, + "requires": { + "unique-slug": "2.0.0" + } + }, + "unique-slug": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.0.tgz", + "integrity": "sha1-22Z258fMBimHj/GWCXx4hVrp9Ks=", + "dev": true, + "requires": { + "imurmurhash": "0.1.4" + } + }, + "unist-util-find-all-after": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unist-util-find-all-after/-/unist-util-find-all-after-1.0.2.tgz", + "integrity": "sha512-nDl79mKpffXojLpCimVXnxhlH/jjaTnDuScznU9J4jjsaUtBdDbxmlc109XtcqxY4SDO0SwzngsxxW8DIISt1w==", + "dev": true, + "requires": { + "unist-util-is": "2.1.2" + } + }, + "unist-util-is": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-2.1.2.tgz", + "integrity": "sha512-YkXBK/H9raAmG7KXck+UUpnKiNmUdB+aBGrknfQ4EreE1banuzrKABx3jP6Z5Z3fMSPMQQmeXBlKpCbMwBkxVw==", + "dev": true + }, + "unist-util-modify-children": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-1.1.2.tgz", + "integrity": "sha512-GRi04yhng1WqBf5RBzPkOtWAadcZS2gvuOgNn/cyJBYNxtTuyYqTKN0eg4rC1YJwGnzrqfRB3dSKm8cNCjNirg==", + "dev": true, + "requires": { + "array-iterate": "1.1.2" + } + }, + "unist-util-remove-position": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.2.tgz", + "integrity": "sha512-XxoNOBvq1WXRKXxgnSYbtCF76TJrRoe5++pD4cCBsssSiWSnPEktyFrFLE8LTk3JW5mt9hB0Sk5zn4x/JeWY7Q==", + "dev": true, + "requires": { + "unist-util-visit": "1.3.1" + } + }, + "unist-util-stringify-position": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz", + "integrity": "sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ==", + "dev": true + }, + "unist-util-visit": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.3.1.tgz", + "integrity": "sha512-0fdB9EQJU0tho5tK0VzOJzAQpPv2LyLZ030b10GxuzAWEfvd54mpY7BMjQ1L69k2YNvL+SvxRzH0yUIehOO8aA==", + "dev": true, + "requires": { + "unist-util-is": "2.1.2" + } + }, + "units-css": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/units-css/-/units-css-0.4.0.tgz", + "integrity": "sha1-1iKGU6UZg9fBb/KPi53Dsf/tOgc=", + "dev": true, + "requires": { + "isnumeric": "0.2.0", + "viewport-dimensions": "0.2.0" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "0.3.1", + "isobject": "3.0.1" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", + "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "2.1.1" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, "url": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", @@ -4820,13 +11531,13 @@ } } }, - "user-home": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", - "integrity": "sha1-nHC/2Babwdy/SGBODwS4tJzenp8=", + "use": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", + "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", "dev": true, "requires": { - "os-homedir": "1.0.2" + "kind-of": "6.0.2" } }, "util": { @@ -4852,10 +11563,59 @@ "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true }, + "v8-compile-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.0.tgz", + "integrity": "sha512-qNdTUMaCjPs4eEnM3W9H94R3sU70YCuT+/ST7nUf+id1bVOrdjrpUaeZLqPBPRph3hsgn4a4BvwpxhHZx+oSDg==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "dev": true, + "requires": { + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" + } + }, "vendors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.2.tgz", + "integrity": "sha512-w/hry/368nO21AN9QljsaIhb9ZiZtZARoVH5f3CsFbawdLdayCgKRPup7CggujvySMxx0I91NOyxdVENohprLQ==", + "dev": true + }, + "vfile": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-2.3.0.tgz", + "integrity": "sha512-ASt4mBUHcTpMKD/l5Q+WJXNtshlWxOogYyGYYrg4lt/vuRjC1EFQtlAofL5VmtVNIZJzWYFJjzGWZ0Gw8pzW1w==", + "dev": true, + "requires": { + "is-buffer": "1.1.6", + "replace-ext": "1.0.0", + "unist-util-stringify-position": "1.1.2", + "vfile-message": "1.0.1" + } + }, + "vfile-location": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.3.tgz", + "integrity": "sha512-zM5/l4lfw1CBoPx3Jimxoc5RNDAHHpk6AM6LM0pTIkm5SUSsx8ZekZ0PVdf0WEZ7kjlhSt7ZlqbRL6Cd6dBs6A==", + "dev": true + }, + "vfile-message": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.1.tgz", - "integrity": "sha1-N61zyO5Bf7PVgOeFMSMH0nSEfyI=", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-1.0.1.tgz", + "integrity": "sha512-vSGCkhNvJzO6VcWC6AlJW4NtYOVtS+RgCaqFIYUjoGIlHnFL+i0LbtYvonDWOMcB97uTPT4PRsyYY7REWC9vug==", + "dev": true, + "requires": { + "unist-util-stringify-position": "1.1.2" + } + }, + "viewport-dimensions": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/viewport-dimensions/-/viewport-dimensions-0.2.0.tgz", + "integrity": "sha1-3nQHR9tTh/0XJfUXXpG6x2r982w=", "dev": true }, "vm-browserify": { @@ -4868,99 +11628,195 @@ } }, "watchpack": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-0.2.9.tgz", - "integrity": "sha1-Yuqkq15bo1/fwBgnVibjwPXj+ws=", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", + "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", "dev": true, "requires": { - "async": "0.9.2", - "chokidar": "1.7.0", - "graceful-fs": "4.1.11" - }, - "dependencies": { - "async": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", - "dev": true - } + "chokidar": "2.0.3", + "graceful-fs": "4.1.11", + "neo-async": "2.5.1" } }, "webpack": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-1.15.0.tgz", - "integrity": "sha1-T/MfU9sDM55VFkqdRo7gMklo/pg=", + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.12.0.tgz", + "integrity": "sha512-EJj2FfhgtjrTbJbJaNulcVpDxi9vsQVvTahHN7xJvIv6W+k4r/E6Hxy4eyOrj+IAFWqYgaUtnpxmSGYP8MSZJw==", "dev": true, "requires": { - "acorn": "3.3.0", - "async": "1.5.2", - "clone": "1.0.2", - "enhanced-resolve": "0.9.1", - "interpret": "0.6.6", - "loader-utils": "0.2.17", - "memory-fs": "0.3.0", + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-module-context": "1.5.12", + "@webassemblyjs/wasm-edit": "1.5.12", + "@webassemblyjs/wasm-opt": "1.5.12", + "@webassemblyjs/wasm-parser": "1.5.12", + "acorn": "5.6.2", + "acorn-dynamic-import": "3.0.0", + "ajv": "6.5.0", + "ajv-keywords": "3.2.0", + "chrome-trace-event": "1.0.0", + "enhanced-resolve": "4.0.0", + "eslint-scope": "3.7.1", + "json-parse-better-errors": "1.0.2", + "loader-runner": "2.3.0", + "loader-utils": "1.1.0", + "memory-fs": "0.4.1", + "micromatch": "3.1.10", "mkdirp": "0.5.1", - "node-libs-browser": "0.7.0", - "optimist": "0.6.1", - "supports-color": "3.2.3", - "tapable": "0.1.10", - "uglify-js": "2.7.5", - "watchpack": "0.2.9", - "webpack-core": "0.6.9" + "neo-async": "2.5.1", + "node-libs-browser": "2.1.0", + "schema-utils": "0.4.5", + "tapable": "1.0.0", + "uglifyjs-webpack-plugin": "1.2.5", + "watchpack": "1.6.0", + "webpack-sources": "1.1.0" }, "dependencies": { "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.6.2.tgz", + "integrity": "sha512-zUzo1E5dI2Ey8+82egfnttyMlMZ2y0D8xOCO3PNPPlYXpl8NZvF6Qk9L9BEtJs+43FqEmfBViDqc5d1ckRDguw==", "dev": true - }, - "interpret": { - "version": "0.6.6", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz", - "integrity": "sha1-/s16GOfOXKar+5U+H4YhOknxYls=", - "dev": true - }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "1.0.0" - } } } }, - "webpack-core": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/webpack-core/-/webpack-core-0.6.9.tgz", - "integrity": "sha1-/FcViMhVjad76e+23r3Fo7FyvcI=", + "webpack-cli": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.0.3.tgz", + "integrity": "sha512-65a3T3SDIozJjRU4UJMdK+LXJt73gNs2qpdjsOeq6jIrfBvAKApy59Glof1qDG3wYEo38HRxb+KrwsrsAtsaiA==", "dev": true, "requires": { - "source-list-map": "0.1.8", - "source-map": "0.4.4" + "chalk": "2.4.1", + "cross-spawn": "6.0.5", + "enhanced-resolve": "4.0.0", + "global-modules-path": "2.1.0", + "import-local": "1.0.0", + "inquirer": "6.0.0", + "interpret": "1.1.0", + "loader-utils": "1.1.0", + "supports-color": "5.4.0", + "v8-compile-cache": "2.0.0", + "yargs": "11.1.0" }, "dependencies": { - "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "amdefine": "1.0.1" + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "chardet": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.5.0.tgz", + "integrity": "sha512-9ZTaoBaePSCFvNlNGrsyI8ZVACP2svUtq0DkM7t4K2ClAa96sqOIRjAzDTc8zXzFt1cZR46rRzLTiHFSJ+Qw0g==", + "dev": true + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "1.0.4", + "path-key": "2.0.1", + "semver": "5.5.0", + "shebang-command": "1.2.0", + "which": "1.3.1" + } + }, + "external-editor": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.0.tgz", + "integrity": "sha512-mpkfj0FEdxrIhOC04zk85X7StNtr0yXnG7zCb+8ikO8OJi2jsHh5YGoknNTyXgsbHOf1WOOcVU3kPFWT2WgCkQ==", + "dev": true, + "requires": { + "chardet": "0.5.0", + "iconv-lite": "0.4.23", + "tmp": "0.0.33" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "inquirer": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.0.0.tgz", + "integrity": "sha512-tISQWRwtcAgrz+SHPhTH7d3e73k31gsOy6i1csonLc0u1dVK/wYvuOnFeiWqC5OXFIYbmrIFInef31wbT8MEJg==", + "dev": true, + "requires": { + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "3.0.0", + "figures": "2.0.0", + "lodash": "4.17.10", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rxjs": "6.2.0", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" } } } }, "webpack-sources": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-0.1.5.tgz", - "integrity": "sha1-qh86vw8NdNtxEcQOUAuE+WZkB1A=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.1.0.tgz", + "integrity": "sha512-aqYp18kPphgoO5c/+NaUvEeACtZjMESmDChuD3NBciVpah3XpMEU9VAAtIaB1BsfJWWTSdv8Vv1m3T0aRk2dUw==", "dev": true, "requires": { - "source-list-map": "0.1.8", - "source-map": "0.5.7" + "source-list-map": "2.0.0", + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } } }, "whet.extend": { @@ -4969,10 +11825,19 @@ "integrity": "sha1-+HfVv2SMl+WqVC+twW1qJZucEaE=", "dev": true }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, "wordwrap": { @@ -4981,6 +11846,47 @@ "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, + "worker-farm": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz", + "integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==", + "dev": true, + "requires": { + "errno": "0.1.7" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -4996,22 +11902,65 @@ "mkdirp": "0.5.1" } }, + "x-is-string": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/x-is-string/-/x-is-string-0.1.0.tgz", + "integrity": "sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI=", + "dev": true + }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", "dev": true }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", "dev": true, "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", + "cliui": "4.1.0", "decamelize": "1.2.0", - "window-size": "0.1.0" + "find-up": "2.1.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "9.0.2" + }, + "dependencies": { + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + } + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "dev": true, + "requires": { + "camelcase": "4.1.0" } } } diff --git a/package.json b/package.json index e75ce2ce..1ee49ebe 100644 --- a/package.json +++ b/package.json @@ -1,25 +1,59 @@ { "name": "codex.editor", - "version": "1.7.8", + "version": "2.0.0", "description": "Codex Editor. Native JS, based on API and Open Source", "main": "index.js", "scripts": { - "build": "webpack" + "build": "rimraf dist && npm run svg && npm run build:dev", + "svg": "svg-sprite-generate -d src/assets/ -o build/sprite.svg", + "build:dev": "webpack --mode development --progress --display-error-details --display-entrypoints" }, "author": "Codex Team", "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/codex-team/codex.editor.git" + }, "devDependencies": { - "babel-core": "^6.21.0", - "babel-loader": "^6.2.10", - "babel-polyfill": "^6.20.0", - "babel-preset-es2015": "^6.22.0", - "babel-runtime": "^6.20.0", - "css-loader": "^0.26.1", - "eslint": "^3.12.2", - "eslint-loader": "^1.6.1", - "extract-text-webpack-plugin": "^1.0.1", + "babel-core": "^6.26.3", + "babel-loader": "^7.1.4", + "babel-plugin-add-module-exports": "^0.2.1", + "babel-plugin-class-display-name": "^2.1.0", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.7.0", + "babel-preset-stage-0": "^6.24.1", + "babel-runtime": "^6.26.0", + "css-loader": "^0.28.11", + "eslint": "^4.19.1", + "eslint-loader": "^2.0.0", + "extract-text-webpack-plugin": "^3.0.2", "html-janitor": "^2.0.2", "path": "^0.12.7", - "webpack": "^1.14.0" - } + "postcss-apply": "^0.10.0", + "postcss-color-hex-alpha": "^3.0.0", + "postcss-color-mod-function": "^2.4.2", + "postcss-cssnext": "^3.1.0", + "postcss-custom-media": "^6.0.0", + "postcss-custom-properties": "^7.0.0", + "postcss-custom-selectors": "^4.0.1", + "postcss-font-family-system-ui": "^3.0.0", + "postcss-font-variant": "^3.0.0", + "postcss-loader": "^2.1.5", + "postcss-media-minmax": "^3.0.0", + "postcss-nested": "^3.0.0", + "postcss-nested-ancestors": "^2.0.0", + "postcss-nesting": "^6.0.0", + "postcss-smart-import": "^0.7.6", + "raw-loader": "^0.5.1", + "rimraf": "^2.6.2", + "stylelint": "^9.3.0", + "svg-sprite-generator": "0.0.7", + "ts-loader": "^4.4.1", + "tslint": "^5.10.0", + "tslint-loader": "^3.6.0", + "typescript": "^2.9.1", + "webpack": "^4.12.0", + "webpack-cli": "^3.0.3" + }, + "dependencies": {} } diff --git a/plugins/attaches/attaches.css b/plugins/attaches/attaches.css deleted file mode 100644 index 8082a356..00000000 --- a/plugins/attaches/attaches.css +++ /dev/null @@ -1,130 +0,0 @@ -.cdx-attaches__default-wrapper { - margin: 15px 0; - padding: 15px; - background: #fff; - border: 1px solid #ebecec; - box-shadow: 0 1px 2px 0 rgba(34, 36, 44, 0.03); - border-radius: 3px; - text-align: center; -} - -.cdx-attaches__default-button { - color: #8990aa; - cursor: pointer; -} - -.cdx-attaches__default-button:hover { - color: #393f52; -} - -.cdx-attaches__wrapper { - display: -ms-flexbox; - display: flex; - -ms-flex-flow: row nowrap; - flex-flow: row nowrap; - -ms-flex-pack: start; - justify-content: flex-start; - -ms-flex-align: center; - align-items: center; - margin: 10px 0; - padding: 15px 20px; - background: #fff; - border: 1px solid #ebecec; - box-shadow: 0 1px 2px 0 rgba(34, 36, 44, 0.03); - border-radius: 3px; - font-size: 15px; -} - -.cdx-attaches__file-name { - -ms-flex-positive: 8; - flex-grow: 8; - width: 100%; - outline: none; - border: 0; - font-size: inherit; -} - -.cdx-attaches__file-name--collapsed { - width: 30%; - overflow: hidden; - text-overflow: ellipsis; -} - -.cdx-attaches__extension, -.cdx-attaches__size { - color: #8f9298; - white-space: nowrap; -} - -.cdx-attaches__extension::after { - content: ','; - margin-right: 0.2em; -} - -.cdx-attaches__size::after { - content: 'KB'; - margin-left: 0.2em; -} - -.cdx-attaches__icon { - display: inline-block; - width: 16px; - height: 32px; - background: url(file-icon-black.svg) no-repeat center center; - background-size: contain; -} - -li:hover .cdx-attaches__icon, -.selected .cdx-attaches__icon { - background: url(file-icon-white.svg) no-repeat center center; - background-size: contain; -} - -.cdx-attaches__icon--inline { - height: 16px; - vertical-align: text-bottom; -} - -.cdx-attaches__loader { - background-color: transparent; - background-image: repeating-linear-gradient(-45deg, transparent, transparent 4px, #f5f9ff 4px, #eaedef 8px) !important; - background-size: 56px 56px; - animation: loading-bar 5s infinite linear; -} - -@keyframes loading-bar { - 100% { background-position: -56% 0; } -} - -.cdx-attaches__progress-bar { - width: 100%; - height: 3px; - margin: 0 15px; - background: #e1e3eb; - border: 0; - border-radius: 5px; -} - -.cdx-attaches__progress-bar::-webkit-progress-bar { - background: #e0e1e3; - border-radius: 5px; -} - -.cdx-attaches__progress-bar::-webkit-progress-value { - background: #414957; - border-radius: 5px; - transition: all 100ms ease-in; -} - -progress::-moz-progress-bar { - background: #414957; - border-radius: 5px; -} - -.cdx-attaches__cross-button { - width: 18px; - height: 18px; - background: url(cross.svg) no-repeat center center; - background-size: contain; - cursor: pointer; -} diff --git a/plugins/attaches/attaches.js b/plugins/attaches/attaches.js deleted file mode 100644 index 52268411..00000000 --- a/plugins/attaches/attaches.js +++ /dev/null @@ -1,430 +0,0 @@ -/** - * Attache-file Plugin for CodeX Editor - * - * @param {String} config.fetchUrl - Route for file uploding - * @param {Nubmer} config.maxSize - Maximum allowed file size in KB - * @param {String} config.accept - Accepted MIME-types. By default, accepts all - * - * Backend should return response with - * 'url' - Full path to the uploaded file - * 'title' - File title, - * 'name' - File name without extension, - * 'extension' - File extension, - * 'size' - File size - * - * @author @gohabereg - * @version 1.0.0 - */ -var cdxAttaches = function () { - - /** - * Private methods and props - */ - - var KBYTE = 1024, - fileWrapper = null; - - /** - * Default config - * Can be redefined with prepare method - * - * @var sting config.fetchUrl -- url to your fetch script - * @var int config.maxSize -- max size of file in kilobytes - * @var accept config.accept -- valid MIME-types. By default, accepts all - * - */ - var config = { - - fetchUrl: '', - maxSize: 2, - accept: '' - - }; - - var elementsClasses = { - - defaultFormWrapper : 'cdx-attaches__default-wrapper', - defaultFormButton : 'cdx-attaches__default-button', - - progressBar : 'cdx-attaches__progress-bar', - wrapper : 'cdx-attaches__wrapper', - loader : 'cdx-attaches__loader', - crossButton : 'cdx-attaches__cross-button', - - file: { - title : 'cdx-attaches__file-name', - collapsedName : 'cdx-attaches__file-name--collapsed', - extension : 'cdx-attaches__extension', - size : 'cdx-attaches__size' - } - - }; - - var ui = { - - defaultForm: function () { - - var wrapper = codex.editor.draw.node('div', elementsClasses.defaultFormWrapper), - button = codex.editor.draw.node('div', elementsClasses.defaultFormButton); - - button.addEventListener('click', upload.fire); - button.innerHTML = ' Загрузить файл'; - - wrapper.appendChild(button); - - return wrapper; - - }, - - uploadedFile: function (data) { - - var wrapper = codex.editor.draw.node('div', elementsClasses.wrapper), - name = codex.editor.draw.node('input', elementsClasses.file.title), - extension = codex.editor.draw.node('span', elementsClasses.file.extension), - size = codex.editor.draw.node('span', elementsClasses.file.size); - - wrapper.dataset.url = data.url; - wrapper.dataset.name = data.name; - name.value = data.title || ''; - extension.textContent = data.extension.toUpperCase(); - size.textContent = data.size; - - wrapper.appendChild(name); - wrapper.appendChild(extension); - wrapper.appendChild(size); - - return wrapper; - - }, - - progressBar: { - - bar: null, - - draw: function () { - - var wrapper = codex.editor.draw.node('div', elementsClasses.wrapper), - progress = codex.editor.draw.node('progress', elementsClasses.progressBar), - name = codex.editor.draw.node('span', elementsClasses.file.title), - crossButton = codex.editor.draw.node('span', elementsClasses.crossButton); - - progress.max = 100; - progress.value = 0; - - name.textContent = codex.editor.transport.input.files[0].name; - name.classList.add(elementsClasses.file.collapsedName); - - crossButton.addEventListener('click', upload.abort); - - ui.progressBar.bar = progress; - - wrapper.appendChild(name); - wrapper.appendChild(progress); - wrapper.appendChild(crossButton); - - return wrapper; - - }, - - change: function (value) { - - console.assert( !isNaN(value), 'CodeX Editor Attaches: passed value is not a Number'); - - ui.progressBar.bar.value = value; - - } - - } - - }; - - /** - * Notify about upload errors via codex.editor.notifications - * - * @param Object error can have `message` property with error message - */ - var notifyError = function (error) { - - error = error || {}; - - codex.editor.notifications.notification({ - type: 'error', - message: 'Ошибка во время загрузки файла' + ( error.message ? ': ' + error.message : '' ) - }); - - }; - - /** - * Contains validation methods - * - * TODO: MIME-type validation - * - */ - var validation = { - - size: function () { - - var file = codex.editor.transport.input.files[0]; - - return Math.ceil(file.size / KBYTE) <= config.maxSize; - - }, - - }; - - var upload = { - - current: null, - - aborted: false, - - /** - * Fired codex.editor.transport selectAndUpload methods - */ - fire: function () { - - codex.editor.transport.selectAndUpload({ - url: config.fetchUrl, - success: upload.success, - beforeSend: upload.start, - progress: upload.progress, - error: upload.error, - accept: config.accept - }); - - }, - - /** - * Will be called before upload - * Draws load animation and progress bar - */ - start: function () { - - if (!validation.size()) { - - notifyError({message: 'Файл слишком большой'}); - return false; - - } - - if (upload.current) { - - notifyError({message: 'Дождитесь окончания предыдущей загрузки'}); - return; - - } - - var progress = ui.progressBar.draw(); - - upload.current = progress; - - codex.editor.content.switchBlock(fileWrapper, progress, 'attaches'); - - }, - - /** - * Handler for XmlHttpRequest.upload.onprogress event - * Changes progress bar status - * - * @param event - */ - progress: function (event) { - - /** Prevents isNaN value assignment */ - if (!event.total) { - return; - } - - var value = parseInt(event.loaded / event.total * 100); - - ui.progressBar.change(value); - - }, - - /** - * Will be called after success upload - * Try to decode JSON response and draws ui or fires error handler - * - * @param response - */ - success: function (response) { - - var data, - uploadedFile; - - try { - - response = JSON.parse(response); - - if (response.success) { - - data = response.data; - data.size = Math.ceil(data.size / KBYTE) || 1; - - uploadedFile = ui.uploadedFile(data); - codex.editor.content.switchBlock(upload.current, uploadedFile, 'attaches'); - - uploadedFile.querySelector('input').focus(); - - } else { - - upload.error(response); - - } - - } catch (e) { - - upload.error(); - - } - - upload.current = null; - - }, - - /** - * Upload errors handler - * - * @param error - */ - error: function (error) { - - var defaultFrom = ui.defaultForm(); - - codex.editor.content.switchBlock(upload.current, defaultFrom, 'attaches'); - - if (!upload.aborted) { - - notifyError(error); - - } - - upload.aborted = false; - - upload.current = null; - - }, - - abort: function () { - - codex.editor.transport.abort(); - - upload.aborted = true; - - upload.current = null; - - } - - }; - - - - /* - * Public methods - * @param {String} _config.fetchUrl Required - */ - var prepare = function (_config) { - - return new Promise(function(resolve, reject){ - - if ( !_config.fetchUrl ){ - - reject(Error('fetchUrl is missed')); - return; - - } - - config.fetchUrl = _config.fetchUrl; - config.accept = _config.accept || config.accept; - - if ( !isNaN(_config.maxSize)){ - config.maxSize = _config.maxSize; - } - - resolve(); - - }); - - }; - - var render = function (data) { - - if (!data) { - - fileWrapper = ui.defaultForm(); - return fileWrapper; - - } - - return ui.uploadedFile(data); - - }; - - var save = function (block) { - - var data = { - - url: block.dataset.url, - name: block.dataset.name, - title: block.querySelector('.' + elementsClasses.file.title).value, - extension: block.querySelector('.' + elementsClasses.file.extension).textContent, - size: block.querySelector('.' + elementsClasses.file.size).textContent, - - }; - - return data; - - }; - - var validate = function (data) { - - if (!data.url || !data.url.trim()) { - - return false; - - } - - if (!data.title || !data.title.trim()) { - - return false; - - } - - if (!data.extension || !data.extension.trim()) { - - return false; - - } - - if (!data.size || !data.size.trim()) { - - return false; - - } - - return true; - - }; - - var destroy = function () { - - cdxAttaches = null; - - }; - - var appendCallback = function () { - - upload.fire(); - - }; - - return { - prepare: prepare, - render: render, - save: save, - validate: validate, - destroy: destroy, - appendCallback: appendCallback - }; - -}(); \ No newline at end of file diff --git a/plugins/attaches/cross.svg b/plugins/attaches/cross.svg deleted file mode 100644 index 1cbdeac8..00000000 --- a/plugins/attaches/cross.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/plugins/attaches/file-icon-black.svg b/plugins/attaches/file-icon-black.svg deleted file mode 100644 index 0a559b7e..00000000 --- a/plugins/attaches/file-icon-black.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/plugins/attaches/file-icon-white.svg b/plugins/attaches/file-icon-white.svg deleted file mode 100644 index 87a6039e..00000000 --- a/plugins/attaches/file-icon-white.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/plugins/code/code.js b/plugins/code/code.js deleted file mode 100644 index aaeb72b3..00000000 --- a/plugins/code/code.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Code Plugin\ - * Creates code tag and adds content to this tag - */ - -var code = (function(code_plugin) { - - var baseClass = "ce-code"; - - /** - * Make initial header block - * @param {object} JSON with block data - * @return {Element} element to append - */ - var make_ = function (data) { - - var tag = codex.editor.draw.node('TEXTAREA', [baseClass], {}); - - if (data && data.text) { - tag.value = data.text; - } - - return tag; - }; - - /** - * Escapes HTML chars - * - * @param {string} input - * @return {string} — escaped string - */ - var escapeHTML_ = function (input) { - - var div = document.createElement('DIV'), - text = document.createTextNode(input); - - div.appendChild(text); - - return div.innerHTML; - - }; - - /** - * Method to render HTML block from JSON - */ - code_plugin.render = function (data) { - - return make_(data); - }; - - /** - * Method to extract JSON data from HTML block - */ - code_plugin.save = function (blockContent) { - - var escaped = escapeHTML_(blockContent.value), - data = { - text : escaped - }; - - - return data; - - }; - - code_plugin.validate = function (data) { - - if (data.text.trim() == '') - return; - - return true; - }; - - code_plugin.destroy = function () { - - code = null; - - }; - - return code_plugin; - -})({}); diff --git a/plugins/embed/embed.js b/plugins/embed/embed.js deleted file mode 100644 index 744ec85c..00000000 --- a/plugins/embed/embed.js +++ /dev/null @@ -1,211 +0,0 @@ -/** - * Embed plugin by gohabereg - * @version 1.0.0 - */ -var embed = function(embed_plugin){ - - var methods = { - - addInternal: function (content) { - codex.editor.content.switchBlock(codex.editor.content.currentNode, content); - - var blockContent = codex.editor.content.currentNode.childNodes[0]; - blockContent.classList.add('embed__loader'); - - setTimeout(function(){ - blockContent.classList.remove('embed__loader'); - }, 1000); - - }, - - getHtmlWithEmbedId: function (type, id) { - return services[type].html.replace(/<\%\= remote\_id \%\>/g, id); - }, - - makeElementFromHtml: function(html) { - var wrapper = document.createElement('DIV'); - - wrapper.innerHTML = html; - - return wrapper; - }, - - getRemoteId: function(source, execArray) { - - switch(source) { - case 'yandex-music-track': - id = execArray[2]+'/'+execArray[1]; - break; - case 'yandex-music-playlist': - id = execArray[1]+'/'+execArray[2]; - break; - default: - id = execArray[1]; - } - - return id; - } - }; - - var services = { - youtube: { - regex: /^.*(?:(?:youtu\.be\/)|(?:youtube\.com)\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*)(?:[\?\&]t\=(\d*)|)/, - html: "", - height: 320, - width: 580 - } - }; - - - embed_plugin.make = function(data, isInternal) { - - if (!data.remote_id) - return; - - var html = methods.getHtmlWithEmbedId(data.source, data.remote_id), - block = methods.makeElementFromHtml(html); - - block.dataset.remoteId = data.remote_id; - block.dataset.source = data.source; - block.dataset.thumbnailUrl = data.thumbnailUrl; - - block.classList.add('embed'); - - // var sidePadding = (600 - services[data.source].width) / 2 + 'px'; - - // block.style.padding = '30px ' + sidePadding; - - if (isInternal) { - methods.addInternal(block); - } - - return block; - - }; - - /** - * Saving JSON output. - * Upload data via ajax - */ - embed_plugin.save = function(blockContent) { - - if (!blockContent) - return; - - var data, - source = blockContent.dataset.source; - - data = { - source: source, - remote_id: blockContent.dataset.remoteId, - thumbnailUrl: blockContent.dataset.thumbnailUrl, - height: services[source].height, - width: services[source].width - }; - - return data; - - }; - - /** - * Render data - */ - embed_plugin.render = function(data) { - return embed_plugin.make(data); - }; - - embed_plugin.urlPastedCallback = function(url, pattern) { - - var execArray = pattern.regex.exec(url), - id = methods.getRemoteId(pattern.type, execArray); - - var data = { - source: pattern.type, - remote_id: id, - thumbnailUrl: url - }; - - embed_plugin.make(data, true); - }; - - embed_plugin.validate = function(savedData) { - - var source = savedData.source, - execArray = services[source].regex.exec(savedData.thumbnailUrl), - remoteId = methods.getRemoteId(source, execArray); - - return remoteId == savedData.remote_id; - - }; - - embed_plugin.pastePatterns = [ - { - type: 'vk', - regex: /https?:\/\/vk\.com\/.*(?:video)([-0-9]+_[0-9]+)/, ///https?.+vk?.com\/feed\?w=wall\d+_\d+/, - callback: embed_plugin.urlPastedCallback - }, - { - type: 'youtube', - regex: /(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/, - callback: embed_plugin.urlPastedCallback - }, - { - type: 'vimeo', - regex: /(?:http[s]?:\/\/)?(?:www.)?vimeo\.co(?:.+\/([^\/]\d+)(?:#t=[\d]+)?s?$)/, - callback: embed_plugin.urlPastedCallback - }, - { - type: 'coub', - regex: /https?:\/\/coub\.com\/view\/([^\/\?\&]+)/, - callback: embed_plugin.urlPastedCallback - }, - { - type: 'vine', - regex: /https?:\/\/vine\.co\/v\/([^\/\?\&]+)/, - callback: embed_plugin.urlPastedCallback - }, - { - type: 'imgur', - regex: /https?:\/\/(?:i\.)?imgur\.com.*\/([a-zA-Z0-9]+)(?:\.gifv)?/, - callback: embed_plugin.urlPastedCallback - }, - { - type: 'gfycat', - regex: /https?:\/\/gfycat\.com(?:\/detail)?\/([a-zA-Z]+)/, - callback: embed_plugin.urlPastedCallback - }, - { - type: 'twitch-channel', - regex: /https?:\/\/www.twitch.tv\/([^\/\?\&]*)/, - callback: embed_plugin.urlPastedCallback - }, - { - type: 'twitch-video', - regex: /https?:\/\/www.twitch.tv\/(?:[^\/\?\&]*\/v|videos)\/([0-9]*)/, - callback: embed_plugin.urlPastedCallback - }, - { - type: 'yandex-music-album', - regex: /https?:\/\/music.yandex.ru\/album\/([0-9]*)/, - callback: embed_plugin.urlPastedCallback - }, - { - type: 'yandex-music-track', - regex: /https?:\/\/music.yandex.ru\/album\/([0-9]*)\/track\/([0-9]*)/, - callback: embed_plugin.urlPastedCallback - }, - { - type: 'yandex-music-playlist', - regex: /https?:\/\/music.yandex.ru\/users\/([^\/\?\&]*)\/playlists\/([0-9]*)/, - callback: embed_plugin.urlPastedCallback - } ]; - - embed_plugin.destroy = function () { - - embed = null; - - }; - - return embed_plugin; - -}({}); \ No newline at end of file diff --git a/plugins/header/header.css b/plugins/header/header.css deleted file mode 100644 index 42a1c0ce..00000000 --- a/plugins/header/header.css +++ /dev/null @@ -1,41 +0,0 @@ -/** -* Plugin styles -*/ -.ce-header { - padding: .7em 0; - margin: 0; - line-height: 1.4em; -} -.ce-header p, -.ce-header div{ - padding: 0 !important; - margin: 0 !important; -} - -/** H e a d e r - settings */ -.ce_plugin_header--select_button{ - display: block; - color: #306ac7; - cursor: pointer; - line-height: 1.3em; -} - .ce_plugin_header--select_button:not(:last-of-type){ - margin-bottom: 1.5em; - } - .ce_plugin_header--select_button:hover{ - color: #a1b4ec; - } - - -/** -* Empty header placeholder -*/ -.ce-header:empty::before{ - content : attr(data-placeholder); - color: #818BA1; - opacity: .7; - transition: opacity 200ms ease; -} -.ce-header:focus::before{ - opacity: .1; -} diff --git a/plugins/header/header.js b/plugins/header/header.js deleted file mode 100644 index 6e73ee88..00000000 --- a/plugins/header/header.js +++ /dev/null @@ -1,169 +0,0 @@ -/** -* Example of making plugin -* H e a d e r -*/ - -var header = (function(header_plugin) { - - /** - * @private - */ - var methods_ = { - - /** - * Binds click event to passed button - */ - addSelectTypeClickListener : function (el, type) { - - el.addEventListener('click', function () { - - methods_.selectTypeClicked(type); - - }, false); - }, - - /** - * Replaces old header with new type - * @params {string} type - new header tagName: H1—H6 - */ - selectTypeClicked : function (type) { - - var old_header, new_header; - - /** Now current header stored as a currentNode */ - old_header = codex.editor.content.currentNode.querySelector('[contentEditable]'); - - /** Making new header */ - new_header = codex.editor.draw.node(type, ['ce-header'], { innerHTML : old_header.innerHTML }); - new_header.contentEditable = true; - new_header.setAttribute('data-placeholder', 'Заголовок'); - new_header.dataset.headerData = type; - - codex.editor.content.switchBlock(old_header, new_header, 'header'); - - /** Close settings after replacing */ - codex.editor.toolbar.settings.close(); - } - - }; - - /** - * @private - * - * Make initial header block - * @param {object} JSON with block data - * @return {Element} element to append - */ - var make_ = function (data) { - - var availableTypes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'], - tag, - headerType = 'h2'; - - - if ( data && data['heading-styles'] && availableTypes.includes(data['heading-styles']) ) { - - headerType = data['heading-styles']; - - } - - tag = document.createElement(headerType); - - /** - * Save header type in data-attr. - * We need it in save method to extract type from HTML to JSON - */ - tag.dataset.headerData = headerType; - - - if (data && data.text) { - tag.textContent = data.text; - } - - if (!tag.dataset.headerData) { - tag.dataset.headerData = 'h2'; - } - - tag.classList.add('ce-header'); - tag.setAttribute('data-placeholder', 'Заголовок'); - tag.contentEditable = true; - - return tag; - - }; - - header_plugin.prepareDataForSave = function(data) { - - }; - - /** - * Method to render HTML block from JSON - */ - header_plugin.render = function (data) { - - return make_(data); - - }; - - /** - * Method to extract JSON data from HTML block - */ - header_plugin.save = function (blockContent) { - - var data = { - "heading-styles": blockContent.dataset.headerData, - "format": "html", - "text": blockContent.textContent || '' - }; - - return data; - }; - - /** - * Settings panel content - * - - - - - - - - - - - - - - * | настройки H1 H2 H3 | - * - - - - - - - - - - - - - - * @return {Element} element contains all settings - */ - header_plugin.makeSettings = function () { - - var holder = codex.editor.draw.node('DIV', ['cdx-plugin-settings--horisontal'], {} ), - types = { - h2: 'H2', - h3: 'H3', - h4: 'H4' - }, - selectTypeButton; - - /** Now add type selectors */ - for (var type in types){ - - selectTypeButton = codex.editor.draw.node('SPAN', ['cdx-plugin-settings__item'], { textContent : types[type] }); - methods_.addSelectTypeClickListener(selectTypeButton, type); - holder.appendChild(selectTypeButton); - - } - - return holder; - }; - - header_plugin.validate = function(data) { - - if (data.text.trim() === '' || data['heading-styles'].trim() === ''){ - return false; - } - - return true; - }; - - header_plugin.destroy = function () { - - header = null; - - } - - return header_plugin; - -})({}); - diff --git a/plugins/image/image.js b/plugins/image/image.js deleted file mode 100644 index b0b83746..00000000 --- a/plugins/image/image.js +++ /dev/null @@ -1,701 +0,0 @@ -/** - * Image plugin for codex-editor - * @author CodeX Team - * - * @version 1.3.0 - */ -var image = (function(image_plugin) { - - /** - * @private - * - * CSS classNames - */ - var elementClasses_ = { - - ce_image : 'ce-image', - loading : 'ce-plugin-image__loader', - blockStretched: 'ce-block--stretched', - uploadedImage : { - centered : 'ce-plugin-image__uploaded--centered', - stretched : 'ce-plugin-image__uploaded--stretched' - }, - imageCaption : 'ce-plugin-image__caption', - imageWrapper : 'ce-plugin-image__wrapper', - formHolder : 'ce-plugin-image__holder', - uploadButton : 'ce-plugin-image__button', - imagePreview : 'ce-image__preview', - selectorHolder: 'ce-settings-checkbox', - selectorButton: 'ce-settings-checkbox__toggler', - settingsItem: 'ce-image-settings__item', - imageWrapperBordered : 'ce-image__wrapper--bordered', - toggled : 'ce-image-settings__item--toggled' - - }; - - /** - * - * @private - * - * UI methods - */ - var ui_ = { - - holder : function(){ - - var element = document.createElement('DIV'); - - element.classList.add(elementClasses_.formHolder); - element.classList.add(elementClasses_.ce_image); - - return element; - }, - - uploadButton : function(){ - - var button = document.createElement('SPAN'); - - button.classList.add(elementClasses_.uploadButton); - - button.innerHTML = ' '; - button.innerHTML += 'Загрузить фотографию'; - - return button; - - }, - - /** - * @param {object} file - file path - * @param {string} style - css class - * @return {object} image - document IMG tag - */ - image : function(file, styles) { - - var image = document.createElement('IMG'); - - styles.map(function(item) { - image.classList.add(item); - }); - - image.src = file.url; - image.dataset.bigUrl = file.bigUrl; - - return image; - }, - - wrapper : function() { - - var div = document.createElement('div'); - - div.classList.add(elementClasses_.imageWrapper); - - return div; - }, - - caption : function() { - - var div = document.createElement('div'); - - div.classList.add(elementClasses_.imageCaption); - div.contentEditable = true; - - return div; - }, - /** - * Draws form for image upload - */ - makeForm : function() { - - var holder = ui_.holder(), - uploadButton = ui_.uploadButton(); - - holder.appendChild(uploadButton); - - uploadButton.addEventListener('click', uploadButtonClicked_, false ); - - image.holder = holder; - - return holder; - }, - - - /** - * wraps image and caption - * @param {object} data - image information - * @param {string} imageTypeClass - plugin's style - * @param {boolean} stretched - stretched or not - * @return wrapped block with image and caption - */ - makeImage : function(data, imageTypeClasses, stretched, bordered) { - - var file = data, - text = data.caption, - type = data.type, - image = ui_.image(file, imageTypeClasses), - caption = ui_.caption(), - wrapper = ui_.wrapper(); - - caption.innerHTML = text || ''; - - wrapper.dataset.stretched = stretched; - wrapper.dataset.bordered = bordered; - - /** Appeding to the wrapper */ - wrapper.appendChild(image); - wrapper.appendChild(caption); - - return wrapper; - }, - - /** - * @param {HTML} data - Rendered block with image - */ - getImage : function(data) { - - var image = data.querySelector('.' + elementClasses_.uploadedImage.centered) || - data.querySelector('.' + elementClasses_.uploadedImage.stretched); - - return image; - }, - - /** - * wraps image and caption - * @deprecated - * @param {object} data - image information - * @return wrapped block with image and caption - */ - centeredImage : function(data) { - - var file = data.file, - text = data.caption, - type = data.type, - image = ui_.image(file, elementClasses_.uploadedImage.centered), - caption = ui_.caption(), - wrapper = ui_.wrapper(); - - caption.textContent = text; - - wrapper.dataset.stretched = 'false'; - - /** Appeding to the wrapper */ - wrapper.appendChild(image); - wrapper.appendChild(caption); - - return wrapper; - }, - - /** - * wraps image and caption - * @deprecated - * @param {object} data - image information - * @return stretched image - */ - stretchedImage : function(data) { - - var file = data.file, - text = data.caption, - type = data.type, - image = ui_.image(file, elementClasses_.uploadedImage.stretched), - caption = ui_.caption(), - wrapper = ui_.wrapper(); - - caption.textContent = text; - - wrapper.dataset.stretched = 'true'; - - /** Appeding to the wrapper */ - wrapper.appendChild(image); - wrapper.appendChild(caption); - - return wrapper; - - } - - }; - - /** - * @private - * - * After render callback - */ - var uploadButtonClicked_ = function(event) { - - var url = image_plugin.config.uploadImage, - beforeSend = uploadingCallbacks_.ByClick.beforeSend, - success = uploadingCallbacks_.ByClick.success, - error = uploadingCallbacks_.ByClick.error; - - /** Define callbacks */ - codex.editor.transport.selectAndUpload({ - url : url, - multiple : false, - accept : 'image/*', - beforeSend : beforeSend, - success : success, - error : error - }); - }; - - var methods_ = { - - addSelectTypeClickListener : function(el, type) { - - el.addEventListener('click', function() { - - // el - settings element - - switch (type) { - case 'bordered': - methods_.toggleBordered(type, this); break; - case 'stretched': - methods_.toggleStretched(type, this); break; - } - - - }, false); - - }, - - toggleBordered : function(type, clickedSettingsItem ) { - - var current = codex.editor.content.currentNode, - blockContent = current.childNodes[0], - img = ui_.getImage(current), - wrapper = current.querySelector('.' + elementClasses_.imageWrapper); - - if (!img) { - return; - } - - /** - * Add classes to the IMG tag and to the Settings element - */ - img.classList.toggle(elementClasses_.imageWrapperBordered); - clickedSettingsItem.classList.toggle(elementClasses_.toggled); - - /** - * Save settings in dataset - */ - wrapper.dataset.bordered = img.classList.contains(elementClasses_.imageWrapperBordered); - - setTimeout(function() { - codex.editor.toolbar.settings.close(); - }, 200); - - }, - - toggleStretched : function( type, clickedSettingsItem ) { - - var current = codex.editor.content.currentNode, - blockContent = current.childNodes[0], - img = ui_.getImage(current), - wrapper = current.querySelector('.' + elementClasses_.imageWrapper); - - if (!img) { - return; - } - - /** Clear classList */ - blockContent.classList.add(elementClasses_.blockStretched); - img.classList.toggle(elementClasses_.uploadedImage.stretched); - img.classList.toggle(elementClasses_.uploadedImage.centered); - - clickedSettingsItem.classList.toggle(elementClasses_.toggled); - - wrapper.dataset.stretched = img.classList.contains(elementClasses_.uploadedImage.stretched); - - setTimeout(function() { - codex.editor.toolbar.settings.close(); - }, 1000); - - } - }; - - /** - * @private - * Callbacks - */ - var uploadingCallbacks_ = { - - ByClick : { - - /** - * Before sending ajax request - */ - beforeSend : function() { - - var input = codex.editor.transport.input, - files = input.files; - - var validFileExtensions = ["jpg", "jpeg", "bmp", "gif", "png"]; - - var type = files[0].type.split('/'); - - var result = validFileExtensions.some(function(ext) { - return ext == type[1]; - }); - - if (!result) { - return; - } - - var reader = new FileReader(); - reader.readAsDataURL(files[0]); - - reader.onload = function(e) { - - var data = { - background : false, - border : false, - isstretch : false, - url : e.target.result, - bigUrl : null, - width : null, - height : null, - additionalData : null, - caption : '', - cover : null - }; - - var newImage = make_(data); - - codex.editor.content.switchBlock(image.holder, newImage, 'image'); - newImage.classList.add(elementClasses_.imagePreview); - - /** - * Change holder to image - */ - image.holder = newImage; - }; - - }, - - /** Photo was uploaded successfully */ - success : function(result) { - - var parsed = JSON.parse(result), - data, - currentBlock = codex.editor.content.currentNode; - - /** - * Preparing {Object} data to draw an image - * @uses ceImage.make method - */ - data = parsed.data; - - image.holder.classList.remove(elementClasses_.imagePreview); - - /** - * Change src of image - */ - var newImage = image.holder.getElementsByTagName('IMG')[0]; - - newImage.src = parsed.data.url; - newImage.dataset.bigUrl = parsed.data.bigUrl; - newImage.dataset.width = parsed.data.width; - newImage.dataset.height = parsed.data.height; - newImage.dataset.additionalData = parsed.data.additionalData; - - }, - - /** Error callback. Sends notification to user that something happend or plugin doesn't supports method */ - error : function(result) { - - var oldHolder = image.holder; - var form = ui_.makeForm(); - - codex.editor.content.switchBlock(oldHolder, form, 'image'); - - } - }, - - ByPaste : { - - /** - * Direct upload - * Any URL that contains image extension - * @param url - */ - uploadImageFromUrl : function(path) { - - var image, - current = codex.editor.content.currentNode, - beforeSend, - success_callback; - - /** When image is uploaded to redactors folder */ - success_callback = function(data) { - - var imageInfo = JSON.parse(data); - - var newImage = image.getElementsByTagName('IMG')[0]; - - newImage.dataset.stretched = false; - newImage.dataset.src = imageInfo.url; - newImage.dataset.bigUrl = imageInfo.bigUrl; - newImage.dataset.width = imageInfo.width; - newImage.dataset.height = imageInfo.height; - newImage.dataset.additionalData = imageInfo.additionalData; - - image.classList.remove(elementClasses_.imagePreview); - - }; - - /** Before sending XMLHTTP request */ - beforeSend = function() { - - var content = current.querySelector('.ce-block__content'); - - var data = { - background: false, - border: false, - isStretch: false, - file: { - url: path, - bigUrl: null, - width: null, - height: null, - additionalData: null - }, - caption: '', - cover: null - }; - - image = codex.editor.tools.image_extended.render(data); - - image.classList.add(elementClasses_.imagePreview); - - var img = image.querySelector('img'); - - codex.editor.content.switchBlock(codex.editor.content.currentNode, image, 'image'); - - }; - - /** Preparing data for XMLHTTP */ - var data = { - url: image_plugin.config.uploadFromUrl, - type: "POST", - data : { - url: path - }, - beforeSend : beforeSend, - success : success_callback - }; - - codex.editor.core.ajax(data); - } - - } - }; - - /** - * Image path - * @type {null} - */ - image_plugin.path = null; - - /** - * Plugin configuration - */ - image_plugin.config = null; - - /** - * - * @private - * - * @param data - * @return {*} - * - */ - var make_ = function ( data ) { - - var holder, - classes = []; - - if (data) { - - if (data.border) { - classes.push(elementClasses_.imageWrapperBordered); - } - - if ( data.isstretch || data.isstretch === 'true') { - - classes.push(elementClasses_.uploadedImage.stretched); - holder = ui_.makeImage(data, classes, 'true', data.border); - - } else { - - classes.push(elementClasses_.uploadedImage.centered); - holder = ui_.makeImage(data, classes, 'false', data.border); - - } - - return holder; - - } else { - - holder = ui_.makeForm(); - - return holder; - } - }; - - /** - * @private - * - * Prepare clear data before save - * - * @param data - */ - var prepareDataForSave_ = function(data) { - - }; - - /** - * @public - * @param config - */ - image_plugin.prepare = function(config) { - - image_plugin.config = config; - - return Promise.resolve(); - }; - - /** - * @public - * - * this tool works when tool is clicked in toolbox - */ - image_plugin.appendCallback = function(event) { - - /** Upload image and call success callback*/ - uploadButtonClicked_(event); - - }; - - /** - * @public - * - * @param data - * @return {*} - */ - image_plugin.render = function( data ) { - - return make_(data); - }; - - /** - * @public - * - * @param block - * @return {{background: boolean, border: boolean, isstretch: boolean, file: {url: (*|string|Object), bigUrl: (null|*), width: *, height: *, additionalData: null}, caption: (string|*|string), cover: null}} - */ - image_plugin.save = function ( block ) { - - var content = block, - image = ui_.getImage(content), - caption = content.querySelector('.' + elementClasses_.imageCaption); - - var data = { - background : false, - border : content.dataset.bordered === 'true' ? true : false, - isstretch : content.dataset.stretched === 'true' ? true : false, - // file : { - url : image.dataset.src || image.src, - bigUrl : image.dataset.bigUrl, - width : image.width, - height : image.height, - additionalData :null, - // }, - caption : caption.innerHTML || '', - cover : null - }; - - return data; - }; - - /** - * @public - * - * Settings panel content - * @return {Element} element contains all settings - */ - image_plugin.makeSettings = function () { - - var currentNode = codex.editor.content.currentNode, - wrapper = currentNode.querySelector('.' + elementClasses_.imageWrapper), - holder = document.createElement('DIV'), - types = { - stretched : "На всю ширину", - bordered : "Добавить рамку" - }, - currentImageWrapper = currentNode.querySelector('.' + elementClasses_.imageWrapper ), - currentImageSettings = currentImageWrapper.dataset; - - /** Add holder classname */ - holder.className = 'ce-image-settings'; - - /** Now add type selectors */ - for (var type in types){ - - /** - * Settings template - */ - var settingsItem = document.createElement('DIV'), - selectorsHolder = document.createElement('SPAN'), - selectorsButton = document.createElement('SPAN'); - - settingsItem.classList.add(elementClasses_.settingsItem); - selectorsHolder.classList.add(elementClasses_.selectorHolder); - selectorsButton.classList.add(elementClasses_.selectorButton); - - selectorsHolder.appendChild(selectorsButton); - settingsItem.appendChild(selectorsHolder); - - selectTypeButton = document.createTextNode(types[type]); - settingsItem.appendChild(selectTypeButton); - - /** - * Activate previously selected settings - */ - if ( currentImageSettings[type] == 'true' ){ - settingsItem.classList.add(elementClasses_.toggled); - } - - methods_.addSelectTypeClickListener(settingsItem, type); - - holder.appendChild(settingsItem); - - } - - return holder; - - }; - - /** - * Share as API - */ - image_plugin.uploadImageFromUri = uploadingCallbacks_.ByPaste.uploadImageFromUrl; - - image_plugin.pastePatterns = [ - { - type: 'image', - regex: /(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*\.(?:jpe?g|gif|png))(?:\?([^#]*))?(?:#(.*))?/i, - callback: image_plugin.uploadImageFromUri - }, - { - type: 'uploadCare', - regex: /^https:\/\/(uploadcare\.cmtt\.ru|ucarecdn\.com|static[0-9]+\.siliconrus\.cmtt\.ru|static[0-9]+\.cmtt\.ru)/i, - callback: image_plugin.uploadImageFromUri - } ]; - - image_plugin.destroy = function () { - - image = null; - - }; - - return image_plugin; - -})({}); \ No newline at end of file diff --git a/plugins/instagram/instagram.js b/plugins/instagram/instagram.js deleted file mode 100644 index 9072ef2d..00000000 --- a/plugins/instagram/instagram.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * Instagram plugin - * @version 1.0.0 - */ -var instagram = (function(instagram_plugin) { - - var methods = { - - render : function(content) { - - codex.editor.content.switchBlock(codex.editor.content.currentNode, content); - - setTimeout(function() { - window.instgrm.Embeds.process(); - }, 200); - - }, - - /** - * Drawing html content. - * - * @param url - * @returns {Element} blockquote - HTML template for Instagram Embed JS - */ - instagramBlock : function(url) { - - var blockquote = codex.editor.draw.node('BLOCKQUOTE', 'instagram-media instagram', {}), - div = codex.editor.draw.node('DIV', '', {}), - paragraph = codex.editor.draw.node('P', 'ce-paste__instagram--p', {}), - anchor = codex.editor.draw.node('A', '', { href : url }); - - blockquote.dataset.instgrmVersion = 4; - - paragraph.appendChild(anchor); - div.appendChild(paragraph); - blockquote.appendChild(div); - - return blockquote; - - } - }; - - /** - * Prepare before usage - * Load important scripts to render embed - */ - instagram_plugin.prepare = function() { - - return new Promise(function(resolve, reject){ - - codex.editor.core.importScript("https://platform.instagram.com/en_US/embeds.js", 'instagram-api').then(function(){ - resolve(); - }).catch(function(){ - reject(Error('Instagram API was not loaded')); - }); - - }); - }; - - /** - * @private - * - * Make instagram embed via Widgets method - */ - var make_ = function(data, isInternal) { - - if (!data.instagram_url) - return; - - var block = methods.instagramBlock(data.instagram_url); - - if (isInternal) { - - setTimeout(function() { - - /** Render block */ - methods.render(block); - - }, 200); - } - - if (!isInternal) { - methods.render(block); - } - - return block; - }; - - instagram_plugin.validate = function(data) { - return true; - }; - - /** - * Saving JSON output. - * Upload data via ajax - */ - instagram_plugin.save = function(blockContent) { - - var data; - - if (!blockContent) - return; - - /** Example */ - data = { - instagram_url: blockContent.src - }; - - return data; - - }; - - instagram_plugin.validate = function(data) { - - var checkUrl = new RegExp("http?.+instagram.com\/p?."); - - if (!data.instagram_url || checkUrl.exec(data.instagram_url).length == 0) - return; - - return true; - }; - - /** - * Render data - */ - instagram_plugin.render = function(data) { - return make_(data); - }; - - /** - * callback for instagram url's coming from pasteTool - * Using instagram Embed Widgete to render - * @param url - */ - instagram_plugin.urlPastedCallback = function(url) { - var data = { - instagram_url: url - }; - - make_(data, true); - - }; - - instagram_plugin.pastePatterns = [ - { - type: 'instagram', - regex: /http?.+instagram.com\/p\/([a-zA-Z0-9]*)\S*/, - callback: instagram_plugin.urlPastedCallback - } - ]; - - instagram_plugin.destroy = function () { - - instagram = null; - delete window.instgrm - - }; - - return instagram_plugin; - -})({}); - diff --git a/plugins/link/link.js b/plugins/link/link.js deleted file mode 100644 index 2763015f..00000000 --- a/plugins/link/link.js +++ /dev/null @@ -1,350 +0,0 @@ -/** - * Created by nostr on 29.06.16. - */ - -/** - * Link tool plugin - */ - -var link = (function(link_plugin) { - - var settings = { - defaultText : 'Вставьте ссылку ...', - ENTER_KEY : 13, - currentBlock : null, - currentInput : null, - elementClasses : { - link: "tool-link-link", - image: "tool-link-image", - title: "tool-link-title", - description: "tool-link-description", - loader: "tool-link-loader", - error: "tool-link-error" - } - }; - - var ui = { - - make : function (json) { - - var wrapper = ui.wrapper(), - siteImage = ui.image(json.image, settings.elementClasses.image), - siteTitle = ui.title(json.title), - siteDescription = ui.description(json.description), - siteLink = ui.link(json.url, json.url); - - wrapper.appendChild(siteImage); - wrapper.appendChild(siteTitle); - wrapper.appendChild(siteLink); - wrapper.appendChild(siteDescription); - - siteTitle.contentEditable = true; - siteDescription.contentEditable = true; - - return wrapper; - - }, - - mainBlock : function () { - - var wrapper = document.createElement('div'); - - wrapper.classList.add("ceditor-tool-link"); - - return wrapper; - - }, - - input : function () { - - var inputTag = document.createElement('input'); - - inputTag.classList.add("ceditor-tool-link-input"); - - inputTag.placeholder = settings.defaultText; - - inputTag.contentEditable = false; - - return inputTag; - - }, - - wrapper : function () { - - var wrapper = document.createElement('div'); - - wrapper.classList.add('tool-link-panel', 'clearfix'); - - return wrapper; - - }, - - image : function (imageSrc, imageClass) { - - var imageTag = document.createElement('img'); - - imageTag.classList.add(imageClass); - - imageTag.setAttribute('src', imageSrc); - - return imageTag; - - }, - - link : function (linkUrl, linkText) { - - var linkTag = document.createElement('a'); - - linkTag.classList.add(settings.elementClasses.link); - - linkTag.href = linkUrl; - - linkTag.target = "_blank"; - - linkTag.innerText = linkText; - - return linkTag; - - }, - - title : function (titleText) { - - var titleTag = document.createElement('div'); - - titleTag.classList.add("tool-link-content", settings.elementClasses.title); - - titleTag.innerHTML = titleText; - - return titleTag; - }, - - description : function (descriptionText) { - - var descriptionTag = document.createElement('div'); - - descriptionTag.classList.add("tool-link-content", settings.elementClasses.description); - - descriptionTag.innerHTML = descriptionText; - - return descriptionTag; - } - - }; - - var methods = { - - blockPasteCallback : function (event) { - - var clipboardData = event.clipboardData || window.clipboardData, - pastedData = clipboardData.getData('Text'), - block = event.target.parentNode; - - methods.renderLink(pastedData, block); - - event.stopPropagation(); - - }, - - blockKeyDownCallback : function (event) { - - var inputTag = event.target, - block = inputTag.parentNode, - url; - - if ( block.classList.contains(settings.elementClasses.error) ) { - block.classList.remove(settings.elementClasses.error); - } - - if (event.keyCode == settings.ENTER_KEY) { - - url = inputTag.value; - - methods.renderLink(url, block); - - event.preventDefault(); - } - }, - - renderLink : function (url, block) { - - Promise.resolve() - - .then(function () { - return methods.urlify(url); - }) - - .then(function (url) { - - /* Show loader gif **/ - block.classList.add(settings.elementClasses.loader); - - return fetch( link_plugin.config.fetchUrl + '?url=' + encodeURI(url) ); - }) - - .then(function (response) { - - if (response.status == "200"){ - - return response.json(); - - } else { - - return Error("Invalid response status: %o", response); - - } - - }) - - .then(function (json) { - methods.composeLinkPreview(json, block); - }) - - .catch(function(error) { - - /* Hide loader gif **/ - block.classList.remove(settings.elementClasses.loader); - - block.classList.add(settings.elementClasses.error); - - codex.editor.core.log('Error while doing things with link paste: %o', 'error', error); - }); - - }, - - urlify : function (text) { - - var urlRegex = /(https?:\/\/\S+)/g; - - var links = text.match(urlRegex); - - if (links) { - return links[0]; - } - - return Promise.reject(Error("Url is not matched")); - - }, - - composeLinkPreview : function (json, currentBlock) { - - if (json == {}) { - return; - } - - var previewBlock = ui.make(json); - - settings.currentInput.remove(); - - currentBlock.appendChild(previewBlock); - - currentBlock.classList.remove(settings.elementClasses.loader); - - } - }; - - link_plugin.prepare = function (config) { - - link_plugin.config = config; - - return Promise.resolve(); - - }; - - /** - * Make initial header block - * @param {object} JSON with block data - * @return {Element} element to append - */ - link_plugin.makeNewBlock = function (data) { - - var wrapper = ui.mainBlock(), - tag = ui.input(); - - settings.currentInput = tag; - - wrapper.appendChild(tag); - - wrapper.classList.add('ce-link'); - /** - * Bind callbacks - **/ - tag.addEventListener('paste', methods.blockPasteCallback, false); - tag.addEventListener('keydown', methods.blockKeyDownCallback, false); - - return wrapper; - - }; - - /** - * Method to render HTML block from JSON - */ - link_plugin.render = function (json) { - - if ( json ) { - - var block = ui.mainBlock(), - tag = ui.make(json); - - block.classList.add('ce-link'); - block.appendChild(tag); - - return block; - - } else { - - var wrapper = ui.mainBlock(), - tag = ui.input(); - - settings.currentInput = tag; - - wrapper.appendChild(tag); - - wrapper.classList.add('ce-link'); - /** - * Bind callbacks - **/ - tag.addEventListener('paste', methods.blockPasteCallback, false); - tag.addEventListener('keydown', methods.blockKeyDownCallback, false); - - return wrapper; - } - - - }; - - link_plugin.validate = function (data) { - - if (data.url.trim() == '' || data.title.trim() == '' || data.description.trim() == '') - return; - - return true; - }; - - /** - * Method to extract JSON data from HTML block - */ - link_plugin.save = function (blockContent){ - - var linkElement = settings.elementClasses.link; - - var data = { - url : blockContent.querySelector("." + linkElement).href, - shortLink : blockContent.querySelector("." + linkElement).textContent || '', - image : blockContent.querySelector("." + settings.elementClasses.image).src || '', - title : blockContent.querySelector("." + settings.elementClasses.title).textContent || '', - description : blockContent.querySelector("." + settings.elementClasses.description).textContent || '' - }; - - return data; - - }; - - link_plugin.destroy = function () { - - link = null; - - }; - - return link_plugin; - -})({}); diff --git a/plugins/list/list.js b/plugins/list/list.js deleted file mode 100644 index 5cdef435..00000000 --- a/plugins/list/list.js +++ /dev/null @@ -1,241 +0,0 @@ -/** - * Code Plugin\ - * Creates code tag and adds content to this tag - */ -var list = (function(list_plugin) { - - /** - * CSS class names - */ - var elementClasses_ = { - pluginWrapper: 'cdx-plugin-list', - li: 'cdx-plugin-list__li', - settings: 'cdx-plugin-list__settings', - settingsItem: 'cdx-plugin-settings__item' - }; - - var LIST_ITEM_TAG = 'LI'; - - var ui = { - - make: function (blockType) { - - var wrapper = this.block(blockType || 'UL', elementClasses_.pluginWrapper); - - wrapper.dataset.type = blockType; - wrapper.contentEditable = true; - - wrapper.addEventListener('keydown', methods_.keyDown); - - return wrapper; - - }, - - block: function (blockType, blockClass) { - - var block = document.createElement(blockType); - - if (blockClass) block.classList.add(blockClass); - - return block; - - }, - - button: function (buttonType) { - - var types = { - unordered: 'Обычный', - ordered: 'Нумерованный' - }, - button = document.createElement('DIV'); - - button.innerHTML = types[buttonType]; - - button.classList.add(elementClasses_.settingsItem); - - return button; - } - }; - - var methods_ = { - - /** - * Changes block type => OL or UL - * @param event - * @param blockType - */ - changeBlockStyle : function (event, blockType) { - - var currentBlock = codex.editor.content.currentNode, - newEditable = ui.make(blockType), - oldEditable = currentBlock.querySelector("[contenteditable]"); - - newEditable.dataset.type = blockType; - newEditable.innerHTML = oldEditable.innerHTML; - newEditable.classList.add(elementClasses_.pluginWrapper); - - codex.editor.content.switchBlock(currentBlock, newEditable, 'list'); - }, - keyDown: function (e) { - - var controlKeyPressed = e.ctrlKey || e.metaKey, - keyCodeForA = 65; - - /** - * If CTRL+A (CMD+A) was pressed, we should select only one list item, - * not all
        or - */ - if (controlKeyPressed && e.keyCode == keyCodeForA) { - - e.preventDefault(); - - /** - * Select
      1. content - */ - methods_.selectListItem(); - - } - - }, - - /** - * Select all content of
      2. with caret - */ - selectListItem : function () { - - var selection = window.getSelection(), - currentSelectedNode = selection.anchorNode.parentNode, - range = new Range(); - - /** - * Search for
      3. element - */ - while ( currentSelectedNode && currentSelectedNode.tagName != LIST_ITEM_TAG ) { - - currentSelectedNode = currentSelectedNode.parentNode; - - } - - range.selectNodeContents(currentSelectedNode); - - selection.removeAllRanges(); - selection.addRange(range); - - } - }; - - /** - * Method to render HTML block from JSON - */ - list_plugin.render = function (data) { - - var type = data && (data.type == 'ordered' || data.type == 'OL') ? 'OL' : 'UL', - tag = ui.make(type), - newLi; - - if (data && data.items) { - - data.items.forEach(function (element, index, array) { - - newLi = ui.block('li', elementClasses_.li); - - newLi.innerHTML = element || ''; - - tag.appendChild(newLi); - - }); - - } else { - - newLi = ui.block('li', elementClasses_.li); - - tag.appendChild(newLi); - - } - - return tag; - - }; - - list_plugin.validate = function(data) { - - var isEmpty = data.items.every(function(item){ - return item.trim() === ''; - }); - - if (isEmpty){ - return; - } - - if (data.type != 'UL' && data.type != 'OL'){ - console.warn('CodeX Editor List-tool: wrong list type passed %o', data.type); - return; - } - - return true; - }; - - /** - * Method to extract JSON data from HTML block - */ - list_plugin.save = function (blockContent){ - - var data = { - type : null, - items : [] - }, - litsItemContent = '', - isEmptyItem = false; - - for (var index = 0; index < blockContent.childNodes.length; index++){ - - litsItemContent = blockContent.childNodes[index].innerHTML; - isEmptyItem = !blockContent.childNodes[index].textContent.trim(); - - if (!isEmptyItem) { - data.items.push(litsItemContent); - } - } - - data.type = blockContent.dataset.type; - - return data; - - }; - - list_plugin.makeSettings = function () { - - var holder = document.createElement('DIV'); - - /** Add holder classname */ - holder.className = elementClasses_.settings; - - var orderedButton = ui.button("ordered"), - unorderedButton = ui.button("unordered"); - - orderedButton.addEventListener('click', function (event) { - methods_.changeBlockStyle(event, 'OL'); - codex.editor.toolbar.settings.close(); - }); - - unorderedButton.addEventListener('click', function (event) { - methods_.changeBlockStyle(event, 'UL'); - codex.editor.toolbar.settings.close(); - }); - - holder.appendChild(orderedButton); - holder.appendChild(unorderedButton); - - return holder; - - }; - - list_plugin.destroy = function () { - - list = null; - - }; - - return list_plugin; - -})({}); diff --git a/plugins/paragraph/paragraph.js b/plugins/paragraph/paragraph.js deleted file mode 100644 index ab660348..00000000 --- a/plugins/paragraph/paragraph.js +++ /dev/null @@ -1,115 +0,0 @@ -/** -* Paragraph Plugin -* Creates DIV tag and adds content to this tag -*/ - -var paragraph = (function(paragraph_plugin) { - - /** - * @private - * - * Make initial paragraph block - * @param {object} JSON with block data - * @return {Element} element to append - */ - - var make_ = function (data) { - - /** Create Empty DIV */ - var tag = codex.editor.draw.node('DIV', ['ce-paragraph'], {}); - - if (data && data.text) { - tag.innerHTML = data.text; - } - - tag.contentEditable = true; - - return tag; - - }; - - /** - * @private - * - * Handles input data for save - * @param data - */ - var prepareDataForSave_ = function(data) { - - }; - - /** - * @public - * - * Plugins should have prepare method - * @param config - */ - paragraph_plugin.prepare = function(config) { - - }; - - /* - * @public - * - * Method to render HTML block from JSON - */ - paragraph_plugin.render = function (data) { - - return make_(data); - - }; - - /** - * @public - * - * Check output data for validity. - * Should be defined by developer - */ - paragraph_plugin.validate = function(output) { - - if (output.text === '') - return; - - return output; - }; - - /** - * @public - * - * Method to extract JSON data from HTML block - */ - paragraph_plugin.save = function (blockContent){ - - var wrappedText = codex.editor.content.wrapTextWithParagraphs(blockContent.innerHTML), - sanitizerConfig = { - tags : { - p : {}, - a: { - href: true, - target: '_blank', - rel: 'nofollow' - }, - i: {}, - b: {}, - } - }; - - var data = { - "text": codex.editor.sanitizer.clean(wrappedText, sanitizerConfig), - "format": "html", - "introText": '<>' - }; - - return data; - - }; - - paragraph_plugin.destroy = function () { - - paragraph = null; - - }; - - return paragraph_plugin; - -})({}); diff --git a/plugins/quote/quote.js b/plugins/quote/quote.js deleted file mode 100644 index 45c7a8b6..00000000 --- a/plugins/quote/quote.js +++ /dev/null @@ -1,585 +0,0 @@ -/** - * - * Quote plugin - */ - -var quote = (function(quote_plugin) { - - /** - * @private - * - * CSS styles - */ - var elementClasses_ = { - - ce_quote : 'ce-quote', - quoteText : 'ce_quote--text', - quoteAuthor : 'ce_quote--author', - authorsJob : 'ce_quote--job', - authorsPhoto : 'authorsPhoto', - authorsPhotoWrapper : 'authorsPhoto-wrapper', - authorsPhotoWrapper_preview : 'authorsPhotoWrapper_preview', - - simple : { - text : 'quoteStyle-simple--text' - }, - - withCaption : { - blockquote : 'quoteStyle-withCaption--blockquote', - author : 'quoteStyle-withCaption--author' - }, - - withPhoto : { - photo : 'quoteStyle-withPhoto--photo', - author : 'quoteStyle-withPhoto--author', - job : 'quoteStyle-withPhoto--job', - quote : 'quoteStyle-withPhoto--quote', - wrapper : 'quoteStyle-withPhoto--wrapper', - authorHolder : 'quoteStyle-withPhoto--authorWrapper' - }, - - settings : { - holder : 'cdx-plugin-settings--horisontal', - caption : 'ce_plugin_quote--caption', - buttons : 'cdx-plugin-settings__item', - selectedType : 'ce-quote-settings--selected' - } - }; - - /** - * @private - * - * - */ - var methods_ = { - - changeStyleClicked : function() { - - var changeStyleButton = this, - quote = codex.editor.content.currentNode.querySelector('.' + elementClasses_.ce_quote), - newStyle = changeStyleButton.dataset.style, - styleSelectors = this.parentNode.childNodes; - - quote.dataset.quoteStyle = newStyle; - - /** - * Mark selected style button - */ - for (var i = styleSelectors.length - 1; i >= 0; i--) { - styleSelectors[i].classList.remove(elementClasses_.settings.selectedType); - } - - this.classList.add(elementClasses_.settings.selectedType); - - }, - - /** - * @deprecated - */ - selectTypeQuoteStyle : function(type) { - - var quoteStyleFunction; - - /** - * Choose Quote style to replace - */ - switch (type) { - case 'simple': - quoteStyleFunction = methods_.makeSimpleQuote; - break; - case 'withCaption': - quoteStyleFunction = methods_.makeQuoteWithCaption; - break; - case 'withPhoto': - quoteStyleFunction = methods_.makeQuoteWithPhoto; - break; - } - - return quoteStyleFunction; - - }, - - /** - * @deprecated - */ - addSelectTypeClickListener : function(el, quoteStyle) { - - el.addEventListener('click', function () { - - /** - * Parsing currentNode to JSON. - */ - var parsedOldQuote = methods_.parseBlockQuote(), - newStyledQuote = quoteStyle(parsedOldQuote); - - var wrapper = codex.editor.content.composeNewBlock(newStyledQuote, 'quote'); - wrapper.appendChild(newStyledQuote); - - codex.editor.content.switchBlock(codex.editor.content.currentNode, newStyledQuote, 'quote'); - - /** Close settings after replacing */ - codex.editor.toolbar.settings.close(); - - }, false); - - }, - - /** - * @deprecated - */ - makeSimpleQuote : function(data) { - - var wrapper = ui_.makeBlock('BLOCKQUOTE', [elementClasses_.simple.text, elementClasses_.quoteText]); - - wrapper.innerHTML = data.text || ''; - - wrapper.dataset.quoteStyle = 'simple'; - wrapper.classList.add(elementClasses_.ce_quote); - wrapper.contentEditable = 'true'; - - return wrapper; - }, - - /** - * @deprecated - */ - makeQuoteWithCaption : function(data) { - - var wrapper = ui_.blockquote(), - text = ui_.makeBlock('DIV', [elementClasses_.withCaption.blockquote, elementClasses_.quoteText]), - author = ui_.makeBlock('DIV', [elementClasses_.withCaption.author, elementClasses_.quoteAuthor]); - - /* make text block ontentEditable */ - text.contentEditable = 'true'; - - text.innerHTML = data.text || ''; - - /* make Author contentEditable */ - author.contentEditable = 'true'; - - author.innerHTML = data.cite || ''; - - /* Appending created components */ - wrapper.dataset.quoteStyle = 'withCaption'; - wrapper.classList.add(elementClasses_.ce_quote); - - wrapper.appendChild(text); - wrapper.appendChild(author); - - return wrapper; - - }, - - makeQuoteWithPhoto : function(data) { - - var wrapper = ui_.blockquote(), - photo = ui_.makeBlock('DIV', [elementClasses_.withPhoto.photo]), - author = ui_.makeBlock('DIV', [elementClasses_.withPhoto.author, elementClasses_.quoteAuthor]), - job = ui_.makeBlock('DIV', [elementClasses_.withPhoto.job, elementClasses_.authorsJob]), - quote = ui_.makeBlock('DIV', [elementClasses_.withPhoto.quote, elementClasses_.quoteText]); - - /* Default Image src */ - if (!data.image) { - - var icon = ui_.makeBlock('SPAN', ['ce-icon-picture']); - photo.appendChild(icon); - - } else { - - var authorsPhoto = ui_.img(elementClasses_.authorsPhoto); - - authorsPhoto.src = data.image; - authorsPhoto.dataset.bigUrl = data.image; - - photo.classList.add(elementClasses_.authorsPhotoWrapper); - photo.appendChild(authorsPhoto); - } - - - photo.addEventListener('click', fileUploadClicked_, false); - - /* make author block contentEditable */ - author.contentEditable = 'true'; - author.innerHTML = data.cite || ''; - - /* Author's position and job */ - job.contentEditable = 'true'; - job.innerHTML = data.caption || ''; - - var authorsWrapper = ui_.makeBlock('DIV', [elementClasses_.withPhoto.authorHolder]); - authorsWrapper.appendChild(author); - authorsWrapper.appendChild(job); - - /* make quote text contentEditable */ - quote.contentEditable = 'true'; - quote.innerHTML = data.text || ''; - - wrapper.classList.add(elementClasses_.ce_quote); - wrapper.classList.add(elementClasses_.withPhoto.wrapper); - wrapper.dataset.quoteStyle = 'withPhoto'; - - wrapper.appendChild(quote); - wrapper.appendChild(photo); - wrapper.appendChild(authorsWrapper); - - return wrapper; - }, - - parseBlockQuote : function(block) { - - var currentNode = block || codex.editor.content.currentNode, - photo = currentNode.getElementsByTagName('img')[0], - author = currentNode.querySelector('.' + elementClasses_.quoteAuthor), - job = currentNode.querySelector('.' + elementClasses_.authorsJob), - quote ; - - /** Simple quote text placed in Blockquote tag*/ - if ( currentNode.dataset.quoteStyle == 'simple' ){ - - quote = currentNode.innerHTML || ''; - - } else { - - quote = currentNode.querySelector('.' + elementClasses_.quoteText).innerHTML; - - } - - if (job){ - - job = job.innerHTML || ''; - - } - - if (author){ - - author = author.innerHTML || ''; - - } - - if (photo){ - - photo = photo.dataset.bigUrl; - - } - - var data = { - style : currentNode.dataset.quoteStyle, - text : quote, - author : author, - job : job, - photo : photo - }; - - return data; - } - }; - - /** - * @private - * - * Author image Uploader - */ - var fileUploadClicked_ = function() { - - var beforeSend = photoUploadingCallbacks_.beforeSend, - success = photoUploadingCallbacks_.success, - error = photoUploadingCallbacks_.error; - - codex.editor.transport.selectAndUpload({ - beforeSend: beforeSend, - success: success, - error: error - }); - - }; - - /** - * @private - * - */ - var ui_ = { - - wrapper : function($classList) { - - var el = document.createElement('DIV'); - - el.classList.add($classList); - - return el; - - }, - - blockquote : function() { - - var el = document.createElement('BLOCKQUOTE'); - - return el; - - }, - - img : function(attribute) { - - var imageTag = document.createElement('IMG'); - imageTag.classList.add(attribute); - - return imageTag; - }, - - makeBlock : function(tag, classList) { - - var el = document.createElement(tag); - - if ( classList ) { - - for( var i = 0; i < classList.length; i++) - el.className += ' ' + classList[i]; - - } - - return el; - - } - - }; - - - - /** - * @private - * - * Callbacks - */ - var photoUploadingCallbacks_ = { - - preview_ : function(e) { - - var uploadImageWrapper = codex.editor.content.currentNode.querySelector('.' + elementClasses_.withPhoto.photo), - authorsPhoto = ui_.img(elementClasses_.authorsPhoto); - - /** Appending uploaded image */ - uploadImageWrapper.classList.add(elementClasses_.authorsPhotoWrapper, elementClasses_.authorsPhotoWrapper_preview); - - authorsPhoto.src = e.target.result; - - /** Remove icon from image wrapper */ - uploadImageWrapper.innerHTML = ''; - - uploadImageWrapper.appendChild(authorsPhoto); - }, - - beforeSend : function() { - - var input = codex.editor.transport.input, - files = input.files, - file = files[0], - fileReader = new FileReader(); - - fileReader.readAsDataURL(file); - - fileReader.onload = photoUploadingCallbacks_.preview_; - - }, - - /** - * Success callbacks for uploaded photo. - * Replace upload icon with uploaded photo - */ - success : function(result) { - - var parsed = JSON.parse(result), - filename = parsed.filename, - uploadImageWrapper = codex.editor.content.currentNode.querySelector('.' + elementClasses_.withPhoto.photo); - - var img = uploadImageWrapper.querySelector('IMG'); - img.src = parsed.data.file.bigUrl; - img.dataset.bigUrl = parsed.data.file.bigUrl; - - uploadImageWrapper.classList.remove(elementClasses_.authorsPhotoWrapper_preview); - }, - - /** Error callback. Sends notification to user that something happend or plugin doesn't supports method */ - error : function(result) { - console.log('Can\'t upload an image'); - } - - }; - - /** - * @private - * - * Make Quote from JSON datasets - */ - var make_ = function(data) { - - var tag; - - if (data && data.size) { - - data.style = quote_plugin.config.defaultStyle; - - /** - * Supported types - */ - switch (data.style) { - - case 'simple': - tag = methods_.makeSimpleQuote(data); - break; - case 'withCaption': - tag = methods_.makeQuoteWithCaption(data); - break; - case 'withPhoto': - tag = methods_.makeQuoteWithPhoto(data); - break; - } - - tag.dataset.quoteStyle = data.size; - - } else { - - var settings = { - "text" : null, - "format" : "html", - "cite" : null, - "caption": null, - "size" : null, - "image" : null - }; - - tag = methods_.makeQuoteWithPhoto(settings); - } - - return tag; - }; - - var prepareDataForSave_ = function(data) { - - if (data.size == 'withPhoto') { - data.size = 'small'; - } - - /** Make paragraphs */ - data.text = codex.editor.content.wrapTextWithParagraphs(data.text); - - return data; - }; - - /** - * @public - * - * Renderer - * - * @param data - */ - quote_plugin.render = function(data) { - return make_(data); - }; - - quote_plugin.validate = function(output) { - - if (typeof output.text != "string") { - return; - } - - return output; - }; - - quote_plugin.save = function(blockContent) { - - /** - * Extracts JSON quote data from HTML block - * @param {Text} text, {Text} author, {Object} photo - */ - var parsedblock = methods_.parseBlockQuote(blockContent); - - var outputData = { - "text" : parsedblock.text, - "format" : "html", - "cite" : parsedblock.author || '', - "caption": parsedblock.job || '', - "size" : parsedblock.style, - "image" : parsedblock.photo - }; - - return prepareDataForSave_(outputData); - }; - - /** - * @public - * - * Draws settings - */ - quote_plugin.makeSettings = function(data) { - - var holder = document.createElement('DIV'), - types = { - big : 'По центру', - small : 'Врезка' - }, - selectTypeButton; - - /** Add holder classname */ - holder.className = elementClasses_.settings.holder; - - /** Now add type selectors */ - for (var type in types){ - - selectTypeButton = document.createElement('SPAN'); - - selectTypeButton.textContent = types[type]; - selectTypeButton.className = elementClasses_.settings.buttons; - - selectTypeButton.dataset.style = type; - - if ( type == quote_plugin.config.defaultStyle ){ - selectTypeButton.classList.add(quoteTools.styles.settings.selectedType); - } - - // var quoteStyle = quoteTools.selectTypeQuoteStyle(type); - - selectTypeButton.addEventListener('click', methods_.changeStyleClicked, false); - // quoteTools.addSelectTypeClickListener(selectTypeButton, quoteStyle); - - holder.appendChild(selectTypeButton); - - } - - return holder; - - }; - - /** - * @public - * Default path to redactors images - * @type {null} - */ - quote_plugin.path = null; - - /** - * @public - * - * @type {null} - */ - quote_plugin.config = null; - - /** - * @public - * - * @param config - */ - quote_plugin.prepare = function(config) { - - quote_plugin.config = config; - - return Promise.resolve(); - }; - - quote_plugin.destroy = function () { - - quote = null; - - }; - - return quote_plugin; - -})({}); \ No newline at end of file diff --git a/plugins/raw/raw.js b/plugins/raw/raw.js deleted file mode 100644 index d63c29f1..00000000 --- a/plugins/raw/raw.js +++ /dev/null @@ -1,51 +0,0 @@ -/** -* Plugin for CodeX.Editor -* Implements RAW-data block -*/ -var rawPlugin = function (plugin) { - - var editor = codex.editor; - - plugin.render = function (data) { - - var input = editor.draw.node('TEXTAREA', 'raw-plugin__input', {}); - - input.placeholder = 'Вставьте HTML код'; - - if (data && data.raw) { - input.value = data.raw; - } - - return input; - - }; - - plugin.save = function (block) { - - return { - raw: block.value - }; - - }; - - plugin.validate = function (data) { - - if (data.raw.trim() === '') { - - return; - - } - - return true; - - }; - - plugin.destroy = function () { - - rawPlugin = null; - - }; - - return plugin; - -}({}); \ No newline at end of file diff --git a/plugins/twitter/twitter.js b/plugins/twitter/twitter.js deleted file mode 100644 index 762fe6e9..00000000 --- a/plugins/twitter/twitter.js +++ /dev/null @@ -1,281 +0,0 @@ -/** - * Twitter plugin - * @version 1.0.0 - */ - -var twitter = (function(twitter_plugin) { - - /** - * User's configuration object - */ - var config_ = {}; - - /** - * CSS classes - */ - var css_ = { - pluginWrapper : 'cdx-tweet' - }; - - var methods = { - - /** - * Twitter render method appends content after block - * @param tweetId - */ - twitter : function(data, twitterBlock) { - - var tweet = methods.drawTwitterHolder(), - twittersCaption = methods.drawTwittersCaptionBlock(); - - if (data.caption) { - twittersCaption.innerHTML = data.caption; - } - - /** - * add created tweet to holder - */ - tweet.appendChild(twitterBlock); - - // setTimeout(function() { - window.twttr.widgets.createTweet(data.id_str, twitterBlock).then(tweetInsertedCallback_); - // }, 1000); - - tweet.classList.add('ce-redactor__loader'); - - if (codex.editor.content.currentNode) { - tweet.dataset.statusUrl = data.status_url; - codex.editor.content.switchBlock(codex.editor.content.currentNode, tweet, 'tweet'); - } - - /** - * in case if we need extra data - */ - if ( !data.user ) { - - codex.editor.core.ajax({ - url : config_.fetchUrl + '?tweetId=' + data.id_str, - type: "GET", - success: function(result) { - methods.saveTwitterData(result, tweet); - } - }); - - } else { - - tweet.dataset.profileImageUrl = data.user.profile_image_url; - tweet.dataset.profileImageUrlHttps = data.user.profile_image_url_https; - tweet.dataset.screenName = data.user.screen_name; - tweet.dataset.name = data.user.name; - tweet.dataset.id = +data.id; - tweet.dataset.idStr = data.id_str; - tweet.dataset.text = data.text; - tweet.dataset.createdAt = data.created_at; - tweet.dataset.statusUrl = data.status_url; - tweet.dataset.media = data.media; - - tweet.classList.remove('ce-redactor__loader'); - } - - /** - * add caption to tweet - */ - setTimeout(function() { - tweet.appendChild(twittersCaption); - }, 1000); - - return tweet; - - }, - - drawTwitterHolder : function() { - - var block = document.createElement('DIV'); - - block.classList.add(css_.pluginWrapper); - - return block; - - }, - - drawTwitterBlock : function() { - var block = codex.editor.draw.node('DIV', '', { height: "20px" }); - return block; - }, - - drawTwittersCaptionBlock : function() { - var block = codex.editor.draw.node('DIV', ['ce-twitter__caption'], { contentEditable : true }); - return block; - }, - - saveTwitterData : function(result, tweet) { - - var data = JSON.parse(result), - twitterContent = tweet; - - setTimeout(function() { - - /** - * Save twitter data via data-attributes - */ - twitterContent.dataset.profileImageUrl = data.user.profile_image_url; - twitterContent.dataset.profileImageUrlHttps = data.user.profile_image_url_https; - twitterContent.dataset.screenName = data.user.screen_name; - twitterContent.dataset.name = data.user.name; - twitterContent.dataset.id = +data.id; - twitterContent.dataset.idStr = data.id_str; - twitterContent.dataset.text = data.text; - twitterContent.dataset.createdAt = data.created_at; - twitterContent.dataset.media = data.entities.urls.length > 0 ? "false" : "true"; - - }, 50); - - } - }; - - /** - * @private - * Fires after tweet widget rendered - */ - function tweetInsertedCallback_(widget) { - - var pluginWrapper = findParent_( widget , css_.pluginWrapper ); - - pluginWrapper.classList.remove('ce-redactor__loader'); - - } - - /** - * @private - * Find closiest parent Element with CSS class - */ - function findParent_ (el, cls) { - while ((el = el.parentElement) && !el.classList.contains(cls)); - return el; - } - - /** - * Prepare twitter scripts - * @param {object} config - */ - twitter_plugin.prepare = function(config) { - - /** - * Save configs - */ - config_ = config; - - return new Promise(function(resolve, reject){ - - codex.editor.core.importScript("https://platform.twitter.com/widgets.js", 'twitter-api').then(function(){ - resolve(); - }).catch(function(){ - reject(Error('Twitter API was not loaded')); - }); - - }); - - }; - - /** - * @private - * - * @param data - * @returns {*} - */ - make_ = function(data) { - - if (!data.id || !data.status_url) - return; - - if (!data.id_str) { - data.id_str = data.status_url.match(/[^\/]+$/)[0]; - } - - var twitterBlock = methods.drawTwitterBlock(); - - var tweet = methods.twitter(data, twitterBlock); - - return tweet; - }; - - twitter_plugin.validate = function(data) { - return true; - }; - - twitter_plugin.save = function(blockContent) { - - var data, - caption = blockContent.querySelector('.ce-twitter__caption'); - - data = { - media:blockContent.dataset.media, - conversation:false, - user:{ - profile_image_url: blockContent.dataset.profileImageUrl, - profile_image_url_https: blockContent.dataset.profileImageUrlHttps, - screen_name: blockContent.dataset.screenName, - name: blockContent.dataset.name - }, - id: blockContent.dataset.id || blockContent.dataset.tweetId, - id_str : blockContent.dataset.idStr, - text: blockContent.dataset.text, - created_at: blockContent.dataset.createdAt, - status_url: blockContent.dataset.statusUrl, - caption: caption.innerHTML || '' - }; - - return data; - }; - - twitter_plugin.render = function(data) { - return make_(data); - }; - - twitter_plugin.urlPastedCallback = function(url) { - - var tweetId, - arr, - data; - - arr = url.split('/'); - tweetId = arr.pop(); - - /** Example */ - data = { - "media" : true, - "conversation" : false, - "user" : null, - "id" : +tweetId, - "text" : null, - "created_at" : null, - "status_url" : url, - "caption" : null - }; - - make_(data); - }; - - twitter_plugin.pastePatterns = [ - { - type: 'twitter', - regex: /http?.+twitter.com?.+\//, - callback: twitter_plugin.urlPastedCallback - } - ]; - - twitter_plugin.destroy = function () { - - twitter = null; - delete window.twttr; - - }; - - return twitter_plugin; - -})({}); - - - - - diff --git a/server/index.php b/server/index.php deleted file mode 100644 index e6286c87..00000000 --- a/server/index.php +++ /dev/null @@ -1,95 +0,0 @@ -loadHTML($html); - $nodes = $doc->getElementsByTagName('title'); - - $title = $nodes->item(0)->nodeValue; - $description = ""; - $keywords = ""; - $image = ""; - - $metas = $doc->getElementsByTagName('meta'); - - for ($i = 0; $i < $metas->length; $i++) - { - $meta = $metas->item($i); - if($meta->getAttribute('name') == 'description') - $description = $meta->getAttribute('content'); - if($meta->getAttribute('name') == 'keywords') - $keywords = $meta->getAttribute('content'); - if($meta->getAttribute('property')=='og:image'){ - $image = $meta->getAttribute('content'); - } - } - - return [ - 'image' => $image, - 'title' => $title, - 'description' => $description - ]; -} - -$url = get_url(); - -$url_params = parse_url($url); - -if (!$url) -{ - exit(0); -} - -$html = file_get_contents_curl($url); - -$result = get_meta_from_html($html); - -$result = array_merge( - - get_meta_from_html($html), - - array( - 'linkUrl' => $url, - 'linkText' => $url_params["host"] . isset($url_params["path"])?$url_params["path"]:"", - ) - -); - -echo json_encode($result); - -?> diff --git a/src/assets/arrow-down.svg b/src/assets/arrow-down.svg new file mode 100644 index 00000000..2ce78b4e --- /dev/null +++ b/src/assets/arrow-down.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/arrow-up.svg b/src/assets/arrow-up.svg new file mode 100644 index 00000000..4bc8ed14 --- /dev/null +++ b/src/assets/arrow-up.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/bold.svg b/src/assets/bold.svg new file mode 100644 index 00000000..f10a3d6d --- /dev/null +++ b/src/assets/bold.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/cross.svg b/src/assets/cross.svg new file mode 100644 index 00000000..54055697 --- /dev/null +++ b/src/assets/cross.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/dots.svg b/src/assets/dots.svg new file mode 100644 index 00000000..661f880d --- /dev/null +++ b/src/assets/dots.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/assets/italic.svg b/src/assets/italic.svg new file mode 100644 index 00000000..0c23b1ff --- /dev/null +++ b/src/assets/italic.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/link.svg b/src/assets/link.svg new file mode 100644 index 00000000..7a6068f4 --- /dev/null +++ b/src/assets/link.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/plus.svg b/src/assets/plus.svg new file mode 100644 index 00000000..5f2fe1b4 --- /dev/null +++ b/src/assets/plus.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/unlink.svg b/src/assets/unlink.svg new file mode 100644 index 00000000..780c3812 --- /dev/null +++ b/src/assets/unlink.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/codex.js b/src/codex.js new file mode 100644 index 00000000..bef63fb5 --- /dev/null +++ b/src/codex.js @@ -0,0 +1,413 @@ +/** + * Codex Editor + * + * Short Description (눈_눈;) + * @version 2.0.0 + * + * How to start? + * Example: + * new CodexEditor({ + * holderId : 'codex-editor', + * initialBlock : 'text', + * placeholder : 'Write your story....', + * tools: { + * quote: Quote, + * anotherTool : AnotherTool + * }, + * toolsConfig: { + * quote: { + * iconClassname : 'quote-icon', + * displayInToolbox : true, + * enableLineBreaks : true + * }, + * anotherTool: { + * iconClassname : 'tool-icon' + * } + * } + * }); + * + * - tools is an object: { + * pluginName: PluginClass, + * ..... + * } + * - toolsConfig is an additional configuration that uses Codex Editor API + * iconClassname - CSS classname of toolbox icon + * displayInToolbox - if you want to see your Tool in toolbox hided in "plus" button, than set "True". By default : "False" + * enableLineBreaks - by default enter creates new block that set as initialblock, but if you set this property "True", enter will break the lines in current block + * + * @author CodeX-Team + * + */ + +/** + * @typedef {CodexEditor} CodexEditor - editor class + */ + +/** + * @typedef {Object} EditorConfig + * @property {String} holderId - Element to append Editor + * @property {Array} data - Blocks list in JSON-format + * @property {Object} tools - Map for used Tools in format { name : Class, ... } + * @property {String} initialBlock - This Tool will be added by default + * @property {String} placeholder - First Block placeholder + * @property {Object} sanitizer - @todo fill desc + * @property {Boolean} hideToolbar - @todo fill desc + * @property {Object} toolsConfig - tools configuration {@link tools#ToolConfig} + */ + +/** + * Dynamically imported utils + * + * @typedef {Dom} $ - {@link components/dom.js} + * @typedef {Util} _ - {@link components/utils.js} + */ + +'use strict'; + +/** + * Apply polyfills + */ +import 'babel-core/register'; +import 'babel-polyfill'; +import 'components/polyfills'; + +/** + * Require Editor modules places in components/modules dir + */ +// eslint-disable-next-line +let modules = editorModules.map( module => require('./components/modules/' + module )); + +/** + * @class + * + * @classdesc CodeX Editor base class + * + * @property this.config - all settings + * @property this.moduleInstances - constructed editor components + * + * @type {CodexEditor} + */ +export default class CodexEditor { + /** Editor version */ + static get version() { + return VERSION; + } + + /** + * @param {EditorConfig} config - user configuration + * + */ + constructor(config) { + /** + * Configuration object + * @type {EditorConfig} + */ + this.config = {}; + + /** + * @typedef {Object} EditorComponents + * @property {BlockManager} BlockManager + * @property {Tools} Tools + * @property {Events} Events + * @property {UI} UI + * @property {Toolbar} Toolbar + * @property {Toolbox} Toolbox + * @property {BlockSettings} BlockSettings + * @property {Renderer} Renderer + * @property {InlineToolbar} InlineToolbar + */ + this.moduleInstances = {}; + + Promise.resolve() + .then(() => { + this.configuration = config; + }) + .then(() => this.init()) + .then(() => this.start()) + .then(() => { + let methods = this.moduleInstances.API.methods; + + /** + * Make API methods available from inside easier + */ + for (let method in methods) { + this[method] = methods[method]; + } + + // todo Is it necessary? + delete this.moduleInstances; + }) + .then(() => { + console.log('CodeX Editor is ready!'); + }) + .catch(error => { + console.log('CodeX Editor does not ready because of %o', error); + }); + } + + /** + * Setting for configuration + * @param {EditorConfig} config + */ + set configuration(config) { + /** + * Initlai block type + * Uses in case when there is no items passed + * @type {{type: (*), data: {text: null}}} + */ + let initialBlock = { + type : config.initialBlock, + data : {} + }; + + this.config.holderId = config.holderId; + this.config.placeholder = config.placeholder || 'write your story...'; + this.config.sanitizer = config.sanitizer || { + p: true, + b: true, + a: true + }; + + this.config.hideToolbar = config.hideToolbar ? config.hideToolbar : false; + this.config.tools = config.tools || {}; + this.config.toolsConfig = config.toolsConfig || {}; + this.config.data = config.data || {}; + + /** + * Initialize items to pass data to the Renderer + */ + if (_.isEmpty(this.config.data)) { + this.config.data = {}; + this.config.data.items = [ initialBlock ]; + } else { + if (!this.config.data.items || this.config.data.items.length === 0) { + this.config.data.items = [ initialBlock ]; + } + } + + /** + * If initial Block's Tool was not passed, use the first Tool in config.tools + */ + if (!config.initialBlock) { + for (this.config.initialBlock in this.config.tools) break; + } else { + this.config.initialBlock = config.initialBlock; + } + } + + /** + * Returns private property + * @returns {EditorConfig} + */ + get configuration() { + return this.config; + } + + /** + * Initializes modules: + * - make and save instances + * - configure + */ + init() { + /** + * Make modules instances and save it to the @property this.moduleInstances + */ + this.constructModules(); + + /** + * Modules configuration + */ + this.configureModules(); + } + + /** + * Make modules instances and save it to the @property this.moduleInstances + */ + constructModules() { + modules.forEach( Module => { + try { + /** + * We use class name provided by displayName property + * + * On build, Babel will transform all Classes to the Functions so, name will always be 'Function' + * To prevent this, we use 'babel-plugin-class-display-name' plugin + * @see https://www.npmjs.com/package/babel-plugin-class-display-name + */ + this.moduleInstances[Module.displayName] = new Module({ + config : this.configuration + }); + } catch ( e ) { + console.log('Module %o skipped because %o', Module, e); + } + }); + } + + /** + * Modules instances configuration: + * - pass other modules to the 'state' property + * - ... + */ + configureModules() { + for(let name in this.moduleInstances) { + /** + * Module does not need self-instance + */ + this.moduleInstances[name].state = this.getModulesDiff( name ); + } + } + + /** + * Return modules without passed name + */ + getModulesDiff( name ) { + let diff = {}; + + for(let moduleName in this.moduleInstances) { + /** + * Skip module with passed name + */ + if (moduleName === name) { + continue; + } + diff[moduleName] = this.moduleInstances[moduleName]; + } + + return diff; + } + + /** + * Start Editor! + * + * Get list of modules that needs to be prepared and return a sequence (Promise) + * @return {Promise} + */ + async start() { + const modulesToPrepare = ['Tools', 'UI', 'BlockManager', 'Paste']; + + await modulesToPrepare.reduce( + (promise, module) => promise.then(async () => { + _.log(`Preparing ${module} module`, 'time'); + + try { + await this.moduleInstances[module].prepare(); + } catch (e) { + _.log(`Module ${module} was skipped because of %o`, 'warn', e); + } + _.log(`Preparing ${module} module`, 'timeEnd'); + }), + Promise.resolve() + ); + + return this.moduleInstances.Renderer.render(this.config.data.items); + } +}; + +// module.exports = (function (editor) { +// +// 'use strict'; +// +// editor.version = VERSION; +// editor.scriptPrefix = 'cdx-script-'; +// +// var init = function () { +// +// editor.core = require('./modules/core'); +// editor.tools = require('./modules/tools'); +// editor.ui = require('./modules/ui'); +// editor.transport = require('./modules/transport'); +// editor.renderer = require('./modules/renderer'); +// editor.saver = require('./modules/saver'); +// editor.content = require('./modules/content'); +// editor.toolbar = require('./modules/toolbar/toolbar'); +// editor.callback = require('./modules/callbacks'); +// editor.draw = require('./modules/draw'); +// editor.caret = require('./modules/caret'); +// editor.notifications = require('./modules/notifications'); +// editor.parser = require('./modules/parser'); +// editor.sanitizer = require('./modules/sanitizer'); +// editor.listeners = require('./modules/listeners'); +// editor.destroyer = require('./modules/destroyer'); +// editor.paste = require('./modules/paste'); +// +// }; +// +// /** +// * @public +// * holds initial settings +// */ +// editor.settings = { +// tools : ['text', 'header', 'picture', 'list', 'quote', 'code', 'twitter', 'instagram', 'smile'], +// holderId : 'codex-editor', +// +// // Type of block showing on empty editor +// initialBlockPlugin: 'text' +// }; +// +// /** +// * public +// * +// * Static nodes +// */ +// editor.nodes = { +// holder : null, +// wrapper : null, +// toolbar : null, +// inlineToolbar : { +// wrapper : null, +// buttons : null, +// actions : null +// }, +// toolbox : null, +// notifications : null, +// plusButton : null, +// showSettingsButton: null, +// showTrashButton : null, +// blockSettings : null, +// pluginSettings : null, +// defaultSettings : null, +// toolbarButtons : {}, // { type : DomEl, ... } +// redactor : null +// }; +// +// /** +// * @public +// * +// * Output state +// */ +// editor.state = { +// jsonOutput : [], +// blocks : [], +// inputs : [] +// }; +// +// /** +// * @public +// * Editor plugins +// */ +// editor.tools = {}; +// +// editor.start = function (userSettings) { +// +// init(); +// +// editor.core.prepare(userSettings) +// +// // If all ok, make UI, bind events and parse initial-content +// .then(editor.ui.prepare) +// .then(editor.tools.prepare) +// .then(editor.sanitizer.prepare) +// .then(editor.paste.prepare) +// .then(editor.transport.prepare) +// .then(editor.renderer.makeBlocksFromData) +// .then(editor.ui.saveInputs) +// .catch(function (error) { +// +// editor.core.log('Initialization failed with error: %o', 'warn', error); +// +// }); +// +// }; +// +// return editor; +// +// })({}); diff --git a/src/components/__module.ts b/src/components/__module.ts new file mode 100644 index 00000000..f8496fe2 --- /dev/null +++ b/src/components/__module.ts @@ -0,0 +1,47 @@ +import IEditor from './interfaces/editor'; +import IEditorConfig from './interfaces/editor-config'; +import IModuleConfig from './interfaces/module-config'; + +/** + * @abstract + * @class Module + * @classdesc All modules inherits from this class. + * + * @typedef {Module} Module + * @property {Object} config - Editor user settings + * @property {IEditorConfig} Editor - List of Editor modules + */ +export default class Module { + + /** + * Editor modules list + * @type {IEditor} + */ + protected Editor: IEditor; + + /** + * Editor configuration object + * @type {IEditorConfig} + */ + protected config: IEditorConfig; + + /** + * @constructor + * @param {IModuleConfig} + */ + constructor({config}: IModuleConfig) { + if (new.target === Module) { + throw new TypeError('Constructors for abstract class Module are not allowed.'); + } + + this.config = config; + } + + /** + * Editor modules setter + * @param {IEditor} Editor + */ + set state(Editor) { + this.Editor = Editor; + } +} diff --git a/src/components/block-tunes/block-tune-delete.ts b/src/components/block-tunes/block-tune-delete.ts new file mode 100644 index 00000000..3a253469 --- /dev/null +++ b/src/components/block-tunes/block-tune-delete.ts @@ -0,0 +1,111 @@ +/** + * @class DeleteTune + * @classdesc Editor's default tune that moves up selected block + * + * @copyright 2018 + */ +import IBlockTune from '../interfaces/block-tune'; + +declare var $: any; +declare var _: any; + +export default class DeleteTune implements IBlockTune { + + /** + * Property that contains CodeX Editor API methods + * @see {docs/api.md} + */ + private readonly api: any; + + /** + * Styles + * @type {{wrapper: string}} + */ + private CSS = { + wrapper: 'ass', + button: 'ce-settings__button', + buttonDelete: 'ce-settings__button--delete', + buttonConfirm: 'ce-settings__button--confirm', + }; + + /** + * Delete confirmation + */ + private needConfirmation: boolean; + + /** + * set false confirmation state + */ + private resetConfirmation: () => void; + + /** + * Tune nodes + */ + private nodes = { + button: null, + }; + + /** + * DeleteTune constructor + * + * @param {Object} api + */ + constructor({api}) { + this.api = api; + + this.resetConfirmation = () => { + this.setConfirmation(false); + }; + } + + /** + * Create "Delete" button and add click event listener + * @returns [Element} + */ + public render() { + this.nodes.button = $.make('div', [this.CSS.button, this.CSS.buttonDelete], {}); + this.nodes.button.appendChild($.svg('cross', 12, 12)); + this.api.listener.on(this.nodes.button, 'click', (event) => this.handleClick(event), false); + return this.nodes.button; + } + + /** + * Delete block conditions passed + * @param {MouseEvent} event + */ + public handleClick(event: MouseEvent): void { + + /** + * if block is not waiting the confirmation, subscribe on block-settings-closing event to reset + * otherwise delete block + */ + if (!this.needConfirmation) { + this.setConfirmation(true); + + /** + * Subscribe on event. + * When toolbar block settings is closed but block deletion is not confirmed, + * then reset confirmation state + */ + this.api.events.on('block-settings-closed', this.resetConfirmation); + + } else { + + /** + * Unsubscribe from block-settings closing event + */ + this.api.events.off('block-settings-closed', this.resetConfirmation); + + this.api.blocks.delete(); + } + } + + /** + * change tune state + */ + private setConfirmation(state): void { + this.needConfirmation = state; + this.nodes.button.classList.add(this.CSS.buttonConfirm); + } + +} diff --git a/src/components/block-tunes/block-tune-move-down.ts b/src/components/block-tunes/block-tune-move-down.ts new file mode 100644 index 00000000..e848ca4e --- /dev/null +++ b/src/components/block-tunes/block-tune-move-down.ts @@ -0,0 +1,88 @@ +/** + * @class MoveDownTune + * @classdesc Editor's default tune - Moves down highlighted block + * + * @copyright 2018 + */ +import IBlockTune from '../interfaces/block-tune'; + +declare var $: any; +declare var _: any; + +export default class MoveDownTune implements IBlockTune { + /** + * Property that contains CodeX Editor API methods + * @see {api.md} + */ + private readonly api: any; + + /** + * Styles + * @type {{wrapper: string}} + */ + private CSS = { + button: 'ce-settings__button', + wrapper: 'ce-tune-move-down', + animation: 'wobble', + }; + + /** + * MoveDownTune constructor + * + * @param {Object} api + */ + public constructor({api}) { + this.api = api; + } + + /** + * Return 'move down' button + */ + public render() { + const moveDownButton = $.make('div', [this.CSS.button, this.CSS.wrapper], {}); + moveDownButton.appendChild($.svg('arrow-down', 14, 14)); + this.api.listener.on(moveDownButton, 'click', (event) => this.handleClick(event, moveDownButton), false); + return moveDownButton; + } + + /** + * Handle clicks on 'move down' button + * @param {MouseEvent} event + * @param {HTMLElement} button + */ + public handleClick(event: MouseEvent, button: HTMLElement) { + + const currentBlockIndex = this.api.blocks.getCurrentBlockIndex(); + + // If Block is last do nothing + if (currentBlockIndex === this.api.blocks.getBlocksCount() - 1) { + button.classList.add(this.CSS.animation); + + window.setTimeout( () => { + button.classList.remove(this.CSS.animation); + }, 500); + return; + } + + const nextBlockElement = this.api.blocks.getBlockByIndex(currentBlockIndex + 1).holder, + nextBlockCoords = nextBlockElement.getBoundingClientRect(); + + let scrollOffset = Math.abs(window.innerHeight - nextBlockElement.offsetHeight); + + /** + * Next block ends on screen. + * Increment scroll by next block's height to save element onscreen-position + */ + if (nextBlockCoords.top < window.innerHeight) { + + scrollOffset = window.scrollY + nextBlockElement.offsetHeight; + + } + + window.scrollTo(0, scrollOffset); + + /** Change blocks positions */ + this.api.blocks.swap(currentBlockIndex, currentBlockIndex + 1); + + } +} diff --git a/src/components/block-tunes/block-tune-move-up.ts b/src/components/block-tunes/block-tune-move-up.ts new file mode 100644 index 00000000..83abffd1 --- /dev/null +++ b/src/components/block-tunes/block-tune-move-up.ts @@ -0,0 +1,95 @@ +/** + * @class MoveUpTune + * @classdesc Editor's default tune that moves up selected block + * + * @copyright 2018 + */ +import IBlockTune from '../interfaces/block-tune'; + +declare var $: any; +declare var _: any; + +export default class MoveUpTune implements IBlockTune { + + /** + * Property that contains CodeX Editor API methods + * @see {api.md} + */ + private readonly api: any; + + /** + * Styles + * @type {{wrapper: string}} + */ + private CSS = { + button: 'ce-settings__button', + wrapper: 'ce-tune-move-up', + animation: 'wobble', + }; + + /** + * MoveUpTune constructor + * + * @param {Object} api + */ + public constructor({api}) { + this.api = api; + } + + /** + * Create "MoveUp" button and add click event listener + * @returns [Element} + */ + public render() { + const moveUpButton = $.make('div', [this.CSS.button, this.CSS.wrapper], {}); + moveUpButton.appendChild($.svg('arrow-up', 14, 14)); + this.api.listener.on(moveUpButton, 'click', (event) => this.handleClick(event, moveUpButton), false); + return moveUpButton; + } + + /** + * Move current block up + * @param {MouseEvent} event + * @param {HTMLElement} button + */ + public handleClick(event: MouseEvent, button: HTMLElement): void { + + const currentBlockIndex = this.api.blocks.getCurrentBlockIndex(); + + if (currentBlockIndex === 0) { + button.classList.add(this.CSS.animation); + + window.setTimeout( () => { + button.classList.remove(this.CSS.animation); + }, 500); + return; + } + + const currentBlockElement = this.api.blocks.getBlockByIndex(currentBlockIndex).holder, + previousBlockElement = this.api.blocks.getBlockByIndex(currentBlockIndex - 1).holder; + + /** + * Here is two cases: + * - when previous block has negative offset and part of it is visible on window, then we scroll + * by window's height and add offset which is mathematically difference between two blocks + * + * - when previous block is visible and has offset from the window, + * than we scroll window to the difference between this offsets. + */ + const currentBlockCoords = currentBlockElement.getBoundingClientRect(), + previousBlockCoords = previousBlockElement.getBoundingClientRect(); + + let scrollUpOffset; + + if (previousBlockCoords.top > 0) { + scrollUpOffset = Math.abs(currentBlockCoords.top) - Math.abs(previousBlockCoords.top); + } else { + scrollUpOffset = window.innerHeight - Math.abs(currentBlockCoords.top) + Math.abs(previousBlockCoords.top); + } + + window.scrollBy(0, -1 * scrollUpOffset); + + /** Change blocks positions */ + this.api.blocks.swap(currentBlockIndex, currentBlockIndex - 1); + } +} diff --git a/src/components/block.js b/src/components/block.js new file mode 100644 index 00000000..483ebfec --- /dev/null +++ b/src/components/block.js @@ -0,0 +1,266 @@ +/** + * @class Block + * @classdesc This class describes editor`s block, including block`s HTMLElement, data and tool + * + * @property {Tool} tool — current block tool (Paragraph, for example) + * @property {Object} CSS — block`s css classes + * + */ + +/** Import default tunes */ +import MoveUpTune from './block-tunes/block-tune-move-up'; +import DeleteTune from './block-tunes/block-tune-delete'; +import MoveDownTune from './block-tunes/block-tune-move-down'; + +/** + * @classdesc Abstract Block class that contains Block information, Tool name and Tool class instance + * + * @property tool - Tool instance + * @property html - Returns HTML content of plugin + * @property holder - Div element that wraps block content with Tool's content. Has `ce-block` CSS class + * @property pluginsContent - HTML content that returns by Tool's render function + */ +export default class Block { + /** + * @constructor + * @param {String} toolName - Tool name that passed on initialization + * @param {Object} toolInstance — passed Tool`s instance that rendered the Block + * @param {Object} settings - default settings + * @param {Object} apiMethods - Editor API + */ + constructor(toolName, toolInstance, settings, apiMethods) { + this.name = toolName; + this.tool = toolInstance; + this.settings = settings; + this.api = apiMethods; + this.holder = this.compose(); + + /** + * @type {IBlockTune[]} + */ + this.tunes = this.makeTunes(); + } + + /** + * CSS classes for the Block + * @return {{wrapper: string, content: string}} + */ + static get CSS() { + return { + wrapper: 'ce-block', + content: 'ce-block__content', + selected: 'ce-block--selected' + }; + } + + /** + * Make default Block wrappers and put Tool`s content there + * @returns {HTMLDivElement} + */ + compose() { + let wrapper = $.make('div', Block.CSS.wrapper), + contentNode = $.make('div', Block.CSS.content), + pluginsContent = this.tool.render(); + + contentNode.appendChild(pluginsContent); + wrapper.appendChild(contentNode); + return wrapper; + } + + /** + * Calls Tool's method + * + * Method checks tool property {MethodName}. Fires method with passes params If it is instance of Function + * + * @param {String} methodName + * @param {Object} params + */ + call(methodName, params) { + /** + * call Tool's method with the instance context + */ + if (this.tool[methodName] && this.tool[methodName] instanceof Function) { + this.tool[methodName].call(this.tool, params); + } + } + + /** + * Returns Plugins content + * @return {Node} + */ + get pluginsContent() { + let pluginsContent = this.holder.querySelector(`.${Block.CSS.content}`); + + if (pluginsContent && pluginsContent.childNodes.length) { + return pluginsContent.childNodes[0]; + } + + return null; + } + + /** + * Get Block's JSON data + * @return {Object} + */ + get data() { + return this.save(); + } + + /** + * is block mergeable + * We plugin have merge function then we call it mergable + * @return {boolean} + */ + get mergeable() { + return typeof this.tool.merge === 'function'; + } + + /** + * Call plugins merge method + * @param {Object} data + */ + mergeWith(data) { + return Promise.resolve() + .then(() => { + this.tool.merge(data); + }); + } + /** + * Extracts data from Block + * Groups Tool's save processing time + * @return {Object} + */ + save() { + let extractedBlock = this.tool.save(this.pluginsContent); + + /** Measuring execution time*/ + let measuringStart = window.performance.now(), + measuringEnd; + + return Promise.resolve(extractedBlock) + .then((finishedExtraction) => { + /** measure promise execution */ + measuringEnd = window.performance.now(); + + return { + tool: this.name, + data: finishedExtraction, + time : measuringEnd - measuringStart + }; + }) + .catch(function (error) { + _.log(`Saving proccess for ${this.tool.name} tool failed due to the ${error}`, 'log', 'red'); + }); + } + + /** + * Uses Tool's validation method to check the correctness of output data + * Tool's validation method is optional + * + * @description Method also can return data if it passed the validation + * + * @param {Object} data + * @returns {Boolean|Object} valid + */ + validateData(data) { + let isValid = true; + + if (this.tool.validate instanceof Function) { + isValid = this.tool.validate(data); + } + + if (!isValid) { + return false; + } + + return data; + } + + /** + * Make an array with default settings + * Each block has default tune instance that have states + * @return {IBlockTune[]} + */ + makeTunes() { + let tunesList = [MoveUpTune, DeleteTune, MoveDownTune]; + + // Pluck tunes list and return tune instances with passed Editor API and settings + return tunesList.map( (tune) => { + return new tune({ + api: this.api, + settings: this.settings, + }); + }); + } + + /** + * Enumerates initialized tunes and returns fragment that can be appended to the toolbars area + * @return {DocumentFragment} + */ + renderTunes() { + let tunesElement = document.createDocumentFragment(); + + this.tunes.forEach( tune => { + $.append(tunesElement, tune.render()); + }); + + return tunesElement; + } + + /** + * Check block for emptiness + * @return {Boolean} + */ + get isEmpty() { + /** + * Allow Tool to represent decorative contentless blocks: for example "* * *"-tool + * That Tools are not empty + */ + if (this.tool.contentless) { + return false; + } + + let emptyText = $.isEmpty(this.pluginsContent), + emptyMedia = !this.hasMedia; + + return emptyText && emptyMedia; + } + + /** + * Check if block has a media content such as images, iframes and other + * @return {Boolean} + */ + get hasMedia() { + /** + * This tags represents media-content + * @type {string[]} + */ + const mediaTags = [ + 'img', + 'iframe', + 'video', + 'audio', + 'source', + 'input', + 'textarea', + 'twitterwidget' + ]; + + return !!this.holder.querySelector(mediaTags.join(',')); + } + + /** + * Set selected state + * @param {Boolean} state - 'true' to select, 'false' to remove selection + */ + set selected(state) { + /** + * We don't need to mark Block as Selected when it is not empty + */ + if (state === true && !this.isEmpty) { + this.holder.classList.add(Block.CSS.selected); + } else { + this.holder.classList.remove(Block.CSS.selected); + } + } +} diff --git a/src/components/core.js b/src/components/core.js new file mode 100644 index 00000000..9b71fda7 --- /dev/null +++ b/src/components/core.js @@ -0,0 +1,348 @@ +/** + * Codex Editor Core + * + * @author Codex Team + * @version 2.0.0 + */ +export default class Core { + /** + * Module key name + * @returns {string} + */ + static get name() { + return 'core'; + }; + + /** Editor script prefixes */ + static get scriptPrefix() { + return 'cdx-script-'; + } + + /** + * + * @param Editor + * @param Editor.modules {@link Tools#list} + * @param Editor.config {@link CodexEditor#configuration} + */ + constructor(config) { + // this.Editor.modules.toolbar; + + this.Editor = null; + + // console.log(this.Editor); + + + // this.toolbar = modules.toolbar; + + // this.sanitizer = null; + // this.state = {}; + } + + /** + * @param Editor + * @param Editor.modules {@link CodexEditor#moduleInstances} + * @param Editor.config {@link CodexEditor#configuration} + * @param Editor + */ + set state(Editor) { + this.Editor = Editor; + } + + /** + * @public + * + * Editor preparing method + * @return Promise + */ + prepare() { + // let self = this; + + console.log('Core prepare fired'); + + /** + * Обращение к другому модулю + */ + console.log(this.Editor.ui.wrapper); + + + return; + + /** + + return new Promise(function (resolve, reject) { + + if (typeof self.Editor.config.holderId === undefined ) { + + reject(Error("Holder wasn't found by ID: #" + userSettings.holderId)); + + } else { + + resolve(); + + } + + resolve(); + + }); + + */ + } + + + /** + * Native Ajax + * @param {String} settings.url - request URL + * @param {function} settings.beforeSend - returned value will be passed as context to the Success, Error and Progress callbacks + * @param {function} settings.success + * @param {function} settings.progress + */ + ajax(settings) { + if (!settings || !settings.url) { + return; + } + + var XMLHTTP = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'), + encodedString, + isFormData, + prop; + + + settings.async = true; + settings.type = settings.type || 'GET'; + settings.data = settings.data || ''; + settings['content-type'] = settings['content-type'] || 'application/json; charset=utf-8'; + + if (settings.type == 'GET' && settings.data) { + settings.url = /\?/.test(settings.url) ? settings.url + '&' + settings.data : settings.url + '?' + settings.data; + } else { + encodedString = ''; + for(prop in settings.data) { + encodedString += (prop + '=' + encodeURIComponent(settings.data[prop]) + '&'); + } + } + + if (settings.withCredentials) { + XMLHTTP.withCredentials = true; + } + + /** + * Value returned in beforeSend funtion will be passed as context to the other response callbacks + * If beforeSend returns false, AJAX will be blocked + */ + let responseContext, + beforeSendResult; + + if (typeof settings.beforeSend === 'function') { + beforeSendResult = settings.beforeSend.call(); + + if (beforeSendResult === false) { + return; + } + } + + XMLHTTP.open( settings.type, settings.url, settings.async ); + + /** + * If we send FormData, we need no content-type header + */ + isFormData = isFormData_(settings.data); + + if (!isFormData) { + if (settings.type !== 'POST') { + XMLHTTP.setRequestHeader('Content-type', settings['content-type']); + } else { + XMLHTTP.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + } + } + + XMLHTTP.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + + responseContext = beforeSendResult || XMLHTTP; + + if (typeof settings.progress === 'function') { + XMLHTTP.upload.onprogress = settings.progress.bind(responseContext); + } + + XMLHTTP.onreadystatechange = function () { + if (XMLHTTP.readyState === 4) { + if (XMLHTTP.status === 200) { + if (typeof settings.success === 'function') { + settings.success.call(responseContext, XMLHTTP.responseText); + } + } else { + if (typeof settings.error === 'function') { + settings.error.call(responseContext, XMLHTTP.responseText, XMLHTTP.status); + } + } + } + }; + + if (isFormData) { + // Sending FormData + XMLHTTP.send(settings.data); + } else { + // POST requests + XMLHTTP.send(encodedString); + } + + return XMLHTTP; + } +}; +// module.exports = (function (core) { +// +// let editor = codex.editor; +// +// +// /** +// * @protected +// * +// * Helper for insert one element after another +// */ +// core.insertAfter = function (target, element) { +// +// target.parentNode.insertBefore(element, target.nextSibling); +// +// }; +// +// /** +// * @const +// * +// * Readable DOM-node types map +// */ +// core.nodeTypes = { +// TAG : 1, +// TEXT : 3, +// COMMENT : 8, +// DOCUMENT_FRAGMENT: 11 +// }; +// +// /** +// * @const +// * Readable keys map +// */ +// core.keys = { BACKSPACE: 8, TAB: 9, ENTER: 13, SHIFT: 16, CTRL: 17, ALT: 18, ESC: 27, SPACE: 32, LEFT: 37, UP: 38, DOWN: 40, RIGHT: 39, DELETE: 46, META: 91 }; +// +// /** +// * @protected +// * +// * Check object for DOM node +// */ +// core.isDomNode = function (el) { +// +// return el && typeof el === 'object' && el.nodeType && el.nodeType == this.nodeTypes.TAG; +// +// }; +// +// /** +// * Checks passed object for emptiness +// * @require ES5 - Object.keys +// * @param {object} +// */ +// core.isEmpty = function ( obj ) { +// +// return Object.keys(obj).length === 0; +// +// }; +// +// /** +// * Appends script to head of document +// * @return Promise +// */ +// core.importScript = function (scriptPath, instanceName) { +// +// return new Promise(function (resolve, reject) { +// +// let script; +// +// /** Script is already loaded */ +// if ( !instanceName ) { +// +// reject('Instance name is missed'); +// +// } else if ( document.getElementById(editor.scriptPrefix + instanceName) ) { +// +// resolve(scriptPath); +// +// } +// +// script = document.createElement('SCRIPT'); +// script.async = true; +// script.defer = true; +// script.id = editor.scriptPrefix + instanceName; +// +// script.onload = function () { +// +// resolve(scriptPath); +// +// }; +// +// script.onerror = function () { +// +// reject(scriptPath); +// +// }; +// +// script.src = scriptPath; +// document.head.appendChild(script); +// +// }); +// +// }; +// +// /** +// * Function for checking is it FormData object to send. +// * @param {Object} object to check +// * @return boolean +// */ +// var isFormData_ = function (object) { +// +// return object instanceof FormData; +// +// }; +// +// /** +// * Check block +// * @param target +// * @description Checks target is it native input +// */ +// core.isNativeInput = function (target) { +// +// var nativeInputAreas = ['INPUT', 'TEXTAREA']; +// +// return nativeInputAreas.indexOf(target.tagName) != -1; +// +// }; +// +// /** +// * Check if block is empty +// * We should check block textContent, child native inputs and some exceptions like IMG and IFRAME +// * +// * @param block +// * @returns {boolean} +// */ +// core.isBlockEmpty = function (block) { +// +// const EXCEPTION_TAGS = ['IMG', 'IFRAME']; +// +// var nativeInputs = block.querySelectorAll('textarea, input'), +// nativeInputsAreEmpty = true, +// textContentIsEmpty = !block.textContent.trim(); +// +// Array.prototype.forEach.call(nativeInputs, function (input) { +// +// if (input.type == 'textarea' || input.type == 'text') { +// +// nativeInputsAreEmpty = nativeInputsAreEmpty && !input.value.trim(); +// +// } +// +// }); +// +// return textContentIsEmpty && nativeInputsAreEmpty && !EXCEPTION_TAGS.includes(block.tagName); +// +// }; +// +// +// return core; +// +// })({}); diff --git a/src/components/dom.js b/src/components/dom.js new file mode 100644 index 00000000..5a9932b7 --- /dev/null +++ b/src/components/dom.js @@ -0,0 +1,361 @@ +/** + * DOM manipulations helper + */ +export default class Dom { + /** + * Check if passed tag has no closed tag + * @param {Element} tag + * @return {Boolean} + */ + static isSingleTag(tag) { + return tag.tagName && ['AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR'].includes(tag.tagName); + }; + + + /** + * Helper for making Elements with classname and attributes + * + * @param {string} tagName - new Element tag name + * @param {array|string} classNames - list or name of CSS classname(s) + * @param {Object} attributes - any attributes + * @return {Element} + */ + static make(tagName, classNames = null, attributes = {}) { + let el = document.createElement(tagName); + + if ( Array.isArray(classNames) ) { + el.classList.add(...classNames); + } else if( classNames ) { + el.classList.add(classNames); + } + + for (let attrName in attributes) { + el[attrName] = attributes[attrName]; + } + + return el; + } + + /** + * Creates Text Node with the passed content + * @param {String} content - text content + * @return {Text} + */ + static text(content) { + return document.createTextNode(content); + } + + /** + * Creates SVG icon linked to the sprite + * @param {string} name - name (id) of icon from sprite + * @param {number} width + * @param {number} height + * @return {SVGElement} + */ + static svg(name, width = 14, height = 14) { + let icon = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); + + icon.classList.add('icon', 'icon--' + name); + icon.setAttribute('width', width + 'px'); + icon.setAttribute('height', height + 'px'); + icon.innerHTML = ``; + + return icon; + } + + /** + * Append one or several elements to the parent + * + * @param {Element} parent - where to append + * @param {Element|Element[]} - element ore elements list + */ + static append(parent, elements) { + if ( Array.isArray(elements) ) { + elements.forEach( el => parent.appendChild(el) ); + } else { + parent.appendChild(elements); + } + } + + /** + * Swap two elements in parent + * @param {HTMLElement} el1 - from + * @param {HTMLElement} el2 - to + */ + static swap(el1, el2) { + // create marker element and insert it where el1 is + const temp = document.createElement('div'), + parent = el1.parentNode; + + parent.insertBefore(temp, el1); + + // move el1 to right before el2 + parent.insertBefore(el1, el2); + + // move el2 to right before where el1 used to be + parent.insertBefore(el2, temp); + + // remove temporary marker node + parent.removeChild(temp); + } + + /** + * Selector Decorator + * + * Returns first match + * + * @param {Element} el - element we searching inside. Default - DOM Document + * @param {String} selector - searching string + * + * @returns {Element} + */ + static find(el = document, selector) { + return el.querySelector(selector); + } + + /** + * Selector Decorator. + * + * Returns all matches + * + * @param {Element} el - element we searching inside. Default - DOM Document + * @param {String} selector - searching string + * @returns {NodeList} + */ + static findAll(el = document, selector) { + return el.querySelectorAll(selector); + } + + /** + * Search for deepest node which is Leaf. + * Leaf is the vertex that doesn't have any child nodes + * + * @description Method recursively goes throw the all Node until it finds the Leaf + * + * @param {Node} node - root Node. From this vertex we start Deep-first search {@link https://en.wikipedia.org/wiki/Depth-first_search} + * @param {Boolean} atLast - find last text node + * @return {Node} - it can be text Node or Element Node, so that caret will able to work with it + */ + static getDeepestNode(node, atLast = false) { + /** + * Current function have two directions: + * - starts from first child and every time gets first or nextSibling in special cases + * - starts from last child and gets last or previousSibling + * @type {string} + */ + let child = atLast ? 'lastChild' : 'firstChild', + sibling = atLast ? 'previousSibling' : 'nextSibling'; + + if (node && node.nodeType === Node.ELEMENT_NODE && node[child]) { + let nodeChild = node[child]; + + /** + * special case when child is single tag that can't contain any content + */ + if (Dom.isSingleTag(nodeChild)) { + /** + * 1) We need to check the next sibling. If it is Node Element then continue searching for deepest + * from sibling + * + * 2) If single tag's next sibling is null, then go back to parent and check his sibling + * In case of Node Element continue searching + * + * 3) If none of conditions above happened return parent Node Element + */ + if (nodeChild[sibling]) { + nodeChild = nodeChild[sibling]; + } else if (nodeChild.parentNode[sibling]) { + nodeChild = nodeChild.parentNode[sibling]; + } else { + return nodeChild.parentNode; + } + } + + return this.getDeepestNode(nodeChild, atLast); + } + + return node; + } + + /** + * Check if object is DOM node + * + * @param {Object} node + * @returns {boolean} + */ + static isElement(node) { + return node && typeof node === 'object' && node.nodeType && node.nodeType === Node.ELEMENT_NODE; + } + + /** + * Check if object is DocumentFragmemt node + * + * @param {Object} node + * @returns {boolean} + */ + static isFragment(node) { + return node && typeof node === 'object' && node.nodeType && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE; + } + + /** + * Checks target if it is native input + * @param {Element|String|Node} target - HTML element or string + * @return {Boolean} + */ + static isNativeInput(target) { + let nativeInputs = [ + 'INPUT', + 'TEXTAREA' + ]; + + return target ? nativeInputs.includes(target.tagName) : false; + } + + /** + * Checks node if it is empty + * + * @description Method checks simple Node without any childs for emptiness + * If you have Node with 2 or more children id depth, you better use {@link Dom#isEmpty} method + * + * @param {Node} node + * @return {Boolean} true if it is empty + */ + static isNodeEmpty(node) { + let nodeText; + + if ( this.isElement(node) && this.isNativeInput(node) ) { + nodeText = node.value; + } else { + nodeText = node.textContent.replace('\u200B', ''); + } + + return nodeText.trim().length === 0; + } + + /** + * checks node if it is doesn't have any child nodes + * @param {Node} node + * @return {boolean} + */ + static isLeaf(node) { + if (!node) { + return false; + } + + return node.childNodes.length === 0; + } + + /** + * breadth-first search (BFS) + * {@link https://en.wikipedia.org/wiki/Breadth-first_search} + * + * @description Pushes to stack all DOM leafs and checks for emptiness + * + * @param {Node} node + * @return {boolean} + */ + static isEmpty(node) { + let treeWalker = [], + leafs = []; + + if (!node) { + return true; + } + + if (!node.childNodes.length) { + return this.isNodeEmpty(node); + } + + treeWalker.push(node.firstChild); + + while ( treeWalker.length > 0 ) { + node = treeWalker.shift(); + + if (!node) continue; + + if ( this.isLeaf(node) ) { + leafs.push(node); + } else { + treeWalker.push(node.firstChild); + } + + while ( node && node.nextSibling ) { + node = node.nextSibling; + + if (!node) continue; + + treeWalker.push(node); + } + + /** + * If one of childs is not empty, checked Node is not empty too + */ + if (node && !this.isNodeEmpty(node)) { + return false; + } + } + + return leafs.every( leaf => this.isNodeEmpty(leaf) ); + } + + /** + * Check if string contains html elements + * + * @param string + * @returns {boolean} + */ + static isHTMLString(string) { + const wrapper = Dom.make('div'); + + wrapper.innerHTML = string; + + return wrapper.childElementCount > 0; + } + + /** + * Return array of names of block html elements + * + * @returns {string[]} + */ + static get blockElements() { + return [ + 'address', + 'article', + 'aside', + 'blockquote', + 'canvas', + 'div', + 'dl', + 'dt', + 'fieldset', + 'figcaption', + 'figure', + 'footer', + 'form', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'header', + 'hgroup', + 'hr', + 'li', + 'main', + 'nav', + 'noscript', + 'ol', + 'output', + 'p', + 'pre', + 'ruby', + 'section', + 'table', + 'tr', + 'tfoot', + 'ul', + 'video' + ]; + } +}; diff --git a/src/components/draw.js b/src/components/draw.js new file mode 100644 index 00000000..b08ab242 --- /dev/null +++ b/src/components/draw.js @@ -0,0 +1,154 @@ +/** + * Codex Editor Draw module + * + * @author Codex Team + * @version 1.0. + */ + +export default (function (draw) { + draw.ceBlock = function () { + var block = document.createElement('DIV'); + + block.className += 'ce_block'; + + return block; + }; + + /** + * Inline toolbar + */ + draw.inlineToolbar = function () { + var bar = document.createElement('DIV'); + + bar.className += 'ce-toolbar-inline'; + + return bar; + }; + + /** + * Wrapper for inline toobar buttons + */ + draw.inlineToolbarButtons = function () { + var wrapper = document.createElement('DIV'); + + wrapper.className += 'ce-toolbar-inline__buttons'; + + return wrapper; + }; + + /** + * For some actions + */ + draw.inlineToolbarActions = function () { + var wrapper = document.createElement('DIV'); + + wrapper.className += 'ce-toolbar-inline__actions'; + + return wrapper; + }; + + draw.inputForLink = function () { + var input = document.createElement('INPUT'); + + input.type = 'input'; + input.className += 'inputForLink'; + input.placeholder = 'Вставьте ссылку ...'; + input.setAttribute('form', 'defaultForm'); + + input.setAttribute('autofocus', 'autofocus'); + + return input; + }; + + /** + * @protected + * + * Draws tool buttons for toolbox + * + * @param {String} type + * @param {String} classname + * @returns {Element} + */ + draw.toolbarButton = function (type, classname) { + var button = document.createElement('li'), + toolIcon = document.createElement('i'), + toolTitle = document.createElement('span'); + + button.dataset.type = type; + button.setAttribute('title', type); + + toolIcon.classList.add(classname); + toolTitle.classList.add('ce_toolbar_tools--title'); + + + button.appendChild(toolIcon); + button.appendChild(toolTitle); + + return button; + }; + + /** + * @protected + * + * Draws tools for inline toolbar + * + * @param {String} type + * @param {String} classname + */ + draw.toolbarButtonInline = function (type, classname) { + var button = document.createElement('BUTTON'), + toolIcon = document.createElement('I'); + + button.type = 'button'; + button.dataset.type = type; + toolIcon.classList.add(classname); + + button.appendChild(toolIcon); + + return button; + }; + + /** + * Redactor block + */ + draw.block = function (tagName, content) { + var node = document.createElement(tagName); + + node.innerHTML = content || ''; + + return node; + }; + + /** + * Creates Node with passed tagName and className + * @param {string} tagName + * @param {string} className + * @param {object} properties - allow to assign properties + */ + draw.node = function ( tagName, className, properties ) { + var el = document.createElement( tagName ); + + if ( className ) el.className = className; + + if ( properties ) { + for (var name in properties) { + el[name] = properties[name]; + } + } + + return el; + }; + + /** + * Unavailable plugin block + */ + draw.unavailableBlock = function () { + var wrapper = document.createElement('DIV'); + + wrapper.classList.add('cdx-unavailable-block'); + + return wrapper; + }; + + return draw; +})({}); \ No newline at end of file diff --git a/src/components/inline-tools/inline-tool-bold.ts b/src/components/inline-tools/inline-tool-bold.ts new file mode 100644 index 00000000..1b57cb6e --- /dev/null +++ b/src/components/inline-tools/inline-tool-bold.ts @@ -0,0 +1,67 @@ +import InlineTool from '../interfaces/inline-tool'; + +declare var $: any; + +/** + * Bold Tool + * + * Inline Toolbar Tool + * + * Makes selected text bolder + */ +export default class BoldInlineTool implements InlineTool { + + /** + * Native Document's command that uses for Bold + */ + private readonly commandName: string = 'bold'; + + /** + * Styles + */ + private readonly CSS = { + button: 'ce-inline-tool', + buttonActive: 'ce-inline-tool--active', + buttonModifier: 'ce-inline-tool--bold', + }; + + /** + * Elements + */ + private nodes = { + button: null, + }; + + constructor(api) { + console.log('Bold Inline Tool is ready'); + } + + /** + * Create button for Inline Toolbar + */ + public render(): HTMLElement { + this.nodes.button = document.createElement('button'); + this.nodes.button.classList.add(this.CSS.button, this.CSS.buttonModifier); + this.nodes.button.appendChild($.svg('bold', 13, 15)); + return this.nodes.button; + } + + /** + * Wrap range with tag + * @param {Range} range + */ + public surround(range: Range): void { + document.execCommand(this.commandName); + } + + /** + * Check selection and set activated state to button if there are tag + * @param {Selection} selection + */ + public checkState(selection: Selection): boolean { + const isActive = document.queryCommandState(this.commandName); + + this.nodes.button.classList.toggle(this.CSS.buttonActive, isActive); + return isActive; + } +} diff --git a/src/components/inline-tools/inline-tool-italic.ts b/src/components/inline-tools/inline-tool-italic.ts new file mode 100644 index 00000000..19d4bdda --- /dev/null +++ b/src/components/inline-tools/inline-tool-italic.ts @@ -0,0 +1,67 @@ +import InlineTool from '../interfaces/inline-tool'; + +declare var $: any; + +/** + * Italic Tool + * + * Inline Toolbar Tool + * + * Style selected text with italic + */ +export default class ItalicInlineTool implements InlineTool { + + /** + * Native Document's command that uses for Italic + */ + private readonly commandName: string = 'italic'; + + /** + * Styles + */ + private readonly CSS = { + button: 'ce-inline-tool', + buttonActive: 'ce-inline-tool--active', + buttonModifier: 'ce-inline-tool--italic', + }; + + /** + * Elements + */ + private nodes = { + button: null, + }; + + constructor(api) { + console.log('Italic Inline Tool is ready'); + } + + /** + * Create button for Inline Toolbar + */ + public render(): HTMLElement { + this.nodes.button = document.createElement('button'); + this.nodes.button.classList.add(this.CSS.button, this.CSS.buttonModifier); + this.nodes.button.appendChild($.svg('italic', 6, 15)); + return this.nodes.button; + } + + /** + * Wrap range with tag + * @param {Range} range + */ + public surround(range: Range): void { + document.execCommand(this.commandName); + } + + /** + * Check selection and set activated state to button if there are tag + * @param {Selection} selection + */ + public checkState(selection: Selection): boolean { + const isActive = document.queryCommandState(this.commandName); + + this.nodes.button.classList.toggle(this.CSS.buttonActive, isActive); + return isActive; + } +} diff --git a/src/components/inline-tools/inline-tool-link.ts b/src/components/inline-tools/inline-tool-link.ts new file mode 100644 index 00000000..49e1df68 --- /dev/null +++ b/src/components/inline-tools/inline-tool-link.ts @@ -0,0 +1,311 @@ +import InlineTool from '../interfaces/inline-tool'; +import Selection from '../selection'; + +declare var $: any; +declare var _: any; + +/** + * Link Tool + * + * Inline Toolbar Tool + * + * Wrap selected text with tag + */ +export default class LinkInlineTool implements InlineTool { + + /** + * Native Document's commands for link/unlink + */ + private readonly commandLink: string = 'createLink'; + private readonly commandUnlink: string = 'unlink'; + + /** + * Enter key code + */ + private readonly ENTER_KEY: number = 13; + + /** + * Styles + */ + private readonly CSS = { + button: 'ce-inline-tool', + buttonActive: 'ce-inline-tool--active', + buttonModifier: 'ce-inline-tool--link', + buttonUnlink: 'ce-inline-tool--unlink', + input: 'ce-inline-tool-input', + inputShowed: 'ce-inline-tool-input--showed', + }; + + /** + * Elements + */ + private nodes = { + button: null, + input: null, + }; + + /** + * Selection instance + */ + private selection: Selection; + + /** + * Input opening state + */ + private inputOpened: boolean = false; + + /** + * Available Inline Toolbar methods (open/close) + */ + private inlineToolbar: any; + + /** + * @param {object} api - CodeX Editor API + * @param {object} api.toolbar - Inline Toolbar API + */ + constructor(api) { + this.inlineToolbar = api.toolbar; + this.selection = new Selection(); + } + + /** + * Create button for Inline Toolbar + */ + public render(): HTMLElement { + this.nodes.button = document.createElement('button'); + this.nodes.button.classList.add(this.CSS.button, this.CSS.buttonModifier); + this.nodes.button.appendChild($.svg('link', 15, 14)); + this.nodes.button.appendChild($.svg('unlink', 16, 18)); + return this.nodes.button; + } + + /** + * Input for the link + */ + public renderActions(): HTMLElement { + this.nodes.input = document.createElement('input'); + this.nodes.input.placeholder = 'Add a link'; + this.nodes.input.classList.add(this.CSS.input); + this.nodes.input.addEventListener('keydown', (event) => { + if (event.keyCode === this.ENTER_KEY ) { + this.enterPressed(event); + } + }); + return this.nodes.input; + } + + /** + * Handle clicks on the Inline Toolbar icon + * @param {Range} range + */ + public surround(range: Range): void { + /** + * Range will be null when user makes second click on the 'link icon' to close opened input + */ + if (range) { + /** + * Save selection before change focus to the input + */ + this.selection.save(); + const parentAnchor = this.selection.findParentTag('A'); + + /** + * Unlink icon pressed + */ + if (parentAnchor) { + this.selection.expandToTag(parentAnchor); + this.unlink(); + this.closeActions(); + this.checkState(); + this.inlineToolbar.close(); + return; + } + } + + this.toggleActions(); + } + + /** + * Check selection and set activated state to button if there are tag + * @param {Selection} selection + */ + public checkState(selection?: Selection): boolean { + const anchorTag = this.selection.findParentTag('A'); + + if (anchorTag) { + this.nodes.button.classList.add(this.CSS.buttonUnlink); + this.nodes.button.classList.add(this.CSS.buttonActive); + this.openActions(); + + /** + * Fill input value with link href + */ + const hrefAttr = anchorTag.getAttribute('href'); + this.nodes.input.value = hrefAttr !== 'null' ? hrefAttr : ''; + + this.selection.save(); + } else { + this.nodes.button.classList.remove(this.CSS.buttonUnlink); + this.nodes.button.classList.remove(this.CSS.buttonActive); + } + + return !!anchorTag; + } + + /** + * Function called with Inline Toolbar closing + */ + public clear(): void { + this.closeActions(); + } + + private toggleActions(): void { + if (!this.inputOpened) { + this.openActions(true); + } else { + this.closeActions(false); + } + } + + /** + * @param {boolean} needFocus - on link creation we need to focus input. On editing - nope. + */ + private openActions(needFocus: boolean = false): void { + this.nodes.input.classList.add(this.CSS.inputShowed); + if (needFocus) { + this.nodes.input.focus(); + } + this.inputOpened = true; + } + + /** + * Close input + * @param {boolean} clearSavedSelection — we don't need to clear saved selection + * on toggle-clicks on the icon of opened Toolbar + */ + private closeActions(clearSavedSelection: boolean = true): void { + this.nodes.input.classList.remove(this.CSS.inputShowed); + this.nodes.input.value = ''; + if (clearSavedSelection) { + this.selection.clearSaved(); + } + this.inputOpened = false; + } + + /** + * Enter pressed on input + * @param {KeyboardEvent} event + */ + private enterPressed(event: KeyboardEvent): void { + let value = this.nodes.input.value || ''; + + if (!value.trim()) { + this.selection.restore(); + this.unlink(); + event.preventDefault(); + this.closeActions(); + } + + if (!this.validateURL(value)) { + /** + * @todo show notification 'Incorrect Link' + */ + _.log('Incorrect Link pasted', 'warn', value); + return; + } + + value = this.prepareLink(value); + + this.selection.restore(); + this.insertLink(value); + + /** + * Preventing events that will be able to happen + */ + event.preventDefault(); + event.stopPropagation(); + event.stopImmediatePropagation(); + + this.closeActions(); + this.inlineToolbar.close(); + this.checkState(); + } + + /** + * Detects if passed string is URL + * @param {string} str + * @return {Boolean} + */ + private validateURL(str: string): boolean { + /** + * Don't allow spaces + */ + return !/\s/.test(str); + } + + /** + * Process link before injection + * - sanitize + * - add protocol for links like 'google.com' + * @param {string} link - raw user input + */ + private prepareLink(link: string): string { + link = link.trim(); + link = this.addProtocol(link); + return link; + } + + /** + * Add 'http' protocol to the links like 'vc.ru', 'google.com' + * @param {String} link + */ + private addProtocol(link: string): string { + /** + * If protocol already exists, do nothing + */ + if (/^(\w+):\/\//.test(link)) { + return link; + } + + /** + * We need to add missed HTTP protocol to the link, but skip 2 cases: + * 1) Internal links like "/general" + * 2) Anchors looks like "#results" + * 3) Protocol-relative URLs like "//google.com" + */ + const isInternal = /^\/[^\/\s]/.test(link), + isAnchor = link.substring(0, 1) === '#', + isProtocolRelative = /^\/\/[^\/\s]/.test(link); + + if (!isInternal && !isAnchor && !isProtocolRelative) { + link = 'http://' + link; + } + + return link; + } + + /** + * Inserts tag with "href" + * @param {string} link - "href" value + */ + private insertLink(link: string): void { + + /** + * Edit all link, not selected part + */ + const anchorTag = this.selection.findParentTag('A'); + + if (anchorTag) { + this.selection.expandToTag(anchorTag); + } + + document.execCommand(this.commandLink, false, link); + } + + /** + * Removes tag + */ + private unlink(): void { + document.execCommand(this.commandUnlink); + } +} diff --git a/src/components/interfaces/api.ts b/src/components/interfaces/api.ts new file mode 100644 index 00000000..6b1d1f8b --- /dev/null +++ b/src/components/interfaces/api.ts @@ -0,0 +1,179 @@ +import IInputOutputData from './input-output-data'; + +/** + * CodeX Editor Public API + * + * @copyright 2018 + */ +export interface IAPI { + blocks: IBlocksAPI; + caret: ICaretAPI; + events: IEventsAPI; + sanitizer: ISanitizerAPI; + saver: ISaverAPI; + selection: ISelectionAPI; + toolbar: IToolbarAPI; + listener: IListenerAPI; +} + +/** + * Working with Blocks list: moving, removing, etc + */ +export interface IBlocksAPI { + + /** + * Clears Blocks list + */ + clear: () => void; + + /** + * Fills editor with Blocks data + */ + render: (data: IInputOutputData) => void; + + /** + * Removes block + */ + delete: (blockIndex?: number) => void; + + /** + * Swap two Blocks by positions + * @param {number} fromIndex - position of first Block + * @param {number} toIndex - position of second Block + */ + swap: (fromIndex: number, toIndex: number) => void; + + /** + * Returns block by passed index + * + * @param {Number} index - needed block with index + * @return {object} + */ + getBlockByIndex: (index: number) => object; + + /** + * Returns current block index + * @return {number} + */ + getCurrentBlockIndex: () => number; + + /** + * Returns Block's count + * @return {number} + */ + getBlocksCount: () => number; +} + +/** + * Methods for working with Caret + */ +export interface ICaretAPI {} + +/** + * Events Module API methods + */ +export interface IEventsAPI { + + /** + * Subsribe on events + */ + on: (eventName: string, callback: () => void) => void; + + /** + * Trigger subsribed callbacks + */ + emit: (eventName: string, data: object) => void; + + /** + * Unsubsribe callback + */ + off: (eventName: string, callback: () => void) => void; +} + +/** + * Sanitizer's methods + */ +export interface ISanitizerAPI { + + /** + * Clean taint string from disallowed tags and attributes + * + * @param taintString + * @param config + */ + clean: (taintString, config?) => string; +} + +/** + * Saver's methods + */ +export interface ISaverAPI { + /** + * Return current blocks + * + * @return {IInputOutputData} + */ + save: () => IInputOutputData; +} + +/** + * Selection's methods + */ +export interface ISelectionAPI { + + /** + * Looks ahead to find passed tag from current selection + * + * @param {String} tagName + * @param {String} className + */ + findParentTag: (tagName: string, className: string) => HTMLElement|null; + + /** + * Expands selection range to the passed parent node + * + * @param {HTMLElement} node + */ + expandToTag: (node: HTMLElement) => void; +} + +/** + * Toolbar's methods + * Basic toolbar methods + */ +export interface IToolbarAPI { + + /** + * Opens only toolbar + */ + open: () => void; + + /** + * Closes toolbar. If toolbox or toolbar-blockSettings are opened then they will be closed too + */ + close: () => void; +} + +/** + * DOM Listener API + */ +export interface IListenerAPI { + + /** + * Adds event listener + * @param {HTMLElement} element + * @param {string} eventType + * @param {() => void} handler + * @param useCapture + * @return {boolean} + */ + on: (element: HTMLElement, eventType: string, handler: () => void, useCapture: boolean) => void; + + /** + * Remove event listener + * @param {HTMLElement} element + * @param {string} eventType + * @param {() => void} handler + */ + off: (element: HTMLElement, eventType: string, handler: () => void) => void; +} diff --git a/src/components/interfaces/block-tool.ts b/src/components/interfaces/block-tool.ts new file mode 100644 index 00000000..12221337 --- /dev/null +++ b/src/components/interfaces/block-tool.ts @@ -0,0 +1,69 @@ +import IEditorConfig from "./editor-config"; + +/** + * Describe Block Tool object + * @see {@link docs/tools.md} + */ +export interface IBlockTool { + + /** + * Should this tools be displayed at the Editor's Toolbox + * @return {boolean} + */ + displayInToolbox(): boolean; + + /** + * Class for the Toolbox icon + * @return {string} + */ + iconClassName(): string; + + /** + * Tool's SVG icon for Toolbox + * @return {string} + */ + toolboxIcon(): string; + + /** + * Create Block's settings block + * @return {HTMLElement} + */ + renderSettings(): HTMLElement; + + /** + * Return Tool's main block-wrapper + * @return {HTMLElement} + */ + render(): HTMLElement; + + /** + * Process Tool's element in DOM and return raw data + * @param {HTMLElement} block - element created by {@link IBlockTool#render} function + * @return {IBlockToolData} + */ + save(block: HTMLElement): IBlockToolData; + + /** + * Method that specified how to merge two Text blocks. + * Called by CodeX Editor by backspace at the beginning of the Block + * @param {IBlockToolData} blockData + */ + merge(blockData: IBlockToolData): void; + + /** + * Validate Block's data + * @param {IBlockToolData} blockData + * @return {boolean} + */ + validate(blockData: IBlockToolData): boolean; +} + +/** + * Object returned by Tool's {@link IBlockTool#save} method + */ +export interface IBlockToolData {} + +/** + * Object passed to the Tool's constructor by {@link IEditorConfig#toolsConfig} + */ +export interface IBlockToolConfig {} diff --git a/src/components/interfaces/block-tune.ts b/src/components/interfaces/block-tune.ts new file mode 100644 index 00000000..b5b74211 --- /dev/null +++ b/src/components/interfaces/block-tune.ts @@ -0,0 +1,24 @@ +/** + * BlockTune interface + * + * All tunes must implement this interface + */ +export default interface IBlockTune { + + /** + * Settings will be described later + */ + settings?: object; + + /** + * Returns tune button that will be appended in default settings area + */ + render(): HTMLElement; + + /** + * handle Click event + * @param {MouseEvent} event + * @param {HTMLElement} button + */ + handleClick(event: MouseEvent, button: HTMLElement): void; +} diff --git a/src/components/interfaces/editor-config.ts b/src/components/interfaces/editor-config.ts new file mode 100644 index 00000000..698efafa --- /dev/null +++ b/src/components/interfaces/editor-config.ts @@ -0,0 +1,53 @@ +import {IBlockTool} from './block-tool'; +import {IBlockToolConfig} from './block-tool'; +import ISanitizerConfig from './sanitizer-config'; +import IInputOutputData from './input-output-data'; + +/** + * Editor Instance config + */ +export default interface IEditorConfig { + + /** + * Element to append Editor + */ + holderId: string; + + /** + * Blocks list in JSON-format + */ + data: IInputOutputData; + + /** + * Map of used Tools + */ + tools: {[toolName: string]: IBlockTool}; + + /** + * Tools configuration + * @see {@link tools#ToolConfig} + */ + toolsConfig: {[toolName: string]: IBlockToolConfig}; + + /** + * This Tool will be added by default + * Name should be equal a one Tool's key of Editor's Tools + */ + initialBlock: string; + + /** + * First Block placeholder + */ + placeholder: string; + + /** + * Define tags not to be stripped off while pasting + * @see {@link sanitizer} + */ + sanitizer: ISanitizerConfig; + + /** + * Do not show toolbar + */ + hideToolbar: boolean; +} diff --git a/src/components/interfaces/editor.ts b/src/components/interfaces/editor.ts new file mode 100644 index 00000000..fee6b9e3 --- /dev/null +++ b/src/components/interfaces/editor.ts @@ -0,0 +1,53 @@ +import BlockEvents from '../modules/block-events'; +import InlineToolbar from '../modules/toolbar-inline'; +import ListenerAPI from '../modules/api-listener'; +import Module from '../__module'; +import SanitizerAPI from '../modules/api-sanitizer'; +import SaverAPI from '../modules/api-saver'; +import SelectionAPI from '../modules/api-selection'; +import ToolbarAPI from '../modules/api-toolbar'; +import API from '../modules/api'; + +export default interface IEditor { + API: API; + + BlockEvents: BlockEvents; + + BlockSettings: Module; // @todo create interface + + BlocksAPI: Module; // @todo create interface + + Caret: Module; // @todo create interface + + Events: Module; // @todo create interface + + EventsAPI: Module; // @todo create interface + + InlineToolbar: InlineToolbar; + + ListenerAPI: ListenerAPI; + + Listeners: Module; // @todo create interface + + Renderer: Module; // @todo create interface + + Sanitizer: Module; // @todo create interface + + SanitizerAPI: SanitizerAPI; + + Saver: Module; // @todo create interface + + SaverAPI: SaverAPI; + + SelectionAPI: SelectionAPI; + + Toolbar: Module; // @todo create interface + + ToolbarAPI: ToolbarAPI; + + Toolbox: Module; // @todo create interface + + Tools: Module; // @todo create interface + + UI: Module; // @todo create interface +} diff --git a/src/components/interfaces/inline-tool.ts b/src/components/interfaces/inline-tool.ts new file mode 100644 index 00000000..0986def8 --- /dev/null +++ b/src/components/interfaces/inline-tool.ts @@ -0,0 +1,63 @@ +/** + * Base structure for the Inline Toolbar Tool + */ +export default interface InlineTool { + /** + * Returns button for the Inline Toolbar + */ + render(): HTMLElement; + + /** + * Make additional element with actions + * For example, input for the 'link' tool or textarea for the 'comment' tool + */ + renderActions?(): HTMLElement; + + /** + * Method that accepts selected range and wrap it somehow + * @param {Range} range - selection's range + */ + surround(range: Range): void; + + /** + * Get Selection and detect if Tool was applied + * For example, after that Tool can highlight button or show some details + * @param {Selection} selection - current Selection + */ + checkState(selection: Selection): boolean; + + /** + * Function called with Inline Toolbar closing + */ + clear?(): void; + + /** + * Allow Tool to determine shortcut that will fire 'surround' method + */ + shortcut?(): Shortcut; +} + +/** + * Specify Shortcut structure for the Inline Tools + */ +interface Shortcut { + /** + * Name like 'CMD+I' + */ + readonly name: string; + + /** + * Key that activates the Shortcut, for example: 73 + */ + readonly keyCode: number; + + /** + * Is need to CMD or CTRL should be pressed + */ + readonly cmdKey: boolean; + + /** + * Is need to ALT should be pressed + */ + readonly altKey: boolean; +} diff --git a/src/components/interfaces/input-output-data.ts b/src/components/interfaces/input-output-data.ts new file mode 100644 index 00000000..7d4c18dc --- /dev/null +++ b/src/components/interfaces/input-output-data.ts @@ -0,0 +1,18 @@ +import {IBlockToolData} from './block-tool'; + +/** + * Interface represents input CodeX Editor data + * that passed with initial configuration object as 'data' key + */ +export default interface IInputOutputData { + + /** + * Saved Blocks + */ + readonly items: IBlockToolData[]; + + /** + * Article id. Optional + */ + readonly id?: number|string; +} diff --git a/src/components/interfaces/module-config.ts b/src/components/interfaces/module-config.ts new file mode 100644 index 00000000..6afa04f3 --- /dev/null +++ b/src/components/interfaces/module-config.ts @@ -0,0 +1,12 @@ +import IEditorConfig from './editor-config'; + +/** + * Internal Module's construction parameters + */ +export default interface IModuleConfig { + + /** + * Editor's config + */ + config: IEditorConfig; +} diff --git a/src/components/interfaces/sanitizer-config.ts b/src/components/interfaces/sanitizer-config.ts new file mode 100644 index 00000000..f9ddc749 --- /dev/null +++ b/src/components/interfaces/sanitizer-config.ts @@ -0,0 +1,35 @@ +export default interface ISanitizerConfig { + /** + * Tag name and params not to be stripped off + * @see {@link https://github.com/guardian/html-janitor} + * + * @example Save P tags + * p: true + * + * @example Save A tags and do not strip HREF attribute + * a: { + * href: true + * } + * + * @example Save A tags with TARGET="_blank" attribute + * a: function (aTag) { + * return aTag.target === '_black'; + * } + * + * @example Save U tags that are not empty + * u: function(el){ + * return el.textContent !== ''; + * } + * + * @example For blockquote with class 'indent' save CLASS and STYLE attributes + * Otherwise strip all attributes + * blockquote: function(el) { + * if (el.classList.contains('indent')) { + * return { 'class': true, 'style': true }; + * } else { + * return {}; + * } + * } + */ + [key: string]: boolean|object|(() => any); +} diff --git a/src/components/modules/_anchors.js b/src/components/modules/_anchors.js new file mode 100644 index 00000000..00defbd4 --- /dev/null +++ b/src/components/modules/_anchors.js @@ -0,0 +1,70 @@ +/** + * Codex Editor Anchors module + * + * @author Codex Team + * @version 1.0 + */ + +module.exports = function (anchors) { + let editor = codex.editor; + + anchors.input = null; + anchors.currentNode = null; + + anchors.settingsOpened = function (currentBlock) { + anchors.currentNode = currentBlock; + anchors.input.value = anchors.currentNode.dataset.anchor || ''; + }; + + anchors.anchorChanged = function (e) { + var newAnchor = e.target.value = anchors.rusToTranslit(e.target.value); + + anchors.currentNode.dataset.anchor = newAnchor; + + if (newAnchor.trim() !== '') { + anchors.currentNode.classList.add(editor.ui.className.BLOCK_WITH_ANCHOR); + } else { + anchors.currentNode.classList.remove(editor.ui.className.BLOCK_WITH_ANCHOR); + } + }; + + anchors.keyDownOnAnchorInput = function (e) { + if (e.keyCode == editor.core.keys.ENTER) { + e.preventDefault(); + e.stopPropagation(); + + e.target.blur(); + editor.toolbar.settings.close(); + } + }; + + anchors.keyUpOnAnchorInput = function (e) { + if (e.keyCode >= editor.core.keys.LEFT && e.keyCode <= editor.core.keys.DOWN) { + e.stopPropagation(); + } + }; + + anchors.rusToTranslit = function (string) { + var ru = [ + 'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', + 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', + 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ь', 'Ы', 'Ь', 'Э', 'Ю', 'Я' + ], + en = [ + 'A', 'B', 'V', 'G', 'D', 'E', 'E', 'Zh', 'Z', 'I', 'Y', + 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', + 'H', 'C', 'Ch', 'Sh', 'Sch', '', 'Y', '', 'E', 'Yu', 'Ya' + ]; + + for (var i = 0; i < ru.length; i++) { + string = string.split(ru[i]).join(en[i]); + string = string.split(ru[i].toLowerCase()).join(en[i].toLowerCase()); + } + + string = string.replace(/[^0-9a-zA-Z_]+/g, '-'); + + return string; + }; + + return anchors; +}({}); \ No newline at end of file diff --git a/src/components/modules/_callbacks.js b/src/components/modules/_callbacks.js new file mode 100644 index 00000000..a1407674 --- /dev/null +++ b/src/components/modules/_callbacks.js @@ -0,0 +1,744 @@ +/** + * @module Codex Editor Callbacks module + * @description Module works with editor added Elements + * + * @author Codex Team + * @version 1.4.0 + */ + +module.exports = (function (callbacks) { + let editor = codex.editor; + + /** + * used by UI module + * @description Routes all keydowns on document + * @param {Object} event + */ + callbacks.globalKeydown = function (event) { + switch (event.keyCode) { + case editor.core.keys.ENTER : enterKeyPressed_(event); break; + } + }; + + /** + * used by UI module + * @description Routes all keydowns on redactors area + * @param {Object} event + */ + callbacks.redactorKeyDown = function (event) { + switch (event.keyCode) { + case editor.core.keys.TAB : tabKeyPressedOnRedactorsZone_(event); break; + case editor.core.keys.ENTER : enterKeyPressedOnRedactorsZone_(event); break; + case editor.core.keys.ESC : escapeKeyPressedOnRedactorsZone_(event); break; + default : defaultKeyPressedOnRedactorsZone_(event); break; + } + }; + + /** + * used by UI module + * @description Routes all keyup events + * @param {Object} event + */ + callbacks.globalKeyup = function (event) { + switch (event.keyCode) { + case editor.core.keys.UP : + case editor.core.keys.LEFT : + case editor.core.keys.RIGHT : + case editor.core.keys.DOWN : arrowKeyPressed_(event); break; + } + }; + + /** + * @param {Object} event + * @private + * + * Handles behaviour when tab pressed + * @description if Content is empty show toolbox (if it is closed) or leaf tools + * uses Toolbars toolbox module to handle the situation + */ + var tabKeyPressedOnRedactorsZone_ = function (event) { + /** + * Wait for solution. Would like to know the behaviour + * @todo Add spaces + */ + event.preventDefault(); + + + if (!editor.core.isBlockEmpty(editor.content.currentNode)) { + return; + } + + if ( !editor.toolbar.opened ) { + editor.toolbar.open(); + } + + if (editor.toolbar.opened && !editor.toolbar.toolbox.opened) { + editor.toolbar.toolbox.open(); + } else { + editor.toolbar.toolbox.leaf(); + } + }; + + /** + * Handles global EnterKey Press + * @see enterPressedOnBlock_ + * @param {Object} event + */ + var enterKeyPressed_ = function () { + if (editor.content.editorAreaHightlighted) { + /** + * it means that we lose input index, saved index before is not correct + * therefore we need to set caret when we insert new block + */ + editor.caret.inputIndex = -1; + + enterPressedOnBlock_(); + } + }; + + /** + * Callback for enter key pressing in first-level block area + * + * @param {Event} event + * @private + * + * @description Inserts new block with initial type from settings + */ + var enterPressedOnBlock_ = function () { + var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; + + editor.content.insertBlock({ + type : NEW_BLOCK_TYPE, + block : editor.tools[NEW_BLOCK_TYPE].render() + }, true ); + + editor.toolbar.move(); + editor.toolbar.open(); + }; + + + /** + * ENTER key handler + * + * @param {Object} event + * @private + * + * @description Makes new block with initial type from settings + */ + var enterKeyPressedOnRedactorsZone_ = function (event) { + if (event.target.contentEditable == 'true') { + /** Update input index */ + editor.caret.saveCurrentInputIndex(); + } + + var currentInputIndex = editor.caret.getCurrentInputIndex() || 0, + workingNode = editor.content.currentNode, + tool = workingNode.dataset.tool, + isEnterPressedOnToolbar = editor.toolbar.opened && + editor.toolbar.current && + event.target == editor.state.inputs[currentInputIndex]; + + /** The list of tools which needs the default browser behaviour */ + var enableLineBreaks = editor.tools[tool].enableLineBreaks; + + /** This type of block creates when enter is pressed */ + var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; + + /** + * When toolbar is opened, select tool instead of making new paragraph + */ + if ( isEnterPressedOnToolbar ) { + event.preventDefault(); + + editor.toolbar.toolbox.toolClicked(event); + + editor.toolbar.close(); + + /** + * Stop other listeners callback executions + */ + event.stopPropagation(); + event.stopImmediatePropagation(); + + return; + } + + /** + * Allow paragraph lineBreaks with shift enter + * Or if shiftkey pressed and enter and enabledLineBreaks, the let new block creation + */ + if ( event.shiftKey || enableLineBreaks ) { + event.stopPropagation(); + event.stopImmediatePropagation(); + return; + } + + var currentSelection = window.getSelection(), + currentSelectedNode = currentSelection.anchorNode, + caretAtTheEndOfText = editor.caret.position.atTheEnd(), + isTextNodeHasParentBetweenContenteditable = false; + + /** + * Allow making new

        in same block by SHIFT+ENTER and forbids to prevent default browser behaviour + */ + if ( event.shiftKey && !enableLineBreaks ) { + editor.callback.enterPressedOnBlock(editor.content.currentBlock, event); + event.preventDefault(); + return; + } + + /** + * Workaround situation when caret at the Text node that has some wrapper Elements + * Split block cant handle this. + * We need to save default behavior + */ + isTextNodeHasParentBetweenContenteditable = currentSelectedNode && currentSelectedNode.parentNode.contentEditable != 'true'; + + /** + * Split blocks when input has several nodes and caret placed in textNode + */ + if ( + currentSelectedNode.nodeType == editor.core.nodeTypes.TEXT && + !isTextNodeHasParentBetweenContenteditable && + !caretAtTheEndOfText + ) { + event.preventDefault(); + + editor.core.log('Splitting Text node...'); + + editor.content.splitBlock(currentInputIndex); + + /** Show plus button when next input after split is empty*/ + if (!editor.state.inputs[currentInputIndex + 1].textContent.trim()) { + editor.toolbar.showPlusButton(); + } + } else { + var islastNode = editor.content.isLastNode(currentSelectedNode); + + if ( islastNode && caretAtTheEndOfText ) { + event.preventDefault(); + event.stopPropagation(); + event.stopImmediatePropagation(); + + editor.core.log('ENTER clicked in last textNode. Create new BLOCK'); + + editor.content.insertBlock({ + type: NEW_BLOCK_TYPE, + block: editor.tools[NEW_BLOCK_TYPE].render() + }, true); + + editor.toolbar.move(); + editor.toolbar.open(); + + /** Show plus button with empty block */ + editor.toolbar.showPlusButton(); + } + } + + /** get all inputs after new appending block */ + editor.ui.saveInputs(); + }; + + /** + * Escape behaviour + * @param event + * @private + * + * @description Closes toolbox and toolbar. Prevents default behaviour + */ + var escapeKeyPressedOnRedactorsZone_ = function (event) { + /** Close all toolbar */ + editor.toolbar.close(); + + /** Close toolbox */ + editor.toolbar.toolbox.close(); + + event.preventDefault(); + }; + + /** + * @param {Event} event + * @private + * + * closes and moves toolbar + */ + var arrowKeyPressed_ = function (event) { + editor.content.workingNodeChanged(); + + /* Closing toolbar */ + editor.toolbar.close(); + editor.toolbar.move(); + }; + + /** + * @private + * @param {Event} event + * + * @description Closes all opened bars from toolbar. + * If block is mark, clears highlightning + */ + var defaultKeyPressedOnRedactorsZone_ = function () { + editor.toolbar.close(); + + if (!editor.toolbar.inline.actionsOpened) { + editor.toolbar.inline.close(); + editor.content.clearMark(); + } + }; + + /** + * Handler when clicked on redactors area + * + * @protected + * @param event + * + * @description Detects clicked area. If it is first-level block area, marks as detected and + * on next enter press will be inserted new block + * Otherwise, save carets position (input index) and put caret to the editable zone. + * + * @see detectWhenClickedOnFirstLevelBlockArea_ + * + */ + callbacks.redactorClicked = function (event) { + detectWhenClickedOnFirstLevelBlockArea_(); + + editor.content.workingNodeChanged(event.target); + editor.ui.saveInputs(); + + var selectedText = editor.toolbar.inline.getSelectionText(), + firstLevelBlock; + + /** If selection range took off, then we hide inline toolbar */ + if (selectedText.length === 0) { + editor.toolbar.inline.close(); + } + + /** Update current input index in memory when caret focused into existed input */ + if (event.target.contentEditable == 'true') { + editor.caret.saveCurrentInputIndex(); + } + + if (editor.content.currentNode === null) { + /** + * If inputs in redactor does not exits, then we put input index 0 not -1 + */ + var indexOfLastInput = editor.state.inputs.length > 0 ? editor.state.inputs.length - 1 : 0; + + /** If we have any inputs */ + if (editor.state.inputs.length) { + /** getting firstlevel parent of input */ + firstLevelBlock = editor.content.getFirstLevelBlock(editor.state.inputs[indexOfLastInput]); + } + + /** If input is empty, then we set caret to the last input */ + if (editor.state.inputs.length && editor.state.inputs[indexOfLastInput].textContent === '' && firstLevelBlock.dataset.tool == editor.settings.initialBlockPlugin) { + editor.caret.setToBlock(indexOfLastInput); + } else { + /** Create new input when caret clicked in redactors area */ + var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; + + editor.content.insertBlock({ + type : NEW_BLOCK_TYPE, + block : editor.tools[NEW_BLOCK_TYPE].render() + }); + + /** If there is no inputs except inserted */ + if (editor.state.inputs.length === 1) { + editor.caret.setToBlock(indexOfLastInput); + } else { + /** Set caret to this appended input */ + editor.caret.setToNextBlock(indexOfLastInput); + } + } + } else { + /** Close all panels */ + editor.toolbar.settings.close(); + editor.toolbar.toolbox.close(); + } + + /** + * Move toolbar and open + */ + editor.toolbar.move(); + editor.toolbar.open(); + + var inputIsEmpty = !editor.content.currentNode.textContent.trim(), + currentNodeType = editor.content.currentNode.dataset.tool, + isInitialType = currentNodeType == editor.settings.initialBlockPlugin; + + + /** Hide plus buttons */ + editor.toolbar.hidePlusButton(); + + if (!inputIsEmpty) { + /** Mark current block */ + editor.content.markBlock(); + } + + if ( isInitialType && inputIsEmpty ) { + /** Show plus button */ + editor.toolbar.showPlusButton(); + } + }; + + /** + * This method allows to define, is caret in contenteditable element or not. + * + * @private + * + * @description Otherwise, if we get TEXT node from range container, that will means we have input index. + * In this case we use default browsers behaviour (if plugin allows that) or overwritten action. + * Therefore, to be sure that we've clicked first-level block area, we should have currentNode, which always + * specifies to the first-level block. Other cases we just ignore. + */ + var detectWhenClickedOnFirstLevelBlockArea_ = function () { + var selection = window.getSelection(), + anchorNode = selection.anchorNode, + flag = false; + + if (selection.rangeCount === 0) { + editor.content.editorAreaHightlighted = true; + } else { + if (!editor.core.isDomNode(anchorNode)) { + anchorNode = anchorNode.parentNode; + } + + /** Already founded, without loop */ + if (anchorNode.contentEditable == 'true') { + flag = true; + } + + while (anchorNode.contentEditable != 'true') { + anchorNode = anchorNode.parentNode; + + if (anchorNode.contentEditable == 'true') { + flag = true; + } + + if (anchorNode == document.body) { + break; + } + } + + /** If editable element founded, flag is "TRUE", Therefore we return "FALSE" */ + editor.content.editorAreaHightlighted = !flag; + } + }; + + /** + * Toolbar button click handler + * + * @param {Object} event - cursor to the button + * @protected + * + * @description gets current tool and calls render method + */ + callbacks.toolbarButtonClicked = function (event) { + var button = this; + + editor.toolbar.current = button.dataset.type; + + editor.toolbar.toolbox.toolClicked(event); + editor.toolbar.close(); + }; + + /** + * Show or Hide toolbox when plus button is clicked + */ + callbacks.plusButtonClicked = function () { + if (!editor.nodes.toolbox.classList.contains('opened')) { + editor.toolbar.toolbox.open(); + } else { + editor.toolbar.toolbox.close(); + } + }; + + /** + * Block handlers for KeyDown events + * + * @protected + * @param {Object} event + * + * Handles keydowns on block + * @see blockRightOrDownArrowPressed_ + * @see backspacePressed_ + * @see blockLeftOrUpArrowPressed_ + */ + callbacks.blockKeydown = function (event) { + let block = event.target; // event.target is input + + switch (event.keyCode) { + case editor.core.keys.DOWN: + case editor.core.keys.RIGHT: + blockRightOrDownArrowPressed_(event); + break; + + case editor.core.keys.BACKSPACE: + backspacePressed_(block, event); + break; + + case editor.core.keys.UP: + case editor.core.keys.LEFT: + blockLeftOrUpArrowPressed_(event); + break; + } + }; + + /** + * RIGHT or DOWN keydowns on block + * + * @param {Object} event + * @private + * + * @description watches the selection and gets closest editable element. + * Uses method getDeepestTextNodeFromPosition to get the last node of next block + * Sets caret if it is contenteditable + */ + var blockRightOrDownArrowPressed_ = function (event) { + var selection = window.getSelection(), + inputs = editor.state.inputs, + focusedNode = selection.anchorNode, + focusedNodeHolder; + + /** Check for caret existance */ + if (!focusedNode) { + return false; + } + + /** Looking for closest (parent) contentEditable element of focused node */ + while (focusedNode.contentEditable != 'true') { + focusedNodeHolder = focusedNode.parentNode; + focusedNode = focusedNodeHolder; + } + + /** Input index in DOM level */ + var editableElementIndex = 0; + + while (focusedNode != inputs[editableElementIndex]) { + editableElementIndex ++; + } + + /** + * Founded contentEditable element doesn't have childs + * Or maybe New created block + */ + if (!focusedNode.textContent) { + editor.caret.setToNextBlock(editableElementIndex); + return; + } + + /** + * Do nothing when caret doesn not reaches the end of last child + */ + var caretInLastChild = false, + caretAtTheEndOfText = false; + + var lastChild, + deepestTextnode; + + lastChild = focusedNode.childNodes[focusedNode.childNodes.length - 1 ]; + + if (editor.core.isDomNode(lastChild)) { + deepestTextnode = editor.content.getDeepestTextNodeFromPosition(lastChild, lastChild.childNodes.length); + } else { + deepestTextnode = lastChild; + } + + caretInLastChild = selection.anchorNode == deepestTextnode; + caretAtTheEndOfText = deepestTextnode.length == selection.anchorOffset; + + if ( !caretInLastChild || !caretAtTheEndOfText ) { + editor.core.log('arrow [down|right] : caret does not reached the end'); + return false; + } + + editor.caret.setToNextBlock(editableElementIndex); + }; + + /** + * LEFT or UP keydowns on block + * + * @param {Object} event + * @private + * + * watches the selection and gets closest editable element. + * Uses method getDeepestTextNodeFromPosition to get the last node of previous block + * Sets caret if it is contenteditable + * + */ + var blockLeftOrUpArrowPressed_ = function (event) { + var selection = window.getSelection(), + inputs = editor.state.inputs, + focusedNode = selection.anchorNode, + focusedNodeHolder; + + /** Check for caret existance */ + if (!focusedNode) { + return false; + } + + /** + * LEFT or UP not at the beginning + */ + if ( selection.anchorOffset !== 0) { + return false; + } + + /** Looking for parent contentEditable block */ + while (focusedNode.contentEditable != 'true') { + focusedNodeHolder = focusedNode.parentNode; + focusedNode = focusedNodeHolder; + } + + /** Input index in DOM level */ + var editableElementIndex = 0; + + while (focusedNode != inputs[editableElementIndex]) { + editableElementIndex ++; + } + + /** + * Do nothing if caret is not at the beginning of first child + */ + var caretInFirstChild = false, + caretAtTheBeginning = false; + + var firstChild, + deepestTextnode; + + /** + * Founded contentEditable element doesn't have childs + * Or maybe New created block + */ + if (!focusedNode.textContent) { + editor.caret.setToPreviousBlock(editableElementIndex); + return; + } + + firstChild = focusedNode.childNodes[0]; + + if (editor.core.isDomNode(firstChild)) { + deepestTextnode = editor.content.getDeepestTextNodeFromPosition(firstChild, 0); + } else { + deepestTextnode = firstChild; + } + + caretInFirstChild = selection.anchorNode == deepestTextnode; + caretAtTheBeginning = selection.anchorOffset === 0; + + if ( caretInFirstChild && caretAtTheBeginning ) { + editor.caret.setToPreviousBlock(editableElementIndex); + } + }; + + /** + * Handles backspace keydown + * + * @param {Element} block + * @param {Object} event + * @private + * + * @description if block is empty, delete the block and set caret to the previous block + * If block is not empty, try to merge two blocks - current and previous + * But it we try'n to remove first block, then we should set caret to the next block, not previous. + * If we removed the last block, create new one + */ + var backspacePressed_ = function (block, event) { + var currentInputIndex = editor.caret.getCurrentInputIndex(), + range, + selectionLength, + firstLevelBlocksCount; + + if (editor.core.isNativeInput(event.target)) { + /** If input value is empty - remove block */ + if (event.target.value.trim() == '') { + block.remove(); + } else { + return; + } + } + + if (block.textContent.trim()) { + range = editor.content.getRange(); + selectionLength = range.endOffset - range.startOffset; + + if (editor.caret.position.atStart() && !selectionLength && editor.state.inputs[currentInputIndex - 1]) { + editor.content.mergeBlocks(currentInputIndex); + } else { + return; + } + } + + if (!selectionLength) { + block.remove(); + } + + + firstLevelBlocksCount = editor.nodes.redactor.childNodes.length; + + /** + * If all blocks are removed + */ + if (firstLevelBlocksCount === 0) { + /** update currentNode variable */ + editor.content.currentNode = null; + + /** Inserting new empty initial block */ + editor.ui.addInitialBlock(); + + /** Updating inputs state after deleting last block */ + editor.ui.saveInputs(); + + /** Set to current appended block */ + window.setTimeout(function () { + editor.caret.setToPreviousBlock(1); + }, 10); + } else { + if (editor.caret.inputIndex !== 0) { + /** Target block is not first */ + editor.caret.setToPreviousBlock(editor.caret.inputIndex); + } else { + /** If we try to delete first block */ + editor.caret.setToNextBlock(editor.caret.inputIndex); + } + } + + editor.toolbar.move(); + + if (!editor.toolbar.opened) { + editor.toolbar.open(); + } + + /** Updating inputs state */ + editor.ui.saveInputs(); + + /** Prevent default browser behaviour */ + event.preventDefault(); + }; + + /** + * used by UI module + * Clicks on block settings button + * + * @param {Object} event + * @protected + * @description Opens toolbar settings + */ + callbacks.showSettingsButtonClicked = function (event) { + /** + * Get type of current block + * It uses to append settings from tool.settings property. + * ... + * Type is stored in data-type attribute on block + */ + var currentToolType = editor.content.currentNode.dataset.tool; + + editor.toolbar.settings.toggle(currentToolType); + + /** Close toolbox when settings button is active */ + editor.toolbar.toolbox.close(); + editor.toolbar.settings.hideRemoveActions(); + }; + + return callbacks; +})({}); \ No newline at end of file diff --git a/src/components/modules/_caret.js b/src/components/modules/_caret.js new file mode 100644 index 00000000..ecae4c0c --- /dev/null +++ b/src/components/modules/_caret.js @@ -0,0 +1,252 @@ +/** + * Codex Editor Caret Module + * + * @author Codex Team + * @version 1.0 + */ + +module.exports = (function (caret) { + let editor = codex.editor; + + /** + * @var {int} InputIndex - editable element in DOM + */ + caret.inputIndex = null; + + /** + * @var {int} offset - caret position in a text node. + */ + caret.offset = null; + + /** + * @var {int} focusedNodeIndex - we get index of child node from first-level block + */ + caret.focusedNodeIndex = null; + + /** + * Creates Document Range and sets caret to the element. + * @protected + * @uses caret.save — if you need to save caret position + * @param {Element} el - Changed Node. + */ + caret.set = function ( el, index, offset) { + offset = offset || caret.offset || 0; + index = index || caret.focusedNodeIndex || 0; + + var childs = el.childNodes, + nodeToSet; + + if ( childs.length === 0 ) { + nodeToSet = el; + } else { + nodeToSet = childs[index]; + } + + /** If Element is INPUT */ + if (el.contentEditable != 'true') { + el.focus(); + return; + } + + if (editor.core.isDomNode(nodeToSet)) { + nodeToSet = editor.content.getDeepestTextNodeFromPosition(nodeToSet, nodeToSet.childNodes.length); + } + + var range = document.createRange(), + selection = window.getSelection(); + + window.setTimeout(function () { + range.setStart(nodeToSet, offset); + range.setEnd(nodeToSet, offset); + + selection.removeAllRanges(); + selection.addRange(range); + + editor.caret.saveCurrentInputIndex(); + }, 20); + }; + + /** + * @protected + * Updates index of input and saves it in caret object + */ + caret.saveCurrentInputIndex = function () { + /** Index of Input that we paste sanitized content */ + var selection = window.getSelection(), + inputs = editor.state.inputs, + focusedNode = selection.anchorNode, + focusedNodeHolder; + + if (!focusedNode) { + return; + } + + /** Looking for parent contentEditable block */ + while (focusedNode.contentEditable != 'true') { + focusedNodeHolder = focusedNode.parentNode; + focusedNode = focusedNodeHolder; + } + + /** Input index in DOM level */ + var editableElementIndex = 0; + + while (focusedNode != inputs[editableElementIndex]) { + editableElementIndex ++; + } + + caret.inputIndex = editableElementIndex; + }; + + /** + * Returns current input index (caret object) + */ + caret.getCurrentInputIndex = function () { + return caret.inputIndex; + }; + + /** + * @param {int} index - index of first-level block after that we set caret into next input + */ + caret.setToNextBlock = function (index) { + var inputs = editor.state.inputs, + nextInput = inputs[index + 1]; + + if (!nextInput) { + editor.core.log('We are reached the end'); + return; + } + + /** + * When new Block created or deleted content of input + * We should add some text node to set caret + */ + if (!nextInput.childNodes.length) { + var emptyTextElement = document.createTextNode(''); + + nextInput.appendChild(emptyTextElement); + } + + editor.caret.inputIndex = index + 1; + editor.caret.set(nextInput, 0, 0); + editor.content.workingNodeChanged(nextInput); + }; + + /** + * @param {int} index - index of target input. + * Sets caret to input with this index + */ + caret.setToBlock = function (index) { + var inputs = editor.state.inputs, + targetInput = inputs[index]; + + if ( !targetInput ) { + return; + } + + /** + * When new Block created or deleted content of input + * We should add some text node to set caret + */ + if (!targetInput.childNodes.length) { + var emptyTextElement = document.createTextNode(''); + + targetInput.appendChild(emptyTextElement); + } + + editor.caret.inputIndex = index; + editor.caret.set(targetInput, 0, 0); + editor.content.workingNodeChanged(targetInput); + }; + + /** + * @param {int} index - index of input + */ + caret.setToPreviousBlock = function (index) { + index = index || 0; + + var inputs = editor.state.inputs, + previousInput = inputs[index - 1], + lastChildNode, + lengthOfLastChildNode, + emptyTextElement; + + + if (!previousInput) { + editor.core.log('We are reached first node'); + return; + } + + lastChildNode = editor.content.getDeepestTextNodeFromPosition(previousInput, previousInput.childNodes.length); + lengthOfLastChildNode = lastChildNode.length; + + /** + * When new Block created or deleted content of input + * We should add some text node to set caret + */ + if (!previousInput.childNodes.length) { + emptyTextElement = document.createTextNode(''); + previousInput.appendChild(emptyTextElement); + } + editor.caret.inputIndex = index - 1; + editor.caret.set(previousInput, previousInput.childNodes.length - 1, lengthOfLastChildNode); + editor.content.workingNodeChanged(inputs[index - 1]); + }; + + caret.position = { + + atStart : function () { + var selection = window.getSelection(), + anchorOffset = selection.anchorOffset, + anchorNode = selection.anchorNode, + firstLevelBlock = editor.content.getFirstLevelBlock(anchorNode), + pluginsRender = firstLevelBlock.childNodes[0]; + + if (!editor.core.isDomNode(anchorNode)) { + anchorNode = anchorNode.parentNode; + } + + var isFirstNode = anchorNode === pluginsRender.childNodes[0], + isOffsetZero = anchorOffset === 0; + + return isFirstNode && isOffsetZero; + }, + + atTheEnd : function () { + var selection = window.getSelection(), + anchorOffset = selection.anchorOffset, + anchorNode = selection.anchorNode; + + /** Caret is at the end of input */ + return !anchorNode || !anchorNode.length || anchorOffset === anchorNode.length; + } + }; + + + /** + * Inserts node at the caret location + * @param {HTMLElement|DocumentFragment} node + */ + caret.insertNode = function (node) { + var selection, range, + lastNode = node; + + if (node.nodeType == editor.core.nodeTypes.DOCUMENT_FRAGMENT) { + lastNode = node.lastChild; + } + + selection = window.getSelection(); + + range = selection.getRangeAt(0); + range.deleteContents(); + + range.insertNode(node); + + range.setStartAfter(lastNode); + range.collapse(true); + + selection.removeAllRanges(); + selection.addRange(range); + }; + + return caret; +})({}); \ No newline at end of file diff --git a/src/components/modules/_content.js b/src/components/modules/_content.js new file mode 100644 index 00000000..10ff5eb2 --- /dev/null +++ b/src/components/modules/_content.js @@ -0,0 +1,941 @@ +/** + * Codex Editor Content Module + * Works with DOM + * + * @class Content + * @classdesc Class works provides COdex Editor appearance logic + * + * @author Codex Team + * @version 2.0.0 + */ + +import $ from '../dom'; + +module.exports = class Content { + /** + * Module key name + * @returns {string} + */ + static get name() { + return 'Content'; + } + + /** + * @constructor + * + * @param {EditorConfig} config + */ + constructor(config) { + this.config = config; + this.Editor = null; + + this.CSS = { + block: 'ce-block', + content: 'ce-block__content', + stretched: 'ce-block--stretched', + highlighted: 'ce-block--highlighted', + }; + + this._currentNode = null; + this._currentIndex = 0; + } + + /** + * Editor modules setter + * @param {object} Editor + */ + set state(Editor) { + this.Editor = Editor; + } + + /** + * Get current working node + * + * @returns {null|HTMLElement} + */ + get currentNode() { + return this._currentNode; + } + + /** + * Set working node. Working node should be first level block, so we find it before set one to _currentNode property + * + * @param {HTMLElement} node + */ + set currentNode(node) { + let firstLevelBlock = this.getFirstLevelBlock(node); + + this._currentNode = firstLevelBlock; + } + + + /** + * @private + * @param pluginHTML + * @param {Boolean} isStretched - make stretched block or not + * + * @description adds necessary information to wrap new created block by first-level holder + */ + composeBlock_(pluginHTML, isStretched = false) { + let block = $.make('DIV', this.CSS.block), + blockContent = $.make('DIV', this.CSS.content); + + blockContent.appendChild(pluginHTML); + block.appendChild(blockContent); + + if (isStretched) { + blockContent.classList.add(this.CSS.stretched); + } + + block.dataset.toolId = this._currentIndex++; + + return block; + }; + + /** + * Finds first-level block + * @description looks for first-level block. + * gets parent while node is not first-level + * + * @param {Element} node - selected or clicked in redactors area node + * @protected + * + */ + getFirstLevelBlock(node) { + if (!$.isElement(node)) { + node = node.parentNode; + } + + if (node === this.Editor.ui.nodes.redactor || node === document.body) { + return null; + } else { + while(node.classList && !node.classList.contains(this.CSS.block)) { + node = node.parentNode; + } + + return node; + } + }; + + /** + * Insert new block to working area + * + * @param {HTMLElement} tool + * + * @returns {Number} tool index + * + */ + insertBlock(tool) { + let newBlock = this.composeBlock_(tool); + + if (this.currentNode) { + this.currentNode.insertAdjacentElement('afterend', newBlock); + } else { + /** + * If redactor is empty, append as first child + */ + this.Editor.ui.nodes.redactor.appendChild(newBlock); + } + + /** + * Set new node as current + */ + this.currentNode = newBlock; + + return newBlock.dataset.toolId; + } +}; + +// module.exports = (function (content) { +// +// let editor = codex.editor; +// +// /** +// * Links to current active block +// * @type {null | Element} +// */ +// content.currentNode = null; +// +// /** +// * clicked in redactor area +// * @type {null | Boolean} +// */ +// content.editorAreaHightlighted = null; +// +// /** +// * @deprecated +// * Synchronizes redactor with original textarea +// */ +// content.sync = function () { +// +// editor.core.log('syncing...'); +// +// /** +// * Save redactor content to editor.state +// */ +// editor.state.html = editor.nodes.redactor.innerHTML; +// +// }; +// +// /** +// * Appends background to the block +// * +// * @description add CSS class to highlight visually first-level block area +// */ +// content.markBlock = function () { +// +// editor.content.currentNode.classList.add(editor.ui.className.BLOCK_HIGHLIGHTED); +// +// }; +// +// /** +// * Clear background +// * +// * @description clears styles that highlights block +// */ +// content.clearMark = function () { +// +// if (editor.content.currentNode) { +// +// editor.content.currentNode.classList.remove(editor.ui.className.BLOCK_HIGHLIGHTED); +// +// } +// +// }; +// +// /** +// * Finds first-level block +// * +// * @param {Element} node - selected or clicked in redactors area node +// * @protected +// * +// * @description looks for first-level block. +// * gets parent while node is not first-level +// */ +// content.getFirstLevelBlock = function (node) { +// +// if (!editor.core.isDomNode(node)) { +// +// node = node.parentNode; +// +// } +// +// if (node === editor.nodes.redactor || node === document.body) { +// +// return null; +// +// } else { +// +// while(!node.classList.contains(editor.ui.className.BLOCK_CLASSNAME)) { +// +// node = node.parentNode; +// +// } +// +// return node; +// +// } +// +// }; +// +// /** +// * Trigger this event when working node changed +// * @param {Element} targetNode - first-level of this node will be current +// * @protected +// * +// * @description If targetNode is first-level then we set it as current else we look for parents to find first-level +// */ +// content.workingNodeChanged = function (targetNode) { +// +// /** Clear background from previous marked block before we change */ +// editor.content.clearMark(); +// +// if (!targetNode) { +// +// return; +// +// } +// +// content.currentNode = content.getFirstLevelBlock(targetNode); +// +// }; +// +// /** +// * Replaces one redactor block with another +// * @protected +// * @param {Element} targetBlock - block to replace. Mostly currentNode. +// * @param {Element} newBlock +// * @param {string} newBlockType - type of new block; we need to store it to data-attribute +// * +// * [!] Function does not saves old block content. +// * You can get it manually and pass with newBlock.innerHTML +// */ +// content.replaceBlock = function (targetBlock, newBlock) { +// +// if (!targetBlock || !newBlock) { +// +// editor.core.log('replaceBlock: missed params'); +// return; +// +// } +// +// /** If target-block is not a frist-level block, then we iterate parents to find it */ +// while(!targetBlock.classList.contains(editor.ui.className.BLOCK_CLASSNAME)) { +// +// targetBlock = targetBlock.parentNode; +// +// } +// +// /** Replacing */ +// editor.nodes.redactor.replaceChild(newBlock, targetBlock); +// +// /** +// * Set new node as current +// */ +// editor.content.workingNodeChanged(newBlock); +// +// /** +// * Add block handlers +// */ +// editor.ui.addBlockHandlers(newBlock); +// +// /** +// * Save changes +// */ +// editor.ui.saveInputs(); +// +// }; +// +// /** +// * @protected +// * +// * Inserts new block to redactor +// * Wrapps block into a DIV with BLOCK_CLASSNAME class +// * +// * @param blockData {object} +// * @param blockData.block {Element} element with block content +// * @param blockData.type {string} block plugin +// * @param needPlaceCaret {bool} pass true to set caret in new block +// * +// */ +// content.insertBlock = function ( blockData, needPlaceCaret ) { +// +// var workingBlock = editor.content.currentNode, +// newBlockContent = blockData.block, +// blockType = blockData.type, +// isStretched = blockData.stretched; +// +// var newBlock = composeNewBlock_(newBlockContent, blockType, isStretched); +// +// if (workingBlock) { +// +// editor.core.insertAfter(workingBlock, newBlock); +// +// } else { +// +// /** +// * If redactor is empty, append as first child +// */ +// editor.nodes.redactor.appendChild(newBlock); +// +// } +// +// /** +// * Block handler +// */ +// editor.ui.addBlockHandlers(newBlock); +// +// /** +// * Set new node as current +// */ +// editor.content.workingNodeChanged(newBlock); +// +// /** +// * Save changes +// */ +// editor.ui.saveInputs(); +// +// +// if ( needPlaceCaret ) { +// +// /** +// * If we don't know input index then we set default value -1 +// */ +// var currentInputIndex = editor.caret.getCurrentInputIndex() || -1; +// +// +// if (currentInputIndex == -1) { +// +// +// var editableElement = newBlock.querySelector('[contenteditable]'), +// emptyText = document.createTextNode(''); +// +// editableElement.appendChild(emptyText); +// editor.caret.set(editableElement, 0, 0); +// +// editor.toolbar.move(); +// editor.toolbar.showPlusButton(); +// +// +// } else { +// +// if (currentInputIndex === editor.state.inputs.length - 1) +// return; +// +// /** Timeout for browsers execution */ +// window.setTimeout(function () { +// +// /** Setting to the new input */ +// editor.caret.setToNextBlock(currentInputIndex); +// editor.toolbar.move(); +// editor.toolbar.open(); +// +// }, 10); +// +// } +// +// } +// +// /** +// * Block is inserted, wait for new click that defined focusing on editors area +// * @type {boolean} +// */ +// content.editorAreaHightlighted = false; +// +// }; +// +// /** +// * Replaces blocks with saving content +// * @protected +// * @param {Element} noteToReplace +// * @param {Element} newNode +// * @param {Element} blockType +// */ +// content.switchBlock = function (blockToReplace, newBlock, tool) { +// +// tool = tool || editor.content.currentNode.dataset.tool; +// var newBlockComposed = composeNewBlock_(newBlock, tool); +// +// /** Replacing */ +// editor.content.replaceBlock(blockToReplace, newBlockComposed); +// +// /** Save new Inputs when block is changed */ +// editor.ui.saveInputs(); +// +// }; +// +// /** +// * Iterates between child noted and looking for #text node on deepest level +// * @protected +// * +// * @param {Element} block - node where find +// * @param {int} postiton - starting postion +// * Example: childNodex.length to find from the end +// * or 0 to find from the start +// * @return {Text} block +// * @uses DFS +// */ +// content.getDeepestTextNodeFromPosition = function (block, position) { +// +// /** +// * Clear Block from empty and useless spaces with trim. +// * Such nodes we should remove +// */ +// var blockChilds = block.childNodes, +// index, +// node, +// text; +// +// for(index = 0; index < blockChilds.length; index++) { +// +// node = blockChilds[index]; +// +// if (node.nodeType == editor.core.nodeTypes.TEXT) { +// +// text = node.textContent.trim(); +// +// /** Text is empty. We should remove this child from node before we start DFS +// * decrease the quantity of childs. +// */ +// if (text === '') { +// +// block.removeChild(node); +// position--; +// +// } +// +// } +// +// } +// +// if (block.childNodes.length === 0) { +// +// return document.createTextNode(''); +// +// } +// +// /** Setting default position when we deleted all empty nodes */ +// if ( position < 0 ) +// position = 1; +// +// var lookingFromStart = false; +// +// /** For looking from START */ +// if (position === 0) { +// +// lookingFromStart = true; +// position = 1; +// +// } +// +// while ( position ) { +// +// /** initial verticle of node. */ +// if ( lookingFromStart ) { +// +// block = block.childNodes[0]; +// +// } else { +// +// block = block.childNodes[position - 1]; +// +// } +// +// if ( block.nodeType == editor.core.nodeTypes.TAG ) { +// +// position = block.childNodes.length; +// +// } else if (block.nodeType == editor.core.nodeTypes.TEXT ) { +// +// position = 0; +// +// } +// +// } +// +// return block; +// +// }; +// +// /** +// * @private +// * @param {Element} block - current plugins render +// * @param {String} tool - plugins name +// * @param {Boolean} isStretched - make stretched block or not +// * +// * @description adds necessary information to wrap new created block by first-level holder +// */ +// var composeNewBlock_ = function (block, tool, isStretched) { +// +// var newBlock = editor.draw.node('DIV', editor.ui.className.BLOCK_CLASSNAME, {}), +// blockContent = editor.draw.node('DIV', editor.ui.className.BLOCK_CONTENT, {}); +// +// blockContent.appendChild(block); +// newBlock.appendChild(blockContent); +// +// if (isStretched) { +// +// blockContent.classList.add(editor.ui.className.BLOCK_STRETCHED); +// +// } +// +// newBlock.dataset.tool = tool; +// return newBlock; +// +// }; +// +// /** +// * Returns Range object of current selection +// * @protected +// */ +// content.getRange = function () { +// +// var selection = window.getSelection().getRangeAt(0); +// +// return selection; +// +// }; +// +// /** +// * Divides block in two blocks (after and before caret) +// * +// * @protected +// * @param {int} inputIndex - target input index +// * +// * @description splits current input content to the separate blocks +// * When enter is pressed among the words, that text will be splited. +// */ +// content.splitBlock = function (inputIndex) { +// +// var selection = window.getSelection(), +// anchorNode = selection.anchorNode, +// anchorNodeText = anchorNode.textContent, +// caretOffset = selection.anchorOffset, +// textBeforeCaret, +// textNodeBeforeCaret, +// textAfterCaret, +// textNodeAfterCaret; +// +// var currentBlock = editor.content.currentNode.querySelector('[contentEditable]'); +// +// +// textBeforeCaret = anchorNodeText.substring(0, caretOffset); +// textAfterCaret = anchorNodeText.substring(caretOffset); +// +// textNodeBeforeCaret = document.createTextNode(textBeforeCaret); +// +// if (textAfterCaret) { +// +// textNodeAfterCaret = document.createTextNode(textAfterCaret); +// +// } +// +// var previousChilds = [], +// nextChilds = [], +// reachedCurrent = false; +// +// if (textNodeAfterCaret) { +// +// nextChilds.push(textNodeAfterCaret); +// +// } +// +// for ( var i = 0, child; !!(child = currentBlock.childNodes[i]); i++) { +// +// if ( child != anchorNode ) { +// +// if ( !reachedCurrent ) { +// +// previousChilds.push(child); +// +// } else { +// +// nextChilds.push(child); +// +// } +// +// } else { +// +// reachedCurrent = true; +// +// } +// +// } +// +// /** Clear current input */ +// editor.state.inputs[inputIndex].innerHTML = ''; +// +// /** +// * Append all childs founded before anchorNode +// */ +// var previousChildsLength = previousChilds.length; +// +// for(i = 0; i < previousChildsLength; i++) { +// +// editor.state.inputs[inputIndex].appendChild(previousChilds[i]); +// +// } +// +// editor.state.inputs[inputIndex].appendChild(textNodeBeforeCaret); +// +// /** +// * Append text node which is after caret +// */ +// var nextChildsLength = nextChilds.length, +// newNode = document.createElement('div'); +// +// for(i = 0; i < nextChildsLength; i++) { +// +// newNode.appendChild(nextChilds[i]); +// +// } +// +// newNode = newNode.innerHTML; +// +// /** This type of block creates when enter is pressed */ +// var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin; +// +// /** +// * Make new paragraph with text after caret +// */ +// editor.content.insertBlock({ +// type : NEW_BLOCK_TYPE, +// block : editor.tools[NEW_BLOCK_TYPE].render({ +// text : newNode +// }) +// }, true ); +// +// }; +// +// /** +// * Merges two blocks — current and target +// * If target index is not exist, then previous will be as target +// * +// * @protected +// * @param {int} currentInputIndex +// * @param {int} targetInputIndex +// * +// * @description gets two inputs indexes and merges into one +// */ +// content.mergeBlocks = function (currentInputIndex, targetInputIndex) { +// +// /** If current input index is zero, then prevent method execution */ +// if (currentInputIndex === 0) { +// +// return; +// +// } +// +// var targetInput, +// currentInputContent = editor.state.inputs[currentInputIndex].innerHTML; +// +// if (!targetInputIndex) { +// +// targetInput = editor.state.inputs[currentInputIndex - 1]; +// +// } else { +// +// targetInput = editor.state.inputs[targetInputIndex]; +// +// } +// +// targetInput.innerHTML += currentInputContent; +// +// }; +// +// /** +// * Iterates all right siblings and parents, which has right siblings +// * while it does not reached the first-level block +// * +// * @param {Element} node +// * @return {boolean} +// */ +// content.isLastNode = function (node) { +// +// // console.log('погнали перебор родителей'); +// +// var allChecked = false; +// +// while ( !allChecked ) { +// +// // console.log('Смотрим на %o', node); +// // console.log('Проверим, пустые ли соседи справа'); +// +// if ( !allSiblingsEmpty_(node) ) { +// +// // console.log('Есть непустые соседи. Узел не последний. Выходим.'); +// return false; +// +// } +// +// node = node.parentNode; +// +// /** +// * Проверяем родителей до тех пор, пока не найдем блок первого уровня +// */ +// if ( node.classList.contains(editor.ui.className.BLOCK_CONTENT) ) { +// +// allChecked = true; +// +// } +// +// } +// +// return true; +// +// }; +// +// /** +// * Checks if all element right siblings is empty +// * @param node +// */ +// var allSiblingsEmpty_ = function (node) { +// +// /** +// * Нужно убедиться, что после пустого соседа ничего нет +// */ +// var sibling = node.nextSibling; +// +// while ( sibling ) { +// +// if (sibling.textContent.length) { +// +// return false; +// +// } +// +// sibling = sibling.nextSibling; +// +// } +// +// return true; +// +// }; +// +// /** +// * @public +// * +// * @param {string} htmlData - html content as string +// * @param {string} plainData - plain text +// * @return {string} - html content as string +// */ +// content.wrapTextWithParagraphs = function (htmlData, plainData) { +// +// if (!htmlData.trim()) { +// +// return wrapPlainTextWithParagraphs(plainData); +// +// } +// +// var wrapper = document.createElement('DIV'), +// newWrapper = document.createElement('DIV'), +// i, +// paragraph, +// firstLevelBlocks = ['DIV', 'P'], +// blockTyped, +// node; +// +// /** +// * Make HTML Element to Wrap Text +// * It allows us to work with input data as HTML content +// */ +// wrapper.innerHTML = htmlData; +// paragraph = document.createElement('P'); +// +// for (i = 0; i < wrapper.childNodes.length; i++) { +// +// node = wrapper.childNodes[i]; +// +// blockTyped = firstLevelBlocks.indexOf(node.tagName) != -1; +// +// /** +// * If node is first-levet +// * we add this node to our new wrapper +// */ +// if ( blockTyped ) { +// +// /** +// * If we had splitted inline nodes to paragraph before +// */ +// if ( paragraph.childNodes.length ) { +// +// newWrapper.appendChild(paragraph.cloneNode(true)); +// +// /** empty paragraph */ +// paragraph = null; +// paragraph = document.createElement('P'); +// +// } +// +// newWrapper.appendChild(node.cloneNode(true)); +// +// } else { +// +// /** Collect all inline nodes to one as paragraph */ +// paragraph.appendChild(node.cloneNode(true)); +// +// /** if node is last we should append this node to paragraph and paragraph to new wrapper */ +// if ( i == wrapper.childNodes.length - 1 ) { +// +// newWrapper.appendChild(paragraph.cloneNode(true)); +// +// } +// +// } +// +// } +// +// return newWrapper.innerHTML; +// +// }; +// +// /** +// * Splits strings on new line and wraps paragraphs with

        tag +// * @param plainText +// * @returns {string} +// */ +// var wrapPlainTextWithParagraphs = function (plainText) { +// +// if (!plainText) return ''; +// +// return '

        ' + plainText.split('\n\n').join('

        ') + '

        '; +// +// }; +// +// /** +// * Finds closest Contenteditable parent from Element +// * @param {Element} node element looking from +// * @return {Element} node contenteditable +// */ +// content.getEditableParent = function (node) { +// +// while (node && node.contentEditable != 'true') { +// +// node = node.parentNode; +// +// } +// +// return node; +// +// }; +// +// /** +// * Clear editors content +// * +// * @param {Boolean} all — if true, delete all article data (content, id, etc.) +// */ +// content.clear = function (all) { +// +// editor.nodes.redactor.innerHTML = ''; +// editor.content.sync(); +// editor.ui.saveInputs(); +// if (all) { +// +// editor.state.blocks = {}; +// +// } else if (editor.state.blocks) { +// +// editor.state.blocks.items = []; +// +// } +// +// editor.content.currentNode = null; +// +// }; +// +// /** +// * +// * Load new data to editor +// * If editor is not empty, just append articleData.items +// * +// * @param articleData.items +// */ +// content.load = function (articleData) { +// +// var currentContent = Object.assign({}, editor.state.blocks); +// +// editor.content.clear(); +// +// if (!Object.keys(currentContent).length) { +// +// editor.state.blocks = articleData; +// +// } else if (!currentContent.items) { +// +// currentContent.items = articleData.items; +// editor.state.blocks = currentContent; +// +// } else { +// +// currentContent.items = currentContent.items.concat(articleData.items); +// editor.state.blocks = currentContent; +// +// } +// +// editor.renderer.makeBlocksFromData(); +// +// }; +// +// return content; +// +// })({}); \ No newline at end of file diff --git a/src/components/modules/_destroyer.js b/src/components/modules/_destroyer.js new file mode 100644 index 00000000..c168f3fb --- /dev/null +++ b/src/components/modules/_destroyer.js @@ -0,0 +1,70 @@ +/** + * Codex Editor Destroyer module + * + * @auhor Codex Team + * @version 1.0 + */ + +module.exports = function (destroyer) { + let editor = codex.editor; + + destroyer.removeNodes = function () { + editor.nodes.wrapper.remove(); + editor.nodes.notifications.remove(); + }; + + destroyer.destroyPlugins = function () { + for (var tool in editor.tools) { + if (typeof editor.tools[tool].destroy === 'function') { + editor.tools[tool].destroy(); + } + } + }; + + destroyer.destroyScripts = function () { + var scripts = document.getElementsByTagName('SCRIPT'); + + for (var i = 0; i < scripts.length; i++) { + if (scripts[i].id.indexOf(editor.scriptPrefix) + 1) { + scripts[i].remove(); + i--; + } + } + }; + + + /** + * Delete editor data from webpage. + * You should send settings argument with boolean flags: + * @param settings.ui- remove redactor event listeners and DOM nodes + * @param settings.scripts - remove redactor scripts from DOM + * @param settings.plugins - remove plugin's objects + * @param settings.core - remove editor core. You can remove core only if UI and scripts flags is true + * } + * + */ + destroyer.destroy = function (settings) { + if (!settings || typeof settings !== 'object') { + return; + } + + if (settings.ui) { + destroyer.removeNodes(); + editor.listeners.removeAll(); + } + + if (settings.scripts) { + destroyer.destroyScripts(); + } + + if (settings.plugins) { + destroyer.destroyPlugins(); + } + + if (settings.ui && settings.scripts && settings.core) { + delete codex.editor; + } + }; + + return destroyer; +}({}); \ No newline at end of file diff --git a/src/components/modules/_notifications.js b/src/components/modules/_notifications.js new file mode 100644 index 00000000..1746ae6f --- /dev/null +++ b/src/components/modules/_notifications.js @@ -0,0 +1,187 @@ +/** + * Codex Editor Notification Module + * + * @author Codex Team + * @version 1.0 + */ + +module.exports = (function (notifications) { + let editor = codex.editor; + + var queue = []; + + var addToQueue = function (settings) { + queue.push(settings); + + var index = 0; + + while ( index < queue.length && queue.length > 5) { + if (queue[index].type == 'confirm' || queue[index].type == 'prompt') { + index++; + continue; + } + + queue[index].close(); + queue.splice(index, 1); + } + }; + + notifications.createHolder = function () { + var holder = editor.draw.node('DIV', 'cdx-notifications-block'); + + editor.nodes.notifications = document.body.appendChild(holder); + + return holder; + }; + + + /** + * Error notificator. Shows block with message + * @protected + */ + notifications.errorThrown = function (errorMsg, event) { + editor.notifications.notification({message: 'This action is not available currently', type: event.type}); + }; + + /** + * + * Appends notification + * + * settings = { + * type - notification type (reserved types: alert, confirm, prompt). Just add class 'cdx-notification-'+type + * message - notification message + * okMsg - confirm button text (default - 'Ok') + * cancelBtn - cancel button text (default - 'Cancel'). Only for confirm and prompt types + * confirm - function-handler for ok button click + * cancel - function-handler for cancel button click. Only for confirm and prompt types + * time - time (in seconds) after which notification will close (default - 10s) + * } + * + * @param settings + */ + notifications.notification = function (constructorSettings) { + /** Private vars and methods */ + var notification = null, + cancel = null, + type = null, + confirm = null, + inputField = null; + + var confirmHandler = function () { + close(); + + if (typeof confirm !== 'function' ) { + return; + } + + if (type == 'prompt') { + confirm(inputField.value); + return; + } + + confirm(); + }; + + var cancelHandler = function () { + close(); + + if (typeof cancel !== 'function' ) { + return; + } + + cancel(); + }; + + + /** Public methods */ + function create(settings) { + if (!(settings && settings.message)) { + editor.core.log('Can\'t create notification. Message is missed'); + return; + } + + settings.type = settings.type || 'alert'; + settings.time = settings.time*1000 || 10000; + + var wrapper = editor.draw.node('DIV', 'cdx-notification'), + message = editor.draw.node('DIV', 'cdx-notification__message'), + input = editor.draw.node('INPUT', 'cdx-notification__input'), + okBtn = editor.draw.node('SPAN', 'cdx-notification__ok-btn'), + cancelBtn = editor.draw.node('SPAN', 'cdx-notification__cancel-btn'); + + message.textContent = settings.message; + okBtn.textContent = settings.okMsg || 'ОК'; + cancelBtn.textContent = settings.cancelMsg || 'Отмена'; + + editor.listeners.add(okBtn, 'click', confirmHandler); + editor.listeners.add(cancelBtn, 'click', cancelHandler); + + wrapper.appendChild(message); + + if (settings.type == 'prompt') { + wrapper.appendChild(input); + } + + wrapper.appendChild(okBtn); + + if (settings.type == 'prompt' || settings.type == 'confirm') { + wrapper.appendChild(cancelBtn); + } + + wrapper.classList.add('cdx-notification-' + settings.type); + wrapper.dataset.type = settings.type; + + notification = wrapper; + type = settings.type; + confirm = settings.confirm; + cancel = settings.cancel; + inputField = input; + + if (settings.type != 'prompt' && settings.type != 'confirm') { + window.setTimeout(close, settings.time); + } + }; + + /** + * Show notification block + */ + function send() { + editor.nodes.notifications.appendChild(notification); + inputField.focus(); + + editor.nodes.notifications.classList.add('cdx-notification__notification-appending'); + + window.setTimeout(function () { + editor.nodes.notifications.classList.remove('cdx-notification__notification-appending'); + }, 100); + + addToQueue({type: type, close: close}); + }; + + /** + * Remove notification block + */ + function close() { + notification.remove(); + }; + + + if (constructorSettings) { + create(constructorSettings); + send(); + } + + return { + create: create, + send: send, + close: close + }; + }; + + notifications.clear = function () { + editor.nodes.notifications.innerHTML = ''; + queue = []; + }; + + return notifications; +})({}); \ No newline at end of file diff --git a/src/components/modules/_parser.js b/src/components/modules/_parser.js new file mode 100644 index 00000000..6eefb459 --- /dev/null +++ b/src/components/modules/_parser.js @@ -0,0 +1,30 @@ +/** + * Codex Editor Parser Module + * + * @author Codex Team + * @version 1.1 + */ + +module.exports = (function (parser) { + let editor = codex.editor; + + /** inserting text */ + parser.insertPastedContent = function (blockType, tag) { + editor.content.insertBlock({ + type : blockType.type, + block : blockType.render({ + text : tag.innerHTML + }) + }); + }; + + /** + * Check DOM node for display style: separated block or child-view + */ + parser.isFirstLevelBlock = function (node) { + return node.nodeType == editor.core.nodeTypes.TAG && + node.classList.contains(editor.ui.className.BLOCK_CLASSNAME); + }; + + return parser; +})({}); diff --git a/src/components/modules/_paste.js b/src/components/modules/_paste.js new file mode 100644 index 00000000..61fc63de --- /dev/null +++ b/src/components/modules/_paste.js @@ -0,0 +1,221 @@ +/** + * Codex Editor Paste module + * + * @author Codex Team + * @version 1.1.1 + */ + +module.exports = function (paste) { + let editor = codex.editor; + + var patterns = []; + + paste.prepare = function () { + var tools = editor.tools; + + for (var tool in tools) { + if (!tools[tool].renderOnPastePatterns || !Array.isArray(tools[tool].renderOnPastePatterns)) { + continue; + } + + tools[tool].renderOnPastePatterns.map(function (pattern) { + patterns.push(pattern); + }); + } + + return Promise.resolve(); + }; + + /** + * Saves data + * @param event + */ + paste.pasted = function (event) { + var clipBoardData = event.clipboardData || window.clipboardData, + content = clipBoardData.getData('Text'); + + var result = analize(content); + + if (result) { + event.preventDefault(); + event.stopImmediatePropagation(); + } + + return result; + }; + + /** + * Analizes pated string and calls necessary method + */ + + var analize = function (string) { + var result = false, + content = editor.content.currentNode, + plugin = content.dataset.tool; + + patterns.map( function (pattern) { + var execArray = pattern.regex.exec(string), + match = execArray && execArray[0]; + + if ( match && match === string.trim()) { + /** current block is not empty */ + if ( content.textContent.trim() && plugin == editor.settings.initialBlockPlugin ) { + pasteToNewBlock_(); + } + + pattern.callback(string, pattern); + result = true; + } + }); + + return result; + }; + + var pasteToNewBlock_ = function () { + /** Create new initial block */ + editor.content.insertBlock({ + + type : editor.settings.initialBlockPlugin, + block : editor.tools[editor.settings.initialBlockPlugin].render({ + text : '' + }) + + }, false); + }; + + /** + * This method prevents default behaviour. + * + * @param {Object} event + * @protected + * + * @description We get from clipboard pasted data, sanitize, make a fragment that contains of this sanitized nodes. + * Firstly, we need to memorize the caret position. We can do that by getting the range of selection. + * After all, we insert clear fragment into caret placed position. Then, we should move the caret to the last node + */ + paste.blockPasteCallback = function (event) { + if (!needsToHandlePasteEvent(event.target)) { + return; + } + + /** Prevent default behaviour */ + event.preventDefault(); + + /** get html pasted data - dirty data */ + var htmlData = event.clipboardData.getData('text/html'), + plainData = event.clipboardData.getData('text/plain'); + + /** Temporary DIV that is used to work with text's paragraphs as DOM-elements*/ + var paragraphs = editor.draw.node('DIV', '', {}), + cleanData, + wrappedData; + + /** Create fragment, that we paste to range after proccesing */ + cleanData = editor.sanitizer.clean(htmlData); + + /** + * We wrap pasted text with

        tags to split it logically + * @type {string} + */ + wrappedData = editor.content.wrapTextWithParagraphs(cleanData, plainData); + paragraphs.innerHTML = wrappedData; + + /** + * If there only one paragraph, just insert in at the caret location + */ + if (paragraphs.childNodes.length == 1) { + emulateUserAgentBehaviour(paragraphs.firstChild); + return; + } + + insertPastedParagraphs(paragraphs.childNodes); + }; + + /** + * Checks if we should handle paste event on block + * @param block + * + * @return {boolean} + */ + var needsToHandlePasteEvent = function (block) { + /** If area is input or textarea then allow default behaviour */ + if ( editor.core.isNativeInput(block) ) { + return false; + } + + var editableParent = editor.content.getEditableParent(block); + + /** Allow paste when event target placed in Editable element */ + if (!editableParent) { + return false; + } + + return true; + }; + + /** + * Inserts new initial plugin blocks with data in paragraphs + * + * @param {Array} paragraphs - array of paragraphs (

        ) whit content, that should be inserted + */ + var insertPastedParagraphs = function (paragraphs) { + var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin, + currentNode = editor.content.currentNode; + + + paragraphs.forEach(function (paragraph) { + /** Don't allow empty paragraphs */ + if (editor.core.isBlockEmpty(paragraph)) { + return; + } + + editor.content.insertBlock({ + type : NEW_BLOCK_TYPE, + block : editor.tools[NEW_BLOCK_TYPE].render({ + text : paragraph.innerHTML + }) + }); + + editor.caret.inputIndex++; + }); + + editor.caret.setToPreviousBlock(editor.caret.getCurrentInputIndex() + 1); + + + /** + * If there was no data in working node, remove it + */ + if (editor.core.isBlockEmpty(currentNode)) { + currentNode.remove(); + editor.ui.saveInputs(); + } + }; + + /** + * Inserts node content at the caret position + * + * @param {Node} node - DOM node (could be DocumentFragment), that should be inserted at the caret location + */ + var emulateUserAgentBehaviour = function (node) { + var newNode; + + if (node.childElementCount) { + newNode = document.createDocumentFragment(); + + node.childNodes.forEach(function (current) { + if (!editor.core.isDomNode(current) && current.data.trim() === '') { + return; + } + + newNode.appendChild(current.cloneNode(true)); + }); + } else { + newNode = document.createTextNode(node.textContent); + } + + editor.caret.insertNode(newNode); + }; + + + return paste; +}({}); \ No newline at end of file diff --git a/src/components/modules/_transport.js b/src/components/modules/_transport.js new file mode 100644 index 00000000..ba29e2b6 --- /dev/null +++ b/src/components/modules/_transport.js @@ -0,0 +1,114 @@ +/** + * + * Codex.Editor Transport Module + * + * @copyright 2017 Codex-Team + * @version 1.2.0 + */ + +module.exports = (function (transport) { + let editor = codex.editor; + + + /** + * @private {Object} current XmlHttpRequest instance + */ + var currentRequest = null; + + + /** + * @type {null} | {DOMElement} input - keeps input element in memory + */ + transport.input = null; + + /** + * @property {Object} arguments - keep plugin settings and defined callbacks + */ + transport.arguments = null; + + /** + * Prepares input element where will be files + */ + transport.prepare = function () { + let input = editor.draw.node( 'INPUT', '', { type : 'file' } ); + + editor.listeners.add(input, 'change', editor.transport.fileSelected); + editor.transport.input = input; + }; + + /** Clear input when files is uploaded */ + transport.clearInput = function () { + /** Remove old input */ + transport.input = null; + + /** Prepare new one */ + transport.prepare(); + }; + + /** + * Callback for file selection + * @param {Event} event + */ + transport.fileSelected = function () { + var input = this, + i, + files = input.files, + formData = new FormData(); + + if (editor.transport.arguments.multiple === true) { + for ( i = 0; i < files.length; i++) { + formData.append('files[]', files[i], files[i].name); + } + } else { + formData.append('files', files[0], files[0].name); + } + + currentRequest = editor.core.ajax({ + type : 'POST', + data : formData, + url : editor.transport.arguments.url, + beforeSend : editor.transport.arguments.beforeSend, + success : editor.transport.arguments.success, + error : editor.transport.arguments.error, + progress : editor.transport.arguments.progress + }); + + /** Clear input */ + transport.clearInput(); + }; + + /** + * Use plugin callbacks + * @protected + * + * @param {Object} args - can have : + * @param {String} args.url - fetch URL + * @param {Function} args.beforeSend - function calls before sending ajax + * @param {Function} args.success - success callback + * @param {Function} args.error - on error handler + * @param {Function} args.progress - xhr onprogress handler + * @param {Boolean} args.multiple - allow select several files + * @param {String} args.accept - adds accept attribute + */ + transport.selectAndUpload = function (args) { + transport.arguments = args; + + if ( args.multiple === true) { + transport.input.setAttribute('multiple', 'multiple'); + } + + if ( args.accept ) { + transport.input.setAttribute('accept', args.accept); + } + + transport.input.click(); + }; + + transport.abort = function () { + currentRequest.abort(); + + currentRequest = null; + }; + + return transport; +})({}); \ No newline at end of file diff --git a/src/components/modules/api-blocks.ts b/src/components/modules/api-blocks.ts new file mode 100644 index 00000000..8ce93631 --- /dev/null +++ b/src/components/modules/api-blocks.ts @@ -0,0 +1,120 @@ +declare var Module: any; + +import { IBlocksAPI } from '../interfaces/api'; +import IInputOutputData from '../interfaces/input-output-data'; +import IModuleConfig from '../interfaces/module-config'; + +/** + * @class BlocksAPI + * provides with methods working with Block + */ +export default class BlocksAPI extends Module implements IBlocksAPI { + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + constructor({config}: IModuleConfig) { + super({config}); + } + + /** + * Available methods + * @return {IBlocksAPI} + */ + get methods(): IBlocksAPI { + return { + clear: () => this.clear(), + render: (data: IInputOutputData) => this.render(data), + delete: () => this.delete(), + swap: (fromIndex: number, toIndex: number) => this.swap(fromIndex, toIndex), + getBlockByIndex: (index: number) => this.getBlockByIndex(index), + getCurrentBlockIndex: () => this.getCurrentBlockIndex(), + getBlocksCount: () => this.getBlocksCount(), + }; + } + + /** + * Returns Blocks count + * @return {number} + */ + public getBlocksCount(): number { + return this.Editor.BlockManager.blocks.length; + } + + /** + * Returns current block index + * @return {number} + */ + public getCurrentBlockIndex(): number { + return this.Editor.BlockManager.currentBlockIndex; + } + + /** + * Returns Current Block + * @param {Number} index + * + * @return {Object} + */ + public getBlockByIndex(index: number): object { + return this.Editor.BlockManager.getBlockByIndex(index); + } + + /** + * Call Block Manager method that swap Blocks + * @param {number} fromIndex - position of first Block + * @param {number} toIndex - position of second Block + */ + public swap(fromIndex: number, toIndex: number): void { + this.Editor.BlockManager.swap(fromIndex, toIndex); + + /** + * Move toolbar + * DO not close the settings + */ + this.Editor.Toolbar.move(false); + } + + /** + * Deletes Block + * @param blockIndex + */ + public delete(blockIndex?: number): void { + this.Editor.BlockManager.removeBlock(blockIndex); + + /** + * in case of last block deletion + * Insert new initial empty block + */ + if (this.Editor.BlockManager.blocks.length === 0) { + this.Editor.BlockManager.insert(); + } + + /** + * In case of deletion first block we need to set caret to the current Block + */ + if (this.Editor.BlockManager.currentBlockIndex === 0) { + this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock); + } else { + this.Editor.Caret.navigatePrevious(true); + } + + this.Editor.Toolbar.close(); + } + + /** + * Clear Editor's area + */ + public clear(): void { + this.Editor.BlockManager.clear(true); + } + + /** + * Fills Editor with Blocks data + * @param {IInputOutputData} data — Saved Editor data + */ + public render(data: IInputOutputData): void { + this.Editor.BlockManager.clear(); + this.Editor.Renderer.render(data.items); + } + +} diff --git a/src/components/modules/api-events.ts b/src/components/modules/api-events.ts new file mode 100644 index 00000000..43bb55b0 --- /dev/null +++ b/src/components/modules/api-events.ts @@ -0,0 +1,58 @@ +declare var Module: any; + +import {IEventsAPI} from '../interfaces/api'; +import IModuleConfig from '../interfaces/module-config'; + +/** + * @class EventsAPI + * provides with methods working with Toolbar + */ +export default class EventsAPI extends Module implements IEventsAPI { + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + constructor({config}: IModuleConfig) { + super({config}); + } + + /** + * Available methods + * @return {IEventsAPI} + */ + get methods(): IEventsAPI { + return { + emit: (eventName: string, data: object) => this.emit(eventName, data), + off: (eventName: string, callback: () => void) => this.off(eventName, callback), + on: (eventName: string, callback: () => void) => this.on(eventName, callback), + }; + } + + /** + * Subscribe on Events + * @param {String} eventName + * @param {Function} callback + */ + public on(eventName, callback): void { + this.Editor.Events.on(eventName, callback); + } + + /** + * Emit event with data + * @param {String} eventName + * @param {Object} data + */ + public emit(eventName, data): void { + this.Editor.Events.emit(eventName, data); + } + + /** + * Unsubscribe from Event + * @param {String} eventName + * @param {Function} callback + */ + public off(eventName, callback): void { + this.Editor.Events.off(eventName, callback); + } + +} diff --git a/src/components/modules/api-listener.ts b/src/components/modules/api-listener.ts new file mode 100644 index 00000000..4e3eb8d2 --- /dev/null +++ b/src/components/modules/api-listener.ts @@ -0,0 +1,52 @@ +declare var Module: any; + +import {IListenerAPI} from '../interfaces/api'; +import IModuleConfig from '../interfaces/module-config'; + +/** + * @class API + * Provides with methods working with DOM Listener + */ +export default class ListenerAPI extends Module implements IListenerAPI { + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + constructor({config}: IModuleConfig) { + super({config}); + } + + /** + * Available methods + * @return {IToolbarAPI} + */ + get methods(): IListenerAPI { + return { + on: (element, eventType, handler, useCapture) => this.on(element, eventType, handler, useCapture), + off: (element, eventType, handler) => this.off(element, eventType, handler), + }; + } + + /** + * adds DOM event listener + * + * @param {HTMLElement} element + * @param {string} eventType + * @param {() => void} handler + * @param {boolean} useCapture + */ + public on(element: HTMLElement, eventType: string, handler: () => void, useCapture?: boolean): void { + this.Editor.Listeners.on(element, eventType, handler, useCapture); + } + + /** + * Removes DOM listener from element + * + * @param element + * @param eventType + * @param handler + */ + public off(element, eventType, handler): void { + this.Editor.Listeners.off(element, eventType, handler); + } +} diff --git a/src/components/modules/api-sanitizer.ts b/src/components/modules/api-sanitizer.ts new file mode 100644 index 00000000..3baf074d --- /dev/null +++ b/src/components/modules/api-sanitizer.ts @@ -0,0 +1,33 @@ +declare var Module: any; + +import {ISanitizerAPI} from '../interfaces/api'; +import IModuleConfig from '../interfaces/module-config'; + +/** + * @class API + * Provides CodeX Editor Sanitizer that allows developers to clean their HTML + */ +export default class SanitizerAPI extends Module implements ISanitizerAPI { + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + constructor({config}: IModuleConfig) { + super({config}); + } + + /** + * Available methods + * @return {ISanitizerAPI} + */ + get methods(): ISanitizerAPI { + return { + clean: (taintString, config) => this.clean(taintString, config), + }; + } + + public clean(taintString, config) { + return this.Editor.Sanitizer.clean(taintString, config); + } + +} diff --git a/src/components/modules/api-saver.ts b/src/components/modules/api-saver.ts new file mode 100644 index 00000000..fef987c8 --- /dev/null +++ b/src/components/modules/api-saver.ts @@ -0,0 +1,36 @@ +declare var Module: any; + +import {ISaverAPI} from '../interfaces/api'; +import IInputOutputData from '../interfaces/input-output-data'; +import IModuleConfig from '../interfaces/module-config'; + +/** + * @class SaverAPI + * provides with methods to save data + */ +export default class SaverAPI extends Module implements ISaverAPI { + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + constructor({config}: IModuleConfig) { + super({config}); + } + + /** + * Available methods + * @return {ISaverAPI} + */ + get methods(): ISaverAPI { + return { + save: () => this.save(), + }; + } + + /** + * Return Editor's data + */ + public save(): IInputOutputData { + return this.Editor.Saver.save(); + } +} diff --git a/src/components/modules/api-selection.ts b/src/components/modules/api-selection.ts new file mode 100644 index 00000000..1b578b09 --- /dev/null +++ b/src/components/modules/api-selection.ts @@ -0,0 +1,49 @@ +declare var Module: any; + +import {ISelectionAPI} from '../interfaces/api'; +import IModuleConfig from '../interfaces/module-config'; +import Selection from '../selection'; + +/** + * @class API + * Provides with methods working with Selection + */ +export default class SelectionAPI extends Module implements ISelectionAPI { + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + constructor({config}: IModuleConfig) { + super({config}); + } + + /** + * Available methods + * @return {ISelectionAPI} + */ + get methods(): ISelectionAPI { + return { + findParentTag: (tagName: string, className: string) => this.findParentTag(tagName, className), + expandToTag: (node: HTMLElement) => this.expandToTag(node), + }; + } + + /** + * Looks ahead from selection and find passed tag with class name + * @param {string} tagName - tag to find + * @param {string} className - tag's class name + * @return {HTMLElement|null} + */ + public findParentTag(tagName: string, className: string): HTMLElement|null { + return new Selection().findParentTag(tagName, className); + } + + /** + * Expand selection to passed tag + * @param {HTMLElement} node - tag that should contain selection + */ + public expandToTag(node: HTMLElement): void { + new Selection().expandToTag(node); + } + +} diff --git a/src/components/modules/api-toolbar.ts b/src/components/modules/api-toolbar.ts new file mode 100644 index 00000000..d3b11660 --- /dev/null +++ b/src/components/modules/api-toolbar.ts @@ -0,0 +1,44 @@ +declare var Module: any; + +import {IToolbarAPI} from '../interfaces/api'; +import IModuleConfig from '../interfaces/module-config'; + +/** + * @class ToolbarsAPI + * provides with methods working with Toolbar + */ +export default class ToolbarAPI extends Module implements IToolbarAPI { + + /** + * Save Editor config. API provides passed configuration to the Blocks + */ + constructor({config}: IModuleConfig) { + super({config}); + } + + /** + * Available methods + * @return {IToolbarAPI} + */ + get methods(): IToolbarAPI { + return { + close: () => this.close(), + open: () => this.open(), + }; + } + + /** + * Open toolbar + */ + public open(): void { + this.Editor.Toolbar.open(); + } + + /** + * Close toolbar and all included elements + */ + public close(): void { + this.Editor.Toolbar.close(); + } + +} diff --git a/src/components/modules/api.ts b/src/components/modules/api.ts new file mode 100644 index 00000000..5525650f --- /dev/null +++ b/src/components/modules/api.ts @@ -0,0 +1,39 @@ +/** + * @module API + * @copyright 2018 + * + * Each block has an Editor API instance to use provided public methods + * if you cant to read more about how API works, please see docs + */ +declare var Module: any; +declare var $: any; +declare var _: any; + +import { IAPI } from '../interfaces/api'; + +/** + * @class API + */ +export default class API extends Module { + + /** + * Save Editor config. API provides passed configuration to the Blocks + * @param {EditorConfig} config + */ + constructor({config}) { + super({config}); + } + + public get methods(): IAPI { + return { + blocks: this.Editor.BlocksAPI.methods, + caret: {}, + events: this.Editor.EventsAPI.methods, + listener: this.Editor.ListenerAPI.methods, + sanitizer: this.Editor.SanitizerAPI.methods, + saver: this.Editor.SaverAPI.methods, + selection: this.Editor.SelectionAPI.methods, + toolbar: this.Editor.ToolbarAPI.methods, + }; + } +} diff --git a/src/components/modules/block-events.ts b/src/components/modules/block-events.ts new file mode 100644 index 00000000..ec18de2e --- /dev/null +++ b/src/components/modules/block-events.ts @@ -0,0 +1,210 @@ +/** + * Contains keyboard and mouse events binded on each Block by Block Manager + */ +declare var Module: any; +declare var $: any; +declare var _: any; + +export default class BlockEvents extends Module { + /** + * @constructor + */ + constructor({config}) { + super({config}); + } + + /** + * All keydowns on Block + * @param {KeyboardEvent} event - keydown + */ + public keydown(event: KeyboardEvent): void { + /** + * Run common method for all keydown events + */ + this.beforeKeydownProcessing(); + + /** + * Fire keydown processor by event.keyCode + */ + switch (event.keyCode) { + case _.keyCodes.BACKSPACE: + this.backspace(event); + break; + + case _.keyCodes.ENTER: + this.enter(event); + break; + + case _.keyCodes.DOWN: + case _.keyCodes.RIGHT: + this.arrowRightAndDown(); + break; + + case _.keyCodes.UP: + case _.keyCodes.LEFT: + this.arrowLeftAndUp(); + break; + + default: + this.defaultHandler(); + break; + } + } + + /** + * Fires on keydown before event processing + */ + public beforeKeydownProcessing(): void { + /** + * Clear all highlightings + */ + this.Editor.BlockManager.clearHighlightings(); + + /** + * Hide Toolbar + */ + this.Editor.Toolbar.close(); + } + + /** + * Key up on Block: + * - shows Inline Toolbar if something selected + */ + public keyup(event): void { + this.Editor.InlineToolbar.handleShowingEvent(event); + } + + /** + * Mouse up on Block: + * - shows Inline Toolbar if something selected + */ + public mouseUp(event): void { + this.Editor.InlineToolbar.handleShowingEvent(event); + } + + /** + * ENTER pressed on block + * @param {KeyboardEvent} event - keydown + */ + private enter(event: KeyboardEvent): void { + const currentBlock = this.Editor.BlockManager.currentBlock, + toolsConfig = this.config.toolsConfig[currentBlock.name]; + + /** + * Don't handle Enter keydowns when Tool sets enableLineBreaks to true. + * Uses for Tools like where line breaks should be handled by default behaviour. + */ + if (toolsConfig && toolsConfig[this.Editor.Tools.apiSettings.IS_ENABLED_LINE_BREAKS]) { + return; + } + + /** + * Allow to create linebreaks by Shift+Enter + */ + if (event.shiftKey) { + return; + } + + /** + * Split the Current Block into two blocks + */ + this.Editor.BlockManager.split(); + + /** + * Renew local current node after split + */ + const newCurrent = this.Editor.BlockManager.currentBlock; + + this.Editor.Toolbar.move(); + + /** + * If new Block is empty + */ + if (this.Editor.Tools.isInitial(newCurrent.tool) && newCurrent.isEmpty) { + /** + * Show Toolbar + */ + this.Editor.Toolbar.open(); + + /** + * Show Plus Button + */ + this.Editor.Toolbar.plusButton.show(); + } + + event.preventDefault(); + } + + /** + * Handle backspace keydown on Block + * @param {KeyboardEvent} event - keydown + */ + private backspace(event: KeyboardEvent): void { + const BM = this.Editor.BlockManager; + + const isFirstBlock = BM.currentBlockIndex === 0, + canMergeBlocks = this.Editor.Caret.isAtStart && !isFirstBlock; + + /** If current Block is empty just remove this Block */ + if (this.Editor.BlockManager.currentBlock.isEmpty) { + this.Editor.BlockManager.removeBlock(); + if (this.Editor.Caret.navigatePrevious(true)) { + this.Editor.Toolbar.close(); + } + return; + } + + if (!canMergeBlocks) { + return; + } + + // preventing browser default behaviour + event.preventDefault(); + + const targetBlock = BM.getBlockByIndex(BM.currentBlockIndex - 1), + blockToMerge = BM.currentBlock; + + /** + * Blocks that can be merged: + * 1) with the same Name + * 2) Tool has 'merge' method + * + * other case will handle as usual ARROW LEFT behaviour + */ + if (blockToMerge.name !== targetBlock.name || !targetBlock.mergeable) { + if (this.Editor.Caret.navigatePrevious()) { + this.Editor.Toolbar.close(); + } + + return; + } + + this.Editor.Caret.createShadow(targetBlock.pluginsContent); + BM.mergeBlocks(targetBlock, blockToMerge) + .then( () => { + /** Restore caret position after merge */ + this.Editor.Caret.restoreCaret(targetBlock.pluginsContent); + targetBlock.pluginsContent.normalize(); + this.Editor.Toolbar.close(); + }); + } + + /** + * Handle right and down keyboard keys + */ + private arrowRightAndDown(): void { + this.Editor.Caret.navigateNext(); + } + + /** + * Handle left and up keyboard keys + */ + private arrowLeftAndUp(): void { + this.Editor.Caret.navigatePrevious(); + } + + /** + * Default keydown handler + */ + private defaultHandler(): void {} +} diff --git a/src/components/modules/blockManager.js b/src/components/modules/blockManager.js new file mode 100644 index 00000000..b6a9dc02 --- /dev/null +++ b/src/components/modules/blockManager.js @@ -0,0 +1,625 @@ +/** + * @class BlockManager + * @classdesc Manage editor`s blocks storage and appearance + * + * @module BlockManager + * + * @version 2.0.0 + */ + +import Block from '../block'; + +/** + * @typedef {BlockManager} BlockManager + * @property {Number} currentBlockIndex - Index of current working block + * @property {Proxy} _blocks - Proxy for Blocks instance {@link Blocks} + */ +export default class BlockManager extends Module { + /** + * @constructor + * @param {EditorConfig} config + */ + constructor({config}) { + super({config}); + + /** + * Proxy for Blocks instance {@link Blocks} + * + * @type {Proxy} + * @private + */ + this._blocks = null; + + /** + * Index of current working block + * + * @type {number} + * @private + */ + this.currentBlockIndex = -1; + } + + /** + * Should be called after Editor.UI preparation + * Define this._blocks property + * + * @returns {Promise} + */ + prepare() { + return new Promise(resolve => { + let blocks = new Blocks(this.Editor.UI.nodes.redactor); + + /** + * We need to use Proxy to overload set/get [] operator. + * So we can use array-like syntax to access blocks + * + * @example + * this._blocks[0] = new Block(...); + * + * block = this._blocks[0]; + * + * @todo proxy the enumerate method + * + * @type {Proxy} + * @private + */ + this._blocks = new Proxy(blocks, { + set: Blocks.set, + get: Blocks.get + }); + + resolve(); + }); + } + + /** + * Creates Block instance by tool name + * + * @param {String} toolName - tools passed in editor config {@link EditorConfig#tools} + * @param {Object} data - constructor params + * @param {Object} settings - block settings + * + * @return {Block} + */ + composeBlock(toolName, data, settings) { + let toolInstance = this.Editor.Tools.construct(toolName, data), + block = new Block(toolName, toolInstance, settings, this.Editor.API.methods); + + this.bindEvents(block); + /** + * Apply callback before inserting html + */ + block.call('appendCallback', {}); + + return block; + } + + /** + * Bind Events + * @param {Object} block + */ + bindEvents(block) { + this.Editor.Listeners.on(block.holder, 'keydown', (event) => this.Editor.BlockEvents.keydown(event)); + this.Editor.Listeners.on(block.holder, 'mouseup', (event) => this.Editor.BlockEvents.mouseUp(event)); + this.Editor.Listeners.on(block.holder, 'keyup', (event) => this.Editor.BlockEvents.keyup(event)); + } + + /** + * Insert new block into _blocks + * + * @param {String} toolName — plugin name, by default method inserts initial block type + * @param {Object} data — plugin data + * @param {Object} settings - default settings + * + * @return {Block} + */ + insert(toolName = this.config.initialBlock, data = {}, settings = {}) { + let block = this.composeBlock(toolName, data, settings); + + + this._blocks[++this.currentBlockIndex] = block; + this.Editor.Caret.setToBlock(block); + + return block; + } + + /** + * Always inserts at the end + */ + insertAtEnd() { + /** + * Define new value for current block index + */ + this.currentBlockIndex = this.blocks.length - 1; + + /** + * Insert initial typed block + */ + this.insert(); + } + + /** + * Merge two blocks + * @param {Block} targetBlock - previous block will be append to this block + * @param {Block} blockToMerge - block that will be merged with target block + * + * @return {Promise} - the sequence that can be continued + */ + mergeBlocks(targetBlock, blockToMerge) { + let blockToMergeIndex = this._blocks.indexOf(blockToMerge); + + return Promise.resolve() + .then( () => { + if (blockToMerge.isEmpty) { + return; + } + + return blockToMerge.data + .then((blockToMergeInfo) => { + targetBlock.mergeWith(blockToMergeInfo.data); + }); + }) + .then( () => { + this.removeBlock(blockToMergeIndex); + this.currentBlockIndex = this._blocks.indexOf(targetBlock); + }); + } + + /** + * Remove block with passed index or remove last + * @param {Number|null} index + */ + removeBlock(index) { + if (!index) { + index = this.currentBlockIndex; + } + this._blocks.remove(index); + } + + /** + * Split current Block + * 1. Extract content from Caret position to the Block`s end + * 2. Insert a new Block below current one with extracted content + */ + split() { + let extractedFragment = this.Editor.Caret.extractFragmentFromCaretPosition(), + wrapper = $.make('div'); + + wrapper.append(extractedFragment); + + /** + * @todo make object in accordance with Tool + */ + let data = { + text: $.isEmpty(wrapper) ? '' : wrapper.innerHTML, + }; + + /** + * Renew current Block + * @type {Block} + */ + const blockInserted = this.insert(this.config.initialBlock, data); + + this.currentNode = blockInserted.pluginsContent; + } + + /** + * Replace current working block + * + * @param {String} toolName — plugin name + * @param {Object} data — plugin data + */ + replace(toolName, data = {}) { + let block = this.composeBlock(toolName, data); + + this._blocks.insert(this.currentBlockIndex, block, true); + } + + /** + * returns last Block + * @return {Block} + */ + get lastBlock() { + return this._blocks[this._blocks.length - 1]; + } + + /** + * Returns Block by passed index + * @param {Number} index + * @return {Block} + */ + getBlockByIndex(index) { + return this._blocks[index]; + } + + /** + * Get Block instance by html element + * @param {Node} element + * @returns {Block} + */ + getBlock(element) { + if (!$.isElement(element)) { + element = element.parentNode; + } + + let nodes = this._blocks.nodes, + firstLevelBlock = element.closest(`.${Block.CSS.wrapper}`), + index = nodes.indexOf(firstLevelBlock); + + if (index >= 0) { + return this._blocks[index]; + } + } + + /** + * Get current Block instance + * + * @return {Block} + */ + get currentBlock() { + return this._blocks[this.currentBlockIndex]; + } + + /** + * Returns next Block instance + * @return {Block|null} + */ + get nextBlock() { + let isLastBlock = this.currentBlockIndex === (this._blocks.length - 1); + + if (isLastBlock) { + return null; + } + + return this._blocks[this.currentBlockIndex + 1]; + } + + /** + * Returns previous Block instance + * @return {Block|null} + */ + get previousBlock() { + let isFirstBlock = this.currentBlockIndex === 0; + + if (isFirstBlock) { + return null; + } + + return this._blocks[this.currentBlockIndex - 1]; + } + + /** + * Get working html element + * + * @return {HTMLElement} + */ + get currentNode() { + return this._blocks.nodes[this.currentBlockIndex]; + } + + /** + * Set currentBlockIndex to passed block + * @param {Node} element + */ + set currentNode(element) { + if (!$.isElement(element)) { + element = element.parentNode; + } + + let nodes = this._blocks.nodes, + firstLevelBlock = element.closest(`.${Block.CSS.wrapper}`); + + if (!firstLevelBlock) { + throw Error('Passed element is not a Block.'); + } + + + /** + * Update current Block's index + * @type {number} + */ + this.currentBlockIndex = nodes.indexOf(firstLevelBlock); + } + + /** + * Remove selection from all Blocks then highlight only Current Block + */ + highlightCurrentNode() { + /** + * Remove previous selected Block's state + */ + this.clearHighlightings(); + + /** + * Mark current Block as selected + * @type {boolean} + */ + this.currentBlock.selected = true; + } + + /** + * Remove selection from all Blocks + */ + clearHighlightings() { + this.blocks.forEach( block => block.selected = false); + } + + /** + * Get array of Block instances + * + * @returns {Block[]} {@link Blocks#array} + */ + get blocks() { + return this._blocks.array; + } + + /** + * 1) Find first-level Block from passed child Node + * 2) Mark it as current + * + * @param {Element|Text} childNode - look ahead from this node. + * @throws Error - when passed Node is not included at the Block + */ + setCurrentBlockByChildNode(childNode) { + /** + * If node is Text TextNode + */ + if (!$.isElement(childNode)) { + childNode = childNode.parentNode; + } + + let parentFirstLevelBlock = childNode.closest(`.${Block.CSS.wrapper}`); + + if (parentFirstLevelBlock) { + this.currentNode = parentFirstLevelBlock; + } else { + throw new Error('Can not find a Block from this child Node'); + } + } + + /** + * Swap Blocks Position + * @param {Number} fromIndex + * @param {Number} toIndex + */ + swap(fromIndex, toIndex) { + /** Move up current Block */ + this._blocks.swap(fromIndex, toIndex); + + /** Now actual block moved up so that current block index decreased */ + this.currentBlockIndex = toIndex; + } + + /** + * Sets current Block Index -1 which means unknown + * and clear highlightings + */ + dropPointer() { + this.currentBlockIndex = -1; + this.clearHighlightings(); + } + + /** + * Clears Editor + * @param {boolean} needAddInitialBlock - 1) in internal calls (for example, in api.blocks.render) + * we don't need to add empty initial block + * 2) in api.blocks.clear we should add empty block + */ + clear(needAddInitialBlock = false) { + this._blocks.removeAll(); + this.dropPointer(); + + if (needAddInitialBlock) { + this.insert(this.config.initialBlock); + } + } +}; + +/** + * @class Blocks + * @classdesc Class to work with Block instances array + * + * @private + * + * @property {HTMLElement} workingArea — editor`s working node + * + */ +class Blocks { + /** + * @constructor + * + * @param {HTMLElement} workingArea — editor`s working node + */ + constructor(workingArea) { + this.blocks = []; + this.workingArea = workingArea; + } + + /** + * Push back new Block + * + * @param {Block} block + */ + push(block) { + this.blocks.push(block); + this.workingArea.appendChild(block.holder); + } + + /** + * Swaps blocks with indexes first and second + * @param {Number} first - first block index + * @param {Number} second - second block index + */ + swap(first, second) { + let secondBlock = this.blocks[second]; + + /** + * Change in DOM + */ + $.swap(this.blocks[first].holder, secondBlock.holder); + + /** + * Change in array + */ + this.blocks[second] = this.blocks[first]; + this.blocks[first] = secondBlock; + } + + /** + * Insert new Block at passed index + * + * @param {Number} index — index to insert Block + * @param {Block} block — Block to insert + * @param {Boolean} replace — it true, replace block on given index + */ + insert(index, block, replace = false) { + if (!this.length) { + this.push(block); + return; + } + + if (index > this.length) { + index = this.length; + } + + if (replace) { + this.blocks[index].holder.remove(); + } + + let deleteCount = replace ? 1 : 0; + + this.blocks.splice(index, deleteCount, block); + + if (index > 0) { + let previousBlock = this.blocks[index - 1]; + + previousBlock.holder.insertAdjacentElement('afterend', block.holder); + } else { + let nextBlock = this.blocks[index + 1]; + + if (nextBlock) { + nextBlock.holder.insertAdjacentElement('beforebegin', block.holder); + } else { + this.workingArea.appendChild(block.holder); + } + } + } + + /** + * Remove block + * @param {Number|null} index + */ + remove(index) { + if (isNaN(index)) { + index = this.length - 1; + } + + this.blocks[index].holder.remove(); + this.blocks.splice(index, 1); + } + + /** + * Remove all blocks + */ + removeAll() { + this.workingArea.innerHTML = ''; + this.blocks.length = 0; + } + + /** + * Insert Block after passed target + * + * @todo decide if this method is necessary + * + * @param {Block} targetBlock — target after wich Block should be inserted + * @param {Block} newBlock — Block to insert + */ + insertAfter(targetBlock, newBlock) { + let index = this.blocks.indexOf(targetBlock); + + this.insert(index + 1, newBlock); + } + + /** + * Get Block by index + * + * @param {Number} index — Block index + * @returns {Block} + */ + get(index) { + return this.blocks[index]; + } + + /** + * Return index of passed Block + * + * @param {Block} block + * @returns {Number} + */ + indexOf(block) { + return this.blocks.indexOf(block); + } + + /** + * Get length of Block instances array + * + * @returns {Number} + */ + get length() { + return this.blocks.length; + } + + /** + * Get Block instances array + * + * @returns {Block[]} + */ + get array() { + return this.blocks; + } + + /** + * Get blocks html elements array + * + * @returns {HTMLElement[]} + */ + get nodes() { + return _.array(this.workingArea.children); + } + + /** + * Proxy trap to implement array-like setter + * + * @example + * blocks[0] = new Block(...) + * + * @param {Blocks} instance — Blocks instance + * @param {Number|String} index — block index + * @param {Block} block — Block to set + * @returns {Boolean} + */ + static set(instance, index, block) { + if (isNaN(Number(index))) { + return false; + } + + instance.insert(index, block); + + return true; + } + + /** + * Proxy trap to implement array-like getter + * + * @param {Blocks} instance — Blocks instance + * @param {Number|String} index — Block index + * @returns {Block|*} + */ + static get(instance, index) { + if (isNaN(Number(index))) { + return instance[index]; + } + + return instance.get(index); + } +} diff --git a/src/components/modules/caret.js b/src/components/modules/caret.js new file mode 100644 index 00000000..deb60a5f --- /dev/null +++ b/src/components/modules/caret.js @@ -0,0 +1,362 @@ +/** + * @class Caret + * @classdesc Contains methods for working Caret + * + * Uses Range methods to manipulate with caret + * + * @module Caret + * + * @version 2.0.0 + */ + +import Selection from '../selection'; + +/** + * @typedef {Caret} Caret + */ +export default class Caret extends Module { + /** + * @constructor + */ + constructor({config}) { + super({config}); + } + + /** + * Elements styles that can be useful for Caret Module + */ + static get CSS() { + return { + shadowCaret: 'cdx-shadow-caret' + }; + }; + + /** + * Method gets Block instance and puts caret to the text node with offset + * There two ways that method applies caret position: + * - first found text node: sets at the beginning, but you can pass an offset + * - last found text node: sets at the end of the node. Also, you can customize the behaviour + * + * @param {Block} block - Block class + * @param {Number} offset - caret offset regarding to the text node + * @param {Boolean} atEnd - put caret at the end of the text node or not + */ + setToBlock(block, offset = 0, atEnd = false) { + let element = block.pluginsContent; + + /** If Element is INPUT */ + if ($.isNativeInput(element)) { + element.focus(); + return; + } + + let nodeToSet = $.getDeepestNode(element, atEnd); + + if (atEnd || offset > nodeToSet.length) { + offset = nodeToSet.length; + } + + /** if found deepest node is native input */ + if ($.isNativeInput(nodeToSet)) { + nodeToSet.focus(); + return; + } + + /** + * @todo try to fix via Promises or use querySelectorAll to not to use timeout + */ + _.delay( () => { + this.set(nodeToSet, offset); + }, 20)(); + + this.Editor.BlockManager.currentNode = block.holder; + } + + /** + * Creates Document Range and sets caret to the element with offset + * @param {Element} element - target node. + * @param {Number} offset - offset + */ + set( element, offset = 0) { + let range = document.createRange(), + selection = Selection.get(); + + range.setStart(element, offset); + range.setEnd(element, offset); + + selection.removeAllRanges(); + selection.addRange(range); + }; + + /** + * Set Caret to the last Block + * If last block is not empty, append another empty block + */ + setToTheLastBlock() { + let lastBlock = this.Editor.BlockManager.lastBlock; + + if (!lastBlock) return; + + /** + * If last block is empty and it is an initialBlock, set to that. + * Otherwise, append new empty block and set to that + */ + if (lastBlock.isEmpty) { + this.setToBlock(lastBlock); + } else { + this.Editor.BlockManager.insertAtEnd(); + } + } + + /** + * Extract content fragment of current Block from Caret position to the end of the Block + */ + extractFragmentFromCaretPosition() { + let selection = Selection.get(); + + if (selection.rangeCount) { + let selectRange = selection.getRangeAt(0), + blockElem = this.Editor.BlockManager.currentBlock.pluginsContent; + + selectRange.deleteContents(); + + if (blockElem) { + let range = selectRange.cloneRange(true); + + range.selectNodeContents(blockElem); + range.setStart(selectRange.endContainer, selectRange.endOffset); + return range.extractContents(); + } + } + } + + /** + * Get all first-level (first child of [contenteditabel]) siblings from passed node + * Then you can check it for emptiness + * + * @example + *
        + * + * @return {Element[]} + */ + getHigherLevelSiblings(from, direction ) { + let current = from, + siblings = []; + + /** + * Find passed node's firs-level parent (in example - blockquote) + */ + while (current.parentNode && current.parentNode.contentEditable !== 'true') { + current = current.parentNode; + } + + let sibling = direction === 'left' ? 'previousSibling' : 'nextSibling'; + + /** + * Find all left/right siblings + */ + while (current[sibling]) { + current = current[sibling]; + siblings.push(current); + } + + return siblings; + } + + /** + * Set's caret to the next Block + * Before moving caret, we should check if caret position is at the end of Plugins node + * Using {@link Dom#getDeepestNode} to get a last node and match with current selection + * + * @param {Boolean} force - force navigation even if caret is not at the end + * + * @return {Boolean} + */ + navigateNext(force = false) { + let nextBlock = this.Editor.BlockManager.nextBlock; + + if (!nextBlock) { + return false; + } + + if (force || this.isAtEnd) { + this.setToBlock(nextBlock); + return true; + } + + return false; + } + + /** + * Set's caret to the previous Block + * Before moving caret, we should check if caret position is start of the Plugins node + * Using {@link Dom#getDeepestNode} to get a last node and match with current selection + * + * @param {Boolean} force - force navigation even if caret is not at the start + * + * @return {Boolean} + */ + navigatePrevious(force = false) { + let previousBlock = this.Editor.BlockManager.previousBlock; + + if (!previousBlock) { + return false; + } + + if (force || this.isAtStart) { + this.setToBlock( previousBlock, 0, true ); + return true; + } + + return false; + } + + /** + * Get's deepest first node and checks if offset is zero + * @return {boolean} + */ + get isAtStart() { + /** + * Don't handle ranges + */ + if (!Selection.isCollapsed) { + return false; + } + + let selection = Selection.get(), + anchorNode = selection.anchorNode, + firstNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent); + + /** + * Workaround case when caret in the text like " |Hello!" + * selection.anchorOffset is 1, but real caret visible position is 0 + * @type {number} + */ + let firstLetterPosition = anchorNode.textContent.search(/\S/); + + if (firstLetterPosition === -1) { // empty text + firstLetterPosition = 0; + } + + /** + * In case of + *
        + *

        <-- first (and deepest) node is + * |adaddad <-- anchor node + *
        + */ + if ($.isEmpty(firstNode)) { + let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'left'), + nothingAtLeft = leftSiblings.every( node => $.isEmpty(node) ); + + + + if (nothingAtLeft && selection.anchorOffset === firstLetterPosition) { + return true; + } + } + + /** + * We use <= comparison for case: + * "| Hello" <--- selection.anchorOffset is 0, but firstLetterPosition is 1 + */ + return firstNode === null || anchorNode === firstNode && selection.anchorOffset <= firstLetterPosition; + } + + /** + * Get's deepest last node and checks if offset is last node text length + * @return {boolean} + */ + get isAtEnd() { + /** + * Don't handle ranges + */ + if (!Selection.isCollapsed) { + return false; + } + + let selection = Selection.get(), + anchorNode = selection.anchorNode, + lastNode = $.getDeepestNode(this.Editor.BlockManager.currentBlock.pluginsContent, true); + + /** + * In case of + *
        + * adaddad| <-- anchor node + *

        <-- first (and deepest) node is + *
        + */ + if ($.isEmpty(lastNode)) { + let leftSiblings = this.getHigherLevelSiblings(anchorNode, 'right'), + nothingAtRight = leftSiblings.every( node => $.isEmpty(node) ); + + if (nothingAtRight && selection.anchorOffset === anchorNode.textContent.length) { + return true; + } + } + + /** + * Workaround case: + * hello | <--- anchorOffset will be 5, but textContent.length will be 6. + * Why not regular .trim(): + * in case of ' hello |' trim() will also remove space at the beginning, so length will be lower than anchorOffset + */ + let rightTrimmedText = lastNode.textContent.replace(/\s+$/, ''); + + /** + * We use >= comparison for case: + * "Hello |" <--- selection.anchorOffset is 7, but rightTrimmedText is 6 + */ + return anchorNode === lastNode && selection.anchorOffset >= rightTrimmedText.length; + } + + /** + * Inserts shadow element after passed element where caret can be placed + * @param {Node} element + */ + createShadow(element) { + let shadowCaret = document.createElement('span'); + + shadowCaret.classList.add(Caret.CSS.shadowCaret); + element.insertAdjacentElement('beforeEnd', shadowCaret); + } + + /** + * Restores caret position + * @param {Node} element + */ + restoreCaret(element) { + let shadowCaret = element.querySelector(`.${Caret.CSS.shadowCaret}`); + + if (!shadowCaret) { + return; + } + + /** + * After we set the caret to the required place + * we need to clear shadow caret + * + * - make new range + * - select shadowed span + * - use extractContent to remove it from DOM + */ + let sel = new Selection(); + + sel.expandToTag(shadowCaret); + + setTimeout(() => { + let newRange = document.createRange(); + + newRange.selectNode(shadowCaret); + newRange.extractContents(); + }, 50); + } +} diff --git a/src/components/modules/events.js b/src/components/modules/events.js new file mode 100644 index 00000000..5cb42283 --- /dev/null +++ b/src/components/modules/events.js @@ -0,0 +1,78 @@ +/** + * @module eventDispatcher + * + * Has two important methods: + * - {Function} on - appends subscriber to the event. If event doesn't exist - creates new one + * - {Function} emit - fires all subscribers with data + * - {Function off - unsubsribes callback + * + * @version 1.0.0 + * + * @typedef {Events} Events + * @property {Object} subscribers - all subscribers grouped by event name + */ +export default class Events extends Module { + /** + * @constructor + */ + constructor({config}) { + super({config}); + this.subscribers = {}; + } + + /** + * Subscribe any event on callback + * + * @param {String} eventName - event name + * @param {Function} callback - subscriber + */ + on(eventName, callback) { + if (!(eventName in this.subscribers)) { + this.subscribers[eventName] = []; + } + + // group by events + this.subscribers[eventName].push(callback); + } + + /** + * Emit callbacks with passed data + * + * @param {String} eventName - event name + * @param {Object} data - subscribers get this data when they were fired + */ + emit(eventName, data) { + if (!this.subscribers[eventName]) { + return; + } + + this.subscribers[eventName].reduce(function (previousData, currentHandler) { + let newData = currentHandler(previousData); + + return newData ? newData : previousData; + }, data); + } + + /** + * Unsubsribe callback from event + * + * @param eventName + * @param callback + */ + off(eventName, callback) { + for(let i = 0; i < this.subscribers[eventName].length; i++) { + if (this.subscribers[eventName][i] === callback) { + delete this.subscribers[eventName][i]; + break; + } + } + } + + /** + * Destroyer + * clears subsribers list + */ + destroy() { + this.subscribers = null; + } +} diff --git a/src/components/modules/listeners.js b/src/components/modules/listeners.js new file mode 100644 index 00000000..435d75e5 --- /dev/null +++ b/src/components/modules/listeners.js @@ -0,0 +1,174 @@ +/** + * Codex Editor Listeners module + * + * @module Listeners + * + * Module-decorator for event listeners assignment + * + * @author Codex Team + * @version 2.0.0 + */ + +/** + * @typedef {Listeners} Listeners + * @property {Array} allListeners + */ +export default class Listeners extends Module { + /** + * @constructor + * @param {EditorConfig} config + */ + constructor({config}) { + super({config}); + this.allListeners = []; + } + + /** + * Assigns event listener on element + * + * @param {Element} element - DOM element that needs to be listened + * @param {String} eventType - event type + * @param {Function} handler - method that will be fired on event + * @param {Boolean} useCapture - use event bubbling + */ + on(element, eventType, handler, useCapture = false) { + let assignedEventData = { + element, + eventType, + handler, + useCapture + }; + + let alreadyExist = this.findOne(element, eventType, handler); + + if (alreadyExist) return; + + this.allListeners.push(assignedEventData); + element.addEventListener(eventType, handler, useCapture); + } + + /** + * Removes event listener from element + * + * @param {Element} element - DOM element that we removing listener + * @param {String} eventType - event type + * @param {Function} handler - remove handler, if element listens several handlers on the same event type + * @param {Boolean} useCapture - use event bubbling + */ + off(element, eventType, handler, useCapture = false) { + let existingListeners = this.findAll(element, eventType, handler); + + for (let i = 0; i < existingListeners.length; i++) { + let index = this.allListeners.indexOf(existingListeners[i]); + + if (index > 0) { + this.allListeners.splice(index, 1); + } + } + + element.removeEventListener(eventType, handler, useCapture); + } + + /** + * Search method: looks for listener by passed element + * @param {Element} element - searching element + * @returns {Array} listeners that found on element + */ + findByElement(element) { + let listenersOnElement = []; + + for (let i = 0; i < this.allListeners.length; i++) { + let listener = this.allListeners[i]; + + if (listener.element === element) { + listenersOnElement.push(listener); + } + } + + return listenersOnElement; + } + + /** + * Search method: looks for listener by passed event type + * @param {String} eventType + * @return {Array} listeners that found on element + */ + findByType(eventType) { + let listenersWithType = []; + + for (let i = 0; i < this.allListeners.length; i++) { + let listener = this.allListeners[i]; + + if (listener.type === eventType) { + listenersWithType.push(listener); + } + } + + return listenersWithType; + } + + /** + * Search method: looks for listener by passed handler + * @param {Function} handler + * @return {Array} listeners that found on element + */ + findByHandler(handler) { + let listenersWithHandler = []; + + for (let i = 0; i < this.allListeners.length; i++) { + let listener = this.allListeners[i]; + + if (listener.handler === handler) { + listenersWithHandler.push(listener); + } + } + + return listenersWithHandler; + } + + /** + * @param {Element} element + * @param {String} eventType + * @param {Function} handler + * @return {Element|null} + */ + findOne(element, eventType, handler) { + let foundListeners = this.findAll(element, eventType, handler); + + return foundListeners.length > 0 ? foundListeners[0] : null; + } + + /** + * @param {Element} element + * @param {String} eventType + * @param {Function} handler + * @return {Array} + */ + findAll(element, eventType, handler) { + let found, + foundByElements = element ? this.findByElement(element) : []; + // foundByEventType = eventType ? this.findByType(eventType) : [], + // foundByHandler = handler ? this.findByHandler(handler) : []; + + if (element && eventType && handler) { + found = foundByElements.filter( event => event.eventType === eventType && event.handler === handler ); + } else if (element && eventType) { + found = foundByElements.filter( event => event.eventType === eventType); + } else { + found = foundByElements; + } + + return found; + } + + /** + * Removes all listeners + */ + removeAll() { + this.allListeners.map( (current) => { + current.element.removeEventListener(current.eventType, current.handler); + }); + + this.allListeners = []; + } +} diff --git a/src/components/modules/paste.ts b/src/components/modules/paste.ts new file mode 100644 index 00000000..3e78a088 --- /dev/null +++ b/src/components/modules/paste.ts @@ -0,0 +1,487 @@ +/** + * @class Paste + * @classdesc Contains methods to handle paste on editor + * + * @module Paste + * + * @version 2.0.0 + */ + +import {IBlockToolData} from '../interfaces/block-tool'; + +declare const Module: any; +declare const $: any; +declare const _: any; + +/** + * Tag substitute object. + * + * @param {string} tool - name of related Tool + * @param {Function} handler - callback to handle pasted element + */ +interface ITagSubstitute { + tool: string; + handler: (element: HTMLElement) => IBlockToolData; +} + +/** + * Pattern substitute object. + * + * @param {string} key - pattern`s key + * @param {RegExp} pattern - pasted pattern + * @param {Function} handler - callback to handle pasted pattern + * @param {string} tool - name of related Tool + */ +interface IPatternSubstitute { + key: string; + pattern: RegExp; + handler: (text: string, key: string) => IBlockToolData; + tool: string; +} + +/** + * Processed paste data object. + * + * @param {string} tool - name of related Tool + * @param {HTMLElement} content - processed pasted content + * @param {boolean} isBlock - true if content should be inserted as new Block + * @param {Function} handler - callback that returns pasted data in IBlockToolData format + */ +interface IPasteData { + tool: string; + content: HTMLElement; + isBlock: boolean; + handler: (content: HTMLElement|string, patten?: RegExp) => IBlockToolData; +} + +export default class Paste extends Module { + + /** If string`s length is greater than this number we don't check paste patterns */ + public static readonly PATTERN_PROCESSING_MAX_LENGTH = 450; + + /** + * Tags` substitutions parameters + */ + private toolsTags: {[tag: string]: ITagSubstitute} = {}; + + /** Patterns` substitutions parameters */ + private toolsPatterns: IPatternSubstitute[] = []; + + /** + * @constructor + */ + constructor({config}) { + super({config}); + } + + public async prepare(): Promise { + this.setCallback(); + this.processTools(); + } + + /** + * Set onPaste callback handler + */ + private setCallback(): void { + const {Listeners, UI} = this.Editor; + Listeners.on(UI.nodes.redactor, 'paste', this.processPastedData); + } + + /** + * Get and process tool`s paste configs + */ + private processTools(): void { + const tools = this.Editor.Tools.blockTools; + Object.entries(tools).forEach(this.processTool); + } + + /** + * Process paste config for each tools + * + * @param {string} tool + */ + private processTool = ([name, tool]) => { + + const toolPasteConfig = tool.onPaste || {}; + + if (!toolPasteConfig.handler) { + _.log( + `"${name}" Tool MUST provide paste handler.`, + 'warn', + ); + } + + if (typeof toolPasteConfig.handler !== 'function') { + _.log( + `Paste handler for "${name}" Tool should be a function.`, + 'warn', + ); + } else { + const tags = toolPasteConfig.tags || []; + + tags.forEach((tag) => { + if (this.toolsTags.hasOwnProperty(tag)) { + _.log( + `Paste handler for "${name}" Tool on "${tag}" tag is skipped ` + + `because it is already used by "${this.toolsTags[tag].tool}" Tool.`, + 'warn', + ); + return; + } + + this.toolsTags[tag] = { + handler: toolPasteConfig.handler, + tool: name, + }; + }); + } + + if (!toolPasteConfig.patternHandler || _.isEmpty(toolPasteConfig.patterns)) { + return; + } + + if (typeof toolPasteConfig.patternHandler !== 'function') { + _.log( + `Pattern parser for "${name}" Tool should be a function.`, + 'warn', + ); + } else { + Object.entries(toolPasteConfig.patterns).forEach(([key, pattern]: [string, RegExp]) => { + /** Still need to validate pattern as it provided by user */ + if (!(pattern instanceof RegExp)) { + _.log( + `Pattern ${pattern} for "${tool}" Tool is skipped because it should be a Regexp instance.`, + 'warn', + ); + } + + this.toolsPatterns.push({ + key, + pattern, + handler: toolPasteConfig.patternHandler, + tool: name, + }); + }); + } + } + + /** + * Check if browser behavior suits better + * + * @param {EventTarget} element - element where content has been pasted + * @returns {boolean} + */ + private isNativeBehaviour(element: EventTarget): boolean { + const {Editor: {BlockManager}} = this; + + if ( $.isNativeInput(element) ) { + return true; + } + + const block = BlockManager.getBlock(element); + + return !block; + } + + /** + * Get pasted data, process it and insert into editor + * + * @param {ClipboardEvent} event + */ + private processPastedData = async (event: ClipboardEvent): Promise => { + const { + Editor: {Tools, Sanitizer, BlockManager, Caret}, + config: {toolsConfig}, + } = this; + + /** If target is native input or is not Block, use browser behaviour */ + if (this.isNativeBehaviour(event.target)) { + return; + } + + event.preventDefault(); + + const block = BlockManager.getBlock(event.target); + const toolConfig = toolsConfig[block.name]; + + /** If paste is dissalowed in block do nothing */ + if (toolConfig && toolConfig[Tools.apiSettings.IS_PASTE_DISALLOWED]) { + return; + } + + const htmlData = event.clipboardData.getData('text/html'), + plainData = event.clipboardData.getData('text/plain'); + + /** Add all block tags and tags can be substituted to sanitizer configuration */ + const blockTags = $.blockElements.reduce((result, tag) => { + result[tag.toLowerCase()] = {}; + + return result; + }, {}); + const toolsTags = Object.keys(this.toolsTags).reduce((result, tag) => { + result[tag.toLowerCase()] = {}; + + return result; + }, {}); + + const customConfig = {tags: Object.assign({}, blockTags, toolsTags, Sanitizer.defaultConfig.tags)}; + const cleanData = Sanitizer.clean(htmlData, customConfig); + + let dataToInsert = []; + + /** If there is no HTML or HTML string is equal to plain one, process it as plain text */ + if (!cleanData.trim() || cleanData.trim() === plainData || !$.isHTMLString(cleanData)) { + dataToInsert = this.processPlain(plainData); + } else { + dataToInsert = this.processHTML(htmlData); + } + + if (dataToInsert.length === 1 && !dataToInsert[0].isBlock) { + this.processSingleBlock(dataToInsert.pop()); + return; + } + + this.splitBlock(); + + await Promise.all(dataToInsert.map( + async (data, i) => await this.insertBlock(data, i === 0), + )); + + Caret.setToBlock(BlockManager.currentBlock, 0, true); + } + + /** + * Process paste to single Block: + * 1. Find patterns` matches + * 2. Insert new block if it is not the same type as current one + * 3. Just insert text if there is no substitutions + * + * @param {IPasteData} dataToInsert + */ + private async processSingleBlock(dataToInsert: IPasteData): Promise { + const initialTool = this.config.initialBlock; + const {BlockManager} = this.Editor; + const {content, tool} = dataToInsert; + + if (tool === initialTool && content.textContent.length < Paste.PATTERN_PROCESSING_MAX_LENGTH) { + const blockData = await this.processPattern(content.textContent); + + if (blockData) { + this.splitBlock(); + + if (BlockManager.currentBlock.isEmpty) { + BlockManager.replace(blockData.tool, blockData.data); + } else { + BlockManager.insert(blockData.tool, blockData.data); + } + return; + } + } + + /** If there is no pattern substitute - insert string as it is */ + document.execCommand('insertHTML', false, content.innerHTML); + } + + /** + * Get patterns` matches + * + * @param {string} text + * @returns Promise<{data: IBlockToolData, tool: string}> + */ + private async processPattern(text: string): Promise<{data: IBlockToolData, tool: string}> { + const pattern = this.toolsPatterns.find((substitute) => { + const execResult = substitute.pattern.exec(text); + + if (!execResult) { + return false; + } + + return text === execResult.shift(); + }); + + const data = pattern && await pattern.handler(text, pattern.key); + + return data && { + data, + tool: pattern.tool, + }; + } + + /** + * + * @param {IPasteData} data + * @param {Boolean} canReplaceCurrentBlock - if true and is current Block is empty, will replace current Block + * @returns {Promise} + */ + private async insertBlock(data: IPasteData, canReplaceCurrentBlock: boolean = false): Promise { + const blockData = await data.handler(data.content); + const {BlockManager} = this.Editor; + const {currentBlock} = BlockManager; + + if (canReplaceCurrentBlock && currentBlock.isEmpty) { + BlockManager.replace(data.tool, blockData); + return; + } + + BlockManager.insert(data.tool, blockData); + } + + /** + * Split current block if paste isn't in the end of the block + */ + private splitBlock() { + const {BlockManager, Caret} = this.Editor; + + /** If we paste into middle of the current block: + * 1. Split + * 2. Navigate to the first part + */ + if (!BlockManager.currentBlock.isEmpty && !Caret.isAtEnd) { + BlockManager.split(); + BlockManager.currentBlockIndex--; + } + } + + /** + * Split HTML string to blocks and return it as array of Block data + * + * @param {string} innerHTML + * @returns {IPasteData[]} + */ + private processHTML(innerHTML: string): IPasteData[] { + const {Tools, Sanitizer} = this.Editor; + const initialTool = this.config.initialBlock; + const wrapper = $.make('DIV'); + + wrapper.innerHTML = innerHTML; + + const nodes = this.getNodes(wrapper); + + return nodes + .map((node) => { + let content, tool = initialTool, isBlock = false; + + switch (node.nodeType) { + /** If node is a document fragment, use temp wrapper to get innerHTML */ + case Node.DOCUMENT_FRAGMENT_NODE: + content = $.make('div'); + content.appendChild(node); + content.innerHTML = Sanitizer.clean(content.innerHTML); + break; + + /** If node is an element, then there might be a substitution */ + case Node.ELEMENT_NODE: + content = node as HTMLElement; + isBlock = true; + content.innerHTML = Sanitizer.clean(content.innerHTML); + + if (this.toolsTags[content.tagName]) { + tool = this.toolsTags[content.tagName].tool; + } + break; + } + + const handler = Tools.blockTools[tool].onPaste.handler; + + return {content, isBlock, handler, tool}; + }) + .filter((data) => !$.isNodeEmpty(data.content)); + } + + /** + * Split plain text by new line symbols and return it as array of Block data + * + * @param {string} plain + * @returns {IPasteData[]} + */ + private processPlain(plain: string): IPasteData[] { + const {initialBlock} = this.config as {initialBlock: string}; + const {Tools} = this.Editor; + + if (!plain) { + return []; + } + const tool = initialBlock; + const handler = Tools.blockTools[tool].onPaste.handler; + + return plain.split('\n\n').map((text) => { + const content = $.make('div'); + + content.innerHTML = plain; + return {content, tool, isBlock: false, handler}; + }); + } + + /** + * Recursively divide HTML string to two types of nodes: + * 1. Block element + * 2. Document Fragments contained text and markup tags like a, b, i etc. + * + * @param {Node} wrapper + * @returns {Node[]} + */ + private getNodes(wrapper: Node): Node[] { + const children = Array.from(wrapper.childNodes); + const tags = Object.keys(this.toolsTags); + + const reducer = (nodes: Node[], node: Node): Node[] => { + if ($.isEmpty(node)) { + return nodes; + } + + const lastNode = nodes[nodes.length - 1]; + let destNode: Node = new DocumentFragment(); + + if (lastNode && $.isFragment(lastNode)) { + destNode = nodes.pop(); + } + + switch (node.nodeType) { + /** + * If node is HTML element: + * 1. Check if it is inline element + * 2. Check if it contains another block or substitutable elements + */ + case Node.ELEMENT_NODE: + const element = node as HTMLElement; + /** Append inline elements to previous fragment */ + if ( + !$.blockElements.includes(element.tagName.toLowerCase()) && + !tags.includes(element.tagName.toLowerCase()) + ) { + destNode.appendChild(element); + return [...nodes, destNode]; + } + + if ( + ( + tags.includes(element.tagName.toLowerCase()) && + Array.from(element.children).every(({tagName}) => !tags.includes(tagName.toLowerCase())) + ) || ( + $.blockElements.includes(element.tagName.toLowerCase()) && + Array.from(element.children).every( + ({tagName}) => !$.blockElements.includes(tagName.toLowerCase()), + ) + ) + ) { + return [...nodes, element]; + } + break; + + /** + * If node is text node, wrap it with DocumentFragment + */ + case Node.TEXT_NODE: + destNode.appendChild(node); + return [...nodes, destNode]; + + default: + return [...nodes, destNode]; + } + + return [...nodes, ...Array.from(node.childNodes).reduce(reducer, [])]; + }; + + return children.reduce(reducer, []); + } +} diff --git a/src/components/modules/renderer.js b/src/components/modules/renderer.js new file mode 100644 index 00000000..dd6ea93a --- /dev/null +++ b/src/components/modules/renderer.js @@ -0,0 +1,88 @@ +/** + * Codex Editor Renderer Module + * + * @module Renderer + * @author CodeX Team + * + * @version 2.0.0 + */ +export default class Renderer extends Module { + /** + * @constructor + * @param {EditorConfig} config + */ + constructor({config}) { + super({config}); + } + + /** + * @typedef {Object} RendererItems + * @property {String} type - tool name + * @property {Object} data - tool data + */ + + /** + * @example + * + * items: [ + * { + * type : 'paragraph', + * data : { + * text : 'Hello from Codex!' + * } + * }, + * { + * type : 'paragraph', + * data : { + * text : 'Leave feedback if you like it!' + * } + * }, + * ] + * + */ + + /** + * Make plugin blocks from array of plugin`s data + * @param {RendererItems[]} items + */ + render(items) { + let chainData = []; + + for (let i = 0; i < items.length; i++) { + chainData.push({ + function: () => this.insertBlock(items[i]) + }); + } + + return _.sequence(chainData); + } + + /** + * Get plugin instance + * Add plugin instance to BlockManager + * Insert block to working zone + * + * @param {Object} item + * @returns {Promise.} + * @private + */ + insertBlock(item) { + let tool = item.type, + data = item.data, + settings = item.settings; + + if (tool in this.Editor.Tools.available) { + this.Editor.BlockManager.insert(tool, data, settings); + } else { + /** + * @todo show warning notification message + * + * `${tool} blocks was skipped.` + */ + + _.log(`Tool «${tool}» is not found. Check 'tools' property at your initial CodeX Editor config.`, 'warn'); + } + + return Promise.resolve(); + } +} diff --git a/src/components/modules/sanitizer.js b/src/components/modules/sanitizer.js new file mode 100644 index 00000000..b0cb51d6 --- /dev/null +++ b/src/components/modules/sanitizer.js @@ -0,0 +1,131 @@ +/** + * CodeX Sanitizer + * + * @module Sanitizer + * Clears HTML from taint tags + * + * @version 2.0.0 + * + * @example + * Module can be used within two ways: + * 1) When you have an instance + * - this.Editor.Sanitizer.clean(yourTaintString); + * 2) As static method + * - CodexEditor.Sanitizer.clean(yourTaintString, yourCustomConfiguration); + * + * {@link SanitizerConfig} + */ + + +/** + * @typedef {Object} SanitizerConfig + * @property {Object} tags - define tags restrictions + * + * @example + * + * tags : { + * p: true, + * a: { + * href: true, + * rel: "nofollow", + * target: "_blank" + * } + * } + */ +export default class Sanitizer extends Module { + /** + * Initializes Sanitizer module + * Sets default configuration if custom not exists + * + * @property {SanitizerConfig} this.defaultConfig + * @property {HTMLJanitor} this._sanitizerInstance - Sanitizer library + * + * @param {SanitizerConfig} config + */ + constructor({config}) { + super({config}); + + // default config + this.defaultConfig = null; + this._sanitizerInstance = null; + + /** Custom configuration */ + this.sanitizerConfig = config.settings ? config.settings.sanitizer : {}; + + /** HTML Janitor library */ + this.sanitizerInstance = require('html-janitor'); + } + + /** + * If developer uses editor's API, then he can customize sanitize restrictions. + * Or, sanitizing config can be defined globally in editors initialization. That config will be used everywhere + * At least, if there is no config overrides, that API uses Default configuration + * + * @uses https://www.npmjs.com/package/html-janitor + * + * @param {HTMLJanitor} library - sanitizer extension + */ + set sanitizerInstance(library) { + this._sanitizerInstance = new library(this.defaultConfig); + } + + /** + * Sets sanitizer configuration. Uses default config if user didn't pass the restriction + * @param {SanitizerConfig} config + */ + set sanitizerConfig(config) { + if (_.isEmpty(config)) { + this.defaultConfig = { + tags: { + p: {}, + a: { + href: true, + target: '_blank', + rel: 'nofollow' + }, + b: {}, + i: {} + } + }; + } else { + this.defaultConfig = config; + } + } + + /** + * Cleans string from unwanted tags + * @param {String} taintString - HTML string + * @param {Object} customConfig - custom sanitizer configuration. Method uses default if param is empty + * @return {String} clean HTML + */ + clean(taintString, customConfig = {}) { + if (_.isEmpty(customConfig)) { + return this._sanitizerInstance.clean(taintString); + } else { + return Sanitizer.clean(taintString, customConfig); + } + } + + /** + * Cleans string from unwanted tags + * @static + * + * Method allows to use default config + * + * @param {String} taintString - taint string + * @param {SanitizerConfig} customConfig - allowed tags + * + * @return {String} clean HTML + */ + static clean(taintString, customConfig) { + let newInstance = new Sanitizer({ + config: { + settings: { + sanitizer: customConfig + } + } + }); + + return newInstance.clean(taintString); + } +} diff --git a/src/components/modules/saver.js b/src/components/modules/saver.js new file mode 100644 index 00000000..e274cf19 --- /dev/null +++ b/src/components/modules/saver.js @@ -0,0 +1,243 @@ +/** + * Codex Editor Saver + * + * @module Saver + * @author Codex Team + * @version 2.0.0 + */ + +/** + * @typedef {Object} SavedData + * @property {Date} time - saving proccess time + * @property {Object} items - extracted data + * @property {String} version - CodexEditor version + */ + +/** + * @classdesc This method reduces all Blocks asyncronically and calls Block's save method to extract data + * + * @typedef {Saver} Saver + * @property {Element} html - Editor HTML content + * @property {String} json - Editor JSON output + */ +export default class Saver extends Module { + /** + * @constructor + * @param config + */ + constructor({config}) { + super({config}); + + this.output = null; + this.blocksData = []; + } + + /** + * Composes new chain of Promises to fire them alternatelly + * @return {SavedData} + */ + save() { + let blocks = this.Editor.BlockManager.blocks, + chainData = []; + + blocks.forEach((block) => { + chainData.push(block.data); + }); + + return Promise.all(chainData) + .then((allExtractedData) => this.makeOutput(allExtractedData)) + .then((outputData) => { + return outputData; + }); + } + + /** + * Creates output object with saved data, time and version of editor + * @param {Object} allExtractedData + * @return {SavedData} + */ + makeOutput(allExtractedData) { + let items = [], + totalTime = 0; + + console.groupCollapsed('[CodexEditor saving]:'); + + allExtractedData.forEach((extraction) => { + /** Group process info */ + console.log(`«${extraction.tool}» saving info`, extraction); + totalTime += extraction.time; + items.push({ + type: extraction.tool, + data: extraction.data + }); + }); + + console.log('Total', totalTime); + console.groupEnd(); + + return { + time : +new Date(), + items : items, + version : VERSION, + }; + } +} + +// module.exports = (function (saver) { +// +// let editor = codex.editor; +// +// /** +// * @public +// * Save blocks +// */ +// saver.save = function () { +// +// /** Save html content of redactor to memory */ +// editor.state.html = editor.nodes.redactor.innerHTML; +// +// /** Clean jsonOutput state */ +// editor.state.jsonOutput = []; +// +// return saveBlocks(editor.nodes.redactor.childNodes); +// +// }; +// +// /** +// * @private +// * Save each block data +// * +// * @param blocks +// * @returns {Promise.} +// */ +// let saveBlocks = function (blocks) { +// +// let data = []; +// +// for(let index = 0; index < blocks.length; index++) { +// +// data.push(getBlockData(blocks[index])); +// +// } +// +// return Promise.all(data) +// .then(makeOutput) +// .catch(editor.core.log); +// +// }; +// +// /** Save and validate block data */ +// let getBlockData = function (block) { +// +// return saveBlockData(block) +// .then(validateBlockData) +// .catch(editor.core.log); +// +// }; +// +// /** +// * @private +// * Call block`s plugin save method and return saved data +// * +// * @param block +// * @returns {Object} +// */ +// let saveBlockData = function (block) { +// +// let pluginName = block.dataset.tool; +// +// /** Check for plugin existence */ +// if (!editor.tools[pluginName]) { +// +// editor.core.log(`Plugin «${pluginName}» not found`, 'error'); +// return {data: null, pluginName: null}; +// +// } +// +// /** Check for plugin having save method */ +// if (typeof editor.tools[pluginName].save !== 'function') { +// +// editor.core.log(`Plugin «${pluginName}» must have save method`, 'error'); +// return {data: null, pluginName: null}; +// +// } +// +// /** Result saver */ +// let blockContent = block.childNodes[0], +// pluginsContent = blockContent.childNodes[0], +// position = pluginsContent.dataset.inputPosition; +// +// /** If plugin wasn't available then return data from cache */ +// if ( editor.tools[pluginName].available === false ) { +// +// return Promise.resolve({data: codex.editor.state.blocks.items[position].data, pluginName}); +// +// } +// +// return Promise.resolve(pluginsContent) +// .then(editor.tools[pluginName].save) +// .then(data => Object({data, pluginName})); +// +// }; +// +// /** +// * Call plugin`s validate method. Return false if validation failed +// * +// * @param data +// * @param pluginName +// * @returns {Object|Boolean} +// */ +// let validateBlockData = function ({data, pluginName}) { +// +// if (!data || !pluginName) { +// +// return false; +// +// } +// +// if (editor.tools[pluginName].validate) { +// +// let result = editor.tools[pluginName].validate(data); +// +// /** +// * Do not allow invalid data +// */ +// if (!result) { +// +// return false; +// +// } +// +// } +// +// return {data, pluginName}; +// +// +// }; +// +// /** +// * Compile article output +// * +// * @param savedData +// * @returns {{time: number, version, items: (*|Array)}} +// */ +// let makeOutput = function (savedData) { +// +// savedData = savedData.filter(blockData => blockData); +// +// let items = savedData.map(blockData => Object({type: blockData.pluginName, data: blockData.data})); +// +// editor.state.jsonOutput = items; +// +// return { +// id: editor.state.blocks.id || null, +// time: +new Date(), +// version: editor.version, +// items +// }; +// +// }; +// +// return saver; +// +// })({}); diff --git a/src/components/modules/toolbar-blockSettings.js b/src/components/modules/toolbar-blockSettings.js new file mode 100644 index 00000000..e57163d8 --- /dev/null +++ b/src/components/modules/toolbar-blockSettings.js @@ -0,0 +1,126 @@ +/** + * Block Settings + * + * ____ Settings Panel ____ + * | ...................... | + * | . Tool Settings . | + * | ...................... | + * | . Default Settings . | + * | ...................... | + * |________________________| + */ +export default class BlockSettings extends Module { + /** + * @constructor + */ + constructor({config}) { + super({config}); + + this.nodes = { + wrapper: null, + toolSettings: null, + defaultSettings: null + }; + } + + /** + * Module Events + * @return {{opened: string, closed: string}} + */ + get events() { + return { + opened: 'block-settings-opened', + closed: 'block-settings-closed', + }; + } + + /** + * Block Settings CSS + * @return {{wrapper, wrapperOpened, toolSettings, defaultSettings, button}} + */ + static get CSS() { + return { + // Settings Panel + wrapper: 'ce-settings', + wrapperOpened: 'ce-settings--opened', + toolSettings: 'ce-settings__plugin-zone', + defaultSettings: 'ce-settings__default-zone', + + button: 'ce-settings__button' + }; + } + + /** + * Panel with block settings with 2 sections: + * - Tool's Settings + * - Default Settings [Move, Remove, etc] + * + * @return {Element} + */ + make() { + this.nodes.wrapper = $.make('div', BlockSettings.CSS.wrapper); + + this.nodes.toolSettings = $.make('div', BlockSettings.CSS.toolSettings); + this.nodes.defaultSettings = $.make('div', BlockSettings.CSS.defaultSettings); + + $.append(this.nodes.wrapper, [this.nodes.toolSettings, this.nodes.defaultSettings]); + } + + /** + * Add Tool's settings + */ + addToolSettings() { + if (typeof this.Editor.BlockManager.currentBlock.tool.renderSettings === 'function') { + $.append(this.nodes.toolSettings, this.Editor.BlockManager.currentBlock.tool.renderSettings()); + } + } + + /** + * Add default settings + */ + addDefaultSettings() { + $.append(this.nodes.defaultSettings, this.Editor.BlockManager.currentBlock.renderTunes()); + } + + /** + * Is Block Settings opened or not + * @returns {boolean} + */ + get opened() { + return this.nodes.wrapper.classList.contains(BlockSettings.CSS.wrapperOpened); + } + + /** + * Open Block Settings pane + */ + open() { + this.nodes.wrapper.classList.add(BlockSettings.CSS.wrapperOpened); + + /** + * Fill Tool's settings + */ + this.addToolSettings(); + + /** + * Add default settings that presents for all Blocks + */ + this.addDefaultSettings(); + + /** Tell to subscribers that block settings is opened */ + this.Editor.Events.emit(this.events.opened); + } + + /** + * Close Block Settings pane + */ + close() { + this.nodes.wrapper.classList.remove(BlockSettings.CSS.wrapperOpened); + + /** Clear settings */ + this.nodes.toolSettings.innerHTML = ''; + this.nodes.defaultSettings.innerHTML = ''; + + /** Tell to subscribers that block settings is closed */ + this.Editor.Events.emit(this.events.closed); + } +} diff --git a/src/components/modules/toolbar-inline.ts b/src/components/modules/toolbar-inline.ts new file mode 100644 index 00000000..b5aaa930 --- /dev/null +++ b/src/components/modules/toolbar-inline.ts @@ -0,0 +1,276 @@ +/** + * Inline toolbar with actions that modifies selected text fragment + * + * |¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯| + * | B i [link] [mark] | + * | _______________________| + */ +declare var Module: any; +declare var $: any; +declare var _: any; +import BoldInlineTool from '../inline-tools/inline-tool-bold'; +import ItalicInlineTool from '../inline-tools/inline-tool-italic'; +import LinkInlineTool from '../inline-tools/inline-tool-link'; +import InlineTool from '../interfaces/inline-tool'; +import Selection from '../selection'; + +export default class InlineToolbar extends Module { + + /** + * CSS styles + */ + public CSS = { + inlineToolbar: 'ce-inline-toolbar', + inlineToolbarShowed: 'ce-inline-toolbar--showed', + buttonsWrapper: 'ce-inline-toolbar__buttons', + actionsWrapper: 'ce-inline-toolbar__actions', + }; + + /** + * Inline Toolbar elements + */ + private nodes = { + wrapper: null, + buttons: null, + /** + * Zone below the buttons where Tools can create additional actions by 'renderActions()' method + * For example, input for the 'link' tool or textarea for the 'comment' tool + */ + actions: null, + }; + + /** + * Margin above/below the Toolbar + */ + private readonly toolbarVerticalMargin: number = 20; + + /** + * Tools instances + */ + private toolsInstances: InlineTool[]; + + /** + * @constructor + */ + constructor({config}) { + super({config}); + } + + /** + * Inline Toolbar Tools + * @todo Merge internal tools with external + */ + get tools(): InlineTool[] { + if (!this.toolsInstances) { + this.toolsInstances = [ + new BoldInlineTool(this.Editor.API.methods), + new ItalicInlineTool(this.Editor.API.methods), + new LinkInlineTool(this.Editor.API.methods), + ...this.Editor.Tools.inline.map( (Tool) => new Tool(this.Editor.API.methods) ), + ]; + } + return this.toolsInstances; + } + + /** + * Making DOM + */ + public make() { + + this.nodes.wrapper = $.make('div', this.CSS.inlineToolbar); + this.nodes.buttons = $.make('div', this.CSS.buttonsWrapper); + this.nodes.actions = $.make('div', this.CSS.actionsWrapper); + + /** + * Append Inline Toolbar to the Editor + */ + $.append(this.nodes.wrapper, [this.nodes.buttons, this.nodes.actions]); + $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper); + + /** + * Append Inline Toolbar Tools + */ + this.addTools(); + + } + + /** + * + * + * Moving / appearance + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + */ + + /** + * Shows Inline Toolbar by keyup/mouseup + * @param {KeyboardEvent|MouseEvent} event + */ + public handleShowingEvent(event): void { + if (!this.allowedToShow(event)) { + this.close(); + return; + } + + this.move(); + this.open(); + + /** Check Tools state for selected fragment */ + this.checkToolsState(); + } + + /** + * Move Toolbar to the selected text + */ + public move(): void { + + const selectionRect = Selection.rect; + const wrapperOffset = this.Editor.UI.nodes.wrapper.getBoundingClientRect(); + + const newCoords = { + x: selectionRect.x - wrapperOffset.left, + y: selectionRect.y + + selectionRect.height + // + window.scrollY + - wrapperOffset.top + + this.toolbarVerticalMargin, + }; + + /** + * If we know selections width, place InlineToolbar to center + */ + if (selectionRect.width) { + newCoords.x += Math.floor(selectionRect.width / 2); + } + + this.nodes.wrapper.style.left = Math.floor(newCoords.x) + 'px'; + this.nodes.wrapper.style.top = Math.floor(newCoords.y) + 'px'; + } + + /** + * Shows Inline Toolbar + */ + private open() { + this.nodes.wrapper.classList.add(this.CSS.inlineToolbarShowed); + + this.tools.forEach( (tool) => { + if (typeof tool.clear === 'function') { + tool.clear(); + } + }); + } + + /** + * Hides Inline Toolbar + */ + private close() { + this.nodes.wrapper.classList.remove(this.CSS.inlineToolbarShowed); + + this.tools.forEach( (tool) => { + if (typeof tool.clear === 'function') { + tool.clear(); + } + }); + } + + /** + * Need to show Inline Toolbar or not + * @param {KeyboardEvent|MouseEvent} event + */ + private allowedToShow(event): boolean { + /** + * Tags conflicts with window.selection function. + * Ex. IMG tag returns null (Firefox) or Redactors wrapper (Chrome) + */ + const tagsConflictsWithSelection = ['IMG', 'INPUT']; + if (event && tagsConflictsWithSelection.includes(event.target.tagName)) { + return false; + } + + const currentSelection = Selection.get(), + selectedText = Selection.text; + + // old browsers + if (!currentSelection || !currentSelection.anchorNode) { + return false; + } + + // empty selection + if (currentSelection.isCollapsed || selectedText.length < 1) { + return false; + } + + // is enabled by current Block's Tool + const currentBlock = this.Editor.BlockManager.getBlock(currentSelection.anchorNode); + + if (!currentBlock) { + return false; + } + + const toolConfig = this.config.toolsConfig[currentBlock.name]; + + return toolConfig && toolConfig[this.Editor.Tools.apiSettings.IS_ENABLED_INLINE_TOOLBAR]; + } + + /** + * + * + * Working with Tools + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + */ + + /** + * Fill Inline Toolbar with Tools + */ + private addTools(): void { + this.tools.forEach( (tool) => { + this.addTool(tool); + }); + } + + /** + * Add tool button and activate clicks + * @param {InlineTool} tool - Tool's instance + */ + private addTool(tool: InlineTool): void { + const button = tool.render(); + + if (!button) { + _.log('Render method must return an instance of Node', 'warn', tool); + return; + } + + this.nodes.buttons.appendChild(button); + + if (typeof tool.renderActions === 'function') { + const actions = tool.renderActions(); + this.nodes.actions.appendChild(actions); + } + + this.Editor.Listeners.on(button, 'click', () => { + this.toolClicked(tool); + }); + } + + /** + * Inline Tool button clicks + * @param {InlineTool} tool - Tool's instance + */ + private toolClicked(tool: InlineTool): void { + const range = Selection.range; + + tool.surround(range); + this.checkToolsState(); + + } + + /** + * Check Tools` state by selection + */ + private checkToolsState(): void { + this.tools.forEach( (tool) => { + tool.checkState(Selection.get()); + }); + } +} diff --git a/src/components/modules/toolbar-toolbox.js b/src/components/modules/toolbar-toolbox.js new file mode 100644 index 00000000..ae3be68a --- /dev/null +++ b/src/components/modules/toolbar-toolbox.js @@ -0,0 +1,198 @@ +/** + * @class Toolbox + * @classdesc Holder for Tools + * + * @typedef {Toolbox} Toolbox + * @property {Boolean} opened - opening state + * @property {Object} nodes - Toolbox nodes + * @property {Object} CSS - CSS class names + * + */ +export default class Toolbox extends Module { + /** + * @constructor + */ + constructor({config}) { + super({config}); + + this.nodes = { + toolbox: null, + buttons: [] + }; + + /** + * Opening state + * @type {boolean} + */ + this.opened = false; + } + + /** + * CSS styles + * @return {{toolbox: string, toolboxButton: string, toolboxOpened: string}} + */ + static get CSS() { + return { + toolbox: 'ce-toolbox', + toolboxButton: 'ce-toolbox__button', + toolboxOpened: 'ce-toolbox--opened', + }; + } + + /** + * Makes the Toolbox + */ + make() { + this.nodes.toolbox = $.make('div', Toolbox.CSS.toolbox); + $.append(this.Editor.Toolbar.nodes.content, this.nodes.toolbox); + + this.addTools(); + } + + /** + * Iterates available tools and appends them to the Toolbox + */ + addTools() { + let tools = this.Editor.Tools.toolsAvailable; + + for (let toolName in tools) { + this.addTool(toolName, tools[toolName]); + } + } + + /** + * Append Tool to the Toolbox + * + * @param {string} toolName - tool name + * @param {IBlockTool} tool - tool class + */ + addTool(toolName, tool) { + const api = this.Editor.Tools.apiSettings; + + if (tool[api.IS_DISPLAYED_IN_TOOLBOX] && !tool[api.TOOLBAR_ICON_CLASS]) { + _.log('Toolbar icon class name is missed. Tool %o skipped', 'warn', toolName); + return; + } + + /** + * @todo Add checkup for the render method + */ + // if (typeof tool.render !== 'function') { + // + // _.log('render method missed. Tool %o skipped', 'warn', tool); + // return; + // + // } + + /** + * Skip tools that pass 'displayInToolbox=false' + */ + if (!tool[api.IS_DISPLAYED_IN_TOOLBOX]) { + return; + } + + let button = $.make('li', [Toolbox.CSS.toolboxButton, tool[api.TOOLBAR_ICON_CLASS]], { + title: toolName + }); + + button.innerHTML = tool.toolboxIcon; + + /** + * Save tool's name in the button data-name + */ + button.dataset.name = toolName; + + $.append(this.nodes.toolbox, button); + + this.nodes.toolbox.appendChild(button); + this.nodes.buttons.push(button); + + /** + * @todo add event with module Listeners + */ + // this.Editor.Listeners.add(); + button.addEventListener('click', event => { + this.buttonClicked(event); + }, false); + } + + /** + * Toolbox button click listener + * 1) if block is empty -> replace + * 2) if block is not empty -> add new block below + * + * @param {MouseEvent} event + */ + buttonClicked(event) { + let toolButton = event.target; + + toolButton = toolButton.closest(`.${Toolbox.CSS.toolboxButton}`); + + if (!toolButton) { + return; + } + + let toolName = toolButton.dataset.name, + tool = this.Editor.Tools.toolClasses[toolName]; + + /** + * @type {Block} + */ + let currentBlock = this.Editor.BlockManager.currentBlock; + + /** + * We do replace if: + * - block is empty + * - block is not irreplaceable + * @type {Array} + */ + if (!tool[this.Editor.Tools.apiSettings.IS_IRREPLACEBLE_TOOL] && currentBlock.isEmpty) { + this.Editor.BlockManager.replace(toolName); + } else { + this.Editor.BlockManager.insert(toolName); + } + + /** + * @todo set caret to the new block + */ + + // window.setTimeout(function () { + + /** Set caret to current block */ + // editor.caret.setToBlock(currentInputIndex); + + // }, 10); + + /** + * Move toolbar when node is changed + */ + this.Editor.Toolbar.move(); + } + + /** + * Open Toolbox with Tools + */ + open() { + this.nodes.toolbox.classList.add(Toolbox.CSS.toolboxOpened); + this.opened = true; + } + + /** + * Close Toolbox + */ + close() { + this.nodes.toolbox.classList.remove(Toolbox.CSS.toolboxOpened); + this.opened = false; + } + + /** + * Close Toolbox + */ + toggle() { + if (!this.opened) { + this.open(); + } else { + this.close(); + } + } +} diff --git a/src/components/modules/toolbar.js b/src/components/modules/toolbar.js new file mode 100644 index 00000000..be82e6d1 --- /dev/null +++ b/src/components/modules/toolbar.js @@ -0,0 +1,246 @@ +/** + * + * «Toolbar» is the node that moves up/down over current block + * + * ______________________________________ Toolbar ____________________________________________ + * | | + * | ..................... Content .................... ......... Block Actions .......... | + * | . . . . | + * | . . . [Open Settings] . | + * | . [Plus Button] [Toolbox: {Tool1}, {Tool2}] . . . | + * | . . . [Settings Panel] . | + * | .................................................. .................................. | + * | | + * |___________________________________________________________________________________________| + * + * + * Toolbox — its an Element contains tools buttons. Can be shown by Plus Button. + * + * _______________ Toolbox _______________ + * | | + * | [Header] [Image] [List] [Quote] ... | + * |_______________________________________| + * + * + * Settings Panel — is an Element with block settings: + * + * ____ Settings Panel ____ + * | ...................... | + * | . Tool Settings . | + * | ...................... | + * | . Default Settings . | + * | ...................... | + * |________________________| + * + * + * @class + * @classdesc Toolbar module + * + * @typedef {Toolbar} Toolbar + * @property {Object} nodes + * @property {Element} nodes.wrapper - Toolbar main element + * @property {Element} nodes.content - Zone with Plus button and toolbox. + * @property {Element} nodes.actions - Zone with Block Settings and Remove Button + * @property {Element} nodes.blockActionsButtons - Zone with Block Buttons: [Settings] + * @property {Element} nodes.plusButton - Button that opens or closes Toolbox + * @property {Element} nodes.toolbox - Container for tools + * @property {Element} nodes.settingsToggler - open/close Settings Panel button + * @property {Element} nodes.settings - Settings Panel + * @property {Element} nodes.pluginSettings - Plugin Settings section of Settings Panel + * @property {Element} nodes.defaultSettings - Default Settings section of Settings Panel + */ +export default class Toolbar extends Module { + /** + * @constructor + */ + constructor({config}) { + super({config}); + + this.nodes = { + wrapper : null, + content : null, + actions : null, + + // Content Zone + plusButton : null, + + // Actions Zone + blockActionsButtons: null, + settingsToggler : null, + }; + } + + /** + * CSS styles + * @return {Object} + * @constructor + */ + static get CSS() { + return { + toolbar: 'ce-toolbar', + content: 'ce-toolbar__content', + actions: 'ce-toolbar__actions', + + toolbarOpened: 'ce-toolbar--opened', + + // Content Zone + plusButton: 'ce-toolbar__plus', + plusButtonHidden: 'ce-toolbar__plus--hidden', + + // Actions Zone + blockActionsButtons: 'ce-toolbar__actions-buttons', + settingsToggler: 'ce-toolbar__settings-btn', + }; + } + + /** + * Makes toolbar + */ + make() { + this.nodes.wrapper = $.make('div', Toolbar.CSS.toolbar); + + /** + * Make Content Zone and Actions Zone + */ + ['content', 'actions'].forEach( el => { + this.nodes[el] = $.make('div', Toolbar.CSS[el]); + $.append(this.nodes.wrapper, this.nodes[el]); + }); + + + /** + * Fill Content Zone: + * - Plus Button + * - Toolbox + */ + this.nodes.plusButton = $.make('div', Toolbar.CSS.plusButton); + $.append(this.nodes.plusButton, $.svg('plus', 14, 14)); + $.append(this.nodes.content, this.nodes.plusButton); + this.nodes.plusButton.addEventListener('click', event => this.plusButtonClicked(event), false); + + + /** + * Make a Toolbox + */ + this.Editor.Toolbox.make(); + + /** + * Fill Actions Zone: + * - Settings Toggler + * - Remove Block Button + * - Settings Panel + */ + this.nodes.blockActionsButtons = $.make('div', Toolbar.CSS.blockActionsButtons); + this.nodes.settingsToggler = $.make('span', Toolbar.CSS.settingsToggler); + const settingsIcon = $.svg('dots', 18, 4); + + $.append(this.nodes.settingsToggler, settingsIcon); + $.append(this.nodes.blockActionsButtons, this.nodes.settingsToggler); + $.append(this.nodes.actions, this.nodes.blockActionsButtons); + + /** + * Make and append Settings Panel + */ + this.Editor.BlockSettings.make(); + $.append(this.nodes.actions, this.Editor.BlockSettings.nodes.wrapper); + + /** + * Append toolbar to the Editor + */ + $.append(this.Editor.UI.nodes.wrapper, this.nodes.wrapper); + + /** + * Bind events on the Toolbar elements + */ + this.bindEvents(); + } + + /** + * Move Toolbar to the Current Block + * @param {Boolean} forceClose - force close Toolbar Settings and Toolbar + */ + move(forceClose = true) { + if (forceClose) { + /** Close Toolbox when we move toolbar */ + this.Editor.Toolbox.close(); + this.Editor.BlockSettings.close(); + } + + let currentNode = this.Editor.BlockManager.currentNode; + + /** + * If no one Block selected as a Current + */ + if (!currentNode) { + return; + } + + /** + * @todo Compute dynamically on prepare + * @type {number} + */ + const defaultToolbarHeight = 49; + const defaultOffset = 34; + + var newYCoordinate = currentNode.offsetTop - (defaultToolbarHeight / 2) + defaultOffset; + + this.nodes.wrapper.style.transform = `translate3D(0, ${Math.floor(newYCoordinate)}px, 0)`; + } + + /** + * Open Toolbar with Plus Button + */ + open() { + this.nodes.wrapper.classList.add(Toolbar.CSS.toolbarOpened); + } + + /** + * Close the Toolbar + */ + close() { + this.nodes.wrapper.classList.remove(Toolbar.CSS.toolbarOpened); + } + + /** + * Plus Button public methods + * @return {{hide: function(): void, show: function(): void}} + */ + get plusButton() { + return { + hide: () => this.nodes.plusButton.classList.add(Toolbar.CSS.plusButtonHidden), + show: () => this.nodes.plusButton.classList.remove(Toolbar.CSS.plusButtonHidden) + }; + } + + /** + * Handler for Plus Button + * @param {MouseEvent} event + */ + plusButtonClicked() { + this.Editor.Toolbox.toggle(); + } + + /** + * Bind events on the Toolbar Elements: + * - Block Settings + */ + bindEvents() { + /** + * Settings toggler + */ + this.Editor.Listeners.on(this.nodes.settingsToggler, 'click', (event) => { + this.settingsTogglerClicked(event); + }); + } + + /** + * Clicks on the Block Settings toggler + */ + settingsTogglerClicked() { + if (this.Editor.BlockSettings.opened) { + this.Editor.BlockSettings.close(); + } else { + this.Editor.BlockSettings.open(); + } + } +} diff --git a/src/components/modules/toolbar/inline.js b/src/components/modules/toolbar/inline.js new file mode 100644 index 00000000..fb50e8dd --- /dev/null +++ b/src/components/modules/toolbar/inline.js @@ -0,0 +1,490 @@ +/** + * Inline toolbar + * + * Contains from tools: + * Bold, Italic, Underline and Anchor + * + * @author Codex Team + * @version 1.0 + */ + +module.exports = (function (inline) { + let editor = codex.editor; + + inline.buttonsOpened = null; + inline.actionsOpened = null; + inline.wrappersOffset = null; + + /** + * saving selection that need for execCommand for styling + * + */ + inline.storedSelection = null; + + /** + * @protected + * + * Open inline toobar + */ + inline.show = function () { + var currentNode = editor.content.currentNode, + tool = currentNode.dataset.tool, + plugin; + + /** + * tool allowed to open inline toolbar + */ + plugin = editor.tools[tool]; + + if (!plugin.showInlineToolbar) + return; + + var selectedText = inline.getSelectionText(), + toolbar = editor.nodes.inlineToolbar.wrapper; + + if (selectedText.length > 0) { + /** Move toolbar and open */ + editor.toolbar.inline.move(); + + /** Open inline toolbar */ + toolbar.classList.add('opened'); + + /** show buttons of inline toolbar */ + editor.toolbar.inline.showButtons(); + } + }; + + /** + * @protected + * + * Closes inline toolbar + */ + inline.close = function () { + var toolbar = editor.nodes.inlineToolbar.wrapper; + + toolbar.classList.remove('opened'); + }; + + /** + * @private + * + * Moving toolbar + */ + inline.move = function () { + if (!this.wrappersOffset) { + this.wrappersOffset = this.getWrappersOffset(); + } + + var coords = this.getSelectionCoords(), + defaultOffset = 0, + toolbar = editor.nodes.inlineToolbar.wrapper, + newCoordinateX, + newCoordinateY; + + if (toolbar.offsetHeight === 0) { + defaultOffset = 40; + } + + newCoordinateX = coords.x - this.wrappersOffset.left; + newCoordinateY = coords.y + window.scrollY - this.wrappersOffset.top - defaultOffset - toolbar.offsetHeight; + + toolbar.style.transform = `translate3D(${Math.floor(newCoordinateX)}px, ${Math.floor(newCoordinateY)}px, 0)`; + + /** Close everything */ + editor.toolbar.inline.closeButtons(); + editor.toolbar.inline.closeAction(); + }; + + /** + * @private + * + * Tool Clicked + */ + + inline.toolClicked = function (event, type) { + /** + * For simple tools we use default browser function + * For more complicated tools, we should write our own behavior + */ + switch (type) { + case 'createLink' : editor.toolbar.inline.createLinkAction(event, type); break; + default : editor.toolbar.inline.defaultToolAction(type); break; + } + + /** + * highlight buttons + * after making some action + */ + editor.nodes.inlineToolbar.buttons.childNodes.forEach(editor.toolbar.inline.hightlight); + }; + + /** + * @private + * + * Saving wrappers offset in DOM + */ + inline.getWrappersOffset = function () { + var wrapper = editor.nodes.wrapper, + offset = this.getOffset(wrapper); + + this.wrappersOffset = offset; + return offset; + }; + + /** + * @private + * + * Calculates offset of DOM element + * + * @param el + * @returns {{top: number, left: number}} + */ + inline.getOffset = function ( el ) { + var _x = 0; + var _y = 0; + + while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) { + _x += (el.offsetLeft + el.clientLeft); + _y += (el.offsetTop + el.clientTop); + el = el.offsetParent; + } + return { top: _y, left: _x }; + }; + + /** + * @private + * + * Calculates position of selected text + * @returns {{x: number, y: number}} + */ + inline.getSelectionCoords = function () { + var sel = document.selection, range; + var x = 0, y = 0; + + if (sel) { + if (sel.type != 'Control') { + range = sel.createRange(); + range.collapse(true); + x = range.boundingLeft; + y = range.boundingTop; + } + } else if (window.getSelection) { + sel = window.getSelection(); + + if (sel.rangeCount) { + range = sel.getRangeAt(0).cloneRange(); + if (range.getClientRects) { + range.collapse(true); + var rect = range.getClientRects()[0]; + + if (!rect) { + return; + } + + x = rect.left; + y = rect.top; + } + } + } + return { x: x, y: y }; + }; + + /** + * @private + * + * Returns selected text as String + * @returns {string} + */ + inline.getSelectionText = function () { + var selectedText = ''; + + // all modern browsers and IE9+ + if (window.getSelection) { + selectedText = window.getSelection().toString(); + } + + return selectedText; + }; + + /** Opens buttons block */ + inline.showButtons = function () { + var buttons = editor.nodes.inlineToolbar.buttons; + + buttons.classList.add('opened'); + + editor.toolbar.inline.buttonsOpened = true; + + /** highlight buttons */ + editor.nodes.inlineToolbar.buttons.childNodes.forEach(editor.toolbar.inline.hightlight); + }; + + /** Makes buttons disappear */ + inline.closeButtons = function () { + var buttons = editor.nodes.inlineToolbar.buttons; + + buttons.classList.remove('opened'); + + editor.toolbar.inline.buttonsOpened = false; + }; + + /** Open buttons defined action if exist */ + inline.showActions = function () { + var action = editor.nodes.inlineToolbar.actions; + + action.classList.add('opened'); + + editor.toolbar.inline.actionsOpened = true; + }; + + /** Close actions block */ + inline.closeAction = function () { + var action = editor.nodes.inlineToolbar.actions; + + action.innerHTML = ''; + action.classList.remove('opened'); + editor.toolbar.inline.actionsOpened = false; + }; + + + /** + * Callback for keydowns in inline toolbar "Insert link..." input + */ + let inlineToolbarAnchorInputKeydown_ = function (event) { + if (event.keyCode != editor.core.keys.ENTER) { + return; + } + + let editable = editor.content.currentNode, + storedSelection = editor.toolbar.inline.storedSelection; + + editor.toolbar.inline.restoreSelection(editable, storedSelection); + editor.toolbar.inline.setAnchor(this.value); + + /** + * Preventing events that will be able to happen + */ + event.preventDefault(); + event.stopImmediatePropagation(); + + editor.toolbar.inline.clearRange(); + }; + + /** Action for link creation or for setting anchor */ + inline.createLinkAction = function (event) { + var isActive = this.isLinkActive(); + + var editable = editor.content.currentNode, + storedSelection = editor.toolbar.inline.saveSelection(editable); + + /** Save globally selection */ + editor.toolbar.inline.storedSelection = storedSelection; + + if (isActive) { + /** + * Changing stored selection. if we want to remove anchor from word + * we should remove anchor from whole word, not only selected part. + * The solution is than we get the length of current link + * Change start position to - end of selection minus length of anchor + */ + editor.toolbar.inline.restoreSelection(editable, storedSelection); + + editor.toolbar.inline.defaultToolAction('unlink'); + } else { + /** Create input and close buttons */ + var action = editor.draw.inputForLink(); + + editor.nodes.inlineToolbar.actions.appendChild(action); + + editor.toolbar.inline.closeButtons(); + editor.toolbar.inline.showActions(); + + /** + * focus to input + * Solution: https://developer.mozilla.org/ru/docs/Web/API/HTMLElement/focus + * Prevents event after showing input and when we need to focus an input which is in unexisted form + */ + action.focus(); + event.preventDefault(); + + /** Callback to link action */ + editor.listeners.add(action, 'keydown', inlineToolbarAnchorInputKeydown_, false); + } + }; + + inline.isLinkActive = function () { + var isActive = false; + + editor.nodes.inlineToolbar.buttons.childNodes.forEach(function (tool) { + var dataType = tool.dataset.type; + + if (dataType == 'link' && tool.classList.contains('hightlighted')) { + isActive = true; + } + }); + + return isActive; + }; + + /** default action behavior of tool */ + inline.defaultToolAction = function (type) { + document.execCommand(type, false, null); + }; + + /** + * @private + * + * Sets URL + * + * @param {String} url - URL + */ + inline.setAnchor = function (url) { + document.execCommand('createLink', false, url); + + /** Close after URL inserting */ + editor.toolbar.inline.closeAction(); + }; + + /** + * @private + * + * Saves selection + */ + inline.saveSelection = function (containerEl) { + var range = window.getSelection().getRangeAt(0), + preSelectionRange = range.cloneRange(), + start; + + preSelectionRange.selectNodeContents(containerEl); + preSelectionRange.setEnd(range.startContainer, range.startOffset); + + start = preSelectionRange.toString().length; + + return { + start: start, + end: start + range.toString().length + }; + }; + + /** + * @private + * + * Sets to previous selection (Range) + * + * @param {Element} containerEl - editable element where we restore range + * @param {Object} savedSel - range basic information to restore + */ + inline.restoreSelection = function (containerEl, savedSel) { + var range = document.createRange(), + charIndex = 0; + + range.setStart(containerEl, 0); + range.collapse(true); + + var nodeStack = [ containerEl ], + node, + foundStart = false, + stop = false, + nextCharIndex; + + while (!stop && (node = nodeStack.pop())) { + if (node.nodeType == 3) { + nextCharIndex = charIndex + node.length; + + if (!foundStart && savedSel.start >= charIndex && savedSel.start <= nextCharIndex) { + range.setStart(node, savedSel.start - charIndex); + foundStart = true; + } + if (foundStart && savedSel.end >= charIndex && savedSel.end <= nextCharIndex) { + range.setEnd(node, savedSel.end - charIndex); + stop = true; + } + charIndex = nextCharIndex; + } else { + var i = node.childNodes.length; + + while (i--) { + nodeStack.push(node.childNodes[i]); + } + } + } + + var sel = window.getSelection(); + + sel.removeAllRanges(); + sel.addRange(range); + }; + + /** + * @private + * + * Removes all ranges from window selection + */ + inline.clearRange = function () { + var selection = window.getSelection(); + + selection.removeAllRanges(); + }; + + /** + * @private + * + * sets or removes hightlight + */ + inline.hightlight = function (tool) { + var dataType = tool.dataset.type; + + if (document.queryCommandState(dataType)) { + editor.toolbar.inline.setButtonHighlighted(tool); + } else { + editor.toolbar.inline.removeButtonsHighLight(tool); + } + + /** + * + * hightlight for anchors + */ + var selection = window.getSelection(), + tag = selection.anchorNode.parentNode; + + if (tag.tagName == 'A' && dataType == 'link') { + editor.toolbar.inline.setButtonHighlighted(tool); + } + }; + + /** + * @private + * + * Mark button if text is already executed + */ + inline.setButtonHighlighted = function (button) { + button.classList.add('hightlighted'); + + /** At link tool we also change icon */ + if (button.dataset.type == 'link') { + var icon = button.childNodes[0]; + + icon.classList.remove('ce-icon-link'); + icon.classList.add('ce-icon-unlink'); + } + }; + + /** + * @private + * + * Removes hightlight + */ + inline.removeButtonsHighLight = function (button) { + button.classList.remove('hightlighted'); + + /** At link tool we also change icon */ + if (button.dataset.type == 'link') { + var icon = button.childNodes[0]; + + icon.classList.remove('ce-icon-unlink'); + icon.classList.add('ce-icon-link'); + } + }; + + + return inline; +})({}); \ No newline at end of file diff --git a/src/components/modules/toolbar/settings.js b/src/components/modules/toolbar/settings.js new file mode 100644 index 00000000..34cf423a --- /dev/null +++ b/src/components/modules/toolbar/settings.js @@ -0,0 +1,140 @@ +/** + * Toolbar settings + * + * @version 1.0.5 + */ + +module.exports = (function (settings) { + let editor = codex.editor; + + settings.opened = false; + + settings.setting = null; + settings.actions = null; + + /** + * Append and open settings + */ + settings.open = function (toolType) { + /** + * Append settings content + * It's stored in tool.settings + */ + if ( !editor.tools[toolType] || !editor.tools[toolType].renderSettings ) { + return; + } + + /** + * Draw settings block + */ + var settingsBlock = editor.tools[toolType].renderSettings(); + + editor.nodes.pluginSettings.appendChild(settingsBlock); + + + /** Open settings block */ + editor.nodes.blockSettings.classList.add('opened'); + this.opened = true; + }; + + /** + * Close and clear settings + */ + settings.close = function () { + editor.nodes.blockSettings.classList.remove('opened'); + editor.nodes.pluginSettings.innerHTML = ''; + + this.opened = false; + }; + + /** + * @param {string} toolType - plugin type + */ + settings.toggle = function ( toolType ) { + if ( !this.opened ) { + this.open(toolType); + } else { + this.close(); + } + }; + + /** + * Here we will draw buttons and add listeners to components + */ + settings.makeRemoveBlockButton = function () { + var removeBlockWrapper = editor.draw.node('SPAN', 'ce-toolbar__remove-btn', {}), + settingButton = editor.draw.node('SPAN', 'ce-toolbar__remove-setting', { innerHTML : '' }), + actionWrapper = editor.draw.node('DIV', 'ce-toolbar__remove-confirmation', {}), + confirmAction = editor.draw.node('DIV', 'ce-toolbar__remove-confirm', { textContent : 'Удалить блок' }), + cancelAction = editor.draw.node('DIV', 'ce-toolbar__remove-cancel', { textContent : 'Отмена' }); + + editor.listeners.add(settingButton, 'click', editor.toolbar.settings.removeButtonClicked, false); + + editor.listeners.add(confirmAction, 'click', editor.toolbar.settings.confirmRemovingRequest, false); + + editor.listeners.add(cancelAction, 'click', editor.toolbar.settings.cancelRemovingRequest, false); + + actionWrapper.appendChild(confirmAction); + actionWrapper.appendChild(cancelAction); + + removeBlockWrapper.appendChild(settingButton); + removeBlockWrapper.appendChild(actionWrapper); + + /** Save setting */ + editor.toolbar.settings.setting = settingButton; + editor.toolbar.settings.actions = actionWrapper; + + return removeBlockWrapper; + }; + + settings.removeButtonClicked = function () { + var action = editor.toolbar.settings.actions; + + if (action.classList.contains('opened')) { + editor.toolbar.settings.hideRemoveActions(); + } else { + editor.toolbar.settings.showRemoveActions(); + } + + editor.toolbar.toolbox.close(); + editor.toolbar.settings.close(); + }; + + settings.cancelRemovingRequest = function () { + editor.toolbar.settings.actions.classList.remove('opened'); + }; + + settings.confirmRemovingRequest = function () { + var currentBlock = editor.content.currentNode, + firstLevelBlocksCount; + + currentBlock.remove(); + + firstLevelBlocksCount = editor.nodes.redactor.childNodes.length; + + /** + * If all blocks are removed + */ + if (firstLevelBlocksCount === 0) { + /** update currentNode variable */ + editor.content.currentNode = null; + + /** Inserting new empty initial block */ + editor.ui.addInitialBlock(); + } + + editor.ui.saveInputs(); + + editor.toolbar.close(); + }; + + settings.showRemoveActions = function () { + editor.toolbar.settings.actions.classList.add('opened'); + }; + + settings.hideRemoveActions = function () { + editor.toolbar.settings.actions.classList.remove('opened'); + }; + + return settings; +})({}); diff --git a/src/components/modules/toolbar/toolbar.js b/src/components/modules/toolbar/toolbar.js new file mode 100644 index 00000000..1ce427f3 --- /dev/null +++ b/src/components/modules/toolbar/toolbar.js @@ -0,0 +1,105 @@ +/** + * Codex Editor toolbar module + * + * Contains: + * - Inline toolbox + * - Toolbox within plus button + * - Settings section + * + * @author Codex Team + * @version 1.0 + */ + +module.exports = (function (toolbar) { + let editor = codex.editor; + + toolbar.settings = require('./settings'); + toolbar.inline = require('./inline'); + toolbar.toolbox = require('./toolbox'); + + /** + * Margin between focused node and toolbar + */ + toolbar.defaultToolbarHeight = 49; + + toolbar.defaultOffset = 34; + + toolbar.opened = false; + + toolbar.current = null; + + /** + * @protected + */ + toolbar.open = function () { + if (editor.hideToolbar) { + return; + } + + let toolType = editor.content.currentNode.dataset.tool; + + if (!editor.tools[toolType] || !editor.tools[toolType].renderSettings ) { + editor.nodes.showSettingsButton.classList.add('hide'); + } else { + editor.nodes.showSettingsButton.classList.remove('hide'); + } + + editor.nodes.toolbar.classList.add('opened'); + this.opened = true; + }; + + /** + * @protected + */ + toolbar.close = function () { + editor.nodes.toolbar.classList.remove('opened'); + + toolbar.opened = false; + toolbar.current = null; + + for (var button in editor.nodes.toolbarButtons) { + editor.nodes.toolbarButtons[button].classList.remove('selected'); + } + + /** Close toolbox when toolbar is not displayed */ + editor.toolbar.toolbox.close(); + editor.toolbar.settings.close(); + }; + + toolbar.toggle = function () { + if ( !this.opened ) { + this.open(); + } else { + this.close(); + } + }; + + toolbar.hidePlusButton = function () { + editor.nodes.plusButton.classList.add('hide'); + }; + + toolbar.showPlusButton = function () { + editor.nodes.plusButton.classList.remove('hide'); + }; + + /** + * Moving toolbar to the specified node + */ + toolbar.move = function () { + /** Close Toolbox when we move toolbar */ + editor.toolbar.toolbox.close(); + + if (!editor.content.currentNode) { + return; + } + + var newYCoordinate = editor.content.currentNode.offsetTop - (editor.toolbar.defaultToolbarHeight / 2) + editor.toolbar.defaultOffset; + + editor.nodes.toolbar.style.transform = `translate3D(0, ${Math.floor(newYCoordinate)}px, 0)`; + + /** Close trash actions */ + editor.toolbar.settings.hideRemoveActions(); + }; + + return toolbar; +})({}); diff --git a/src/components/modules/toolbar/toolbox.js b/src/components/modules/toolbar/toolbox.js new file mode 100644 index 00000000..16f4f6d3 --- /dev/null +++ b/src/components/modules/toolbar/toolbox.js @@ -0,0 +1,159 @@ +/** + * Codex Editor toolbox + * + * All tools be able to appended here + * + * @author Codex Team + * @version 1.0 + */ + +module.exports = (function (toolbox) { + let editor = codex.editor; + + toolbox.opened = false; + toolbox.openedOnBlock = null; + + /** Shows toolbox */ + toolbox.open = function () { + /** Close setting if toolbox is opened */ + if (editor.toolbar.settings.opened) { + editor.toolbar.settings.close(); + } + + /** Add 'toolbar-opened' class for current block **/ + toolbox.openedOnBlock = editor.content.currentNode; + toolbox.openedOnBlock.classList.add('toolbar-opened'); + + /** display toolbox */ + editor.nodes.toolbox.classList.add('opened'); + + /** Animate plus button */ + editor.nodes.plusButton.classList.add('clicked'); + + /** toolbox state */ + editor.toolbar.toolbox.opened = true; + }; + + /** Closes toolbox */ + toolbox.close = function () { + /** Remove 'toolbar-opened' class from current block **/ + if (toolbox.openedOnBlock) toolbox.openedOnBlock.classList.remove('toolbar-opened'); + toolbox.openedOnBlock = null; + + /** Makes toolbox disappear */ + editor.nodes.toolbox.classList.remove('opened'); + + /** Rotate plus button */ + editor.nodes.plusButton.classList.remove('clicked'); + + /** toolbox state */ + editor.toolbar.toolbox.opened = false; + + editor.toolbar.current = null; + }; + + toolbox.leaf = function () { + let currentTool = editor.toolbar.current, + tools = Object.keys(editor.tools), + barButtons = editor.nodes.toolbarButtons, + nextToolIndex = 0, + toolToSelect, + visibleTool, + tool; + + if ( !currentTool ) { + /** Get first tool from object*/ + for(tool in editor.tools) { + if (editor.tools[tool].displayInToolbox) { + break; + } + + nextToolIndex ++; + } + } else { + nextToolIndex = (tools.indexOf(currentTool) + 1) % tools.length; + visibleTool = tools[nextToolIndex]; + + while (!editor.tools[visibleTool].displayInToolbox) { + nextToolIndex = (nextToolIndex + 1) % tools.length; + visibleTool = tools[nextToolIndex]; + } + } + + toolToSelect = tools[nextToolIndex]; + + for ( var button in barButtons ) { + barButtons[button].classList.remove('selected'); + } + + barButtons[toolToSelect].classList.add('selected'); + editor.toolbar.current = toolToSelect; + }; + + /** + * Transforming selected node type into selected toolbar element type + * @param {event} event + */ + toolbox.toolClicked = function (event) { + /** + * UNREPLACEBLE_TOOLS this types of tools are forbidden to replace even they are empty + */ + var UNREPLACEBLE_TOOLS = ['image', 'link', 'list', 'instagram', 'twitter', 'embed'], + tool = editor.tools[editor.toolbar.current], + workingNode = editor.content.currentNode, + currentInputIndex = editor.caret.inputIndex, + newBlockContent, + appendCallback, + blockData; + + /** Make block from plugin */ + newBlockContent = tool.render(); + + /** information about block */ + blockData = { + block : newBlockContent, + type : tool.type, + stretched : false + }; + + if ( + workingNode && + UNREPLACEBLE_TOOLS.indexOf(workingNode.dataset.tool) === -1 && + workingNode.textContent.trim() === '' + ) { + /** Replace current block */ + editor.content.switchBlock(workingNode, newBlockContent, tool.type); + } else { + /** Insert new Block from plugin */ + editor.content.insertBlock(blockData); + + /** increase input index */ + currentInputIndex++; + } + + /** Fire tool append callback */ + appendCallback = tool.appendCallback; + + if (appendCallback && typeof appendCallback == 'function') { + appendCallback.call(event); + } + + window.setTimeout(function () { + /** Set caret to current block */ + editor.caret.setToBlock(currentInputIndex); + }, 10); + + + /** + * Changing current Node + */ + editor.content.workingNodeChanged(); + + /** + * Move toolbar when node is changed + */ + editor.toolbar.move(); + }; + + return toolbox; +})({}); \ No newline at end of file diff --git a/src/components/modules/tools.js b/src/components/modules/tools.js new file mode 100644 index 00000000..6c9b3e26 --- /dev/null +++ b/src/components/modules/tools.js @@ -0,0 +1,269 @@ +/** + * @module Codex Editor Tools Submodule + * + * Creates Instances from Plugins and binds external config to the instances + */ + +/** + * Each Tool must contain the following important objects: + * + * @typedef {Object} ToolConfig {@link docs/tools.md} + * @property {String} iconClassname - this a icon in toolbar + * @property {Boolean} displayInToolbox - will be displayed in toolbox. Default value is TRUE + * @property {Boolean} enableLineBreaks - inserts new block or break lines. Default value is FALSE + * @property {Boolean|String[]} inlineToolbar - Pass `true` to enable the Inline Toolbar with all Tools, all pass an array with specified Tools list | + * @property render @todo add description + * @property save @todo add description + * @property settings @todo add description + * @property validate - method that validates output data before saving + */ + +/** + * @typedef {Function} Tool {@link docs/tools.md} + * @property {Boolean} displayInToolbox - By default, tools won't be added in the Toolbox. Pass true to add. + * @property {String} iconClassName - CSS class name for the Toolbox button + * @property {Boolean} irreplaceable - Toolbox behaviour: replace or add new block below + * @property render + * @property save + * @property settings + * @property validate + * + * @todo update according to current API + * @todo describe Tool in the {@link docs/tools.md} + */ + +/** + * Class properties: + * + * @typedef {Tools} Tools + * @property {Tools[]} toolsAvailable - available Tools + * @property {Tools[]} toolsUnavailable - unavailable Tools + * @property {Object} toolsClasses - all classes + * @property {EditorConfig} config - Editor config + */ +export default class Tools extends Module { + /** + * Returns available Tools + * @return {Tool[]} + */ + get available() { + return this.toolsAvailable; + } + + /** + * Returns unavailable Tools + * @return {Tool[]} + */ + get unavailable() { + return this.toolsUnavailable; + } + + /** + * Return Tools for the Inline Toolbar + * @return {Array} - array of Inline Tool's classes + */ + get inline() { + return Object.values(this.available).filter( tool => { + if (!tool[this.apiSettings.IS_INLINE]) { + return false; + } + + /** + * Some Tools validation + */ + const inlineToolRequiredMethods = ['render', 'surround', 'checkState']; + const notImplementedMethods = inlineToolRequiredMethods.filter( method => !new tool()[method] ); + + if (notImplementedMethods.length) { + _.log(`Incorrect Inline Tool: ${tool.name}. Some of required methods is not implemented %o`, 'warn', notImplementedMethods); + return false; + } + + return true; + }); + } + + /** + * Return editor block tools + */ + get blockTools() { + // eslint-disable-next-line no-unused-vars + const tools = Object.entries(this.available).filter( ([name, tool]) => { + if (tool[this.apiSettings.IS_INLINE]) { + return false; + } + + return true; + }); + + const result = {}; + + tools.forEach(([name, tool]) => result[name] = tool); + + return result; + } + + /** + * Constant for available Tools Settings + * @return {object} + */ + get apiSettings() { + return { + IS_INLINE: 'isInline', + TOOLBAR_ICON_CLASS: 'iconClassName', + IS_DISPLAYED_IN_TOOLBOX: 'displayInToolbox', + IS_ENABLED_LINE_BREAKS: 'enableLineBreaks', + IS_IRREPLACEBLE_TOOL: 'irreplaceable', + IS_ENABLED_INLINE_TOOLBAR: 'inlineToolbar', + IS_PASTE_DISALLOWED: 'disallowPaste' + }; + } + + /** + * Static getter for default Tool config fields + * @return {ToolConfig} + */ + get defaultConfig() { + return { + [this.apiSettings.TOOLBAR_ICON_CLASS] : false, + [this.apiSettings.IS_DISPLAYED_IN_TOOLBOX] : false, + [this.apiSettings.IS_ENABLED_LINE_BREAKS] : false, + [this.apiSettings.IS_IRREPLACEBLE_TOOL] : false, + [this.apiSettings.IS_ENABLED_INLINE_TOOLBAR]: false, + }; + } + + /** + * @constructor + * + * @param {EditorConfig} config + */ + constructor({config}) { + super({config}); + + /** + * Map {name: Class, ...} where: + * name — block type name in JSON. Got from EditorConfig.tools keys + * @type {Object} + */ + this.toolClasses = {}; + + /** + * Available tools list + * {name: Class, ...} + * @type {Object} + */ + this.toolsAvailable = {}; + + /** + * Tools that rejected a prepare method + * {name: Class, ... } + * @type {Object} + */ + this.toolsUnavailable = {}; + } + + /** + * Creates instances via passed or default configuration + * @return {Promise} + */ + prepare() { + if (!this.config.hasOwnProperty('tools')) { + return Promise.reject("Can't start without tools"); + } + + for(let toolName in this.config.tools) { + this.toolClasses[toolName] = this.config.tools[toolName]; + } + + /** + * getting classes that has prepare method + */ + let sequenceData = this.getListOfPrepareFunctions(); + + /** + * if sequence data contains nothing then resolve current chain and run other module prepare + */ + if (sequenceData.length === 0) { + return Promise.resolve(); + } + + /** + * to see how it works {@link Util#sequence} + */ + return _.sequence(sequenceData, (data) => { + this.success(data); + }, (data) => { + this.fallback(data); + }); + } + + /** + * Binds prepare function of plugins with user or default config + * @return {Array} list of functions that needs to be fired sequentially + */ + getListOfPrepareFunctions() { + let toolPreparationList = []; + + for(let toolName in this.toolClasses) { + let toolClass = this.toolClasses[toolName]; + + if (typeof toolClass.prepare === 'function') { + toolPreparationList.push({ + function : toolClass.prepare, + data : { + toolName + } + }); + } else { + /** + * If Tool hasn't a prepare method, mark it as available + */ + this.toolsAvailable[toolName] = toolClass; + } + } + + return toolPreparationList; + } + + /** + * @param {ChainData.data} data - append tool to available list + */ + success(data) { + this.toolsAvailable[data.toolName] = this.toolClasses[data.toolName]; + } + + /** + * @param {ChainData.data} data - append tool to unavailable list + */ + fallback(data) { + this.toolsUnavailable[data.toolName] = this.toolClasses[data.toolName]; + } + + /** + * Return tool`a instance + * + * @param {String} tool — tool name + * @param {Object} data — initial data + * + * @todo throw exceptions if tool doesnt exist + * + */ + construct(tool, data) { + let plugin = this.toolClasses[tool], + config = this.config.toolsConfig[tool]; + + let instance = new plugin(data, config || {}); + + return instance; + } + + /** + * Check if passed Tool is an instance of Initial Block Tool + * @param {Tool} tool - Tool to check + * @return {Boolean} + */ + isInitial(tool) { + return tool instanceof this.available[this.config.initialBlock]; + } +} diff --git a/src/components/modules/ui.js b/src/components/modules/ui.js new file mode 100644 index 00000000..bd12bfcf --- /dev/null +++ b/src/components/modules/ui.js @@ -0,0 +1,537 @@ +/** + * Module UI + * + * @type {UI} + */ + +/** + * Prebuilded sprite of SVG icons + */ +import sprite from '../../../build/sprite.svg'; +import Selection from '../selection'; + +/** + * @class + * + * @classdesc Makes CodeX Editor UI: + * + * + * + * + * + * + * @typedef {UI} UI + * @property {EditorConfig} config - editor configuration {@link CodexEditor#configuration} + * @property {Object} Editor - available editor modules {@link CodexEditor#moduleInstances} + * @property {Object} nodes - + * @property {Element} nodes.holder - element where we need to append redactor + * @property {Element} nodes.wrapper - + * @property {Element} nodes.redactor - + */ +export default class UI extends Module { + /** + * @constructor + * + * @param {EditorConfig} config + */ + constructor({config}) { + super({config}); + + this.nodes = { + holder: null, + wrapper: null, + redactor: null + }; + } + + /** + * Making main interface + */ + async prepare() { + await this.make(); + + /** + * Append SVG sprite + */ + await this.appendSVGSprite(); + + /** + * Make toolbar + */ + await this.Editor.Toolbar.make(); + + /** + * Make the Inline toolbar + */ + await this.Editor.InlineToolbar.make(); + + /** + * Load and append CSS + */ + await this.loadStyles(); + + /** + * Bind events for the UI elements + */ + await this.bindEvents(); + } + + /** + * CodeX Editor UI CSS class names + * @return {{editorWrapper: string, editorZone: string, block: string}} + */ + get CSS() { + return { + editorWrapper : 'codex-editor', + editorZone : 'codex-editor__redactor', + }; + } + + /** + * Makes CodeX Editor interface + * @return {Promise} + */ + async make() { + /** + * Element where we need to append CodeX Editor + * @type {Element} + */ + this.nodes.holder = document.getElementById(this.config.holderId); + + if (!this.nodes.holder) { + throw Error("Holder wasn't found by ID: #" + this.config.holderId); + } + + /** + * Create and save main UI elements + */ + this.nodes.wrapper = $.make('div', this.CSS.editorWrapper); + this.nodes.redactor = $.make('div', this.CSS.editorZone); + + this.nodes.wrapper.appendChild(this.nodes.redactor); + this.nodes.holder.appendChild(this.nodes.wrapper); + } + + /** + * Appends CSS + */ + loadStyles() { + /** + * Load CSS + */ + let styles = require('../../styles/main.css'); + + /** + * Make tag + */ + let tag = $.make('style', null, { + textContent: styles.toString() + }); + + /** + * Append styles + */ + $.append(document.head, tag); + } + + /** + * Bind events on the CodeX Editor interface + */ + bindEvents() { + this.Editor.Listeners.on(this.nodes.redactor, 'click', event => this.redactorClicked(event), false ); + this.Editor.Listeners.on(document, 'keydown', event => this.documentKeydown(event), true ); + this.Editor.Listeners.on(document, 'click', event => this.documentClicked(event), false ); + } + + /** + * All keydowns on document + * @param event + */ + documentKeydown(event) { + switch (event.keyCode) { + case _.keyCodes.ENTER: + this.enterPressed(event); + break; + + default: + this.defaultBehaviour(event); + break; + } + } + + /** + * Ignore all other document's keydown events + * @param {KeyboardEvent} event + */ + defaultBehaviour(event) { + const keyDownOnEditor = event.target.closest(`.${this.CSS.editorWrapper}`); + + /** + * Ignore keydowns on document + * clear pointer and close toolbar + */ + if (!keyDownOnEditor) { + /** + * Remove all highlights and remove caret + */ + this.Editor.BlockManager.dropPointer(); + + /** + * Close Toolbar + */ + this.Editor.Toolbar.close(); + } + } + + /** + * Enter pressed on document + * @param event + */ + enterPressed(event) { + let hasPointerToBlock = this.Editor.BlockManager.currentBlockIndex >= 0; + + /** + * If Selection is out of Editor and document has some selection + */ + if (!Selection.isAtEditor && Selection.anchorNode) { + return; + } + + /** + * If there is no selection (caret is not placed) and BlockManager points some to Block + */ + if (hasPointerToBlock && !Selection.anchorNode) { + /** + * Insert initial typed Block + */ + this.Editor.BlockManager.insert(); + this.Editor.BlockManager.highlightCurrentNode(); + + /** + * Move toolbar and show plus button because new Block is empty + */ + this.Editor.Toolbar.move(); + this.Editor.Toolbar.plusButton.show(); + } + } + + /** + * All clicks on document + * @param {MouseEvent} event - Click + */ + documentClicked(event) { + /** + * Close Inline Toolbar when nothing selected + * Do not fire check on clicks at the Inline Toolbar buttons + */ + const clickedOnInlineToolbarButton = event.target.closest(`.${this.Editor.InlineToolbar.CSS.inlineToolbar}`); + const clickedInsideofEditor = event.target.closest(`.${this.CSS.editorWrapper}`); + + /** Clear highlightings and pointer on BlockManager */ + if (!clickedInsideofEditor) { + this.Editor.BlockManager.dropPointer(); + this.Editor.Toolbar.close(); + } + + if (!clickedOnInlineToolbarButton) { + this.Editor.InlineToolbar.handleShowingEvent(event); + } + } + + /** + * All clicks on the redactor zone + * + * @param {MouseEvent} event + * + * @description + * 1. Save clicked Block as a current {@link BlockManager#currentNode} + * it uses for the following: + * - add CSS modifier for the selected Block + * - on Enter press, we make a new Block under that + * + * 2. Move and show the Toolbar + * + * 3. Set a Caret + * + * 4. By clicks on the Editor's bottom zone: + * - if last Block is empty, set a Caret to this + * - otherwise, add a new empty Block and set a Caret to that + * + * 5. Hide the Inline Toolbar + * + * @see selectClickedBlock + * + */ + redactorClicked(event) { + let clickedNode = event.target; + + /** + * Select clicked Block as Current + */ + try { + /** + * Renew Current Block + */ + this.Editor.BlockManager.setCurrentBlockByChildNode(clickedNode); + + /** + * Highlight Current Node + */ + this.Editor.BlockManager.highlightCurrentNode(); + } catch (e) { + /** + * If clicked outside first-level Blocks, set Caret to the last empty Block + */ + this.Editor.Caret.setToTheLastBlock(); + } + + /** + * Move toolbar and open + */ + this.Editor.Toolbar.move(); + this.Editor.Toolbar.open(); + + /** + * Hide the Plus Button + * */ + this.Editor.Toolbar.plusButton.hide(); + + /** + * Show the Plus Button if: + * - Block is an initial-block (Text) + * - Block is empty + */ + let isInitialBlock = this.Editor.Tools.isInitial(this.Editor.BlockManager.currentBlock.tool), + isEmptyBlock = this.Editor.BlockManager.currentBlock.isEmpty; + + if (isInitialBlock && isEmptyBlock) { + this.Editor.Toolbar.plusButton.show(); + } + } + + /** + * Append prebuilded sprite with SVG icons + */ + appendSVGSprite() { + let spriteHolder = $.make('div'); + + spriteHolder.innerHTML = sprite; + + $.append(this.nodes.wrapper, spriteHolder); + } +} + +// /** +// * Codex Editor UI module +// * +// * @author Codex Team +// * @version 1.2.0 +// */ +// +// module.exports = (function (ui) { +// +// let editor = codex.editor; +// +// /** +// * Basic editor classnames +// */ +// ui.prepare = function () { +// + +// +// }; +// +// /** Draw notifications holder */ +// var makeNotificationHolder_ = function () { +// +// /** Append block with notifications to the document */ +// editor.nodes.notifications = editor.notifications.createHolder(); +// +// }; +// +// +// var addInlineToolbarTools_ = function () { +// +// var tools = { +// +// bold: { +// icon : 'ce-icon-bold', +// command : 'bold' +// }, +// +// italic: { +// icon : 'ce-icon-italic', +// command : 'italic' +// }, +// +// link: { +// icon : 'ce-icon-link', +// command : 'createLink' +// } +// }; +// +// var toolButton, +// tool; +// +// for(var name in tools) { +// +// tool = tools[name]; +// +// toolButton = editor.draw.toolbarButtonInline(name, tool.icon); +// +// editor.nodes.inlineToolbar.buttons.appendChild(toolButton); +// /** +// * Add callbacks to this buttons +// */ +// editor.ui.setInlineToolbarButtonBehaviour(toolButton, tool.command); +// +// } +// +// }; +// +// /** +// * @private +// * Bind editor UI events +// */ +// var bindEvents_ = function () { +// +// editor.core.log('ui.bindEvents fired', 'info'); +// +// // window.addEventListener('error', function (errorMsg, url, lineNumber) { +// // editor.notifications.errorThrown(errorMsg, event); +// // }, false ); +// +// /** All keydowns on Document */ +// editor.listeners.add(document, 'keydown', editor.callback.globalKeydown, false); +// +// /** All keydowns on Redactor zone */ +// editor.listeners.add(editor.nodes.redactor, 'keydown', editor.callback.redactorKeyDown, false); +// +// /** All keydowns on Document */ +// editor.listeners.add(document, 'keyup', editor.callback.globalKeyup, false ); +// +// /** +// * Mouse click to radactor +// */ +// editor.listeners.add(editor.nodes.redactor, 'click', editor.callback.redactorClicked, false ); +// +// /** +// * Clicks to the Plus button +// */ +// editor.listeners.add(editor.nodes.plusButton, 'click', editor.callback.plusButtonClicked, false); +// +// /** +// * Clicks to SETTINGS button in toolbar +// */ +// editor.listeners.add(editor.nodes.showSettingsButton, 'click', editor.callback.showSettingsButtonClicked, false ); +// +// /** Bind click listeners on toolbar buttons */ +// for (var button in editor.nodes.toolbarButtons) { +// +// editor.listeners.add(editor.nodes.toolbarButtons[button], 'click', editor.callback.toolbarButtonClicked, false); +// +// } +// +// }; +// +// ui.addBlockHandlers = function (block) { +// +// if (!block) return; +// +// /** +// * Block keydowns +// */ +// editor.listeners.add(block, 'keydown', editor.callback.blockKeydown, false); +// +// /** +// * Pasting content from another source +// * We have two type of sanitization +// * First - uses deep-first search algorithm to get sub nodes, +// * sanitizes whole Block_content and replaces cleared nodes +// * This method is deprecated +// * Method is used in editor.callback.blockPaste(event) +// * +// * Secont - uses Mutation observer. +// * Observer "observe" DOM changes and send changings to callback. +// * Callback gets changed node, not whole Block_content. +// * Inserted or changed node, which we've gotten have been cleared and replaced with diry node +// * +// * Method is used in editor.callback.blockPasteViaSanitize(event) +// * +// * @uses html-janitor +// * @example editor.callback.blockPasteViaSanitize(event), the second method. +// * +// */ +// editor.listeners.add(block, 'paste', editor.paste.blockPasteCallback, false); +// +// /** +// * Show inline toolbar for selected text +// */ +// editor.listeners.add(block, 'mouseup', editor.toolbar.inline.show, false); +// editor.listeners.add(block, 'keyup', editor.toolbar.inline.show, false); +// +// }; +// +// /** getting all contenteditable elements */ +// ui.saveInputs = function () { +// +// var redactor = editor.nodes.redactor; +// +// editor.state.inputs = []; +// +// /** Save all inputs in global variable state */ +// var inputs = redactor.querySelectorAll('[contenteditable], input, textarea'); +// +// Array.prototype.map.call(inputs, function (current) { +// +// if (!current.type || current.type == 'text' || current.type == 'textarea') { +// +// editor.state.inputs.push(current); +// +// } +// +// }); +// +// }; +// +// /** +// * Adds first initial block on empty redactor +// */ +// ui.addInitialBlock = function () { +// +// var initialBlockType = editor.settings.initialBlockPlugin, +// initialBlock; +// +// if ( !editor.tools[initialBlockType] ) { +// +// editor.core.log('Plugin %o was not implemented and can\'t be used as initial block', 'warn', initialBlockType); +// return; +// +// } +// +// initialBlock = editor.tools[initialBlockType].render(); +// +// initialBlock.setAttribute('data-placeholder', editor.settings.placeholder); +// +// editor.content.insertBlock({ +// type : initialBlockType, +// block : initialBlock +// }); +// +// editor.content.workingNodeChanged(initialBlock); +// +// }; +// +// ui.setInlineToolbarButtonBehaviour = function (button, type) { +// +// editor.listeners.add(button, 'mousedown', function (event) { +// +// editor.toolbar.inline.toolClicked(event, type); +// +// }, false); +// +// }; +// +// return ui; +// +// })({}); diff --git a/src/components/polyfills.js b/src/components/polyfills.js new file mode 100644 index 00000000..2f317fe4 --- /dev/null +++ b/src/components/polyfills.js @@ -0,0 +1,20 @@ +/** + * Element.closest() + * + * https://developer.mozilla.org/en-US/docs/Web/API/Element/closest + */ +if (!Element.prototype.matches) + Element.prototype.matches = Element.prototype.msMatchesSelector || + Element.prototype.webkitMatchesSelector; + +if (!Element.prototype.closest) + Element.prototype.closest = function (s) { + var el = this; + + if (!document.documentElement.contains(el)) return null; + do { + if (el.matches(s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null); + return null; + }; diff --git a/src/components/selection.js b/src/components/selection.js new file mode 100644 index 00000000..e992d422 --- /dev/null +++ b/src/components/selection.js @@ -0,0 +1,294 @@ +/** + * Working with selection + * @typedef {Selection} Selection + */ +export default class Selection { + /** + * @constructor + */ + constructor() { + this.instance = null; + this.selection = null; + + /** + * This property can store Selection's range for restoring later + * @type {Range|null} + */ + this.savedSelectionRange = null; + } + + /** + * Editor styles + * @return {{editorWrapper: string, editorZone: string}} + * @constructor + */ + static get CSS() { + return { + editorWrapper : 'codex-editor', + editorZone : 'codex-editor__redactor', + }; + } + + /** + * Returns window Selection + * {@link https://developer.mozilla.org/ru/docs/Web/API/Window/getSelection} + * @return {Selection} + */ + static get() { + return window.getSelection(); + } + + /** + * Returns selected anchor + * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorNode} + * @return {Node|null} + */ + static get anchorNode() { + const selection = window.getSelection(); + + return selection ? selection.anchorNode : null; + } + + /** + * Returns selection offset according to the anchor node + * {@link https://developer.mozilla.org/ru/docs/Web/API/Selection/anchorOffset} + * @return {Number|null} + */ + static get anchorOffset() { + const selection = window.getSelection(); + + return selection ? selection.anchorOffset : null; + } + + /** + * Is current selection range collapsed + * @return {boolean|null} + */ + static get isCollapsed() { + const selection = window.getSelection(); + + return selection ? selection.isCollapsed : null; + } + + /** + * Check current selection if it is at Editor's zone + * @return {boolean} + */ + static get isAtEditor() { + let selection = Selection.get(), + selectedNode, + editorZone = false; + + /** + * Something selected on document + */ + selectedNode = selection.anchorNode || selection.focusNode; + + if (selectedNode && selectedNode.nodeType === Node.TEXT_NODE) { + selectedNode = selectedNode.parentNode; + } + + if (selectedNode) { + editorZone = selectedNode.closest(`.${Selection.CSS.editorZone}`); + } + + /** + * Selection is not out of Editor because Editor's wrapper was found + */ + return editorZone && editorZone.nodeType === Node.ELEMENT_NODE; + } + + /** + * Return first range + * @return {Range|null} + */ + static get range() { + const selection = window.getSelection(); + + return selection && selection.rangeCount ? selection.getRangeAt(0) : null; + } + + /** + * Calculates position and size of selected text + * @return {{x, y, width, height, top?, left?, bottom?, right?}} + */ + static get rect() { + let sel = document.selection, range; + let rect = { + x: 0, + y: 0, + width: 0, + height: 0 + }; + + if (sel && sel.type !== 'Control') { + range = sel.createRange(); + rect.x = range.boundingLeft; + rect.y = range.boundingTop; + rect.width = range.boundingWidth; + rect.height = range.boundingHeight; + + return rect; + } + + if (!window.getSelection) { + _.log('Method window.getSelection is not supported', 'warn'); + return rect; + } + + sel = window.getSelection(); + + if (!sel.rangeCount) { + _.log('Method Selection.rangeCount() is not supported', 'warn'); + return rect; + } + + range = sel.getRangeAt(0).cloneRange(); + + if (range.getBoundingClientRect) { + rect = range.getBoundingClientRect(); + } + // Fall back to inserting a temporary element + if (rect.x === 0 && rect.y === 0) { + let span = document.createElement('span'); + + if (span.getBoundingClientRect) { + // Ensure span has dimensions and position by + // adding a zero-width space character + span.appendChild( document.createTextNode('\u200b') ); + range.insertNode(span); + rect = span.getBoundingClientRect(); + + let spanParent = span.parentNode; + + spanParent.removeChild(span); + + // Glue any broken text nodes back together + spanParent.normalize(); + } + } + + return rect; + } + + /** + * Returns selected text as String + * @returns {string} + */ + static get text() { + return window.getSelection ? window.getSelection().toString() : ''; + }; + + /** + * Save Selection's range + */ + save() { + this.savedSelectionRange = Selection.range; + } + + /** + * Restore saved Selection's range + */ + restore() { + if (!this.savedSelectionRange) { + return; + } + + const sel = window.getSelection(); + + sel.removeAllRanges(); + sel.addRange(this.savedSelectionRange); + } + + /** + * Clears saved selection + */ + clearSaved() { + this.savedSelectionRange = null; + } + + /** + * Looks ahead to find passed tag from current selection + * + * @param {String} tagName - tag to found + * @param {String} [className] - tag's class name + * @param {Number} [searchDepth] - count of tags that can be included. For better performance. + * @return {HTMLElement|null} + */ + findParentTag(tagName, className, searchDepth = 10) { + let selection = window.getSelection(), + parentTag = null; + + /** + * If selection is missing or no anchorNode or focusNode were found then return null + */ + if (!selection || !selection.anchorNode || !selection.focusNode) { + return null; + } + + /** + * Define Nodes for start and end of selection + */ + let boundNodes = [ + /** the Node in which the selection begins */ + selection.anchorNode, + /** the Node in which the selection ends */ + selection.focusNode + ]; + + /** + * For each selection parent Nodes we try to find target tag [with target class name] + * It would be saved in parentTag variable + */ + boundNodes.forEach(parent => { + /** Reset tags limit */ + let searchDepthIterable = searchDepth; + + while (searchDepthIterable > 0 && parent.parentNode) { + /** + * Check tag's name + */ + if (parent.tagName === tagName) { + /** + * Optional additional check for class-name matching + */ + if (className && parent.classList && !parent.classList.contains(className)) { + continue; + } + + /** + * If we have found required tag with class then save the result and go out from cycle + */ + parentTag = parent; + break; + } + + /** + * Target tag was not found. Go up to the parent and check it + */ + parent = parent.parentNode; + searchDepthIterable--; + } + }); + + /** + * Return found tag or null + */ + return parentTag; + } + + /** + * Expands selection range to the passed parent node + * + * @param {HTMLElement} node + */ + expandToTag(node) { + let selection = window.getSelection(); + + selection.removeAllRanges(); + let range = document.createRange(); + + range.selectNodeContents(node); + selection.addRange(range); + } +} diff --git a/src/components/utils.js b/src/components/utils.js new file mode 100644 index 00000000..ba700d91 --- /dev/null +++ b/src/components/utils.js @@ -0,0 +1,175 @@ +/** + * Codex Editor Util + */ +export default class Util { + /** + * Custom logger + * + * @param {string} msg - message + * @param {string} type - logging type 'log'|'warn'|'error'|'info' + * @param {*} args - argument to log with a message + */ + static log(msg, type, args) { + type = type || 'log'; + + if (!args) { + if (['time', 'timeEnd'].includes(type)) { + msg = `[codex-editor]: ${msg}`; + } else { + args = msg || 'undefined'; + msg = '[codex-editor]: %o'; + } + } else { + msg = '[codex-editor]: ' + msg; + } + + try{ + if ( 'console' in window && window.console[ type ] ) { + if ( args ) window.console[ type ]( msg, args ); + else window.console[ type ]( msg ); + } + } catch(e) { + // do nothing + } + } + + /** + * Returns basic keycodes as constants + * @return {{}} + */ + static get keyCodes() { + return { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + SHIFT: 16, + CTRL: 17, + ALT: 18, + ESC: 27, + SPACE: 32, + LEFT: 37, + UP: 38, + DOWN: 40, + RIGHT: 39, + DELETE: 46, + META: 91 + }; + } + + /** + * @typedef {Object} ChainData + * @property {Object} data - data that will be passed to the success or fallback + * @property {Function} function - function's that must be called asynchronically + */ + + /** + * Fires a promise sequence asyncronically + * + * @param {Object[]} chains - list or ChainData's + * @param {Function} success - success callback + * @param {Function} fallback - callback that fires in case of errors + * + * @return {Promise} + */ + static sequence(chains, success = () => {}, fallback = () => {}) { + return new Promise(function (resolve) { + /** + * pluck each element from queue + * First, send resolved Promise as previous value + * Each plugins "prepare" method returns a Promise, that's why + * reduce current element will not be able to continue while can't get + * a resolved Promise + */ + chains.reduce(function (previousValue, currentValue, iteration) { + return previousValue + .then(() => waitNextBlock(currentValue, success, fallback)) + .then(() => { + // finished + if (iteration === chains.length - 1) { + resolve(); + } + }); + }, Promise.resolve()); + }); + + /** + * Decorator + * + * @param {ChainData} chainData + * + * @param {Function} successCallback + * @param {Function} fallbackCallback + * + * @return {Promise} + */ + function waitNextBlock(chainData, successCallback, fallbackCallback) { + return new Promise(function (resolve) { + chainData.function() + .then(() => { + successCallback(chainData.data || {}); + }) + .then(resolve) + .catch(function () { + fallbackCallback(chainData.data || {}); + + // anyway, go ahead even it falls + resolve(); + }); + }); + } + } + + /** + * Make array from array-like collection + * + * @param {*} collection + * + * @return {Array} + */ + static array(collection) { + return Array.prototype.slice.call(collection); + } + + /** + * Checks if object is empty + * + * @param {Object} object + * @return {boolean} + */ + static isEmpty(object) { + return Object.keys(object).length === 0 && object.constructor === Object; + } + + /** + * Check if passed object is a Promise + * @param {*} object - object to check + * @return {Boolean} + */ + static isPromise(object) { + return Promise.resolve(object) === object; + } + + /** + * Check if passed element is contenteditable + * @param element + * @return {boolean} + */ + static isContentEditable(element) { + return element.contentEditable === 'true'; + } + + /** + * Delays method execution + * + * @param method + * @param timeout + */ + static delay(method, timeout) { + return function () { + let context = this, + args = arguments; + + window.setTimeout(() => method.apply(context, args), timeout); + }; + } +}; diff --git a/codex-editor.css b/src/styles/_legacy.css similarity index 97% rename from codex-editor.css rename to src/styles/_legacy.css index 1fb54f95..6b72d89e 100644 --- a/codex-editor.css +++ b/src/styles/_legacy.css @@ -1,24 +1,17 @@ -/** -* CodeX Editor stylesheets -* @author CodeX Team https://ifmo.su -* -* https://github.com/codex-team/codex.editor -*/ - - -@import url('icons.css'); - - /** * Editor wrapper */ .codex-editor{ position: relative; -} + border: 1px solid #ccc; + padding: 10px; - .codex-editor .hide { + .hide { display: none; } +} + + /** * Working zone - redactor @@ -27,6 +20,7 @@ position: relative; padding-bottom: 120px; min-height: 350px; + border: 1px dotted #ccc; } .ce-block__content a { @@ -69,7 +63,6 @@ */ .ce-toolbar__plus{ position: absolute; - background-image: url('fonts/codex_editor/icon-plus.svg'); background-position: center center; background-repeat: no-repeat; text-align: center; @@ -327,7 +320,6 @@ .ce-settings__anchor-hash { display: inline-block; - background: url('fonts/codex_editor/icon-hash.svg') no-repeat center center; background-size: contain; height: 11px; width: 10px; diff --git a/src/styles/animations.css b/src/styles/animations.css new file mode 100644 index 00000000..935a9703 --- /dev/null +++ b/src/styles/animations.css @@ -0,0 +1,37 @@ +.wobble { + animation-name: wobble; + animation-duration: 400ms; +} + +/** + * @author Nick Pettit - https://github.com/nickpettit/glide + */ +@keyframes wobble { + from { + transform: translate3d(0, 0, 0); + } + + 15% { + transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -5deg); + } + + 30% { + transform: translate3d(2%, 0, 0) rotate3d(0, 0, 1, 3deg); + } + + 45% { + transform: translate3d(-3%, 0, 0) rotate3d(0, 0, 1, -3deg); + } + + 60% { + transform: translate3d(2%, 0, 0) rotate3d(0, 0, 1, 2deg); + } + + 75% { + transform: translate3d(-1%, 0, 0) rotate3d(0, 0, 1, -1deg); + } + + to { + transform: translate3d(0, 0, 0); + } +} diff --git a/src/styles/block.css b/src/styles/block.css new file mode 100644 index 00000000..c1628508 --- /dev/null +++ b/src/styles/block.css @@ -0,0 +1,15 @@ +.ce-block { + &:first-of-type { + margin-top: 0; + } + + &--selected { + background-image: linear-gradient(17deg, rgba(243, 248, 255, 0.03) 63.45%, rgba(207, 214, 229, 0.27) 98%); + border-radius: 3px; + } + + &__content { + max-width: var(--content-width); + margin: 0 auto; + } +} diff --git a/src/styles/inline-toolbar.css b/src/styles/inline-toolbar.css new file mode 100644 index 00000000..3d9ff6af --- /dev/null +++ b/src/styles/inline-toolbar.css @@ -0,0 +1,58 @@ +.ce-inline-toolbar { + @apply --overlay-pane; + padding: 6px; + transform: translateX(-50%); + display: none; + box-shadow: 0 6px 12px -6px rgba(131, 147, 173, 0.46), + 5px -12px 34px -13px rgba(97, 105, 134, 0.6), + 0 26px 52px 3px rgba(147, 165, 186, 0.24); + + &--showed { + display: block; + } +} + +.ce-inline-tool { + @apply --toolbar-button; + line-height: normal; + + &--link { + .icon { + margin-top: -2px; + } + + .icon--unlink { + display: none; + } + } + + &--unlink { + .icon--link { + display: none; + } + .icon--unlink { + display: inline-block; + } + } + + &-input { + background-color: var(--bg-light); + outline: none; + border: 0; + border-radius: 3px; + margin: 6px 0 0; + font-size: 13px; + padding: 8px; + width: 100%; + box-sizing: border-box; + display: none; + + &::placeholder { + color: var(--grayText); + } + + &--showed { + display: block; + } + } +} diff --git a/src/styles/main.css b/src/styles/main.css new file mode 100644 index 00000000..1553265d --- /dev/null +++ b/src/styles/main.css @@ -0,0 +1,8 @@ +@import url('variables.css'); +@import url('ui.css'); +@import url('toolbar.css'); +@import url('toolbox.css'); +@import url('inline-toolbar.css'); +@import url('settings.css'); +@import url('block.css'); +@import url('animations.css'); diff --git a/src/styles/settings.css b/src/styles/settings.css new file mode 100644 index 00000000..0af84b0d --- /dev/null +++ b/src/styles/settings.css @@ -0,0 +1,65 @@ +.ce-settings { + @apply --overlay-pane; + right: 5px; + top: 35px; + min-width: 124px; + + &::before{ + left: auto; + right: 12px; + } + + display: none; + + &--opened { + display: block; + } + + &__plugin-zone { + &:not(:empty){ + padding: 6px 6px 0; + } + } + + &__default-zone { + &:not(:empty){ + padding: 6px; + } + } + + &__button { + @apply --toolbar-button; + + &--disabled { + cursor: not-allowed !important; + opacity: .3; + } + + &--selected { + color: var(--color-active-icon); + } + + &--delete { + transition: background-color 300ms ease; + will-change: background-color; + + .icon { + transition: transform 200ms ease-out; + will-change: transform; + } + } + + &--confirm { + background-color: var(--color-confirm); + color: #fff; + + &:hover { + background-color: color-mod(var(--color-confirm) blackness(+5%)) !important; + } + + .icon { + transform: rotate(90deg); + } + } + } +} diff --git a/src/styles/toolbar.css b/src/styles/toolbar.css new file mode 100644 index 00000000..953090ce --- /dev/null +++ b/src/styles/toolbar.css @@ -0,0 +1,57 @@ +.ce-toolbar { + position: absolute; + left: 0; + right: 0; + top: 0; + /*opacity: 0;*/ + /*visibility: hidden;*/ + transition: opacity 100ms ease; + will-change: opacity, transform; + display: none; + + &--opened { + display: block; + /*opacity: 1;*/ + /*visibility: visible;*/ + } + + &__content { + max-width: var(--content-width); + margin: 0 auto; + position: relative; + } + + &__plus { + @apply --toolbox-button; + + position: absolute; + left: calc(calc(var(--toolbox-buttons-size) + 10px) * -1); + + &--hidden { + display: none; + } + } + + /** + * Block actions Zone + * ------------------------- + */ + &__actions { + position: absolute; + right: 0; + top: 0; + padding-right: 16px; + + &-buttons { + text-align: right; + } + } + + &__settings-btn { + display: inline-block; + width: 24px; + height: 24px; + color: var(--grayText); + cursor: pointer; + } +} diff --git a/src/styles/toolbox.css b/src/styles/toolbox.css new file mode 100644 index 00000000..d9d06c8b --- /dev/null +++ b/src/styles/toolbox.css @@ -0,0 +1,15 @@ +.ce-toolbox { + position: absolute; + visibility: hidden; + transition: opacity 100ms ease; + will-change: opacity; + + &--opened { + opacity: 1; + visibility: visible; + } + + &__button { + @apply --toolbox-button; + } +} diff --git a/src/styles/ui.css b/src/styles/ui.css new file mode 100644 index 00000000..5c129de8 --- /dev/null +++ b/src/styles/ui.css @@ -0,0 +1,37 @@ +/** +* Editor wrapper +*/ +.codex-editor { + position: relative; + box-sizing: border-box; + + .hide { + display: none; + } + + &__redactor { + padding-bottom: 300px; + } + + svg { + fill: currentColor; + vertical-align: middle; + max-height: 100%; + } +} + +/** + * Set color for native selection + */ +::selection{ + background-color: var(--selectionColor); +} + +/** + * Add placeholder to content editable elements with data attribute + * data-placeholder="Hello world!" + */ +[contentEditable=true][data-placeholder]:empty:not(:focus):before{ + content: attr(data-placeholder); + color: var(--grayText); +} diff --git a/src/styles/variables.css b/src/styles/variables.css new file mode 100644 index 00000000..f5f21296 --- /dev/null +++ b/src/styles/variables.css @@ -0,0 +1,113 @@ +:root { + /** + * Selection color + */ + --selectionColor: rgba(61,166,239,0.63); + + /** + * Toolbar buttons + */ + --bg-light: #eff2f5; + + /** + * All gray texts: placeholders, settings + */ + --grayText: #707684; + + /** Blue icons */ + --color-active-icon: #388AE5; + + /** + * Block content width + */ + --content-width: 650px; + + /** + * Toolbar buttons height and width + */ + --toolbar-buttons-size: 34px; + + /** + * Toolbar Plus Button and Toolbox buttons height and width + */ + --toolbox-buttons-size: 20px; + + /** + * Confirm deletion bg + */ + --color-confirm: #E24A4A; + + --overlay-pane: { + position: absolute; + background-color: #FFFFFF; + box-shadow: 0 8px 23px -6px rgba(21,40,54,0.31), 22px -14px 34px -18px rgba(33,48,73,0.26); + border-radius: 4px; + z-index: 2; + + &::before { + content: ''; + width: 15px; + height: 15px; + position: absolute; + top: -7px; + left: 50%; + margin-left: -7px; + transform: rotate(-45deg); + background-color: #fff; + z-index: -1; + } + }; + + /** + * Styles for Toolbox Buttons and Plus Button + */ + --toolbox-button: { + color: var(--grayText); + cursor: pointer; + display: inline-block; + width: var(--toolbox-buttons-size); + height: var(--toolbox-buttons-size); + /*line-height: var(--toolbox-buttons-size);*/ + display: flex; + justify-content: center; + align-items: center; + + &:not(:last-of-type){ + margin-right: 3px; + } + + &:hover { + color: var(--color-active-icon); + } + }; + + /** + * Styles for Settings Button in Toolbar + */ + --toolbar-button: { + display: inline-block; + width: 34px; + height: 34px; + line-height: 34px; + text-align: center; + border-radius: 3px; + cursor: pointer; + border: 0; + outline: none; + background-color: transparent; + vertical-align: bottom; + color: var(--grayText); + + &:not(:last-of-type){ + margin-right: 5px; + } + + &:hover { + background-color: var(--bg-light); + } + + &--active { + color: var(--color-active-icon); + } + }; +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..436deb5c --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions" : { + "sourceMap": true, + "target": "es2017", + "declaration": false, + "lib": ["es2017", "dom"] + } +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 00000000..b24cbdfa --- /dev/null +++ b/tslint.json @@ -0,0 +1,15 @@ +{ + "extends": "tslint:recommended", + "rules": { + "indent": [true, "spaces", 2], + "quotemark": [true, "single"], + "no-console": false, + "one-variable-per-declaration": false, + "object-literal-sort-keys": false, + "ordered-imports": [true, { + "import-sources-order": "any", + "named-imports-order": "case-insensitive" + }], + "no-empty": false + } +} diff --git a/webpack.config.js b/webpack.config.js index 31562936..d0919d70 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,79 +20,192 @@ const VERSION = process.env.VERSION || pkg.version; * Plugins for bundle * @type {webpack} */ -var webpack = require('webpack'); -var ExtractTextWebpackPlugin = require('extract-text-webpack-plugin'); +var webpack = require('webpack'); + +/** + * File system + */ +var fs = require('fs'); + +/** + * Available CodeX Editor modules placed in components/modules folder + * They will required automatically. + * Folders and files starting with '_' will be skipped + * @type {Array} + */ +var editorModules = fs.readdirSync('./src/components/modules').filter( name => /.(j|t)s$/.test(name) && name.substring(0,1) !== '_' ); + +editorModules.forEach( name => { + console.log('Require modules/' + name); +}); + +/** + * Options for the Babel + */ +var babelLoader = { + loader: 'babel-loader', + options: { + cacheDirectory: true, + presets: [ + "env" + ], + plugins: [ + /** + * Dont need to use «.default» after «export default Class Ui {}» + * @see {@link https://github.com/59naga/babel-plugin-add-module-exports} + */ + 'add-module-exports', + /** + * Babel transforms some awesome ES6 features to ES5 with extra code, such as Class, JSX. + * This plugin makes all generated extra codes to one module which significantly reduces the bundle code size. + * + * {@link https://github.com/brianZeng/babel-plugin-transform-helper} + * @since 11 dec 2017 - removed due to plugin does not supports class inheritance + */ + // ['babel-plugin-transform-helper', { + // helperFilename:'build/__tmp_babel_helpers.js' + // }], + 'class-display-name', + ] + } +}; + + module.exports = { - entry: { - "codex-editor": "./codex" - }, - output: { - filename: "[name].js", - library: ["codex","editor"] - }, + entry: { + 'codex-editor': ['babel-polyfill', './src/codex'] + }, + output: { + path: path.resolve(__dirname, 'build'), + filename: '[name].js', + library: [ 'CodexEditor' ], + libraryTarget: 'umd' + }, - watch: true, + watch: true, + watchOptions: { + aggregateTimeout: 50 + }, - watchOptions: { - aggregateTimeOut: 50 - }, + devtool: NODE_ENV == 'development' ? 'source-map' : null, - devtool: NODE_ENV == 'development' ? "source-map" : null, - - resolve : { - fallback: path.join(__dirname, "node_modules"), - modulesDirectories : ['./node_modules', './modules'], - extensions : ['', '.js', '.json'] - }, - - resolveLoader : { - modulesDirectories: ['./node_modules'], - moduleTemplates: ["*-webpack-loader", "*-web-loader", "*-loader", "*"], - extensions: ['', '.js'] - }, - - plugins: [ - - /** Pass variables into modules */ - new webpack.DefinePlugin({ - NODE_ENV: JSON.stringify(NODE_ENV), - VERSION: JSON.stringify(VERSION) - }), - - /** Минифицируем CSS и JS */ - new webpack.optimize.UglifyJsPlugin({ - /** Disable warning messages. Cant disable uglify for 3rd party libs such as html-janitor */ - compress: { - warnings: false - } - }), - - /** Block biuld if errors found */ - new webpack.NoErrorsPlugin(), - - ], - - module : { - - loaders : [{ - test : /\.js$/, - exclude: /(node_modules)/, - loader : 'babel', - query: { - presets: [__dirname + '/node_modules/babel-preset-es2015'] - } - }, - { - test : /\.js$/, - loader: 'eslint-loader?fix=true', - exclude: /(node_modules)/ - }, - { - test : /\.css$/, - exclude: /(node_modules)/, - loader: ExtractTextWebpackPlugin.extract('style-loader', 'css-loader') - }] + /** + * Tell webpack what directories should be searched when resolving modules. + */ + resolve : { + // fallback: path.join(__dirname, 'node_modules'), + modules : [ path.join(__dirname, "src"), "node_modules"], + extensions: ['.js', '.ts'], + alias: { + 'utils': path.resolve(__dirname + '/src/components/', './utils'), + 'dom': path.resolve(__dirname + '/src/components/', './dom'), } -}; \ No newline at end of file + }, + // + + // resolveLoader : { + // modules: [ path.resolve(__dirname, "src"), "node_modules" ], + // moduleTemplates: ['*-webpack-loader', '*-web-loader', '*-loader', '*'], + // extensions: ['.js'] + // }, + + plugins: [ + + /** Pass variables into modules */ + new webpack.DefinePlugin({ + NODE_ENV: JSON.stringify(NODE_ENV), + VERSION: JSON.stringify(VERSION), + editorModules: JSON.stringify(editorModules) + }), + + /** + * Setting up a dynamic requires that we use to autoload Editor Modules from 'components/modules' dir + * {@link https://webpack.js.org/plugins/context-replacement-plugin/} + */ + new webpack.ContextReplacementPlugin( + /src\/components\/modules/, + false, // newContentRecursive=false because we dont need to include folders + new RegExp( + '[^_]' + // dont match names started with '_' + `(${editorModules.join('|')})` + // module names pattern: (events.js|ui.js|...) + '$' // at the end of path + ) + ), + + /** + * Automatically load global visible modules + * instead of having to import/require them everywhere. + */ + new webpack.ProvidePlugin({ + '_': 'utils', + '$': 'dom', + 'Module': './../__module.ts', + }), + + /** Минифицируем CSS и JS */ + // new webpack.optimize.UglifyJsPlugin({ + /** Disable warning messages. Cant disable uglify for 3rd party libs such as html-janitor */ + // compress: { + // warnings: false + // } + // }), + + /** Block biuld if errors found */ + // new webpack.NoErrorsPlugin(), + + ], + + module : { + rules : [ + { + test: /\.ts$/, + use: [ + babelLoader, + { + loader: 'ts-loader' + }, + { + loader: 'tslint-loader', + } + ] + }, + { + test : /\.js$/, + use: [ + babelLoader, + { + loader: 'eslint-loader?fix=true&esModules=true', + } + ], + exclude: /(node_modules|build)/, // dont need to look in '/build' to prevent analyse __tmp_babel_helper.js + }, + { + test: /\.css$/, + exclude: /node_modules/, + use: [ + { + loader: 'css-loader', + options: { + // minimize: 1, + importLoaders: 1 + } + }, + 'postcss-loader' + ] + }, + { + test: /\.(svg)$/, + use: [ + { + loader: 'raw-loader', + } + ] + } + ] + }, + optimization: { + minimize: false + }, +};