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AA2B,IAApB,EAAE,QAAQ,EACnB,IAAG,OAAO,EACX,CAZD,GAcA,EAAK,GAAO,EAAO,IAIvB,OAAO,CACT,GAAG,CAAC,IAGN,IAAI,EAAiC,iBAAhB,EAA2B,SAAS,eAAe,GAAe,EAEvF,IAAK,EAAS,CACZ,GAA2B,iBAAhB,EACT,MAAM,MAAM,0EAA2E,OAAO,EAAa,OAG7G,MAAM,MAAM,oFACd,CAEA,IAAI,EAAO,aAAa,QAAQ,KAAK,EAAS,GAE9C,GAAI,EAAK,YAAY,IAAI,IAAM,SAAS,eAAe,EAAK,YAAY,IAAI,IAC1E,MAAM,MAAM,wGAAyG,OAAO,EAAK,YAAY,IAAI,GAAI,OAGvJ,OAAO,EAAI,MAAM,UAAS,EAAI,SAAS,SAAS,EAAS,EAAK,YAAa,EAAK,SAAU,EAAK,kBAAmB,EAAK,QAAS,EAAK,QAAQ,KAAM,EAAS,EAAK,mBACnK,GAEF,QAAQ,QAAU","file":"/npm/kothing-editor-twoorgu@0.1.5/lib/editor.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/kothing-editor-twoorgu@0.1.5/lib/editor.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = void 0;\n\nvar _core = _interopRequireDefault(require(\"./lib/core\"));\n\nvar _util = _interopRequireDefault(require(\"./lib/util\"));\n\nvar _constructor = _interopRequireDefault(require(\"./lib/constructor\"));\n\nvar _context = _interopRequireDefault(require(\"./lib/context\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar _default = {\n  /**\r\n   * @description Returns the create function with preset options.\r\n   * If the options overlap, the options of the 'create' function take precedence.\r\n   * @param {Json} options Initialization options\r\n   * @returns {Object}\r\n   */\n  init: function init(init_options) {\n    return {\n      create: function (idOrElement, options) {\n        return this.create(idOrElement, options, init_options);\n      }.bind(this)\n    };\n  },\n\n  /**\r\n   * @description Create the KothingEditor\r\n   * @param {String|Element} idOrElement textarea Id or textarea element\r\n   * @param {JSON|Object} options user options\r\n   * @returns {Object}\r\n   */\n  create: function create(idOrElement, options, _init_options) {\n    _util.default._propertiesInit();\n\n    if (_typeof(options) !== \"object\") {\n      options = {};\n    }\n\n    if (_init_options) {\n      options = [_init_options, options].reduce(function (init, option) {\n        for (var key in option) {\n          if (!_util.default.hasOwn(option, key)) {\n            continue;\n          }\n\n          if (key === \"plugins\" && option[key] && init[key]) {\n            (function () {\n              var i = init[key],\n                  o = option[key];\n              i = i.length ? i : Object.keys(i).map(function (name) {\n                return i[name];\n              });\n              o = o.length ? o : Object.keys(o).map(function (name) {\n                return o[name];\n              });\n              init[key] = o.filter(function (val) {\n                return i.indexOf(val) === -1;\n              }).concat(i);\n            })();\n          } else {\n            init[key] = option[key];\n          }\n        }\n\n        return init;\n      }, {});\n    }\n\n    var element = typeof idOrElement === \"string\" ? document.getElementById(idOrElement) : idOrElement;\n\n    if (!element) {\n      if (typeof idOrElement === \"string\") {\n        throw Error(\"[KothingEditor.create.fail] The element for that id was not found (ID:\\\"\".concat(idOrElement, \"\\\")\"));\n      }\n\n      throw Error(\"[KothingEditor.create.fail] KothingEditor requires textarea's element or id value\");\n    }\n\n    var cons = _constructor.default.init(element, options);\n\n    if (cons.constructed.top.id && document.getElementById(cons.constructed.top.id)) {\n      throw Error(\"[KothingEditor.create.fail] The ID of the KothingEditor you are trying to create already exists (ID:\\\"\".concat(cons.constructed.top.id, \"\\\")\"));\n    }\n\n    return (0, _core.default)((0, _context.default)(element, cons.constructed, cons.options), cons.pluginCallButtons, cons.plugins, cons.options.lang, options, cons._responsiveButtons);\n  }\n};\nexports.default = _default;"]}