directus-extension-editorjs
Version:
Block-styled editor for rich media stories, outputs clean data in JSON. More info at https://editorjs.io/
2 lines • 781 kB
JavaScript
import{useApi as e,useStores as t,defineInterface as n}from"@directus/extensions-sdk";import{ref as r,defineComponent as o,onMounted as i,onUnmounted as a,watch as s,resolveComponent as c,openBlock as l,createElementBlock as u,Fragment as d,createElementVNode as f,normalizeClass as p,unref as h,createBlock as v,withCtx as g,createCommentVNode as m,createVNode as y}from"vue";import{useI18n as b}from"vue-i18n";var x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function w(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k={exports:{}};
/*! For license information please see editor.js.LICENSE.txt */window;var S=w(k.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=187)}([function(e,t,n){var r=n(10),o=n(17),i=n(27),a=n(23),s=n(31),c=function(e,t,n){var l,u,d,f,p=e&c.F,h=e&c.G,v=e&c.S,g=e&c.P,m=e&c.B,y=h?r:v?r[t]||(r[t]={}):(r[t]||{}).prototype,b=h?o:o[t]||(o[t]={}),x=b.prototype||(b.prototype={});for(l in h&&(n=t),n)d=((u=!p&&y&&void 0!==y[l])?y:n)[l],f=m&&u?s(d,r):g&&"function"==typeof d?s(Function.call,d):d,y&&a(y,l,d,e&c.U),b[l]!=d&&i(b,l,f),g&&x[l]!=d&&(x[l]=d)};r.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t,n){var r=n(110);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(59),o=n(152);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){var r,o,i;o=[t,n(20),n(371),n(21),n(403),n(14)],void 0===(i="function"==typeof(r=function(e,t,r,o,i,a){var s,c=n(1);function l(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"log",r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"color: inherit";if("console"in window&&window.console[n]){var i=["info","log","warn","error"].includes(n),a=[];switch(l.logLevel){case s.ERROR:if("error"!==n)return;break;case s.WARN:if(!["error","warn"].includes(n))return;break;case s.INFO:if(!i||e)return}r&&a.push(r);var c="Editor.js ".concat("2.25.0"),u="line-height: 1em;\n color: #006FEA;\n display: inline-block;\n font-size: 11px;\n line-height: 1em;\n background-color: #fff;\n padding: 4px 9px;\n border-radius: 30px;\n border: 1px solid rgba(56, 138, 229, 0.16);\n margin: 4px 5px 4px 0;";e&&(i?(a.unshift(u,o),t="%c".concat(c,"%c ").concat(t)):t="( ".concat(c," )").concat(t));try{if(i)if(r){var d;(d=console)[n].apply(d,["".concat(t," %o")].concat(a))}else{var f;(f=console)[n].apply(f,[t].concat(a))}else console[n](t)}catch(e){}}}Object.defineProperty(e,"__esModule",{value:!0}),e.setLogLevel=function(e){l.logLevel=e},e.typeOf=f,e.isFunction=p,e.isObject=h,e.isString=function(e){return"string"===f(e)},e.isBoolean=function(e){return"boolean"===f(e)},e.isNumber=function(e){return"number"===f(e)},e.isUndefined=v,e.isClass=function(e){return p(e)&&/^\s*class\s+/.test(e.toString())},e.isEmpty=function(e){return!e||0===Object.keys(e).length&&e.constructor===Object},e.isPromise=function(e){return Promise.resolve(e)===e},e.isPrintableKey=function(e){return e>47&&e<58||32===e||13===e||229===e||e>64&&e<91||e>95&&e<112||e>185&&e<193||e>218&&e<223},e.sequence=function(e){return g.apply(this,arguments)},e.array=function(e){return Array.prototype.slice.call(e)},e.delay=function(e,t){return function(){var n=this,r=arguments;window.setTimeout((function(){return e.apply(n,r)}),t)}},e.getFileExtension=function(e){return e.name.split(".").pop()},e.isValidMimeType=function(e){return/^[-\w]+\/([-+\w]+|\*)$/.test(e)},e.debounce=function(e,t,n){var r,o=this;return function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];var c=o,l=function(){r=null,n||e.apply(c,a)},u=n&&!r;window.clearTimeout(r),r=window.setTimeout(l,t),u&&e.apply(c,a)}},e.throttle=function(e,t){var n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,a=null,s=0;i||(i={});var c=function(){s=!1===i.leading?0:Date.now(),a=null,o=e.apply(n,r),a||(n=r=null)};return function(){var l=Date.now();s||!1!==i.leading||(s=l);var u=t-(l-s);return n=this,r=arguments,u<=0||u>t?(a&&(clearTimeout(a),a=null),s=l,o=e.apply(n,r),a||(n=r=null)):a||!1===i.trailing||(a=setTimeout(c,u)),o}},e.copyTextToClipboard=function(e){var t=a.default.make("div","codex-editor-clipboard",{innerHTML:e});document.body.appendChild(t);var n=window.getSelection(),r=document.createRange();r.selectNode(t),window.getSelection().removeAllRanges(),n.addRange(r),document.execCommand("copy"),document.body.removeChild(t)},e.getUserOS=m,e.capitalize=function(e){return e[0].toUpperCase()+e.slice(1)},e.deepMerge=function e(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];if(!o.length)return t;var a=o.shift();if(h(t)&&h(a))for(var s in a)h(a[s])?(t[s]||Object.assign(t,(0,r.default)({},s,{})),e(t[s],a[s])):Object.assign(t,(0,r.default)({},s,a[s]));return e.apply(void 0,[t].concat(o))},e.beautifyShortcut=function(e){var t=m();return e=e.replace(/shift/gi,"⇧").replace(/backspace/gi,"⌫").replace(/enter/gi,"⏎").replace(/up/gi,"↑").replace(/left/gi,"→").replace(/down/gi,"↓").replace(/right/gi,"←").replace(/escape/gi,"⎋").replace(/insert/gi,"Ins").replace(/delete/gi,"␡").replace(/\+/gi," + "),t.mac?e.replace(/ctrl|cmd/gi,"⌘").replace(/alt/gi,"⌥"):e.replace(/cmd/gi,"Ctrl").replace(/windows/gi,"WIN")},e.getValidUrl=function(e){try{return new URL(e).href}catch(e){}return"//"===e.substring(0,2)?window.location.protocol+e:window.location.origin+e},e.generateBlockId=function(){return(0,i.nanoid)(10)},e.openTab=function(e){window.open(e,"_blank")},e.generateId=function(){return"".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").concat(Math.floor(1e8*Math.random()).toString(16))},e.deprecationAssert=function(e,t,n){var r="«".concat(t,"» is deprecated and will be removed in the next major release. Please use the «").concat(n,"» instead.");e&&d(r,"warn")},e.cacheable=function(e,t,n){var r=n.value?"value":"get",o=n[r],i="#".concat(t,"Cache");if(n[r]=function(){if(void 0===this[i]){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this[i]=o.apply.apply(o,[this].concat(t))}return this[i]},"get"===r&&n.set){var a=n.set;n.set=function(t){delete e[i],a.apply(this,t)}}return n},e.isMobileScreen=function(){return window.matchMedia("(max-width: 650px)").matches},e.equals=function(e,t){var n=Array.isArray(e)||h(e),r=Array.isArray(t)||h(t);return n||r?JSON.stringify(e)===JSON.stringify(t):e===t},e.isIosDevice=e.isTouchSupported=e.logLabeled=e.log=e.mouseButtons=e.keyCodes=e.LogLevels=void 0,t=c(t),r=c(r),o=c(o),a=c(a),e.LogLevels=s,function(e){e.VERBOSE="VERBOSE",e.INFO="INFO",e.WARN="WARN",e.ERROR="ERROR"}(s||(e.LogLevels=s={})),e.keyCodes={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.mouseButtons={LEFT:0,WHEEL:1,RIGHT:2,BACKWARD:3,FORWARD:4},l.logLevel=s.VERBOSE;var u=l.bind(window,!1);e.log=u;var d=l.bind(window,!0);function f(e){return Object.prototype.toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function p(e){return"function"===f(e)||"asyncfunction"===f(e)}function h(e){return"object"===f(e)}function v(e){return"undefined"===f(e)}function g(){return(g=(0,o.default)(t.default.mark((function e(n){var r,i,a,s,c=arguments;return t.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=function(){return(s=(0,o.default)(t.default.mark((function e(n,r,o){return t.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,n.function(n.data);case 3:return e.next=5,r(v(n.data)?{}:n.data);case 5:e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),o(v(n.data)?{}:n.data);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)},a=function(e,t,n){return s.apply(this,arguments)},r=c.length>1&&void 0!==c[1]?c[1]:function(){},i=c.length>2&&void 0!==c[2]?c[2]:function(){},e.abrupt("return",n.reduce(function(){var e=(0,o.default)(t.default.mark((function e(n,o){return t.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n;case 2:return e.abrupt("return",a(o,r,i));case 3:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Promise.resolve()));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(){var e={win:!1,mac:!1,x11:!1,linux:!1},t=Object.keys(e).find((function(e){return-1!==navigator.appVersion.toLowerCase().indexOf(e)}));return t?(e[t]=!0,e):e}e.logLabeled=d;var y="ontouchstart"in document.documentElement;e.isTouchSupported=y;var b="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1);e.isIosDevice=b})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){var r=n(59);function o(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return o=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=o();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}},function(e,t,n){var r,o,i;o=[t,n(2),n(3),n(111)],void 0===(i="function"==typeof(r=function(r,o,i,a){var s=n(1);function c(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,o=s(o),i=s(i),a=s(a);var u=function(){function e(t){var n=this,r=t.config,i=t.eventsDispatcher;if((0,o.default)(this,e),this.nodes={},this.listeners=new a.default,this.readOnlyMutableListeners={on:function(e,t,r){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];n.mutableListenerIds.push(n.listeners.on(e,t,r,o))},clearAll:function(){var e,t=c(n.mutableListenerIds);try{for(t.s();!(e=t.n()).done;){var r=e.value;n.listeners.offById(r)}}catch(e){t.e(e)}finally{t.f()}n.mutableListenerIds=[]}},this.mutableListenerIds=[],(this instanceof e?this.constructor:void 0)===e)throw new TypeError("Constructors for abstract class Module are not allowed.");this.config=r,this.eventsDispatcher=i}return(0,i.default)(e,[{key:"removeAllNodes",value:function(){for(var e in this.nodes){var t=this.nodes[e];t instanceof HTMLElement&&t.remove()}}},{key:"state",set:function(e){this.Editor=e}},{key:"isRtl",get:function(){return"rtl"===this.config.i18n.direction}}]),e}();r.default=u,u.displayName="Module",e.exports=t.default})?r.apply(t,o):r)||(e.exports=i)},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var r=n(13);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r,o,i;o=[t,n(42),n(2),n(3),n(7)],void 0===(i="function"==typeof(r=function(r,o,i,a,s){var c=n(8),l=n(1);Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,o=l(o),i=l(i),a=l(a),s=c(s);var u=function(){function e(){(0,i.default)(this,e)}return(0,a.default)(e,null,[{key:"isSingleTag",value:function(e){return e.tagName&&["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"].includes(e.tagName)}},{key:"isLineBreakTag",value:function(e){return e&&e.tagName&&["BR","WBR"].includes(e.tagName)}},{key:"make",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=document.createElement(e);for(var a in Array.isArray(n)?(t=i.classList).add.apply(t,(0,o.default)(n)):n&&i.classList.add(n),r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}},{key:"text",value:function(e){return document.createTextNode(e)}},{key:"svg",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:14,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:14,r=document.createElementNS("http://www.w3.org/2000/svg","svg");return r.classList.add("icon","icon--"+e),r.setAttribute("width",t+"px"),r.setAttribute("height",n+"px"),r.innerHTML='<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#'.concat(e,'"></use>'),r}},{key:"append",value:function(e,t){Array.isArray(t)?t.forEach((function(t){return e.appendChild(t)})):e.appendChild(t)}},{key:"prepend",value:function(e,t){Array.isArray(t)?(t=t.reverse()).forEach((function(t){return e.prepend(t)})):e.prepend(t)}},{key:"swap",value:function(e,t){var n=document.createElement("div"),r=e.parentNode;r.insertBefore(n,e),r.insertBefore(e,t),r.insertBefore(t,n),r.removeChild(n)}},{key:"find",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments.length>1?arguments[1]:void 0;return e.querySelector(t)}},{key:"get",value:function(e){return document.getElementById(e)}},{key:"findAll",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=arguments.length>1?arguments[1]:void 0;return e.querySelectorAll(t)}},{key:"findAllInputs",value:function(t){return s.array(t.querySelectorAll(e.allInputsSelector)).reduce((function(t,n){return e.isNativeInput(n)||e.containsOnlyInlineElements(n)?[].concat((0,o.default)(t),[n]):[].concat((0,o.default)(t),(0,o.default)(e.getDeepestBlockElements(n)))}),[])}},{key:"getDeepestNode",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=n?"lastChild":"firstChild",o=n?"previousSibling":"nextSibling";if(t&&t.nodeType===Node.ELEMENT_NODE&&t[r]){var i=t[r];if(e.isSingleTag(i)&&!e.isNativeInput(i)&&!e.isLineBreakTag(i))if(i[o])i=i[o];else{if(!i.parentNode[o])return i.parentNode;i=i.parentNode[o]}return this.getDeepestNode(i,n)}return t}},{key:"isElement",value:function(e){return!s.isNumber(e)&&e&&e.nodeType&&e.nodeType===Node.ELEMENT_NODE}},{key:"isFragment",value:function(e){return!s.isNumber(e)&&e&&e.nodeType&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}},{key:"isContentEditable",value:function(e){return"true"===e.contentEditable}},{key:"isNativeInput",value:function(e){return!(!e||!e.tagName)&&["INPUT","TEXTAREA"].includes(e.tagName)}},{key:"canSetCaret",value:function(t){var n=!0;if(e.isNativeInput(t))switch(t.type){case"file":case"checkbox":case"radio":case"hidden":case"submit":case"button":case"image":case"reset":n=!1}else n=e.isContentEditable(t);return n}},{key:"isNodeEmpty",value:function(e){return!(this.isSingleTag(e)&&!this.isLineBreakTag(e))&&0===(this.isElement(e)&&this.isNativeInput(e)?e.value:e.textContent.replace("","")).trim().length}},{key:"isLeaf",value:function(e){return!!e&&0===e.childNodes.length}},{key:"isEmpty",value:function(e){e.normalize();for(var t=[e];t.length>0;)if(e=t.shift()){if(this.isLeaf(e)&&!this.isNodeEmpty(e))return!1;e.childNodes&&t.push.apply(t,(0,o.default)(Array.from(e.childNodes)))}return!0}},{key:"isHTMLString",value:function(t){var n=e.make("div");return n.innerHTML=t,n.childElementCount>0}},{key:"getContentLength",value:function(t){return e.isNativeInput(t)?t.value.length:t.nodeType===Node.TEXT_NODE?t.length:t.textContent.length}},{key:"containsOnlyInlineElements",value:function(t){var n;return s.isString(t)?(n=document.createElement("div")).innerHTML=t:n=t,Array.from(n.children).every((function t(n){return!e.blockElements.includes(n.tagName.toLowerCase())&&Array.from(n.children).every(t)}))}},{key:"getDeepestBlockElements",value:function(t){return e.containsOnlyInlineElements(t)?[t]:Array.from(t.children).reduce((function(t,n){return[].concat((0,o.default)(t),(0,o.default)(e.getDeepestBlockElements(n)))}),[])}},{key:"getHolder",value:function(e){return s.isString(e)?document.getElementById(e):e}},{key:"isExtensionNode",value:function(e){return e&&["GRAMMARLY-EXTENSION"].includes(e.nodeName)}},{key:"isAnchor",value:function(e){return"a"===e.tagName.toLowerCase()}},{key:"offset",value:function(e){var t=e.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop,o=t.top+r,i=t.left+n;return{top:o,left:i,bottom:o+t.height,right:i+t.width}}},{key:"allInputsSelector",get:function(){return"[contenteditable=true], textarea, input:not([type]), "+["text","password","email","number","search","tel","url"].map((function(e){return'input[type="'.concat(e,'"]')})).join(", ")}},{key:"blockElements",get:function(){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"]}}]),e}();r.default=u,u.displayName="Dom",e.exports=t.default})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){var r=n(69)("wks"),o=n(44),i=n(10).Symbol,a="function"==typeof i;(e.exports=function(e){return r[e]||(r[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=r},function(e,t,n){var r=n(33),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},function(e,t,n){e.exports=!n(11)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(12),o=n(116),i=n(40),a=Object.defineProperty;t.f=n(18)?Object.defineProperty:function(e,t,n){if(r(e),t=i(t,!0),r(n),o)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=n(147)},function(e,t){function n(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var a=e.apply(t,r);function s(e){n(a,o,i,s,c,"next",e)}function c(e){n(a,o,i,s,c,"throw",e)}s(void 0)}))}}},function(e,t,n){var r=n(38);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(10),o=n(27),i=n(26),a=n(44)("src"),s=n(192),c=(""+s).split("toString");n(17).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var l="function"==typeof n;l&&(i(n,"name")||o(n,"name",t)),e[t]!==n&&(l&&(i(n,a)||o(n,a,e[t]?""+e[t]:c.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",(function(){return"function"==typeof this&&this[a]||s.call(this)}))},function(e,t,n){var r=n(0),o=n(11),i=n(38),a=/"/g,s=function(e,t,n,r){var o=String(i(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+o+"</"+t+">"};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*o((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})),"String",n)}},function(e,t,n){var r,o,i;o=[t,n(2),n(3),n(7),n(14)],void 0===(i="function"==typeof(r=function(r,o,i,a,s){var c=n(8),l=n(1);Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,o=l(o),i=l(i),a=c(a),s=l(s);var u=function(){function e(){(0,o.default)(this,e),this.instance=null,this.selection=null,this.savedSelectionRange=null,this.isFakeBackgroundEnabled=!1,this.commandBackground="backColor",this.commandRemoveFormat="removeFormat"}return(0,i.default)(e,[{key:"removeFakeBackground",value:function(){this.isFakeBackgroundEnabled&&(this.isFakeBackgroundEnabled=!1,document.execCommand(this.commandRemoveFormat))}},{key:"setFakeBackground",value:function(){document.execCommand(this.commandBackground,!1,"#a8d6ff"),this.isFakeBackgroundEnabled=!0}},{key:"save",value:function(){this.savedSelectionRange=e.range}},{key:"restore",value:function(){if(this.savedSelectionRange){var e=window.getSelection();e.removeAllRanges(),e.addRange(this.savedSelectionRange)}}},{key:"clearSaved",value:function(){this.savedSelectionRange=null}},{key:"collapseToEnd",value:function(){var e=window.getSelection(),t=document.createRange();t.selectNodeContents(e.focusNode),t.collapse(!1),e.removeAllRanges(),e.addRange(t)}},{key:"findParentTag",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=window.getSelection(),o=null;return r&&r.anchorNode&&r.focusNode?([r.anchorNode,r.focusNode].forEach((function(r){for(var i=n;i>0&&r.parentNode&&(r.tagName!==e||(o=r,t&&r.classList&&!r.classList.contains(t)&&(o=null),!o));)r=r.parentNode,i--})),o):null}},{key:"expandToTag",value:function(e){var t=window.getSelection();t.removeAllRanges();var n=document.createRange();n.selectNodeContents(e),t.addRange(n)}}],[{key:"isSelectionAtEditor",value:function(t){if(!t)return!1;var n=t.anchorNode||t.focusNode;n&&n.nodeType===Node.TEXT_NODE&&(n=n.parentNode);var r=null;return n&&n instanceof Element&&(r=n.closest(".".concat(e.CSS.editorZone))),!!r&&r.nodeType===Node.ELEMENT_NODE}},{key:"isRangeAtEditor",value:function(t){if(t){var n=t.startContainer;n&&n.nodeType===Node.TEXT_NODE&&(n=n.parentNode);var r=null;return n&&n instanceof Element&&(r=n.closest(".".concat(e.CSS.editorZone))),!!r&&r.nodeType===Node.ELEMENT_NODE}}},{key:"getRangeFromSelection",value:function(e){return e&&e.rangeCount?e.getRangeAt(0):null}},{key:"get",value:function(){return window.getSelection()}},{key:"setCursor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=document.createRange(),r=window.getSelection();if(s.default.isNativeInput(e)){if(!s.default.canSetCaret(e))return;return e.focus(),e.selectionStart=e.selectionEnd=t,e.getBoundingClientRect()}return n.setStart(e,t),n.setEnd(e,t),r.removeAllRanges(),r.addRange(n),n.getBoundingClientRect()}},{key:"addFakeCursor",value:function(t){var n=e.range,r=s.default.make("span","codex-editor__fake-cursor");r.dataset.mutationFree="true",!n||t&&!t.contains(n.startContainer)||(n.collapse(),n.insertNode(r))}},{key:"removeFakeCursor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,t=s.default.find(e,".codex-editor__fake-cursor");t&&t.remove()}},{key:"CSS",get:function(){return{editorWrapper:"codex-editor",editorZone:"codex-editor__redactor"}}},{key:"anchorNode",get:function(){var e=window.getSelection();return e?e.anchorNode:null}},{key:"anchorElement",get:function(){var e=window.getSelection();if(!e)return null;var t=e.anchorNode;return t?s.default.isElement(t)?t:t.parentElement:null}},{key:"anchorOffset",get:function(){var e=window.getSelection();return e?e.anchorOffset:null}},{key:"isCollapsed",get:function(){var e=window.getSelection();return e?e.isCollapsed:null}},{key:"isAtEditor",get:function(){return this.isSelectionAtEditor(e.get())}},{key:"isSelectionExists",get:function(){return!!e.get().anchorNode}},{key:"range",get:function(){return this.getRangeFromSelection(this.get())}},{key:"rect",get:function(){var e,t=document.selection,n={x:0,y:0,width:0,height:0};if(t&&"Control"!==t.type)return e=t.createRange(),n.x=e.boundingLeft,n.y=e.boundingTop,n.width=e.boundingWidth,n.height=e.boundingHeight,n;if(!window.getSelection)return a.log("Method window.getSelection is not supported","warn"),n;if(null===(t=window.getSelection()).rangeCount||isNaN(t.rangeCount))return a.log("Method SelectionUtils.rangeCount is not supported","warn"),n;if(0===t.rangeCount)return n;if((e=t.getRangeAt(0).cloneRange()).getBoundingClientRect&&(n=e.getBoundingClientRect()),0===n.x&&0===n.y){var r=document.createElement("span");if(r.getBoundingClientRect){r.appendChild(document.createTextNode("")),e.insertNode(r),n=r.getBoundingClientRect();var o=r.parentNode;o.removeChild(r),o.normalize()}}return n}},{key:"text",get:function(){return window.getSelection?window.getSelection().toString():""}}]),e}();r.default=u,u.displayName="SelectionUtils",e.exports=t.default})?r.apply(t,o):r)||(e.exports=i)},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(19),o=n(43);e.exports=n(18)?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(63),o=n(38);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(11);e.exports=function(e,t){return!!e&&r((function(){t?e.call(null,(function(){}),1):e.call(null)}))}},function(e,t,n){var r=n(361),o=n(362),i=n(148),a=n(363);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||a()}},function(e,t,n){var r=n(32);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(64),o=n(43),i=n(28),a=n(40),s=n(26),c=n(116),l=Object.getOwnPropertyDescriptor;t.f=n(18)?l:function(e,t){if(e=i(e),t=a(t,!0),c)try{return l(e,t)}catch(e){}if(s(e,t))return o(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(0),o=n(17),i=n(11);e.exports=function(e,t){var n=(o.Object||{})[e]||Object[e],a={};a[e]=t(n),r(r.S+r.F*i((function(){n(1)})),"Object",a)}},function(e,t,n){var r=n(31),o=n(63),i=n(22),a=n(16),s=n(132);e.exports=function(e,t){var n=1==e,c=2==e,l=3==e,u=4==e,d=6==e,f=5==e||d,p=t||s;return function(t,s,h){for(var v,g,m=i(t),y=o(m),b=r(s,h,3),x=a(y.length),w=0,k=n?p(t,x):c?p(t,0):void 0;x>w;w++)if((f||w in y)&&(g=b(v=y[w],w,m),e))if(n)k[w]=g;else if(g)switch(e){case 3:return!0;case 5:return v;case 6:return w;case 2:k.push(v)}else if(u)return!1;return d?-1:l||u?u:k}}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){if(n(18)){var r=n(45),o=n(10),i=n(11),a=n(0),s=n(80),c=n(109),l=n(31),u=n(57),d=n(43),f=n(27),p=n(58),h=n(33),v=n(16),g=n(143),m=n(47),y=n(40),b=n(26),x=n(65),w=n(13),k=n(22),S=n(101),_=n(48),C=n(50),E=n(49).f,T=n(103),O=n(44),L=n(15),B=n(36),M=n(70),I=n(66),j=n(105),A=n(55),R=n(73),N=n(56),P=n(104),U=n(134),F=n(19),D=n(34),H=F.f,z=D.f,q=o.RangeError,V=o.TypeError,W=o.Uint8Array,$=Array.prototype,G=c.ArrayBuffer,Y=c.DataView,X=B(0),J=B(2),K=B(3),Z=B(4),Q=B(5),ee=B(6),te=M(!0),ne=M(!1),re=j.values,oe=j.keys,ie=j.entries,ae=$.lastIndexOf,se=$.reduce,ce=$.reduceRight,le=$.join,ue=$.sort,de=$.slice,fe=$.toString,pe=$.toLocaleString,he=L("iterator"),ve=L("toStringTag"),ge=O("typed_constructor"),me=O("def_constructor"),ye=s.CONSTR,be=s.TYPED,xe=s.VIEW,we=B(1,(function(e,t){return Ee(I(e,e[me]),t)})),ke=i((function(){return 1===new W(new Uint16Array([1]).buffer)[0]})),Se=!!W&&!!W.prototype.set&&i((function(){new W(1).set({})})),_e=function(e,t){var n=h(e);if(n<0||n%t)throw q("Wrong offset!");return n},Ce=function(e){if(w(e)&&be in e)return e;throw V(e+" is not a typed array!")},Ee=function(e,t){if(!w(e)||!(ge in e))throw V("It is not a typed array constructor!");return new e(t)},Te=function(e,t){return Oe(I(e,e[me]),t)},Oe=function(e,t){for(var n=0,r=t.length,o=Ee(e,r);r>n;)o[n]=t[n++];return o},Le=function(e,t,n){H(e,t,{get:function(){return this._d[n]}})},Be=function(e){var t,n,r,o,i,a,s=k(e),c=arguments.length,u=c>1?arguments[1]:void 0,d=void 0!==u,f=T(s);if(null!=f&&!S(f)){for(a=f.call(s),r=[],t=0;!(i=a.next()).done;t++)r.push(i.value);s=r}for(d&&c>2&&(u=l(u,arguments[2],2)),t=0,n=v(s.length),o=Ee(this,n);n>t;t++)o[t]=d?u(s[t],t):s[t];return o},Me=function(){for(var e=0,t=arguments.length,n=Ee(this,t);t>e;)n[e]=arguments[e++];return n},Ie=!!W&&i((function(){pe.call(new W(1))})),je=function(){return pe.apply(Ie?de.call(Ce(this)):Ce(this),arguments)},Ae={copyWithin:function(e,t){return U.call(Ce(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Z(Ce(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return P.apply(Ce(this),arguments)},filter:function(e){return Te(this,J(Ce(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Q(Ce(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Ce(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){X(Ce(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return ne(Ce(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(Ce(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return le.apply(Ce(this),arguments)},lastIndexOf:function(e){return ae.apply(Ce(this),arguments)},map:function(e){return we(Ce(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return se.apply(Ce(this),arguments)},reduceRight:function(e){return ce.apply(Ce(this),arguments)},reverse:function(){for(var e,t=Ce(this).length,n=Math.floor(t/2),r=0;r<n;)e=this[r],this[r++]=this[--t],this[t]=e;return this},some:function(e){return K(Ce(this),e,arguments.length>1?arguments[1]:void 0)},sort:function(e){return ue.call(Ce(this),e)},subarray:function(e,t){var n=Ce(this),r=n.length,o=m(e,r);return new(I(n,n[me]))(n.buffer,n.byteOffset+o*n.BYTES_PER_ELEMENT,v((void 0===t?r:m(t,r))-o))}},Re=function(e,t){return Te(this,de.call(Ce(this),e,t))},Ne=function(e){Ce(this);var t=_e(arguments[1],1),n=this.length,r=k(e),o=v(r.length),i=0;if(o+t>n)throw q("Wrong length!");for(;i<o;)this[t+i]=r[i++]},Pe={entries:function(){return ie.call(Ce(this))},keys:function(){return oe.call(Ce(this))},values:function(){return re.call(Ce(this))}},Ue=function(e,t){return w(e)&&e[be]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},Fe=function(e,t){return Ue(e,t=y(t,!0))?d(2,e[t]):z(e,t)},De=function(e,t,n){return!(Ue(e,t=y(t,!0))&&w(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?H(e,t,n):(e[t]=n.value,e)};ye||(D.f=Fe,F.f=De),a(a.S+a.F*!ye,"Object",{getOwnPropertyDescriptor:Fe,defineProperty:De}),i((function(){fe.call({})}))&&(fe=pe=function(){return le.call(this)});var He=p({},Ae);p(He,Pe),f(He,he,Pe.values),p(He,{slice:Re,set:Ne,constructor:function(){},toString:fe,toLocaleString:je}),Le(He,"buffer","b"),Le(He,"byteOffset","o"),Le(He,"byteLength","l"),Le(He,"length","e"),H(He,ve,{get:function(){return this[be]}}),e.exports=function(e,t,n,c){var l=e+((c=!!c)?"Clamped":"")+"Array",d="get"+e,p="set"+e,h=o[l],m=h||{},y=h&&C(h),b=!h||!s.ABV,k={},S=h&&h.prototype,T=function(e,n){H(e,n,{get:function(){return function(e,n){var r=e._d;return r.v[d](n*t+r.o,ke)}(this,n)},set:function(e){return function(e,n,r){var o=e._d;c&&(r=(r=Math.round(r))<0?0:r>255?255:255&r),o.v[p](n*t+o.o,r,ke)}(this,n,e)},enumerable:!0})};b?(h=n((function(e,n,r,o){u(e,h,l,"_d");var i,a,s,c,d=0,p=0;if(w(n)){if(!(n instanceof G||"ArrayBuffer"==(c=x(n))||"SharedArrayBuffer"==c))return be in n?Oe(h,n):Be.call(h,n);i=n,p=_e(r,t);var m=n.byteLength;if(void 0===o){if(m%t)throw q("Wrong length!");if((a=m-p)<0)throw q("Wrong length!")}else if((a=v(o)*t)+p>m)throw q("Wrong length!");s=a/t}else s=g(n),i=new G(a=s*t);for(f(e,"_d",{b:i,o:p,l:a,e:s,v:new Y(i)});d<s;)T(e,d++)})),S=h.prototype=_(He),f(S,"constructor",h)):i((function(){h(1)}))&&i((function(){new h(-1)}))&&R((function(e){new h,new h(null),new h(1.5),new h(e)}),!0)||(h=n((function(e,n,r,o){var i;return u(e,h,l),w(n)?n instanceof G||"ArrayBuffer"==(i=x(n))||"SharedArrayBuffer"==i?void 0!==o?new m(n,_e(r,t),o):void 0!==r?new m(n,_e(r,t)):new m(n):be in n?Oe(h,n):Be.call(h,n):new m(g(n))})),X(y!==Function.prototype?E(m).concat(E(y)):E(m),(function(e){e in h||f(h,e,m[e])})),h.prototype=S,r||(S.constructor=h));var O=S[he],L=!!O&&("values"==O.name||null==O.name),B=Pe.values;f(h,ge,!0),f(S,be,l),f(S,xe,!0),f(S,me,h),(c?new h(1)[ve]==l:ve in S)||H(S,ve,{get:function(){return l}}),k[l]=h,a(a.G+a.W+a.F*(h!=m),k),a(a.S,l,{BYTES_PER_ELEMENT:t}),a(a.S+a.F*i((function(){m.of.call(h,1)})),l,{from:Be,of:Me}),"BYTES_PER_ELEMENT"in S||f(S,"BYTES_PER_ELEMENT",t),a(a.P,l,Ae),N(l),a(a.P+a.F*Se,l,{set:Ne}),a(a.P+a.F*!L,l,Pe),r||S.toString==fe||(S.toString=fe),a(a.P+a.F*i((function(){new h(1).slice()})),l,{slice:Re}),a(a.P+a.F*(i((function(){return[1,2].toLocaleString()!=new h([1,2]).toLocaleString()}))||!i((function(){S.toLocaleString.call([1,2])}))),l,{toLocaleString:je}),A[l]=L?O:B,r||L||f(S,he,B)}}else e.exports=function(){}},function(e,t,n){var r=n(13);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){var r=n(44)("meta"),o=n(13),i=n(26),a=n(19).f,s=0,c=Object.isExtensible||function(){return!0},l=!n(11)((function(){return c(Object.preventExtensions({}))})),u=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},d=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!i(e,r)){if(!c(e))return"F";if(!t)return"E";u(e)}return e[r].i},getWeak:function(e,t){if(!i(e,r)){if(!c(e))return!0;if(!t)return!1;u(e)}return e[r].w},onFreeze:function(e){return l&&d.NEED&&c(e)&&!i(e,r)&&u(e),e}}},function(e,t,n){var r=n(368),o=n(369),i=n(148),a=n(370);e.exports=function(e){return r(e)||o(e)||i(e)||a()}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=!1},function(e,t,n){var r=n(118),o=n(88);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(33),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t,n){var r=n(12),o=n(119),i=n(88),a=n(87)("IE_PROTO"),s=function(){},c=function(){var e,t=n(85)("iframe"),r=i.length;for(t.style.display="none",n(89).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),c=e.F;r--;)delete c.prototype[i[r]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(s.prototype=r(e),n=new s,s.prototype=null,n[a]=e):n=c(),void 0===t?n:o(n,t)}},function(e,t,n){var r=n(118),o=n(88).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},function(e,t,n){var r=n(26),o=n(22),i=n(87)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),r(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t,n){var r=n(15)("unscopables"),o=Array.prototype;null==o[r]&&n(27)(o,r,{}),e.exports=function(e){o[r][e]=!0}},function(e,t,n){var r=n(13);e.exports=function(e,t){if(!r(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,n){var r=n(19).f,o=n(26),i=n(15)("toStringTag");e.exports=function(e,t,n){e&&!o(e=n?e:e.prototype,i)&&r(e,i,{configurable:!0,value:t})}},function(e,t,n){var r=n(0),o=n(38),i=n(11),a=n(91),s="["+a+"]",c=RegExp("^"+s+s+"*"),l=RegExp(s+s+"*$"),u=function(e,t,n){var o={},s=i((function(){return!!a[e]()||"
"!="
"[e]()})),c=o[e]=s?t(d):a[e];n&&(o[n]=c),r(r.P+r.F*s,"String",o)},d=u.trim=function(e,t){return e=String(o(e)),1&t&&(e=e.replace(c,"")),2&t&&(e=e.replace(l,"")),e};e.exports=u},function(e,t){e.exports={}},function(e,t,n){var r=n(10),o=n(19),i=n(18),a=n(15)("species");e.exports=function(e){var t=r[e];i&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(23);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){var r,o,i;o=[t,n(2),n(3),n(150)],void 0===(i="function"==typeof(r=function(r,o,i,a){var s=n(1);Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,o=s(o),i=s(i),a=s(a);var c=function(){function e(){(0,o.default)(this,e)}return(0,i.default)(e,null,[{key:"ui",value:function(t,n){return e._t(t,n)}},{key:"t",value:function(t,n){return e._t(t,n)}},{key:"setDictionary",value:function(t){e.currentDictionary=t}},{key:"_t",value:function(t,n){var r=e.getNamespace(t);return r&&r[n]?r[n]:n}},{key:"getNamespace",value:function(t){return t.split(".").reduce((function(e,t){return e&&Object.keys(e).length?e[t]:{}}),e.currentDictionary)}}]),e}();r.default=c,c.displayName="I18n",c.currentDictionary=a.default,e.exports=t.default})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){var r,o,i;o=[t,n(30),n(20),n(21),n(42),n(2),n(3),n(152),n(113),n(5),n(6),n(4),n(14),n(7),n(112),n(25),n(81)],void 0===(i="function"==typeof(r=function(e,t,r,o,i,a,s,c,l,u,d,f,p,h,v,g,m){var y,b=n(8),x=n(1);function w(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BlockToolAPI=void 0,t=x(t),r=x(r),o=x(o),i=x(i),a=x(a),s=x(s),c=x(c),l=x(l),u=x(u),d=x(d),f=x(f),p=x(p),h=b(h),v=x(v),g=x(g),m=x(m),e.BlockToolAPI=y,function(e){e.APPEND_CALLBACK="appendCallback",e.RENDERED="rendered",e.MOVED="moved",e.UPDATED="updated",e.REMOVED="removed",e.ON_PASTE="onPaste"}(y||(e.BlockToolAPI=y={}));var k=function(e){(0,u.default)(_,e);var n,m,b,x,k,S=(n=_,function(){var e,t=(0,f.default)(n);if(w()){var r=(0,f.default)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,d.default)(this,e)});function _(e){var t,n=e.id,r=void 0===n?h.generateBlockId():n,o=e.data,s=e.tool,l=e.api,u=e.readOnly,d=e.tunesData;return(0,a.default)(this,_),(t=S.call(this)).cachedInputs=[],t.tunesInstances=new Map,t.defaultTunesInstances=new Map,t.unavailableTunesData={},t.inputIndex=0,t.modificationDebounceTimer=450,t.didMutated=h.debounce((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=e instanceof InputEvent||!e.some((function(e){var t=e.addedNodes,n=void 0===t?[]:t,r=e.removedNodes;return[].concat((0,i.default)(Array.from(n)),(0,i.default)(Array.from(r))).some((function(e){return p.default.isElement(e)&&"true"===e.dataset.mutationFree}))}));n&&(t.cachedInputs=[],t.updateCurrentInput(),t.call(y.UPDATED),t.emit("didMutated",(0,c.default)(t)))}),t.modificationDebounceTimer),t.handleFocus=function(){t.cachedInputs=[],t.updateCurrentInput()},t.name=s.name,t.id=r,t.settings=s.settings,t.config=s.settings.config||{},t.api=l,t.blockAPI=new v.default((0,c.default)(t)),t.mutationObserver=new MutationObserver(t.didMutated),t.tool=s,t.toolInstance=s.create(o,t.blockAPI,u),t.tunes=s.tunes,t.composeTunes(d),t.holder=t.compose(),t}return(0,s.default)(_,[{key:"call",value:function(e,t){if(h.isFunction(this.toolInstance[e])){e===y.APPEND_CALLBACK&&h.log("`appendCallback` hook is deprecated and will be removed in the next major release. Use `rendered` hook instead","warn");try{this.toolInstance[e].call(this.toolInstance,t)}catch(t){h.log("Error during '".concat(e,"' call: ").concat(t.message),"error")}}}},{key:"mergeWith",value:(k=(0,o.default)(r.default.mark((function e(t){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.toolInstance.merge(t);case 2:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"save",value:(x=(0,o.default)(r.default.mark((function e(){var n,o,a,s,c=this;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.toolInstance.save(this.pluginsContent);case 2:return n=e.sent,o=this.unavailableTunesData,[].concat((0,i.default)(this.tunesInstances.entries()),(0,i.default)(this.defaultTunesInstances.entries())).forEach((function(e){var n=(0,t.default)(e,2),r=n[0],i=n[1];if(h.isFunction(i.save))try{o[r]=i.save()}catch(e){h.log("Tune ".concat(i.constructor.name," save method throws an Error %o"),"warn",e)}})),a=window.performance.now(),e.abrupt("return",Promise.resolve(n).then((function(e){return s=window.performance.now(),{id:c.id,tool:c.name,data:e,tunes:o,time:s-a}})).catch((function(e){h.log("Saving proccess for ".concat(c.name," tool failed due to the ").concat(e),"log","red")})));case 7:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"validate",value:(b=(0,o.default)(r.default.mark((function e(t){var n;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!0,!(this.toolInstance.validate instanceof Function)){e.next=5;break}return e.next=4,this.toolInstance.validate(t);case 4:n=e.sent;case 5:return e.abrupt("return",n);case 6:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"renderTunes",value:function(){var e=document.createDocumentFragment(),t=document.createDocumentFragment();return this.tunesInstances.forEach((function(t){p.default.append(e,t.render())})),this.defaultTunesInstances.forEach((function(e){p.default.append(t,e.render())})),[e,t]}},{key:"updateCurrentInput",value:function(){this.currentInput=p.default.isNativeInput(document.activeElement)||!g.default.anchorNode?document.activeElement:g.default.anchorNode}},{key:"willSelect",value:function(){this.mutationObserver.observe(this.holder.firstElementChild,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),this.addInputEvents()}},{key:"willUnselect",value:function(){this.mutationObserver.disconnect(),this.removeInputEvents()}},{key:"dispatchChange",value:function(){this.didMutated()}},{key:"destroy",value:function(){(0,l.default)((0,f.default)(_.prototype),"destroy",this).call(this),h.isFunction(this.toolInstance.destroy)&&this.toolInstance.destroy()}},{key:"renderSettings",value:function(){if(h.isFunction(this.toolInstance.renderSettings))return this.toolInstance.renderSettings()}},{key:"getActiveToolboxEntry",value:(m=(0,o.default)(r.default.mark((function e(){var n,o,i;return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(1!==(n=this.tool.toolbox).length){e.next=3;break}return e.abrupt("return",Promise.resolve(this.tool.toolbox[0]));case 3:return e.next=5,this.data;case 5:return o=e.sent,i=n,e.abrupt("return",i.find((function(e){return Object.entries(e.data).some((function(e){var n=(0,t.default)(e,2),r=n[0],i=n[1];return o[r]&&h.equals(o[r],i)}))})));case 8:case"end":return e.stop()}}),e,this)}))),function(){return m.apply(this,arguments)})},{key:"compose",value:function(){var e=p.default.make("div",_.CSS.wrapper),t=p.default.make("div",_.CSS.content),n=this.toolInstance.render();t.appendChild(n);var r=t;return[].concat((0,i.default)(this.tunesInstances.values()),(0,i.default)(this.defaultTunesInstances.values())).forEach((function(e){if(h.isFunction(e.wrap))try{r=e.wrap(r)}catch(t){h.log("Tune ".concat(e.constructor.name," wrap method throws an Error %o"),"warn",t)}})),e.appendChild(r),e}},{key:"composeTunes",value:function(e){var n=this;Array.from(this.tunes.values()).forEach((function(t){(t.isInternal?n.defaultTunesInstances:n.tunesInstances).set(t.name,t.create(e[t.name],n.blockAPI))})),Object.entries(e).forEach((function(e){var r=(0,t.default)(e,2),o=r[0],i=r[1];n.tunesInstances.has(o)||(n.unavailableTunesData[o]=i)}))}},{key:"addInputEvents",value:function(){var e=this;this.inputs.forEach((function(t){t.addEventListener("focus",e.handleFocus),p.default.isNativeInput(t)&&t.addEventListener("input",e.didMutated)}))}},{key:"removeInputEvents",value:function(){var e=this;this.inputs.forEach((function(t){t.removeEventListener("focus",e.handleFocus),p.default.isNativeInput(t)&&t.removeEventListener("input",e.didMutated)}))}},{key:"inputs",get:function(){if(0!==this.cachedInputs.length)return this.cachedInputs;var e=p.default.findAllInputs(this.holder);return this.inputIndex>e.length-1&&(this.inputIndex=e.length-1),this.cachedInputs=e,e}},{key:"currentInput",get:function(){return this.inputs[this.inputIndex]},set:function(e){var t=this.inputs.findIndex((function(t){return t===e||t.contains(e)}));-1!==t&&(this.inputIndex=t)}},{key:"firstInput",get:function(){return this.inputs[0]}},{key:"lastInput",get:function(){var e=this.inputs;return e[e.length-1]}},{key:"nextInput",get:function(){return this.inputs[this.inputIndex+1]}},{key:"previousInput",get:function(){return this.inputs[this.inputIndex-1]}},{key:"data",get:function(){return this.save().then((function(e){return e&&!h.isEmpty(e.data)?e.data:{}}))}},{key:"sanitize",get:function(){return this.tool.sanitizeConfig}},{key:"mergeable",get:function(){return h.isFunction(this.toolInstance.merge)}},{key:"isEmpty",get:function(){var e=p.default.isEmpty(this.pluginsContent),t=!this.hasMedia;return e&&t}},{key:"hasMedia",get:function(){return!!this.holder.querySelector(["img","iframe","video","audio","source","input","textarea","twitterwidget"].join(","))}},{key:"focused",set:function(e){this.holder.classList.toggle(_.CSS.focused,e)},get:function(){return this.holder.classList.contains(_.CSS.focused)}},{key:"selected",set:function(e){e?(this.holder.classList.add(_.CSS.selected),g.default.addFakeCursor(this.holder)):(this.holder.classList.remove(_.CSS.selected),g.default.removeFakeCursor(this.holder))},get:function(){return this.holder.classList.contains(_.CSS.selected)}},{key:"stretched",set:function(e){this.holder.classList.toggle(_.CSS.wrapperStretched,e)},get:function(){return this.holder.classList.contains(_.CSS.wrapperStretched)}},{key:"dropTarget",set:function(e){this.holder.classList.toggle(_.CSS.dropTarget,e)}},{key:"pluginsContent",get:function(){var e=this.holder.querySelector(".".concat(_.CSS.content));if(e&&e.childNodes.length)for(var t=e.childNodes.length-1;t>=0;t--){var n=e.childNodes[t];if(!p.default.isExtensionNode(n))return n}return null}}],[{key:"CSS",get:function(){return{wrapper:"ce-block",wrapperStretched:"ce-block--stretched",content:"ce-block__content",focused:"ce-block--focused",selected:"ce-block--selected",dropTarget:"ce-block--drop-target"}}}]),_}(m.default);e.default=k,k.displayName="Block"})?r.apply(t,o):r)||(e.exports=i)},function(e,t,n){var r,o,i;o=[t,n(2),n(3),n(381),n(7)],void 0===(i="function"==typeof(r=function(r,o,i,a,s){var c=n(8),l=n(1);Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,o=l(o),i=l(i),a=l(a),s=c(s);var u=function(){function e(t){var n=this;(0,o.default)(this,e),this.iterator=null,this.activated=!1,this.onKeyDown=function(t){if(n.isEventReadyForHandling(t))switch(e.usedKeys.includes(t.keyCode)&&t.preventDefault(),t.keyCode){case s.keyCodes.TAB:n.handleTabPress(t);break;case s.keyCodes.LEFT:case s.keyCodes.UP:n.flipLeft();break;case s.keyCodes.RIGHT:case s.keyCodes.DOWN:n.flipRig