PageSourceSearch

https://www.makerful.ai/_next/static/chunks/243dde97-2f9704f71aeb32dd.js

js makerful.ai collected 2026-10-05 15:23:22 UTC 210,467 bytes, 17 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5821],{58272:function(e,o,i){function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(){}i.d(o,{Z:function(){return tj}}),"u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof global?global:"u">typeof self&&self,Object.assign(r,{default:r,register:r,revert:function(){},__esModule:!0}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){let o=(this.document||this.ownerDocument).querySelectorAll(e),i=o.length;for(;--i>=0&&o.item(i)!==this;);return i>-1}),Element.prototype.closest||(Element.prototype.closest=function(e){let o=this;if(!document.documentElement.contains(o))return null;do{if(o.matches(e))return o;o=o.parentElement||o.parentNode}while(null!==o);return null}),Element.prototype.prepend||(Element.prototype.prepend=function(e){let o=document.createDocumentFragment();Array.isArray(e)||(e=[e]),e.forEach(e=>{let i=e instanceof Node;o.appendChild(i?e:document.createTextNode(e))}),this.insertBefore(o,this.firstChild)}),Element.prototype.scrollIntoViewIfNeeded||(Element.prototype.scrollIntoViewIfNeeded=function(e){e=0==arguments.length||!!e;let o=this.parentNode,i=window.getComputedStyle(o,null),n=parseInt(i.getPropertyValue("border-top-width")),r=parseInt(i.getPropertyValue("border-left-width")),l=this.offsetTop-o.offsetTop<o.scrollTop,a=this.offsetTop-o.offsetTop+this.clientHeight-n>o.scrollTop+o.clientHeight,c=this.offsetLeft-o.offsetLeft<o.scrollLeft,d=this.offsetLeft-o.offsetLeft+this.clientWidth-r>o.scrollLeft+o.clientWidth;(l||a)&&e&&(o.scrollTop=this.offsetTop-o.offsetTop-o.clientHeight/2-n+this.clientHeight/2),(c||d)&&e&&(o.scrollLeft=this.offsetLeft-o.offsetLeft-o.clientWidth/2-r+this.clientWidth/2),(l||a||c||d)&&!e&&this.scrollIntoView(l&&!a)}),window.requestIdleCallback=window.requestIdleCallback||function(e){let o=Date.now();return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-o))}})},1)},window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)};let l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;return crypto.getRandomValues(new Uint8Array(e)).reduce((e,o)=>((o&=63)<36?e+=o.toString(36):o<62?e+=(o-26).toString(36).toUpperCase():o>62?e+="-":e+="_",e),"")};var a,c,d,h,p,u,g,f,m,b,k=((a=k||{}).VERBOSE="VERBOSE",a.INFO="INFO",a.WARN="WARN",a.ERROR="ERROR",a);let v={BACKSPACE:8,TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,DOWN:40,RIGHT:39,DELETE:46};function x(e,o){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"log",n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"color: inherit";if(!("console"in window)||!window.console[i])return;let l=["info","log","warn","error"].includes(i),a=[];switch(x.logLevel){case"ERROR":if("error"!==i)return;break;case"WARN":if(!["error","warn"].includes(i))return;break;case"INFO":if(!l||e)return}n&&a.push(n);let c="Editor.js 2.29.1";e&&(l?(a.unshift("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;",r),o="%c".concat(c,"%c ").concat(o)):o="( ".concat(c," )").concat(o));try{l?n?console[i]("".concat(o," %o"),...a):console[i](o,...a):console[i](o)}catch(e){}}x.logLevel="VERBOSE";let w=x.bind(window,!1),y=x.bind(window,!0);function E(e){return Object.prototype.toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function C(e){return"function"===E(e)||"asyncfunction"===E(e)}function B(e){return"object"===E(e)}function S(e){return"string"===E(e)}function T(e){return"number"===E(e)}function I(e){return"undefined"===E(e)}function _(e){return!e||0===Object.keys(e).length&&e.constructor===Object}function M(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}async function A(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};async function n(e,o,i){try{await e.function(e.data),await o(I(e.data)?{}:e.data)}catch(o){i(I(e.data)?{}:e.data)}}return e.reduce(async(e,r)=>(await e,n(r,o,i)),Promise.resolve())}function L(e){return Array.prototype.slice.call(e)}function O(e,o){return function(){let i=this,n=arguments;window.setTimeout(()=>e.apply(i,n),o)}}function N(e,o,i){let n;var r=this;return function(){for(var l=arguments.length,a=Array(l),c=0;c<l;c++)a[c]=arguments[c];let d=i&&!n;window.clearTimeout(n),n=window.setTimeout(()=>{n=null,i||e.apply(r,a)},o),d&&e.apply(r,a)}}function D(e,o){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n,r,l,a=null,c=0;i||(i={});let d=function(){c=!1===i.leading?0:Date.now(),a=null,l=e.apply(n,r),a||(n=r=null)};return function(){let h=Date.now();c||!1!==i.leading||(c=h);let p=o-(h-c);return n=this,r=arguments,p<=0||p>o?(a&&(clearTimeout(a),a=null),c=h,l=e.apply(n,r),a||(n=r=null)):a||!1===i.trailing||(a=setTimeout(d,p)),l}}function R(e){return e[0].toUpperCase()+e.slice(1)}function P(e){let o=function(){let e={win:!1,mac:!1,x11:!1,linux:!1},o=Object.keys(e).find(e=>-1!==window.navigator.appVersion.toLowerCase().indexOf(e));return o&&(e[o]=!0),e}();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," + "),e=o.mac?e.replace(/ctrl|cmd/gi,"⌘").replace(/alt/gi,"⌥"):e.replace(/cmd/gi,"Ctrl").replace(/windows/gi,"WIN")}function F(e,o,i){let n="\xab".concat(o,"\xbb is deprecated and will be removed in the next major release. Please use the \xab").concat(i,"\xbb instead.");e&&y(n,"warn")}function H(e,o,i){let n=i.value?"value":"get",r=i[n],l="#".concat(o,"Cache");if(i[n]=function(){for(var e=arguments.length,o=Array(e),i=0;i<e;i++)o[i]=arguments[i];return void 0===this[l]&&(this[l]=r.apply(this,...o)),this[l]},"get"===n&&i.set){let o=i.set;i.set=function(i){delete e[l],o.apply(this,i)}}return i}function z(){return window.matchMedia("(max-width: ".concat(650,"px)")).matches}let U="u">typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1);
1class j{static isSingleTag(e){return e.tagName&&["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"].includes(e.tagName)}static isLineBreakTag(e){return e&&e.tagName&&["BR","WBR"].includes(e.tagName)}static make(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=document.createElement(e);for(let e in Array.isArray(o)?n.classList.add(...o):o&&n.classList.add(o),i)Object.prototype.hasOwnProperty.call(i,e)&&(n[e]=i[e]);return n}static text(e){return document.createTextNode(e)}static append(e,o){Array.isArray(o)?o.forEach(o=>e.appendChild(o)):e.appendChild(o)}static prepend(e,o){Array.isArray(o)?(o=o.reverse()).forEach(o=>e.prepend(o)):e.prepend(o)}static swap(e,o){let i=document.createElement("div"),n=e.parentNode;n.insertBefore(i,e),n.insertBefore(e,o),n.insertBefore(o,i),n.removeChild(i)}static find(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,o=arguments.length>1?arguments[1]:void 0;return e.querySelector(o)}static get(e){return document.getElementById(e)}static findAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,o=arguments.length>1?arguments[1]:void 0;return e.querySelectorAll(o)}static get allInputsSelector(){return"[contenteditable=true], textarea, input:not([type]), "+["text","password","email","number","search","tel","url"].map(e=>'input[type="'.concat(e,'"]')).join(", ")}static findAllInputs(e){return L(e.querySelectorAll(j.allInputsSelector)).reduce((e,o)=>j.isNativeInput(o)||j.containsOnlyInlineElements(o)?[...e,o]:[...e,...j.getDeepestBlockElements(o)],[])}static getDeepestNode(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=o?"lastChild":"firstChild",n=o?"previousSibling":"nextSibling";if(e&&e.nodeType===Node.ELEMENT_NODE&&e[i]){let r=e[i];if(j.isSingleTag(r)&&!j.isNativeInput(r)&&!j.isLineBreakTag(r)){if(r[n])r=r[n];else{if(!r.parentNode[n])return r.parentNode;r=r.parentNode[n]}}return this.getDeepestNode(r,o)}return e}static isElement(e){return!T(e)&&e&&e.nodeType&&e.nodeType===Node.ELEMENT_NODE}static isFragment(e){return!T(e)&&e&&e.nodeType&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}static isContentEditable(e){return"true"===e.contentEditable}static isNativeInput(e){return!!e&&!!e.tagName&&["INPUT","TEXTAREA"].includes(e.tagName)}static canSetCaret(e){let o=!0;if(j.isNativeInput(e))switch(e.type){case"file":case"checkbox":case"radio":case"hidden":case"submit":case"button":case"image":case"reset":o=!1}else o=j.isContentEditable(e);return o}static isNodeEmpty(e,o){let i;return(!this.isSingleTag(e)||!!this.isLineBreakTag(e))&&(i=this.isElement(e)&&this.isNativeInput(e)?e.value:e.textContent.replace("​",""),o&&(i=i.replace(RegExp(o,"g"),"")),0===i.trim().length)}static isLeaf(e){return!!e&&0===e.childNodes.length}static isEmpty(e,o){e.normalize();let i=[e];for(;i.length>0;)if(e=i.shift()){if(this.isLeaf(e)&&!this.isNodeEmpty(e,o))return!1;e.childNodes&&i.push(...Array.from(e.childNodes))}return!0}static isHTMLString(e){let o=j.make("div");return o.innerHTML=e,o.childElementCount>0}static getContentLength(e){return j.isNativeInput(e)?e.value.length:e.nodeType===Node.TEXT_NODE?e.length:e.textContent.length}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","tbody","thead","tr","tfoot","ul","video"]}static containsOnlyInlineElements(e){let o;S(e)?(o=document.createElement("div")).innerHTML=e:o=e;let i=e=>!j.blockElements.includes(e.tagName.toLowerCase())&&Array.from(e.children).every(i);return Array.from(o.children).every(i)}static getDeepestBlockElements(e){return j.containsOnlyInlineElements(e)?[e]:Array.from(e.children).reduce((e,o)=>[...e,...j.getDeepestBlockElements(o)],[])}static getHolder(e){return S(e)?document.getElementById(e):e}static isAnchor(e){return"a"===e.tagName.toLowerCase()}static offset(e){let o=e.getBoundingClientRect(),i=window.pageXOffset||document.documentElement.scrollLeft,n=window.pageYOffset||document.documentElement.scrollTop,r
1=o.top+n,l=o.left+i;return{top:r,left:l,bottom:r+o.height,right:l+o.width}}}let Y={ui:{blockTunes:{toggler:{"Click to tune":"","or drag to move":""}},inlineToolbar:{converter:{"Convert to":""}},toolbar:{toolbox:{Add:""}},popover:{Filter:"","Nothing found":""}},toolNames:{Text:"",Link:"",Bold:"",Italic:""},tools:{link:{"Add a link":""},stub:{"The block can not be displayed correctly.":""}},blockTunes:{delete:{Delete:"","Click to delete":""},moveUp:{"Move up":""},moveDown:{"Move down":""}}},W=class{static ui(e,o){return W._t(e,o)}static t(e,o){return W._t(e,o)}static setDictionary(e){W.currentDictionary=e}static _t(e,o){let i=W.getNamespace(e);return i&&i[o]?i[o]:o}static getNamespace(e){return e.split(".").reduce((e,o)=>e&&Object.keys(e).length?e[o]:{},W.currentDictionary)}};W.currentDictionary=Y;class K extends Error{}class X{on(e,o){e in this.subscribers||(this.subscribers[e]=[]),this.subscribers[e].push(o)}once(e,o){e in this.subscribers||(this.subscribers[e]=[]);let i=n=>{let r=o(n),l=this.subscribers[e].indexOf(i);return -1!==l&&this.subscribers[e].splice(l,1),r};this.subscribers[e].push(i)}emit(e,o){_(this.subscribers)||!this.subscribers[e]||this.subscribers[e].reduce((e,o)=>{let i=o(e);return void 0!==i?i:e},o)}off(e,o){if(void 0===this.subscribers[e]){console.warn('EventDispatcher .off(): there is no subscribers for event "'.concat(e.toString(),'". Probably, .off() called before .on()'));return}for(let i=0;i<this.subscribers[e].length;i++)if(this.subscribers[e][i]===o){delete this.subscribers[e][i];break}}destroy(){this.subscribers={}}constructor(){this.subscribers={}}}function V(e){Object.setPrototypeOf(this,{get id(){return e.id},get name(){return e.name},get config(){return e.config},get holder(){return e.holder},get isEmpty(){return e.isEmpty},get selected(){return e.selected},set stretched(t){e.stretched=t},get stretched(){return e.stretched},get focusable(){return e.focusable},call:(o,i)=>e.call(o,i),save:()=>e.save(),validate:o=>e.validate(o),dispatchChange(){e.dispatchChange()}})}class Z{on(e,o,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"".concat(e).concat(Math.floor(1e8*Math.random()).toString(16))}("l");if(!this.findOne(e,o,i))return this.allListeners.push({id:r,element:e,eventType:o,handler:i,options:n}),e.addEventListener(o,i,n),r}off(e,o,i,n){let r=this.findAll(e,o,i);r.forEach((e,o)=>{let i=this.allListeners.indexOf(r[o]);i>-1&&(this.allListeners.splice(i,1),e.element.removeEventListener(e.eventType,e.handler,e.options))})}offById(e){let o=this.findById(e);o&&o.element.removeEventListener(o.eventType,o.handler,o.options)}findOne(e,o,i){let n=this.findAll(e,o,i);return n.length>0?n[0]:null}findAll(e,o,i){let n=e?this.findByEventTarget(e):[];return e&&o&&i?n.filter(e=>e.eventType===o&&e.handler===i):e&&o?n.filter(e=>e.eventType===o):n}removeAll(){this.allListeners.map(e=>{e.element.removeEventListener(e.eventType,e.handler,e.options)}),this.allListeners=[]}destroy(){this.removeAll()}findByEventTarget(e){return this.allListeners.filter(o=>{if(o.element===e)return o})}findByType(e){return this.allListeners.filter(o=>{if(o.eventType===e)return o})}findByHandler(e){return this.allListeners.filter(o=>{if(o.handler===e)return o})}findById(e){return this.allListeners.find(o=>o.id===e)}constructor(){this.allListeners=[]}}class q{set state(e){this.Editor=e}removeAllNodes(){for(let e in this.nodes){let o=this.nodes[e];o instanceof HTMLElement&&o.remove()}}get isRtl(){return"rtl"===this.config.i18n.direction}constructor({config:e,eventsDispatcher:o}){var i=this;if(this.nodes={},this.listeners=new Z,this.readOnlyMutableListeners={on:function(e,o,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];i.mutableListenerIds.push(i.listeners.on(e,o,n,r))},clearAll:()=>{for(let e of this.mutableListenerIds)this.listeners.offById(e);this.mutableListenerIds=[]}},this.mutableListenerIds=[],new.target===q)throw TypeError("Constructors for abstract class Module are not allowed.");this.config=e,this.eventsDispatcher=o}}class G{static get CSS(){return{editorWrapper:"codex-editor",editorZone:"codex-editor__redactor"}}static get anchorNode(){let e=window.getSelection();return e?e.anchorNode:null}static get anchorElement(){let e=window.getSelection();if(!e)return null;let o=e.anchorNode;return o?j.isElement(o)?o:o.parentElement:null}static get anchorOffset(){let e=window.getSelection();return e?e.anchorOffset:null}static get isCollapsed(){let e=window.getSelection();return e?e.isCollapsed:null}static get isAtEditor(){return this.isSelectionAtEditor(G.get())}static isSelectionAtEditor(e){if(!e)return!1;let o=e.anchorNode||e.focusNode;o&&o.nodeType===Node.TEXT_NODE&&(o=o.parentNode);let i=null;return o&&o instanceof Element&&(i=o.closest(".".concat(G.CSS.editorZone))),!!i&&i.nodeType===Node.ELEMENT_NODE}static isRangeAtEditor(e){if(!e)return;let o=e.startContainer;o&&o.nodeType===Node.TEXT_NODE&&(o=o.parentNode);let i=null;return o&&o instanceof Element&&(i=o.closest(".".concat(G.CSS.editorZone))),!!i&&i.nodeType===Node.ELEMENT_NODE}static get isSelectionExists(){return!!G.get().anchorNode}static get range(){return this.getRangeFromSelection(this.get())}static getRangeFromSelection(e){return e&&e.rangeCount?e.getRangeAt(0):null}static get rect(){let e=document.selection,o,i={x:0,y:0,width:0,height:0};if(e&&"Control"!==e.type)return o=e.createRange(),i.x=o.boundingLeft,i.y=o.boundingTop,i.width=o.boundingWidth,i.height=o.boundingHeight,i;if(!window.getSelection)return w("Method window.getSelection is not supported","warn"),i;if(null===(e=window.getSelection()).rangeCount||isNaN(e.rangeCount))return w("Method SelectionUtils.rangeCount is not supported","warn"),i;if(0===e.rangeCount)return i;if((o=e.getRangeAt(0).cloneRange()).getBoundingClientRect&&(i=o.getBoundingClientRect()),0===i.x&&0===i.y){let e=document.createElement("span");if(e.getBoundingClientRect){e.appendChild(document.createTextNode("​")),o.insertNode(e),i=e.getBoundingClientRect();let n=e.parentNode;n.removeChild(e),n.normalize()}}return i}static get text(){return window.getSelection?window.getSelection().toString():""}static get(){return window.getSelection()}static setCursor(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=document.createRange(),n=window.getSelection();
1return j.isNativeInput(e)?j.canSetCaret(e)?(e.focus(),e.selectionStart=e.selectionEnd=o,e.getBoundingClientRect()):void 0:(i.setStart(e,o),i.setEnd(e,o),n.removeAllRanges(),n.addRange(i),i.getBoundingClientRect())}static isRangeInsideContainer(e){let o=G.range;return null!==o&&e.contains(o.startContainer)}static addFakeCursor(){let e=G.range;if(null===e)return;let o=j.make("span","codex-editor__fake-cursor");o.dataset.mutationFree="true",e.collapse(),e.insertNode(o)}static isFakeCursorInsideContainer(e){return null!==j.find(e,".codex-editor__fake-cursor")}static removeFakeCursor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body,o=j.find(e,".codex-editor__fake-cursor");o&&o.remove()}removeFakeBackground(){this.isFakeBackgroundEnabled&&(this.isFakeBackgroundEnabled=!1,document.execCommand(this.commandRemoveFormat))}setFakeBackground(){document.execCommand(this.commandBackground,!1,"#a8d6ff"),this.isFakeBackgroundEnabled=!0}save(){this.savedSelectionRange=G.range}restore(){if(!this.savedSelectionRange)return;let e=window.getSelection();e.removeAllRanges(),e.addRange(this.savedSelectionRange)}clearSaved(){this.savedSelectionRange=null}collapseToEnd(){let e=window.getSelection(),o=document.createRange();o.selectNodeContents(e.focusNode),o.collapse(!1),e.removeAllRanges(),e.addRange(o)}findParentTag(e,o){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,n=window.getSelection(),r=null;return n&&n.anchorNode&&n.focusNode?([n.anchorNode,n.focusNode].forEach(n=>{let l=i;for(;l>0&&n.parentNode&&!(n.tagName===e&&(r=n,o&&n.classList&&!n.classList.contains(o)&&(r=null),r));)n=n.parentNode,l--}),r):null}expandToTag(e){let o=window.getSelection();o.removeAllRanges();let i=document.createRange();i.selectNodeContents(e),o.addRange(i)}constructor(){this.instance=null,this.selection=null,this.savedSelectionRange=null,this.isFakeBackgroundEnabled=!1,this.commandBackground="backColor",this.commandRemoveFormat="removeFormat"}}let Q="redactor dom changed",J="block changed",$="fake cursor is about to be toggled",ee="fake cursor have been set";function et(e,o){return e.mergeable&&e.name===o.name}var eo=((c=eo||{}).APPEND_CALLBACK="appendCallback",c.RENDERED="rendered",c.MOVED="moved",c.UPDATED="updated",c.REMOVED="removed",c.ON_PASTE="onPaste",c);class ei extends X{static get CSS(){return{wrapper:"ce-block",wrapperStretched:"ce-block--stretched",content:"ce-block__content",selected:"ce-block--selected",dropTarget:"ce-block--drop-target"}}get inputs(){if(0!==this.cachedInputs.length)return this.cachedInputs;let e=j.findAllInputs(this.holder);return this.inputIndex>e.length-1&&(this.inputIndex=e.length-1),this.cachedInputs=e,e}get currentInput(){return this.inputs[this.inputIndex]}set currentInput(e){let o=this.inputs.findIndex(o=>o===e||o.contains(e));-1!==o&&(this.inputIndex=o)}get firstInput(){return this.inputs[0]}get lastInput(){let e=this.inputs;return e[e.length-1]}get nextInput(){return this.inputs[this.inputIndex+1]}get previousInput(){return this.inputs[this.inputIndex-1]}get data(){return this.save().then(e=>e&&!_(e.data)?e.data:{})}get sanitize(){return this.tool.sanitizeConfig}get mergeable(){return C(this.toolInstance.merge)}get focusable(){return 0!==this.inputs.length}get isEmpty(){let e=j.isEmpty(this.pluginsContent,"/"),o=!this.hasMedia;return e&&o}get hasMedia(){return!!this.holder.querySelector("img,iframe,video,audio,source,input,textarea,twitterwidget")}set selected(e){var o,i;this.holder.classList.toggle(ei.CSS.selected,e);let n=!0===e&&G.isRangeInsideContainer(this.holder),r=!1===e&&G.isFakeCursorInsideContainer(this.holder);(n||r)&&(null==(o=this.editorEventBus)||o.emit($,{state:e}),n?G.addFakeCursor():G.removeFakeCursor(this.holder),null==(i=this.editorEventBus)||i.emit(ee,{state:e}))}get selected(){return this.holder.classList.contains(ei.CSS.selected)}set stretched(e){this.holder.classList.toggle(ei.CSS.wrapperStretched,e)}get stretched(){return this.holder.classList.contains(ei.CSS.wrapperStretched)}set dropTarget(e){this.holder.classList.toggle(ei.CSS.dropTarget,e)}get pluginsContent(){return this.toolRenderedElement}call(e,o){if(C(this.toolInstance[e])){"appendCallback"===e&&w("`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,o)}catch(o){w("Error during '".concat(e,"' call: ").concat(o.message),"error")}}}async mergeWith(e){await this.toolInstance.merge(e)}async save(){let e;let o=await this.toolInstance.save(this.pluginsContent),i=this.unavailableTunesData;
1[...this.tunesInstances.entries(),...this.defaultTunesInstances.entries()].forEach(e=>{let[o,n]=e;if(C(n.save))try{i[o]=n.save()}catch(e){w("Tune ".concat(n.constructor.name," save method throws an Error %o"),"warn",e)}});let n=window.performance.now();return Promise.resolve(o).then(o=>(e=window.performance.now(),{id:this.id,tool:this.name,data:o,tunes:i,time:e-n})).catch(e=>{w("Saving process for ".concat(this.name," tool failed due to the ").concat(e),"log","red")})}async validate(e){let o=!0;return this.toolInstance.validate instanceof Function&&(o=await this.toolInstance.validate(e)),o}getTunes(){let e=document.createElement("div"),o=[];return["function"==typeof this.toolInstance.renderSettings?this.toolInstance.renderSettings():[],[...this.tunesInstances.values(),...this.defaultTunesInstances.values()].map(e=>e.render())].flat().forEach(i=>{j.isElement(i)?e.appendChild(i):Array.isArray(i)?o.push(...i):o.push(i)}),[o,e]}updateCurrentInput(){this.currentInput=j.isNativeInput(document.activeElement)||!G.anchorNode?document.activeElement:G.anchorNode}dispatchChange(){this.didMutated()}destroy(){this.unwatchBlockMutations(),this.removeInputEvents(),super.destroy(),C(this.toolInstance.destroy)&&this.toolInstance.destroy()}async getActiveToolboxEntry(){let e=this.tool.toolbox;if(1===e.length)return Promise.resolve(this.tool.toolbox[0]);let o=await this.data;return e.find(e=>Object.entries(e.data).some(e=>{let[i,n]=e;return o[i]&&function(e,o){let i=Array.isArray(e)||B(e),n=Array.isArray(o)||B(o);return i||n?JSON.stringify(e)===JSON.stringify(o):e===o}(o[i],n)}))}async exportDataAsString(){return function(e,o){let i=null==o?void 0:o.export;return C(i)?i(e):S(i)?e[i]:(void 0!==i&&w("Conversion \xabexport\xbb property must be a string or function. String means key of saved data object to export. Function should export processed string to export."),"")}(await this.data,this.tool.conversionConfig)}compose(){let e=j.make("div",ei.CSS.wrapper),o=j.make("div",ei.CSS.content),i=this.toolInstance.render();e.dataset.id=this.id,this.toolRenderedElement=i,o.appendChild(this.toolRenderedElement);let n=o;return[...this.tunesInstances.values(),...this.defaultTunesInstances.values()].forEach(e=>{if(C(e.wrap))try{n=e.wrap(n)}catch(o){w("Tune ".concat(e.constructor.name," wrap method throws an Error %o"),"warn",o)}}),e.appendChild(n),e}composeTunes(e){Array.from(this.tunes.values()).forEach(o=>{(o.isInternal?this.defaultTunesInstances:this.tunesInstances).set(o.name,o.create(e[o.name],this.blockAPI))}),Object.entries(e).forEach(e=>{let[o,i]=e;
1this.tunesInstances.has(o)||(this.unavailableTunesData[o]=i)})}addInputEvents(){this.inputs.forEach(e=>{e.addEventListener("focus",this.handleFocus),j.isNativeInput(e)&&e.addEventListener("input",this.didMutated)})}removeInputEvents(){this.inputs.forEach(e=>{e.removeEventListener("focus",this.handleFocus),j.isNativeInput(e)&&e.removeEventListener("input",this.didMutated)})}watchBlockMutations(){var e;this.redactorDomChangedCallback=e=>{let{mutations:o}=e;o.some(e=>(function(e,o){let{type:i,target:n,addedNodes:r,removedNodes:l}=e;if(n===o)return!0;if(["characterData","attributes"].includes(i)){let e=n.nodeType===Node.TEXT_NODE?n.parentNode:n;return o.contains(e)}let a=Array.from(r).some(e=>o.contains(e)),c=Array.from(l).some(e=>o.contains(e));return a||c})(e,this.toolRenderedElement))&&this.didMutated(o)},null==(e=this.editorEventBus)||e.on(Q,this.redactorDomChangedCallback)}unwatchBlockMutations(){var e;null==(e=this.editorEventBus)||e.off(Q,this.redactorDomChangedCallback)}detectToolRootChange(e){e.forEach(e=>{if(Array.from(e.removedNodes).includes(this.toolRenderedElement)){let o=e.addedNodes[e.addedNodes.length-1];this.toolRenderedElement=o}})}dropInputsCache(){this.cachedInputs=[]}constructor({id:e=l(10),data:o,tool:i,api:n,readOnly:r,tunesData:a},c){var d;super(),d=this,this.cachedInputs=[],this.toolRenderedElement=null,this.tunesInstances=new Map,this.defaultTunesInstances=new Map,this.unavailableTunesData={},this.inputIndex=0,this.editorEventBus=null,this.handleFocus=()=>{this.dropInputsCache(),this.updateCurrentInput()},this.didMutated=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,o=void 0===e,i=e instanceof InputEvent;o||i||d.detectToolRootChange(e),!o&&!i&&e.length>0&&e.every(e=>{let{addedNodes:o,removedNodes:i,target:n}=e;return[...Array.from(o),...Array.from(i),n].some(e=>(j.isElement(e)||(e=e.parentElement),e&&null!==e.closest('[data-mutation-free="true"]')))})||(d.dropInputsCache(),d.updateCurrentInput(),d.call("updated"),d.emit("didMutated",d))},this.name=i.name,this.id=e,this.settings=i.settings,this.config=i.settings.config||{},this.api=n,this.editorEventBus=c||null,this.blockAPI=new V(this),this.tool=i,this.toolInstance=i.create(o,this.blockAPI,r),this.tunes=i.tunes,this.composeTunes(a),this.holder=this.compose(),window.requestIdleCallback(()=>{this.watchBlockMutations(),this.addInputEvents()})}}class en extends q{get methods(){var e=this;return{clear:()=>this.clear(),render:e=>this.render(e),renderFromHTML:e=>this.renderFromHTML(e),delete:e=>this.delete(e),swap:(e,o)=>this.swap(e,o),move:(e,o)=>this.move(e,o),getBlockByIndex:e=>this.getBlockByIndex(e),getById:e=>this.getById(e),getCurrentBlockIndex:()=>this.getCurrentBlockIndex(),getBlockIndex:e=>this.getBlockIndex(e),getBlocksCount:()=>this.getBlocksCount(),stretchBlock:function(o){let i=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return e.stretchBlock(o,i)},insertNewBlock:()=>this.insertNewBlock(),insert:this.insert,insertMany:this.insertMany,update:this.update,composeBlockData:this.composeBlockData,convert:this.convert}}getBlocksCount(){return this.Editor.BlockManager.blocks.length}getCurrentBlockIndex(){return this.Editor.BlockManager.currentBlockIndex}getBlockIndex(e){let o=this.Editor.BlockManager.getBlockById(e);if(!o){y("There is no block with id `"+e+"`","warn");return}return this.Editor.BlockManager.getBlockIndex(o)}getBlockByIndex(e){let o=this.Editor.BlockManager.getBlockByIndex(e);if(void 0===o){y("There is no block at index `"+e+"`","warn");return}return new V(o)}getById(e){let o=this.Editor.BlockManager.getBlockById(e);return void 0===o?(y("There is no block with id `"+e+"`","warn"),null):new V(o)}swap(e,o){w("`blocks.swap()` method is deprecated and will be removed in the next major release. Use `block.move()` method instead","info"),this.Editor.BlockManager.swap(e,o)}move(e,o){this.Editor.BlockManager.move(e,o)}delete(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.Editor.BlockManager.currentBlockIndex;try{let o=this.Editor.BlockManager.getBlockByIndex(e);this.Editor.BlockManager.removeBlock(o)}catch(e){y(e,"warn");return}0===this.Editor.BlockManager.blocks.length&&this.Editor.BlockManager.insert(),this.Editor.BlockManager.currentBlock&&this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock,this.Editor.Caret.positions.END),this.Editor.Toolbar.close()}async clear(){await this.Editor.BlockManager.clear(!0),this.Editor.InlineToolbar.close()}async render(e){if(void 0===e||void 0===e.blocks)throw Error("Incorrect data passed to the render() method");this.Editor.ModificationsObserver.disable(),await this.Editor.BlockManager.clear(),await this.Editor.Renderer.render(e.blocks),this.Editor.ModificationsObserver.enable()}renderFromHTML(e){return this.Editor.BlockManager.clear(),this.Editor.Paste.processText(e,!0)}stretchBlock(e){let o=!(arguments.length>1)||void 0===arguments[1]||arguments[1];F(!0,"blocks.stretchBlock()","BlockAPI");let i=this.Editor.BlockManager.getBlockByIndex(e);i&&(i.stretched=o)}insertNewBlock(){w("Method blocks.insertNewBlock() is deprecated and it will be removed in the next major release. Use blocks.insert() instead.","warn"),this.insert()}validateIndex(e){if("number"!=typeof e)throw Error("Index should be a number");if(e<0||null===e)throw Error("Index should be greater than or equal to 0")}constructor(){var e;super(...arguments),e=this,this.insert=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.config.defaultBlock,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],arguments.length>3?arguments[3]:void 0),r=arguments.length>4?arguments[4]:void 0,l=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;return new V(e.Editor.BlockManager.insert({id:a,tool:o,data:i,index:n,needToFocus:r,replace:l}))},this.composeBlockData=async e=>new ei({tool:this.Editor.Tools.blockTools.get(e),api:this.Editor.API,readOnly:!0,data:{},tunesData:{}}).data,this.update=async(e,o)=>{let{BlockManager:i}=this.Editor,n=i.getBlockById(e);
1if(void 0===n)throw Error('Block with id "'.concat(e,'" not found'));return new V(await i.update(n,o))},this.convert=(e,o,i)=>{var n,r;let{BlockManager:l,Tools:a}=this.Editor,c=l.getBlockById(e);if(!c)throw Error('Block with id "'.concat(e,'" not found'));let d=a.blockTools.get(c.name),h=a.blockTools.get(o);if(!h)throw Error('Block Tool with type "'.concat(o,'" not found'));let p=(null==(n=null==d?void 0:d.conversionConfig)?void 0:n.export)!==void 0,u=(null==(r=h.conversionConfig)?void 0:r.import)!==void 0;if(p&&u)l.convert(c,o,i);else{let e=[!p&&R(c.name),!u&&R(o)].filter(Boolean).join(" and ");throw Error('Conversion from "'.concat(c.name,'" to "').concat(o,'" is not possible. ').concat(e,' tool(s) should provide a "conversionConfig"'))}},this.insertMany=function(o){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.Editor.BlockManager.blocks.length-1;e.validateIndex(i);let n=o.map(o=>{let{id:i,type:n,data:r}=o;return e.Editor.BlockManager.composeBlock({id:i,tool:n||e.config.defaultBlock,data:r})});return e.Editor.BlockManager.insertMany(n,i),n.map(e=>new V(e))}}}class es extends q{get methods(){return{setToFirstBlock:this.setToFirstBlock,setToLastBlock:this.setToLastBlock,setToPreviousBlock:this.setToPreviousBlock,setToNextBlock:this.setToNextBlock,setToBlock:this.setToBlock,focus:this.focus}}constructor(){var e;super(...arguments),e=this,this.setToFirstBlock=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.Editor.Caret.positions.DEFAULT,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!e.Editor.BlockManager.firstBlock&&(e.Editor.Caret.setToBlock(e.Editor.BlockManager.firstBlock,o,i),!0)},this.setToLastBlock=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.Editor.Caret.positions.DEFAULT,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!e.Editor.BlockManager.lastBlock&&(e.Editor.Caret.setToBlock(e.Editor.BlockManager.lastBlock,o,i),!0)},this.setToPreviousBlock=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.Editor.Caret.positions.DEFAULT,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!e.Editor.BlockManager.previousBlock&&(e.Editor.Caret.setToBlock(e.Editor.BlockManager.previousBlock,o,i),!0)},this.setToNextBlock=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.Editor.Caret.positions.DEFAULT,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return!!e.Editor.BlockManager.nextBlock&&(e.Editor.Caret.setToBlock(e.Editor.BlockManager.nextBlock,o,i),!0)},this.setToBlock=function(o){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.Editor.Caret.positions.DEFAULT,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return!!e.Editor.BlockManager.blocks[o]&&(e.Editor.Caret.setToBlock(e.Editor.BlockManager.blocks[o],i,n),!0)},this.focus=function(){let o=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return o?e.setToLastBlock(e.Editor.Caret.positions.END):e.setToFirstBlock(e.Editor.Caret.positions.START)}}}class er extends q{get methods(){return{emit:(e,o)=>
1this.emit(e,o),off:(e,o)=>this.off(e,o),on:(e,o)=>this.on(e,o)}}on(e,o){this.eventsDispatcher.on(e,o)}emit(e,o){this.eventsDispatcher.emit(e,o)}off(e,o){this.eventsDispatcher.off(e,o)}}class el extends q{static getNamespace(e){return e.isTune()?"blockTunes.".concat(e.name):"tools.".concat(e.name)}get methods(){return{t:()=>{y("I18n.t() method can be accessed only from Tools","warn")}}}getMethodsForTool(e){return Object.assign(this.methods,{t:o=>W.t(el.getNamespace(e),o)})}}class ea extends q{get methods(){return{blocks:this.Editor.BlocksAPI.methods,caret:this.Editor.CaretAPI.methods,events:this.Editor.EventsAPI.methods,listeners:this.Editor.ListenersAPI.methods,notifier:this.Editor.NotifierAPI.methods,sanitizer:this.Editor.SanitizerAPI.methods,saver:this.Editor.SaverAPI.methods,selection:this.Editor.SelectionAPI.methods,styles:this.Editor.StylesAPI.classes,toolbar:this.Editor.ToolbarAPI.methods,inlineToolbar:this.Editor.InlineToolbarAPI.methods,tooltip:this.Editor.TooltipAPI.methods,i18n:this.Editor.I18nAPI.methods,readOnly:this.Editor.ReadOnlyAPI.methods,ui:this.Editor.UiAPI.methods}}getMethodsForTool(e){return Object.assign(this.methods,{i18n:this.Editor.I18nAPI.getMethodsForTool(e)})}}class ec extends q{get methods(){return{close:()=>this.close(),open:()=>this.open()}}open(){this.Editor.InlineToolbar.tryToShow()}close(){this.Editor.InlineToolbar.close()}}class ed extends q{get methods(){return{on:(e,o,i,n)=>this.on(e,o,i,n),off:(e,o,i,n)=>this.off(e,o,i,n),offById:e=>this.offById(e)}}on(e,o,i,n){return this.listeners.on(e,o,i,n)}off(e,o,i,n){this.listeners.off(e,o,i,n)}offById(e){this.listeners.offById(e)}}var eh={};window,({get exports(){return eh},set exports(s){eh=s}}).exports=function(e){var o={};function i(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=o,i.d=function(e,o,n){i.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:n})},i.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,o){if(1&o&&(e=i(e)),8&o||4&o&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var r in e)i.d(n,r,(function(o){return e[o]}).bind(null,r));return n},i.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(o,"a",o),o},i.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},i.p="/",i(i.s=0)}([function(e,o,i){var n,r;i(1),/*!
2       * Codex JavaScript Notification module
3       * https://github.com/codex-team/js-notifier
4       */e.exports=(n=i(6),r=null,{show:function(e){if(e.message){r||(r=n.getWrapper(),document.body.appendChild(r));var o=null,i=e.time||8e3;switch(e.type){case"confirm":o=n.confirm(e);break;case"prompt":o=n.prompt(e);break;default:o=n.alert(e),window.setTimeout(function(){o.remove()},i)}r.appendChild(o),o.classList.add("cdx-notify--bounce-in")}}})},function(e,o,i){var n=i(2);"string"==typeof n&&(n=[[e.i,n,""]]),i(4)(n,{hmr:!0,transform:void 0,insertInto:void 0}),n.locals&&(e.exports=n.locals)},function(e,o,i){(e.exports=i(3)(!1)).push([e.i,'.cdx-notify--error{background:#fffbfb!important}.cdx-notify--error::before{background:#fb5d5d!important}.cdx-notify__input{max-width:130px;padding:5px 10px;background:#f7f7f7;border:0;border-radius:3px;font-size:13px;color:#656b7c;outline:0}.cdx-notify__input:-ms-input-placeholder{color:#656b7c}.cdx-notify__input::placeholder{color:#656b7c}.cdx-notify__input:focus:-ms-input-placeholder{color:rgba(101,107,124,.3)}.cdx-notify__input:focus::placeholder{color:rgba(101,107,124,.3)}.cdx-notify__button{border:none;border-radius:3px;font-size:13px;padding:5px 10px;cursor:pointer}.cdx-notify__button:last-child{margin-left:10px}.cdx-notify__button--cancel{background:#f2f5f7;box-shadow:0 2px 1px 0 rgba(16,19,29,0);color:#656b7c}.cdx-notify__button--cancel:hover{background:#eee}.cdx-notify__button--confirm{background:#34c992;box-shadow:0 1px 1px 0 rgba(18,49,35,.05);color:#fff}.cdx-notify__button--confirm:hover{background:#33b082}.cdx-notify__btns-wrapper{display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;margin-top:5px}.cdx-notify__cross{position:absolute;top:5px;right:5px;width:10px;height:10px;padding:5px;opacity:.54;cursor:pointer}.cdx-notify__cross::after,.cdx-notify__cross::before{content:\'\';position:absolute;
4left:9px;top:5px;height:12px;width:2px;background:#575d67}.cdx-notify__cross::before{transform:rotate(-45deg)}.cdx-notify__cross::after{transform:rotate(45deg)}.cdx-notify__cross:hover{opacity:1}.cdx-notifies{position:fixed;z-index:2;bottom:20px;left:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",sans-serif}.cdx-notify{position:relative;width:220px;margin-top:15px;padding:13px 16px;background:#fff;box-shadow:0 11px 17px 0 rgba(23,32,61,.13);border-radius:5px;font-size:14px;line-height:1.4em;word-wrap:break-word}.cdx-notify::before{content:\'\';position:absolute;display:block;top:0;left:0;width:3px;height:calc(100% - 6px);margin:3px;border-radius:5px;background:0 0}@keyframes bounceIn{0%{opacity:0;transform:scale(.3)}50%{opacity:1;transform:scale(1.05)}70%{transform:scale(.9)}100%{transform:scale(1)}}.cdx-notify--bounce-in{animation-name:bounceIn;animation-duration:.6s;animation-iteration-count:1}.cdx-notify--success{background:#fafffe!important}.cdx-notify--success::before{background:#41ffb1!important}',""])},function(e,o){e.exports=function(e){var o=[];return o.toString=function(){return this.map(function(o){var i=function(e,o){var i=e[1]||"",n=e[3];if(!n)return i;if(o&&"function"==typeof btoa){var r="/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */";return[i].concat(n.sources.map(function(e){return"/*# sourceURL="+n.sourceRoot+e+" */"})).concat([r]).join("\n")}return[i].join("\n")}(o,e);return o[2]?"@media "+o[2]+"{"+i+"}":i}).join("")},o.i=function(e,i){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},r=0;r<this.length;r++){var l=this[r][0];"number"==typeof l&&(n[l]=!0)}for(r=0;r<e.length;r++){var a=e[r];"number"==typeof a[0]&&n[a[0]]||(i&&!a[2]?a[2]=i:i&&(a[2]="("+a[2]+") and ("+i+")"),o.push(a))}},o}},function(e,o,i){var n,r,l,a={},c=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===l&&(l=r.apply(this,arguments)),l}),d=(n={},function(e){if("function"==typeof e)return e();if(void 0===n[e]){var o=(function(e){return document.querySelector(e)}).call(this,e);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}n[e]=o}return n[e]}),h=null,p=0,u=[],g=i(5);function f(e,o){for(var i=0;i<e.length;i++){var n=e[i],r=a[n.id];if(r){r.refs++;for(var l=0;l<r.parts.length;l++)r.parts[l](n.parts[l]);for(;l<n.parts.length;l++)r.parts.push(w(n.parts[l],o))}else{var c=[];for(l=0;l<n.parts.length;l++)c.push(w(n.parts[l],o));a[n.id]={id:n.id,refs:1,parts:c}}}}function m(e,o){for(var i=[],n={},r=0;r<e.length;r++){var l=e[r],a=o.base?l[0]+o.base:l[0],c={css:l[1],media:l[2],sourceMap:l[3]};n[a]?n[a].parts.push(c):i.push(n[a]={id:a,parts:[c]})}return i}function b(e,o){var i=d(e.insertInto);if(!i)throw Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var n=u[u.length-1];if("top"===e.insertAt)n?n.nextSibling?i.insertBefore(o,n.nextSibling):i.appendChild(o):i.insertBefore(o,i.firstChild),u.push(o);else if("bottom"===e.insertAt)i.appendChild(o);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var r=d(e.insertInto+" "+e.insertAt.before);i.insertBefore(o,r)}}function k(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var o=u.indexOf(e);o>=0&&u.splice(o,1)}function v(e){var o=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),x(o,e.attrs),b(e,o),o}function x(e,o){Object.keys(o).forEach(function(i){e.setAttribute(i,o[i])})}function w(e,o){if(o.transform&&e.css){if(!(l=o.transform(e.css)))return function(){};e.css=l}if(o.singleton){var i,n,r,l,a,c=p++;n=C.bind(null,i=h||(h=v(o)),c,!1),r=C.bind(null,i,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(a=document.createElement("link"),void 0===o.attrs.type&&(o.attrs.type="text/css"),o.attrs.rel="stylesheet",x(a,o.attrs),b(o,a),n=(function(e,o,i){var n=i.css,r=i.sourceMap,l=void 0===o.convertToAbsoluteUrls&&r;(o.convertToAbsoluteUrls||l)&&(n=g(n)),r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([n],{type:"text/css"}),c=e.href;e.href=URL.createObjectURL(a),c&&URL.revokeObjectURL(c)}).bind(null,i=a,o),r=function(){k(i),i.href&&URL.revokeObjectURL(i.href)}):(n=(function(e,o){var i=o.css,n=o.media;if(n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}).bind(null,i=v(o)),r=function(){k(i)});return n(e),function(o){o?(o.css!==e.css||o.media!==e.media||o.sourceMap!==e.sourceMap)&&n(e=o):r()}}e.exports=function(e,o){if("u">typeof DEBUG&&DEBUG&&"object"!=typeof document)throw Error("The style-loader cannot be used in a non-browser environment");(o=o||{}).attrs="object"==typeof o.attrs?o.attrs:{},o.singleton||"boolean"==typeof o.singleton||(o.singleton=c()),o.insertInto||(o.insertInto="head"),o.insertAt||(o.insertAt="bottom");var i=m(e,o);return f(i,o),function(e){for(var n,r=[],l=0;l<i.length;l++){var c=i[l];(n=a[c.id]).refs--,r.push(n)}for(e&&f(m(e,o),o),l=0;l<r.length;l++)if(0===(n=r[l]).refs){for(var d=0;d<n.parts.length;d++)n.parts[d]();delete a[n.id]}}};
4var y,E=(y=[],function(e,o){return y[e]=o,y.filter(Boolean).join("\n")});function C(e,o,i,n){var r=i?"":n.css;if(e.styleSheet)e.styleSheet.cssText=E(o,r);else{var l=document.createTextNode(r),a=e.childNodes;a[o]&&e.removeChild(a[o]),a.length?e.insertBefore(l,a[o]):e.appendChild(l)}}},function(e,o){e.exports=function(e){var o="u">typeof window&&window.location;if(!o)throw Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var i=o.protocol+"//"+o.host,n=i+o.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,o){var r=o.trim().replace(/^"(.*)"$/,function(e,o){return o}).replace(/^'(.*)'$/,function(e,o){return o});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(r)?e:"url("+JSON.stringify(0===r.indexOf("//")?r:0===r.indexOf("/")?i+r:n+r.replace(/^\.\//,""))+")"})}},function(e,o,i){var n,r,l,a,c,d;e.exports=(n="cdx-notify",r="cdx-notify__cross",l="cdx-notify__button--confirm",a="cdx-notify__button",c="cdx-notify__btns-wrapper",{alert:d=function(e){var o=document.createElement("DIV"),i=document.createElement("DIV"),l=e.message,a=e.style;return o.classList.add(n),a&&o.classList.add(n+"--"+a),o.innerHTML=l,i.classList.add(r),i.addEventListener("click",o.remove.bind(o)),o.appendChild(i),o},confirm:function(e){var o=d(e),i=document.createElement("div"),n=document.createElement("button"),h=document.createElement("button"),p=o.querySelector("."+r),u=e.cancelHandler,g=e.okHandler;return i.classList.add(c),n.innerHTML=e.okText||"Confirm",h.innerHTML=e.cancelText||"Cancel",n.classList.add(a),h.classList.add(a),n.classList.add(l),h.classList.add("cdx-notify__button--cancel"),u&&"function"==typeof u&&(h.addEventListener("click",u),p.addEventListener("click",u)),g&&"function"==typeof g&&n.addEventListener("click",g),n.addEventListener("click",o.remove.bind(o)),h.addEventListener("click",o.remove.bind(o)),i.appendChild(n),i.appendChild(h),o.appendChild(i),o},prompt:function(e){var o=d(e),i=document.createElement("div"),n=document.createElement("button"),h=document.createElement("input"),p=o.querySelector("."+r),u=e.cancelHandler,g=e.okHandler;return i.classList.add(c),n.innerHTML=e.okText||"Ok",n.classList.add(a),n.classList.add(l),h.classList.add("cdx-notify__input"),e.placeholder&&h.setAttribute("placeholder",e.placeholder),e.default&&(h.value=e.default),e.inputType&&(h.type=e.inputType),u&&"function"==typeof u&&p.addEventListener("click",u),g&&"function"==typeof g&&n.addEventListener("click",function(){g(h.value)}),n.addEventListener("click",o.remove.bind(o)),i.appendChild(h),i.appendChild(n),o.appendChild(i),o},getWrapper:function(){var e=document.createElement("DIV");return e.classList.add("cdx-notifies"),e}})}]);let ep=n(eh);class eu{show(e){ep.show(e)}}class eg extends q{get methods(){return{show:e=>this.show(e)}}show(e){return this.notifier.show(e)}constructor({config:e,eventsDispatcher:o}){super({config:e,eventsDispatcher:o}),this.notifier=new eu}}class ef extends q{get methods(){let e=()=>this.isEnabled;return{toggle:e=>this.toggle(e),get isEnabled(){return e()}}}toggle(e){return this.Editor.ReadOnly.toggle(e)}get isEnabled(){return this.Editor.ReadOnly.isEnabled}}var em={};({get exports(){return em},set exports(s){em=s}}).exports=function(){function e(e){var o=e.tags;if(!Object.keys(o).map(function(e){return typeof o[e]}).every(function(e){return"object"===e||"boolean"===e||"function"===e}))throw Error("The configuration was invalid");this.config=e}var o=["P","LI","TD","TH","DIV","H1","H2","H3","H4","H5","H6","PRE"];function i(e){return -1!==o.indexOf(e.nodeName)}var n=["A","B","STRONG","I","EM","SUB","SUP","U","STRIKE"];return e.prototype.clean=function(e){let o=document.implementation.createHTMLDocument(),i=o.createElement("div");return i.innerHTML=e,this._sanitize(o,i),i.innerHTML},e.prototype._sanitize=function(e,o){var r=e.createTreeWalker(o,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null,!1),l=r.firstChild();if(l)do{if(l.nodeType===Node.TEXT_NODE){if(!(""===l.data.trim()&&(l.previousElementSibling&&i(l.previousElementSibling)||l.nextElementSibling&&i(l.nextElementSibling))))continue;o.removeChild(l),this._sanitize(e,o);break}if(l.nodeType===Node.COMMENT_NODE){o.removeChild(l),this._sanitize(e,o);break}var a,c,d,h,p=(d=l,-1!==n.indexOf(d.nodeName));p&&(h=Array.prototype.some.call(l.childNodes,i));var u=!!o.parentNode,g=i(o)&&i(l)&&u,f=l.nodeName.toLowerCase(),m=(a=this.config,c=l,"function"==typeof a.tags[f]?a.tags[f](c):a.tags[f]);if(p&&h||typeof m>"u"||"boolean"==typeof m&&!m||!this.config.keepNestedBlockElements&&g){if(!("SCRIPT"===l.n
4odeName||"STYLE"===l.nodeName))for(;l.childNodes.length>0;)o.insertBefore(l.childNodes[0],l);o.removeChild(l),this._sanitize(e,o);break}for(var b=0;b<l.attributes.length;b+=1){var k=l.attributes[b];(function(e,o,i){var n=e.name.toLowerCase();return!0!==o&&("function"==typeof o[n]?!o[n](e.value,i):typeof o[n]>"u"||!1===o[n]||"string"==typeof o[n]&&o[n]!==e.value)})(k,m,l)&&(l.removeAttribute(k.name),b-=1)}this._sanitize(e,l)}while(l=r.nextSibling())},e}();let eb=em;function ek(e,o){return e.map(e=>{let i=C(o)?o(e.tool):o;return _(i)||(e.data=function e(o,i){return Array.isArray(o)?o.map(o=>e(o,i)):B(o)?function(o,i){let n={};for(let l in o){var r;if(!Object.prototype.hasOwnProperty.call(o,l))continue;let a=o[l],c=B(r=i[l])||"boolean"===E(r)||C(r)?i[l]:i;n[l]=e(a,c)}return n}(o,i):S(o)?B(i)?ev(o,i):!1===i?ev(o,{}):o:o}(e.data,i)),e})}function ev(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new eb({tags:o}).clean(e)}class ex extends q{get methods(){return{clean:(e,o)=>this.clean(e,o)}}clean(e,o){return ev(e,o)}}class ew extends q{get methods(){return{save:()=>this.save()}}save(){let e="Editor's content can not be saved in read-only mode";return this.Editor.ReadOnly.isEnabled?(y(e,"warn"),Promise.reject(Error(e))):this.Editor.Saver.save()}}class ey extends q{get methods(){return{findParentTag:(e,o)=>this.findParentTag(e,o),expandToTag:e=>this.expandToTag(e)}}findParentTag(e,o){return new G().findParentTag(e,o)}expandToTag(e){new G().expandToTag(e)}}class eE extends q{get classes(){return{block:"cdx-block",inlineToolButton:"ce-inline-tool",inlineToolButtonActive:"ce-inline-tool--active",input:"cdx-input",loader:"cdx-loader",button:"cdx-button",settingsButton:"cdx-settings-button",settingsButtonActive:"cdx-settings-button--active"}}}class eC extends q{get methods(){return{close:()=>this.close(),open:()=>this.open(),toggleBlockSettings:e=>this.toggleBlockSettings(e),toggleToolbox:e=>this.toggleToolbox(e)}}open(){this.Editor.Toolbar.moveAndOpen()}close(){this.Editor.Toolbar.close()}toggleBlockSettings(e){if(-1===this.Editor.BlockManager.currentBlockIndex){y("Could't toggle the Toolbar because there is no block selected ","warn");return}(null!=e?e:!this.Editor.BlockSettings.opened)?(this.Editor.Toolbar.moveAndOpen(),this.Editor.BlockSettings.open()):this.Editor.BlockSettings.close()}toggleToolbox(e){if(-1===this.Editor.BlockManager.currentBlockIndex){y("Could't toggle the Toolbox because there is no block selected ","warn");return}(null!=e?e:!this.Editor.Toolbar.toolbox.opened)?(this.Editor.Toolbar.moveAndOpen(),this.Editor.Toolbar.toolbox.open()):this.Editor.Toolbar.toolbox.close()}}var eB={};window,({get exports(){return eB},set exports(s){eB=s}}).exports=function(e){var o={};function i(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=o,i.d=function(e,o,n){i.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:n})},i.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,o){if(1&o&&(e=i(e)),8&o||4&o&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var r in e)i.d(n,r,(function(o){return e[o]}).bind(null,r));return n},i.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(o,"a",o),o},i.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},i.p="",i(i.s=0)}([function(e,o,i){e.exports=i(1)},function(e,o,i){i.r(o),i.d(o,"default",function(){return n});class n{get CSS(){return{tooltip:"ct",tooltipContent:"ct__content",tooltipShown:"ct--shown",placement:{left:"ct--left",bottom:"ct--bottom",right:"ct--right",top:"ct--top"}}}show(e,o,i){this.nodes.wrapper||this.prepare(),this.hidingTimeout&&clearTimeout(this.hidingTimeout);let n=Object.assign({placement:"bottom",marginTop:0,marginLeft:0,marginRight:0,marginBottom:0,delay:70,hidingDelay:0},i);if(n.hidingDelay&&(this.hidingDelay=n.hidingDelay),this.nodes.content.innerHTML="","string"==typeof o)this.nodes.content.appendChild(document.createTextNode(o));else{if(!(o instanceof Node))throw Error("[CodeX Tooltip] Wrong type of \xabcontent\xbb passed. It should be an instance of Node or String. But "+typeof o+" given.");this.nodes.content.appendChild(o)}switch(this.nodes.wrapper.classList.remove(...Object.values(this.CSS.placement)),n.placement){case"top":this.placeTop(e,n);break;case"left":this.placeLeft(e,n);break;case"right":this.placeRight(e,n);break;default:this.placeBottom(e,n)}n&&n.delay?this.showingTimeout=setTimeout(()=>{this.nodes.wrapper.classList.add(this.CSS.tooltipShown),this.showed=!0},n.delay):(this.nodes.wrapper.classList.add(this.CSS.tooltipShown),this.showed=!0)}hide(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.hidingDelay&&!e)return this.hidingTimeout&&clearTimeout(this.hidingTimeout),void(this.hidingTimeout=setTimeout(()=>{this.hide(!0)},this.hidingDelay));this.nodes.wrapper.classList.remove(this.CSS.tooltipShown),this.showed=!1,this.showingTimeout&&clearTimeout(this.showingTimeout)}onHover(e,o,i){e.addEventListener("mouseenter",()=>{this.show(e,o,i)}),e.addEventListener("mouseleave",()=>{this.hide()})}destroy(){this.nodes.wrapper.remove(),window.removeEventListener("scroll",this.handleWindowScroll)}prepare(){this.nodes.wrapper=this.make("div",this.CSS.tooltip),this.nodes.content=this.make("div",this.CSS.tooltipContent),this.append(this.nodes.wrapper,this.nodes.content),this.append(document.body,this.nodes.wrapper)}loadStyles(){let e="codex-tooltips-style";if(document.getElementById(e))return;let o=i(2),n=this.make("style",null,{textContent:o.toString(),id:e});this.prepend(document.head,n)}placeBottom(e,o){let i=e.getBoundingClientRect(),n=i.left+e.clientWidth/2-this.nodes.wrapper.offsetWidth/2,r=i.bottom+window.pageYOffset+this.offsetTop+o.marginTop;this.applyPlacement("bottom",n,r)}placeTop(e,o){let i=e.getBoundingClientRect(),n=i.left+e.clientWidth/2-this.nodes.wrapper.offsetWidth/2,r=i.top+window.pageYOffset-this.nodes.wrapper.clientHeight-this.offsetTop;this.applyPlacement("top",n,r)}placeLeft(e,o){let i=e.getBoundingClientRect(),n=i.left-this.nodes.wrapper.offsetWidth-this.offsetLeft-o.marginLeft,r=i.top+window.pageYOffset+e.clientHeight/2-this.nodes.wrapper.offsetHeight/2;this.applyPlacement("left",n,r)}placeRight(e,o){let i=e.getBoundingClientRect(),n=i.right+this.offsetRight+o.marginRight,r=i.top+window.pageYOffset+e.clientHeight/2-this.nodes.wrapper.offsetHeight/2;
4this.applyPlacement("right",n,r)}applyPlacement(e,o,i){this.nodes.wrapper.classList.add(this.CSS.placement[e]),this.nodes.wrapper.style.left=o+"px",this.nodes.wrapper.style.top=i+"px"}make(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=document.createElement(e);for(let e in Array.isArray(o)?n.classList.add(...o):o&&n.classList.add(o),i)i.hasOwnProperty(e)&&(n[e]=i[e]);return n}append(e,o){Array.isArray(o)?o.forEach(o=>e.appendChild(o)):e.appendChild(o)}prepend(e,o){Array.isArray(o)?(o=o.reverse()).forEach(o=>e.prepend(o)):e.prepend(o)}constructor(){this.nodes={wrapper:null,content:null},this.showed=!1,this.offsetTop=10,this.offsetLeft=10,this.offsetRight=10,this.hidingDelay=0,this.handleWindowScroll=()=>{this.showed&&this.hide(!0)},this.loadStyles(),this.prepare(),window.addEventListener("scroll",this.handleWindowScroll,{passive:!0})}}},function(e,o){e.exports='.ct{z-index:999;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;-webkit-transition:opacity 50ms ease-in,-webkit-transform 70ms cubic-bezier(.215,.61,.355,1);transition:opacity 50ms ease-in,-webkit-transform 70ms cubic-bezier(.215,.61,.355,1);transition:opacity 50ms ease-in,transform 70ms cubic-bezier(.215,.61,.355,1);transition:opacity 50ms ease-in,transform 70ms cubic-bezier(.215,.61,.355,1),-webkit-transform 70ms cubic-bezier(.215,.61,.355,1);will-change:opacity,top,left;-webkit-box-shadow:0 8px 12px 0 rgba(29,32,43,.17),0 4px 5px -3px rgba(5,6,12,.49);box-shadow:0 8px 12px 0 rgba(29,32,43,.17),0 4px 5px -3px rgba(5,6,12,.49);border-radius:9px}.ct,.ct:before{position:absolute;top:0;left:0}.ct:before{content:"";bottom:0;right:0;background-color:#1d202b;z-index:-1;border-radius:4px}@supports(-webkit-mask-box-image:url("")){.ct:before{border-radius:0;-webkit-mask-box-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M10.71 0h2.58c3.02 0 4.64.42 6.1 1.2a8.18 8.18 0 013.4 3.4C23.6 6.07 24 7.7 24 10.71v2.58c0 3.02-.42 4.64-1.2 6.1a8.18 8.18 0 01-3.4 3.4c-1.47.8-3.1 1.21-6.11 1.21H10.7c-3.02 0-4.64-.42-6.1-1.2a8.18 8.18 0 01-3.4-3.4C.4 17.93 0 16.3 0 13.29V10.7c0-3.02.42-4.64 1.2-6.1a8.18 8.18 0 013.4-3.4C6.07.4 7.7 0 10.71 0z"/></svg>\') 48% 41% 37.9% 53.3%}}@media (--mobile){.ct{display:none}}.ct__content{padding:6px 10px;color:#cdd1e0;font-size:12px;text-align:center;letter-spacing:.02em;line-height:1em}.ct:after{content:"";width:8px;height:8px;position:absolute;background-color:#1d202b;z-index:-1}.ct--bottom{-webkit-transform:translateY(5px);transform:translateY(5px)}.ct--bottom:after{top:-3px;left:50%;-webkit-transform:translateX(-50%) rotate(-45deg);transform:translateX(-50%) rotate(-45deg)}.ct--top{-webkit-transform:translateY(-5px);transform:translateY(-5px)}.ct--top:after{top:auto;bottom:-3px;left:50%;-webkit-transform:translateX(-50%) rotate(-45deg);transform:translateX(-50%) rotate(-45deg)}.ct--left{-webkit-transform:translateX(-5px);transform:translateX(-5px)}.ct--left:after{top:50%;left:auto;right:0;-webkit-transform:translate(41.6%,-50%) rotate(-45deg);transform:translate(41.6%,-50%) rotate(-45deg)}.ct--right{-webkit-transform:translateX(5px);transform:translateX(5px)}.ct--right:after{top:50%;left:0;-webkit-transform:translate(-41.6%,-50%) rotate(-45deg);transform:translate(-41.6%,-50%) rotate(-45deg)}.ct--shown{opacity:1;-webkit-transform:none;transform:none}'}]).default;let eS=n(eB),eT=null;function eI(){eT||(eT=new eS)}function e_(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];eI(),null==eT||eT.hide(e)}function eM(e,o,i){eI(),null==eT||eT.onHover(e,o,i)}class eA extends q{get methods(){return{show:(e,o,i)=>this.show(e,o,i),hide:()=>this.hide(),onHover:(e,o,i)=>this.onHover(e,o,i)}}show(e,o,i){eI(),null==eT||eT.show(e,o,i)}hide(){e_()}onHover(e,o,i){eM(e,o,i)}constructor({config:e,eventsDispatcher:o}){super({config:e,eventsDispatcher:o})}}class eL extends q{get methods(){return{nodes:this.editorNodes}}get editorNodes(){return{wrapper:this.Editor.UI.nodes.wrapper,redactor:this.Editor.UI.nodes.redactor}}}let eO=function e(o,i){let n={};
4return Object.entries(o).forEach(o=>{let[r,l]=o;if(B(l)){let o=i?"".concat(i,".").concat(r):r;Object.values(l).every(e=>S(e))?n[r]=o:n[r]=e(l,o);return}n[r]=l}),n}(Y),eN='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M7 10L11.8586 14.8586C11.9367 14.9367 12.0633 14.9367 12.1414 14.8586L17 10"/></svg>',eD='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M7.69998 12.6L7.67896 12.62C6.53993 13.7048 6.52012 15.5155 7.63516 16.625V16.625C8.72293 17.7073 10.4799 17.7102 11.5712 16.6314L13.0263 15.193C14.0703 14.1609 14.2141 12.525 13.3662 11.3266L13.22 11.12"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M16.22 11.12L16.3564 10.9805C17.2895 10.0265 17.3478 8.5207 16.4914 7.49733V7.49733C15.5691 6.39509 13.9269 6.25143 12.8271 7.17675L11.3901 8.38588C10.0935 9.47674 9.95706 11.4241 11.0888 12.6852L11.12 12.72"/></svg>';class eR{get isDisabled(){return this.params.isDisabled}get toggle(){return this.params.toggle}get title(){return this.params.title}get closeOnActivate(){return this.params.closeOnActivate}get isConfirmationStateEnabled(){return null!==this.confirmationState}get isFocused(){return this.nodes.root.classList.contains(eR.CSS.focused)}static get CSS(){return{container:"ce-popover-item",title:"ce-popover-item__title",secondaryTitle:"ce-popover-item__secondary-title",icon:"ce-popover-item__icon",active:"ce-popover-item--active",disabled:"ce-popover-item--disabled",focused:"ce-popover-item--focused",hidden:"ce-popover-item--hidden",confirmationState:"ce-popover-item--confirmation",noHover:"ce-popover-item--no-hover",noFocus:"ce-popover-item--no-focus",wobbleAnimation:"wobble"}}getElement(){return this.nodes.root}handleClick(){if(this.isConfirmationStateEnabled){this.activateOrEnableConfirmationMode(this.confirmationState);return}this.activateOrEnableConfirmationMode(this.params)}toggleActive(e){this.nodes.root.classList.toggle(eR.CSS.active,e)}toggleHidden(e){this.nodes.root.classList.toggle(eR.CSS.hidden,e)}reset(){this.isConfirmationStateEnabled&&this.disableConfirmationMode()}onFocus(){this.disableSpecialHoverAndFocusBehavior()}make(e){let o=j.make("div",eR.CSS.container);return e.name&&(o.dataset.itemName=e.name),this.nodes.icon=j.make("div",eR.CSS.icon,{innerHTML:e.icon||'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><circle cx="12" cy="12" r="4" stroke="currentColor" stroke-width="2"/></svg>'}),o.appendChild(this.nodes.icon),o.appendChild(j.make("div",eR.CSS.title,{innerHTML:e.title||""})),e.secondaryLabel&&o.appendChild(j.make("div",eR.CSS.secondaryTitle,{textContent:e.secondaryLabel})),e.isActive&&o.classList.add(eR.CSS.active),e.isDisabled&&o.classList.add(eR.CSS.disabled),o}enableConfirmationMode(e){let o={...this.params,...e,confirmation:e.confirmation},i=this.make(o);this.nodes.root.innerHTML=i.innerHTML,this.nodes.root.classList.add(eR.CSS.confirmationState),this.confirmationState=e,this.enableSpecialHoverAndFocusBehavior()}disableConfirmationMode(){let e=this.make(this.params);this.nodes.root.innerHTML=e.innerHTML,this.nodes.root.classList.remove(eR.CSS.confirmationState),this.confirmationState=null,this.disableSpecialHoverAndFocusBehavior()}enableSpecialHoverAndFocusBehavior(){this.nodes.root.classList.add(eR.CSS.noHover),this.nodes.root.classList.add(eR.CSS.noFocus),this.nodes.root.addEventListener("mouseleave",this.removeSpecialHoverBehavior,{once:!0})}disableSpecialHoverAndFocusBehavior(){this.removeSpecialFocusBehavior(),this.removeSpecialHoverBehavior(),this.nodes.root.removeEventListener("mouseleave",this.removeSpecialHoverBehavior)}activateOrEnableConfirmationMode(e){if(void 0===e.confirmation)try{e.onActivate(e),this.disableConfirmationMode()}catch(e){this.animateError()}else this.enableConfirmationMode(e.confirmation)}animateError(){this.nodes.icon.classList.contains(eR.CSS.wobbleAnimation)||(this.nodes.icon.classList.add(eR.CSS.wobbleAnimation),this.nodes.icon.addEventListener("animationend",this.onErrorAnimationEnd))}constructor(e){this.nodes={root:null,icon:null},this.confirmationState=null,this.removeSpecialFocusBehavior=()=>{this.nodes.root.classList.remove(eR.CSS.noFocus)},this.removeSpecialHoverBehavior=()=>{this.nodes.root.classList.remove(eR.CSS.noHover)},this.onErrorAnimationEnd=()=>{this.nodes.icon.classList.remove(eR.CSS.wobbleAnimation),this.nodes.icon.removeEventListener("animationend",this.onErrorAnimationEnd)},this.params=e,this.nodes.root=this.make(e)}}let eP=class{get currentItem(){return -1===this.cursor?null:this.items[this.cursor]}setCursor(e){e<this.items.length&&e>=-1&&(this.dropCursor(),this.cursor=e,this.items[this.cursor].classList.add(this.focusedCssClass))}setItems(e){this.items=e}next(){this.cursor=this.leafNodesAndReturnIndex(eP.directions.RIGHT)}previous(){this.cursor=this.leafNodesAndReturnIndex(eP.directions.LEFT)}dropCursor(){-1!==this.cursor&&(this.items[this.cursor].classList.remove(this.focusedCssClass),this.cursor=-1)}leafNodesAndReturnIndex(e){if(0===this.items.length)return this.cursor;let o=this.cursor;return -1===o?o=e===eP.directions.RIGHT?-1:0:this.items[o].classList.remove(this.focusedCssClass),o=e===eP.directions.RIGHT?(o+1)%this.items.length:(this.items.length+o-1)%this.items.length,j.canSetCaret(this.items[o])&&O(()=>G.setCursor(this.items[o]),50)(),this.items[o].classList.add(this.focusedCssClass),o}constructor(e,o){this.cursor=-1,this.items=[],this.items=e||[],this.focusedCssClass=o}};eP.directions={RIGHT:"right",LEFT:"left"};class eF{get isActivated(){return this.activated}static get usedKeys(){return[v.TAB,v.LEFT,v.RIGHT,v.ENTER,v.UP,v.DOWN]}activate(e,o){this.activated=!0,e&&this.iterator.setItems(e),void 0!==o&&this.iterator.setCursor(o),document.addEventListener("keydown",this.onKeyDown,!0)}deactivate(){this.activated=!1,this.dropCursor(),document.removeEventListener("keydown",this.onKeyDown)}focusFirst(){this.dropCursor(),this.flipRight()}flipLeft(){this.iterator.previous(),this.flipCallback()}flipRight(){this.iterator.next(),this.flipCallback()}hasFocus(){return!!this.iterator.currentItem}onFlip(e){this.flipCallbacks.push(e)}removeOnFlip(e){this.flipCallbacks=this.flipCallbacks.filter(o=>o!==e)}dropCursor(){this.iterator.dropCursor()}isEventReadyForHandling(e){return this.activated&&this.allowedKeys.includes(e.ke
4yCode)}handleTabPress(e){switch(e.shiftKey?eP.directions.LEFT:eP.directions.RIGHT){case eP.directions.RIGHT:this.flipRight();break;case eP.directions.LEFT:this.flipLeft()}}handleEnterPress(e){this.activated&&(this.iterator.currentItem&&(e.stopPropagation(),e.preventDefault(),this.iterator.currentItem.click()),C(this.activateCallback)&&this.activateCallback(this.iterator.currentItem))}flipCallback(){this.iterator.currentItem&&this.iterator.currentItem.scrollIntoViewIfNeeded(),this.flipCallbacks.forEach(e=>e())}constructor(e){this.iterator=null,this.activated=!1,this.flipCallbacks=[],this.onKeyDown=e=>{if(this.isEventReadyForHandling(e))switch(eF.usedKeys.includes(e.keyCode)&&e.preventDefault(),e.keyCode){case v.TAB:this.handleTabPress(e);break;case v.LEFT:case v.UP:this.flipLeft();break;case v.RIGHT:case v.DOWN:this.flipRight();break;case v.ENTER:this.handleEnterPress(e)}},this.iterator=new eP(e.items,e.focusedItemClass),this.activateCallback=e.activateCallback,this.allowedKeys=e.allowedKeys||eF.usedKeys}}class eH{static get CSS(){return{wrapper:"cdx-search-field",icon:"cdx-search-field__icon",input:"cdx-search-field__input"}}getElement(){return this.wrapper}focus(){this.input.focus()}clear(){this.input.value="",this.searchQuery="",this.onSearch("",this.foundItems)}destroy(){this.listeners.removeAll()}render(e){this.wrapper=j.make("div",eH.CSS.wrapper);let o=j.make("div",eH.CSS.icon,{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><circle cx="10.5" cy="10.5" r="5.5" stroke="currentColor" stroke-width="2"/><line x1="15.4142" x2="19" y1="15" y2="18.5858" stroke="currentColor" stroke-linecap="round" stroke-width="2"/></svg>'});this.input=j.make("input",eH.CSS.input,{placeholder:e,tabIndex:-1}),this.wrapper.appendChild(o),this.wrapper.appendChild(this.input),this.listeners.on(this.input,"input",()=>{this.searchQuery=this.input.value,this.onSearch(this.searchQuery,this.foundItems)})}get foundItems(){return this.items.filter(e=>this.checkItem(e))}checkItem(e){var o;let i=(null==(o=e.title)?void 0:o.toLowerCase())||"",n=this.searchQuery.toLowerCase();return i.includes(n)}constructor({items:e,onSearch:o,placeholder:i}){this.listeners=new Z,this.items=e,this.onSearch=o,this.render(i)}}let ez=class{lock(){U?this.lockHard():document.body.classList.add(ez.CSS.scrollLocked)}unlock(){U?this.unlockHard():document.body.classList.remove(ez.CSS.scrollLocked)}lockHard(){this.scrollPosition=window.pageYOffset,document.documentElement.style.setProperty("--window-scroll-offset","".concat(this.scrollPosition,"px")),document.body.classList.add(ez.CSS.scrollLockedHard)}unlockHard(){document.body.classList.remove(ez.CSS.scrollLockedHard),null!==this.scrollPosition&&window.scrollTo(0,this.scrollPosition),this.scrollPosition=null}};ez.CSS={scrollLocked:"ce-scroll-locked",scrollLockedHard:"ce-scroll-locked--hard"};var eU=Object.defineProperty,ej=Object.getOwnPropertyDescriptor,eY=((d=eY||{}).Close="close",d);let eW=class extends X{static get CSS(){return{popover:"ce-popover",popoverOpenTop:"ce-popover--open-top",popoverOpened:"ce-popover--opened",search:"ce-popover__search",nothingFoundMessage:"ce-popover__nothing-found-message",nothingFoundMessageDisplayed:"ce-popover__nothing-found-message--displayed",customContent:"ce-popover__custom-content",customContentHidden:"ce-popover__custom-content--hidden",items:"ce-popover__items",overlay:"ce-popover__overlay",overlayHidden:"ce-popover__overlay--hidden"}}getElement(){return this.nodes.wrapper}hasFocus(){return this.flipper.hasFocus()}show(){this.shouldOpenBottom||(this.nodes.popover.style.setProperty("--popover-height",this.height+"px"),this.nodes.popover.classList.add(eW.CSS.popoverOpenTop)),this.nodes.overlay.classList.remove(eW.CSS.overlayHidden),this.nodes.popover.classList.add(eW.CSS.popoverOpened),this.flipper.activate(this.flippableElements),void 0!==this.search&&requestAnimationFrame(()=>{var e;null==(e=this.search)||e.focus()}),z()&&this.scrollLocker.lock()}hide(){this.nodes.popover.classList.remove(eW.CSS.popoverOpened),this.nodes.popover.classList.remove(eW.CSS.popoverOpenTop),this.nodes.overlay.classList.add(eW.CSS.overlayHidden
4),this.flipper.deactivate(),this.items.forEach(e=>e.reset()),void 0!==this.search&&this.search.clear(),z()&&this.scrollLocker.unlock(),this.emit("close")}destroy(){this.flipper.deactivate(),this.listeners.removeAll(),z()&&this.scrollLocker.unlock()}make(){this.nodes.popover=j.make("div",[eW.CSS.popover]),this.nodes.nothingFoundMessage=j.make("div",[eW.CSS.nothingFoundMessage],{textContent:this.messages.nothingFound}),this.nodes.popover.appendChild(this.nodes.nothingFoundMessage),this.nodes.items=j.make("div",[eW.CSS.items]),this.items.forEach(e=>{this.nodes.items.appendChild(e.getElement())}),this.nodes.popover.appendChild(this.nodes.items),this.listeners.on(this.nodes.popover,"click",e=>{let o=this.getTargetItem(e);void 0!==o&&this.handleItemClick(o)}),this.nodes.wrapper=j.make("div"),this.nodes.overlay=j.make("div",[eW.CSS.overlay,eW.CSS.overlayHidden]),this.listeners.on(this.nodes.overlay,"click",()=>{this.hide()}),this.nodes.wrapper.appendChild(this.nodes.overlay),this.nodes.wrapper.appendChild(this.nodes.popover)}addSearch(){this.search=new eH({items:this.items,placeholder:this.messages.search,onSearch:(e,o)=>{this.items.forEach(e=>{let i=!o.includes(e);e.toggleHidden(i)}),this.toggleNothingFoundMessage(0===o.length),this.toggleCustomContent(""!==e);let i=""===e?this.flippableElements:o.map(e=>e.getElement());this.flipper.isActivated&&(this.flipper.deactivate(),this.flipper.activate(i))}});let e=this.search.getElement();e.classList.add(eW.CSS.search),this.nodes.popover.insertBefore(e,this.nodes.popover.firstChild)}addCustomContent(e){this.nodes.customContent=e,this.nodes.customContent.classList.add(eW.CSS.customContent),this.nodes.popover.insertBefore(e,this.nodes.popover.firstChild)}getTargetItem(e){return this.items.find(o=>e.composedPath().includes(o.getElement()))}handleItemClick(e){e.isDisabled||(this.items.filter(o=>o!==e).forEach(e=>e.reset()),e.handleClick(),this.toggleItemActivenessIfNeeded(e),e.closeOnActivate&&this.hide())}initializeFlipper(){this.flipper=new eF({items:this.flippableElements,focusedItemClass:eR.CSS.focused,allowedKeys:[v.TAB,v.UP,v.DOWN,v.ENTER]}),this.flipper.onFlip(this.onFlip)}get flippableElements(){let e=this.items.map(e=>e.getElement());return(this.customContentFlippableItems||[]).concat(e)}get height(){let e=0;if(null===this.nodes.popover)return e;let o=this.nodes.popover.cloneNode(!0);return o.style.visibility="hidden",o.style.position="absolute",o.style.top="-1000px",o.classList.add(eW.CSS.popoverOpened),document.body.appendChild(o),e=o.offsetHeight,o.remove(),e}get shouldOpenBottom(){let e=this.nodes.popover.getBoundingClientRect(),o=this.scopeElement.getBoundingClientRect(),i=this.height,n=e.top+i,r=e.top-i,l=Math.min(window.innerHeight,o.bottom);return r<o.top||n<=l}toggleNothingFoundMessage(e){this.nodes.nothingFoundMessage.classList.toggle(eW.CSS.nothingFoundMessageDisplayed,e)}toggleCustomContent(e){var o;null==(o=this.nodes.customContent)||o.classList.toggle(eW.CSS.customContentHidden,e)}toggleItemActivenessIfNeeded(e){if(!0===e.toggle&&e.toggleActive(),"string"==typeof e.toggle){let o=this.items.filter(o=>o.toggle===e.toggle);if(1===o.length){e.toggleActive();return}o.forEach(o=>{o.toggleActive(o===e)})}}constructor(e){super(),this.scopeElement=document.body,this.listeners=new Z,this.scrollLocker=new ez,this.nodes={wrapper:null,popover:null,nothingFoundMessage:null,customContent:null,items:null,overlay:null},this.messages={nothingFound:"Nothing found",search:"Search"},this.onFlip=()=>{this.items.find(e=>e.isFocused).onFocus()},this.items=e.items.map(e=>new eR(e)),void 0!==e.scopeElement&&(this.scopeElement=e.scopeElement),e.messages&&(this.messages={...this.messages,...e.messages}),e.customContentFlippableItems&&(this.customContentFlippableItems=e.customContentFlippableItems),this.make(),e.customContent&&this.addCustomContent(e.customContent),e.searchable&&this.addSearch(),this.initializeFlipper()}};((e,o,i,n)=>{for(var r,l=n>1?void 0:n?ej(o,i):o,a=e.length-1;a>=0;a--)(r=e[a])&&(l=(n?r(o,i,l):r(l))||l);return n&&l&&eU(o,i,l)})([H],eW.prototype,"height",1);class eK extends q{get events(){return{opened:"block-settings-opened",closed:"block-settings-closed"}}get CSS(){return{settings:"ce-settings"}}get flipper(){var e;return null==(e=this.popover)?void 0:e.flipper}make(){this.nodes.wrapper=j.make("div",[this.CSS.settings])}destroy(){this.removeAllNodes()}open(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.Editor.BlockManager.currentBlock;this.opened=!0,this.selection.save(),this.Editor.BlockSelection.selectBlock(e),this.Editor.BlockSelection.clearCache();let[o,i]=e.getTunes();
4this.eventsDispatcher.emit(this.events.opened),this.popover=new eW({searchable:!0,items:o.map(e=>this.resolveTuneAliases(e)),customContent:i,customContentFlippableItems:this.getControls(i),scopeElement:this.Editor.API.methods.ui.nodes.redactor,messages:{nothingFound:W.ui(eO.ui.popover,"Nothing found"),search:W.ui(eO.ui.popover,"Filter")}}),this.popover.on(eY.Close,this.onPopoverClose),this.nodes.wrapper.append(this.popover.getElement()),this.popover.show()}getElement(){return this.nodes.wrapper}close(){this.opened&&(this.opened=!1,G.isAtEditor||this.selection.restore(),this.selection.clearSaved(),!this.Editor.CrossBlockSelection.isCrossBlockSelectionStarted&&this.Editor.BlockManager.currentBlock&&this.Editor.BlockSelection.unselectBlock(this.Editor.BlockManager.currentBlock),this.eventsDispatcher.emit(this.events.closed),this.popover&&(this.popover.off(eY.Close,this.onPopoverClose),this.popover.destroy(),this.popover.getElement().remove(),this.popover=null))}getControls(e){let{StylesAPI:o}=this.Editor;return Array.from(e.querySelectorAll(".".concat(o.classes.settingsButton,", ").concat(j.allInputsSelector)))}resolveTuneAliases(e){let o=function(e,o){let i={};return Object.keys(e).forEach(n=>{let r=o[n];void 0!==r?i[r]=e[n]:i[n]=e[n]}),i}(e,{label:"title"});return e.confirmation&&(o.confirmation=this.resolveTuneAliases(e.confirmation)),o}constructor(){super(...arguments),this.opened=!1,this.selection=new G,this.onPopoverClose=()=>{this.close()}}}class eX extends q{static get CSS(){return{conversionToolbarWrapper:"ce-conversion-toolbar",conversionToolbarShowed:"ce-conversion-toolbar--showed",conversionToolbarTools:"ce-conversion-toolbar__tools",conversionToolbarLabel:"ce-conversion-toolbar__label",conversionTool:"ce-conversion-tool",conversionToolHidden:"ce-conversion-tool--hidden",conversionToolIcon:"ce-conversion-tool__icon",conversionToolSecondaryLabel:"ce-conversion-tool__secondary-label",conversionToolFocused:"ce-conversion-tool--focused",conversionToolActive:"ce-conversion-tool--active"}}make(){this.nodes.wrapper=j.make("div",[eX.CSS.conversionToolbarWrapper,...this.isRtl?[this.Editor.UI.CSS.editorRtlFix]:[]]),this.nodes.tools=j.make("div",eX.CSS.conversionToolbarTools);let e=j.make("div",eX.CSS.conversionToolbarLabel,{textContent:W.ui(eO.ui.inlineToolbar.converter,"Convert to")});return this.addTools(),this.enableFlipper(),j.append(this.nodes.wrapper,e),j.append(this.nodes.wrapper,this.nodes.tools),this.nodes.wrapper}destroy(){this.flipper&&(this.flipper.deactivate(),this.flipper=null),this.removeAllNodes()}toggle(e){this.opened?this.close():this.open(),C(e)&&(this.togglingCallback=e)}open(){this.filterTools(),this.opened=!0,this.nodes.wrapper.classList.add(eX.CSS.conversionToolbarShowed),window.requestAnimationFrame(()=>{this.flipper.activate(this.tools.map(e=>e.button).filter(e=>!e.classList.contains(eX.CSS.conversionToolHidden))),this.flipper.focusFirst(),C(this.togglingCallback)&&this.togglingCallback(!0)})}close(){this.opened=!1,this.flipper.deactivate(),this.nodes.wrapper.classList.remove(eX.CSS.conversionToolbarShowed),C(this.togglingCallback)&&this.togglingCallback(!1)}hasTools(){return 1!==this.tools.length||this.tools[0].name!==this.config.defaultBlock}async replaceWithBlock(e,o){let{BlockManager:i,BlockSelection:n,InlineToolbar:r,Caret:l}=this.Editor;i.convert(this.Editor.BlockManager.currentBlock,e,o),n.clearSelection(),this.close(),r.close(),window.requestAnimationFrame(()=>{l.setToBlock(this.Editor.BlockManager.currentBlock,l.positions.END)})}addTools(){Array.from(this.Editor.Tools.blockTools.entries()).forEach(e=>{var o;let[i,n]=e,r=n.conversionConfig;r&&r.import&&null!=(o=n.toolbox)&&o.forEach(e=>this.addToolIfValid(i,e))})}addToolIfValid(e,o){_(o)||!o.icon||this.addTool(e,o)}addTool(e,o){var i;let n=j.make("div",[eX.CSS.conversionTool]),r=j.make("div",[eX.CSS.conversionToolIcon]);n.dataset.tool=e,r.innerHTML=o.icon,j.append(n,r),j.append(n,j.text(W.t(eO.toolNames,o.title||R(e))));let l=null==(i=this.Editor.Tools.blockTools.get(e))?void 0:i.shortcut;if(l){let e=j.make("span",eX.CSS.conversionToolSecondaryLabel,{innerText:P(l)});j.append(n,e)}j.append(this.nodes.tools,n),this.tools.push({name:e,button:n,toolboxItem:o}),this.listeners.on(n,"click",async()=>{await this.replaceWithBlock(e,o.data)})}async filterTools(){let{currentBlock:e}=this.Editor.BlockManager,o=await e.getActiveToolboxEntry();
4this.tools.forEach(i=>{let n=!1;if(o){var r;let l=(r=i.toolboxItem,o.icon===r.icon&&o.title===r.title);n=i.button.dataset.tool===e.name&&l}i.button.hidden=n,i.button.classList.toggle(eX.CSS.conversionToolHidden,n)})}enableFlipper(){this.flipper=new eF({focusedItemClass:eX.CSS.conversionToolFocused})}constructor(){super(...arguments),this.opened=!1,this.tools=[],this.flipper=null,this.togglingCallback=null}}var eV={};window,({get exports(){return eV},set exports(s){eV=s}}).exports=function(e){var o={};function i(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=e,i.c=o,i.d=function(e,o,n){i.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:n})},i.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,o){if(1&o&&(e=i(e)),8&o||4&o&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var r in e)i.d(n,r,(function(o){return e[o]}).bind(null,r));return n},i.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(o,"a",o),o},i.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},i.p="",i(i.s=0)}([function(e,o,i){function n(e,o){for(var i=0;i<o.length;i++){var n=o[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function r(e,o,i){return o&&n(e.prototype,o),i&&n(e,i),e}i.r(o);var l=function(){function e(o){var i=this;(function(e,o){if(!(e instanceof o))throw TypeError("Cannot call a class as a function")})(this,e),this.commands={},this.keys={},this.name=o.name,this.parseShortcutName(o.name),this.element=o.on,this.callback=o.callback,this.executeShortcut=function(e){i.execute(e)},this.element.addEventListener("keydown",this.executeShortcut,!1)}return r(e,null,[{key:"supportedCommands",get:function(){return{SHIFT:["SHIFT"],CMD:["CMD","CONTROL","COMMAND","WINDOWS","CTRL"],ALT:["ALT","OPTION"]}}},{key:"keyCodes",get:function(){return{0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,BACKSPACE:8,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,INSERT:45,DELETE:46,".":190}}}]),r(e,[{key:"parseShortcutName",value:function(o){o=o.split("+");for(var i=0;i<o.length;i++){o[i]=o[i].toUpperCase();var n=!1;for(var r in e.supportedCommands)if(e.supportedCommands[r].includes(o[i])){n=this.commands[r]=!0;break}n||(this.keys[o[i]]=!0)}
4for(var l in e.supportedCommands)this.commands[l]||(this.commands[l]=!1)}},{key:"execute",value:function(o){var i,n={CMD:o.ctrlKey||o.metaKey,SHIFT:o.shiftKey,ALT:o.altKey},r=!0;for(i in this.commands)this.commands[i]!==n[i]&&(r=!1);var l,a=!0;for(l in this.keys)a=a&&o.keyCode===e.keyCodes[l];r&&a&&this.callback(o)}},{key:"remove",value:function(){this.element.removeEventListener("keydown",this.executeShortcut)}}]),e}();o.default=l}]).default;let eZ=n(eV);class eq{add(e){if(this.findShortcut(e.on,e.name))throw Error("Shortcut ".concat(e.name," is already registered for ").concat(e.on,". Please remove it before add a new handler."));let o=new eZ({name:e.name,on:e.on,callback:e.handler}),i=this.registeredShortcuts.get(e.on)||[];this.registeredShortcuts.set(e.on,[...i,o])}remove(e,o){let i=this.findShortcut(e,o);if(!i)return;i.remove();let n=this.registeredShortcuts.get(e);this.registeredShortcuts.set(e,n.filter(e=>e!==i))}findShortcut(e,o){return(this.registeredShortcuts.get(e)||[]).find(e=>{let{name:i}=e;return i===o})}constructor(){this.registeredShortcuts=new Map}}let eG=new eq;var eQ=Object.defineProperty,eJ=Object.getOwnPropertyDescriptor,e$=(e,o,i,n)=>{for(var r,l=n>1?void 0:n?eJ(o,i):o,a=e.length-1;a>=0;a--)(r=e[a])&&(l=(n?r(o,i,l):r(l))||l);return n&&l&&eQ(o,i,l),l},e0=((h=e0||{}).Opened="toolbox-opened",h.Closed="toolbox-closed",h.BlockAdded="toolbox-block-added",h);let e1=class extends X{get isEmpty(){return 0===this.toolsToBeDisplayed.length}static get CSS(){return{toolbox:"ce-toolbox"}}make(){return this.popover=new eW({scopeElement:this.api.ui.nodes.redactor,searchable:!0,messages:{nothingFound:this.i18nLabels.nothingFound,search:this.i18nLabels.filter},items:this.toolboxItemsToBeDisplayed}),this.popover.on(eY.Close,this.onPopoverClose),this.enableShortcuts(),this.nodes.toolbox=this.popover.getElement(),this.nodes.toolbox.classList.add(e1.CSS.toolbox),this.nodes.toolbox}hasFocus(){var e;return null==(e=this.popover)?void 0:e.hasFocus()}destroy(){var e;super.destroy(),this.nodes&&this.nodes.toolbox&&(this.nodes.toolbox.remove(),this.nodes.toolbox=null),this.removeAllShortcuts(),null==(e=this.popover)||e.off(eY.Close,this.onPopoverClose)}toolButtonActivated(e,o){this.insertNewBlock(e,o)}open(){var e;this.isEmpty||(null==(e=this.popover)||e.show(),this.opened=!0,this.emit("toolbox-opened"))}close(){var e;null==(e=this.popover)||e.hide(),this.opened=!1,this.emit("toolbox-closed")}toggle(){this.opened?this.close():this.open()}get toolsToBeDisplayed(){let e=[];return this.tools.forEach(o=>{o.toolbox&&e.push(o)}),e}get toolboxItemsToBeDisplayed(){let e=(e,o)=>({icon:e.icon,title:W.t(eO.toolNames,e.title||R(o.name)),name:o.name,onActivate:()=>{this.toolButtonActivated(o.name,e.data)},secondaryLabel:o.shortcut?P(o.shortcut):""});return this.toolsToBeDisplayed.reduce((o,i)=>(Array.isArray(i.toolbox)?i.toolbox.forEach(n=>{o.push(e(n,i))}):void 0!==i.toolbox&&o.push(e(i.toolbox,i)),o),[])}enableShortcuts(){this.toolsToBeDisplayed.forEach(e=>{let o=e.shortcut;o&&this.enableShortcutForTool(e.name,o)})}enableShortcutForTool(e,o){eG.add({name:o,on:this.api.ui.nodes.redactor,handler:o=>{o.preventDefault();let i=this.api.blocks.getCurrentBlockIndex(),n=this.api.blocks.getBlockByIndex(i);if(n)try{this.api.blocks.convert(n.id,e),window.requestAnimationFrame(()=>{this.api.caret.setToBlock(i,"end")});return}catch(e){}this.insertNewBlock(e)}})}removeAllShortcuts(){this.toolsToBeDisplayed.forEach(e=>{let o=e.shortcut;o&&eG.remove(this.api.ui.nodes.redactor,o)})}async insertNewBlock(e,o){let i;let n=this.api.blocks.getCurrentBlockIndex(),r=this.api.blocks.getBlockByIndex(n);if(!r)return;let l=r.isEmpty?n:n+1;o&&(i=Object.assign(await this.api.blocks.composeBlockData(e),o));let a=this.api.blocks.insert(e,i,void 0,l,void 0,r.isEmpty);a.call(eo.APPEND_CALLBACK),this.api.caret.setToBlock(l),this.emit("toolbox-block-added",{block:a}),this.api.toolbar.close()}constructor({api:e,tools:o,i18nLabels:i}){super(),this.opened=!1,this.nodes={toolbox:null},this.onPopoverClose=()=>{this.opened=!1,this.emit("toolbox-closed")},this.api=e,this.tools=o,this.i18nLabels=i}};
4e$([H],e1.prototype,"toolsToBeDisplayed",1),e$([H],e1.prototype,"toolboxItemsToBeDisplayed",1);let e2="block hovered";async function e5(e,o){let i=navigator.keyboard;return i&&(await i.getLayoutMap()).get(e)||o}class e3 extends q{get CSS(){return{toolbar:"ce-toolbar",content:"ce-toolbar__content",actions:"ce-toolbar__actions",actionsOpened:"ce-toolbar__actions--opened",toolbarOpened:"ce-toolbar--opened",openedToolboxHolderModifier:"codex-editor--toolbox-opened",plusButton:"ce-toolbar__plus",plusButtonShortcut:"ce-toolbar__plus-shortcut",settingsToggler:"ce-toolbar__settings-btn",settingsTogglerHidden:"ce-toolbar__settings-btn--hidden"}}get opened(){return this.nodes.wrapper.classList.contains(this.CSS.toolbarOpened)}get toolbox(){var e;return{opened:null==(e=this.toolboxInstance)?void 0:e.opened,close:()=>{var e;null==(e=this.toolboxInstance)||e.close()},open:()=>{if(null===this.toolboxInstance){w("toolbox.open() called before initialization is finished","warn");return}this.Editor.BlockManager.currentBlock=this.hoveredBlock,this.toolboxInstance.open()},toggle:()=>{if(null===this.toolboxInstance){w("toolbox.toggle() called before initialization is finished","warn");return}this.toolboxInstance.toggle()},hasFocus:()=>{var e;return null==(e=this.toolboxInstance)?void 0:e.hasFocus()}}}get blockActions(){return{hide:()=>{this.nodes.actions.classList.remove(this.CSS.actionsOpened)},show:()=>{this.nodes.actions.classList.add(this.CSS.actionsOpened)}}}get blockTunesToggler(){return{hide:()=>this.nodes.settingsToggler.classList.add(this.CSS.settingsTogglerHidden),show:()=>this.nodes.settingsToggler.classList.remove(this.CSS.settingsTogglerHidden)}}toggleReadOnly(e){e?(this.destroy(),this.Editor.BlockSettings.destroy(),this.disableModuleBindings()):window.requestIdleCallback(()=>{this.drawUI(),this.enableModuleBindings()},{timeout:2e3})}moveAndOpen(){let e,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.Editor.BlockManager.currentBlock;if(null===this.toolboxInstance){w("Can't open Toolbar since Editor initialization is not finished yet","warn");return}if(this.toolboxInstance.opened&&this.toolboxInstance.close(),this.Editor.BlockSettings.opened&&this.Editor.BlockSettings.close(),!o)return;this.hoveredBlock=o;let i=o.holder,{isMobile:n}
4=this.Editor.UI,r=o.pluginsContent,l=parseInt(window.getComputedStyle(r).paddingTop,10),a=i.offsetHeight;e=n?i.offsetTop+a:i.offsetTop+l,this.nodes.wrapper.style.top="".concat(Math.floor(e),"px"),1===this.Editor.BlockManager.blocks.length&&o.isEmpty?this.blockTunesToggler.hide():this.blockTunesToggler.show(),this.open()}close(){var e,o;this.Editor.ReadOnly.isEnabled||(null==(e=this.nodes.wrapper)||e.classList.remove(this.CSS.toolbarOpened),this.blockActions.hide(),null==(o=this.toolboxInstance)||o.close(),this.Editor.BlockSettings.close(),this.reset())}reset(){this.nodes.wrapper.style.top="unset"}open(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.nodes.wrapper.classList.add(this.CSS.toolbarOpened),e?this.blockActions.show():this.blockActions.hide()}async make(){this.nodes.wrapper=j.make("div",this.CSS.toolbar),["content","actions"].forEach(e=>{this.nodes[e]=j.make("div",this.CSS[e])}),j.append(this.nodes.wrapper,this.nodes.content),j.append(this.nodes.content,this.nodes.actions),this.nodes.plusButton=j.make("div",this.CSS.plusButton,{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M12 7V12M12 17V12M17 12H12M12 12H7"/></svg>'}),j.append(this.nodes.actions,this.nodes.plusButton),this.readOnlyMutableListeners.on(this.nodes.plusButton,"click",()=>{e_(!0),this.plusButtonClicked()},!1);let e=j.make("div");e.appendChild(document.createTextNode(W.ui(eO.ui.toolbar.toolbox,"Add"))),e.appendChild(j.make("div",this.CSS.plusButtonShortcut,{textContent:"/"})),eM(this.nodes.plusButton,e,{hidingDelay:400}),this.nodes.settingsToggler=j.make("span",this.CSS.settingsToggler,{innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M9.40999 7.29999H9.4"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 7.29999H14.59"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M9.30999 12H9.3"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 12H14.59"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M9.40999 16.7H9.4"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2.6" d="M14.6 16.7H14.59"/></svg>'}),j.append(this.nodes.actions,this.nodes.settingsToggler);let o=j.make("div"),i=j.text(W.ui(eO.ui.blockTunes.toggler,"Click to tune")),n=await e5("Slash","/");o.appendChild(i),o.appendChild(j.make("div",this.CSS.plusButtonShortcut,{textContent:P("CMD + ".concat(n))})),eM(this.nodes.settingsToggler,o,{hidingDelay:400}),j.append(this.nodes.actions,this.makeToolbox()),j.append(this.nodes.actions,this.Editor.BlockSettings.getElement()),j.append(this.Editor.UI.nodes.wrapper,this.nodes.wrapper)}makeToolbox(){return this.toolboxInstance=new e1({api:this.Editor.API.methods,tools:this.Editor.Tools.blockTools,i18nLabels:{filter:W.ui(eO.ui.popover,"Filter"),nothingFound:W.ui(eO.ui.popover,"Nothing found")}}),this.toolboxInstance.on(e0.Opened,()=>{this.Editor.UI.nodes.wrapper.classList.add(this.CSS.openedToolboxHolderModifier)}),this.toolboxInstance.on(e0.Closed,()=>{this.Editor.UI.nodes.wrapper.classList.remove(this.CSS.openedToolboxHolderModifier)}),this.toolboxInstance.on(e0.BlockAdded,e=>{let{block:o}=e,{BlockManager:i,Caret:n}=this.Editor,r=i.getBlockById(o.id);0===r.inputs.length&&(r===i.lastBlock?(i.insertAtEnd(),n.setToBlock(i.lastBlock)):n.setToBlock(i.nextBlock))}),this.toolboxInstance.make()}plusButtonClicked(){var e;this.Editor.BlockManager.currentBlock=this.hoveredBlock,null==(e=this.toolboxInstance)||e.toggle()}enableModuleBindings(){this.readOnlyMutableListeners.on(this.nodes.settingsToggler,"mousedown",e=>{var o;e.stopPropagation(),this.settingsTogglerClicked(),null!=(o=this.toolboxInstance)&&o.opened&&this.toolboxInstance.close(),e_(!0)},!0),z()||this.eventsDispatcher.on(e2,e=>{var o;this.Editor.BlockSettings.opened||null!=(o=this.toolboxInstance)&&o.opened||this.moveAndOpe
4n(e.block)})}disableModuleBindings(){this.readOnlyMutableListeners.clearAll()}settingsTogglerClicked(){this.Editor.BlockManager.currentBlock=this.hoveredBlock,this.Editor.BlockSettings.opened?this.Editor.BlockSettings.close():this.Editor.BlockSettings.open(this.hoveredBlock)}drawUI(){this.Editor.BlockSettings.make(),this.make()}destroy(){this.removeAllNodes(),this.toolboxInstance&&this.toolboxInstance.destroy()}constructor({config:e,eventsDispatcher:o}){super({config:e,eventsDispatcher:o}),this.toolboxInstance=null}}var e4=((p=e4||{})[p.Block=0]="Block",p[p.Inline=1]="Inline",p[p.Tune=2]="Tune",p),e6=((u=e6||{}).Shortcut="shortcut",u.Toolbox="toolbox",u.EnabledInlineTools="inlineToolbar",u.EnabledBlockTunes="tunes",u.Config="config",u),e8=((g=e8||{}).Shortcut="shortcut",g.SanitizeConfig="sanitize",g),e7=((f=e7||{}).IsEnabledLineBreaks="enableLineBreaks",f.Toolbox="toolbox",f.ConversionConfig="conversionConfig",f.IsReadOnlySupported="isReadOnlySupported",f.PasteConfig="pasteConfig",f),e9=((m=e9||{}).IsInline="isInline",m.Title="title",m),te=((b=te||{}).IsTune="isTune",b);class tt{get settings(){let e=this.config.config||{};return!this.isDefault||"placeholder"in e||!this.defaultPlaceholder||(e.placeholder=this.defaultPlaceholder),e}reset(){if(C(this.constructable.reset))return this.constructable.reset()}prepare(){if(C(this.constructable.prepare))return this.constructable.prepare({toolName:this.name,config:this.settings})}get shortcut(){let e=this.constructable.shortcut;return this.config.shortcut||e}get sanitizeConfig(){return this.constructable.sanitize||{}}isInline(){return 1===this.type}isBlock(){return 0===this.type}isTune(){return 2===this.type}constructor({name:e,constructable:o,config:i,api:n,isDefault:r,isInternal:l=!1,defaultPlaceholder:a}){this.api=n,this.name=e,this.constructable=o,this.config=i,this.isDefault=r,this.isInternal=l,this.defaultPlaceholder=a}}class to extends q{toggleReadOnly(e){e?(this.destroy(),this.Editor.ConversionToolbar.destroy()):window.requestIdleCallback(()=>{this.make()},{timeout:2e3})}async tryToShow(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=!(arguments.length>1)||void 0===arguments[1]||arguments[1];e&&this.close(),this.allowedToShow()&&(await this.addToolsFiltered(o),this.move(),this.open(o),this.Editor.Toolbar.close())}close(){this.opened&&(this.Editor.ReadOnly.isEnabled||(this.nodes.wrapper.classList.remove(this.CSS.inlineToolbarShowed),Array.from(this.toolsInstances.entries()).forEach(e=>{let[o,i]=e,n=this.getToolShortcut(o);n&&eG.remove(this.Editor.UI.nodes.redactor,n),C(i.clear)&&i.clear()}),this.reset(),this.opened=!1,this.flipper.deactivate(),this.Editor.ConversionToolbar.close()))}containsNode(e){return void 0!==this.nodes.wrapper&&this.nodes.wrapper.contains(e)}destroy(){this.flipper&&(this.flipper.deactivate(),this.flipper=null),this.removeAllNodes()}make(){this.nodes.wrapper=j.make("div",[this.CSS.inlineToolbar,...this.isRtl?[this.Editor.UI.CSS.editorRtlFix]:[]]),this.nodes.togglerAndButtonsWrapper=j.make("div",this.CSS.togglerAndButtonsWrapper),this.nodes.buttons=j.make("div",this.CSS.buttonsWrapper),this.nodes.actions=j.make("div",this.CSS.actionsWrapper),this.listeners.on(this.nodes.wrapper,"mousedown",e=>{e.target.closest(".".concat(this.CSS.actionsWrapper))||e.preventDefault()}),j.append(this.nodes.wrapper,[this.nodes.togglerAndButtonsWrapper,this.nodes.actions]),j.append(this.Editor.UI.nodes.wrapper,this.nodes.wrapper),this.addConversionToggler(),j.append(this.nodes.togglerAndButtonsWrapper,this.nodes.buttons),this.prepareConversionToolbar(),window.requestAnimationFrame(()=>{this.recalculateWidth()}),this.enableFlipper()}open(){if(this.opened)return;this.nodes.wrapper.classList.add(this.CSS.inlineToolbarShowed),this.buttonsList=this.nodes.buttons.querySelectorAll(".".concat(this.CSS.inlineToolButton)),this.opened=!0;let e=Array.from(this.buttonsList);e.unshift(this.nodes.conversionToggler),e=e.filter(e=>!e.hidden),this.flipper.activate(e)}move(){let e=G.rect,o=this.Editor.UI.nodes.wrapper.getBoundingClientRect(),i={x:e.x-o.x,y:e.y+e.height-o.top+this.toolbarVerticalMargin};i.x+this.width+o.x>this.Editor.UI.contentRect.right&&(i.x=this.Editor.UI.contentRect.right-this.width-o.x),this.nodes.wrapper.style.left=Math.floor(i.x)+"px",this.nodes.wrapper.style.top=Math.floor(i.y)+"px"}
4reset(){this.nodes.wrapper.classList.remove(this.CSS.inlineToolbarLeftOriented,this.CSS.inlineToolbarRightOriented),this.nodes.wrapper.style.left="0",this.nodes.wrapper.style.top="0"}allowedToShow(){let e=G.get(),o=G.text;if(!e||!e.anchorNode||e.isCollapsed||o.length<1)return!1;let i=j.isElement(e.anchorNode)?e.anchorNode:e.anchorNode.parentElement;if(e&&["IMG","INPUT"].includes(i.tagName)||null===i.closest('[contenteditable="true"]'))return!1;let n=this.Editor.BlockManager.getBlock(e.anchorNode);return!!n&&0!==n.tool.inlineTools.size}recalculateWidth(){this.width=this.nodes.wrapper.offsetWidth}addConversionToggler(){this.nodes.conversionToggler=j.make("div",this.CSS.conversionToggler),this.nodes.conversionTogglerContent=j.make("div",this.CSS.conversionTogglerContent);let e=j.make("div",this.CSS.conversionTogglerArrow,{innerHTML:eN});this.nodes.conversionToggler.appendChild(this.nodes.conversionTogglerContent),this.nodes.conversionToggler.appendChild(e),this.nodes.togglerAndButtonsWrapper.appendChild(this.nodes.conversionToggler),this.listeners.on(this.nodes.conversionToggler,"click",()=>{this.Editor.ConversionToolbar.toggle(e=>{!e&&this.opened?this.flipper.activate():this.opened&&this.flipper.deactivate()})}),!1===z()&&eM(this.nodes.conversionToggler,W.ui(eO.ui.inlineToolbar.converter,"Convert to"),{placement:"top",hidingDelay:100})}async setConversionTogglerContent(){let{BlockManager:e}=this.Editor,{currentBlock:o}=e,i=o.name,n=o.tool.conversionConfig,r=n&&n.export;this.nodes.conversionToggler.hidden=!r,this.nodes.conversionToggler.classList.toggle(this.CSS.conversionTogglerHidden,!r);let l=await o.getActiveToolboxEntry()||{};this.nodes.conversionTogglerContent.innerHTML=l.icon||l.title||R(i)}prepareConversionToolbar(){let e=this.Editor.ConversionToolbar.make();j.append(this.nodes.wrapper,e)}async addToolsFiltered(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],o=G.get(),i=this.Editor.BlockManager.getBlock(o.anchorNode);this.nodes.buttons.innerHTML="",this.nodes.actions.innerHTML="",this.toolsInstances=new Map,Array.from(i.tool.inlineTools.values()).forEach(e=>{this.addTool(e)}),e&&this.Editor.ConversionToolbar.hasTools()?await this.setConversionTogglerContent():this.nodes.conversionToggler.hidden=!0,this.recalculateWidth()}addTool(e){let o=e.create(),i=o.render();if(!i){w("Render method must return an instance of Node","warn",e.name);return}if(i.dataset.tool=e.name,this.nodes.buttons.appendChild(i),this.toolsInstances.set(e.name,o),C(o.renderActions)){let e=o.renderActions();this.nodes.actions.appendChild(e)}this.listeners.on(i,"click",e=>{this.toolClicked(o),e.preventDefault()});let n=this.getToolShortcut(e.name);if(n)try{this.enableShortcuts(o,n)}catch(e){}let r=j.make("div"),l=W.t(eO.toolNames,e.title||R(e.name));r.appendChild(j.text(l)),n&&r.appendChild(j.make("div",this.CSS.inlineToolbarShortcut,{textContent:P(n)})),!1===z()&&eM(i,r,{placement:"top",hidingDelay:100}),o.checkState(G.get())}getToolShortcut(e){let{Tools:o}=this.Editor,i=o.inlineTools.get(e);return Array.from(o.internal.inlineTools.keys()).includes(e)?this.inlineTools[e][e8.Shortcut]:i.shortcut}enableShortcuts(e,o){eG.add({name:o,handler:o=>{let{currentBlock:i}=this.Editor.BlockManager;i&&i.tool.enabledInlineTools&&(o.preventDefault(),this.toolClicked(e))},on:this.Editor.UI.nodes.redactor})}toolClicked(e){let o=G.range;e.surround(o),this.checkToolsState(),void 0!==e.renderActions&&this.flipper.deactivate()}checkToolsState(){this.toolsInstances.forEach(e=>{e.checkState(G.get())})}get inlineTools(){let e={};return Array.from(this.Editor.Tools.inlineTools.entries()).forEach(o=>{let[i,n]=o;e[i]=n.create()}),e}enableFlipper(){this.flipper=new eF({focusedItemClass:this.CSS.focusedButton,allowedKeys:[v.ENTER,v.TAB]})}constructor({config:e,eventsDispatcher:o}){super({config:e,eventsDispatcher:o}),this.CSS={inlineToolbar:"ce-inline-toolbar",inlineToolbarShowed:"ce-inline-toolbar--showed",inlineToolbarLeftOriented:"ce-inline-toolbar--left-oriented",inlineToolbarRightOriented:"ce-inline-toolbar--right-oriented",inlineToolbarShortcut:"ce-inline-toolbar__shortcut",buttonsWrapper:"ce-inline-toolbar__buttons",actionsWrapper:"ce-inline-toolbar__actions",inlineToolButton:"ce-inline-tool",inputField:"cdx-input",focu
4sedButton:"ce-inline-tool--focused",conversionToggler:"ce-inline-toolbar__dropdown",conversionTogglerArrow:"ce-inline-toolbar__dropdown-arrow",conversionTogglerHidden:"ce-inline-toolbar__dropdown--hidden",conversionTogglerContent:"ce-inline-toolbar__dropdown-content",togglerAndButtonsWrapper:"ce-inline-toolbar__toggler-and-button-wrapper"},this.opened=!1,this.toolbarVerticalMargin=z()?20:6,this.buttonsList=null,this.width=0,this.flipper=null}}class ti extends q{keydown(e){switch(this.beforeKeydownProcessing(e),e.keyCode){case v.BACKSPACE:this.backspace(e);break;case v.DELETE:this.delete(e);break;case v.ENTER:this.enter(e);break;case v.DOWN:case v.RIGHT:this.arrowRightAndDown(e);break;case v.UP:case v.LEFT:this.arrowLeftAndUp(e);break;case v.TAB:this.tabPressed(e)}"/"!==e.key||e.ctrlKey||e.metaKey||this.slashPressed(),"Slash"===e.code&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.commandSlashPressed())}beforeKeydownProcessing(e){this.needToolbarClosing(e)&&M(e.keyCode)&&(this.Editor.Toolbar.close(),this.Editor.ConversionToolbar.close(),e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||this.Editor.BlockSelection.clearSelection(e))}keyup(e){e.shiftKey||this.Editor.UI.checkEmptiness()}dragOver(e){this.Editor.BlockManager.getBlockByChildNode(e.target).dropTarget=!0}dragLeave(e){this.Editor.BlockManager.getBlockByChildNode(e.target).dropTarget=!1}handleCommandC(e){let{BlockSelection:o}=this.Editor;o.anyBlockSelected&&o.copySelectedBlocks(e)}handleCommandX(e){let{BlockSelection:o,BlockManager:i,Caret:n}=this.Editor;o.anyBlockSelected&&o.copySelectedBlocks(e).then(()=>{let r=i.removeSelectedBlocks(),l=i.insertDefaultBlockAtIndex(r,!0);n.setToBlock(l,n.positions.START),o.clearSelection(e)})}tabPressed(e){let{InlineToolbar:o,ConversionToolbar:i,Caret:n}=this.Editor;!i.opened&&!o.opened&&(e.shiftKey?n.navigatePrevious(!0):n.navigateNext(!0))&&e.preventDefault()}commandSlashPressed(){this.Editor.BlockSelection.selectedBlocks.length>1||this.activateBlockSettings()}slashPressed(){this.Editor.BlockManager.currentBlock.isEmpty&&this.activateToolbox()}enter(e){let{BlockManager:o,UI:i}=this.Editor;if(o.currentBlock.tool.isLineBreaksEnabled||i.someToolbarOpened&&i.someFlipperButtonFocused||e.shiftKey)return;let n=this.Editor.BlockManager.currentBlock;this.Editor.Caret.isAtStart&&!this.Editor.BlockManager.currentBlock.hasMedia?this.Editor.BlockManager.insertDefaultBlockAtIndex(this.Editor.BlockManager.currentBlockIndex):n=this.Editor.Caret.isAtEnd?this.Editor.BlockManager.insertDefaultBlockAtIndex(this.Editor.BlockManager.currentBlockIndex+1):this.Editor.BlockManager.split(),this.Editor.Caret.setToBlock(n),this.Editor.Toolbar.moveAndOpen(n),e.preventDefault()}
4backspace(e){let{BlockManager:o,Caret:i}=this.Editor,{currentBlock:n,previousBlock:r}=o;if(G.isCollapsed&&i.isAtStart){if(e.preventDefault(),this.Editor.Toolbar.close(),n.currentInput!==n.firstInput){i.navigatePrevious();return}if(null!==r){if(r.isEmpty){o.removeBlock(r);return}if(n.isEmpty){o.removeBlock(n);let e=o.currentBlock;i.setToBlock(e,i.positions.END);return}et(n,r)?this.mergeBlocks(r,n):i.setToBlock(r,i.positions.END)}}}delete(e){let{BlockManager:o,Caret:i}=this.Editor,{currentBlock:n,nextBlock:r}=o;if(G.isCollapsed&&i.isAtEnd){if(e.preventDefault(),this.Editor.Toolbar.close(),n.currentInput!==n.lastInput){i.navigateNext();return}if(null!==r){if(r.isEmpty){o.removeBlock(r);return}if(n.isEmpty){o.removeBlock(n),i.setToBlock(r,i.positions.START);return}et(n,r)?this.mergeBlocks(n,r):i.setToBlock(r,i.positions.START)}}}mergeBlocks(e,o){let{BlockManager:i,Caret:n,Toolbar:r}=this.Editor;n.createShadow(e.pluginsContent),i.mergeBlocks(e,o).then(()=>{window.requestAnimationFrame(()=>{n.restoreCaret(e.pluginsContent),e.pluginsContent.normalize(),r.close()})})}arrowRightAndDown(e){let o=eF.usedKeys.includes(e.keyCode)&&(!e.shiftKey||e.keyCode===v.TAB);if(this.Editor.UI.someToolbarOpened&&o)return;this.Editor.Toolbar.close();let i=this.Editor.Caret.isAtEnd||this.Editor.BlockSelection.anyBlockSelected;if(e.shiftKey&&e.keyCode===v.DOWN&&i){this.Editor.CrossBlockSelection.toggleBlockSelectedState();return}if(e.keyCode!==v.DOWN&&(e.keyCode!==v.RIGHT||this.isRtl)?this.Editor.Caret.navigatePrevious():this.Editor.Caret.navigateNext()){e.preventDefault();return}O(()=>{this.Editor.BlockManager.currentBlock&&this.Editor.BlockManager.currentBlock.updateCurrentInput()},20)(),this.Editor.BlockSelection.clearSelection(e)}arrowLeftAndUp(e){if(this.Editor.UI.someToolbarOpened){if(eF.usedKeys.includes(e.keyCode)&&(!e.shiftKey||e.keyCode===v.TAB))return;this.Editor.UI.closeAllToolbars()}this.Editor.Toolbar.close();let o=this.Editor.Caret.isAtStart||this.Editor.BlockSelection.anyBlockSelected;if(e.shiftKey&&e.keyCode===v.UP&&o){this.Editor.CrossBlockSelection.toggleBlockSelectedState(!1);return}if(e.keyCode!==v.UP&&(e.keyCode!==v.LEFT||this.isRtl)?this.Editor.Caret.navigateNext():this.Editor.Caret.navigatePrevious()){e.preventDefault();return}O(()=>{this.Editor.BlockManager.currentBlock&&this.Editor.BlockManager.currentBlock.updateCurrentInput()},20)(),this.Editor.BlockSelection.clearSelection(e)}needToolbarClosing(e){let o=e.keyCode===v.ENTER&&this.Editor.Toolbar.toolbox.opened,i=e.keyCode===v.ENTER&&this.Editor.BlockSettings.opened,n=e.keyCode===v.ENTER&&this.Editor.InlineToolbar.opened,r=e.keyCode===v.ENTER&&this.Editor.ConversionToolbar.opened,l=e.keyCode===v.TAB;return!(e.shiftKey||l||o||i||n||r)}activateToolbox(){this.Editor.Toolbar.opened||this.Editor.Toolbar.moveAndOpen(),this.Editor.Toolbar.toolbox.open()}activateBlockSettings(){this.Editor.Toolbar.opened||this.Editor.Toolbar.moveAndOpen(),this.Editor.BlockSettings.opened||this.Editor.BlockSettings.open()}}class tn{get length(){return this.blocks.length}get array(){return this.blocks}get nodes(){return L(this.workingArea.children)}static set(e,o,i){return isNaN(Number(o))?Reflect.set(e,o,i):e.insert(+o,i),!0}static get(e,o){return isNaN(Number(o))?Reflect.get(e,o):e.get(+o)}push(e){this.blocks.push(e),this.insertToDOM(e)}swap(e,o){let i=this.blocks[o];j.swap(this.blocks[e].holder,i.holder),this.blocks[o]=this.blocks[e],this.blocks[e]=i}move(e,o){let i=this.blocks.splice(o,1)[0],n=e-1,r=this.blocks[Math.max(0,n)];e>0?this.insertToDOM(i,"afterend",r):this.insertToDOM(i,"beforebegin",r),this.blocks.splice(e,0,i);let l=this.composeBlockEvent("move",{fromIndex:o,toIndex:e});i.call(eo.MOVED,l)}insert(e,o){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.length){this.push(o);return}if(e>this.length&&(e=this.length),i&&(this.blocks[e].holder.remove(),this.blocks[e].call(eo.REMOVED)),this.blocks.splice(e,i?1:0,o),e>0){let i=this.blocks[e-1];this.insertToDOM(o,"afterend",i)}else{let i=this.blocks[e+1];i?this.insertToDOM(o,"beforebegin",i):this.insertToDOM(o)}}replace(e,o){if(void 0===this.blocks[e])throw Error("Incorrect index");this.blocks[e].holder.replaceWith(o.holder),this.blocks[e]=o}insertMany(e,o){let i=new DocumentFragment;for(let o of e)i.appendChild(o.holder);if(this.length>0){if(o>0){let e=Math.min(o-1,this.length-1);this.blocks[e].holder.after(i)}else 0===o&&this.workingArea.prepend(i);this.blocks.splice(o,0,...e)}else this.blocks.push(...e),this.workingArea.appendChild(i);
4e.forEach(e=>e.call(eo.RENDERED))}remove(e){isNaN(e)&&(e=this.length-1),this.blocks[e].holder.remove(),this.blocks[e].call(eo.REMOVED),this.blocks.splice(e,1)}removeAll(){this.workingArea.innerHTML="",this.blocks.forEach(e=>e.call(eo.REMOVED)),this.blocks.length=0}insertAfter(e,o){let i=this.blocks.indexOf(e);this.insert(i+1,o)}get(e){return this.blocks[e]}indexOf(e){return this.blocks.indexOf(e)}insertToDOM(e,o,i){o?i.holder.insertAdjacentElement(o,e.holder):this.workingArea.appendChild(e.holder),e.call(eo.RENDERED)}composeBlockEvent(e,o){return new CustomEvent(e,{detail:o})}constructor(e){this.blocks=[],this.workingArea=e}}let ts="block-removed",tr="block-added",tl="block-changed";class ta{add(e){return new Promise((o,i)=>{this.completed=this.completed.then(e).then(o).catch(i)})}constructor(){this.completed=Promise.resolve()}}class tc extends q{get currentBlockIndex(){return this._currentBlockIndex}set currentBlockIndex(e){this._currentBlockIndex=e}get firstBlock(){return this._blocks[0]}get lastBlock(){return this._blocks[this._blocks.length-1]}get currentBlock(){return this._blocks[this.currentBlockIndex]}set currentBlock(e){this.currentBlockIndex=this.getBlockIndex(e)}get nextBlock(){return this.currentBlockIndex===this._blocks.length-1?null:this._blocks[this.currentBlockIndex+1]}get nextContentfulBlock(){return this.blocks.slice(this.currentBlockIndex+1).find(e=>!!e.inputs.length)}get previousContentfulBlock(){return this.blocks.slice(0,this.currentBlockIndex).reverse().find(e=>!!e.inputs.length)}get previousBlock(){return 0===this.currentBlockIndex?null:this._blocks[this.currentBlockIndex-1]}get blocks(){return this._blocks.array}get isEditorEmpty(){return this.blocks.every(e=>e.isEmpty)}prepare(){let e=new tn(this.Editor.UI.nodes.redactor);this._blocks=new Proxy(e,{set:tn.set,get:tn.get}),this.listeners.on(document,"copy",e=>this.Editor.BlockEvents.handleCommandC(e))}toggleReadOnly(e){e?this.disableModuleBindings():this.enableModuleBindings()}composeBlock(e){let{tool:o,data:i={},id:n,tunes:r={}}=e,l=this.Editor.ReadOnly.isEnabled,a=new ei({id:n,data:i,tool:this.Editor.Tools.blockTools.get(o),api:this.Editor.API,readOnly:l,tunesData:r},this.eventsDispatcher);return l||window.requestIdleCallback(()=>{this.bindBlockEvents(a)},{timeout:2e3}),a}insert(){let{id:e,tool:o=this.config.defaultBlock,data:i={},index:n,needToFocus:r=!0,replace:l=!1,tunes:a={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=n;void 0===c&&(c=this.currentBlockIndex+(l?0:1));let d=this.composeBlock({id:e,tool:o,data:i,tunes:a});return l&&this.blockDidMutated(ts,this.getBlockByIndex(c),{index:c}),this._blocks.insert(c,d,l),this.blockDidMutated(tr,d,{index:c}),r?this.currentBlockIndex=c:c<=this.currentBlockIndex&&this.currentBlockIndex++,d}insertMany(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this._blocks.insertMany(e,o)}async update(e,o){let i=await e.data,n=this.composeBlock({id:e.id,tool:e.name,data:Object.assign({},i,o),tunes:e.tunes}),r=this.getBlockIndex(e);return this._blocks.replace(r,n),this.blockDidMutated(tl,n,{index:r}),n}replace(e,o,i){let n=this.getBlockIndex(e);this.insert({tool:o,data:i,index:n,replace:!0})}paste(e,o){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this.insert({tool:e,replace:i});try{window.requestIdleCallback(()=>{n.call(eo.ON_PASTE,o)})}catch(o){w("".concat(e,": onPaste callback call is failed"),"error",o)}return n}insertDefaultBlockAtIndex(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.composeBlock({tool:this.config.defaultBlock});return this._blocks[e]=i,this.blockDidMutated(tr,i,{index:e}),o?this.currentBlockIndex=e:e<=this.currentBlockIndex&&this.currentBlockIndex++,i}insertAtEnd(){return this.currentBlockIndex=this.blocks.length-1,this.insert()}async mergeBlocks(e,o){let i=await o.data;_(i)||await e.mergeWith(i),this.removeBlock(o),this.currentBlockIndex=this._blocks.indexOf(e)}removeBlock(e){let o=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return new Promise(i=>{let n=this._blocks.indexOf(e);if(!this.validateIndex(n))throw Error("Can't find a Block to remove");e.destroy(),this._blocks.remove(n),this.blockDidMutated(ts,e,{index:n}),this.currentBlockIndex>=n&&this.currentBlockIndex--,this.blocks.length?0===n&&(this.currentBlockIndex=0):(this.currentBlockIndex=-1,o&&this.insert()
4),i()})}removeSelectedBlocks(){let e;for(let o=this.blocks.length-1;o>=0;o--)this.blocks[o].selected&&(this.removeBlock(this.blocks[o]),e=o);return e}removeAllBlocks(){for(let e=this.blocks.length-1;e>=0;e--)this._blocks.remove(e);this.currentBlockIndex=-1,this.insert(),this.currentBlock.firstInput.focus()}split(){let e=this.Editor.Caret.extractFragmentFromCaretPosition(),o=j.make("div");o.appendChild(e);let i={text:j.isEmpty(o)?"":o.innerHTML};return this.insert({data:i})}getBlockByIndex(e){return -1===e&&(e=this._blocks.length-1),this._blocks[e]}getBlockIndex(e){return this._blocks.indexOf(e)}getBlockById(e){return this._blocks.array.find(o=>o.id===e)}getBlock(e){j.isElement(e)||(e=e.parentNode);let o=this._blocks.nodes,i=e.closest(".".concat(ei.CSS.wrapper)),n=o.indexOf(i);if(n>=0)return this._blocks[n]}setCurrentBlockByChildNode(e){j.isElement(e)||(e=e.parentNode);let o=e.closest(".".concat(ei.CSS.wrapper));if(!o)return;let i=o.closest(".".concat(this.Editor.UI.CSS.editorWrapper));if(null!=i&&i.isEqualNode(this.Editor.UI.nodes.wrapper))return this.currentBlockIndex=this._blocks.nodes.indexOf(o),this.currentBlock.updateCurrentInput(),this.currentBlock}getBlockByChildNode(e){if(!e||!(e instanceof Node))return;j.isElement(e)||(e=e.parentNode);let o=e.closest(".".concat(ei.CSS.wrapper));return this.blocks.find(e=>e.holder===o)}swap(e,o){this._blocks.swap(e,o),this.currentBlockIndex=o}move(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.currentBlockIndex;if(isNaN(e)||isNaN(o)){w("Warning during 'move' call: incorrect indices provided.","warn");return}if(!this.validateIndex(e)||!this.validateIndex(o)){w("Warning during 'move' call: indices cannot be lower than 0 or greater than the amount of blocks.","warn");return}this._blocks.move(e,o),this.currentBlockIndex=e,this.blockDidMutated("block-moved",this.currentBlock,{fromIndex:o,toIndex:e})}async convert(e,o,i){if(!await e.save())throw Error("Could not convert Block. Failed to extract original Block data.");let n=this.Editor.Tools.blockTools.get(o);if(!n)throw Error("Could not convert Block. Tool \xab".concat(o,"\xbb not found."));let r=function(e,o){let i=null==o?void 0:o.import;return C(i)?i(e):S(i)?{[i]:e}:(void 0!==i&&w("Conversion \xabimport\xbb property must be a string or function. String means key of tool data to import. Function accepts a imported string and return composed tool data."),{})}(ev(await e.exportDataAsString(),n.sanitizeConfig),n.conversionConfig);i&&(r=Object.assign(r,i)),this.replace(e,n.name,r)}dropPointer(){this.currentBlockIndex=-1}async clear(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=new ta;this.blocks.forEach(e=>{o.add(async()=>{await this.removeBlock(e,!1)})}),await o.completed,this.dropPointer(),e&&this.insert(),this.Editor.UI.checkEmptiness()}async destroy(){await Promise.all(this.blocks.map(e=>e.destroy()))}bindBlockEvents(e){let{BlockEvents:o}=this.Editor;this.readOnlyMutableListeners.on(e.holder,"keydown",e=>{o.keydown(e)}),this.readOnlyMutableListeners.on(e.holder,"keyup",e=>{o.keyup(e)}),this.readOnlyMutableListeners.on(e.holder,"dragover",e=>{o.dragOver(e)}),this.readOnlyMutableListeners.on(e.holder,"dragleave",e=>{o.dragLeave(e)}),e.on("didMutated",e=>this.blockDidMutated(tl,e,{index:this.getBlockIndex(e)}))}disableModuleBindings(){this.readOnlyMutableListeners.clearAll()}enableModuleBindings(){this.readOnlyMutableListeners.on(document,"cut",e=>this.Editor.BlockEvents.handleCommandX(e)),this.blocks.forEach(e=>{this.bindBlockEvents(e)})}validateIndex(e){return!(e<0||e>=this._blocks.length)}blockDidMutated(e,o,i){let n=new CustomEvent(e,{detail:{target:new V(o),...i}});return this.eventsDispatcher.emit(J,{event:n}),o}constructor(){super(...arguments),this._currentBlockIndex=-1,this._blocks=null}}class td extends q{get sanitizerConfig(){return{p:{},h1:{},h2:{},h3:{},h4:{},h5:{},h6:{},ol:{},ul:{},li:{},br:!0,img:{src:!0,width:!0,height:!0},a:{href:!0},b:{},i:{},u:{}}}get allBlocksSelected(){let{BlockManager:e}=this.Editor;return e.blocks.every(e=>!0===e.selected)}set allBlocksSelected(e){let{BlockManager:o}=this.Editor;o.blocks.forEach(o=>{o.selected=e}),this.clearCache()}get anyBlockSelected(){let{BlockManager:e}=this.Editor;return null===this.anyBlockSelectedCache&&(this.anyBlockSelectedCache=e.blocks.some(e=>!0===e.selected)),this.anyBlockSelectedCache}get selectedBlocks(){return this.Editor.BlockManager.blocks.filter(e=>e.selected)}prepare(){this.selection=new G,eG.add({name:"CMD+A",handler:e=>{let{BlockManager:o,ReadOnly:i}=this.Editor;if(i.isEnabled){e.preventDefault(),this.selectAllBlocks();return}o.currentBlock&&this.handleCommandA(e)},on:this.Editor.UI.nodes.redactor})}toggleReadOnly(){G.get().removeAllRanges(),this.allBlocksSelected=!1}unSelectBlockByIndex(e){let{BlockManager:o}=this.Editor;(isNaN(e)?o.currentBlock:o.getBlockByIndex(e)).selected=!1,this.clearCache()}clearSelection(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{BlockManager:i,Caret:n,RectangleSelection:r}=this.Editor;this.needToSelectAll=!1,this.nativeInputSelected=!1,this.readyToBlockSelection=!1;let l=e&&e instanceof KeyboardEvent,a=l&&M(e.keyCode);if(this.anyBlockSelected&&l&&a&&!G.isSelectionExists){let o=i.removeSelectedBlocks();i.insertDefaultBlockAtIndex(o,!0),n.setToBlock(i.currentBlock),O(()=>{let o=e.key;n.insertContentAtCaretPosition(o.length>1?"":o)},20)()}if(this.Editor.CrossBlockSelection.clear(e),!this.anyBlockSelected||r.isRectActivated()){this.Editor.RectangleSelection.clearSelection();return}
4o&&this.selection.restore(),this.allBlocksSelected=!1}copySelectedBlocks(e){e.preventDefault();let o=j.make("div");this.selectedBlocks.forEach(e=>{let i=ev(e.holder.innerHTML,this.sanitizerConfig),n=j.make("p");n.innerHTML=i,o.appendChild(n)});let i=Array.from(o.childNodes).map(e=>e.textContent).join("\n\n"),n=o.innerHTML;return e.clipboardData.setData("text/plain",i),e.clipboardData.setData("text/html",n),Promise.all(this.selectedBlocks.map(e=>e.save())).then(o=>{try{e.clipboardData.setData(this.Editor.Paste.MIME_TYPE,JSON.stringify(o))}catch(e){}})}selectBlockByIndex(e){let{BlockManager:o}=this.Editor,i=o.getBlockByIndex(e);void 0!==i&&this.selectBlock(i)}selectBlock(e){this.selection.save(),G.get().removeAllRanges(),e.selected=!0,this.clearCache(),this.Editor.InlineToolbar.close()}unselectBlock(e){e.selected=!1,this.clearCache()}clearCache(){this.anyBlockSelectedCache=null}destroy(){eG.remove(this.Editor.UI.nodes.redactor,"CMD+A")}handleCommandA(e){if(this.Editor.RectangleSelection.clearSelection(),j.isNativeInput(e.target)&&!this.readyToBlockSelection){this.readyToBlockSelection=!0;return}let o=this.Editor.BlockManager.getBlock(e.target),i=o.inputs;if(i.length>1&&!this.readyToBlockSelection){this.readyToBlockSelection=!0;return}if(1===i.length&&!this.needToSelectAll){this.needToSelectAll=!0;return}this.needToSelectAll?(e.preventDefault(),this.selectAllBlocks(),this.needToSelectAll=!1,this.readyToBlockSelection=!1,this.Editor.ConversionToolbar.close()):this.readyToBlockSelection&&(e.preventDefault(),this.selectBlock(o),this.needToSelectAll=!0)}selectAllBlocks(){this.selection.save(),G.get().removeAllRanges(),this.allBlocksSelected=!0,this.Editor.InlineToolbar.close()}constructor(){super(...arguments),this.anyBlockSelectedCache=null,this.needToSelectAll=!1,this.nativeInputSelected=!1,this.readyToBlockSelection=!1}}class th extends q{get positions(){return{START:"start",END:"end",DEFAULT:"default"}}static get CSS(){return{shadowCaret:"cdx-shadow-caret"}}get isAtStart(){let{currentBlock:e}=this.Editor.BlockManager;if(!e.focusable)return!0;let o=G.get(),i=j.getDeepestNode(e.currentInput),n=o.focusNode;if(j.isNativeInput(i))return 0===i.selectionEnd;if(!o.anchorNode)return!1;let r=n.textContent.search(/\S/);-1===r&&(r=0);let l=o.focusOffset;return n.nodeType!==Node.TEXT_NODE&&n.childNodes.length&&(n.childNodes[l]?(n=n.childNodes[l],l=0):l=(n=n.childNodes[l-1]).textContent.length),!!((j.isLineBreakTag(i)||j.isEmpty(i))&&this.getHigherLevelSiblings(n,"left").every(e=>{let o=j.isLineBreakTag(e),i=1===e.children.length&&j.isLineBreakTag(e.children[0]);return j.isEmpty(e)&&!(o||i)}))&&l===r||null===i||n===i&&l<=r}get isAtEnd(){let{currentBlock:e}=this.Editor.BlockManager;if(!e.focusable)return!0;let o=G.get(),i=o.focusNode,n=j.getDeepestNode(e.currentInput,!0);if(j.isNativeInput(n))return n.selectionEnd===n.value.length;if(!o.focusNode)return!1;let r=o.focusOffset;if(i.nodeType!==Node.TEXT_NODE&&i.childNodes.length&&(i.childNodes[r-1]?r=(i=i.childNodes[r-1]).textContent.length:(i=i.childNodes[0],r=0)),j.isLineBreakTag(n)||j.isEmpty(n)){let e=this.getHigherLevelSiblings(i,"right");if(e.every((o,i)=>i===e.length-1&&j.isLineBreakTag(o)||j.isEmpty(o)&&!j.isLineBreakTag(o))&&r===i.textContent.length)return!0}let l=n.textContent.replace(/\s+$/,"");return i===n&&r>=l.length}setToBlock(e){var o;let i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.positions.DEFAULT,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,{BlockManager:l,BlockSelection:a}=this.Editor;if(a.clearSelection(),!e.focusable){null==(o=window.getSelection())||o.removeAllRanges(),a.selectBlock(e),l.currentBlock=e;return}switch(n){case this.positions.START:i=e.firstInput;break;case this.positions.END:i=e.lastInput;break;default:i=e.currentInput}if(!i)return;let c=j.getDeepestNode(i,n===this.positions.END),d=j.getContentLength(c);switch(!0){case n===this.positions.START:r=0;break;case n===this.positions.END:case r>d:r=d}this.set(c,r),l.setCurrentBlockByChildNode(e.holder),l.currentBlock.currentInput=i}setToInput(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.positions.DEFAULT,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,{currentBlock:n}=this.Editor.BlockManager,r=j.getDeepestNode(e);switch(o){case this.positions.START:this.set(r,0);break;case this.positions.END:this.set(r,j.getContentLength(r));break;default:i&&this.set(r,i)}n.currentInput=e}set(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,{top:i,bottom:n}=G.setCursor(e,o),{innerHeight:r}=window;i<0?window.scrollBy(0,i-30):n>r&&window.scrollBy(0,n-r+30)}setToTheLastBlock(){let e=this.Editor.BlockManager.lastBlock;if(e){if(e.tool.isDefault&&e.isEmpty)this.setToBlock(e);else{let e=this.Editor.BlockManager.insertAtEnd();this.setToBlock(e)}}}extractFragmentFromCaretPosition(){let e=G.get();if(e.rangeCount){let o=e.getRangeAt(0),i=this.Editor.BlockManager.currentBlock.currentInput;if(o.deleteContents(),i){if(j.isNativeInput(i)){let e=document.createDocumentFragment(),o=i.value.substring(0,i.selectionStart),n=i.value.substring(i.selectionStart);return e.textContent=n,i.value=o,e}{let e=o.cloneRange();return e.selectNodeContents(i),e.setStart(o.endContainer,o.endOffset),e.extractContents()}}}}navigateNext(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],{BlockManager:o}=this.Editor,{currentBlock:i,nextBlock:n}=o,{nextInput:r}=i,l=this.isAtEnd,a=n,c=e||l;if(r&&c)return this.setToInput(r,this.positions.START),!0;if(null===a){if(i.tool.isDefault||!c)return!1;a=o.insertAtEnd()}return!!c&&(this.setToBlock(a,this.positions.START),!0)}navigatePrevious(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],{currentBlock:o,previousBlock:i}=this.Editor.BlockManager;if(!o)return!1;let{previousInput:n}=o,r=e||this.isAtStart;return n&&r?(this.setToInput(n,this.positions.END),!0):null!==i&&!!r&&(this.setToBlock(i,this.positions.END),!0)}createShadow(e){let o=document.createElement("span");o.classList.add(th.CSS.shadowCaret),e.insertAdjacentElement("beforeend",o)}restoreCaret(e){let o=e.querySelector(".".concat(th.CSS.shadowCaret));if(!o)return;new G().expandToTag(o);let i=document.createRange();i.selectNode(o),i.extractContents()}insertContentAtCaretPosition(e){let o=document.createDocumentFragment(),i=document.createElement("div"),n=G.get(),r
4=G.range;i.innerHTML=e,Array.from(i.childNodes).forEach(e=>o.appendChild(e)),0===o.childNodes.length&&o.appendChild(new Text);let l=o.lastChild;r.deleteContents(),r.insertNode(o);let a=document.createRange(),c=l.nodeType===Node.TEXT_NODE?l:l.firstChild;null!==c&&null!==c.textContent&&a.setStart(c,c.textContent.length),n.removeAllRanges(),n.addRange(a)}getHigherLevelSiblings(e,o){let i=e,n=[];for(;i.parentNode&&"true"!==i.parentNode.contentEditable;)i=i.parentNode;let r="left"===o?"previousSibling":"nextSibling";for(;i[r];)n.push(i=i[r]);return n}}class tp extends q{async prepare(){this.listeners.on(document,"mousedown",e=>{this.enableCrossBlockSelection(e)})}watchSelection(e){if(0!==e.button)return;let{BlockManager:o}=this.Editor;this.firstSelectedBlock=o.getBlock(e.target),this.lastSelectedBlock=this.firstSelectedBlock,this.listeners.on(document,"mouseover",this.onMouseOver),this.listeners.on(document,"mouseup",this.onMouseUp)}get isCrossBlockSelectionStarted(){return!!this.firstSelectedBlock&&!!this.lastSelectedBlock}toggleBlockSelectedState(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],{BlockManager:o,BlockSelection:i}=this.Editor;this.lastSelectedBlock||(this.lastSelectedBlock=this.firstSelectedBlock=o.currentBlock),this.firstSelectedBlock===this.lastSelectedBlock&&(this.firstSelectedBlock.selected=!0,i.clearCache(),G.get().removeAllRanges());let n=o.blocks.indexOf(this.lastSelectedBlock)+(e?1:-1),r=o.blocks[n];r&&(this.lastSelectedBlock.selected!==r.selected?r.selected=!0:this.lastSelectedBlock.selected=!1,i.clearCache(),this.lastSelectedBlock=r,this.Editor.InlineToolbar.close(),r.holder.scrollIntoView({block:"nearest"}))}clear(e){let{BlockManager:o,BlockSelection:i,Caret:n}=this.Editor,r=o.blocks.indexOf(this.firstSelectedBlock),l=o.blocks.indexOf(this.lastSelectedBlock);if(i.anyBlockSelected&&r>-1&&l>-1&&e&&e instanceof KeyboardEvent)switch(e.keyCode){case v.DOWN:case v.RIGHT:n.setToBlock(o.blocks[Math.max(r,l)],n.positions.END);break;case v.UP:case v.LEFT:n.setToBlock(o.blocks[Math.min(r,l)],n.positions.START);break;default:n.setToBlock(o.blocks[Math.max(r,l)],n.positions.END)}this.firstSelectedBlock=this.lastSelectedBlock=null}enableCrossBlockSelection(e){let{UI:o}=this.Editor;G.isCollapsed||this.Editor.BlockSelection.clearSelection(e),o.nodes.redactor.contains(e.target)?this.watchSelection(e):this.Editor.BlockSelection.clearSelection(e)}toggleBlocksSelectedState(e,o){let{BlockManager:i,BlockSelection:n}=this.Editor,r=i.blocks.indexOf(e),l=i.blocks.indexOf(o),a=e.selected!==o.selected;for(let c=Math.min(r,l);c<=Math.max(r,l);c++){let r=i.blocks[c];r!==this.firstSelectedBlock&&r!==(a?e:o)&&(i.blocks[c].selected=!i.blocks[c].selected,n.clearCache())}}constructor(){super(...arguments),this.onMouseUp=()=>{this.listeners.off(document,"mouseover",this.onMouseOver),this.listeners.off(document,"mouseup",this.onMouseUp)},this.onMouseOver=e=>{let{BlockManager:o,BlockSelection:i}=this.Editor;if(null===e.relatedTarget&&null===e.target)return;let n=o.getBlockByChildNode(e.relatedTarget)||this.lastSelectedBlock,r=o.getBlockByChildNode(e.target);if(!(!n||!r)&&r!==n){if(n===this.firstSelectedBlock){G.get().removeAllRanges(),n.selected=!0,r.selected=!0,i.clearCache();return}if(r===this.firstSelectedBlock){n.selected=!1,r.selected=!1,i.clearCache();return}this.Editor.InlineToolbar.close(),this.toggleBlocksSelectedState(n,r),this.lastSelectedBlock=r}}}}class tu extends q{toggleReadOnly(e){e?this.disableModuleBindings():this.enableModuleBindings()}enableModuleBindings(){let{UI:e}=this.Editor;this.readOnlyMutableListeners.on(e.nodes.holder,"drop",async e=>{await this.processDrop(e)},!0),this.readOnlyMutableListeners.on(e.nodes.holder,"dragstart",()=>{this.processDragStart()}),this.readOnlyMutableListeners.on(e.nodes.holder,"dragover",e=>{this.processDragOver(e)},!0)}disableModuleBindings(){this.readOnlyMutableListeners.clearAll()}
4async processDrop(e){let{BlockManager:o,Caret:i,Paste:n}=this.Editor;e.preventDefault(),o.blocks.forEach(e=>{e.dropTarget=!1}),G.isAtEditor&&!G.isCollapsed&&this.isStartedAtEditor&&document.execCommand("delete"),this.isStartedAtEditor=!1;let r=o.setCurrentBlockByChildNode(e.target);if(r)this.Editor.Caret.setToBlock(r,i.positions.END);else{let e=o.setCurrentBlockByChildNode(o.lastBlock.holder);this.Editor.Caret.setToBlock(e,i.positions.END)}await n.processDataTransfer(e.dataTransfer,!0)}processDragStart(){G.isAtEditor&&!G.isCollapsed&&(this.isStartedAtEditor=!0),this.Editor.InlineToolbar.close()}processDragOver(e){e.preventDefault()}constructor(){super(...arguments),this.isStartedAtEditor=!1}}class tg extends q{enable(){this.mutationObserver.observe(this.Editor.UI.nodes.redactor,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),this.disabled=!1}disable(){this.mutationObserver.disconnect(),this.disabled=!0}particularBlockChanged(e){this.disabled||!C(this.config.onChange)||(this.batchingOnChangeQueue.set("block:".concat(e.detail.target.id,":event:").concat(e.type),e),this.batchingTimeout&&clearTimeout(this.batchingTimeout),this.batchingTimeout=setTimeout(()=>{let e;e=1===this.batchingOnChangeQueue.size?this.batchingOnChangeQueue.values().next().value:Array.from(this.batchingOnChangeQueue.values()),this.config.onChange&&this.config.onChange(this.Editor.API.methods,e),this.batchingOnChangeQueue.clear()},this.batchTime))}redactorChanged(e){this.eventsDispatcher.emit(Q,{mutations:e})}constructor({config:e,eventsDispatcher:o}){super({config:e,eventsDispatcher:o}),this.disabled=!1,this.batchingTimeout=null,this.batchingOnChangeQueue=new Map,this.batchTime=400,this.mutationObserver=new MutationObserver(e=>{this.redactorChanged(e)}),this.eventsDispatcher.on(J,e=>{this.particularBlockChanged(e.event)}),this.eventsDispatcher.on($,()=>{this.disable()}),this.eventsDispatcher.on(ee,()=>{this.enable()})}}let tf=class extends q{async prepare(){this.processTools()}toggleReadOnly(e){e?this.unsetCallback():this.setCallback()}async processDataTransfer(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{Tools:i}=this.Editor,n=e.types;if((n.includes?n.includes("Files"):n.contains("Files"))&&!_(this.toolsFiles)){await this.processFiles(e.files);return}let r=e.getData(this.MIME_TYPE),l=e.getData("text/plain"),a=e.getData("text/html");if(r)try{this.insertEditorJSData(JSON.parse(r));return}catch(e){}o&&l.trim()&&a.trim()&&(a="<p>"+(a.trim()?a:l)+"</p>");let c=ev(a,Object.assign({},Object.keys(this.toolsTags).reduce((e,o)=>{var i;return e[o.toLowerCase()]=null!==(i=this.toolsTags[o].sanitizationConfig)&&void 0!==i?i:{},e},{}),i.getAllInlineToolsSanitizeConfig(),{br:{}}));c.trim()&&c.trim()!==l&&j.isHTMLString(c)?await this.processText(c,!0):await this.processText(l)}async processText(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{Caret:i,BlockManager:n}=this.Editor,r=o?this.processHTML(e):this.processPlain(e);if(!r.length)return;if(1===r.length){r[0].isBlock?this.processSingleBlock(r.pop()):this.processInlinePaste(r.pop());return}let l=n.currentBlock&&n.currentBlock.tool.isDefault&&n.currentBlock.isEmpty;r.map(async(e,o)=>this.insertBlock(e,0===o&&l)),n.currentBlock&&i.setToBlock(n.currentBlock,i.positions.END)}setCallback(){this.listeners.on(this.Editor.UI.nodes.holder,"paste",this.handlePasteEvent)}unsetCallback(){this.listeners.off(this.Editor.UI.nodes.holder,"paste",this.handlePasteEvent)}processTools(){Array.from(this.Editor.Tools.blockTools.values()).forEach(this.processTool)}collectTagNames(e){return S(e)?[e]:B(e)?Object.keys(e):[]}getTagsConfig(e){if(!1===e.pasteConfig)return;let o=e.pasteConfig.tags||[],i=[];o.forEach(o=>{let n=this.collectTagNames(o);i.push(...n),n.forEach(i=>{if(Object.prototype.hasOwnProperty.call(this.toolsTags,i)){w("Paste handler for \xab".concat(e.name,"\xbb Tool on \xab").concat(i,"\xbb tag is skipped because it is already used by \xab").concat(this.toolsTags[i].tool.name,"\xbb Tool."),"warn");return}let n=B(o)?o[i]:null;this.toolsTags[i.toUpperCase()]={tool:e,sanitizationConfig:n}})}),this.tagsByTool[e.name]=i.map(e=>e.toUpperCase())}getFilesConfig(e){if(!1===e.pasteConfig)return;let{files:o={}}
4=e.pasteConfig,{extensions:i,mimeTypes:n}=o;(i||n)&&(i&&!Array.isArray(i)&&(w("\xabextensions\xbb property of the onDrop config for \xab".concat(e.name,"\xbb Tool should be an array")),i=[]),n&&!Array.isArray(n)&&(w("\xabmimeTypes\xbb property of the onDrop config for \xab".concat(e.name,"\xbb Tool should be an array")),n=[]),n&&(n=n.filter(o=>!!/^[-\w]+\/([-+\w]+|\*)$/.test(o)||(w("MIME type value \xab".concat(o,"\xbb for the \xab").concat(e.name,"\xbb Tool is not a valid MIME type"),"warn"),!1))),this.toolsFiles[e.name]={extensions:i||[],mimeTypes:n||[]})}getPatternsConfig(e){!1===e.pasteConfig||!e.pasteConfig.patterns||_(e.pasteConfig.patterns)||Object.entries(e.pasteConfig.patterns).forEach(o=>{let[i,n]=o;n instanceof RegExp||w("Pattern ".concat(n," for \xab").concat(e.name,"\xbb Tool is skipped because it should be a Regexp instance."),"warn"),this.toolsPatterns.push({key:i,pattern:n,tool:e})})}isNativeBehaviour(e){return j.isNativeInput(e)}async processFiles(e){let o;let{BlockManager:i}=this.Editor;o=(o=await Promise.all(Array.from(e).map(e=>this.processFile(e)))).filter(e=>!!e);let n=i.currentBlock.tool.isDefault&&i.currentBlock.isEmpty;o.forEach((e,o)=>{i.paste(e.type,e.event,0===o&&n)})}async processFile(e){let o=e.name.split(".").pop(),i=Object.entries(this.toolsFiles).find(i=>{let[n,{mimeTypes:r,extensions:l}]=i,[a,c]=e.type.split("/"),d=l.find(e=>e.toLowerCase()===o.toLowerCase()),h=r.find(e=>{let[o,i]=e.split("/");return o===a&&(i===c||"*"===i)});return!!d||!!h});if(!i)return;let[n]=i;return{event:this.composePasteEvent("file",{file:e}),type:n}}processHTML(e){let{Tools:o}=this.Editor,i=j.make("DIV");return i.innerHTML=e,this.getNodes(i).map(e=>{let i,n=o.defaultTool,r=!1;switch(e.nodeType){case Node.DOCUMENT_FRAGMENT_NODE:(i=j.make("div")).appendChild(e);break;case Node.ELEMENT_NODE:i=e,r=!0,this.toolsTags[i.tagName]&&(n=this.toolsTags[i.tagName].tool)}let{tags:l}=n.pasteConfig||{tags:[]},a=Object.assign({},l.reduce((e,o)=>(this.collectTagNames(o).forEach(i=>{let n=B(o)?o[i]:null;e[i.toLowerCase()]=n||{}}),e),{}),n.baseSanitizeConfig);if("table"===i.tagName.toLowerCase()){let e=ev(i.outerHTML,a);i=j.make("div",void 0,{innerHTML:e}).firstChild}else i.innerHTML=ev(i.innerHTML,a);let c=this.composePasteEvent("tag",{data:i});return{content:i,isBlock:r,tool:n.name,event:c}}).filter(e=>{let o=j.isEmpty(e.content),i=j.isSingleTag(e.content);return!o||i})}processPlain(e){let{defaultBlock:o}=this.config;return e?e.split(/\r?\n/).filter(e=>e.trim()).map(e=>{let i=j.make("div");i.textContent=e;let n=this.composePasteEvent("tag",{data:i});return{content:i,tool:o,isBlock:!1,event:n}}):[]}async processSingleBlock(e){let{Caret:o,BlockManager:i}=this.Editor,{currentBlock:n}=i;if(!n||e.tool!==n.name||!j.containsOnlyInlineElements(e.content.innerHTML)){this.insertBlock(e,(null==n?void 0:n.tool.isDefault)&&n.isEmpty);return}o.insertContentAtCaretPosition(e.content.innerHTML)}
4async processInlinePaste(e){let{BlockManager:o,Caret:i}=this.Editor,{content:n}=e;if(o.currentBlock&&o.currentBlock.tool.isDefault&&n.textContent.length<tf.PATTERN_PROCESSING_MAX_LENGTH){let e=await this.processPattern(n.textContent);if(e){let n=o.currentBlock&&o.currentBlock.tool.isDefault&&o.currentBlock.isEmpty,r=o.paste(e.tool,e.event,n);i.setToBlock(r,i.positions.END);return}}if(o.currentBlock&&o.currentBlock.currentInput){let e=o.currentBlock.tool.baseSanitizeConfig;document.execCommand("insertHTML",!1,ev(n.innerHTML,e))}else this.insertBlock(e)}async processPattern(e){let o=this.toolsPatterns.find(o=>{let i=o.pattern.exec(e);return!!i&&e===i.shift()});return o?{event:this.composePasteEvent("pattern",{key:o.key,data:e}),tool:o.tool.name}:void 0}insertBlock(e){let o,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{BlockManager:n,Caret:r}=this.Editor,{currentBlock:l}=n;if(i&&l&&l.isEmpty){o=n.paste(e.tool,e.event,!0),r.setToBlock(o,r.positions.END);return}o=n.paste(e.tool,e.event),r.setToBlock(o,r.positions.END)}
4insertEditorJSData(e){let{BlockManager:o,Caret:i,Tools:n}=this.Editor;ek(e,e=>n.blockTools.get(e).sanitizeConfig).forEach((e,n)=>{let{tool:r,data:l}=e,a=!1;0===n&&(a=o.currentBlock&&o.currentBlock.tool.isDefault&&o.currentBlock.isEmpty);let c=o.insert({tool:r,data:l,replace:a});i.setToBlock(c,i.positions.END)})}processElementNode(e,o,i){let n=Object.keys(this.toolsTags),{tool:r}=this.toolsTags[e.tagName]||{},l=this.tagsByTool[null==r?void 0:r.name]||[],a=n.includes(e.tagName),c=j.blockElements.includes(e.tagName.toLowerCase()),d=Array.from(e.children).some(e=>{let{tagName:o}=e;return n.includes(o)&&!l.includes(o)}),h=Array.from(e.children).some(e=>{let{tagName:o}=e;return j.blockElements.includes(o.toLowerCase())});return c||a||d?(!a||d)&&(!c||h||d)?void 0:[...o,i,e]:(i.appendChild(e),[...o,i])}getNodes(e){let o;let i=Array.from(e.childNodes),n=(e,i)=>{if(j.isEmpty(i)&&!j.isSingleTag(i))return e;let r=e[e.length-1],l=new DocumentFragment;switch(r&&j.isFragment(r)&&(l=e.pop()),i.nodeType){case Node.ELEMENT_NODE:if(o=this.processElementNode(i,e,l))return o;break;case Node.TEXT_NODE:return l.appendChild(i),[...e,l];default:return[...e,l]}return[...e,...Array.from(i.childNodes).reduce(n,[])]};return i.reduce(n,[])}composePasteEvent(e,o){return new CustomEvent(e,{detail:o})}constructor(){super(...arguments),this.MIME_TYPE="application/x-editor-js",this.toolsTags={},this.tagsByTool={},this.toolsPatterns=[],this.toolsFiles={},this.exceptionList=[],this.processTool=e=>{try{let o=e.create({},{},!1);if(!1===e.pasteConfig){this.exceptionList.push(e.name);return}if(!C(o.onPaste))return;this.getTagsConfig(e),this.getFilesConfig(e),this.getPatternsConfig(e)}catch(o){w("Paste handling for \xab".concat(e.name,"\xbb Tool hasn't been set up because of the error"),"warn",o)}},this.handlePasteEvent=async e=>{let{BlockManager:o,Toolbar:i}=this.Editor,n=o.setCurrentBlockByChildNode(e.target);!n||this.isNativeBehaviour(e.target)&&!e.clipboardData.types.includes("Files")||n&&this.exceptionList.includes(n.name)||(e.preventDefault(),this.processDataTransfer(e.clipboardData),i.close())}}};tf.PATTERN_PROCESSING_MAX_LENGTH=450;class tm extends q{get isEnabled(){return this.readOnlyEnabled}async prepare(){let{Tools:e}=this.Editor,{blockTools:o}=e,i=[];Array.from(o.entries()).forEach(e=>{let[o,n]=e;n.isReadOnlySupported||i.push(o)}),this.toolsDontSupportReadOnly=i,this.config.readOnly&&i.length>0&&this.throwCriticalError(),this.toggle(this.config.readOnly)}async toggle(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:!this.readOnlyEnabled;e&&this.toolsDontSupportReadOnly.length>0&&this.throwCriticalError();let o=this.readOnlyEnabled;for(let o in this.readOnlyEnabled=e,this.Editor)this.Editor[o].toggleReadOnly&&this.Editor[o].toggleReadOnly(e);if(o===e)return this.readOnlyEnabled;let i=await this.Editor.Saver.save();return await this.Editor.BlockManager.clear(),await this.Editor.Renderer.render(i.blocks),this.readOnlyEnabled}throwCriticalError(){throw new K("To enable read-only mode all connected tools should support it. Tools ".concat(this.toolsDontSupportReadOnly.join(", ")," don't support read-only mode."))}constructor(){super(...arguments),this.toolsDontSupportReadOnly=[],this.readOnlyEnabled=!1}}class tb extends q{static get CSS(){return{overlay:"codex-editor-overlay",overlayContainer:"codex-editor-overlay__container",rect:"codex-editor-overlay__rectangle",topScrollZone:"codex-editor-overlay__scroll-zone--top",bottomScrollZone:"codex-editor-overlay__scroll-zone--bottom"}}prepare(){this.enableModuleBindings()}startSelection(e,o){let i=document.elementFromPoint(e-window.pageXOffset,o-window.pageYOffset);i.closest(".".concat(this.Editor.Toolbar.CSS.toolbar))||(this.Editor.BlockSelection.allBlocksSelected=!1,this.clearSelection(),this.stackOfSelected=[]);let n=[".".concat(ei.CSS.content),".".concat(this.Editor.Toolbar.CSS.toolbar),".".concat(this.Editor.InlineToolbar.CSS.inlineToolbar)],r=i.closest("."+this.Editor.UI.CSS.editorWrapper),l=n.some(e=>!!i.closest(e));!r||l||(this.mousedown=!0,this.startX=e,this.startY=o)}endSelection(){this.mousedown=!1,this.startX=0,this.startY=0,this.overlayRectangle.style.display="none"}isRectActivated(){return this.isRectSelectionActivated}clearSelection(){this.isRectSelectionActivated=!1}enableModuleBindings(){let{container:e}=this.genHTML();this.listeners.on(e,"mousedown",e=>{this.processMouseDown(e)},!1),this.listeners.on(document.body,"mousemove",D(e=>{this.processMouseMove(e)},10),{passive:!0}),this.listeners.on(document.body,"mouseleave",()=>{this.processMouseLeave()}),this.listeners.on(window,"scroll",D(e=>{this.processScroll(e)},10),{passive:!0}),this.listeners.on(document.body,"mouseup",()=>{this.processMouseUp()},!1)}processMouseDown(e){e.button===this.MAIN_MOUSE_BUTTON&&(null!==e.target.closest(j.allInputsSelector)||this.startSelection(e.pageX,e.pageY))}processMouseMove(e){this.changingRectangle(e),this.scrollByZones(e.clientY)}processMouseLeave(){this.clearSelection(),this.endSelection()}processScroll(e){this.changingRectangle(e)}processMouseUp(){this.clearSelection(),this.endSelection()}scrollByZones(e){if(this.inScrollZone=null,e<=this.HEIGHT_OF_SCROLL_ZONE&&(this.inScrollZone=this.TOP_SCROLL_ZONE),document.documentElement.clientHeight-e<=this.HEIGHT_OF_SCROLL_ZONE&&(this.inScrollZone=this.BOTTOM_SCROLL_ZONE),!this.inScrollZone){this.isScrolling=!1;return}this.isScrolling||(this.scrollVertical(this.inScrollZone===this.TOP_SCROLL_ZONE?-this.SCROLL_SPEED:this.SCROLL_SPEED),this.isScrolling=!0)}genHTML(){let{UI:e}=this.Editor,o=e.nodes.holder.querySelector("."+e.CSS.editorWrapper),i=j.make("div",tb.CSS.overlay,{}),n=j.make("div",tb.CSS.overlayContainer,{}),r=j.make("div",tb.CSS.rect,{});return n.appendChild(r),i.appendChild(n),o.appendChild(i),this.overlayRectangle=r,{container:o,overlay:i}}scrollVertical(e){if(!(this.inScrollZone&&this.mousedown))return;let o=window.pageYOffset;window.scrollBy(0,e),this.mouseY+=window.pageYOffset-o,setTimeout(()=>{this.scrollVertical(e)},0)}changingRectangle(e){if(!this.mousedown)return;void 0!==e.pageY&&(this.mouseX=e.pageX,this.mouseY=e.pageY);let{rightPos:o,leftPos:i,index:n}=this.genInfoForMouseSelection(),r=this.startX>o&&this.mouseX>o,l=this.startX<i&&this.mouseX<i;this.rectCrossesBlocks=!(r||l),this.isRectSelectionActivated||(this.rectCrossesBlocks=!1,this.isRectSelectionActivated=!0,this.shrinkRectangleToPoint(),this.overlayRectangle.style.display="block"),this.updateRectangleSize(),this.Editor.Toolbar.close(),void 0!==n&&(this.trySelectNextBlock(n),this.inverseSelection(),G.get().removeAllRanges())}shrinkRectangleToPoint(){this.overlayRectangle.style.left="".concat(this.startX-window.pageXOffset,"px"),this.overlayRectangle.style.top="".concat(this.startY-window.pageYOffset,"px"),this.overlayRectangle.style.bottom="calc(100% - ".concat(this.startY-window.pageYOffset,"px"),this.overlayRectangle.style.right="calc(100% - ".concat(this.startX-window.pageXOffset,"px")}inverseSelection(){let e=this.Editor.BlockManager.getBlockByIndex(this.stackOfSelected[0]).selected;if(this.rectCrossesBlocks&&!e)for(let e of this.stackOfSelected)this.Editor.BlockSelection.selectBlockByIndex(e);if(!this.rectCrossesBlocks&&e)for(let e of this.stackOfSelected)this.Editor.BlockSelection.unSelectBlockByIndex(e)}updateRectangleSize(){this.mouseY>=this.startY?(this.overlayRectangle.style.top="".concat(this.startY-window.pageYOffset,"px"),this.overlayRectangle.style.bottom="calc(100% - ".concat(this.mouseY-window.pageYOffset,"px")):(this.overlayRectangle.style.bottom="calc(100% - ".concat(this.startY-window.pageYOffset,"px"),this.overlayRectangle.style.top="".concat(this.mouseY-window.pageYOffset,"px")),this.mouseX>=this.startX?(this.overlayRectangle.style.left="".concat(this.startX-window.pageXOffset,"px"),this.overlayRectangle.style.right="calc(100% - ".concat(this.mouseX-window.pageXOffset,"px")):(this.overlayRectangle.style.right="calc(100% - ".concat(this.startX-window.pageXOffset,"px"),this.overlayRectangle.style.left="".concat(this.mouseX-window.pageXOffset,"px"))}genInfoForMouseSelection(){let e;let o=document.body.offsetWidth/2,i=this.mouseY-window.pageYOffset,n=document.elementFromPoint(o,i),r=this.Editor.BlockManager.getBlockByChildNode(n);void 0!==r&&(e=this.Editor.BlockManager.blocks.findIndex(e=>e.holder===r.holder));let l=this.Editor.BlockManager.lastBlock.holder.querySelector("."+ei.CSS.content),a=Number.parseInt(window.getComputedStyle(l).width,10)/2;return{index:e,leftPos:o-a,rightPos:o+a}}addBlockInSelection(e){this.rectCrossesBlocks&&this.Editor.BlockSelection.selectBlockByIndex(e),this.stackOfSelected.push(e)}trySelectNextBlock(e){let o=this.stackOfSelected[this.stackOfSelected.length-1]===e,i=this.stackOfSelected.length;if(o)return;let n=this.stackOfSelected[i-1]-this.stackOfSelected[i-2]>0,r=0;i>1&&(r=n?1:-1);let l=e>this.stackOfSelected[i-1]&&1===r,a=e<this.stackOfSelected[i-1]&&-1===r,c=!(l||a||0===r);if(!c&&(e>this.stackOfSelected[i-1]||void 0===this.stackOfSelected[i-1])){let o=this.stackOfSelected[i-1]+1||e;for(;o<=e;o++)this.addBlockInSelection(o);return}if(!c&&e<this.stackOfSelected[i-1]){for(let o=this.stackOfSelected[i-1]-1;o>=e;o--)this.addBlockInSelection(o);return}if(!c)return;let d=i-1,h;for(h=e>this.stackOfSelected[i-1]?()=>e>this.stackOfSelected[d]:()=>e<this.stackOfSelected[d];h();)this.rectCrossesBlocks&&this.Editor.BlockSelection.unSelectBlockByIndex(this.stackOfSelected[d]),this.stackOfSelected.pop(),d--}constructor(){super(...arguments),this.isRectSelectionActivated=!1,this.SCROLL_SPEED=3,this.HEIGHT_OF_SCROLL_ZONE=40,this.BOTTOM_SCROLL_ZONE=1,this.TOP_SCROLL_ZONE=2,this.MAIN_MOUSE_BUTTON=0,this.mousedown=!1,this.isScrolling=!1,this.inScrollZone=null,this.startX=0,this.startY=0,this.mouseX=0,this.mouseY=0,this.stackOfSelected=[],this.listenerIds=[]}}class tk extends q{async render(e){return new Promise(o=>{let{Tools:i,BlockManager:n}=this.Editor;if(0===e.length)n.insert();else{let o=e.map(e=>{let o,{type:r,data:l,tunes:a,id:c}=e;!1===i.available.has(r)&&(y("Tool \xab".concat(r,"\xbb is not found. Check 'tools' property at the Editor.js config."),"warn"),l=this.composeStubDataForTool(r,l,c),r=i.stubTool);try{o=n.composeBlock({id:c,tool:r,data:l,tunes:a})}catch(e){w("Block \xab".concat(r,"\xbb skipped because of plugins error"),"error",{data:l,error:e}),l=this.composeStubDataForTool(r,l,c),r=i.stubTool,o=n.composeBlock({id:c,tool:r,data:l,tunes:a})}return o}
4);n.insertMany(o)}window.requestIdleCallback(()=>{o()},{timeout:2e3})})}composeStubDataForTool(e,o,i){let{Tools:n}=this.Editor,r=e;if(n.unavailable.has(e)){let o=n.unavailable.get(e).toolbox;void 0!==o&&void 0!==o[0].title&&(r=o[0].title)}return{savedData:{id:i,type:e,data:o},title:r}}}class tv extends q{async save(){let{BlockManager:e,Tools:o}=this.Editor,i=e.blocks,n=[];try{i.forEach(e=>{n.push(this.getSavedData(e))});let e=await Promise.all(n),r=await ek(e,e=>o.blockTools.get(e).sanitizeConfig);return this.makeOutput(r)}catch(e){y("Saving failed due to the Error %o","error",e)}}async getSavedData(e){let o=await e.save(),i=o&&await e.validate(o.data);return{...o,isValid:i}}makeOutput(e){let o=[];return e.forEach(e=>{let{id:i,tool:n,data:r,tunes:l,isValid:a}=e;if(!a){w("Block \xab".concat(n,"\xbb skipped because saved data is invalid"));return}if(n===this.Editor.Tools.stubTool){o.push(r);return}let c={id:i,type:n,data:r,...!_(l)&&{tunes:l}};o.push(c)}),{time:+new Date,blocks:o,version:"2.29.1"}}}!function(){try{if("u">typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode(".ce-paragraph{line-height:1.6em;outline:none}.ce-paragraph[data-placeholder]:empty:before{content:attr(data-placeholder);color:#707684;font-weight:400;opacity:0}
4.codex-editor--empty .ce-block:first-child .ce-paragraph[data-placeholder]:empty:before{opacity:1}.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph[data-placeholder]:empty:before,.codex-editor--empty .ce-block:first-child .ce-paragraph[data-placeholder]:empty:focus:before{opacity:0}.ce-paragraph p:first-of-type{margin-top:0}.ce-paragraph p:last-of-type{margin-bottom:0}")),document.head.appendChild(e)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();/**
5 * Base Paragraph Block for the Editor.js.
6 * Represents a regular text block
7 *
8 * @author CodeX ([email protected])
9 * @copyright CodeX 2018
10 * @license The MIT License (MIT)
11 */class tx{static get DEFAULT_PLACEHOLDER(){return""}onKeyUp(e){if("Backspace"!==e.code&&"Delete"!==e.code)return;let{textContent:o}=this._element;""===o&&(this._element.innerHTML="")}drawView(){let e=document.createElement("DIV");return e.classList.add(this._CSS.wrapper,this._CSS.block),e.contentEditable=!1,e.dataset.placeholder=this.api.i18n.t(this._placeholder),this._data.text&&(e.innerHTML=this._data.text),this.readOnly||(e.contentEditable=!0,e.addEventListener("keyup",this.onKeyUp)),e}render(){return this._element=this.drawView(),this._element}merge(e){let o={text:this.data.text+e.text};this.data=o}validate(e){return!(""===e.text.trim()&&!this._preserveBlank)}save(e){return{text:e.innerHTML}}onPaste(e){let o={text:e.detail.data.innerHTML};this.data=o}static get conversionConfig(){return{export:"text",import:"text"}}static get sanitize(){return{text:{br:!0}}}static get isReadOnlySupported(){return!0}get data(){if(null!==this._element){let e=this._element.innerHTML;this._data.text=e}return this._data}set data(e){this._data=e||{},null!==this._element&&this.hydrate()}hydrate(){window.requestAnimationFrame(()=>{this._element.innerHTML=this._data.text||""})}static get pasteConfig(){return{tags:["P"]}}static get toolbox(){return{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8 9V7.2C8 7.08954 8.08954 7 8.2 7L12 7M16 9V7.2C16 7.08954 15.9105 7 15.8 7L12 7M12 7L12 17M12 17H10M12 17H14"/></svg>',title:"Text"}}constructor({data:e,config:o,api:i,readOnly:n}){this.api=i,this.readOnly=n,this._CSS={block:this.api.styles.block,wrapper:"ce-paragraph"},this.readOnly||(this.onKeyUp=this.onKeyUp.bind(this)),this._placeholder=o.placeholder?o.placeholder:tx.DEFAULT_PLACEHOLDER,this._data={},this._element=null,this._preserveBlank=void 0!==o.preserveBlank&&o.preserveBlank,this.data=e}}class tw{static get sanitize(){return{b:{}}}render(){return this.nodes.button=document.createElement("button"),this.nodes.button.type="button",this.nodes.button.classList.add(this.CSS.button,this.CSS.buttonModifier),this.nodes.button.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M9 12L9 7.1C9 7.04477 9.04477 7 9.1 7H10.4C11.5 7 14 7.1 14 9.5C14 9.5 14 12 11 12M9 12V16.8C9 16.9105 9.08954 17 9.2 17H12.5C14 17 15 16 15 14.5C15 11.7046 11 12 11 12M9 12H11"/></svg>',this.nodes.button}surround(){document.execCommand(this.commandName)}checkState(){let e=document.queryCommandState(this.commandName);return this.nodes.button.classList.toggle(this.CSS.buttonActive,e),e}get shortcut(){return"CMD+B"}constructor(){this.commandName="bold",this.CSS={button:"ce-inline-tool",buttonActive:"ce-inline-tool--active",buttonModifier:"ce-inline-tool--bold"},this.nodes={button:void 0}}}tw.isInline=!0,tw.title="Bold";class ty{static get sanitize(){return{i:{}}}render(){return this.nodes.button=document.createElement("button"),this.nodes.button.type="button",this.nodes.button.classList.add(this.CSS.button,this.CSS.buttonModifier),this.nodes.button.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M13.34 10C12.4223 12.7337 11 17 11 17"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M14.21 7H14.2"/></svg>',this.nodes.button}surround(){document.execCommand(this.commandName)}checkState(){let e=document.queryCommandState(this.commandName);return this.nodes.button.classList.toggle(this.CSS.buttonActive,e),e}get shortcut(){return"CMD+I"}constructor(){this.commandName="italic",this.CSS={button:"ce-inline-tool",buttonActive:"ce-inline-tool--active",buttonModifier:"ce-inline-tool--italic"},this.nodes={button:null}}}ty.isInline=!0,ty.title="Italic";class tE{static get sanitize(){return{a:{href:!0,target:"_blank",rel:"nofollow"}}}render(){return this.nodes.button=document.createElement("button"),this.nodes.button.type="button",this.nodes.button.classList.add(this.CSS.button,this.CSS.buttonModifier),this.nodes.button.innerHTML=eD,this.nodes.button}renderActions(){return this.nodes.input=document.createElement("input"),this.nodes.input.placeholder=this.i18n.t("Add a link"),this.nodes.input.classList.add(this.CSS.input),this.nodes.input.addEventListener("keydown",e=>{e.keyCode===this.ENTER_KEY&&this.enterPressed(e)}),this.nodes.input}
11surround(e){if(e){this.inputOpened?(this.selection.restore(),this.selection.removeFakeBackground()):(this.selection.setFakeBackground(),this.selection.save());let e=this.selection.findParentTag("A");if(e){this.selection.expandToTag(e),this.unlink(),this.closeActions(),this.checkState(),this.toolbar.close();return}}this.toggleActions()}checkState(){let e=this.selection.findParentTag("A");if(e){this.nodes.button.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M15.7795 11.5C15.7795 11.5 16.053 11.1962 16.5497 10.6722C17.4442 9.72856 17.4701 8.2475 16.5781 7.30145V7.30145C15.6482 6.31522 14.0873 6.29227 13.1288 7.25073L11.8796 8.49999"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8.24517 12.3883C8.24517 12.3883 7.97171 12.6922 7.47504 13.2161C6.58051 14.1598 6.55467 15.6408 7.44666 16.5869V16.5869C8.37653 17.5731 9.93744 17.5961 10.8959 16.6376L12.1452 15.3883"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M17.7802 15.1032L16.597 14.9422C16.0109 14.8624 15.4841 15.3059 15.4627 15.8969L15.4199 17.0818"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M6.39064 9.03238L7.58432 9.06668C8.17551 9.08366 8.6522 8.58665 8.61056 7.99669L8.5271 6.81397"/><line x1="12.1142" x2="11.7" y1="12.2" y2="11.7858" stroke="currentColor" stroke-linecap="round" stroke-width="2"/></svg>',this.nodes.button.classList.add(this.CSS.buttonUnlink),this.nodes.button.classList.add(this.CSS.buttonActive),this.openActions();let o=e.getAttribute("href");this.nodes.input.value="null"!==o?o:"",this.selection.save()}else this.nodes.button.innerHTML=eD,this.nodes.button.classList.remove(this.CSS.buttonUnlink),this.nodes.button.classList.remove(this.CSS.buttonActive);return!!e}clear(){this.closeActions()}get shortcut(){return"CMD+K"}toggleActions(){this.inputOpened?this.closeActions(!1):this.openActions(!0)}openActions(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.nodes.input.classList.add(this.CSS.inputShowed),e&&this.nodes.input.focus(),this.inputOpened=!0}closeActions(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];if(this.selection.isFakeBackgroundEnabled){let e=new G;e.save(),this.selection.restore(),this.selection.removeFakeBackground(),e.restore()}this.nodes.input.classList.remove(this.CSS.inputShowed),this.nodes.input.value="",e&&this.selection.clearSaved(),this.inputOpened=!1}enterPressed(e){let o=this.nodes.input.value||"";if(!o.trim()){this.selection.restore(),this.unlink(),e.preventDefault(),this.closeActions();return}if(!this.validateURL(o)){this.notifier.show({message:"Pasted link is not valid.",style:"error"}),w("Incorrect Link pasted","warn",o);return}o=this.prepareLink(o),this.selection.restore(),this.selection.removeFakeBackground(),this.insertLink(o),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.selection.collapseToEnd(),this.inlineToolbar.close()}validateURL(e){return!/\s/.test(e)}prepareLink(e){return e=e.trim(),e=this.addProtocol(e)}addProtocol(e){if(/^(\w+):(\/\/)?/.test(e))return e;let o=/^\/[^/\s]/.test(e),i="#"===e.substring(0,1),n=/^\/\/[^/\s]/.test(e);return o||i||n||(e="http://"+e),e}insertLink(e){let o=this.selection.findParentTag("A");o&&this.selection.expandToTag(o),document.execCommand(this.commandLink,!1,e)}unlink(){document.execCommand(this.commandUnlink)}constructor({api:e}){this.commandLink="createLink",this.commandUnlink="unlink",this.ENTER_KEY=13,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"},this.nodes={button:null,input:null},this.inputOpened=!1,this.toolbar=e.toolbar,this.inlineToolbar=e.inlineToolbar,this.notifier=e.notifier,this.i18n=e.i18n,this.selection=new G}}tE.isInline=!0,tE.title="Link";class tC{render(){return this.wrapper}save(){return this.savedData}make(){let e=j.make("div",this.CSS.wrapper),o=j.make("div",this.CSS.info),i=j.make("div",this.CSS.title,{textContent:this.title}),n=j.make("div",this.CSS.subtitle,{textContent:this.subtitle});return e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><rect width="14" height="14" x="5" y="5" stroke="currentColor" stroke-width="2" rx="4"/><line x1="12" x2="12" y1="9" y2="12" stroke="currentColor" stroke-linecap="round" stroke-width="2"/><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M12 15.02V15.01"/></svg>',o.appendChild(i),o.appendChild(n),e.appendChild(o),e}constructor({data:e,api:o}){this.CSS={wrapper:"ce-stub",info:"ce-stub__info",title:"ce-stub__title",subt
11itle:"ce-stub__subtitle"},this.api=o,this.title=e.title||this.api.i18n.t("Error"),this.subtitle=this.api.i18n.t("The block can not be displayed correctly."),this.savedData=e.savedData,this.wrapper=this.make()}}tC.isReadOnlySupported=!0;class tB extends tt{get title(){return this.constructable[e9.Title]}create(){return new this.constructable({api:this.api.getMethodsForTool(this),config:this.settings})}constructor(){super(...arguments),this.type=e4.Inline}}class tS extends tt{create(e,o){return new this.constructable({api:this.api.getMethodsForTool(this),config:this.settings,block:o,data:e})}constructor(){super(...arguments),this.type=e4.Tune}}class tT extends Map{get blockTools(){return new tT(Array.from(this.entries()).filter(e=>{let[,o]=e;return o.isBlock()}))}get inlineTools(){return new tT(Array.from(this.entries()).filter(e=>{let[,o]=e;return o.isInline()}))}get blockTunes(){return new tT(Array.from(this.entries()).filter(e=>{let[,o]=e;return o.isTune()}))}get internalTools(){return new tT(Array.from(this.entries()).filter(e=>{let[,o]=e;return o.isInternal}))}get externalTools(){return new tT(Array.from(this.entries()).filter(e=>{let[,o]=e;return!o.isInternal}))}}var tI=Object.defineProperty,t_=Object.getOwnPropertyDescriptor,tM=(e,o,i,n)=>{for(var r,l=n>1?void 0:n?t_(o,i):o,a=e.length-1;a>=0;a--)(r=e[a])&&(l=(n?r(o,i,l):r(l))||l);return n&&l&&tI(o,i,l),l};class tA extends tt{create(e,o,i){return new this.constructable({data:e,block:o,readOnly:i,api:this.api.getMethodsForTool(this),config:this.settings})}get isReadOnlySupported(){return!0===this.constructable[e7.IsReadOnlySupported]}get isLineBreaksEnabled(){return this.constructable[e7.IsEnabledLineBreaks]}get toolbox(){let e=this.constructable[e7.Toolbox],o=this.config[e6.Toolbox];if(!_(e)&&!1!==o)return o?Array.isArray(e)?Array.isArray(o)?o.map((o,i)=>{let n=e[i];return n?{...n,...o}:o}):[o]:Array.isArray(o)?o:[{...e,...o}]:Array.isArray(e)?e:[e]}get conversionConfig(){return this.constructable[e7.ConversionConfig]}get enabledInlineTools(){return this.config[e6.EnabledInlineTools]||!1}get enabledBlockTunes(){return this.config[e6.EnabledBlockTunes]}get pasteConfig(){var e;return null!==(e=this.constructable[e7.PasteConfig])&&void 0!==e?e:{}}get sanitizeConfig(){let e=super.sanitizeConfig,o=this.baseSanitizeConfig;if(_(e))return o;let i={};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=e[n];B(r)?i[n]=Object.assign({},o,r):i[n]=r}return i}get baseSanitizeConfig(){let e={};return Array.from(this.inlineTools.values()).forEach(o=>Object.assign(e,o.sanitizeConfig)),Array.from(this.tunes.values()).forEach(o=>Object.assign(e,o.sanitizeConfig)),e}constructor(){super(...arguments),this.type=e4.Block,this.inlineTools=new tT,this.tunes=new tT}}tM([H],tA.prototype,"sanitizeConfig",1),tM([H],tA.prototype,"baseSanitizeConfig",1);class tL{get(e){let{class:o,isInternal:i=!1,...n}=this.config[e];return new(this.getConstructor(o))({name:e,constructable:o,config:n,api:this.api,isDefault:e===this.editorConfig.defaultBlock,defaultPlaceholder:this.editorConfig.placeholder,isInternal:i})}getConstructor(e){switch(!0){case e[e9.IsInline]:return tB;case e[te.IsTune]:return tS;default:return tA}}constructor(e,o,i){this.api=i,this.config=e,this.editorConfig=o}}class tO{render(){return{icon:eN,title:this.api.i18n.t("Move down"),onActivate:()=>this.handleClick(),name:"move-down"}}handleClick(){let e=this.api.blocks.getCurrentBlockIndex(),o=this.api.blocks.getBlockByIndex(e+1);if(!o)throw Error("Unable to move Block down since it is already the last");let i=o.holder,n=i.getBoundingClientRect(),r=Math.abs(window.innerHeight-i.offsetHeight);n.top<window.innerHeight&&(r=window.scrollY+i.offsetHeight),window.scrollTo(0,r),this.api.blocks.move(e+1),this.api.toolbar.toggleBlockSettings(!0)}constructor({api:e}){this.CSS={animation:"wobble"},this.api=e}}tO.isTune=!0;class tN{render(){return{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M8 8L12 12M12 12L16 16M12 12L16 8M12 12L8 16"/></svg>',title:this.api.i18n.t("Delete"),name:"delete",confirmation:{title:this.api.i18n.t("Click to delete"),onActivate:()=>this.handleClick()}}}handleClick(){this.api.blocks.delete()}constructor({api:e}){this.api=e}}tN.isTune=!0;class tD{render(){return{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
11<path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M7 15L11.8586 10.1414C11.9367 10.0633 12.0633 10.0633 12.1414 10.1414L17 15"/></svg>',title:this.api.i18n.t("Move up"),onActivate:()=>this.handleClick(),name:"move-up"}}handleClick(){let e;let o=this.api.blocks.getCurrentBlockIndex(),i=this.api.blocks.getBlockByIndex(o),n=this.api.blocks.getBlockByIndex(o-1);if(0===o||!i||!n)throw Error("Unable to move Block up since it is already the first");let r=i.holder,l=n.holder,a=r.getBoundingClientRect(),c=l.getBoundingClientRect();e=c.top>0?Math.abs(a.top)-Math.abs(c.top):Math.abs(a.top)+c.height,window.scrollBy(0,-1*e),this.api.blocks.move(o-1),this.api.toolbar.toggleBlockSettings(!0)}constructor({api:e}){this.CSS={animation:"wobble"},this.api=e}}tD.isTune=!0;var tR=Object.defineProperty,tP=Object.getOwnPropertyDescriptor;class tF extends q{get available(){return this.toolsAvailable}get unavailable(){return this.toolsUnavailable}get inlineTools(){return this.available.inlineTools}get blockTools(){return this.available.blockTools}get blockTunes(){return this.available.blockTunes}get defaultTool(){return this.blockTools.get(this.config.defaultBlock)}get internal(){return this.available.internalTools}async prepare(){if(this.validateTools(),this.config.tools=function e(o){for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];if(!n.length)return o;let l=n.shift();if(B(o)&&B(l))for(let i in l)B(l[i])?(o[i]||Object.assign(o,{[i]:{}}),e(o[i],l[i])):Object.assign(o,{[i]:l[i]});return e(o,...n)}({},this.internalTools,this.config.tools),!Object.prototype.hasOwnProperty.call(this.config,"tools")||0===Object.keys(this.config.tools).length)throw Error("Can't start without tools");let e=this.prepareConfig();this.factory=new tL(e,this.config,this.Editor.API);let o=this.getListOfPrepareFunctions(e);if(0===o.length)return Promise.resolve();await A(o,e=>{this.toolPrepareMethodSuccess(e)},e=>{this.toolPrepareMethodFallback(e)}),this.prepareBlockTools()}getAllInlineToolsSanitizeConfig(){let e={};return Array.from(this.inlineTools.values()).forEach(o=>{Object.assign(e,o.sanitizeConfig)}),e}destroy(){Object.values(this.available).forEach(async e=>{C(e.reset)&&await e.reset()})}get internalTools(){return{bold:{class:tw,isInternal:!0},italic:{class:ty,isInternal:!0},link:{class:tE,isInternal:!0},paragraph:{class:tx,inlineToolbar:!0,isInternal:!0},stub:{class:tC,isInternal:!0},moveUp:{class:tD,isInternal:!0},delete:{class:tN,isInternal:!0},moveDown:{class:tO,isInternal:!0}}}toolPrepareMethodSuccess(e){let o=this.factory.get(e.toolName);if(o.isInline()){let e=["render","surround","checkState"].filter(e=>!o.create()[e]);if(e.length){w("Incorrect Inline Tool: ".concat(o.name,". Some of required methods is not implemented %o"),"warn",e),this.toolsUnavailable.set(o.name,o);return}}this.toolsAvailable.set(o.name,o)}toolPrepareMethodFallback(e){this.toolsUnavailable.set(e.toolName,this.factory.get(e.toolName))}getListOfPrepareFunctions(e){let o=[];return Object.entries(e).forEach(e=>{let[i,n]=e;o.push({function:C(n.class.prepare)?n.class.prepare:()=>{},data:{toolName:i,config:n.config}})}),o}prepareBlockTools(){Array.from(this.blockTools.values()).forEach(e=>{this.assignInlineToolsToBlockTool(e),this.assignBlockTunesToBlockTool(e)})}assignInlineToolsToBlockTool(e){if(!1!==this.config.inlineToolbar){if(!0===e.enabledInlineTools){e.inlineTools=new tT(Array.isArray(this.config.inlineToolbar)?this.config.inlineToolbar.map(e=>[e,this.inlineTools.get(e)]):Array.from(this.inlineTools.entries()));return}Array.isArray(e.enabledInlineTools)&&(e.inlineTools=new tT(e.enabledInlineTools.map(e=>[e,this.inlineTools.get(e)])))}}assignBlockTunesToBlockTool(e){if(!1!==e.enabledBlockTunes){if(Array.isArray(e.enabledBlockTunes)){let o=new tT(e.enabledBlockTunes.map(e=>[e,this.blockTunes.get(e)]));e.tunes=new tT([...o,...this.blockTunes.internalTools]);return}if(Array.isArray(this.config.tunes)){let o=new tT(this.config.tunes.map(e=>[e,this.blockTunes.get(e)]));e.tunes=new tT([...o,...this.blockTunes.internalTools]);return}e.tunes=this.blockTunes.internalTools}}validateTools(){for(let e in this.config.tools)if(Object.prototype.hasOwnProperty.call(this.config.tools,e)){if(e in this.internalTools)return;let o=this.config.tools[e];if(!C(o)&&!C(o.class))throw Error("Tool \xab".concat(e,"\xbb must be a constructor function or an object with function in the \xabclass\xbb property"))}}prepareConfig(){let e={};for(let o in this.config.tools)B(this.config.tools[o])?e[o]=this.config.tools[o]:e[o]={class:this.config.tools[o]};return e}constructor(){super(...arguments),this.stubTool="stub",this.toolsAvailable=new tT,this.toolsUnavailable=new tT}}((e,o,i,n)=>{for(var r,l=n>1?void 0:n?tP(o,i):o,a=e.length-1;a>=0;a--)(r=e[a])&&(l=(n?r(o,i,l):r(l))||l);return n&&l&&tR(o,i,l)})([H],tF.prototype,"getAllInlineToolsSanitizeConfig",1);class tH extends q{get CSS(){return{editorWrapper:"codex-editor",editorWrapperNarrow:"codex-editor--narrow",editorZone:"codex-editor__redactor",editorZoneHidden:"codex-editor__redactor--hidden",editorEmpty:"codex-editor--empty",editorRtlFix:"codex-editor--rtl"}}get contentRect(){if(this.contentRectCache)return this.contentRectCache;let e=this.nodes.wrapper.querySelector(".".concat(ei.CSS.content));return e?(this.contentRectCache=e.getBoundingClientRect(),this.contentRectCache):{width:650,left:0,right:0}}async prepare(){this.checkIsMobile(),this.make(),this.loadStyles()}toggleReadOnly(e){e?this.disableModuleBindings():window.requestIdleCallback(()=>{this.enableModuleBindings()},{timeout:2e3})}checkEmptiness(){let{BlockManager:e}=this.Editor;this.nodes.wrapper.classList.toggle(this.CSS.editorEmpty,e.isEditorEmpty)}get someToolbarOpened(){let{Toolbar:e,BlockSettings:o,InlineToolbar:i,ConversionToolbar:n}=this.Editor;return o.opened||i.opened||n.opened||e.toolbox.opened}
11get someFlipperButtonFocused(){return!!this.Editor.Toolbar.toolbox.hasFocus()||Object.entries(this.Editor).filter(e=>{let[o,i]=e;return i.flipper instanceof eF}).some(e=>{let[o,i]=e;return i.flipper.hasFocus()})}destroy(){this.nodes.holder.innerHTML=""}closeAllToolbars(){let{Toolbar:e,BlockSettings:o,InlineToolbar:i,ConversionToolbar:n}=this.Editor;o.close(),i.close(),n.close(),e.toolbox.close()}checkIsMobile(){this.isMobile=window.innerWidth<650}make(){this.nodes.holder=j.getHolder(this.config.holder),this.nodes.wrapper=j.make("div",[this.CSS.editorWrapper,...this.isRtl?[this.CSS.editorRtlFix]:[]]),this.nodes.redactor=j.make("div",this.CSS.editorZone),this.nodes.holder.offsetWidth<this.contentRect.width&&this.nodes.wrapper.classList.add(this.CSS.editorWrapperNarrow),this.nodes.redactor.style.paddingBottom=this.config.minHeight+"px",this.nodes.wrapper.appendChild(this.nodes.redactor),this.nodes.holder.appendChild(this.nodes.wrapper)}loadStyles(){let e="editor-js-styles";if(j.get(e))return;let o=j.make("style",null,{id:e,textContent:
vendor: 30,190 bytes, line 11
11':root{--selectionColor: #e1f2ff;--inlineSelectionColor: #d4ecff;--bg-light: #eff2f5;--grayText: #707684;--color-dark: #1D202B;--color-active-icon: #388AE5;--color-gray-border: rgba(201, 201, 204, .48);--content-width: 650px;--narrow-mode-right-padding: 50px;--toolbox-buttons-size: 26px;--toolbox-buttons-size--mobile: 36px;--icon-size: 20px;--icon-size--mobile: 28px;--block-padding-vertical: .4em;--color-line-gray: #EFF0F1 }.codex-editor{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;z-index:1}.codex-editor .hide{display:none}.codex-editor__redactor [contenteditable]:empty:after{content:"\\feff"}@media (min-width: 651px){.codex-editor--narrow .codex-editor__redactor{margin-right:50px}}@media (min-width: 651px){.codex-editor--narrow.codex-editor--rtl .codex-editor__redactor{margin-left:50px;margin-right:0}}@media (min-width: 651px){.codex-editor--narrow .ce-toolbar__actions{right:-5px}}.codex-editor-copyable{position:absolute;height:1px;width:1px;top:-400%;opacity:.001}.codex-editor-overlay{position:fixed;top:0px;left:0px;right:0px;bottom:0px;z-index:999;pointer-events:none;overflow:hidden}.codex-editor-overlay__container{position:relative;pointer-events:auto;z-index:0}.codex-editor-overlay__rectangle{position:absolute;pointer-events:none;background-color:#2eaadc33;border:1px solid transparent}.codex-editor svg{max-height:100%}.codex-editor path{stroke:currentColor}.codex-editor ::-moz-selection{background-color:#d4ecff}.codex-editor ::selection{background-color:#d4ecff}.codex-editor--toolbox-opened [contentEditable=true][data-placeholder]:focus:before{opacity:0!important}.ce-scroll-locked{overflow:hidden}.ce-scroll-locked--hard{overflow:hidden;top:calc(-1 * var(--window-scroll-offset));position:fixed;width:100%}.ce-toolbar{position:absolute;left:0;right:0;top:0;-webkit-transition:opacity .1s ease;transition:opacity .1s ease;will-change:opacity,top;display:none}.ce-toolbar--opened{display:block}.ce-toolbar__content{max-width:650px;margin:0 auto;position:relative}.ce-toolbar__plus{color:#1d202b;cursor:pointer;width:26px;height:26px;border-radius:7px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-flex-negative:0;flex-shrink:0}@media (max-width: 650px){.ce-toolbar__plus{width:36px;height:36px}}@media (hover: hover){.ce-toolbar__plus:hover{background-color:#eff2f5}}.ce-toolbar__plus--active{background-color:#eff2f5;-webkit-animation:bounceIn .75s 1;animation:bounceIn .75s 1;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.ce-toolbar__plus-shortcut{opacity:.6;word-spacing:-2px;margin-top:5px}@media (max-width: 650px){.ce-toolbar__plus{position:absolute;background-color:#fff;border:1px solid #E8E8EB;-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.13);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;z-index:2;position:static}.ce-toolbar__plus--left-oriented:before{left:15px;margin-left:0}.ce-toolbar__plus--right-oriented:before{left:auto;right:15px;margin-left:0}}.ce-toolbar__actions{position:absolute;right:100%;opacity:0;display:-webkit-box;display:-ms-flexbox;display:flex;padding-right:5px}.ce-toolbar__actions--opened{opacity:1}@media (max-width: 650px){.ce-toolbar__actions{right:auto}}.ce-toolbar__settings-btn{color:#1d202b;width:26px;height:26px;border-radius:7px;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;margin-left:3px;cursor:pointer;user-select:none}@media (max-width: 650px){.ce-toolbar__settings-btn{width:36px;height:36px}}@media (hover: hover){.ce-toolbar__settings-btn:hover{background-color:#eff2f5}}.ce-toolbar__settings-btn--active{background-color:#eff2f5;-webkit-animation:bounceIn .75s 1;animation:bounceIn .75s 1;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@media (min-width: 651px){.ce-toolbar__settings-btn{width:24px}}.ce-toolbar__settings-btn--hidden{display:none}@media (max-width: 650px){.ce-toolbar__settings-btn{position:absolute;background-color:#fff;border:1px solid #E8E8EB;-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.13);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;z-index:2;position:static}.ce-toolbar__settings-btn--left-oriented:before{left:15px;margin-left:0}.ce-toolbar__settings-btn--right-oriented:before{left:auto;right:15px;margin-left:0}}.ce-toolbar__plus svg,.ce-toolbar__settings-btn svg{width:24px;height:24px}@media (min-width: 651px){.codex-editor--narrow .ce-toolbar__plus{left:5px}}@media (min-width: 651px){.codex-editor--narrow .ce-toolbox .ce-popover{right:0;left:auto;left:initial}}.ce-inline-toolbar{--y-offset: 8px;position:absolute;background-color:#fff;border:1px solid #E8E8EB;-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.13);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;z-index:2;opacity:0;visibility:hidden;-webkit-transition:opacity .25s ease;transition:opacity .25s ease;will-change:opacity,left,top;top:0;left:0;z-index:3}.ce-inline-toolbar--left-oriented:before{left:15px;margin-left:0}.ce-inline-toolbar--right-oriented:before{left:auto;right:15px;margin-left:0}.ce-inline-toolbar--showed{opacity:1;visibility:visible}.ce-inline-toolbar [hidden]{display:none!important}.ce-inline-toolbar__toggler-and-button-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;padding:0 6px}.ce-inline-toolbar__buttons{display:-webkit-box;display:-ms-flexbox;display:flex}.ce-inline-toolbar__dropdown{display:-webkit-box;display:-ms-flexbox;display:flex;padding:6px;margin:0 6px 0 -6px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-right:1px solid rgba(201,201,204,.48);-webkit-box-sizing:border-box;box-sizing:border-box}@media (hover: hover){.ce-inline-toolbar__dropdown:hover{background:#eff2f5}}.ce-inline-toolbar__dropdown--hidden{display:none}.ce-inline-toolbar__dropdown-content,.ce-inline-toolbar__dropdown-arrow{display:-webkit-box;display:-ms-flexbox;display:flex}.ce-inline-toolbar__dropdown-content svg,.ce-inline-toolbar__dropdown-arrow svg{width:20px;height:20px}.ce-inline-toolbar__shortcut{opacity:.6;word-spacing:-3px;margin-top:3px}.ce-inline-tool{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:6px 1px;cursor:pointer;border:0;outline:none;background-color:transparent;vertical-align:bottom;color:inherit;margin:0;border-radius:0;line-height:normal}.ce-inline-tool svg{width:20px;height:20px}@media (max-width: 650px){.ce-inline-tool svg{width:28px;height:28px}}@media (hover: hover){.ce-inline-tool:hover{background-color:#eff2f5}}.ce-inline-tool--active{color:#388ae5}.ce-inline-tool--focused{background:rgba(34,186,255,.08)!important}.ce-inline-tool--focused{-webkit-box-shadow:inset 0 0 0px 1px rgba(7,161,227,.08);box-shadow:inset 0 0 0 1px #07a1e314}.ce-inline-tool--focused-animated{-webkit-animation-name:buttonClicked;animation-name:buttonClicked;-webkit-animation-duration:.25s;animation-duration:.25s}.ce-inline-tool--link .icon--unlink,.ce-inline-tool--unlink .icon--link{display:none}.ce-inline-tool--unlink .icon--unlink{display:inline-block;margin-bottom:-1px}.ce-inline-tool-input{outline:none;border:0;border-radius:0 0 4px 4px;margin:0;font-size:13px;padding:10px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;display:none;font-weight:500;border-top:1px solid rgba(201,201,204,.48);-webkit-appearance:none;font-family:inherit}@media (max-width: 650px){.ce-inline-tool-input{font-size:15px;font-weight:500}}.ce-inline-tool-input::-webkit-input-placeholder{color:#707684}.ce-inline-tool-input::-moz-placeholder{color:#707684}.ce-inline-tool-input:-ms-input-placeholder{color:#707684}.ce-inline-tool-input::-ms-input-placeholder{color:#707684}.ce-inline-tool-input::placeholder{color:#707684}.ce-inline-tool-input--showed{display:block}.ce-conversion-toolbar{position:absolute;background-color:#fff;border:1px solid #E8E8EB;-webkit-box-shadow:0 3px 15px -3px rgba(13,20,33,.13);box-shadow:0 3px 15px -3px #0d142121;border-radius:6px;z-index:2;opacity:0;visibility:hidden;will-change:transform,opacity;-webkit-transition:opacity .1s ease,-webkit-transform .1s ease;transition:opacity .1s ease,-webkit-transform .1s ease;transition:transform .1s ease,opacity .1s ease;transition:transform .1s ease,opacity .1s ease,-webkit-transform .1s ease;-webkit-transform:translateY(-8px);transform:translateY(-8px);left:-1px;width:190px;margin-top:5px;-webkit-box-sizing:content-box;box-sizing:content-box}.ce-conversion-toolbar--left-oriented:before{left:15px;margin-left:0}.ce-conversion-toolbar--right-oriented:before{left:auto;right:15px;margin-left:0}.ce-conversion-toolbar--showed{opacity:1;visibility:visible;-webkit-transform:none;transform:none}.ce-conversion-toolbar [hidden]{display:none!important}.ce-conversion-toolbar__buttons{display:-webkit-box;display:-ms-flexbox;display:flex}.ce-conversion-toolbar__label{color:#707684;font-size:11px;font-weight:500;letter-spacing:.33px;padding:10px 10px 5px;text-transform:uppercase}.ce-conversion-tool{display:-webkit-box;display:-ms-flexbox;display:flex;padding:5px 10px;font-size:14px;line-height:20px;font-weight:500;cursor:pointer;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.ce-conversion-tool--hidden{display:none}.ce-conversion-tool--focused{background:rgba(34,186,255,.08)!important}.ce-conversion-tool--focused{-webkit-box-shadow:inset 0 0 0px 1px rgba(7,161,227,.08);box-shadow:inset 0 0 0 1px #07a1e314}.ce-conversion-tool--focused-animated{-webkit-animation-name:buttonClicked;animation-name:buttonClicked;-webkit-animation-duration:.25s;animation-duration:.25s}.ce-conversion-tool:hover{background:#eff2f5}.ce-conversion-tool__icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;width:26px;height:26px;-webkit-box-shadow:0 0 0 1px rgba(201,201,204,.48);box-shadow:0 0 0 1px #c9c9cc7a;border-radius:5px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;background:#fff;-webkit-box-sizing:content-box;box-sizing:content-box;-ms-flex-negative:0;flex-shrink:0;margin-right:10px}.ce-conversion-tool__icon svg{width:20px;height:20px}@media (max-width: 650px){.ce-conversion-tool__icon{width:36px;height:36px;border-radius:8px}.ce-conversion-tool__icon svg{width:28px;height:28px}}.ce-conversion-tool--last{margin-right:0!important}.ce-conversion-tool--active{color:#388ae5!important}.ce-conversion-tool--active{-webkit-animation:bounceIn .75s 1;animation:bounceIn .75s 1;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.ce-conversion-tool__secondary-label{color:#707684;font-size:12px;margin-left:auto;white-space:nowrap;letter-spacing:-.1em;padding-right:5px;margin-bottom:-2px;opacity:.6}@media (max-width: 650px){.ce-conversion-tool__secondary-label{display:none}}.ce-settings__button{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:6px 1px;border-radius:3px;cursor:pointer;border:0;outline:none;background-color:transparent;vertical-align:bottom;color:inherit;margin:0;line-height:32px}.ce-settings__button svg{width:20px;height:20px}@media (max-width: 650px){.ce-settings__button svg{width:28px;height:28px}}@media (hover: hover){.ce-settings__button:hover{background-color:#eff2f5}}.ce-settings__button--active{color:#388ae5}.ce-settings__button--focused{background:rgba(34,186,255,.08)!important}.ce-settings__button--focused{-webkit-box-shadow:inset 0 0 0px 1px rgba(7,161,227,.08);box-shadow:inset 0 0 0 1px #07a1e314}.ce-settings__button--focused-animated{-webkit-animation-name:buttonClicked;animation-name:buttonClicked;-webkit-animation-duration:.25s;animation-duration:.25s}.ce-settings__button:not(:nth-child(3n+3)){margin-right:3px}.ce-settings__button:nth-child(n+4){margin-top:3px}.ce-settings__button--disabled{cursor:not-allowed!important}.ce-settings__button--disabled{opacity:.3}.ce-settings__button--selected{color:#388ae5}@media (min-width: 651px){.codex-editor--narrow .ce-settings .ce-popover{right:0;left:auto;left:initial}}@-webkit-keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.ce-block{-webkit-animation:fade-in .3s ease;animation:fade-in .3s ease;-webkit-animation-fill-mode:none;animation-fill-mode:none;-webkit-animation-fill-mode:initial;animation-fill-mode:initial}.ce-block:first-of-type{margin-top:0}.ce-block--selected .ce-block__content{background:#e1f2ff}.ce-block--selected .ce-block__content [contenteditable]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ce-block--selected .ce-block__content img,.ce-block--selected .ce-block__content .ce-stub{opacity:.55}.ce-block--stretched .ce-block__content{max-width:none}.ce-block__content{position:relative;max-width:650px;margin:0 auto;-webkit-transition:background-color .15s ease;transition:background-color .15s ease}.ce-block--drop-target .ce-block__content:before{content:"";position:absolute;top:100%;left:-20px;margin-top:-1px;height:8px;width:8px;border:solid #388AE5;border-width:1px 1px 0 0;-webkit-transform-origin:right;transform-origin:right;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.ce-block--drop-target .ce-block__content:after{content:"";position:absolute;top:100%;height:1px;width:100%;color:#388ae5;background:repeating-linear-gradient(90deg,#388AE5,#388AE5 1px,#fff 1px,#fff 6px)}.ce-block a{cursor:pointer;-webkit-text-decoration:underline;text-decoration:underline}.ce-block b{font-weight:700}.ce-block i{font-style:italic}@-webkit-keyframes bounceIn{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}20%{-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}60%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes bounceIn{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}20%{-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}60%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@-webkit-keyframes selectionBounce{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}50%{-webkit-transform:scale3d(1.01,1.01,1.01);transform:scale3d(1.01,1.01,1.01)}70%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes selectionBounce{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}50%{-webkit-transform:scale3d(1.01,1.01,1.01);transform:scale3d(1.01,1.01,1.01)}70%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@-webkit-keyframes buttonClicked{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.95,.95,.95);transform:scale3d(.95,.95,.95)}60%{-webkit-transform:scale3d(1.02,1.02,1.02);transform:scale3d(1.02,1.02,1.02)}80%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}@keyframes buttonClicked{0%,20%,40%,60%,80%,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{-webkit-transform:scale3d(.95,.95,.95);transform:scale3d(.95,.95,.95)}60%{-webkit-transform:scale3d(1.02,1.02,1.02);transform:scale3d(1.02,1.02,1.02)}80%{-webkit-transform:scale3d(1,1,1);transform:scaleZ(1)}}.cdx-block{padding:.4em 0}.cdx-block::-webkit-input-placeholder{line-height:normal!important}.cdx-input{border:1px solid rgba(201,201,204,.48);-webkit-box-shadow:inset 0 1px 2px 0 rgba(35,44,72,.06);box-shadow:inset 0 1px 2px #232c480f;border-radius:3px;padding:10px 12px;outline:none;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box}.cdx-input[data-placeholder]:before{position:static!important}.cdx-input[data-placeholder]:before{display:inline-block;width:0;white-space:nowrap;pointer-events:none}.cdx-settings-button{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding:6px 1px;border-radius:3px;cursor:pointer;border:0;outline:none;background-color:transparent;vertical-align:bottom;color:inherit;margin:0;min-width:26px;min-height:26px}.cdx-settings-button svg{width:20px;height:20px}@media (max-width: 650px){.cdx-settings-button svg{width:28px;height:28px}}@media (hover: hover){.cdx-settings-button:hover{background-color:#eff2f5}}.cdx-settings-button--focused{background:rgba(34,186,255,.08)!important}.cdx-settings-button--focused{-webkit-box-shadow:inset 0 0 0px 1px rgba(7,161,227,.08);box-shadow:inset 0 0 0 1px #07a1e314}.cdx-settings-button--focused-animated{-webkit-animation-name:buttonClicked;animation-name:buttonClicked;-webkit-animation-duration:.25s;animation-duration:.25s}.cdx-settings-button--active{color:#388ae5}.cdx-settings-button svg{width:auto;height:auto}@media (max-width: 650px){.cdx-settings-button{width:36px;height:36px;border-radius:8px}}.cdx-loader{position:relative;border:1px solid rgba(201,201,204,.48)}.cdx-loader:before{content:"";position:absolute;left:50%;top:50%;width:18px;height:18px;margin:-11px 0 0 -11px;border:2px solid rgba(201,201,204,.48);border-left-color:#388ae5;border-radius:50%;-webkit-animation:cdxRotation 1.2s infinite linear;animation:cdxRotation 1.2s infinite linear}@-webkit-keyframes cdxRotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes cdxRotation{0%{-webkit-transform:rotate(0deg);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.cdx-button{padding:13px;border-radius:3px;border:1px solid rgba(201,201,204,.48);font-size:14.9px;background:#fff;-webkit-box-shadow:0 2px 2px 0 rgba(18,30,57,.04);box-shadow:0 2px 2px #121e390a;color:#707684;text-align:center;cursor:pointer}@media (hover: hover){.cdx-button:hover{background:#FBFCFE;-webkit-box-shadow:0 1px 3px 0 rgba(18,30,57,.08);box-shadow:0 1px 3px #121e3914}}.cdx-button svg{height:20px;margin-right:.2em;margin-top:-2px}.ce-stub{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:12px 18px;margin:10px 0;border-radius:10px;background:#eff2f5;border:1px solid #EFF0F1;color:#707684;font-size:14px}.ce-stub svg{width:20px;height:20px}.ce-stub__info{margin-left:14px}.ce-stub__title{font-weight:500;text-transform:capitalize}.codex-editor.codex-editor--rtl{direction:rtl}.codex-editor.codex-editor--rtl .cdx-list{padding-left:0;padding-right:40px}.codex-editor.codex-editor--rtl .ce-toolbar__plus{right:-26px;left:auto}.codex-editor.codex-editor--rtl .ce-toolbar__actions{right:auto;left:-26px}@media (max-width: 650px){.codex-editor.codex-editor--rtl .ce-toolbar__actions{margin-left:0;margin-right:auto;padding-right:0;padding-left:10px}}.codex-editor.codex-editor--rtl .ce-settings{left:5px;right:auto}.codex-editor.codex-editor--rtl .ce-settings:before{right:auto;left:25px}.codex-editor.codex-editor--rtl .ce-settings__button:not(:nth-child(3n+3)){margin-left:3px;margin-right:0}.codex-editor.codex-editor--rtl .ce-conversion-tool__icon{margin-right:0;margin-left:10px}.codex-editor.codex-editor--rtl .ce-inline-toolbar__dropdown{border-right:0px solid transparent;border-left:1px solid rgba(201,201,204,.48);margin:0 -6px 0 6px}.codex-editor.codex-editor--rtl .ce-inline-toolbar__dropdown .icon--toggler-down{margin-left:0;margin-right:4px}@media (min-width: 651px){.codex-editor--narrow.codex-editor--rtl .ce-toolbar__plus{left:0px;right:5px}}@media (min-width: 651px){.codex-editor--narrow.codex-editor--rtl .ce-toolbar__actions{left:-5px}}.cdx-search-field{--icon-margin-right: 10px;background:rgba(232,232,235,.49);border:1px solid rgba(226,226,229,.2);border-radius:6px;padding:2px;display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:auto}.cdx-search-field__icon{width:26px;height:26px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:var(--icon-margin-right)}.cdx-search-field__icon svg{width:20px;height:20px;color:#707684}.cdx-search-field__input{font-size:14px;outline:none;font-weight:500;font-family:inherit;border:0;background:transparent;margin:0;padding:0;line-height:22px;min-width:calc(100% - 26px - var(--icon-margin-right))}.cdx-search-field__input::-webkit-input-placeholder{color:#707684;font-weight:500}.cdx-search-field__input::-moz-placeholder{color:#707684;font-weight:500}.cdx-search-field__input:-ms-input-placeholder{color:#707684;font-weight:500}.cdx-search-field__input::-ms-input-placeholder{color:#707684;font-weight:500}.cdx-search-field__input::placeholder{color:#707684;font-weight:500}.ce-popover{--border-radius: 6px;--width: 200px;--max-height: 270px;--padding: 6px;--offset-from-target: 8px;--color-border: #e8e8eb;--color-shadow: rgba(13,20,33,.13);--color-background: white;--color-text-primary: black;--color-text-secondary: #707684;--color-border-icon: rgba(201, 201, 204, .48);--color-border-icon-disabled: #EFF0F1;--color-text-icon-active: #388AE5;--color-background-icon-active: rgba(56, 138, 229, .1);--color-background-item-focus: rgba(34, 186, 255, .08);--color-shadow-item-focus: rgba(7, 161, 227, .08);--color-background-item-hover: #eff2f5;--color-background-item-confirm: #E24A4A;--color-background-item-confirm-hover: #CE4343;min-width:var(--width);width:var(--width);max-height:var(--max-height);border-radius:var(--border-radius);overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-shadow:0 3px 15px -3px var(--color-shadow);box-shadow:0 3px 15px -3px var(--color-shadow);position:absolute;left:0;top:calc(100% + var(--offset-from-target));background:var(--color-background);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;z-index:4;opacity:0;max-height:0;pointer-events:none;padding:0;border:none}.ce-popover--opened{opacity:1;padding:var(--padding);max-height:var(--max-height);pointer-events:auto;-webkit-animation:panelShowing .1s ease;animation:panelShowing .1s ease;border:1px solid var(--color-border)}@media (max-width: 650px){.ce-popover--opened{-webkit-animation:panelShowingMobile .25s ease;animation:panelShowingMobile .25s ease}}.ce-popover__items{overflow-y:auto;-ms-scroll-chaining:none;overscroll-behavior:contain}@media (max-width: 650px){.ce-popover__overlay{position:fixed;top:0;bottom:0;left:0;right:0;background:#1D202B;z-index:3;opacity:.5;-webkit-transition:opacity .12s ease-in;transition:opacity .12s ease-in;will-change:opacity;visibility:visible}}.ce-popover__overlay--hidden{display:none}.ce-popover--open-top{top:calc(-1 * (var(--offset-from-target) + var(--popover-height)))}@media (max-width: 650px){.ce-popover{--offset: 5px;position:fixed;max-width:none;min-width:calc(100% - var(--offset) * 2);left:var(--offset);right:var(--offset);bottom:calc(var(--offset) + env(safe-area-inset-bottom));top:auto;border-radius:10px}.ce-popover .ce-popover__search{display:none}}.ce-popover__search,.ce-popover__custom-content:not(:empty){margin-bottom:5px}.ce-popover__nothing-found-message{color:#707684;display:none;cursor:default;padding:3px;font-size:14px;line-height:20px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ce-popover__nothing-found-message--displayed{display:block}.ce-popover__custom-content:not(:empty){padding:4px}@media (min-width: 651px){.ce-popover__custom-content:not(:empty){padding:0}}.ce-popover__custom-content--hidden{display:none}.ce-popover-item{--border-radius: 6px;--icon-size: 20px;--icon-size-mobile: 28px;border-radius:var(--border-radius);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:3px;color:var(--color-text-primary);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media (max-width: 650px){.ce-popover-item{padding:4px}}.ce-popover-item:not(:last-of-type){margin-bottom:1px}.ce-popover-item__icon{border-radius:5px;width:26px;height:26px;-webkit-box-shadow:0 0 0 1px var(--color-border-icon);box-shadow:0 0 0 1px var(--color-border-icon);background:#fff;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-right:10px}.ce-popover-item__icon svg{width:20px;height:20px}@media (max-width: 650px){.ce-popover-item__icon{width:36px;height:36px;border-radius:8px}.ce-popover-item__icon svg{width:var(--icon-size-mobile);height:var(--icon-size-mobile)}}.ce-popover-item__title{font-size:14px;line-height:20px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media (max-width: 650px){.ce-popover-item__title{font-size:16px}}.ce-popover-item__secondary-title{color:var(--color-text-secondary);font-size:12px;margin-left:auto;white-space:nowrap;letter-spacing:-.1em;padding-right:5px;margin-bottom:-2px;opacity:.6}@media (max-width: 650px){.ce-popover-item__secondary-title{display:none}}.ce-popover-item--active{background:var(--color-background-icon-active);color:var(--color-text-icon-active)}.ce-popover-item--active .ce-popover-item__icon{-webkit-box-shadow:none;box-shadow:none}.ce-popover-item--disabled{color:var(--color-text-secondary);cursor:default;pointer-events:none}.ce-popover-item--disabled .ce-popover-item__icon{-webkit-box-shadow:0 0 0 1px var(--color-border-icon-disabled);box-shadow:0 0 0 1px var(--color-border-icon-disabled)}.ce-popover-item--focused:not(.ce-popover-item--no-focus){background:var(--color-background-item-focus)!important}.ce-popover-item--focused:not(.ce-popover-item--no-focus){-webkit-box-shadow:inset 0 0 0px 1px var(--color-shadow-item-focus);box-shadow:inset 0 0 0 1px var(--color-shadow-item-focus)}.ce-popover-item--hidden{display:none}@media (hover: hover){.ce-popover-item:hover{cursor:pointer}.ce-popover-item:hover:not(.ce-popover-item--no-hover){background-color:var(--color-background-item-hover)}.ce-popover-item:hover .ce-popover-item__icon{-webkit-box-shadow:none;box-shadow:none}}.ce-popover-item--confirmation{background:var(--color-background-item-confirm)}.ce-popover-item--confirmation .ce-popover-item__icon{color:var(--color-background-item-confirm)}.ce-popover-item--confirmation .ce-popover-item__title{color:#fff}@media (hover: hover){.ce-popover-item--confirmation:not(.ce-popover-item--no-hover):hover{background:var(--color-background-item-confirm-hover)}}.ce-popover-item--confirmation:not(.ce-popover-item--no-focus).ce-popover-item--focused{background:var(--color-background-item-confirm-hover)!important}.ce-popover-item--confirmation .ce-popover-item__icon,.ce-popover-item--active .ce-popover-item__icon,.ce-popover-item--focused .ce-popover-item__icon{-webkit-box-shadow:none;box-shadow:none}@-webkit-keyframes panelShowing{0%{opacity:0;-webkit-transform:translateY(-8px) scale(.9);transform:translateY(-8px) scale(.9)}70%{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes panelShowing{0%{opacity:0;-webkit-transform:translateY(-8px) scale(.9);transform:translateY(-8px) scale(.9)}70%{opacity:1;-webkit-transform:translateY(2px);transform:translateY(2px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@-webkit-keyframes panelShowingMobile{0%{opacity:0;-webkit-transform:translateY(14px) scale(.98);transform:translateY(14px) scale(.98)}70%{opacity:1;-webkit-transform:translateY(-4px);transform:translateY(-4px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes panelShowingMobile{0%{opacity:0;-webkit-transform:translateY(14px) scale(.98);transform:translateY(14px) scale(.98)}70%{opacity:1;-webkit-transform:translateY(-4px);transform:translateY(-4px)}to{-webkit-transform:translateY(0);transform:translateY(0)}}.wobble{-webkit-animation-name:wobble;animation-name:wobble;-webkit-animation-duration:.4s;animation-duration:.4s}@-webkit-keyframes wobble{0%{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}15%{-webkit-transform:translate3d(-9%,0,0);transform:translate3d(-9%,0,0)}30%{-webkit-transform:translate3d(9%,0,0);transform:translate3d(9%,0,0)}45%{-webkit-transform:translate3d(-4%,0,0);transform:translate3d(-4%,0,0)}60%{-webkit-transform:translate3d(4%,0,0);transform:translate3d(4%,0,0)}75%{-webkit-transform:translate3d(-1%,0,0);transform:translate3d(-1%,0,0)}to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}@keyframes wobble{0%{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}15%{-webkit-transform:translate3d(-9%,0,0);transform:translate3d(-9%,0,0)}30%{-webkit-transform:translate3d(9%,0,0);transform:translate3d(9%,0,0)}45%{-webkit-transform:translate3d(-4%,0,0);transform:translate3d(-4%,0,0)}60%{-webkit-transform:translate3d(4%,0,0);transform:translate3d(4%,0,0)}75%{-webkit-transform:translate3d(-1%,0,0);transform:translate3d(-1%,0,0)}to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}}\n'
11.toString()});this.config.style&&!_(this.config.style)&&this.config.style.nonce&&o.setAttribute("nonce",this.config.style.nonce),j.prepend(document.head,o)}enableModuleBindings(){this.readOnlyMutableListeners.on(this.nodes.redactor,"click",e=>{this.redactorClicked(e)},!1),this.readOnlyMutableListeners.on(this.nodes.redactor,"mousedown",e=>{this.documentTouched(e)},{capture:!0,passive:!0}),this.readOnlyMutableListeners.on(this.nodes.redactor,"touchstart",e=>{this.documentTouched(e)},{capture:!0,passive:!0}),this.readOnlyMutableListeners.on(document,"keydown",e=>{this.documentKeydown(e)},!0),this.readOnlyMutableListeners.on(document,"mousedown",e=>{this.documentClicked(e)},!0);let e=N(()=>{this.selectionChanged()},180);this.readOnlyMutableListeners.on(document,"selectionchange",e,!0),this.readOnlyMutableListeners.on(window,"resize",()=>{this.resizeDebouncer()},{passive:!0}),this.watchBlockHoveredEvents()}watchBlockHoveredEvents(){let e;this.readOnlyMutableListeners.on(this.nodes.redactor,"mousemove",D(o=>{let i=o.target.closest(".ce-block");this.Editor.BlockSelection.anyBlockSelected||i&&e!==i&&(e=i,this.eventsDispatcher.emit(e2,{block:this.Editor.BlockManager.getBlockByChildNode(i)}))},20),{passive:!0})}disableModuleBindings(){this.readOnlyMutableListeners.clearAll()}windowResize(){this.contentRectCache=null,this.checkIsMobile()}documentKeydown(e){switch(e.keyCode){case v.ENTER:this.enterPressed(e);break;case v.BACKSPACE:case v.DELETE:this.backspacePressed(e);break;case v.ESC:this.escapePressed(e);break;default:this.defaultBehaviour(e)}}defaultBehaviour(e){let{currentBlock:o}=this.Editor.BlockManager,i=e.target.closest(".".concat(this.CSS.editorWrapper)),n=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;if(void 0!==o&&null===i){this.Editor.BlockEvents.keydown(e);return}i||o&&n||(this.Editor.BlockManager.dropPointer(),this.Editor.Toolbar.close())}backspacePressed(e){let{BlockManager:o,BlockSelection:i,Caret:n}=this.Editor;if(i.anyBlockSelected&&!G.isSelectionExists){let r=o.removeSelectedBlocks(),l=o.insertDefaultBlockAtIndex(r,!0);n.setToBlock(l,n.positions.START),i.clearSelection(e),e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()}}escapePressed(e){this.Editor.BlockSelection.clearSelection(e),this.Editor.Toolbar.toolbox.opened?(this.Editor.Toolbar.toolbox.close(),this.Editor.Caret.setToBlock(this.Editor.BlockManager.currentBlock,this.Editor.Caret.positions.END)):this.Editor.BlockSettings.opened?this.Editor.BlockSettings.close():this.Editor.ConversionToolbar.opened?this.Editor.ConversionToolbar.close():this.Editor.InlineToolbar.opened?this.Editor.InlineToolbar.close():this.Editor.Toolbar.close()}enterPressed(e){let{BlockManager:o,BlockSelection:i}=this.Editor,n=o.currentBlockIndex>=0;if(i.anyBlockSelected&&!G.isSelectionExists){i.clearSelection(e),e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation();return}if(!this.someToolbarOpened&&n&&"BODY"===e.target.tagName){let e=this.Editor.BlockManager.insert();this.Editor.Caret.setToBlock(e),this.Editor.Toolbar.moveAndOpen(e)}this.Editor.BlockSelection.clearSelection(e)}documentClicked(e){var o,i;if(!e.isTrusted)return;let n=e.target;this.nodes.holder.contains(n)||G.isAtEditor||(this.Editor.BlockManager.dropPointer(),this.Editor.Toolbar.close());let r=null==(o=this.Editor.BlockSettings.nodes.wrapper)?void 0:o.contains(n),l=null==(i=this.Editor.Toolbar.nodes.settingsToggler)?void 0:i.contains(n);if(this.Editor.BlockSettings.opened&&!(r||l)){this.Editor.BlockSettings.close();let e=this.Editor.BlockManager.getBlockByChildNode(n);
11this.Editor.Toolbar.moveAndOpen(e)}this.Editor.BlockSelection.clearSelection(e)}documentTouched(e){let o=e.target;if(o===this.nodes.redactor){let i=e instanceof MouseEvent?e.clientX:e.touches[0].clientX,n=e instanceof MouseEvent?e.clientY:e.touches[0].clientY;o=document.elementFromPoint(i,n)}try{this.Editor.BlockManager.setCurrentBlockByChildNode(o)}catch(e){this.Editor.RectangleSelection.isRectActivated()||this.Editor.Caret.setToTheLastBlock()}this.Editor.Toolbar.moveAndOpen()}redactorClicked(e){if(!G.isCollapsed)return;let o=e.target,i=e.metaKey||e.ctrlKey;if(j.isAnchor(o)&&i){var n;e.stopImmediatePropagation(),e.stopPropagation(),n=function(e){try{return new URL(e).href}catch(e){}return"//"===e.substring(0,2)?window.location.protocol+e:window.location.origin+e}(o.getAttribute("href")),window.open(n,"_blank");return}this.processBottomZoneClick(e)}processBottomZoneClick(e){let o=this.Editor.BlockManager.getBlockByIndex(-1),i=j.offset(o.holder).bottom,n=e.pageY,{BlockSelection:r}=this.Editor;if(e.target instanceof Element&&e.target.isEqualNode(this.nodes.redactor)&&!r.anyBlockSelected&&i<n){e.stopImmediatePropagation(),e.stopPropagation();
11let{BlockManager:o,Caret:i,Toolbar:n}=this.Editor;o.lastBlock.tool.isDefault&&o.lastBlock.isEmpty||o.insertAtEnd(),i.setToTheLastBlock(),n.moveAndOpen(o.lastBlock)}}selectionChanged(){let{CrossBlockSelection:e,BlockSelection:o}=this.Editor,i=G.anchorElement;if(e.isCrossBlockSelectionStarted&&o.anyBlockSelected&&G.get().removeAllRanges(),!i){G.range||this.Editor.InlineToolbar.close();return}let n=null===i.closest(".".concat(ei.CSS.content));n&&(this.Editor.InlineToolbar.containsNode(i)||this.Editor.InlineToolbar.close(),"true"!==i.dataset.inlineToolbar)||(this.Editor.BlockManager.currentBlock||this.Editor.BlockManager.setCurrentBlockByChildNode(i),this.Editor.InlineToolbar.tryToShow(!0,!0!==n))}constructor(){super(...arguments),this.isMobile=!1,this.contentRectCache=void 0,this.resizeDebouncer=N(()=>{this.windowResize()},200)}}let tz={BlocksAPI:en,CaretAPI:es,EventsAPI:er,I18nAPI:el,API:ea,InlineToolbarAPI:ec,ListenersAPI:ed,NotifierAPI:eg,ReadOnlyAPI:ef,SanitizerAPI:ex,SaverAPI:ew,SelectionAPI:ey,StylesAPI:eE,ToolbarAPI:eC,TooltipAPI:eA,UiAPI:eL,BlockSettings:eK,ConversionToolbar:eX,Toolbar:e3,InlineToolbar:to,BlockEvents:ti,BlockManager:tc,BlockSelection:td,Caret:th,CrossBlockSelection:tp,DragNDrop:tu,ModificationsObserver:tg,Paste:tf,ReadOnly:tm,RectangleSelection:tb,Renderer:tk,Saver:tv,Tools:tF,UI:tH};class tU{set configuration(e){var o,i,n;B(e)?this.config={...e}:this.config={holder:e},F(!!this.config.holderId,"config.holderId","config.holder"),this.config.holderId&&!this.config.holder&&(this.config.holder=this.config.holderId,this.config.holderId=null),null==this.config.holder&&(this.config.holder="editorjs"),this.config.logLevel||(this.config.logLevel=k.VERBOSE),n=this.config.logLevel,x.logLevel=n,F(!!this.config.initialBlock,"config.initialBlock","config.defaultBlock"),this.config.defaultBlock=this.config.defaultBlock||this.config.initialBlock||"paragraph",this.config.minHeight=void 0!==this.config.minHeight?this.config.minHeight:300;let r={type:this.config.defaultBlock,data:{}};this.config.placeholder=this.config.placeholder||!1,this.config.sanitizer=this.config.sanitizer||{p:!0,b:!0,a:!0},this.config.hideToolbar=!!this.config.hideToolbar&&this.config.hideToolbar,this.config.tools=this.config.tools||{},this.config.i18n=this.config.i18n||{},this.config.data=this.config.data||{blocks:[]},this.config.onReady=this.config.onReady||(()=>{}),this.config.onChange=this.config.onChange||(()=>{}),this.config.inlineToolbar=void 0===this.config.inlineToolbar||this.config.inlineToolbar,(_(this.config.data)||!this.config.data.blocks||0===this.config.data.blocks.length)&&(this.config.data={blocks:[r]}),this.config.readOnly=this.config.readOnly||!1,null!=(o=this.config.i18n)&&o.messages&&W.setDictionary(this.config.i18n.messages),this.config.i18n.direction=(null==(i=this.config.i18n)?void 0:i.direction)||"ltr"}get configuration(){return this.config}validate(){let{holderId:e,holder:o}=this.config;if(e&&o)throw Error("\xabholderId\xbb and \xabholder\xbb param can't assign at the same time.");if(S(o)&&!j.get(o))throw Error("element with ID \xab".concat(o,"\xbb is missing. Pass correct holder's ID."));if(o&&B(o)&&!j.isElement(o))throw Error("\xabholder\xbb value must be an Element node")}init(){this.constructModules(),this.configureModules()}async start(){await ["Tools","UI","BlockManager","Paste","BlockSelection","RectangleSelection","CrossBlockSelection","ReadOnly"].reduce((e,o)=>e.then(async()=>{try{await this.moduleInstances[o].prepare()}catch(e){if(e instanceof K)throw Error(e.message);w("Module ".concat(o," was skipped because of %o"),"warn",e)}}),Promise.resolve())}render(){return this.moduleInstances.Renderer.render(this.config.data.blocks)}constructModules(){Object.entries(tz).forEach(e=>{let[o,i]=e;try{this.moduleInstances[o]=new i({config:this.configuration,eventsDispatcher:this.eventsDispatcher})}catch(e){w("[constructModules]","Module ".concat(o," skipped because"),"error",e)}})}configureModules(){for(let e in this.moduleInstances)Object.prototype.hasOwnProperty.call(this.moduleInstances,e)&&(this.moduleInstances[e].state=this.getModulesDiff(e))}getModulesDiff(e){let o={};for(let i in this.moduleInstances)i!==e&&(o[i]=this.moduleInstances[i]);return o}constructor(e){let o,i;this.moduleInstances={}
11,this.eventsDispatcher=new X,this.isReady=new Promise((e,n)=>{o=e,i=n}),Promise.resolve().then(async()=>{this.configuration=e,this.validate(),this.init(),await this.start(),await this.render();let{BlockManager:i,Caret:n,UI:r,ModificationsObserver:l}=this.moduleInstances;r.checkEmptiness(),l.enable(),this.configuration.autofocus&&n.setToBlock(i.blocks[0],n.positions.START),o()}).catch(e=>{w("Editor.js is not ready because of ".concat(e),"error"),i(e)})}}/**
12 * Editor.js
13 *
14 * @license Apache-2.0
15 * @see Editor.js <https://editorjs.io>
16 * @author CodeX Team <https://codex.so>
17 */class tj{static get version(){return"2.29.1"}exportAPI(e){["configuration"].forEach(o=>{this[o]=e[o]}),this.destroy=()=>{for(let o in Object.values(e.moduleInstances).forEach(e=>{C(e.destroy)&&e.destroy(),e.listeners.removeAll()}),null==eT||eT.destroy(),eT=null,e=null,this)Object.prototype.hasOwnProperty.call(this,o)&&delete this[o];Object.setPrototypeOf(this,null)},Object.setPrototypeOf(this,e.moduleInstances.API.methods),delete this.exportAPI,Object.entries({blocks:{clear:"clear",render:"render"},caret:{focus:"focus"},events:{on:"on",off:"off",emit:"emit"},saver:{save:"save"}}).forEach(o=>{let[i,n]=o;Object.entries(n).forEach(o=>{let[n,r]=o;this[r]=e.moduleInstances.API.methods[i][n]})})}constructor(e){let o=()=>{};B(e)&&C(e.onReady)&&(o=e.onReady);let i=new tU(e);this.isReady=i.isReady.then(()=>{this.exportAPI(i),o()})}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.