diff --git a/README.md b/README.md index 9c5b87836..4411d3cec 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ Pure javscript based WYSIWYG web editor, with no dependencies > The Suneditor is a lightweight, flexible, customizable WYSIWYG text editor for your web applications. > - Pasting from Microsoft Word and Excel. > - Custom table selection, merge and split. -> - Media embeds, image uploads. -> - Can use CodeMirror. +> - Media embed, images upload. +> - Can use CodeMirror, KaTeX. > - And.. many other features :) -![WYSIWYG HTML Editor](http://suneditor.com/docs/screen-main-w.png?v=2301) +![WYSIWYG HTML Editor](http://suneditor.com/docs/screen-main-w.png?v=2700) ## Table of contents - [Browser Support](#browser-support) @@ -30,15 +30,11 @@ Pure javscript based WYSIWYG web editor, with no dependencies - [Plugins can be used directly in the button list](#3-plugins-can-be-used-directly-in-the-button-list) - [Init function](#init-function) - [Use CodeMirror](#use-codemirror) +- [Use KaTeX (math plugin)](#use-katex-math-plugin) - [Options](#options) - [Functions](#functions) - [Plugins list](#plugins-list) - [Examples](#examples) - - [Defining menu items](#defining-menu-items) - - [Char count, Button groups](#char-count-button-groups) - - [Iframe, fullPage and use CodeMirror](#iframe-fullpage-and-use-codemirror) - - [Image management](#image-management) - - [User Functions](#user-functions) - [Options template](#options-template) - [Custom plugins](#custom-plugins) - [Document](#document) @@ -143,14 +139,14 @@ suneditor.create('sample', { buttonList: [ ['undo', 'redo'], ['font', 'fontSize', 'formatBlock'], - ['paragraphStyle'], + ['paragraphStyle', 'blockquote'], ['bold', 'underline', 'italic', 'strike', 'subscript', 'superscript'], ['fontColor', 'hiliteColor', 'textStyle'], ['removeFormat'], '/', // Line break ['outdent', 'indent'], ['align', 'horizontalRule', 'list', 'lineHeight'], - ['table', 'link', 'image', 'video'], + ['table', 'link', 'image', 'video', /** 'math' */], // You must add the 'katex' library at options to use the 'math' plugin. ['fullScreen', 'showBlocks', 'codeView'], ['preview', 'print'], ['save', 'template'] @@ -171,16 +167,14 @@ suneditor.create('sample', { ```javascript import 'suneditor/dist/css/suneditor.min.css' import suneditor from 'suneditor' -import {align, font, fontSize, fontColor, hiliteColor, horizontalRule, list, lineHeight, - table, template, formatBlock, paragraphStyle, textStyle, link, image, video} from 'suneditor/src/plugins' +import {align, font, fontSize, fontColor, hiliteColor, + horizontalRule, image, template} from 'suneditor/src/plugins' suneditor.create('sample', { buttonList: [ ['undo', 'redo', 'removeFormat'], - [font, fontSize, formatBlock], - [paragraphStyle, textStyle, fontColor, hiliteColor], - [align, horizontalRule, list, lineHeight], - [table, link, image, video, template] + [align, font, fontSize, fontColor, hiliteColor], + [horizontalRule, image, template] ], }) ``` @@ -202,13 +196,13 @@ const initEditor = suneditor.init({ buttonList: [ ['undo', 'redo', 'font', 'fontSize', 'formatBlock', - 'paragraphStyle', + 'paragraphStyle', 'blockquote', 'bold', 'underline', 'italic', 'strike', 'subscript', 'superscript', 'fontColor', 'hiliteColor', 'textStyle', 'removeFormat', 'outdent', 'indent', 'align', 'horizontalRule', 'list', 'lineHeight', - 'table', 'link', 'image', 'video', + 'table', 'link', 'image', 'video', /** 'math' */, // You must add the 'katex' library at options to use the 'math' plugin. 'fullScreen', 'showBlocks', 'codeView', 'preview', 'print', 'save', 'template'] ] @@ -231,8 +225,9 @@ initEditor.create('sample_2', { ## Use CodeMirror ```html + - + @@ -248,7 +243,7 @@ import 'codemirror/mode/htmlmixed/htmlmixed' import 'codemirror/lib/codemirror.css' suneditor.create('sample', { - codeMirror: CodeMirror, + codeMirror: CodeMirror // window.CodeMirror, // Set options // codeMirror: { // src: CodeMirror, @@ -261,9 +256,38 @@ suneditor.create('sample', { }); ``` +## Use KaTeX (math plugin) +```html + + + + +``` +```javascript +import 'suneditor/dist/css/suneditor.min.css' +import suneditor from 'suneditor' +// Import katex +import katex from 'katex' +import 'katex/dist/katex.min.css' + +suneditor.create('sample', { + katex: katex // window.katex, + // Set options + // katex: { + // src: katex, + // options: {...} + // } + buttonList: [ + ['math'] + ] +}); +``` + ## Options ```java plugins: [ + // command + blockquote, // Submenu align, font, @@ -281,12 +305,28 @@ plugins: [ // Dialog image, link, - video + video, + math // You must add the 'katex' library at options to use the 'math' plugin. ] : Plugins array. default: null {Array} +// Whitelist--------------------------------------å--------------------------------------------------------- +// _defaultTagsWhitelist : 'br|p|div|pre|blockquote|h[1-6]|ol|ul|li|hr|figure|figcaption|img|iframe|audio|video|table|thead|tbody|tr|th|td|a|b|strong|var|i|em|u|ins|s|span|strike|del|sub|sup' +addTagsWhitelist : Add tags to the default tags whitelist of editor. default: '' {String} + ex) 'mark|canvas|label|select|option|input' +// _editorTagsWhitelist : _defaultTagsWhitelist + addTagsWhitelist +pasteTagsWhitelist : Whitelist of tags when pasting. default: _editorTagsWhitelist {String} + ex) 'p|h[1-6]' +attributesWhitelist : Add attributes whitelist of tags that should be kept undeleted from the editor. + // -- Fixed whitelist -- + // Native attributes: 'contenteditable|colspan|rowspan|target|href|src|class|type' + // Editor attributes: 'data-format|data-size|data-file-size|data-file-name|data-origin|data-align|data-image-link|data-rotate|data-proportion|data-percentage|origin-size' + ex) { + 'all': 'style', // Apply to all tags + 'input': 'checked' // Apply to input tag + } // Layout------------------------------------------------------------------------------------------------------- lang : language object. default : en {Object} -mode : The mode of the editor ('classic', 'inline', 'balloon'). default: 'classic' {String} +mode : The mode of the editor ('classic', 'inline', 'balloon', 'balloon-always'). default: 'classic' {String} toolbarWidth : The width of the toolbar. Applies only when the editor mode is 'inline' or 'balloon' mode. default: 'auto' {Number|String} stickyToolbar : Reference height value that should be changed to sticky toolbar mode. @@ -300,7 +340,7 @@ iframeCSSFileName : Name or Array of the CSS file to apply inside the iframe. or put the URL value. default: 'suneditor' {Array|String} ex) 'main' or ['suneditor', 'http://suneditor.com/sample/css/sample.css'] codeMirror : If you put the CodeMirror object as an option, you can do Codeview using CodeMirror. default: null {Object} - Use version 5.0.0 or later. + Use version 5.x.x // https://github.com/codemirror/CodeMirror ex) codeMirror: CodeMirror // Default option codeMirror: { // Custom option src: CodeMirror, @@ -313,6 +353,17 @@ codeMirror : If you put the CodeMirror object as an option, you can do Code */ } } +katex : Required library for math plugins. default: null {Object} + Use version 0.x.x // https://github.com/KaTeX/KaTeX + ex) katex: katex // Default option + katex: { // Custom option + src: katex, + options: { + /** default options ** + * throwOnError: false, + */ + } + } // Display------------------------------------------------------------------------------------------------------- position : The position property of suneditor. default: null {String} @@ -355,12 +406,14 @@ fontSizeUnit : The font size unit. default: 'px formats : Change default formatBlock array. default: [...] {Array} Default value: [ 'p', 'div', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' + // "blockquote": range format, "pre": free format, "Other tags": replace format ], Custom: [{ tag: 'div', // Tag name name: 'Custom div' || null, // default: tag name - command: 'replace' || 'range', // default: "replace" - class: '__se__format__xxx' || null, // Class names must always begin with "__se__format__" + command: 'replace' || 'range' || 'free', // default: "replace" + class: '__se__format__replace_xxx' || '__se__format__range_xxx' || '__se__format__free_xxx' + // Class names must always begin with "__se__format__(replace, range, free)_" }] colorList : Change default color array of color picker. default: [..[..]..] {Array} Default value: [ @@ -450,8 +503,12 @@ imageUrlInput : Choose whether to create a image url input tag in the image up imageUploadHeader : Http Header when uploading images. default: null {Object} imageUploadUrl : The image upload to server mapping address. default: null {String} ex) "/editor/uploadImage.ajax" + request format: { + "file-0": {}, + "file-1": {} + } When not used, it enters base64 data - return { + response format: { "errorMessage": "insert error message", "result": [ { @@ -516,13 +573,13 @@ buttonList : Defines button list to array {Array} default: [ ['undo', 'redo'], // ['font', 'fontSize', 'formatBlock'], - // ['paragraphStyle'], + // ['paragraphStyle', 'blockquote'], ['bold', 'underline', 'italic', 'strike', 'subscript', 'superscript'], // ['fontColor', 'hiliteColor', 'textStyle'], ['removeFormat'], ['outdent', 'indent'], // ['align', 'horizontalRule', 'list', 'lineHeight'], - // ['table', 'link', 'image', 'video'], + // ['table', 'link', 'image', 'video', 'math'], ['fullScreen', 'showBlocks', 'codeView'], ['preview', 'print'], // ['save', 'template'], @@ -621,23 +678,30 @@ editor.toolbar.show(); // Event functions ------------------------------------------------------------------------------------- // It can be redefined by receiving event object as parameter. // It is not called in exceptional cases and is called after the default event function has finished. -editor.onScroll = function (e) { console.log('onScroll', e) } +// e: event object, core: Core object +editor.onScroll = function (e, core) { console.log('onScroll', e) } + +editor.onMouseDown = function (e, core) { console.log('onMouseDown', e) } + +editor.onClick = function (e, core) { console.log('onClick', e) } -editor.onClick = function (e) { console.log('onClick', e) } +editor.onKeyDown = function (e, core) { console.log('onKeyDown', e) } -editor.onKeyDown = function (e) { console.log('onKeyDown', e) } +editor.onKeyUp = function (e, core) { console.log('onKeyUp', e) } -editor.onKeyUp = function (e) { console.log('onKeyUp', e) } +editor.onDrop = function (e, core) { console.log('onDrop', e) } -editor.onDrop = function (e) { console.log('onDrop', e) } +editor.onChange = function (contents, core) { console.log('onChange', contents) } -editor.onChange = function (contents) { console.log('onChange', contents) } +editor.onFocus = function (e, core) { console.log('onFocus', e) } + +editor.onBlur = function (e, core) { console.log('onBlur', e) } // onload event // When reloaded with the "setOptions" method, the value of the "reload" argument is true. editor.onload = function (core, reload) { console.log('onload-core', core) - console.log('onload-reload', reload) + console.log('onload-reload', reload) } // Paste event. @@ -646,8 +710,23 @@ editor.onload = function (core, reload) { /** * cleanData : HTML string modified for editor format * maxCharCount : maxChartCount option (true if max character is exceeded) + * core: Core object */ -editor.onPaste = function (e, cleanData, maxCharCount) { console.log('onPaste', e, cleanData, maxCharCount) } +editor.onPaste = function (e, cleanData, maxCharCount, core) { console.log('onPaste', e) } + +// Called before the image is uploaded +// If false is returned, no image upload is performed. +/** + * files: Files array + * info: Input information + * core: Core object + * return {Boolean} + */ +editor.onImageUploadBefore: function (files, info, core) { + console.log('files', files); + console.log('info', info); + return Boolean +} // Called when the image is uploaded or the uploaded image is deleted. /** @@ -655,15 +734,16 @@ editor.onPaste = function (e, cleanData, maxCharCount) { console.log('onPaste', * index: Uploaded index (key value) * state: Upload status ('create', 'update', 'delete') * imageInfo: { - * * index: data index - * * name: file name - * * size: file size - * * select: select function - * * delete: delete function + * - index: data index + * - name: file name + * - size: file size + * - select: select function + * - delete: delete function * } * remainingFilesCount: Count of remaining image files + * core: Core object */ -editor.onImageUpload = function (targetImgElement, index, state, imageInfo, remainingFilesCount) { +editor.onImageUpload = function (targetImgElement, index, state, imageInfo, remainingFilesCount, core) { console.log(`targetImgElement:${targetImgElement}, index:${index}, state('create', 'update', 'delete'):${state}`) console.log(`imageInfo:${imageInfo}, remainingFilesCount:${remainingFilesCount}`) } @@ -673,16 +753,71 @@ editor.onImageUpload = function (targetImgElement, index, state, imageInfo, rema /** * errorMessage: Error message to show * result: Result object + * core: Core object + * return {Boolean} */ -editor.onImageUploadError = function (errorMessage, result) { +editor.onImageUploadError = function (errorMessage, result, core) { alert(errorMessage) + return Boolean +} + +// It replaces the default callback function of the image upload +/** + * response: Response object + * info (Input information): { + * - linkValue: Link url value + * - linkNewWindow: Open in new window Check Value + * - inputWidth: Value of width input + * - inputHeight: Value of height input + * - align: Align Check Value + * - isUpdate: Update image if true, create image if false + * - currentImage: If isUpdate is true, the currently selected image. + * } + * core: Core object + */ +editor.imageUploadHandler = function (response, info, core) { + // Example of upload method + const res = JSON.parse(response.responseText); + + // Error + if (res.errorMessage) { + if (typeof editor.onImageUploadError === 'function') { + if (core.onImageUploadError(res.errorMessage, res.result)) { + core.notice.open.call(core, res.errorMessage); + } + } else { + core.notice.open.call(core, res.errorMessage); + } + /** + * You can do the same thing using the core private function. + * The core._imageUploadError function returns false when "editor.onImageUploadError" function is not defined. + */ + // if (core._imageUploadError(res.errorMessage, res.result)) { + // core.notice.open.call(core, res.errorMessage); + // } + } + // Success + else { + const fileList = res.result; + const imagePlugin = core.plugins.image; + + for (let i = 0, len = fileList.length, file; i < len; i++) { + // The file object must have name and size attributes. + file = {name: fileList[i].name, size: fileList[i].size}; + // For existing image updates, the "info" attributes are predefined in the element. + // The "imagePlugin.update_src" function is only changes the "src" attribute of an image. + if (info.isUpdate) imagePlugin.update_src.call(core, fileList[i].url, info.currentImage, file); + // The image is created and a format element(p, div..) is added below it. + else imagePlugin.create_image.call(core, fileList[i].url, info.linkValue, info.linkNewWindow, info.inputWidth, info.inputHeight, info.align, file); + } + } } /** * toolbar: Toolbar Element * context: The editor's context object (editor.getContext()) */ -editor.showInline = function (toolbar, context) { +editor.showInline = function (toolbar, context, core) { console.log('toolbar', toolbar); console.log('context', context); } @@ -699,9 +834,13 @@ editor.showInline = function (toolbar, context) { + + blockquote + command + image - dialog + dialog link @@ -709,6 +848,9 @@ editor.showInline = function (toolbar, context) { video + + math + align submenu @@ -753,15 +895,7 @@ editor.showInline = function (toolbar, context) { ## Examples - [Defining menu items](http://suneditor.com/sample/html/examples.html#setting) - - [Char count, Button groups](http://suneditor.com/sample/html/examples.html#groups) - - [Iframe, fullPage and use CodeMirror](http://suneditor.com/sample/html/examples.html#CodeMirror) - - [Image management](http://suneditor.com/sample/html/examples.html#image) - - [User Functions](http://suneditor.com/sample/html/examples.html#functions) +[Examples](http://suneditor.com/sample/html/examples.html) ## Options template [Options template](http://suneditor.com/sample/html/options.html) diff --git a/dist/css/suneditor.min.css b/dist/css/suneditor.min.css index 5e5cd6d9f..a01df1e0b 100644 --- a/dist/css/suneditor.min.css +++ b/dist/css/suneditor.min.css @@ -1 +1 @@ -.sun-editor{width:auto;height:auto;box-sizing:border-box;font-family:Helvetica Neue,sans-serif;border:1px solid #dadada;text-align:left;background-color:#fff;color:#000;user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none}.sun-editor *{box-sizing:border-box;-webkit-user-drag:none;overflow:visible}.sun-editor-common button,.sun-editor-common input,.sun-editor-common select,.sun-editor-common textarea{font-size:14px;line-height:1.5}.sun-editor-common blockquote,.sun-editor-common body,.sun-editor-common button,.sun-editor-common code,.sun-editor-common dd,.sun-editor-common div,.sun-editor-common dl,.sun-editor-common dt,.sun-editor-common fieldset,.sun-editor-common form,.sun-editor-common h1,.sun-editor-common h2,.sun-editor-common h3,.sun-editor-common h4,.sun-editor-common h5,.sun-editor-common h6,.sun-editor-common input,.sun-editor-common legend,.sun-editor-common li,.sun-editor-common ol,.sun-editor-common p,.sun-editor-common pre,.sun-editor-common select,.sun-editor-common td,.sun-editor-common textarea,.sun-editor-common th,.sun-editor-common ul{margin:0;padding:0;border:0}.sun-editor-common dl,.sun-editor-common li,.sun-editor-common menu,.sun-editor-common ol,.sun-editor-common ul{list-style:none!important}.sun-editor-common hr{margin:6px 0!important}.sun-editor textarea{resize:none!important;border:0!important}.sun-editor button{border:0;background-color:transparent;touch-action:manipulation;cursor:pointer;outline:none}.sun-editor button,.sun-editor input,.sun-editor select,.sun-editor textarea{vertical-align:middle}.sun-editor button span{display:block;margin:0;padding:0}.sun-editor button .txt{display:block;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@font-face{font-family:Suneditor-icon;src:url(../fonts/435801d088c67acdd4c667e00037f080.eot);src:url(../fonts/435801d088c67acdd4c667e00037f080.eot?#iefix) format("embedded-opentype"),url(../fonts/54469d382ec66ca4460d57a5f4a49b05.woff2) format("woff2"),url(../fonts/1d63e86b832ddfc4008baf6e69e7c39b.woff) format("woff"),url(../fonts/773c0f21a6a926b07f111a3892134dec.ttf) format("truetype"),url(../fonts/0b8f27509021ddc0f7d4ee103181bc05.svg#Suneditor-icon) format("svg");font-weight:400;font-style:normal}.sun-editor [class*=se-icon-]:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Suneditor-icon;display:inline-block;font-style:normal;font-variant:normal;font-weight:400;text-rendering:auto;font-size:15px}.sun-editor .se-toolbar [class*=se-icon-]:before{line-height:2.1}.sun-editor .se-icon-align-justify:before{content:"A"}.sun-editor .se-icon-align-left:before{content:"B"}.sun-editor .se-icon-align-right:before{content:"C"}.sun-editor .se-icon-align-center:before{content:"D"}.sun-editor .se-icon-underline:before{content:"E"}.sun-editor .se-icon-bold:before{content:"F"}.sun-editor .se-icon-italic:before{content:"G"}.sun-editor .se-icon-strokethrough:before{content:"H"}.sun-editor .se-icon-subscript:before{content:"I"}.sun-editor .se-icon-superscript:before{content:"J"}.sun-editor .se-icon-redo:before{content:"K"}.sun-editor .se-icon-undo:before{content:"L"}.sun-editor .se-icon-erase:before{content:"M"}.sun-editor .se-icon-fontColor:before{content:"N"}.sun-editor .se-icon-hiliteColor:before{content:"O"}.sun-editor .se-icon-indent-left:before{content:"P"}.sun-editor .se-icon-indent-right:before{content:"Q"}.sun-editor .se-icon-list-bullets:before{content:"R"}.sun-editor .se-icon-list-number:before{content:"S"}.sun-editor .se-icon-grid:before{content:"T"}.sun-editor .se-icon-code-view:before{content:"U"}.sun-editor .se-icon-preview:before{content:"V"}.sun-editor .se-icon-showBlocks:before{content:"W"}.sun-editor .se-icon-expansion:before{content:"X"}.sun-editor .se-icon-reduction:before{content:"Y"}.sun-editor .se-icon-image:before{content:"Z"}.sun-editor .se-icon-link:before{content:"a"}.sun-editor .se-icon-auto-size:before{content:"b"}.sun-editor .se-icon-print:before{content:"c"}.sun-editor .se-icon-modify:before{content:"d"}.sun-editor .se-icon-revert:before{content:"e"}.sun-editor .se-icon-arrow-down:before{content:"f";font-size:10px}.sun-editor .se-icon-video:before{content:"g"}.sun-editor .se-icon-cancel:before{content:"h";font-size:10px}.sun-editor .se-icon-warning:before{content:"i"}.sun-editor .se-icon-insert-column-right:before{content:"j"}.sun-editor .se-icon-insert-row-below:before{content:"k"}.sun-editor .se-icon-insert-row-above:before{content:"l"}.sun-editor .se-icon-insert-column-left:before{content:"m"}.sun-editor .se-icon-delete-row:before{content:"n"}.sun-editor .se-icon-delete-column:before{content:"o"}.sun-editor .se-icon-unlink:before{content:"p"}.sun-editor .se-icon-empty-file:before{content:"q"}.sun-editor .se-icon-paragraph-style:before{content:"r"}.sun-editor .se-icon-delete:before{content:"s"}.sun-editor .se-icon-rotate-left:before{content:"t"}.sun-editor .se-icon-rotate-right:before{content:"u"}.sun-editor .se-icon-mirror-horizontal:before{content:"v"}.sun-editor .se-icon-mirror-vertical:before{content:"w"}.sun-editor .se-icon-save:before{content:"x"}.sun-editor .se-icon-hr:before{content:"y"}.sun-editor .se-icon-checked:before{content:"z"}.sun-editor .se-icon-table-header:before{content:"0"}.sun-editor .se-icon-merge-cell:before{content:"1"}.sun-editor .se-icon-split-cell:before{content:"2"}.sun-editor .se-icon-caption:before{content:"3"}.sun-editor .se-icon-edit:before{content:"4"}.sun-editor .se-icon-question:before{content:"5"}.sun-editor .se-icon-attachment:before{content:"6"}.sun-editor .se-icon-add:before{content:"7"}.sun-editor .se-icon-more-vertical:before{content:"8"}.sun-editor .se-icon-more-horizontal:before{content:"9"}.sun-editor .se-icon-map-pin:before{content:"!"}.sun-editor .se-icon-magic-stick:before{content:'"'}.sun-editor .se-icon-math:before{content:"#"}.sun-editor .se-icon-audio:before{content:"$"}.sun-editor .se-icon-emoji:before{content:"%"}.sun-editor .se-icon-template:before{content:"&"}.sun-editor .se-icon-line-height:before{content:"'"}.sun-editor .se-icon-text-style:before{content:"("}.sun-editor .se-arrow,.sun-editor .se-arrow:after{position:absolute;display:block;width:0;height:0;border:11px solid transparent}.sun-editor .se-arrow.se-arrow-up{top:-11px;left:20px;margin-left:-11px;border-top-width:0;border-bottom-color:rgba(0,0,0,.25)}.sun-editor .se-arrow.se-arrow-up:after{top:1px;margin-left:-11px;content:" ";border-top-width:0;border-bottom-color:#fff}.sun-editor .se-toolbar .se-arrow.se-arrow-up:after{border-bottom-color:#fafafa}.sun-editor .se-arrow.se-arrow-down{top:0;left:0;margin-left:-11px;border-bottom-width:0;border-top-color:rgba(0,0,0,.25)}.sun-editor .se-arrow.se-arrow-down:after{top:-12px;margin-left:-11px;content:" ";border-bottom-width:0;border-top-color:#fff}.sun-editor .se-toolbar .se-arrow.se-arrow-down:after{border-top-color:#fafafa}.sun-editor .se-container{position:relative;width:100%;height:100%}.sun-editor button{color:#000}.sun-editor .se-btn{float:left;width:35px;height:35px;border:0;border-radius:2px;margin:1px!important;padding:0;font-size:12px;line-height:27px}.sun-editor .se-btn:enabled:focus,.sun-editor .se-btn:enabled:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn:enabled:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-btn-primary{color:#000;background-color:#c7deff;border:1px solid #80bdff;border-radius:2px}.sun-editor .se-btn-primary:focus,.sun-editor .se-btn-primary:hover{color:#000;background-color:#80bdff;border-color:#3f9dff;outline:0 none}.sun-editor .se-btn-primary:active{color:#fff;background-color:#3f9dff;border-color:#4592ff;-webkit-box-shadow:inset 0 3px 5px #4592ff;box-shadow:inset 0 3px 5px #4592ff}.sun-editor .se-btn:enabled.active{color:#4592ff;outline:0 none}.sun-editor .se-btn:enabled.active:focus,.sun-editor .se-btn:enabled.active:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn:enabled.active:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-btn:enabled.on{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn:enabled.on:focus,.sun-editor .se-btn:enabled.on:hover{background-color:#d1d1d1;border-color:#c1c1c1;outline:0 none}.sun-editor .se-btn:enabled.on:active{background-color:#c1c1c1;border-color:#b1b1b1;-webkit-box-shadow:inset 0 3px 5px #b1b1b1;box-shadow:inset 0 3px 5px #b1b1b1}.sun-editor .se-btn-list:disabled,.sun-editor .se-btn:disabled,.sun-editor :disabled [class*=se-icon-]:before{cursor:not-allowed;background-color:inherit;color:#bdbdbd}.sun-editor .se-loading-box{position:absolute;display:none;width:100%;height:100%;top:0;left:0;background-color:#fff;opacity:.7;filter:alpha(opacity=70);z-index:2147483647}.sun-editor .se-loading-box .se-loading-effect{position:absolute;display:block;top:50%;left:50%;height:25px;width:25px;border-top:2px solid #07d;border-right:2px solid transparent;border-radius:50%;animation:spinner .8s linear infinite;margin:-25px 0 0 -25px}.sun-editor .se-toolbar{display:block;position:relative;height:auto;width:100%;overflow:visible;padding:4px 3px 0;margin:0;background-color:#fafafa;outline:1px solid #dadada;z-index:5}.sun-editor .se-toolbar-cover{position:absolute;display:none;font-size:36px;width:100%;height:100%;top:0;left:0;background-color:#fefefe;opacity:.5;filter:alpha(opacity=50);cursor:not-allowed;z-index:4}.sun-editor .se-toolbar-separator-vertical{display:inline-block;height:0;width:0;margin:2px;vertical-align:top}.sun-editor .se-toolbar.se-toolbar-balloon,.sun-editor .se-toolbar.se-toolbar-inline{display:none;position:absolute;z-index:2147483647;box-shadow:0 3px 9px rgba(0,0,0,.5);-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5)}.sun-editor .se-toolbar.se-toolbar-balloon{width:auto}.sun-editor .se-toolbar.se-toolbar-sticky{position:fixed;top:0}.sun-editor .se-toolbar-sticky-dummy{display:none;position:static;z-index:-1}.sun-editor .se-btn-module{display:inline-block}.sun-editor .se-btn-module-border{border:1px solid #dadada;border-radius:2px}.sun-editor .se-btn-module-enter{display:block;width:100%;height:1px;margin-bottom:5px;background-color:transparent}.sun-editor .se-menu-list,.sun-editor .se-menu-list li{float:left;padding:0;margin:0}.sun-editor .se-menu-list li{position:relative}.sun-editor .se-btn-select{width:auto;display:flex;text-align:left;padding:4px 6px}.sun-editor .se-btn-select .txt{flex:5;float:left;text-align:left}.sun-editor .se-btn-select .se-icon-arrow-down{flex:1;float:right}.sun-editor .se-btn-select.se-btn-tool-font{width:100px}.sun-editor .se-btn-select.se-btn-tool-format,.sun-editor .se-btn-select.se-btn-tool-size{width:80px}.sun-editor .se-list-layer{display:none;position:absolute;top:37px;z-index:4;left:1px;border:1px solid #bababa;border-radius:2px;background-color:#fff;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);outline:0 none}.sun-editor .se-list-layer .se-list-inner{padding:0;margin:0;overflow-x:initial;overflow-y:initial;overflow:visible}.sun-editor .se-list-layer button{margin:0;width:100%}.sun-editor .se-list-inner .se-list-basic{width:100%;padding:0}.sun-editor .se-list-inner .se-list-basic li{width:100%}.sun-editor .se-list-inner .se-list-basic li>button{min-width:100%;width:max-content}.sun-editor .se-list-inner .se-list-basic li button.active{background-color:#80bdff;border:1px solid #3f9dff;border-left:0;border-right:0}.sun-editor .se-list-inner .se-list-basic li button.active:active{background-color:#3f9dff;border:1px solid #4592ff;border-left:0;border-right:0;-webkit-box-shadow:inset 0 3px 5px #4592ff;box-shadow:inset 0 3px 5px #4592ff}.sun-editor .se-btn-list{width:100%;height:auto;min-height:32px;max-height:100px;padding:0 14px;cursor:pointer;font-size:12px;line-height:normal;text-indent:0;text-decoration:none;text-align:left}.sun-editor .se-btn-list.default_value{background-color:#f3f3f3;border-top:1px dotted #b1b1b1;border-bottom:1px dotted #b1b1b1}.sun-editor .se-btn-list:focus,.sun-editor .se-btn-list:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn-list:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-list-layer .se-list-font-family{min-width:156px}.sun-editor .se-list-layer .se-list-font-family .default{border-bottom:1px solid #ccc}.sun-editor .se-list-layer .se-list-format{min-width:156px}.sun-editor .se-list-layer .se-list-format li{padding:0;width:100%}.sun-editor .se-list-layer .se-list-format .se-btn-list{line-height:100%}.sun-editor .se-list-layer .se-list-format .se-btn-list[data-value=h1]{height:40px}.sun-editor .se-list-layer .se-list-format .se-btn-list[data-value=h2]{height:34px}.sun-editor .se-list-layer .se-list-format div,.sun-editor .se-list-layer .se-list-format p{font-size:13px}.sun-editor .se-list-layer .se-list-format h1{font-size:2em;font-weight:700;color:#333}.sun-editor .se-list-layer .se-list-format h2{font-size:1.5em;font-weight:700;color:#333}.sun-editor .se-list-layer .se-list-format h3{font-size:1.17em;font-weight:700;color:#333}.sun-editor .se-list-layer .se-list-format h4{font-size:1em;font-weight:700;color:#333}.sun-editor .se-list-layer .se-list-format h5{font-size:.83em;font-weight:700;color:#333}.sun-editor .se-list-layer .se-list-format h6{font-size:.67em;font-weight:700;color:#333}.sun-editor .se-list-layer .se-list-format blockquote{font-size:13px;color:#999;height:22px;margin:0;background-color:transparent;line-height:1.5;border-color:#b1b1b1;padding:0 0 0 7px;border-left:5px #b1b1b1;border-style:solid}.sun-editor .se-list-layer .se-list-format pre{font-size:13px;color:#666;padding:4px 11px;margin:0;background-color:#f9f9f9;border:1px solid #e1e1e1;border-radius:2px}.sun-editor .se-list-layer .se-list-font-size{min-width:140px;max-height:300px;overflow-x:hidden;overflow-y:auto}.sun-editor .se-list-layer .se-list-line{width:125px}.sun-editor .se-list-layer .se-list-align{left:9px;width:125px}.sun-editor .se-list-layer .se-list-align .se-btn-align>span{display:inline-block;width:14px;height:32px;margin:-1px 10px 0 0;vertical-align:middle}.sun-editor .se-list-layer .se-list-format div{padding:4px 2px}.sun-editor .se-selector-table{display:none;position:absolute;top:34px;left:1px;z-index:4;padding:5px 0;float:left;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border-radius:2px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.sun-editor .se-selector-table .se-table-size{font-size:18px;padding:0 5px}.sun-editor .se-selector-table .se-table-size-picker{position:absolute!important;z-index:3;font-size:18px;width:10em;height:10em;cursor:pointer}.sun-editor .se-selector-table .se-table-size-highlighted{position:absolute!important;z-index:2;font-size:18px;width:1em;height:1em;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADJmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo4QTZCNzMzN0I3RUYxMUU4ODcwQ0QwMjM1NTgzRTJDNyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo4QTZCNzMzNkI3RUYxMUU4ODcwQ0QwMjM1NTgzRTJDNyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOCAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0MzYyNEUxRUI3RUUxMUU4ODZGQzgwRjNBODgyNTdFOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0MzYyNEUxRkI3RUUxMUU4ODZGQzgwRjNBODgyNTdFOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pl0yAuwAAABBSURBVDhPY/wPBAxUAGCDGvdBeWSAeicIDTfIXREiQArYeR9hEBOEohyMGkQYjBpEGAxjg6ib+yFMygCVvMbAAABj0hwMTNeKJwAAAABJRU5ErkJggg==") repeat}.sun-editor .se-selector-table .se-table-size-unhighlighted{position:relative!important;z-index:1;font-size:18px;width:5em;height:5em;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC") repeat}.sun-editor .se-selector-table .se-table-size-display{padding-left:5px}.sun-editor .se-list-layer .se-selector-color{display:flex;width:max-content;max-width:270px;height:auto;padding:0;margin:auto}.sun-editor .se-list-layer .se-selector-color .se-color-pallet{width:100%;height:100%;padding:0}.sun-editor .se-list-layer .se-selector-color .se-color-pallet li{display:flex;float:left;position:relative;margin:0}.sun-editor .se-list-layer .se-selector-color .se-color-pallet button{display:block;cursor:default;width:30px;height:30px;text-indent:-9999px}.sun-editor .se-list-layer .se-selector-color .se-color-pallet button.active,.sun-editor .se-list-layer .se-selector-color .se-color-pallet button:focus,.sun-editor .se-list-layer .se-selector-color .se-color-pallet button:hover{border:3px solid #fff}.sun-editor .se-submenu-form-group{display:flex;width:100%;height:auto;padding:4px}.sun-editor .se-submenu-form-group input{flex:auto;display:inline-block;width:72px;height:33px;color:#555;font-size:12px;margin:1px 0;padding:0;border-radius:.25rem;border-bottom:2px solid #b1b1b1;outline:none;text-transform:uppercase}.sun-editor .se-submenu-form-group input:focus{outline:none;border-bottom:3px solid #b1b1b1}.sun-editor .se-submenu-form-group button{float:right;width:35px;height:35px;padding:0;margin:0 0 0 4px!important}.sun-editor .se-submenu-form-group button.se-btn{border:1px solid #ccc}.sun-editor .se-wrapper{position:relative!important;width:100%;height:auto;overflow:hidden;z-index:1}.sun-editor .se-wrapper .se-wrapper-inner{width:100%;height:100%;min-height:65px;overflow-y:auto;overflow-x:auto;-webkit-overflow-scrolling:touch;user-select:text;-o-user-select:text;-moz-user-select:text;-khtml-user-select:text;-webkit-user-select:text;-ms-user-select:text}.sun-editor .se-wrapper .se-wrapper-inner:focus{outline:none}.sun-editor .se-wrapper .se-wrapper-code{background-color:#191919;color:#fff;font-size:13px;word-break:break-all;padding:0;margin:0}.sun-editor .se-wrapper .se-wrapper-wysiwyg{background-color:#fff}.sun-editor .se-wrapper .se-wrapper-code-mirror{font-size:13px}.sun-editor .se-wrapper .se-placeholder{position:absolute;display:none;white-space:nowrap;text-overflow:ellipsis;z-index:1;color:#b1b1b1;font-size:13px;line-height:1.5;top:0;left:0;right:0;overflow:hidden;margin-top:0;padding-top:16px;padding-left:16px;margin-left:0;padding-right:16px;margin-right:0;pointer-events:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden}.sun-editor .se-resizing-bar{display:flex;width:auto;height:auto;min-height:16px;border-top:1px solid #dadada;padding:0 4px;background-color:#fafafa;cursor:ns-resize}.sun-editor .se-resizing-bar.se-resizing-none{cursor:default}.sun-editor .se-resizing-back{position:absolute;display:none;cursor:default;top:0;left:0;width:100%;height:100%;z-index:2147483647}.sun-editor .se-resizing-bar .se-navigation{flex:auto;position:relative;width:auto;height:auto;color:#666;margin:0;padding:0;font-size:10px;font-weight:700;line-height:1.5;background:transparent}.sun-editor .se-resizing-bar .se-char-counter-wrapper{flex:none;position:relative;display:block;width:auto;height:auto;margin:0;padding:0;font-size:10px;background:transparent}.sun-editor .se-resizing-bar .se-char-counter-wrapper span{color:#999;font-size:13px;font-family:Helvetica Neue,sans-serif}.sun-editor .se-resizing-bar .se-char-counter.se-blink{color:#b94a48;animation:blinker .2s linear infinite}.sun-editor .se-dialog{position:absolute;display:none;top:0;left:0;width:100%;height:100%;z-index:2147483647}.sun-editor .se-dialog button,.sun-editor .se-dialog input,.sun-editor .se-dialog label{font-size:14px;line-height:1.5;color:#111;margin:0}.sun-editor .se-dialog .se-dialog-back{background-color:#222;opacity:.5}.sun-editor .se-dialog .se-dialog-back,.sun-editor .se-dialog .se-dialog-inner{position:absolute;width:100%;height:100%;top:0;left:0}.sun-editor .se-dialog .se-dialog-inner .se-modal-title{font-size:14px;font-weight:700;margin:0;padding:0;line-height:1.5}.sun-editor .se-dialog .se-dialog-inner .se-dialog-content{position:relative;width:auto;max-width:500px;margin:20px auto;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:2px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}@media screen and (max-width:509px){.sun-editor .se-dialog .se-dialog-inner .se-dialog-content{width:100%}}.sun-editor .se-dialog .se-dialog-inner .se-dialog-header{height:50px;padding:15px 15px 5px;border-bottom:1px solid #e5e5e5}.sun-editor .se-dialog .se-dialog-inner button.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#666;padding:0!important;margin:0!important;background:transparent;border:0;text-shadow:0 1px 0 #fff;-webkit-appearance:none;filter:alpha(opacity=100);opacity:1}.sun-editor .se-dialog .se-dialog-inner button.close:focus,.sun-editor .se-dialog .se-dialog-inner button.close:hover{color:#000}.sun-editor .se-dialog .se-dialog-inner .se-dialog-body{position:relative;padding:15px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form{margin-bottom:10px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form-footer{margin-top:10px;margin-bottom:0}.sun-editor .se-dialog .se-dialog-inner input:disabled{background-color:#f3f3f3}.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-text{width:100%}.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-text .size-h,.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-text .size-w{width:70px;text-align:center}.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-x{margin:0 8px;width:25px;text-align:center}.sun-editor .se-dialog .se-dialog-inner .se-dialog-content label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}.sun-editor .se-dialog .se-dialog-inner .se-dialog-content .se-btn-primary{display:inline-block;padding:6px 12px;margin:0 0 10px!important;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;border-radius:2px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-footer{padding:10px 15px 0;text-align:right;border-top:1px solid #e5e5e5}.sun-editor .se-dialog .se-dialog-inner .se-dialog-footer>div{float:left}.sun-editor .se-dialog .se-dialog-inner .se-dialog-footer>div>label{margin-top:5px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-radio{margin-left:12px;margin-right:6px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-check{margin-left:12px;margin-right:4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form-footer .se-dialog-btn-check{margin-left:0;margin-right:4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-control,.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-select{display:inline-block;width:70px;height:34px;font-size:14px;text-align:center;line-height:1.42857143;color:#000;border:1px solid #ccc;border-radius:2px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-form{display:block;width:100%;height:34px;font-size:14px;line-height:1.42857143;padding:0 4px;color:#000;border:1px solid #ccc;border-radius:2px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form input:focus,.sun-editor .se-dialog .se-dialog-inner .se-dialog-form select:focus{border-color:#80bdff;outline:0;-webkit-box-shadow:0 0 0 .2rem #c7deff;box-shadow:0 0 0 .2rem #c7deff}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-video-ratio{margin-left:4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-revert{border:1px solid #ccc}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-revert:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-revert:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-dialog-tabs{width:100%;height:25px;border-bottom:1px solid #e5e5e5}.sun-editor .se-dialog-tabs button{background-color:#e5e5e5;border-right:1px solid #e5e5e5;float:left;outline:none;padding:2px 13px;transition:.3s}.sun-editor .se-dialog-tabs button:hover{background-color:#fff}.sun-editor .se-dialog-tabs button.active{background-color:#fff;border-bottom:0}.sun-editor .se-controller .se-arrow.se-arrow-up{border-bottom-color:rgba(0,0,0,.25)}.sun-editor .se-controller{position:absolute;display:none;overflow:visible;z-index:4;border:1px solid rgba(0,0,0,.25);border-radius:2px;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.sun-editor .se-controller .se-btn-group{position:relative;display:flex;vertical-align:middle;padding:2px 2px 2px 0;top:0;left:0}.sun-editor .se-controller .se-btn-group .se-btn-group-sub{left:50%;min-width:auto;width:max-content;display:none}.sun-editor .se-controller .se-btn-group .se-btn-group-sub button{margin:0;min-width:72px}.sun-editor .se-controller .se-btn-group button{position:relative;min-height:35px;height:auto;border:none;border-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;margin:0 0 0 2px;padding:5px 10px;font-size:12px;line-height:1.5;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation}.sun-editor .se-controller .se-btn-group button:focus:enabled,.sun-editor .se-controller .se-btn-group button:hover:enabled{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-controller .se-btn-group button:active:enabled{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-controller .se-btn-group button span{display:block;padding:0;margin:0}.sun-editor .se-controller .se-btn-group button:enabled.active{color:#4592ff;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.active:focus,.sun-editor .se-controller .se-btn-group button:enabled.active:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.active:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-controller .se-btn-group button:enabled.on{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.on:focus,.sun-editor .se-controller .se-btn-group button:enabled.on:hover{background-color:#d1d1d1;border-color:#c1c1c1;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.on:active{background-color:#c1c1c1;border-color:#b1b1b1;-webkit-box-shadow:inset 0 3px 5px #b1b1b1;box-shadow:inset 0 3px 5px #b1b1b1}.sun-editor .se-controller-resizing{margin-top:-50px!important;padding:0;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143}.sun-editor .se-controller-resizing .se-btn-group .se-btn-group-sub.se-resizing-align-list{left:57px}.sun-editor .se-resizing-container{position:absolute;display:none;z-index:4;border:1px solid #80bdff}.sun-editor .se-resizing-container .se-modal-resize{position:absolute;display:inline-block;background-color:#3f9dff;opacity:.3}.sun-editor .se-resizing-container .se-resize-dot{position:absolute;top:0;left:0;width:100%;height:100%}.sun-editor .se-resizing-container .se-resize-dot>span{position:absolute;width:7px;height:7px;background-color:#3f9dff;border:1px solid #4592ff}.sun-editor .se-resizing-container .se-resize-dot>span.tl{top:-5px;left:-5px;cursor:nw-resize}.sun-editor .se-resizing-container .se-resize-dot>span.tr{top:-5px;right:-5px;cursor:ne-resize}.sun-editor .se-resizing-container .se-resize-dot>span.bl{bottom:-5px;left:-5px;cursor:sw-resize}.sun-editor .se-resizing-container .se-resize-dot>span.br{right:-5px;bottom:-5px;cursor:se-resize}.sun-editor .se-resizing-container .se-resize-dot>span.lw{left:-7px;bottom:50%;cursor:w-resize}.sun-editor .se-resizing-container .se-resize-dot>span.th{left:50%;top:-7px;cursor:n-resize}.sun-editor .se-resizing-container .se-resize-dot>span.rw{right:-7px;bottom:50%;cursor:e-resize}.sun-editor .se-resizing-container .se-resize-dot>span.bh{right:50%;bottom:-7px;cursor:s-resize}.sun-editor .se-resizing-container .se-resize-display{position:absolute;right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:#fff;background-color:#333;border-radius:2px}.sun-editor .se-controller-table,.sun-editor .se-controller-table-cell{width:auto}.sun-editor .se-controller-link,.sun-editor .se-controller-table,.sun-editor .se-controller-table-cell{padding:0;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143}.sun-editor .se-controller-link:after,.sun-editor .se-controller-link:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.sun-editor .se-controller-link .link-content{padding:0;margin:0}.sun-editor .se-controller-link .link-content a{display:inline-block;color:#4592ff;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;margin-left:5px}.sun-editor .se-notice{position:relative;display:none;width:100%;height:auto;word-break:break-all;font-size:13px;color:#b94a48;background-color:#f2dede;padding:15px;margin:0;border:1px solid #eed3d7;user-select:text;-o-user-select:text;-moz-user-select:text;-khtml-user-select:text;-webkit-user-select:text;-ms-user-select:text}.sun-editor .se-notice button{float:right}.sun-editor .se-tooltip{position:relative;overflow:visible}.sun-editor .se-tooltip .se-tooltip-inner{visibility:hidden;position:absolute;display:block;width:auto;top:120%;left:50%;background:transparent;opacity:0;z-index:1;line-height:1.5;transition:opacity .5s;margin:0;padding:0;bottom:auto;float:none;pointer-events:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden}.sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text{position:relative;display:inline-block;width:auto;left:-50%;font-size:.9em;margin:0;padding:4px 6px;border-radius:2px;background-color:#333;color:#fff;text-align:center;line-height:unset;white-space:nowrap;cursor:auto}.sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text:after{content:"";position:absolute;bottom:100%;left:50%;margin-left:-5px;border:5px solid transparent;border-bottom-color:#333}.sun-editor .se-tooltip:hover .se-tooltip-inner{visibility:visible;opacity:1}@keyframes blinker{50%{opacity:0}}@keyframes spinner{to{transform:rotate(1turn)}}.sun-editor-editable{font-family:Helvetica Neue,sans-serif;font-size:13px;line-height:1.5;color:#333;text-align:left;background-color:#fff;word-break:break-all;word-wrap:break-word;padding:16px;margin:0}.sun-editor-editable *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.sun-editor-editable audio,.sun-editor-editable figcaption,.sun-editor-editable figure,.sun-editor-editable iframe,.sun-editor-editable img,.sun-editor-editable td,.sun-editor-editable th,.sun-editor-editable video{position:relative}.sun-editor-editable .__se__float-left{float:left}.sun-editor-editable .__se__float-right{float:right}.sun-editor-editable .__se__float-center{float:center}.sun-editor-editable .__se__float-none{float:none}.sun-editor-editable span{display:inline;vertical-align:baseline;margin:0;padding:0}.sun-editor-editable a{color:#004cff;text-decoration:none}.sun-editor-editable span[style~="color:"] a{color:inherit}.sun-editor-editable a:focus,.sun-editor-editable a:hover{cursor:pointer;color:#0093ff;text-decoration:underline}.sun-editor-editable pre{display:block;padding:8px;margin:0 0 10px;line-height:1.45;color:#666;background-color:#f9f9f9;border:1px solid #e1e1e1;border-radius:2px;white-space:pre-wrap;word-wrap:break-word;overflow:visible}.sun-editor-editable ol{list-style-type:decimal}.sun-editor-editable ol,.sun-editor-editable ul{display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0;margin-inline-end:0;padding-inline-start:40px}.sun-editor-editable ul{list-style-type:disc}.sun-editor-editable li{display:list-item;text-align:-webkit-match-parent;margin-bottom:5px}.sun-editor-editable sub,.sun-editor-editable sup{font-size:75%;line-height:0}.sun-editor-editable sub{vertical-align:sub}.sun-editor-editable sup{vertical-align:super}.sun-editor-editable p{display:block;margin:0 0 10px}.sun-editor-editable div{display:block;margin:0;padding:0}.sun-editor-editable blockquote{display:block;font-family:inherit;font-size:inherit;color:#999;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0;margin-inline-end:0;padding:0 5px 0 20px;border:solid #b1b1b1;border-width:0 0 0 5px}.sun-editor-editable blockquote blockquote{border-color:#c1c1c1}.sun-editor-editable blockquote blockquote blockquote{border-color:#d1d1d1}.sun-editor-editable blockquote blockquote blockquote blockquote{border-color:#e1e1e1}.sun-editor-editable h1{font-size:2em;margin-block-start:.67em;margin-block-end:.67em}.sun-editor-editable h1,.sun-editor-editable h2{display:block;margin-inline-start:0;margin-inline-end:0;font-weight:700}.sun-editor-editable h2{font-size:1.5em;margin-block-start:.83em;margin-block-end:.83em}.sun-editor-editable h3{font-size:1.17em;margin-block-start:1em;margin-block-end:1em}.sun-editor-editable h3,.sun-editor-editable h4{display:block;margin-inline-start:0;margin-inline-end:0;font-weight:700}.sun-editor-editable h4{font-size:1em;margin-block-start:1.33em;margin-block-end:1.33em}.sun-editor-editable h5{font-size:.83em;margin-block-start:1.67em;margin-block-end:1.67em}.sun-editor-editable h5,.sun-editor-editable h6{display:block;margin-inline-start:0;margin-inline-end:0;font-weight:700}.sun-editor-editable h6{font-size:.67em;margin-block-start:2.33em;margin-block-end:2.33em}.sun-editor-editable hr{display:flex;border-width:1px 0 0;border-color:#000;border-image:initial;height:1px}.sun-editor-editable hr.__se__solid{border-style:solid none none}.sun-editor-editable hr.__se__dotted{border-style:dotted none none}.sun-editor-editable hr.__se__dashed{border-style:dashed none none}.sun-editor-editable table{display:table;table-layout:auto;border:1px solid #ccc;width:100%;max-width:100%;margin:0 0 10px;background-color:transparent;border-spacing:0;border-collapse:collapse}.sun-editor-editable table thead{border-bottom:2px solid #333}.sun-editor-editable table tr{border:1px solid #efefef}.sun-editor-editable table th{background-color:#f3f3f3}.sun-editor-editable table td,.sun-editor-editable table th{border:1px solid #e1e1e1;padding:.4em;background-clip:padding-box}.sun-editor-editable table td.se-table-selected-cell,.sun-editor-editable table th.se-table-selected-cell{border:1px double #4592ff;background-color:#f1f7ff}.sun-editor-editable.se-disabled *{user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none}.sun-editor-editable .se-component{display:flex;padding:1px;margin:0 0 10px}.sun-editor-editable .se-component.__se__float-left{margin:0 20px 10px 0}.sun-editor-editable .se-component.__se__float-right{margin:0 0 10px 20px}.sun-editor-editable[contenteditable=true] .se-component{outline:1px dashed #e1e1e1}.sun-editor-editable audio,.sun-editor-editable iframe,.sun-editor-editable img,.sun-editor-editable video{display:block;margin:0;padding:0;width:auto;height:auto;max-width:100%}.sun-editor-editable[contenteditable=true] figure:after{position:absolute;content:"";z-index:1;top:0;left:0;right:0;bottom:0;cursor:default;display:block;background:transparent}.sun-editor-editable[contenteditable=true] figure a,.sun-editor-editable[contenteditable=true] figure iframe,.sun-editor-editable[contenteditable=true] figure img{z-index:0}.sun-editor-editable[contenteditable=true] figure figcaption{display:block;z-index:2}.sun-editor-editable .se-image-container,.sun-editor-editable .se-video-container{width:auto;height:auto;max-width:100%}.sun-editor-editable figure{display:block;outline:none;margin:0;padding:0}.sun-editor-editable figure figcaption{padding:1em .5em;margin:0;background-color:#f9f9f9;outline:none}.sun-editor-editable figure figcaption p{line-height:2;margin:0}.sun-editor-editable .se-image-container a img{padding:1px;margin:1px;outline:1px solid #4592ff}.sun-editor-editable .se-video-container iframe{outline:1px solid #9e9e9e;position:absolute;top:0;left:0;border:0;width:100%;height:100%}.sun-editor-editable .se-video-container figure{left:0;width:100%;max-width:100%}.sun-editor-editable.se-show-block div,.sun-editor-editable.se-show-block h1,.sun-editor-editable.se-show-block h2,.sun-editor-editable.se-show-block h3,.sun-editor-editable.se-show-block h4,.sun-editor-editable.se-show-block h5,.sun-editor-editable.se-show-block h6,.sun-editor-editable.se-show-block p{border:1px dashed #3f9dff!important;padding:10px 8px 8px!important}.se-show-block p{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPAQMAAAAF7dc0AAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAaSURBVAjXY/j/gwGCPvxg+F4BQiAGDP1HQQByxxw0gqOzIwAAAABJRU5ErkJggg==") no-repeat}.se-show-block div{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAPAQMAAAAxlBYoAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAmSURBVAjXY/j//wcDDH+8XsHwDYi/hwNx1A8w/nYLKH4XoQYJAwCXnSgcl2MOPgAAAABJRU5ErkJggg==") no-repeat}.se-show-block h1{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAfSURBVAjXY/j/v4EBhr+9B+LzEPrDeygfhI8j1CBhAEhmJGY4Rf6uAAAAAElFTkSuQmCC") no-repeat}.se-show-block h2{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAmSURBVAjXY/j/v4EBhr+dB+LtQPy9geEDEH97D8T3gbgdoQYJAwA51iPuD2haEAAAAABJRU5ErkJggg==") no-repeat}.se-show-block h3{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAiSURBVAjXY/j/v4EBhr+dB+LtQPy9geHDeQgN5p9HqEHCADeWI+69VG2MAAAAAElFTkSuQmCC") no-repeat}.se-show-block h4{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPAQMAAADTSA1RAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAiSURBVAjXY/j//wADDH97DsTXIfjDdiDdDMTfIRhZHRQDAKJOJ6L+K3y7AAAAAElFTkSuQmCC") no-repeat}.se-show-block h5{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAlSURBVAjXY/j/v4EBhr+1A/F+IO5vYPiwHUh/B2IQfR6hBgkDABlWIy5uM+9GAAAAAElFTkSuQmCC") no-repeat}.se-show-block h6{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAiSURBVAjXY/j/v4EBhr+dB+LtQLy/geFDP5S9HSKOrA6KAR9GIza1ptJnAAAAAElFTkSuQmCC") no-repeat}.sun-editor-editable .__se__p-bordered,.sun-editor .__se__p-bordered{border-top:1px solid #b1b1b1;border-bottom:1px solid #b1b1b1;padding:4px 0}.sun-editor-editable .__se__p-spaced,.sun-editor .__se__p-spaced{letter-spacing:1px}.sun-editor-editable .__se__p-neon,.sun-editor .__se__p-neon{font-weight:200;font-style:italic;background:#000;color:#fff;padding:6px 4px;border:2px solid #fff;border-radius:6px;text-transform:uppercase;animation:neonFlicker 1.5s infinite alternate}@keyframes neonFlicker{0%,19%,21%,23%,25%,54%,56%,to{text-shadow:-.2rem -.2rem 1rem #fff,.2rem .2rem 1rem #fff,0 0 2px #f40,0 0 4px #f40,0 0 6px #f40,0 0 8px #f40,0 0 10px #f40;box-shadow:0 0 .5px #fff,inset 0 0 .5px #fff,0 0 2px #08f,inset 0 0 2px #08f,0 0 4px #08f,inset 0 0 4px #08f}20%,24%,55%{text-shadow:none;box-shadow:none}}.sun-editor-editable .__se__t-shadow,.sun-editor .__se__t-shadow{text-shadow:-.2rem -.2rem 1rem #fff,.2rem .2rem 1rem #fff,0 0 .2rem #999,0 0 .4rem #888,0 0 .6rem #777,0 0 .8rem #666,0 0 1rem #555} \ No newline at end of file +.sun-editor{width:auto;height:auto;box-sizing:border-box;font-family:Helvetica Neue,sans-serif;border:1px solid #dadada;text-align:left;background-color:#fff;color:#000;user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none}.sun-editor *{box-sizing:border-box;-webkit-user-drag:none;overflow:visible}.sun-editor-common button,.sun-editor-common input,.sun-editor-common select,.sun-editor-common textarea{font-size:14px;line-height:1.5}.sun-editor-common blockquote,.sun-editor-common body,.sun-editor-common button,.sun-editor-common code,.sun-editor-common dd,.sun-editor-common div,.sun-editor-common dl,.sun-editor-common dt,.sun-editor-common fieldset,.sun-editor-common form,.sun-editor-common h1,.sun-editor-common h2,.sun-editor-common h3,.sun-editor-common h4,.sun-editor-common h5,.sun-editor-common h6,.sun-editor-common input,.sun-editor-common legend,.sun-editor-common li,.sun-editor-common ol,.sun-editor-common p,.sun-editor-common pre,.sun-editor-common select,.sun-editor-common td,.sun-editor-common textarea,.sun-editor-common th,.sun-editor-common ul{margin:0;padding:0;border:0}.sun-editor-common dl,.sun-editor-common li,.sun-editor-common menu,.sun-editor-common ol,.sun-editor-common ul{list-style:none!important}.sun-editor-common hr{margin:6px 0!important}.sun-editor textarea{resize:none!important;border:0!important}.sun-editor button{border:0;background-color:transparent;touch-action:manipulation;cursor:pointer;outline:none}.sun-editor button,.sun-editor input,.sun-editor select,.sun-editor textarea{vertical-align:middle}.sun-editor button span{display:block;margin:0;padding:0}.sun-editor button .txt{display:block;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@font-face{font-family:Suneditor-icon;src:url(../fonts/435801d088c67acdd4c667e00037f080.eot);src:url(../fonts/435801d088c67acdd4c667e00037f080.eot?#iefix) format("embedded-opentype"),url(../fonts/54469d382ec66ca4460d57a5f4a49b05.woff2) format("woff2"),url(../fonts/1d63e86b832ddfc4008baf6e69e7c39b.woff) format("woff"),url(../fonts/773c0f21a6a926b07f111a3892134dec.ttf) format("truetype"),url(../fonts/0b8f27509021ddc0f7d4ee103181bc05.svg#Suneditor-icon) format("svg");font-weight:400;font-style:normal}.sun-editor [class*=se-icon-]:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Suneditor-icon;display:inline-block;font-style:normal;font-variant:normal;font-weight:400;text-rendering:auto;font-size:15px}.sun-editor button>svg{width:25px;height:25px;margin:5px}.sun-editor .se-toolbar button>i:before{line-height:2.1}.sun-editor .se-icon-align-justify:before{content:"A"}.sun-editor .se-icon-align-left:before{content:"B"}.sun-editor .se-icon-align-right:before{content:"C"}.sun-editor .se-icon-align-center:before{content:"D"}.sun-editor .se-icon-underline:before{content:"E"}.sun-editor .se-icon-bold:before{content:"F"}.sun-editor .se-icon-italic:before{content:"G"}.sun-editor .se-icon-strokethrough:before{content:"H"}.sun-editor .se-icon-subscript:before{content:"I"}.sun-editor .se-icon-superscript:before{content:"J"}.sun-editor .se-icon-redo:before{content:"K"}.sun-editor .se-icon-undo:before{content:"L"}.sun-editor .se-icon-erase:before{content:"M"}.sun-editor .se-icon-fontColor:before{content:"N"}.sun-editor .se-icon-hiliteColor:before{content:"O"}.sun-editor .se-icon-indent-left:before{content:"P"}.sun-editor .se-icon-indent-right:before{content:"Q"}.sun-editor .se-icon-list-bullets:before{content:"R"}.sun-editor .se-icon-list-number:before{content:"S"}.sun-editor .se-icon-grid:before{content:"T"}.sun-editor .se-icon-code-view:before{content:"U"}.sun-editor .se-icon-preview:before{content:"V"}.sun-editor .se-icon-showBlocks:before{content:"W"}.sun-editor .se-icon-expansion:before{content:"X"}.sun-editor .se-icon-reduction:before{content:"Y"}.sun-editor .se-icon-image:before{content:"Z"}.sun-editor .se-icon-link:before{content:"a"}.sun-editor .se-icon-auto-size:before{content:"b"}.sun-editor .se-icon-print:before{content:"c"}.sun-editor .se-icon-modify:before{content:"d"}.sun-editor .se-icon-revert:before{content:"e"}.sun-editor .se-icon-arrow-down:before{content:"f";font-size:10px}.sun-editor .se-icon-video:before{content:"g"}.sun-editor .se-icon-cancel:before{content:"h";font-size:10px}.sun-editor .se-icon-warning:before{content:"i"}.sun-editor .se-icon-insert-column-right:before{content:"j"}.sun-editor .se-icon-insert-row-below:before{content:"k"}.sun-editor .se-icon-insert-row-above:before{content:"l"}.sun-editor .se-icon-insert-column-left:before{content:"m"}.sun-editor .se-icon-delete-row:before{content:"n"}.sun-editor .se-icon-delete-column:before{content:"o"}.sun-editor .se-icon-unlink:before{content:"p"}.sun-editor .se-icon-empty-file:before{content:"q"}.sun-editor .se-icon-paragraph-style:before{content:"r"}.sun-editor .se-icon-delete:before{content:"s"}.sun-editor .se-icon-rotate-left:before{content:"t"}.sun-editor .se-icon-rotate-right:before{content:"u"}.sun-editor .se-icon-mirror-horizontal:before{content:"v"}.sun-editor .se-icon-mirror-vertical:before{content:"w"}.sun-editor .se-icon-save:before{content:"x"}.sun-editor .se-icon-hr:before{content:"y"}.sun-editor .se-icon-checked:before{content:"z"}.sun-editor .se-icon-table-header:before{content:"0"}.sun-editor .se-icon-merge-cell:before{content:"1"}.sun-editor .se-icon-split-cell:before{content:"2"}.sun-editor .se-icon-caption:before{content:"3"}.sun-editor .se-icon-edit:before{content:"4"}.sun-editor .se-icon-question:before{content:"5"}.sun-editor .se-icon-attachment:before{content:"6"}.sun-editor .se-icon-add:before{content:"7"}.sun-editor .se-icon-more-vertical:before{content:"8"}.sun-editor .se-icon-more-horizontal:before{content:"9"}.sun-editor .se-icon-map-pin:before{content:"!"}.sun-editor .se-icon-magic-stick:before{content:'"'}.sun-editor .se-icon-math:before{content:"#"}.sun-editor .se-icon-audio:before{content:"$"}.sun-editor .se-icon-emoji:before{content:"%"}.sun-editor .se-icon-template:before{content:"&"}.sun-editor .se-icon-line-height:before{content:"'"}.sun-editor .se-icon-text-style:before{content:"("}.sun-editor .se-arrow,.sun-editor .se-arrow:after{position:absolute;display:block;width:0;height:0;border:11px solid transparent}.sun-editor .se-arrow.se-arrow-up{top:-11px;left:20px;margin-left:-11px;border-top-width:0;border-bottom-color:rgba(0,0,0,.25)}.sun-editor .se-arrow.se-arrow-up:after{top:1px;margin-left:-11px;content:" ";border-top-width:0;border-bottom-color:#fff}.sun-editor .se-toolbar .se-arrow.se-arrow-up:after{border-bottom-color:#fafafa}.sun-editor .se-arrow.se-arrow-down{top:0;left:0;margin-left:-11px;border-bottom-width:0;border-top-color:rgba(0,0,0,.25)}.sun-editor .se-arrow.se-arrow-down:after{top:-12px;margin-left:-11px;content:" ";border-bottom-width:0;border-top-color:#fff}.sun-editor .se-toolbar .se-arrow.se-arrow-down:after{border-top-color:#fafafa}.sun-editor .se-container{position:relative;width:100%;height:100%}.sun-editor button{color:#000}.sun-editor .se-btn{float:left;width:35px;height:35px;border:0;border-radius:4px;margin:1px!important;padding:0;font-size:12px;line-height:27px}.sun-editor .se-btn:enabled:focus,.sun-editor .se-btn:enabled:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn:enabled:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-btn-primary{color:#000;background-color:#c7deff;border:1px solid #80bdff;border-radius:4px}.sun-editor .se-btn-primary:focus,.sun-editor .se-btn-primary:hover{color:#000;background-color:#80bdff;border-color:#3f9dff;outline:0 none}.sun-editor .se-btn-primary:active{color:#fff;background-color:#3f9dff;border-color:#4592ff;-webkit-box-shadow:inset 0 3px 5px #4592ff;box-shadow:inset 0 3px 5px #4592ff}.sun-editor .se-btn:enabled.active{color:#4592ff;outline:0 none}.sun-editor .se-btn:enabled.active:focus,.sun-editor .se-btn:enabled.active:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn:enabled.active:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-btn:enabled.on{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn:enabled.on:focus,.sun-editor .se-btn:enabled.on:hover{background-color:#d1d1d1;border-color:#c1c1c1;outline:0 none}.sun-editor .se-btn:enabled.on:active{background-color:#c1c1c1;border-color:#b1b1b1;-webkit-box-shadow:inset 0 3px 5px #b1b1b1;box-shadow:inset 0 3px 5px #b1b1b1}.sun-editor .se-btn-list:disabled,.sun-editor .se-btn:disabled,.sun-editor button:disabled{cursor:not-allowed;background-color:inherit;color:#bdbdbd}.sun-editor .se-loading-box{position:absolute;display:none;width:100%;height:100%;top:0;left:0;background-color:#fff;opacity:.7;filter:alpha(opacity=70);z-index:2147483647}.sun-editor .se-loading-box .se-loading-effect{position:absolute;display:block;top:50%;left:50%;height:25px;width:25px;border-top:2px solid #07d;border-right:2px solid transparent;border-radius:50%;animation:spinner .8s linear infinite;margin:-25px 0 0 -25px}.sun-editor .se-toolbar{display:block;position:relative;height:auto;width:100%;overflow:visible;padding:4px 3px 0;margin:0;background-color:#fafafa;outline:1px solid #dadada;z-index:5}.sun-editor .se-toolbar-cover{position:absolute;display:none;font-size:36px;width:100%;height:100%;top:0;left:0;background-color:#fefefe;opacity:.5;filter:alpha(opacity=50);cursor:not-allowed;z-index:4}.sun-editor .se-toolbar-separator-vertical{display:inline-block;height:0;width:0;margin:2px;vertical-align:top}.sun-editor .se-toolbar.se-toolbar-balloon,.sun-editor .se-toolbar.se-toolbar-inline{display:none;position:absolute;z-index:2147483647;box-shadow:0 3px 9px rgba(0,0,0,.5);-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5)}.sun-editor .se-toolbar.se-toolbar-balloon{width:auto}.sun-editor .se-toolbar.se-toolbar-sticky{position:fixed;top:0}.sun-editor .se-toolbar-sticky-dummy{display:none;position:static;z-index:-1}.sun-editor .se-btn-module{display:inline-block}.sun-editor .se-btn-module-border{border:1px solid #dadada;border-radius:4px}.sun-editor .se-btn-module-enter{display:block;width:100%;height:1px;margin-bottom:5px;background-color:transparent}.sun-editor .se-menu-list,.sun-editor .se-menu-list li{float:left;padding:0;margin:0}.sun-editor .se-menu-list li{position:relative}.sun-editor .se-btn-select{width:auto;display:flex;text-align:left;padding:4px 6px}.sun-editor .se-btn-select .txt{flex:5;float:left;text-align:left}.sun-editor .se-btn-select .se-icon-arrow-down{flex:1;float:right}.sun-editor .se-btn-select.se-btn-tool-font{width:100px}.sun-editor .se-btn-select.se-btn-tool-format,.sun-editor .se-btn-select.se-btn-tool-size{width:80px}.sun-editor .se-list-layer{display:none;position:absolute;top:37px;z-index:4;left:1px;border:1px solid #bababa;border-radius:4px;padding:6px 0;background-color:#fff;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);outline:0 none}.sun-editor .se-list-layer .se-list-inner{padding:0;margin:0;overflow-x:initial;overflow-y:initial;overflow:visible}.sun-editor .se-list-layer button{margin:0;width:100%}.sun-editor .se-list-inner .se-list-basic{width:100%;padding:0}.sun-editor .se-list-inner .se-list-basic li{width:100%}.sun-editor .se-list-inner .se-list-basic li>button{min-width:100%;width:max-content}.sun-editor .se-list-inner .se-list-basic li button.active{background-color:#80bdff;border:1px solid #3f9dff;border-left:0;border-right:0}.sun-editor .se-list-inner .se-list-basic li button.active:active{background-color:#3f9dff;border:1px solid #4592ff;border-left:0;border-right:0;-webkit-box-shadow:inset 0 3px 5px #4592ff;box-shadow:inset 0 3px 5px #4592ff}.sun-editor .se-btn-list{width:100%;height:auto;min-height:32px;max-height:100px;padding:0 14px;cursor:pointer;font-size:12px;line-height:normal;text-indent:0;text-decoration:none;text-align:left}.sun-editor .se-btn-list.default_value{background-color:#f3f3f3;border-top:1px dotted #b1b1b1;border-bottom:1px dotted #b1b1b1}.sun-editor .se-btn-list:focus,.sun-editor .se-btn-list:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn-list:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-list-layer .se-list-font-family{min-width:156px}.sun-editor .se-list-layer .se-list-font-family .default{border-bottom:1px solid #ccc}.sun-editor .se-list-layer .se-list-format{min-width:156px}.sun-editor .se-list-layer .se-list-format li{padding:0;width:100%}.sun-editor .se-list-layer .se-list-format .se-btn-list{line-height:100%}.sun-editor .se-list-layer .se-list-format .se-btn-list[data-value=h1]{height:40px}.sun-editor .se-list-layer .se-list-format .se-btn-list[data-value=h2]{height:34px}.sun-editor .se-list-layer .se-list-format div,.sun-editor .se-list-layer .se-list-format p{font-size:13px}.sun-editor .se-list-layer .se-list-format h1{font-size:2em;font-weight:700;color:#333}.sun-editor .se-list-layer .se-list-format h2{font-size:1.5em;font-weight:700;color:#333}.sun-editor .se-list-layer .se-list-format h3{font-size:1.17em;font-weight:700;color:#333}.sun-editor .se-list-layer .se-list-format h4{font-size:1em;font-weight:700;color:#333}.sun-editor .se-list-layer .se-list-format h5{font-size:.83em;font-weight:700;color:#333}.sun-editor .se-list-layer .se-list-format h6{font-size:.67em;font-weight:700;color:#333}.sun-editor .se-list-layer .se-list-format blockquote{font-size:13px;color:#999;height:22px;margin:0;background-color:transparent;line-height:1.5;border-color:#b1b1b1;padding:0 0 0 7px;border-left:5px #b1b1b1;border-style:solid}.sun-editor .se-list-layer .se-list-format pre{font-size:13px;color:#666;padding:4px 11px;margin:0;background-color:#f9f9f9;border:1px solid #e1e1e1;border-radius:4px}.sun-editor .se-list-layer .se-list-font-size{min-width:140px;max-height:300px;overflow-x:hidden;overflow-y:auto}.sun-editor .se-list-layer .se-list-line{width:125px}.sun-editor .se-list-layer .se-list-align{left:9px;width:125px}.sun-editor .se-list-layer .se-list-align .se-btn-align>span{display:inline-block;width:14px;height:32px;margin:-1px 10px 0 0;vertical-align:middle}.sun-editor .se-list-layer .se-list-format div{padding:4px 2px}.sun-editor .se-selector-table{display:none;position:absolute;top:34px;left:1px;z-index:4;padding:5px 0;float:left;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.sun-editor .se-selector-table .se-table-size{font-size:18px;padding:0 5px}.sun-editor .se-selector-table .se-table-size-picker{position:absolute!important;z-index:3;font-size:18px;width:10em;height:10em;cursor:pointer}.sun-editor .se-selector-table .se-table-size-highlighted{position:absolute!important;z-index:2;font-size:18px;width:1em;height:1em;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADJmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo4QTZCNzMzN0I3RUYxMUU4ODcwQ0QwMjM1NTgzRTJDNyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo4QTZCNzMzNkI3RUYxMUU4ODcwQ0QwMjM1NTgzRTJDNyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOCAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0MzYyNEUxRUI3RUUxMUU4ODZGQzgwRjNBODgyNTdFOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0MzYyNEUxRkI3RUUxMUU4ODZGQzgwRjNBODgyNTdFOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pl0yAuwAAABBSURBVDhPY/wPBAxUAGCDGvdBeWSAeicIDTfIXREiQArYeR9hEBOEohyMGkQYjBpEGAxjg6ib+yFMygCVvMbAAABj0hwMTNeKJwAAAABJRU5ErkJggg==") repeat}.sun-editor .se-selector-table .se-table-size-unhighlighted{position:relative!important;z-index:1;font-size:18px;width:5em;height:5em;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC") repeat}.sun-editor .se-selector-table .se-table-size-display{padding-left:5px}.sun-editor .se-list-layer .se-selector-color{display:flex;width:max-content;max-width:270px;height:auto;padding:0;margin:auto}.sun-editor .se-list-layer .se-selector-color .se-color-pallet{width:100%;height:100%;padding:0}.sun-editor .se-list-layer .se-selector-color .se-color-pallet li{display:flex;float:left;position:relative;margin:0}.sun-editor .se-list-layer .se-selector-color .se-color-pallet button{display:block;cursor:default;width:30px;height:30px;text-indent:-9999px}.sun-editor .se-list-layer .se-selector-color .se-color-pallet button.active,.sun-editor .se-list-layer .se-selector-color .se-color-pallet button:focus,.sun-editor .se-list-layer .se-selector-color .se-color-pallet button:hover{border:3px solid #fff}.sun-editor .se-submenu-form-group{display:flex;width:100%;height:auto;padding:4px}.sun-editor .se-submenu-form-group input{flex:auto;display:inline-block;width:auto;height:33px;color:#555;font-size:12px;margin:1px 0;padding:0;border-radius:.25rem;border:1px solid #ccc}.sun-editor .se-submenu-form-group input:focus{border-color:#80bdff;outline:0;-webkit-box-shadow:0 0 0 .2rem #c7deff;box-shadow:0 0 0 .2rem #c7deff}.sun-editor .se-submenu-form-group button{float:right;width:35px;height:35px;margin:0 0 0 4px!important}.sun-editor .se-submenu-form-group button.se-btn{border:1px solid #ccc}.sun-editor .se-submenu-form-group>div{position:relative}.sun-editor .se-submenu-form-group .se-color-input{width:72px;text-transform:uppercase;border:none;border-bottom:2px solid #b1b1b1;outline:none}.sun-editor .se-submenu-form-group .se-color-input:focus{outline:none;border-bottom:3px solid #b1b1b1;-webkit-box-shadow:none;box-shadow:none}.sun-editor .se-wrapper{position:relative!important;width:100%;height:auto;overflow:hidden;z-index:1}.sun-editor .se-wrapper .se-wrapper-inner{width:100%;height:100%;min-height:65px;overflow-y:auto;overflow-x:auto;-webkit-overflow-scrolling:touch;user-select:text;-o-user-select:text;-moz-user-select:text;-khtml-user-select:text;-webkit-user-select:text;-ms-user-select:text}.sun-editor .se-wrapper .se-wrapper-inner:focus{outline:none}.sun-editor .se-wrapper .se-wrapper-code{background-color:#191919;color:#fff;font-size:13px;word-break:break-all;padding:0;margin:0}.sun-editor .se-wrapper .se-wrapper-wysiwyg{background-color:#fff}.sun-editor .se-wrapper .se-wrapper-code-mirror{font-size:13px}.sun-editor .se-wrapper .se-placeholder{position:absolute;display:none;white-space:nowrap;text-overflow:ellipsis;z-index:1;color:#b1b1b1;font-size:13px;line-height:1.5;top:0;left:0;right:0;overflow:hidden;margin-top:0;padding-top:16px;padding-left:16px;margin-left:0;padding-right:16px;margin-right:0;pointer-events:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden}.sun-editor .se-resizing-bar{display:flex;width:auto;height:auto;min-height:16px;border-top:1px solid #dadada;padding:0 4px;background-color:#fafafa;cursor:ns-resize}.sun-editor .se-resizing-bar.se-resizing-none{cursor:default}.sun-editor .se-resizing-back{position:absolute;display:none;cursor:default;top:0;left:0;width:100%;height:100%;z-index:2147483647}.sun-editor .se-resizing-bar .se-navigation{flex:auto;position:relative;width:auto;height:auto;color:#666;margin:0;padding:0;font-size:10px;font-weight:700;line-height:1.5;background:transparent}.sun-editor .se-resizing-bar .se-char-counter-wrapper{flex:none;position:relative;display:block;width:auto;height:auto;margin:0;padding:0;font-size:10px;background:transparent}.sun-editor .se-resizing-bar .se-char-counter-wrapper span{color:#999;font-size:13px;font-family:Helvetica Neue,sans-serif}.sun-editor .se-resizing-bar .se-char-counter.se-blink{color:#b94a48;animation:blinker .2s linear infinite}.sun-editor .se-dialog{position:absolute;display:none;top:0;left:0;width:100%;height:100%;z-index:2147483647}.sun-editor .se-dialog button,.sun-editor .se-dialog input,.sun-editor .se-dialog label{font-size:14px;line-height:1.5;color:#111;margin:0}.sun-editor .se-dialog .se-dialog-back{background-color:#222;opacity:.5}.sun-editor .se-dialog .se-dialog-back,.sun-editor .se-dialog .se-dialog-inner{position:absolute;width:100%;height:100%;top:0;left:0}.sun-editor .se-dialog .se-dialog-inner .se-dialog-content{position:relative;width:auto;max-width:500px;margin:20px auto;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:4px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}@media screen and (max-width:509px){.sun-editor .se-dialog .se-dialog-inner .se-dialog-content{width:100%}}.sun-editor .se-dialog .se-dialog-inner .se-dialog-header{height:50px;padding:6px 15px;border-bottom:1px solid #e5e5e5}.sun-editor .se-dialog .se-dialog-inner .se-dialog-header .se-dialog-close{float:right;font-weight:700;text-shadow:0 1px 0 #fff;-webkit-appearance:none;filter:alpha(opacity=100);opacity:1}.sun-editor .se-dialog .se-dialog-inner .se-dialog-header .se-modal-title{font-size:14px;font-weight:700;margin:0;padding:0;line-height:2.5}.sun-editor .se-dialog .se-dialog-inner .se-dialog-body{position:relative;padding:15px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form{margin-bottom:10px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form-footer{margin-top:10px;margin-bottom:0}.sun-editor .se-dialog .se-dialog-inner input:disabled{background-color:#f3f3f3}.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-text{width:100%}.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-text .size-h,.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-text .size-w{width:70px;text-align:center}.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-x{margin:0 8px;width:25px;text-align:center}.sun-editor .se-dialog .se-dialog-inner .se-dialog-content label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}.sun-editor .se-dialog .se-dialog-inner .se-dialog-content .se-btn-primary{display:inline-block;padding:6px 12px;margin:0 0 10px!important;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;border-radius:4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-footer{padding:10px 15px 0;text-align:right;border-top:1px solid #e5e5e5}.sun-editor .se-dialog .se-dialog-inner .se-dialog-footer>div{float:left}.sun-editor .se-dialog .se-dialog-inner .se-dialog-footer>div>label{margin-top:5px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-radio{margin-left:12px;margin-right:6px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-check{margin-left:12px;margin-right:4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form-footer .se-dialog-btn-check{margin-left:0;margin-right:4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-control,.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-select{display:inline-block;width:70px;height:34px;font-size:14px;text-align:center;line-height:1.42857143;color:#000;border:1px solid #ccc;border-radius:4px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-form{display:block;width:100%;height:34px;font-size:14px;line-height:1.42857143;padding:0 4px;color:#000;border:1px solid #ccc;border-radius:4px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form input:focus,.sun-editor .se-dialog .se-dialog-inner .se-dialog-form select:focus,.sun-editor .se-dialog .se-dialog-inner .se-dialog-form textarea:focus{border-color:#80bdff;outline:0;-webkit-box-shadow:0 0 0 .2rem #c7deff;box-shadow:0 0 0 .2rem #c7deff}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-video-ratio{margin-left:4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form a{color:#004cff}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-revert{border:1px solid #ccc}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-revert:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-revert:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-dialog-tabs{width:100%;height:25px;border-bottom:1px solid #e5e5e5}.sun-editor .se-dialog-tabs button{background-color:#e5e5e5;border-right:1px solid #e5e5e5;float:left;outline:none;padding:2px 13px;transition:.3s}.sun-editor .se-dialog-tabs button:hover{background-color:#fff}.sun-editor .se-dialog-tabs button.active{background-color:#fff;border-bottom:0}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-form.se-math-exp{resize:vertical!important;height:4rem;border:1px solid #ccc!important;font-size:13px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-select.se-math-size{width:6em;height:28px;margin-left:1em}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-math-preview{font-size:13px}.sun-editor .se-controller .se-arrow.se-arrow-up{border-bottom-color:rgba(0,0,0,.25)}.sun-editor .se-controller{position:absolute;display:none;overflow:visible;z-index:4;border:1px solid rgba(0,0,0,.25);border-radius:4px;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.sun-editor .se-controller .se-btn-group{position:relative;display:flex;vertical-align:middle;padding:2px 2px 2px 0;top:0;left:0}.sun-editor .se-controller .se-btn-group .se-btn-group-sub{left:50%;min-width:auto;width:max-content;display:none}.sun-editor .se-controller .se-btn-group .se-btn-group-sub button{margin:0;min-width:72px}.sun-editor .se-controller .se-btn-group button{position:relative;min-height:35px;height:auto;border:none;border-radius:4px;border-top-right-radius:0;border-bottom-right-radius:0;margin:0 0 0 2px;padding:5px 10px;font-size:12px;line-height:1.5;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation}.sun-editor .se-controller .se-btn-group button:focus:enabled,.sun-editor .se-controller .se-btn-group button:hover:enabled{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-controller .se-btn-group button:active:enabled{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-controller .se-btn-group button span{display:block;padding:0;margin:0}.sun-editor .se-controller .se-btn-group button:enabled.active{color:#4592ff;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.active:focus,.sun-editor .se-controller .se-btn-group button:enabled.active:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.active:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-controller .se-btn-group button:enabled.on{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.on:focus,.sun-editor .se-controller .se-btn-group button:enabled.on:hover{background-color:#d1d1d1;border-color:#c1c1c1;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.on:active{background-color:#c1c1c1;border-color:#b1b1b1;-webkit-box-shadow:inset 0 3px 5px #b1b1b1;box-shadow:inset 0 3px 5px #b1b1b1}.sun-editor .se-controller-resizing{margin-top:-50px!important;padding:0;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143}.sun-editor .se-controller-resizing .se-btn-group .se-btn-group-sub.se-resizing-align-list{left:57px}.sun-editor .se-resizing-container{position:absolute;display:none;z-index:4;border:1px solid #80bdff}.sun-editor .se-resizing-container .se-modal-resize{position:absolute;display:inline-block;background-color:#3f9dff;opacity:.3}.sun-editor .se-resizing-container .se-resize-dot{position:absolute;top:0;left:0;width:100%;height:100%}.sun-editor .se-resizing-container .se-resize-dot>span{position:absolute;width:7px;height:7px;background-color:#3f9dff;border:1px solid #4592ff}.sun-editor .se-resizing-container .se-resize-dot>span.tl{top:-5px;left:-5px;cursor:nw-resize}.sun-editor .se-resizing-container .se-resize-dot>span.tr{top:-5px;right:-5px;cursor:ne-resize}.sun-editor .se-resizing-container .se-resize-dot>span.bl{bottom:-5px;left:-5px;cursor:sw-resize}.sun-editor .se-resizing-container .se-resize-dot>span.br{right:-5px;bottom:-5px;cursor:se-resize}.sun-editor .se-resizing-container .se-resize-dot>span.lw{left:-7px;bottom:50%;cursor:w-resize}.sun-editor .se-resizing-container .se-resize-dot>span.th{left:50%;top:-7px;cursor:n-resize}.sun-editor .se-resizing-container .se-resize-dot>span.rw{right:-7px;bottom:50%;cursor:e-resize}.sun-editor .se-resizing-container .se-resize-dot>span.bh{right:50%;bottom:-7px;cursor:s-resize}.sun-editor .se-resizing-container .se-resize-display{position:absolute;right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:#fff;background-color:#333;border-radius:4px}.sun-editor .se-controller-table,.sun-editor .se-controller-table-cell{width:auto}.sun-editor .se-controller-link,.sun-editor .se-controller-table,.sun-editor .se-controller-table-cell{padding:0;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143}.sun-editor .se-controller-link:after,.sun-editor .se-controller-link:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.sun-editor .se-controller-link .link-content{padding:0;margin:0}.sun-editor .se-controller-link .link-content a{display:inline-block;color:#4592ff;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;margin-left:5px}.sun-editor .se-notice{position:relative;display:none;width:100%;height:auto;word-break:break-all;font-size:13px;color:#b94a48;background-color:#f2dede;padding:15px;margin:0;border:1px solid #eed3d7;user-select:text;-o-user-select:text;-moz-user-select:text;-khtml-user-select:text;-webkit-user-select:text;-ms-user-select:text}.sun-editor .se-notice button{float:right}.sun-editor .se-tooltip{position:relative;overflow:visible}.sun-editor .se-tooltip .se-tooltip-inner{visibility:hidden;position:absolute;display:block;width:auto;top:120%;left:50%;background:transparent;opacity:0;z-index:1;line-height:1.5;transition:opacity .5s;margin:0;padding:0;bottom:auto;float:none;pointer-events:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden}.sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text{position:relative;display:inline-block;width:auto;left:-50%;font-size:.9em;margin:0;padding:4px 6px;border-radius:2px;background-color:#333;color:#fff;text-align:center;line-height:unset;white-space:nowrap;cursor:auto}.sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text:after{content:"";position:absolute;bottom:100%;left:50%;margin-left:-5px;border:5px solid transparent;border-bottom-color:#333}.sun-editor .se-tooltip:hover .se-tooltip-inner{visibility:visible;opacity:1}@keyframes blinker{50%{opacity:0}}@keyframes spinner{to{transform:rotate(1turn)}}.sun-editor-editable{font-family:Helvetica Neue,sans-serif;font-size:13px;line-height:1.5;color:#333;text-align:left;background-color:#fff;word-break:break-all;word-wrap:break-word;padding:16px;margin:0}.sun-editor-editable *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.sun-editor-editable audio,.sun-editor-editable figcaption,.sun-editor-editable figure,.sun-editor-editable iframe,.sun-editor-editable img,.sun-editor-editable td,.sun-editor-editable th,.sun-editor-editable video{position:relative}.sun-editor-editable .__se__float-left{float:left}.sun-editor-editable .__se__float-right{float:right}.sun-editor-editable .__se__float-center{float:center}.sun-editor-editable .__se__float-none{float:none}.sun-editor-editable span{display:inline;vertical-align:baseline;margin:0;padding:0}.sun-editor-editable a{color:#004cff;text-decoration:none}.sun-editor-editable span[style~="color:"] a{color:inherit}.sun-editor-editable a:focus,.sun-editor-editable a:hover{cursor:pointer;color:#0093ff;text-decoration:underline}.sun-editor-editable pre{display:block;padding:8px;margin:0 0 10px;line-height:1.45;color:#666;background-color:#f9f9f9;border:1px solid #e1e1e1;border-radius:2px;white-space:pre-wrap;word-wrap:break-word;overflow:visible}.sun-editor-editable ol{list-style-type:decimal}.sun-editor-editable ol,.sun-editor-editable ul{display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0;margin-inline-end:0;padding-inline-start:40px}.sun-editor-editable ul{list-style-type:disc}.sun-editor-editable li{display:list-item;text-align:-webkit-match-parent;margin-bottom:5px}.sun-editor-editable ol ol,.sun-editor-editable ol ul,.sun-editor-editable ul ol,.sun-editor-editable ul ul{margin:0}.sun-editor-editable ol ol,.sun-editor-editable ul ol{list-style-type:lower-alpha}.sun-editor-editable ol ol ol,.sun-editor-editable ul ol ol,.sun-editor-editable ul ul ol{list-style-type:upper-roman}.sun-editor-editable ol ul,.sun-editor-editable ul ul{list-style-type:circle}.sun-editor-editable ol ol ul,.sun-editor-editable ol ul ul,.sun-editor-editable ul ul ul{list-style-type:square}.sun-editor-editable sub,.sun-editor-editable sup{font-size:75%;line-height:0}.sun-editor-editable sub{vertical-align:sub}.sun-editor-editable sup{vertical-align:super}.sun-editor-editable p{display:block;margin:0 0 10px}.sun-editor-editable div{display:block;margin:0;padding:0}.sun-editor-editable blockquote{display:block;font-family:inherit;font-size:inherit;color:#999;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0;margin-inline-end:0;padding:0 5px 0 20px;border:solid #b1b1b1;border-width:0 0 0 5px}.sun-editor-editable blockquote blockquote{border-color:#c1c1c1}.sun-editor-editable blockquote blockquote blockquote{border-color:#d1d1d1}.sun-editor-editable blockquote blockquote blockquote blockquote{border-color:#e1e1e1}.sun-editor-editable h1{font-size:2em;margin-block-start:.67em;margin-block-end:.67em}.sun-editor-editable h1,.sun-editor-editable h2{display:block;margin-inline-start:0;margin-inline-end:0;font-weight:700}.sun-editor-editable h2{font-size:1.5em;margin-block-start:.83em;margin-block-end:.83em}.sun-editor-editable h3{font-size:1.17em;margin-block-start:1em;margin-block-end:1em}.sun-editor-editable h3,.sun-editor-editable h4{display:block;margin-inline-start:0;margin-inline-end:0;font-weight:700}.sun-editor-editable h4{font-size:1em;margin-block-start:1.33em;margin-block-end:1.33em}.sun-editor-editable h5{font-size:.83em;margin-block-start:1.67em;margin-block-end:1.67em}.sun-editor-editable h5,.sun-editor-editable h6{display:block;margin-inline-start:0;margin-inline-end:0;font-weight:700}.sun-editor-editable h6{font-size:.67em;margin-block-start:2.33em;margin-block-end:2.33em}.sun-editor-editable hr{display:flex;border-width:1px 0 0;border-color:#000;border-image:initial;height:1px}.sun-editor-editable hr.__se__solid{border-style:solid none none}.sun-editor-editable hr.__se__dotted{border-style:dotted none none}.sun-editor-editable hr.__se__dashed{border-style:dashed none none}.sun-editor-editable table{display:table;table-layout:auto;border:1px solid #ccc;width:100%;max-width:100%;margin:0 0 10px;background-color:transparent;border-spacing:0;border-collapse:collapse}.sun-editor-editable table thead{border-bottom:2px solid #333}.sun-editor-editable table tr{border:1px solid #efefef}.sun-editor-editable table th{background-color:#f3f3f3}.sun-editor-editable table td,.sun-editor-editable table th{border:1px solid #e1e1e1;padding:.4em;background-clip:padding-box}.sun-editor-editable table td.se-table-selected-cell,.sun-editor-editable table th.se-table-selected-cell{border:1px double #4592ff;background-color:#f1f7ff}.sun-editor-editable.se-disabled *{user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none}.sun-editor-editable .se-component{display:flex;padding:1px;margin:0 0 10px}.sun-editor-editable .se-component.__se__float-left{margin:0 20px 10px 0}.sun-editor-editable .se-component.__se__float-right{margin:0 0 10px 20px}.sun-editor-editable[contenteditable=true] .se-component{outline:1px dashed #e1e1e1}.sun-editor-editable audio,.sun-editor-editable iframe,.sun-editor-editable img,.sun-editor-editable video{display:block;margin:0;padding:0;width:auto;height:auto;max-width:100%}.sun-editor-editable[contenteditable=true] figure:after{position:absolute;content:"";z-index:1;top:0;left:0;right:0;bottom:0;cursor:default;display:block;background:transparent}.sun-editor-editable[contenteditable=true] figure a,.sun-editor-editable[contenteditable=true] figure iframe,.sun-editor-editable[contenteditable=true] figure img{z-index:0}.sun-editor-editable[contenteditable=true] figure figcaption{display:block;z-index:2}.sun-editor-editable .se-image-container,.sun-editor-editable .se-video-container{width:auto;height:auto;max-width:100%}.sun-editor-editable figure{display:block;outline:none;margin:0;padding:0}.sun-editor-editable figure figcaption{padding:1em .5em;margin:0;background-color:#f9f9f9;outline:none}.sun-editor-editable figure figcaption p{line-height:2;margin:0}.sun-editor-editable .se-image-container a img{padding:1px;margin:1px;outline:1px solid #4592ff}.sun-editor-editable .se-video-container iframe{outline:1px solid #9e9e9e;position:absolute;top:0;left:0;border:0;width:100%;height:100%}.sun-editor-editable .se-video-container figure{left:0;width:100%;max-width:100%}.sun-editor-editable.se-show-block div,.sun-editor-editable.se-show-block h1,.sun-editor-editable.se-show-block h2,.sun-editor-editable.se-show-block h3,.sun-editor-editable.se-show-block h4,.sun-editor-editable.se-show-block h5,.sun-editor-editable.se-show-block h6,.sun-editor-editable.se-show-block li,.sun-editor-editable.se-show-block ol,.sun-editor-editable.se-show-block p,.sun-editor-editable.se-show-block ul{border:1px dashed #3f9dff!important;padding:10px 8px 8px!important}.se-show-block p{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPAQMAAAAF7dc0AAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAaSURBVAjXY/j/gwGCPvxg+F4BQiAGDP1HQQByxxw0gqOzIwAAAABJRU5ErkJggg==") no-repeat}.se-show-block div{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAPAQMAAAAxlBYoAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAmSURBVAjXY/j//wcDDH+8XsHwDYi/hwNx1A8w/nYLKH4XoQYJAwCXnSgcl2MOPgAAAABJRU5ErkJggg==") no-repeat}.se-show-block h1{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAfSURBVAjXY/j/v4EBhr+9B+LzEPrDeygfhI8j1CBhAEhmJGY4Rf6uAAAAAElFTkSuQmCC") no-repeat}.se-show-block h2{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAmSURBVAjXY/j/v4EBhr+dB+LtQPy9geEDEH97D8T3gbgdoQYJAwA51iPuD2haEAAAAABJRU5ErkJggg==") no-repeat}.se-show-block h3{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAiSURBVAjXY/j/v4EBhr+dB+LtQPy9geHDeQgN5p9HqEHCADeWI+69VG2MAAAAAElFTkSuQmCC") no-repeat}.se-show-block h4{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPAQMAAADTSA1RAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAiSURBVAjXY/j//wADDH97DsTXIfjDdiDdDMTfIRhZHRQDAKJOJ6L+K3y7AAAAAElFTkSuQmCC") no-repeat}.se-show-block h5{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAlSURBVAjXY/j/v4EBhr+1A/F+IO5vYPiwHUh/B2IQfR6hBgkDABlWIy5uM+9GAAAAAElFTkSuQmCC") no-repeat}.se-show-block h6{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAiSURBVAjXY/j/v4EBhr+dB+LtQLy/geFDP5S9HSKOrA6KAR9GIza1ptJnAAAAAElFTkSuQmCC") no-repeat}.se-show-block li{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA7SURBVDhPYxgFcNDQ0PAfykQBIHEYhgoRB/BpwCfHBKWpBkaggYxQGgOgBzyQD1aLLA4TGwWDGjAwAACR3RcEU9Ui+wAAAABJRU5ErkJggg==") no-repeat}.se-show-block ol{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAABHSURBVDhPYxgFcNDQ0PAfhKFcFIBLHCdA1oBNM0kGEmMAPgOZoDTVANUNxAqQvURMECADRiiNAWCagDSGGhyW4DRrMAEGBgAu0SX6WpGgjAAAAABJRU5ErkJggg==") no-repeat}.se-show-block ul{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAA1SURBVDhPYxgFDA0NDf+hTBSALI5LDQgwQWmqgVEDKQcsUBoF4ItFGEBXA+QzQpmDGjAwAAA8DQ4Lni6gdAAAAABJRU5ErkJggg==") no-repeat}.sun-editor-editable .__se__p-bordered,.sun-editor .__se__p-bordered{border-top:1px solid #b1b1b1;border-bottom:1px solid #b1b1b1;padding:4px 0}.sun-editor-editable .__se__p-spaced,.sun-editor .__se__p-spaced{letter-spacing:1px}.sun-editor-editable .__se__p-neon,.sun-editor .__se__p-neon{font-weight:200;font-style:italic;background:#000;color:#fff;padding:6px 4px;border:2px solid #fff;border-radius:6px;text-transform:uppercase;animation:neonFlicker 1.5s infinite alternate}@keyframes neonFlicker{0%,19%,21%,23%,25%,54%,56%,to{text-shadow:-.2rem -.2rem 1rem #fff,.2rem .2rem 1rem #fff,0 0 2px #f40,0 0 4px #f40,0 0 6px #f40,0 0 8px #f40,0 0 10px #f40;box-shadow:0 0 .5px #fff,inset 0 0 .5px #fff,0 0 2px #08f,inset 0 0 2px #08f,0 0 4px #08f,inset 0 0 4px #08f}20%,24%,55%{text-shadow:none;box-shadow:none}}.sun-editor-editable .__se__t-shadow,.sun-editor .__se__t-shadow{text-shadow:-.2rem -.2rem 1rem #fff,.2rem .2rem 1rem #fff,0 0 .2rem #999,0 0 .4rem #888,0 0 .6rem #777,0 0 .8rem #666,0 0 1rem #555} \ No newline at end of file diff --git a/dist/suneditor.min.js b/dist/suneditor.min.js index 0426e37cc..37b8a10dd 100644 --- a/dist/suneditor.min.js +++ b/dist/suneditor.min.js @@ -1 +1 @@ -!function(e){var t={};function i(n){if(t[n])return t[n].exports;var l=t[n]={i:n,l:!1,exports:{}};return e[n].call(l.exports,l,l.exports,i),l.l=!0,l.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"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&t&&"string"!=typeof e)for(var l in e)i.d(n,l,function(t){return e[t]}.bind(null,l));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="XJR1")}({"3FqI":function(e,t,i){},P6u4:function(e,t,i){"use strict";var n,l;n="undefined"!=typeof window?window:this,l=function(e,t){const i={toolbar:{default:"Default",save:"Save",font:"Font",formats:"Formats",fontSize:"Size",bold:"Bold",underline:"Underline",italic:"Italic",strike:"Strike",subscript:"Subscript",superscript:"Superscript",removeFormat:"Remove Format",fontColor:"Font Color",hiliteColor:"Highlight Color",indent:"Indent",outdent:"Outdent",align:"Align",alignLeft:"Align left",alignRight:"Align right",alignCenter:"Align center",alignJustify:"Align justify",list:"List",orderList:"Ordered list",unorderList:"Unordered list",horizontalRule:"Horizontal line",hr_solid:"Solid",hr_dotted:"Dotted",hr_dashed:"Dashed",table:"Table",link:"Link",image:"Image",video:"Video",fullScreen:"Full screen",showBlocks:"Show blocks",codeView:"Code view",undo:"Undo",redo:"Redo",preview:"Preview",print:"print",tag_p:"Paragraph",tag_div:"Normal (DIV)",tag_h:"Header",tag_blockquote:"Quote",tag_pre:"Code",template:"Template",lineHeight:"Line height",paragraphStyle:"Paragraph style",textStyle:"Text style"},dialogBox:{linkBox:{title:"Insert Link",url:"URL to link",text:"Text to display",newWindowCheck:"Open in new window"},imageBox:{title:"Insert image",file:"Select from files",url:"Image URL",altText:"Alternative text"},videoBox:{title:"Insert Video",url:"Media embed URL, YouTube"},caption:"Insert description",close:"Close",submitButton:"Submit",revertButton:"Revert",proportion:"Constrain proportions",basic:"Basic",left:"Left",right:"Right",center:"Center",width:"Width",height:"Height",size:"Size",ratio:"Ratio"},controller:{edit:"Edit",unlink:"Unlink",remove:"Remove",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:"Delete row",insertColumnBefore:"Insert column before",insertColumnAfter:"Insert column after",deleteColumn:"Delete column",resize100:"Resize 100%",resize75:"Resize 75%",resize50:"Resize 50%",resize25:"Resize 25%",autoSize:"Auto size",mirrorHorizontal:"Mirror, Horizontal",mirrorVertical:"Mirror, Vertical",rotateLeft:"Rotate left",rotateRight:"Rotate right",maxSize:"Max size",minSize:"Min size",tableHeader:"Table header",mergeCells:"Merge cells",splitCells:"Split Cells",HorizontalSplit:"Horizontal split",VerticalSplit:"Vertical split"},menu:{spaced:"Spaced",bordered:"Bordered",neon:"Neon",translucent:"Translucent",shadow:"Shadow"}};return void 0===t&&(e.SUNEDITOR_LANG||(e.SUNEDITOR_LANG={}),e.SUNEDITOR_LANG.en=i),i},"object"==typeof e.exports?e.exports=n.document?l(n,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return l(e)}:l(n)},WUQj:function(e,t,i){},XJR1:function(e,t,i){"use strict";i.r(t);i("3FqI"),i("WUQj");var n={name:"colorPicker",add:function(e){const t=e.context;t.colorPicker={colorListHTML:"",_colorInput:"",_defaultColor:"#000",_styleProperty:"color",_currentColor:"",_colorList:[]};let i=this.createColorList(e.context.option,e.lang,this._makeColorList);t.colorPicker.colorListHTML=i,i=null},createColorList:function(e,t,i){const n=e.colorList&&0!==e.colorList.length?e.colorList:["#ff0000","#ff5e00","#ffe400","#abf200","#00d8ff","#0055ff","#6600ff","#ff00dd","#000000","#ffd8d8","#fae0d4","#faf4c0","#e4f7ba","#d4f4fa","#d9e5ff","#e8d9ff","#ffd9fa","#f1f1f1","#ffa7a7","#ffc19e","#faed7d","#cef279","#b2ebf4","#b2ccff","#d1b2ff","#ffb2f5","#bdbdbd","#f15f5f","#f29661","#e5d85c","#bce55c","#5cd1e5","#6699ff","#a366ff","#f261df","#8c8c8c","#980000","#993800","#998a00","#6b9900","#008299","#003399","#3d0099","#990085","#353535","#670000","#662500","#665c00","#476600","#005766","#002266","#290066","#660058","#222222"];let l=[],o='
';for(let e=0,t=n.length;e0&&(o+='
'+i(l)+"
",l=[]),"object"==typeof n[e]&&(o+='
'+i(n[e])+"
"));return o+='
",o},_makeColorList:function(e){let t="";t+='",t},init:function(e,t){const i=this.plugins.colorPicker;let n=t||(i.getColorInNode.call(this,e)||this.context.colorPicker._defaultColor);n=i.isHexColor(n)?n:i.rgb2hex(n)||n;const l=this.context.colorPicker._colorList;if(l)for(let e=0,t=l.length;e=3&&"#"+((1<<24)+(i[0]<<16)+(i[1]<<8)+i[2]).toString(16).substr(1)}},l={name:"dialog",add:function(e){const t=e.context;t.dialog={kind:"",updateModal:!1};let i=e.util.createElement("DIV");i.className="se-dialog sun-editor-common";let n=e.util.createElement("DIV");n.className="se-dialog-back",n.style.display="none";let l=e.util.createElement("DIV");l.className="se-dialog-inner",l.style.display="none",i.appendChild(n),i.appendChild(l),t.dialog.modalArea=i,t.dialog.back=n,t.dialog.modal=l,t.dialog.modal.addEventListener("click",this.onClick_dialog.bind(e)),t.element.relative.appendChild(i),i=null,n=null,l=null},onClick_dialog:function(e){e.stopPropagation(),(/se-dialog-inner/.test(e.target.className)||/close/.test(e.target.getAttribute("data-command")))&&this.plugins.dialog.close.call(this)},open:function(e,t){if(this.modalForm)return!1;this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null),this.plugins.dialog._bindClose=function(e){/27/.test(e.keyCode)&&this.plugins.dialog.close.call(this)}.bind(this),this._d.addEventListener("keydown",this.plugins.dialog._bindClose),this.context.dialog.updateModal=t,"full"===this.context.option.popupDisplay?this.context.dialog.modalArea.style.position="fixed":this.context.dialog.modalArea.style.position="absolute",this.context.dialog.kind=e,this.modalForm=this.context[e].modal;const i=this.context[e].focusElement;"function"==typeof this.plugins[e].on&&this.plugins[e].on.call(this,t),this.context.dialog.modalArea.style.display="block",this.context.dialog.back.style.display="block",this.context.dialog.modal.style.display="block",this.modalForm.style.display="block",i&&i.focus()},_bindClose:null,close:function(){this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null);const e=this.context.dialog.kind;this.modalForm.style.display="none",this.context.dialog.back.style.display="none",this.context.dialog.modalArea.style.display="none",this.context.dialog.kind="",this.context.dialog.updateModal=!1,this.plugins[e].init.call(this),this.modalForm=null,this.focus()}},o={name:"resizing",add:function(e){const t=e.context;t.resizing={_resizeClientX:0,_resizeClientY:0,_resize_plugin:"",_resize_w:0,_resize_h:0,_origin_w:0,_origin_h:0,_rotateVertical:!1,_resize_direction:"",_move_path:null,_isChange:!1};let i=this.setController_resize.call(e);t.resizing.resizeContainer=i,t.resizing.resizeDiv=i.querySelector(".se-modal-resize"),t.resizing.resizeDot=i.querySelector(".se-resize-dot"),t.resizing.resizeDisplay=i.querySelector(".se-resize-display");let n=this.setController_button.call(e);t.resizing.resizeButton=n,n.addEventListener("mousedown",(function(e){e.stopPropagation()}),!1);let l=t.resizing.resizeHandles=t.resizing.resizeDot.querySelectorAll("span");t.resizing.resizeButtonGroup=n.querySelector("._se_resizing_btn_group"),t.resizing.rotationButtons=n.querySelectorAll("._se_resizing_btn_group ._se_rotation"),t.resizing.percentageButtons=n.querySelectorAll("._se_resizing_btn_group ._se_percentage"),t.resizing.alignMenu=n.querySelector(".se-resizing-align-list"),t.resizing.alignMenuList=t.resizing.alignMenu.querySelectorAll("button"),t.resizing.alignButton=n.querySelector("._se_resizing_align_button"),t.resizing.alignButtonIcon=t.resizing.alignButton.querySelector("i"),t.resizing.autoSizeButton=n.querySelector("._se_resizing_btn_group ._se_auto_size"),t.resizing.captionButton=n.querySelector("._se_resizing_caption_button"),l[0].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[1].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[2].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[3].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[4].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[5].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[6].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[7].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),n.addEventListener("click",this.onClick_resizeButton.bind(e)),t.element.relative.appendChild(i),t.element.relative.appendChild(n),i=null,n=null,l=null},setController_resize:function(){const e=this.util.createElement("DIV");return e.className="se-resizing-container",e.style.display="none",e.innerHTML='
',e},setController_button:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-resizing",t.innerHTML='
",t},_module_getSizeX:function(e,t,i,n){return t||(t=e._element),i||(i=e._cover),n||(n=e._container),n&&i&&t?/%$/.test(t.style.width)?(this.util.getNumber(n.style.width,2)||100)+"%":t.style.width:""},_module_getSizeY:function(e,t,i,n){return t||(t=e._element),i||(i=e._cover),n||(n=e._container),n&&i&&t?this.util.getNumber(i.style.paddingBottom)>0&&!this.context.resizing._rotateVertical?i.style.height:/%$/.test(t.style.height)&&/%$/.test(t.style.width)?(this.util.getNumber(n.style.height,2)||100)+"%":t.style.height:""},_module_setModifyInputSize:function(e,t){const i=e._onlyPercentage&&this.context.resizing._rotateVertical;e.proportion.checked=e._proportionChecked="false"!==e._element.getAttribute("data-proportion");let n=i?"":this.plugins.resizing._module_getSizeX.call(this,e);if(n===e._defaultSizeX&&(n=""),e._onlyPercentage&&(n=this.util.getNumber(n,2)),e.inputX.value=n,t.setInputSize.call(this,"x"),!e._onlyPercentage){let t=i?"":this.plugins.resizing._module_getSizeY.call(this,e);t===e._defaultSizeY&&(t=""),e._onlyPercentage&&(t=this.util.getNumber(t,2)),e.inputY.value=t}e.inputX.disabled=!!i,e.inputY.disabled=!!i,e.proportion.disabled=!!i,t.setRatio.call(this)},_module_setInputSize:function(e,t){if(e._onlyPercentage)"x"===t&&e.inputX.value>100&&(e.inputX.value=100);else if(e.proportion.checked&&e._ratio&&/\d/.test(e.inputX.value)&&/\d/.test(e.inputY.value)){const i=e.inputX.value.replace(/\d+|\./g,"")||e.sizeUnit,n=e.inputY.value.replace(/\d+|\./g,"")||e.sizeUnit;if(i!==n)return;const l="%"===i?2:0;"x"===t?e.inputY.value=this.util.getNumber(e._ratioY*this.util.getNumber(e.inputX.value,l),l)+n:e.inputX.value=this.util.getNumber(e._ratioX*this.util.getNumber(e.inputY.value,l),l)+i}},_module_setRatio:function(e){const t=e.inputX.value,i=e.inputY.value;if(e.proportion.checked&&/\d+/.test(t)&&/\d+/.test(i)){if((t.replace(/\d+|\./g,"")||e.sizeUnit)!==(i.replace(/\d+|\./g,"")||e.sizeUnit))e._ratio=!1;else if(!e._ratio){const n=this.util.getNumber(t),l=this.util.getNumber(i);e._ratio=!0,e._ratioX=n/l,e._ratioY=l/n}}else e._ratio=!1},_module_sizeRevert:function(e){e._onlyPercentage?e.inputX.value=e._origin_w>100?100:e._origin_w:(e.inputX.value=e._origin_w,e.inputY.value=e._origin_h)},_module_saveCurrentSize:function(e){const t=this.plugins.resizing._module_getSizeX.call(this,e),i=this.plugins.resizing._module_getSizeY.call(this,e);e._element.setAttribute("data-size",t+","+i),e._videoRatio&&(e._videoRatio=i)},call_controller_resize:function(e,t){const i=this.context.resizing,n=this.context[t];i._resize_plugin=t;const l=i.resizeContainer,o=i.resizeDiv,s=this.util.getOffset(e,this.context.element.wysiwygFrame),a=i._rotateVertical=/^(90|270)$/.test(Math.abs(e.getAttribute("data-rotate")).toString()),r=a?e.offsetHeight:e.offsetWidth,c=a?e.offsetWidth:e.offsetHeight,d=s.top,u=s.left-this.context.element.wysiwygFrame.scrollLeft;l.style.top=d+"px",l.style.left=u+"px",l.style.width=r+"px",l.style.height=c+"px",o.style.top="0px",o.style.left="0px",o.style.width=r+"px",o.style.height=c+"px";let h=e.getAttribute("data-align")||"basic";h="none"===h?"basic":h;const p=this.util.getParentElement(e,this.util.isComponent),g=this.util.getParentElement(e,"FIGURE"),m=this.plugins.resizing._module_getSizeX.call(this,n,e,g,p)||"auto",f=n._onlyPercentage&&"image"===t?"":", "+(this.plugins.resizing._module_getSizeY.call(this,n,e,g,p)||"auto");this.util.changeTxt(i.resizeDisplay,this.lang.dialogBox[h]+" ("+m+f+")"),i.resizeButtonGroup.style.display=n._resizing?"":"none";const _=!n._resizing||n._resizeDotHide||n._onlyPercentage?"none":"flex",b=i.resizeHandles;for(let e=0,t=b.length;e",e},set_cover:function(e){const t=this.util.createElement("FIGURE");return t.appendChild(e),t},set_container:function(e,t){const i=this.util.createElement("DIV");return i.className="se-component "+t,i.setAttribute("contenteditable",!1),i.appendChild(e),i},onClick_resizeButton:function(e){e.stopPropagation();const t=e.target,i=t.getAttribute("data-command")||t.parentNode.getAttribute("data-command");if(!i)return;const n=t.getAttribute("data-value")||t.parentNode.getAttribute("data-value"),l=this.context.resizing._resize_plugin,o=this.context[l],s=o._element,a=this.plugins[l];if(e.preventDefault(),"function"!=typeof this.plugins.resizing._closeAlignMenu||(this.plugins.resizing._closeAlignMenu(),"onalign"!==i)){switch(i){case"auto":a.setAutoSize.call(this),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,l));break;case"percent":let e=this.plugins.resizing._module_getSizeY.call(this,o);if(this.context.resizing._rotateVertical){const t=s.getAttribute("data-percentage");t&&(e=t.split(",")[1])}this.plugins.resizing.resetTransform.call(this,s),a.setPercentSize.call(this,100*n,e),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,l));break;case"mirror":const t=s.getAttribute("data-rotate")||"0";let i=s.getAttribute("data-rotateX")||"",r=s.getAttribute("data-rotateY")||"";"h"===n&&!this.context.resizing._rotateVertical||"v"===n&&this.context.resizing._rotateVertical?r=r?"":"180":i=i?"":"180",s.setAttribute("data-rotateX",i),s.setAttribute("data-rotateY",r),this.plugins.resizing._setTransForm(s,t,i,r);break;case"rotate":const c=this.context.resizing,d=1*s.getAttribute("data-rotate")+1*n,u=this._w.Math.abs(d)>=360?0:d;s.setAttribute("data-rotate",u),c._rotateVertical=/^(90|270)$/.test(this._w.Math.abs(u).toString()),this.plugins.resizing.setTransformSize.call(this,s,null,null),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,l));break;case"onalign":this.plugins.resizing.openAlignMenu.call(this);break;case"align":const h="basic"===n?"none":n;a.setAlign.call(this,h,null,null,null),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,l));break;case"caption":const p=!o._captionChecked;if(a.openModify.call(this,!0),o._captionChecked=o.captionCheckEl.checked=p,"image"===l?a.update_image.call(this,!1,!1,!1):"video"===l&&(this.context.dialog.updateModal=!0,a.submitAction.call(this)),p){const e=this.util.getChildElement(o._caption,(function(e){return 3===e.nodeType}));e?this.setRange(e,0,e,e.textContent.length):o._caption.focus(),this.controllersOff()}else a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,l)),a.openModify.call(this,!0);break;case"revert":a.setOriginSize.call(this),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,l));break;case"update":a.openModify.call(this),this.controllersOff();break;case"delete":a.destroy.call(this)}this.history.push(!1)}},resetTransform:function(e){const t=(e.getAttribute("data-size")||e.getAttribute("data-origin")||"").split(",");this.context.resizing._rotateVertical=!1,e.style.maxWidth="",e.style.transform="",e.style.transformOrigin="",e.setAttribute("data-rotate",""),e.setAttribute("data-rotateX",""),e.setAttribute("data-rotateY",""),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,t[0]?t[0]:"auto",t[1]?t[1]:"",!0)},setTransformSize:function(e,t,i){let n=e.getAttribute("data-percentage");const l=this.context.resizing._rotateVertical,o=1*e.getAttribute("data-rotate");let s="";if(n&&!l)n=n.split(","),"auto"===n[0]&&"auto"===n[1]?this.plugins[this.context.resizing._resize_plugin].setAutoSize.call(this):this.plugins[this.context.resizing._resize_plugin].setPercentSize.call(this,n[0],n[1]);else{const n=this.util.getParentElement(e,"FIGURE"),a=t||e.offsetWidth,r=i||e.offsetHeight,c=(l?r:a)+"px",d=(l?a:r)+"px";if(this.plugins[this.context.resizing._resize_plugin].cancelPercentAttr.call(this),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,a+"px",r+"px",!0),n.style.width=c,n.style.height=this.context[this.context.resizing._resize_plugin]._caption?"":d,l){let e=a/2+"px "+a/2+"px 0",t=r/2+"px "+r/2+"px 0";s=90===o||-270===o?t:e}}e.style.transformOrigin=s,this.plugins.resizing._setTransForm(e,o.toString(),e.getAttribute("data-rotateX")||"",e.getAttribute("data-rotateY")||""),e.style.maxWidth=l?"none":"",this.plugins.resizing.setCaptionPosition.call(this,e)},_setTransForm:function(e,t,i,n){let l=(e.offsetWidth-e.offsetHeight)*(/-/.test(t)?1:-1),o="";if(/[1-9]/.test(t)&&(i||n))switch(o=i?"Y":"X",t){case"90":o=i&&n?"X":n?o:"";break;case"270":l*=-1,o=i&&n?"Y":i?o:"";break;case"-90":o=i&&n?"Y":i?o:"";break;case"-270":l*=-1,o=i&&n?"X":n?o:"";break;default:o=""}t%180==0&&(e.style.maxWidth=""),e.style.transform="rotate("+t+"deg)"+(i?" rotateX("+i+"deg)":"")+(n?" rotateY("+n+"deg)":"")+(o?" translate"+o+"("+l+"px)":"")},setCaptionPosition:function(e){const t=this.util.getChildElement(this.util.getParentElement(e,"FIGURE"),"FIGCAPTION");t&&(t.style.marginTop=(this.context.resizing._rotateVertical?e.offsetWidth-e.offsetHeight:0)+"px")},onMouseDown_resize_handle:function(e){const t=this.context.resizing,i=t._resize_direction=e.target.classList[0];e.stopPropagation(),e.preventDefault();const n=this.context.resizing._resize_plugin,l=this.context[n]._element,o=this.plugins[n];t._resizeClientX=e.clientX,t._resizeClientY=e.clientY,this.context.element.resizeBackground.style.display="block",t.resizeButton.style.display="none",t.resizeDiv.style.float=/l/.test(i)?"right":/r/.test(i)?"left":"none";const s=function(e){if("keydown"===e.type&&27!==e.keyCode)return;const i=t._isChange;t._isChange=!1,this.removeDocEvent("mousemove",a),this.removeDocEvent("mouseup",s),this.removeDocEvent("keydown",s),"keydown"===e.type?(this.controllersOff(),this.context.element.resizeBackground.style.display="none",this.plugins[this.context.resizing._resize_plugin].init.call(this)):(this.plugins.resizing.cancel_controller_resize.call(this),i&&this.history.push(!1)),o.onModifyMode.call(this,l,this.plugins.resizing.call_controller_resize.call(this,l,t._resize_plugin))}.bind(this),a=this.plugins.resizing.resizing_element.bind(this,t,i,this.context[t._resize_plugin]);this.addDocEvent("mousemove",a),this.addDocEvent("mouseup",s),this.addDocEvent("keydown",s)},resizing_element:function(e,t,i,n){const l=n.clientX,o=n.clientY;let s=i._element_w,a=i._element_h;const r=i._element_w+(/r/.test(t)?l-e._resizeClientX:e._resizeClientX-l),c=i._element_h+(/b/.test(t)?o-e._resizeClientY:e._resizeClientY-o),d=i._element_h/i._element_w*r;/t/.test(t)&&(e.resizeDiv.style.top=i._element_h-(/h/.test(t)?c:d)+"px"),/l/.test(t)&&(e.resizeDiv.style.left=i._element_w-r+"px"),/r|l/.test(t)&&(e.resizeDiv.style.width=r+"px",s=r),/^(t|b)[^h]$/.test(t)?(e.resizeDiv.style.height=d+"px",a=d):/^(t|b)h$/.test(t)&&(e.resizeDiv.style.height=c+"px",a=c),e._resize_w=s,e._resize_h=a,this.util.changeTxt(e.resizeDisplay,this._w.Math.round(s)+" x "+this._w.Math.round(a)),e._isChange=!0},cancel_controller_resize:function(){const e=this.context.resizing._rotateVertical;this.controllersOff(),this.context.element.resizeBackground.style.display="none";let t=this._w.Math.round(e?this.context.resizing._resize_h:this.context.resizing._resize_w),i=this._w.Math.round(e?this.context.resizing._resize_w:this.context.resizing._resize_h);if(!e&&!/%$/.test(t)){const e=16,n=this.context.element.wysiwygFrame.clientWidth-2*e-2;this.util.getNumber(t)>n&&(i=this._w.Math.round(i/t*n),t=n)}this.plugins[this.context.resizing._resize_plugin].setSize.call(this,t,i,!1),this.plugins[this.context.resizing._resize_plugin].init.call(this)}},s={name:"notice",add:function(e){const t=e.context;t.notice={};let i=e.util.createElement("DIV"),n=e.util.createElement("SPAN"),l=e.util.createElement("BUTTON");i.className="se-notice",l.className="close",l.setAttribute("aria-label","Close"),l.setAttribute("title",e.lang.dialogBox.close),l.innerHTML='',i.appendChild(n),i.appendChild(l),t.notice.modal=i,t.notice.message=n,l.addEventListener("click",this.onClick_cancel.bind(e)),t.element.relative.insertBefore(i,t.element.editorArea),i=null},onClick_cancel:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.notice.close.call(this)},open:function(e){this.context.notice.message.textContent=e,this.context.notice.modal.style.display="block"},close:function(){this.context.notice.modal.style.display="none"}},a={align:{name:"align",add:function(e,t){const i=e.context;i.align={_alignList:null,currentAlign:""};let n=this.setSubmenu.call(e),l=n.querySelector("ul");l.addEventListener("click",this.pickup.bind(e)),i.align._alignList=l.querySelectorAll("li button"),t.parentNode.appendChild(n),n=null,l=null},setSubmenu:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-list-layer",t.innerHTML='
",t},on:function(){const e=this.context.align,t=e._alignList,i=this.commandMap.ALIGN.getAttribute("data-focus")||"left";if(i!==e.currentAlign){for(let e=0,n=t.length;e('+t.toolbar.default+")";for(o=0,s=a.length;o";return r+="",i.innerHTML=r,i},on:function(){const e=this.context.font,t=e._fontList,i=this.commandMap.FONT.textContent;if(i!==e.currentFont){for(let e=0,n=t.length;e('+t.toolbar.default+")";for(let t,i=0,o=e.fontSizeUnit,s=n.length;i";return l+="",i.innerHTML=l,i},on:function(){const e=this.context.fontSize,t=e._sizeList,i=this.commandMap.SIZE.textContent;if(i!==e.currentSize){for(let e=0,n=t.length;e
  • ",t},appendHr:function(e){const t=this.util.createElement("HR");t.className=e,this.focus();let i=this.insertComponent(t,!1);this.setRange(i,0,i,0)},horizontalRulePick:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,i=null;for(;!i&&!/UL/i.test(t.tagName);)i=t.getAttribute("data-value"),t=t.parentNode;i&&(this.plugins.horizontalRule.appendHr.call(this,"__se__"+i),this.submenuOff())}},list:{name:"list",add:function(e,t){const i=e.context;i.list={_list:null,currentList:""};let n=this.setSubmenu.call(e),l=n.querySelector("ul");l.addEventListener("click",this.pickup.bind(e)),i.list._list=l.querySelectorAll("li button"),t.parentNode.appendChild(n),n=null,l=null},setSubmenu:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-submenu se-list-layer",t.innerHTML='
    ",t},on:function(){const e=this.context.list,t=e._list,i=this.commandMap.LI.getAttribute("data-focus")||"";if(i!==e.currentList){for(let e=0,n=t.length;e"),e.innerHTML+=t.outerHTML,i&&(e.innerHTML+="
    ")}else e.innerHTML=t.innerHTML;r.appendChild(e),s||(h=r),s&&d===c&&!this.util.isRangeFormatElement(g)||(u||(u=r),l&&s&&d===c||s&&this.util.isList(c)&&c===a||r.parentNode!==d&&d.insertBefore(r,g)),this.util.removeItem(t),l&&null===p&&(p=r.children.length-1),s&&this.util.getRangeFormatElement(c,m)!==this.util.getRangeFormatElement(a,m)&&(r=this.util.createElement(i)),f&&0===f.children.length&&this.util.removeItem(f)}else this.util.removeItem(t);p&&(u=u.children[p]),a&&(g=r.children.length-1,r.innerHTML+=d.innerHTML,h=r.children[g],this.util.removeItem(d)),o=s=this.util.getEdgeChildNodes(u.firstChild,h.lastChild)}else{const e=this.util.getRangeFormatElement(this.getSelectionNode()),t=e&&e.tagName===i;let l,a;const r=function(e){return!this.isComponent(e)}.bind(this.util);t||(a=this.util.createElement(i));for(let e,c,d=0,u=n.length;d1?this.setRange(o.sc,0,s.ec,s.ec.textContent.length):this.setRange(o.ec,o.ec.textContent.length,s.ec,s.ec.textContent.length),this.submenuOff(),this.history.push(!1)}},table:{name:"table",add:function(e,t){const i=e.context;i.table={_element:null,_tdElement:null,_trElement:null,_trElements:null,_tableXY:[],_maxWidth:!0,resizeIcon:null,resizeText:null,headerButton:null,mergeButton:null,splitButton:null,splitMenu:null,maxText:e.lang.controller.maxSize,minText:e.lang.controller.minSize,_physical_cellCnt:0,_logical_cellCnt:0,_rowCnt:0,_rowIndex:0,_physical_cellIndex:0,_logical_cellIndex:0,_current_colSpan:0,_current_rowSpan:0};let n=this.setSubmenu.call(e),l=n.querySelector(".se-controller-table-picker");i.table.tableHighlight=n.querySelector(".se-table-size-highlighted"),i.table.tableUnHighlight=n.querySelector(".se-table-size-unhighlighted"),i.table.tableDisplay=n.querySelector(".se-table-size-display");let o=this.setController_table.call(e);i.table.tableController=o,i.table.resizeIcon=o.querySelector("._se_table_resize > i"),i.table.resizeText=o.querySelector("._se_table_resize > span > span"),i.table.headerButton=o.querySelector("._se_table_header"),o.addEventListener("mousedown",(function(e){e.stopPropagation()}),!1);let s=this.setController_tableEditor.call(e);i.table.resizeDiv=s,i.table.splitMenu=s.querySelector(".se-btn-group-sub"),i.table.mergeButton=s.querySelector("._se_table_merge_button"),i.table.splitButton=s.querySelector("._se_table_split_button"),s.addEventListener("mousedown",(function(e){e.stopPropagation()}),!1),l.addEventListener("mousemove",this.onMouseMove_tablePicker.bind(e)),l.addEventListener("click",this.appendTable.bind(e)),s.addEventListener("click",this.onClick_tableController.bind(e)),o.addEventListener("click",this.onClick_tableController.bind(e)),t.parentNode.appendChild(n),i.element.relative.appendChild(s),i.element.relative.appendChild(o),n=null,l=null,s=null,o=null},setSubmenu:function(){const e=this.util.createElement("DIV");return e.className="se-submenu se-selector-table",e.innerHTML='
    1 x 1
    ',e},setController_table:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-table",t.innerHTML='
    ",t},setController_tableEditor:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-table-cell",t.innerHTML='
    • '+e.controller.VerticalSplit+'
    • '+e.controller.HorizontalSplit+"
    ",t},appendTable:function(){const e=this.util.createElement("TABLE"),t=this.plugins.table.createCells,i=this.context.table._tableXY[0];let n=this.context.table._tableXY[1],l="";for(;n>0;)l+=""+t.call(this,"td",i)+"",--n;l+="",e.innerHTML=l,this.insertComponent(e,!1);const o=e.querySelector("td div");this.setRange(o,0,o,0),this.plugins.table.reset_table_picker.call(this)},createCells:function(e,t,i){if(e=e.toLowerCase(),i){const t=this.util.createElement(e);return t.innerHTML="

    ",t}{let i="";for(;t>0;)i+="<"+e+">

    ",t--;return i}},onMouseMove_tablePicker:function(e){e.stopPropagation();let t=this._w.Math.ceil(e.offsetX/18),i=this._w.Math.ceil(e.offsetY/18);t=t<1?1:t,i=i<1?1:i,this.context.table.tableHighlight.style.width=t+"em",this.context.table.tableHighlight.style.height=i+"em";let n=t<5?5:t>9?10:t+1,l=i<5?5:i>9?10:i+1;this.context.table.tableUnHighlight.style.width=n+"em",this.context.table.tableUnHighlight.style.height=l+"em",this.util.changeTxt(this.context.table.tableDisplay,t+" x "+i),this.context.table._tableXY=[t,i]},reset_table_picker:function(){if(!this.context.table.tableHighlight)return;const e=this.context.table.tableHighlight.style,t=this.context.table.tableUnHighlight.style;e.width="1em",e.height="1em",t.width="5em",t.height="5em",this.util.changeTxt(this.context.table.tableDisplay,"1 x 1"),this.submenuOff()},init:function(){const e=this.context.table,t=this.plugins.table;if(t._removeEvents.call(this),t._selectedTable){const e=t._selectedTable.querySelectorAll(".se-table-selected-cell");for(let t=0,i=e.length;t0)for(let e,t=0;to||(u>=e.index?(n+=e.cs,u+=e.cs,e.rs-=1,e.row=o+1,e.rs<1&&(r.splice(t,1),t--)):h===p-1&&(e.rs-=1,e.row=o+1,e.rs<1&&(r.splice(t,1),t--)));if(o===s&&h===l){i._logical_cellIndex=u;break}d>0&&a.push({index:u,cs:c+1,rs:d,row:-1}),n+=c}r=r.concat(a).sort((function(e,t){return e.index-t.index})),a=[]}a=null,r=null}},editTable:function(e,t){const i=this.plugins.table,n=this.context.table,l=n._element,o="row"===e;if(o){const e=n._trElement.parentNode;if(/^THEAD$/i.test(e.nodeName)){if("up"===t)return;if(!e.nextElementSibling||!/^TBODY$/i.test(e.nextElementSibling.nodeName))return void(l.innerHTML+=""+i.createCells.call(this,"td",n._logical_cellCnt,!1)+"")}}if(i._ref){const e=n._tdElement,l=i._selectedCells;if(o)if(t)i.setCellInfo.call(this,"up"===t?l[0]:l[l.length-1],!0),i.editRow.call(this,t,e);else{let e=l[0].parentNode;const n=[l[0]];for(let t,i=1,o=l.length;is&&s>t&&(e[l].rowSpan=i+a,c-=n)}if(n){const e=r[o+1];if(e){const t=[];let i=r[o].cells,n=0;for(let e,l,o=0,s=i.length;o1&&(e.rowSpan-=1,t.push({cell:e.cloneNode(!1),index:l}));if(t.length>0){let l=t.shift();i=e.cells,n=0;for(let o,s,a=0,r=i.length;a=l.index)||(a--,n--,n+=l.cell.colSpan-1,e.insertBefore(l.cell,o),l=t.shift(),l));a++);if(l){e.appendChild(l.cell);for(let i=0,n=t.length;i0){const e=!o[b+1];for(let t,i=0;i_||(g>=t.index?(f+=t.cs,g=b+f,t.rs-=1,t.row=_+1,t.rs<1&&(d.splice(i,1),i--)):e&&(t.rs-=1,t.row=_+1,t.rs<1&&(d.splice(i,1),i--)))}i>0&&c.push({rs:i,cs:r+1,index:g,row:-1}),g>=t&&g+r<=t+s?h.push(e):g<=t+s&&g+r>=t?e.colSpan-=n.getOverlapRangeAtIndex(a,a+s,g,g+r):i>0&&(gt+s)&&p.push({cell:e,i:_,rs:_+i}),f+=r}else{if(b>=t)break;if(r>0){if(u<1&&r+b>=t){e.colSpan+=1,t=null,u=i+1;break}t-=r}if(!m){for(let e,i=0;i0){u-=1;continue}null!==t&&o.length>0&&(g=this.plugins.table.createCells.call(this,o[0].nodeName,0,!0),g=e.insertBefore(g,o[t]))}}if(l){let e,t;for(let i,l=0,o=h.length;l1)c.colSpan=this._w.Math.floor(e/2),l.colSpan=e-c.colSpan,s.insertBefore(c,l.nextElementSibling);else{let t=[],i=[];for(let s,r,c=0,d=n._rowCnt;c0)for(let e,t=0;tc||(u>=e.index?(r+=e.cs,u+=e.cs,e.rs-=1,e.row=c+1,e.rs<1&&(i.splice(t,1),t--)):h===p-1&&(e.rs-=1,e.row=c+1,e.rs<1&&(i.splice(t,1),t--)));if(u<=a&&d>0&&t.push({index:u,cs:o+1,rs:d,row:-1}),n!==l&&u<=a&&u+o>=a+e-1){n.colSpan+=1;break}if(u>a)break;r+=o}i=i.concat(t).sort((function(e,t){return e.index-t.index})),t=[]}s.insertBefore(c,l.nextElementSibling)}}else{const e=l.rowSpan;if(c.colSpan=l.colSpan,e>1){c.rowSpan=this._w.Math.floor(e/2);const i=e-c.rowSpan,n=[],r=t.getArrayIndex(o,s)+i;for(let e,t,i=0;i=a));c++)l=e[c],o=l.rowSpan-1,o>0&&o+i>=r&&s=h.index&&(r+=h.cs,l+=h.cs,h=n.shift()),l>=a||o===s-1){d.insertBefore(c,e.nextElementSibling);break}r+=t}l.rowSpan=i}else{c.rowSpan=l.rowSpan;const e=t.createElement("TR");e.appendChild(c);for(let e,t=0;t=r&&(e[i].rowSpan+=1)}const i=n._physical_cellIndex,a=s.cells;for(let e=0,t=a.length;e0&&s+o>=n&&(e.rowSpan-=i.getOverlapRangeAtIndex(n,l,s,s+o));else o.push(e[s]);for(let e=0,t=o.length;e"+this.plugins.table.createCells.call(this,"th",this.context.table._logical_cellCnt,!1)+"",n.insertBefore(t,n.firstElementChild)}e.toggleClass(t,"active"),/TH/i.test(this.context.table._tdElement.nodeName)?this.controllersOff():this.plugins.table.setPositionControllerDiv.call(this,this.context.table._tdElement,!1)},resizeTable:function(){const e=this.context.table,t=e.resizeIcon,i=e.resizeText;let n="se-icon-expansion",l="se-icon-reduction",o=e.minText,s="100%";e._maxWidth||(n="se-icon-reduction",l="se-icon-expansion",o=e.maxText,s="auto"),this.util.removeClass(t,n),this.util.addClass(t,l),this.util.changeTxt(i,o),e._element.style.width=s},setActiveButton:function(e,t){const i=this.context.table;t&&e!==t?(i.splitButton.setAttribute("disabled",!0),i.mergeButton.removeAttribute("disabled")):(i.splitButton.removeAttribute("disabled"),i.mergeButton.setAttribute("disabled",!0))},_bindOnSelect:null,_bindOffSelect:null,_bindOffShift:null,_selectedCells:null,_shift:!1,_fixedCell:null,_fixedCellName:null,_selectedCell:null,_selectedTable:null,_ref:null,_toggleEditor:function(e){this.context.element.wysiwyg.setAttribute("contenteditable",e),e?this.util.removeClass(this.context.element.wysiwyg,"se-disabled"):this.util.addClass(this.context.element.wysiwyg,"se-disabled")},_offCellMultiSelect:function(e){e.stopPropagation();const t=this.plugins.table;t._shift?t._initBind&&(this._wd.removeEventListener("touchmove",t._initBind),t._initBind=null):(t._removeEvents.call(this),t._toggleEditor.call(this,!0)),t._fixedCell&&t._selectedTable&&(t.setActiveButton.call(this,t._fixedCell,t._selectedCell),t.call_controller_tableEdit.call(this,t._selectedCell||t._fixedCell),t._selectedCells=t._selectedTable.querySelectorAll(".se-table-selected-cell"),t._selectedCell&&t._fixedCell&&this.focusEdge(t._selectedCell),t._shift||(t._fixedCell=null,t._selectedCell=null,t._fixedCellName=null))},_onCellMultiSelect:function(e){const t=this.plugins.table,i=this.util.getParentElement(e.target,this.util.isCell);if(t._shift)i===t._fixedCell?t._toggleEditor.call(this,!0):t._toggleEditor.call(this,!1);else if(!t._ref){if(i===t._fixedCell)return;t._toggleEditor.call(this,!1)}i&&i!==t._selectedCell&&t._fixedCellName===i.nodeName&&t._selectedTable===this.util.getParentElement(i,"TABLE")&&(t._selectedCell=i,t._setMultiCells.call(this,t._fixedCell,i))},_setMultiCells:function(e,t){const i=this.plugins.table,n=i._selectedTable.rows,l=this.util,o=i._selectedTable.querySelectorAll(".se-table-selected-cell");for(let e=0,t=o.length;e0)for(let e,t=0;td||(u>=e.index?(o+=e.cs,u+=e.cs,e.rs-=1,e.row=d+1,e.rs<1&&(a.splice(t,1),t--)):g===m-1&&(e.rs-=1,e.row=d+1,e.rs<1&&(a.splice(t,1),t--)));if(s){if(n!==e&&n!==t||(c.cs=null!==c.cs&&c.csu+h?c.ce:u+h,c.rs=null!==c.rs&&c.rsd+p?c.re:d+p,c._i+=1),2===c._i){s=!1,a=[],r=[],d=-1;break}}else if(l.getOverlapRangeAtIndex(c.cs,c.ce,u,u+h)&&l.getOverlapRangeAtIndex(c.rs,c.re,d,d+p)){const e=c.csu+h?c.ce:u+h,i=c.rsd+p?c.re:d+p;if(c.cs!==e||c.ce!==t||c.rs!==i||c.re!==o){c.cs=e,c.ce=t,c.rs=i,c.re=o,d=-1,a=[],r=[];break}l.addClass(n,"se-table-selected-cell")}p>0&&r.push({index:u,cs:h+1,rs:p,row:-1}),o+=n.colSpan-1}a=a.concat(r).sort((function(e,t){return e.index-t.index})),r=[]}},_removeEvents:function(){const e=this.plugins.table;e._initBind&&(this._wd.removeEventListener("touchmove",e._initBind),e._initBind=null),e._bindOnSelect&&(this._wd.removeEventListener("mousedown",e._bindOnSelect),this._wd.removeEventListener("mousemove",e._bindOnSelect),e._bindOnSelect=null),e._bindOffSelect&&(this._wd.removeEventListener("mouseup",e._bindOffSelect),e._bindOffSelect=null),e._bindOffShift&&(this._wd.removeEventListener("keyup",e._bindOffShift),e._bindOffShift=null)},_initBind:null,onTableCellMultiSelect:function(e,t){const i=this.plugins.table;i._removeEvents.call(this),this.controllersOff(),i._shift=t,i._fixedCell=e,i._fixedCellName=e.nodeName,i._selectedTable=this.util.getParentElement(e,"TABLE");const n=i._selectedTable.querySelectorAll(".se-table-selected-cell");for(let e=0,t=n.length;e-1?(i=e.toLowerCase(),s="pre"===i||"blockquote"===i?"range":"replace",r=/^h/.test(i)?i.match(/\d+/)[0]:"",a=t["tag_"+(r?"h":i)]+r,c=""):(i=e.tag.toLowerCase(),s=e.command,a=e.name||i,c=e.class?' class="'+e.class+'"':""),o+='
  • ";return o+="",i.innerHTML=o,i},on:function(){const e=this.context.formatBlock,t=e._formatList,i=(this.commandMap.FORMAT.getAttribute("data-focus")||"P").toLowerCase();if(i!==e.currentFormat){for(let e=0,n=t.length;e('+t.toolbar.default+")";for(let e,t=0,i=n.length;t";return l+="",i.innerHTML=l,i},on:function(){const e=this.context.lineHeight,t=e._sizeList,i=this.util.getFormatElement(this.getSelectionNode()).style.lineHeight+"";if(i!==e.currentSize){for(let e=0,n=t.length;e";return i+="",t.innerHTML=i,t},pickup:function(e){if(!/^BUTTON$/i.test(e.target.tagName))return!1;e.preventDefault(),e.stopPropagation();const t=this.context.option.templates[e.target.getAttribute("data-value")];if(!t.html)throw this.submenuOff(),Error('[SUNEDITOR.template.fail] cause : "templates[i].html not found"');this.setContents(t.html),this.submenuOff()}},paragraphStyle:{name:"paragraphStyle",add:function(e,t){const i=e.context;i.paragraphStyle={_classList:null};let n=this.setSubmenu.call(e);n.querySelector("ul").addEventListener("click",this.pickUp.bind(e)),i.paragraphStyle._classList=n.querySelectorAll("li button"),t.parentNode.appendChild(n),n=null},setSubmenu:function(){const e=this.context.option,t=this.util.createElement("DIV");t.className="se-submenu se-list-layer";const i=this.lang.menu,n={spaced:{name:i.spaced,class:"__se__p-spaced",_class:""},bordered:{name:i.bordered,class:"__se__p-bordered",_class:""},neon:{name:i.neon,class:"__se__p-neon",_class:""}},l=e.paragraphStyles&&0!==e.paragraphStyles.length?e.paragraphStyles:["spaced","bordered","neon"];let o='
      ';for(let e,t,i,s,a=0,r=l.length;a
    "}return o+="",t.innerHTML=o,t},on:function(){const e=this.context.paragraphStyle._classList,t=this.util.getFormatElement(this.getSelectionNode());for(let i=0,n=e.length;i"}return l+="",t.innerHTML=l,t},on:function(){const e=this.util,t=this.context.textStyle._styleList,i=this.getSelectionNode();for(let n,l,o,s=0,a=t.length;s'+e.dialogBox.linkBox.title+'
    ",t},setController_LinkButton:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-link",t.innerHTML='
    ",t},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();const t=function(){if(0===this.context.link.focusElement.value.trim().length)return!1;const e=this.context.link,t=e.focusElement.value,i=e.linkAnchorText,n=0===i.value.length?t:i.value;if(this.context.dialog.updateModal)e._linkAnchor.href=t,e._linkAnchor.textContent=n,e._linkAnchor.target=e.linkNewWindowCheck.checked?"_blank":"",this.setRange(e._linkAnchor.childNodes[0],0,e._linkAnchor.childNodes[0],e._linkAnchor.textContent.length);else{const i=this.util.createElement("A");i.href=t,i.textContent=n,i.target=e.linkNewWindowCheck.checked?"_blank":"";const l=this.getSelectedElements();if(l.length>1){const e=this.util.createElement(l[0].nodeName);e.appendChild(i),this.insertNode(e)}else this.insertNode(i);this.setRange(i.childNodes[0],0,i.childNodes[0],i.textContent.length)}this.history.push(!1),e.focusElement.value="",e.linkAnchorText.value=""}.bind(this);try{t()}finally{this.plugins.dialog.close.call(this),this.closeLoading(),this.focus()}return!1},on:function(e){e||(this.context.link.linkAnchorText.value=this.getSelection().toString()),this.context.link._linkAnchor&&(this.context.dialog.updateModal=!0,this.context.link.focusElement.value=this.context.link._linkAnchor.href,this.context.link.linkAnchorText.value=this.context.link._linkAnchor.textContent,this.context.link.linkNewWindowCheck.checked=!!/_blank/i.test(this.context.link._linkAnchor.target))},call_controller_linkButton:function(e){this.editLink=this.context.link._linkAnchor=e;const t=this.context.link.linkBtn,i=t.querySelector("a");i.href=e.href,i.title=e.textContent,i.textContent=e.textContent;const n=this.util.getOffset(e,this.context.element.wysiwygFrame);t.style.top=n.top+e.offsetHeight+10+"px",t.style.left=n.left-this.context.element.wysiwygFrame.scrollLeft+"px",t.style.display="block";const l=this.context.element.wysiwygFrame.offsetWidth-(t.offsetLeft+t.offsetWidth);l<0?(t.style.left=t.offsetLeft+l+"px",t.firstElementChild.style.left=20-l+"px"):t.firstElementChild.style.left="20px",this.controllersOn(t,this.plugins.link.init.bind(this))},onClick_linkBtn:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")||e.target.parentNode.getAttribute("data-command");if(t){if(e.preventDefault(),/update/.test(t))this.context.link.focusElement.value=this.context.link._linkAnchor.href,this.context.link.linkAnchorText.value=this.context.link._linkAnchor.textContent,this.context.link.linkNewWindowCheck.checked=!!/_blank/i.test(this.context.link._linkAnchor.target),this.plugins.dialog.open.call(this,"link",!0);else if(/unlink/.test(t)){const e=this.util.getChildElement(this.context.link._linkAnchor,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!1),t=this.util.getChildElement(this.context.link._linkAnchor,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!0);this.setRange(e,0,t,t.textContent.length),this.nodeChange(null,null,["A"],!1)}else this.util.removeItem(this.context.link._linkAnchor),this.context.link._linkAnchor=null,this.focus(),this.history.push(!1);this.controllersOff()}},init:function(){if(!/link/i.test(this.context.dialog.kind)){const e=this.context.link;e.linkBtn.style.display="none",e._linkAnchor=null,e.focusElement.value="",e.linkAnchorText.value="",e.linkNewWindowCheck.checked=!1}}},image:{name:"image",add:function(e){e.addModule([l,o,s]);const t=e.context;t.image={sizeUnit:t.option._imageSizeUnit,_linkElement:null,_container:null,_cover:null,_element:null,_element_w:1,_element_h:1,_element_l:0,_element_t:0,_defaultSizeX:"auto",_defaultSizeY:"auto",_origin_w:"auto"===t.option.imageWidth?"":t.option.imageWidth,_origin_h:"",_altText:"",_caption:null,captionCheckEl:null,_linkValue:"",_align:"none",_captionChecked:!1,_proportionChecked:!0,_floatClassRegExp:"__se__float\\-[a-z]+",_xmlHttp:null,_captionShow:!0,_resizing:t.option.imageResizing,_rotation:t.option.imageRotation,_resizeDotHide:!t.option.imageHeightShow,_uploadFileLength:0,_onlyPercentage:t.option.imageSizeOnlyPercentage,_ratio:!1,_ratioX:1,_ratioY:1};let i=this.setDialog.call(e);t.image.modal=i,t.image.imgUrlFile=i.querySelector("._se_image_url"),t.image.imgInputFile=t.image.focusElement=i.querySelector("._se_image_file"),t.image.altText=i.querySelector("._se_image_alt"),t.image.imgLink=i.querySelector("._se_image_link"),t.image.imgLinkNewWindowCheck=i.querySelector("._se_image_link_check"),t.image.captionCheckEl=i.querySelector("._se_image_check_caption"),t.image.modal.querySelector(".se-dialog-tabs").addEventListener("click",this.openTab.bind(e)),t.image.modal.querySelector(".se-btn-primary").addEventListener("click",this.submit.bind(e)),t.image.proportion={},t.image.inputX={},t.image.inputY={},t.option.imageResizing&&(t.image.proportion=i.querySelector("._se_image_check_proportion"),t.image.inputX=i.querySelector("._se_image_size_x"),t.image.inputY=i.querySelector("._se_image_size_y"),t.image.inputX.value=t.option.imageWidth,t.image.inputX.addEventListener("keyup",this.setInputSize.bind(e,"x")),t.image.inputY.addEventListener("keyup",this.setInputSize.bind(e,"y")),t.image.inputX.addEventListener("change",this.setRatio.bind(e)),t.image.inputY.addEventListener("change",this.setRatio.bind(e)),t.image.proportion.addEventListener("change",this.setRatio.bind(e)),i.querySelector(".se-dialog-btn-revert").addEventListener("click",this.sizeRevert.bind(e))),t.dialog.modal.appendChild(i),i=null},setDialog:function(){const e=this.context.option,t=this.lang,i=this.util.createElement("DIV");i.className="se-dialog-content",i.style.display="none";let n='
    '+t.dialogBox.imageBox.title+'
    ';if(e.imageFileInput&&(n+='
    '),e.imageUrlInput&&(n+='
    '),n+='
    ',e.imageResizing){const i=e.imageSizeOnlyPercentage,l=i?' style="display: none !important;"':"",o=e.imageHeightShow?"":' style="display: none !important;"';n+='
    ',i||!e.imageHeightShow?n+='
    ":n+='
    ",n+=' '+t.dialogBox.proportion+'
    '}return n+='
    ",i.innerHTML=n,i},openTab:function(e){const t=this.context.image.modal,i="init"===e?t.querySelector("._se_tab_link"):e.target;if(!/^BUTTON$/i.test(i.tagName))return!1;const n=i.getAttribute("data-tab-link");let l,o,s;for(o=t.getElementsByClassName("_se_tab_content"),l=0;l0){let t=0;const i=[];for(let n=0,l=e.length;n0){let e=0;const i=this._variable._imagesInfo;for(let t=0,n=i.length;tn){const i="[SUNEDITOR.imageUpload.fail] Size of uploadable total images: "+n/1e3+"KB";return this._imageUploadError(i,{limitSize:n,currentSize:e,uploadSize:t})&&s.open.call(this,i),void this.closeLoading()}}this.context.image._uploadFileLength=i.length;const l=this.context.option.imageUploadUrl,o=this.context.option.imageUploadHeader,a=this.context.dialog.updateModal?1:i.length;if("string"==typeof l&&l.length>0){const e=new FormData;for(let t=0;t0)for(let e in o)this.context.image._xmlHttp.setRequestHeader(e,o[e]);this.context.image._xmlHttp.send(e)}else for(let e=0;e0){const n=this.util.createElement("A");return n.href=/^https?:\/\//.test(t)?t:"http://"+t,n.target=i?"_blank":"",n.setAttribute("data-image-link","image"),e.setAttribute("data-image-link",t),n.appendChild(e),n}return e},setInputSize:function(e,t){t&&32===t.keyCode?t.preventDefault():this.plugins.resizing._module_setInputSize.call(this,this.context.image,e)},setRatio:function(){this.plugins.resizing._module_setRatio.call(this,this.context.image)},submit:function(e){const t=this.context.image,i=this.plugins.image;this.showLoading(),e.preventDefault(),e.stopPropagation(),t._linkValue=t.imgLink.value,t._altText=t.altText.value,t._align=t.modal.querySelector('input[name="suneditor_image_radio"]:checked').value,t._captionChecked=t.captionCheckEl.checked,t._resizing&&(t._proportionChecked=t.proportion.checked);try{this.context.dialog.updateModal&&i.update_image.call(this,!1,!1,!1),t.imgInputFile&&t.imgInputFile.files.length>0?i.onRender_imgInput.call(this):t.imgUrlFile&&t.imgUrlFile.value.trim().length>0?i.onRender_imgUrl.call(this):this.closeLoading()}catch(e){throw this.closeLoading(),Error('[SUNEDITOR.image.submit.fail] cause : "'+e.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},setImagesInfo:function(e,t){const i=this._variable._imagesInfo;let n=e.getAttribute("data-index"),l=null,o="";if(!n||this._imagesInfoInit)o="create",n=this._variable._imageIndex,this._variable._imageIndex++,e.setAttribute("data-index",n),e.setAttribute("data-file-name",t.name),e.setAttribute("data-file-size",t.size),l={src:e.src,index:1*n,name:t.name,size:t.size},i.push(l);else{o="update",n*=1;for(let e=0,t=i.length;e-1||(i.splice(t,1),this._imageUpload(null,e,"delete",null,0),t--);this.context.resizing._resize_plugin=""},_onload_image:function(e,t){t&&(this.plugins.image.setImagesInfo.call(this,e,t),this.history.push(!0))},create_image:function(e,t,i,n,l,o,s){const a=this.context.image;this.context.resizing._resize_plugin="image";let r=this.util.createElement("IMG");r.addEventListener("load",this.plugins.image._onload_image.bind(this,r,s)),r.src=e,r.alt=a._altText,r=this.plugins.image.onRender_link.call(this,r,t,i),r.setAttribute("data-rotate","0"),a._resizing&&r.setAttribute("data-proportion",a._proportionChecked);const c=this.plugins.resizing.set_cover.call(this,r),d=this.plugins.resizing.set_container.call(this,c,"se-image-container");a._captionChecked&&(a._caption=this.plugins.resizing.create_caption.call(this),a._caption.setAttribute("contenteditable",!1),c.appendChild(a._caption)),a._element=r,a._cover=c,a._container=d,this.plugins.image.applySize.call(this),this.plugins.image.setAlign.call(this,o,r,c,d),this.insertComponent(d,!0),this.context.resizing._resize_plugin=""},update_image:function(e,t,i){const n=this.context.image,l=n._linkValue;let o,s=n._element,a=n._cover,r=n._container,c=!1;null===a&&(c=!0,s=n._element.cloneNode(!0),a=this.plugins.resizing.set_cover.call(this,s)),null===r&&(a=a.cloneNode(!0),c=!0,r=this.plugins.resizing.set_container.call(this,a,"se-image-container")),c&&(r.innerHTML="",r.appendChild(a));const d=this.util.isNumber(n.inputX.value)?n.inputX.value+n.sizeUnit:n.inputX.value,u=this.util.isNumber(n.inputY.value)?n.inputY.value+n.sizeUnit:n.inputY.value;if(o=/%$/.test(s.style.width)?d!==r.style.width||u!==r.style.height:d!==s.style.width||u!==s.style.height,s.alt=n._altText,n._captionChecked?n._caption||(n._caption=this.plugins.resizing.create_caption.call(this),a.appendChild(n._caption)):n._caption&&(this.util.removeItem(n._caption),n._caption=null),l.trim().length>0)if(null!==n._linkElement)n._linkElement.href=l,n._linkElement.target=n.imgLinkNewWindowCheck.checked?"_blank":"",s.setAttribute("data-image-link",l);else{let e=this.plugins.image.onRender_link.call(this,s,l,this.context.image.imgLinkNewWindowCheck.checked);a.insertBefore(e,n._caption)}else if(null!==n._linkElement){const e=s;e.setAttribute("data-image-link","");let t=e.cloneNode(!0);a.removeChild(n._linkElement),a.insertBefore(t,n._caption),s=t}if(c){const e=this.util.isRangeFormatElement(n._element.parentNode)||this.util.isWysiwygDiv(n._element.parentNode)?n._element:/^A$/i.test(n._element.parentNode.nodeName)?n._element.parentNode:this.util.getFormatElement(n._element)||n._element;e.parentNode.insertBefore(r,e),this.util.removeItem(e),s=r.querySelector("img"),n._element=s,n._cover=a,n._container=r}!n._onlyPercentage&&o&&!e&&(/\d+/.test(s.style.height)||this.context.resizing._rotateVertical&&n._captionChecked)&&(/%$/.test(n.inputX.value)||/%$/.test(n.inputY.value)?this.plugins.resizing.resetTransform.call(this,s):this.plugins.resizing.setTransformSize.call(this,s,this.util.getNumber(n.inputX.value,0),this.util.getNumber(n.inputY.value,0)));if(n._resizing&&(s.setAttribute("data-proportion",n._proportionChecked),o&&this.plugins.image.applySize.call(this)),this.plugins.image.setAlign.call(this,null,s,null,null),e&&this.plugins.image.setImagesInfo.call(this,s,{name:s.getAttribute("data-file-name")||s.src.split("/").pop(),size:s.getAttribute("data-file-size")||0}),t){this.plugins.image.init.call(this);const e=this.plugins.resizing.call_controller_resize.call(this,s,"image");this.plugins.image.onModifyMode.call(this,s,e)}i||this.history.push(!1)},update_src:function(e,t,i){t.src=e,this._w.setTimeout(this.plugins.image.setImagesInfo.bind(this,t,i))},onModifyMode:function(e,t){const i=this.context.image;i._linkElement=/^A$/i.test(e.parentNode.nodeName)?e.parentNode:null,i._element=e,i._cover=this.util.getParentElement(e,"FIGURE"),i._container=this.util.getParentElement(e,this.util.isComponent),i._caption=this.util.getChildElement(i._cover,"FIGCAPTION"),i._align=e.getAttribute("data-align")||"none",t&&(i._element_w=t.w,i._element_h=t.h,i._element_t=t.t,i._element_l=t.l);let n=i._element.getAttribute("data-size")||i._element.getAttribute("data-origin");n?(n=n.split(","),i._origin_w=n[0],i._origin_h=n[1]):t&&(i._origin_w=t.w,i._origin_h=t.h)},openModify:function(e){const t=this.context.image;t.imgUrlFile.value=t._element.src,t._altText=t.altText.value=t._element.alt,t._linkValue=t.imgLink.value=null===t._linkElement?"":t._linkElement.href,t.imgLinkNewWindowCheck.checked=t._linkElement&&"_blank"===t._linkElement.target,t.modal.querySelector('input[name="suneditor_image_radio"][value="'+t._align+'"]').checked=!0,t._align=t.modal.querySelector('input[name="suneditor_image_radio"]:checked').value,t._captionChecked=t.captionCheckEl.checked=!!t._caption,t._resizing&&this.plugins.resizing._module_setModifyInputSize.call(this,t,this.plugins.image),e||this.plugins.dialog.open.call(this,"image",!0)},on:function(e){if(!e){const e=this.context.image;e.inputX.value=e._origin_w=this.context.option.imageWidth===e._defaultSizeX?"":this.context.option.imageWidth,e.inputY.value=e._origin_h="",e.inputY.disabled=!0,e.proportion.disabled=!0}},sizeRevert:function(){this.plugins.resizing._module_sizeRevert.call(this,this.context.image)},applySize:function(e,t){const i=this.context.image;return e||(e=i.inputX.value),t||(t=i.inputY.value),i._onlyPercentage&&e||/%$/.test(e)?(this.plugins.image.setPercentSize.call(this,e,t),!0):(e&&"auto"!==e||t&&"auto"!==t?this.plugins.image.setSize.call(this,e,t,!1):this.plugins.image.setAutoSize.call(this),!1)},setSize:function(e,t,i){const n=this.context.image;this.plugins.image.cancelPercentAttr.call(this),n._element.style.width=this.util.isNumber(e)?e+n.sizeUnit:e,n._element.style.height=this.util.isNumber(t)?t+n.sizeUnit:/%$/.test(t)?"":t,"center"===n._align&&this.plugins.image.setAlign.call(this,null,null,null,null),i||n._element.removeAttribute("data-percentage"),this.plugins.resizing._module_saveCurrentSize.call(this,n)},setAutoSize:function(){const e=this.context.image;this.plugins.resizing.resetTransform.call(this,e._element),this.plugins.image.cancelPercentAttr.call(this),e._element.style.maxWidth="",e._element.style.width="",e._element.style.height="",e._cover.style.width="",e._cover.style.height="",this.plugins.image.setAlign.call(this,null,null,null,null),e._element.setAttribute("data-percentage","auto,auto"),this.plugins.resizing._module_saveCurrentSize.call(this,e)},setOriginSize:function(){const e=this.context.image;e._element.removeAttribute("data-percentage"),this.plugins.resizing.resetTransform.call(this,e._element),this.plugins.image.cancelPercentAttr.call(this);const t=(e._element.getAttribute("data-origin")||"").split(","),i=t[0],n=t[1];t&&(e._onlyPercentage||/%$/.test(i)&&(/%$/.test(n)||!/\d/.test(n))?this.plugins.image.setPercentSize.call(this,i,n):this.plugins.image.setSize.call(this,i,n),this.plugins.resizing._module_saveCurrentSize.call(this,e))},setPercentSize:function(e,t){const i=this.context.image;t=!t||/%$/.test(t)||this.util.getNumber(t,0)?this.util.isNumber(t)?t+i.sizeUnit:t||"":this.util.isNumber(t)?t+"%":t;const n=/%$/.test(t);i._container.style.width=this.util.isNumber(e)?e+"%":e,i._container.style.height="",i._cover.style.width="100%",i._cover.style.height=n?t:"",i._element.style.width="100%",i._element.style.height=n?"":t,i._element.style.maxWidth="","center"===i._align&&this.plugins.image.setAlign.call(this,null,null,null,null),i._element.setAttribute("data-percentage",e+","+t),this.plugins.resizing.setCaptionPosition.call(this,i._element),this.plugins.resizing._module_saveCurrentSize.call(this,i)},cancelPercentAttr:function(){const e=this.context.image;e._cover.style.width="",e._cover.style.height="",e._container.style.width="",e._container.style.height="",this.util.removeClass(e._container,this.context.image._floatClassRegExp),this.util.addClass(e._container,"__se__float-"+e._align),"center"===e._align&&this.plugins.image.setAlign.call(this,null,null,null,null)},setAlign:function(e,t,i,n){const l=this.context.image;e||(e=l._align),t||(t=l._element),i||(i=l._cover),n||(n=l._container),i.style.margin=e&&"none"!==e?"auto":"0",/%$/.test(t.style.width)&&"center"===e?(n.style.minWidth="100%",i.style.width=n.style.width):(n.style.minWidth="",i.style.width=this.context.resizing._rotateVertical?t.style.height||t.offsetHeight:t.style.width&&"auto"!==t.style.width?t.style.width||"100%":""),this.util.hasClass(n,"__se__float-"+e)||(this.util.removeClass(n,l._floatClassRegExp),this.util.addClass(n,"__se__float-"+e)),t.setAttribute("data-align",e)},resetAlign:function(){const e=this.context.image;e._element.setAttribute("data-align",""),e._align="none",e._cover.style.margin="0",this.util.removeClass(e._container,e._floatClassRegExp)},destroy:function(e){const t=e||this.context.image._element,i=this.util.getParentElement(t,this.util.isComponent)||t,n=1*t.getAttribute("data-index");let l=i.previousElementSibling||i.nextElementSibling;if(this.util.removeItem(i),this.plugins.image.init.call(this),this.controllersOff(),this.focusEdge(l),n>=0){const e=this._variable._imagesInfo;for(let t=0,i=e.length;t'+t.dialogBox.videoBox.title+'
    ';if(e.videoResizing){const i=e.videoRatioList||[{name:"16:9",value:.5625},{name:"4:3",value:.75},{name:"21:9",value:.4285}],l=e.videoRatio,o=e.videoSizeOnlyPercentage,s=o?' style="display: none !important;"':"",a=e.videoHeightShow?"":' style="display: none !important;"',r=e.videoRatioShow?"":' style="display: none !important;"',c=o||e.videoHeightShow||e.videoRatioShow?"":' style="display: none !important;"';n+='
    "}return n+='
    ",i.innerHTML=n,i},setVideoRatio:function(e){const t=this.context.video,i=e.target.options[e.target.selectedIndex].value;t._defaultSizeY=t._videoRatio=i?100*i+"%":t._defaultSizeY,t.inputY.placeholder=i?100*i+"%":"",t.inputY.value=""},setInputSize:function(e,t){if(t&&32===t.keyCode)return void t.preventDefault();const i=this.context.video;this.plugins.resizing._module_setInputSize.call(this,i,e),"y"===e&&this.plugins.video.setVideoRatioSelect.call(this,t.target.value||i._videoRatio)},setRatio:function(){this.plugins.resizing._module_setRatio.call(this,this.context.video)},_onload_video:function(e){this.plugins.video.setVideosInfo.call(this,e)},submitAction:function(){if(0===this.context.video.focusElement.value.trim().length)return!1;this.context.resizing._resize_plugin="video";const e=this.context.video;let t=null,i=null,n=null,l=e.focusElement.value.trim();if(e._align=e.modal.querySelector('input[name="suneditor_video_radio"]:checked').value,/^$/.test(l))t=(new this._w.DOMParser).parseFromString(l,"text/html").querySelector("iframe");else{if(t=this.util.createElement("IFRAME"),/youtu\.?be/.test(l)&&(/^http/.test(l)||(l="https://"+l),l=l.replace("watch?v=",""),/^\/\/.+\/embed\//.test(l)||(l=l.replace(l.match(/\/\/.+\//)[0],"//www.youtube.com/embed/").replace("&","?&")),e._youtubeQuery.length>0))if(/\?/.test(l)){const t=l.split("?");l=t[0]+"?"+e._youtubeQuery+"&"+t[1]}else l+="?"+e._youtubeQuery;t.src=l}this.context.dialog.updateModal?(e._element.src!==t.src&&(e._element.src=t.src),n=e._container,i=this.util.getParentElement(e._element,"FIGURE"),t=e._element):(t.frameBorder="0",t.allowFullscreen=!0,t.addEventListener("load",this.plugins.video._onload_video.bind(this,t)),e._element=t,i=this.plugins.resizing.set_cover.call(this,t),n=this.plugins.resizing.set_container.call(this,i,"se-video-container"),this._variable._videosCnt++),e._cover=i,e._container=n;const o=this.plugins.resizing._module_getSizeX.call(this,e)!==(e.inputX.value||e._defaultSizeX)||this.plugins.resizing._module_getSizeY.call(this,e)!==(e.inputY.value||e._videoRatio),s=!this.context.dialog.updateModal||o;e._resizing&&(this.context.video._proportionChecked=e.proportion.checked,t.setAttribute("data-proportion",e._proportionChecked));let a=!1;s&&(a=this.plugins.video.applySize.call(this)),a&&"center"===e._align||this.plugins.video.setAlign.call(this,null,t,i,n),this.context.dialog.updateModal?e._resizing&&this.context.resizing._rotateVertical&&s&&this.plugins.resizing.setTransformSize.call(this,t,null,null):this.insertComponent(n,!1),this.context.resizing._resize_plugin="",this.context.dialog.updateModal&&this.history.push(!1)},setVideosInfo:function(e){if(!e.getAttribute("data-origin")){const t=this.util.getParentElement(e,this.util.isComponent),i=this.util.getParentElement(e,"FIGURE"),n=this.plugins.resizing._module_getSizeX.call(this,this.context.video,e,i,t),l=this.plugins.resizing._module_getSizeY.call(this,this.context.video,e,i,t);e.setAttribute("data-origin",n+","+l),e.setAttribute("data-size",n+","+l)}},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();try{this.plugins.video.submitAction.call(this)}finally{this.plugins.dialog.close.call(this),this.closeLoading()}return this.focus(),!1},_update_videoCover:function(e){const t=this.context.video;e.frameBorder="0",e.allowFullscreen=!0,e.onload=e.addEventListener("load",this.plugins.video._onload_video.bind(this,e));const i=this.util.getParentElement(e,this.util.isComponent)||this.util.getParentElement(e,function(e){return this.isWysiwygDiv(e.parentNode)}.bind(this.util));t._element=e=e.cloneNode(!1);const n=t._cover=this.plugins.resizing.set_cover.call(this,e),l=t._container=this.plugins.resizing.set_container.call(this,n,"se-video-container"),o=i.getElementsByTagName("FIGCAPTION")[0];let s=null;o&&(s=this.util.createElement("DIV"),s.innerHTML=o.innerHTML,this.util.removeItem(o));const a=(e.getAttribute("data-size")||e.getAttribute("data-origin")||"").split(",");this.plugins.video.applySize.call(this,a[0]||this.context.option.videoWidth,a[1]||""),i.parentNode.insertBefore(l,i),s&&i.parentNode.insertBefore(s,i),this.util.removeItem(i)},onModifyMode:function(e,t){const i=this.context.video;i._element=e,i._cover=this.util.getParentElement(e,"FIGURE"),i._container=this.util.getParentElement(e,this.util.isComponent),i._align=e.getAttribute("data-align")||"none",i._element_w=t.w,i._element_h=t.h,i._element_t=t.t,i._element_l=t.l;let n=i._element.getAttribute("data-size")||i._element.getAttribute("data-origin");n?(n=n.split(","),i._origin_w=n[0],i._origin_h=n[1]):(i._origin_w=t.w,i._origin_h=t.h)},openModify:function(e){const t=this.context.video;if(t.focusElement.value=t._element.src,t.modal.querySelector('input[name="suneditor_video_radio"][value="'+t._align+'"]').checked=!0,t._resizing){this.plugins.resizing._module_setModifyInputSize.call(this,t,this.plugins.video);const e=t._videoRatio=this.plugins.resizing._module_getSizeY.call(this,t);this.plugins.video.setVideoRatioSelect.call(this,e)||(t.inputY.value=t._onlyPercentage?this.util.getNumber(e,2):e)}e||this.plugins.dialog.open.call(this,"video",!0)},on:function(e){if(!e){const e=this.context.video;e.inputX.value=e._origin_w=this.context.option.videoWidth===e._defaultSizeX?"":this.context.option.videoWidth,e.inputY.value=e._origin_h="",e.proportion.disabled=!0}},setVideoRatioSelect:function(e){let t=!1;const i=this.context.video,n=i.videoRatioOption.options;/%$/.test(e)||i._onlyPercentage?e=this.util.getNumber(e,2)/100+"":(!this.util.isNumber(e)||1*e>=1)&&(e=""),i.inputY.placeholder="";for(let l=0,o=n.length;l0||!i.style.width)&&t._update_videoCover.call(this,i);this.context.resizing._resize_plugin=""},sizeRevert:function(){this.plugins.resizing._module_sizeRevert.call(this,this.context.video)},applySize:function(e,t){const i=this.context.video;return e||(e=i.inputX.value),t||(t=i.inputY.value),i._onlyPercentage||/%$/.test(e)||!e?(this.plugins.video.setPercentSize.call(this,e||"100%",t||i._videoRatio),!0):(e&&"auto"!==e||t&&"auto"!==t?this.plugins.video.setSize.call(this,e,t||i._defaultRatio,!1):this.plugins.video.setAutoSize.call(this),!1)},setSize:function(e,t,i){const n=this.context.video;e=this.util.getNumber(e,0),t=this.util.isNumber(t)?t+n.sizeUnit:t||"",n._element.style.width=e?e+n.sizeUnit:"",n._cover.style.paddingBottom=n._cover.style.height=t,/%$/.test(t)?n._element.style.height="":n._element.style.height=t,i||n._element.removeAttribute("data-percentage"),this.plugins.resizing._module_saveCurrentSize.call(this,n)},setAutoSize:function(){this.plugins.video.setPercentSize.call(this,100,this.context.video._defaultRatio)},setOriginSize:function(e){const t=this.context.video;t._element.removeAttribute("data-percentage"),this.plugins.resizing.resetTransform.call(this,t._element),this.plugins.video.cancelPercentAttr.call(this);const i=((e?t._element.getAttribute("data-size"):"")||t._element.getAttribute("data-origin")||"").split(",");if(i){const e=i[0],n=i[1];t._onlyPercentage||/%$/.test(e)&&(/%$/.test(n)||!/\d/.test(n))?this.plugins.video.setPercentSize.call(this,e,n):this.plugins.video.setSize.call(this,e,n),this.plugins.resizing._module_saveCurrentSize.call(this,t)}},setPercentSize:function(e,t){const i=this.context.video;t=!t||/%$/.test(t)||this.util.getNumber(t,0)?this.util.isNumber(t)?t+i.sizeUnit:t||i._videoRatio:this.util.isNumber(t)?t+"%":t,i._container.style.width=this.util.isNumber(e)?e+"%":e,i._container.style.height="",i._cover.style.width="100%",i._cover.style.height=t,i._cover.style.paddingBottom=t,i._element.style.width="100%",i._element.style.height="100%",i._element.style.maxWidth="","center"===i._align&&this.plugins.video.setAlign.call(this,null,null,null,null),i._element.setAttribute("data-percentage",e+","+t),this.plugins.resizing._module_saveCurrentSize.call(this,i)},cancelPercentAttr:function(){const e=this.context.video;e._cover.style.width="",e._cover.style.height="",e._cover.style.paddingBottom="",e._container.style.width="",e._container.style.height="",this.util.removeClass(e._container,this.context.video._floatClassRegExp),this.util.addClass(e._container,"__se__float-"+e._align),"center"===e._align&&this.plugins.video.setAlign.call(this,null,null,null,null)},setAlign:function(e,t,i,n){const l=this.context.video;e||(e=l._align),t||(t=l._element),i||(i=l._cover),n||(n=l._container),i.style.margin=e&&"none"!==e?"auto":"0",/%$/.test(t.style.width)&&"center"===e?(n.style.minWidth="100%",i.style.width=n.style.width,i.style.height=i.style.paddingBottom,i.style.paddingBottom=this.util.getNumber(this.util.getNumber(i.style.paddingBottom,2)/100*this.util.getNumber(i.style.width,2),2)+"%"):(n.style.minWidth="",i.style.width=this.context.resizing._rotateVertical?t.style.height||t.offsetHeight:t.style.width||"100%",i.style.paddingBottom=i.style.height),this.util.hasClass(n,"__se__float-"+e)||(this.util.removeClass(n,l._floatClassRegExp),this.util.addClass(n,"__se__float-"+e)),t.setAttribute("data-align",e)},resetAlign:function(){const e=this.context.video;e._element.setAttribute("data-align",""),e._align="none",e._cover.style.margin="0",this.util.removeClass(e._container,e._floatClassRegExp)},destroy:function(){this._variable._videosCnt--;const e=this.context.video._container;let t=e.previousElementSibling||e.nextElementSibling;this.util.removeItem(e),this.plugins.video.init.call(this),this.controllersOff(),this.focusEdge(t),this.history.push(!1)},init:function(){const e=this.context.video;e.focusElement.value="",e._origin_w=this.context.option.videoWidth,e._origin_h="",e.modal.querySelector('input[name="suneditor_video_radio"][value="none"]').checked=!0,e._resizing&&(e.inputX.value=this.context.option.videoWidth===e._defaultSizeX?"":this.context.option.videoWidth,e.inputY.value="",e.proportion.checked=!0,e.proportion.disabled=!0,this.plugins.video.setVideoRatioSelect.call(this,e._defaultRatio))}}},r=i("P6u4"),c=i.n(r);const d={_d:document,_w:window,_tagConvertor:function(e){const t={b:"strong",i:"em",var:"em",u:"ins",strike:"del",s:"del"};return e.replace(/(<\/?)(b|strong|var|i|em|u|ins|s|strike|del)\b\s*(?:[^>^<]+)?\s*(?=>)/gi,(function(e,i,n){return i+("string"==typeof t[n]?t[n]:n)}))},_HTMLConvertor:function(e){const t={"&":"&"," ":" ","'":""","<":"<",">":">"};return e.replace(/&|\u00A0|'|<|>/g,(function(e){return"string"==typeof t[e]?t[e]:e}))},zeroWidthSpace:"​",zeroWidthRegExp:new RegExp(String.fromCharCode(8203),"g"),onlyZeroWidthRegExp:new RegExp("^"+String.fromCharCode(8203)+"+$"),onlyZeroWidthSpace:function(e){return"string"!=typeof e&&(e=e.textContent),""===e||this.onlyZeroWidthRegExp.test(e)},getXMLHttpRequest:function(){if(!this._w.ActiveXObject)return this._w.XMLHttpRequest?new XMLHttpRequest:null;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return null}}},createElement:function(e){return this._d.createElement(e)},createTextNode:function(e){return this._d.createTextNode(e||"")},getIncludePath:function(e,t){let i="";const n=[],l="js"===t?"script":"link",o="js"===t?"src":"href";let s="(?:";for(let t=0,i=e.length;t0?n[0][o]:""),-1===i.indexOf(":/")&&"//"!==i.slice(0,2)&&(i=0===i.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+i:location.href.match(/^[^\?]*\/(?:)/)[0]+i),!i)throw"[SUNEDITOR.util.getIncludePath.fail] The SUNEDITOR installation path could not be automatically detected. (name: +"+name+", extension: "+t+")";return i},getPageStyle:function(e){let t="";const i=(e?this.getIframeDocument(e):this._d).styleSheets;for(let e,n=0,l=i.length;n-1||(n+=i[e].name+'="'+i[e].value+'" ');return n},convertContentsForEditor:function(e){let t="",i=this._d.createRange().createContextualFragment(e).childNodes;for(let e,n=0,l=i.length;n0&&(t+="

    "+n+"

    ")}else t+=e.replace(/(?!>)\s+(?=<)/g," ");return 0===t.length&&(t="

    "+((e=this._HTMLConvertor(e)).length>0?e:"
    ")+"

    "),this._tagConvertor(t.replace(this._deleteExclusionTags,""))},convertHTMLForCodeView:function(e,t){let i="";const n=this._w.RegExp,l=new n("^(BLOCKQUOTE|PRE|TABLE|THEAD|TBODY|TR|TH|TD|OL|UL|IMG|IFRAME|VIDEO|AUDIO|FIGURE|FIGCAPTION|HR|BR)$","i"),o=this.isFormatElement.bind(this),s="string"==typeof e?this._d.createRange().createContextualFragment(e):e,a=this;return t=(t*=1)>0?new this._w.Array(t+1).join(" "):"",function e(s,r,c){const d=s.childNodes,u=l.test(s.nodeName),h=u?r:"";for(let p,g,m,f=0,_=d.length;f<_;f++){if(p=d[f],m=l.test(p.nodeName),g=m?"\n":"",c=!o(p)||u||/^(TH|TD)$/i.test(s.nodeName)?"":"\n",3===p.nodeType){i+=a._HTMLConvertor(/^\n+$/.test(p.data)?"":p.data);continue}if(0===p.childNodes.length){i+=(/^(HR)$/i.test(p.nodeName)?"\n":"")+h+p.outerHTML+g;continue}p.innerHTML=p.innerHTML;const _=p.nodeName.toLowerCase();i+=(c||(u?"":g))+(h||m?r:"")+p.outerHTML.match(n("<"+_+"[^>]*>","i"))[0]+g,e(p,r+t,""),i+=(m?r:"")+""+(c||g||u?"\n":/^(TH|TD)$/i.test(p.nodeName)?"\n":"")}}(s,"","\n"),i.trim()+"\n"},isWysiwygDiv:function(e){return!(!e||1!==e.nodeType||!this.hasClass(e,"se-wrapper-wysiwyg")&&!/^BODY$/i.test(e.nodeName))},isFormatElement:function(e){return!(!e||1!==e.nodeType||!/^(P|DIV|H[1-6]|LI|TH|TD)$/i.test(e.nodeName)||this.isComponent(e)||this.isWysiwygDiv(e))},isRangeFormatElement:function(e){return!(!e||1!==e.nodeType||!/^(BLOCKQUOTE|OL|UL|PRE|FIGCAPTION|TABLE|THEAD|TBODY|TR|TH|TD)$/i.test(e.nodeName)&&"range"!==e.getAttribute("data-format"))},isComponent:function(e){return e&&(/se-component/.test(e.className)||/^(TABLE|HR)$/.test(e.nodeName))},getFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&e.firstElementChild,this.isFormatElement(e)&&t(e))return e;e=e.parentNode}return null},getRangeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&!/^(THEAD|TBODY|TR)$/i.test(e.nodeName)&&t(e))return e;e=e.parentNode}return null},copyTagAttributes:function(e,t){t.style.cssText&&(e.style.cssText+=t.style.cssText);const i=t.classList;for(let t=0,n=i.length;t0&&!this.isBreak(e);)e=e.firstChild;for(;t&&1===t.nodeType&&t.childNodes.length>0&&!this.isBreak(t);)t=t.lastChild;return{sc:e,ec:t||e}}},getOffset:function(e,t){let i=0,n=0,l=3===e.nodeType?e.parentElement:e;const o=this.getParentElement(e,this.isWysiwygDiv.bind(this));for(;l&&!this.hasClass(l,"se-container")&&l!==o;)i+=l.offsetLeft,n+=l.offsetTop,l=l.offsetParent;const s=t&&/iframe/i.test(t.nodeName);return{left:i+(s?t.parentElement.offsetLeft:0),top:n-o.scrollTop+(s?t.parentElement.offsetTop:0)}},getOverlapRangeAtIndex:function(e,t,i,n){if(e<=n?ti)return 0;const l=(e>i?e:i)-(t0?" ":"")+t)},removeClass:function(e,t){if(!e)return;const i=new this._w.RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(i," ").trim()},toggleClass:function(e,t){if(!e)return;const i=new this._w.RegExp("(\\s|^)"+t+"(\\s|$)");i.test(e.className)?e.className=e.className.replace(i," ").trim():e.className+=" "+t},removeItem:function(e){if(e)try{e.remove()}catch(t){e.parentNode.removeChild(e)}},removeItemAllParents:function(e,t){if(!e)return null;let i=null;return t||(t=function(e){const t=e.textContent.trim();return 0===t.length||/^(\n|\u200B)+$/.test(t)}),function e(n){if(!d.isWysiwygDiv(n)){const l=n.parentNode;l&&t(n)&&(i={sc:n.previousElementSibling,ec:n.nextElementSibling},d.removeItem(n),e(l))}}(e),i},removeEmptyNode:function(e){const t=this;!function i(n){if(n===e||!t.onlyZeroWidthSpace(n.textContent)||/^BR$/i.test(n.nodeName)||n.firstChild&&/^BR$/i.test(n.firstChild.nodeName)||t.isComponent(n)){const e=n.children;for(let n=0,l=e.length,o=0;n")},isIgnoreNodeChange:function(e){return 3!==e.nodeType&&!/^(span|font|b|strong|var|i|em|u|ins|s|strike|del|sub|sup|mark|a)$/i.test(e.nodeName)},cleanHTML:function(e){const t=new this._w.RegExp("^(meta|script|link|style|[a-z]+:[a-z]+)$","i"),i=this._d.createRange().createContextualFragment(e).childNodes;let n="";for(let e=0,l=i.length;e(\n|.)*<\/(script|style)>/g,"").replace(/(<[a-zA-Z0-9]+)[^>]*(?=>)/g,(function(e,t){const i=e.match(/((?:contenteditable|colspan|rowspan|target|href|src|class|data-format|data-size|data-file-size|data-file-name|data-origin|data-align|data-image-link|data-rotate|data-proportion|data-percentage|origin-size)\s*=\s*"[^"]*")/gi);if(i)for(let e=0,n=i.length;e^<]*)>/g,"").replace(this._deleteExclusionTags,""),this._tagConvertor(n||e)},_deleteExclusionTags:function(){const e="br|p|div|pre|blockquote|h[1-6]|ol|ul|dl|li|hr|figure|figcaption|img|iframe|audio|video|table|thead|tbody|tr|th|td|a|b|strong|var|i|em|u|ins|s|span|strike|del|sub|sup|mark".split("|");let t="<\\/?(";for(let i=0,n=e.length;i'}return i}()+("auto"===e.height?"":"");o.allowFullscreen=!0,o.frameBorder=0,o.addEventListener("load",(function(){this.setAttribute("scrolling","auto"),this.contentDocument.head.innerHTML=''+t,this.contentDocument.body.className="sun-editor-editable",this.contentDocument.body.setAttribute("contenteditable",!0),this.contentDocument.body.innerHTML=l}))}else o.setAttribute("contenteditable",!0),o.setAttribute("scrolling","auto"),o.className+=" sun-editor-editable",o.innerHTML=l;o.style.height=e.height,o.style.minHeight=e.minHeight,o.style.maxHeight=e.maxHeight;const s=document.createElement("TEXTAREA");s.className="se-wrapper-inner se-wrapper-code",s.style.display="none",s.style.height=e.height,s.style.minHeight=e.minHeight,s.style.maxHeight=e.maxHeight,"auto"===e.height&&(s.style.overflow="hidden");let a=null,r=null,c=null;if(e.resizingBar&&(a=document.createElement("DIV"),a.className="se-resizing-bar sun-editor-common",r=document.createElement("DIV"),r.className="se-navigation sun-editor-common",a.appendChild(r),e.charCounter)){const t=document.createElement("DIV");if(t.className="se-char-counter-wrapper",c=document.createElement("SPAN"),c.className="se-char-counter",c.textContent="0",t.appendChild(c),e.maxCharCount>0){const i=document.createElement("SPAN");i.textContent=" / "+e.maxCharCount,t.appendChild(i)}a.appendChild(t)}let d=null;return e.placeholder&&(d=document.createElement("SPAN"),d.className="se-placeholder",d.innerText=e.placeholder),{bottomBar:{resizingBar:a,navigation:r,charCounter:c},wysiwygFrame:o,codeView:s,placeholder:d}},_initOptions:function(e,t){t.lang=t.lang||c.a,t.mode=t.mode||"classic",t.toolbarWidth=t.toolbarWidth?u.isNumber(t.toolbarWidth)?t.toolbarWidth+"px":t.toolbarWidth:"auto",t.stickyToolbar=/balloon/i.test(t.mode)?-1:void 0===t.stickyToolbar?0:/^\d+/.test(t.stickyToolbar)?u.getNumber(t.stickyToolbar,0):-1,t.iframe=t.fullPage||t.iframe,t.iframeCSSFileName=t.iframe?"string"==typeof t.iframeCSSFileName?[t.iframeCSSFileName]:t.iframeCSSFileName||["suneditor"]:null,t.codeMirror=t.codeMirror?t.codeMirror.src?t.codeMirror:{src:t.codeMirror}:null,t.display=t.display||("none"!==e.style.display&&e.style.display?e.style.display:"block"),t.popupDisplay=t.popupDisplay||"full",t.resizingBar=void 0===t.resizingBar?!/inline|balloon/i.test(t.mode):t.resizingBar,t.showPathLabel=!!t.resizingBar&&("boolean"!=typeof t.showPathLabel||t.showPathLabel),t.charCounter=t.maxCharCount>0||"boolean"==typeof t.charCounter&&t.charCounter,t.maxCharCount=u.isNumber(t.maxCharCount)&&t.maxCharCount>-1?1*t.maxCharCount:null,t.width=t.width?u.isNumber(t.width)?t.width+"px":t.width:e.clientWidth?e.clientWidth+"px":"100%",t.minWidth=(u.isNumber(t.minWidth)?t.minWidth+"px":t.minWidth)||"",t.maxWidth=(u.isNumber(t.maxWidth)?t.maxWidth+"px":t.maxWidth)||"",t.height=t.height?u.isNumber(t.height)?t.height+"px":t.height:e.clientHeight?e.clientHeight+"px":"auto",t.minHeight=(u.isNumber(t.minHeight)?t.minHeight+"px":t.minHeight)||"",t.maxHeight=(u.isNumber(t.maxHeight)?t.maxHeight+"px":t.maxHeight)||"",t.font=t.font?t.font:null,t.fontSize=t.fontSize?t.fontSize:null,t.formats=t.formats?t.formats:null,t.colorList=t.colorList?t.colorList:null,t.lineHeights=t.lineHeights?t.lineHeights:null,t.paragraphStyles=t.paragraphStyles?t.paragraphStyles:null,t.textStyles=t.textStyles?t.textStyles:null,t.fontSizeUnit="string"==typeof t.fontSizeUnit&&t.fontSizeUnit.trim()||"px",t.imageResizing=void 0===t.imageResizing||t.imageResizing,t.imageHeightShow=void 0===t.imageHeightShow||!!t.imageHeightShow,t.imageWidth=t.imageWidth?u.isNumber(t.imageWidth)?t.imageWidth+"px":t.imageWidth:"auto",t.imageSizeOnlyPercentage=!!t.imageSizeOnlyPercentage,t._imageSizeUnit=t.imageSizeOnlyPercentage?"%":"px",t.imageRotation=void 0!==t.imageRotation?t.imageRotation:!(t.imageSizeOnlyPercentage||!t.imageHeightShow),t.imageFileInput=void 0===t.imageFileInput||t.imageFileInput,t.imageUrlInput=void 0===t.imageUrlInput||!t.imageFileInput||t.imageUrlInput,t.imageUploadHeader=t.imageUploadHeader||null,t.imageUploadUrl=t.imageUploadUrl||null,t.imageUploadSizeLimit=/\d+/.test(t.imageUploadSizeLimit)?u.getNumber(t.imageUploadSizeLimit,0):null,t.videoResizing=void 0===t.videoResizing||t.videoResizing,t.videoHeightShow=void 0===t.videoHeightShow||!!t.videoHeightShow,t.videoRatioShow=void 0===t.videoRatioShow||!!t.videoRatioShow,t.videoWidth=t.videoWidth&&u.getNumber(t.videoWidth)?u.isNumber(t.videoWidth)?t.videoWidth+"px":t.videoWidth:"100%",t.videoSizeOnlyPercentage=!!t.videoSizeOnlyPercentage,t._videoSizeUnit=t.videoSizeOnlyPercentage?"%":"px",t.videoRotation=void 0!==t.videoRotation?t.videoRotation:!(t.videoSizeOnlyPercentage||!t.videoHeightShow),t.videoRatio=u.getNumber(t.videoRatio,4)||.5625,t.videoRatioList=t.videoRatioList?t.videoRatioList:null,t.youtubeQuery=(t.youtubeQuery||"").replace("?",""),t.callBackSave=t.callBackSave?t.callBackSave:null,t.templates=t.templates?t.templates:null,t.placeholder="string"==typeof t.placeholder?t.placeholder:null,t.buttonList=t.buttonList||[["undo","redo"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],["outdent","indent"],["fullScreen","showBlocks","codeView"],["preview","print"]]},_defaultButtons:function(e){return{bold:["_se_command_bold",e.toolbar.bold+" (CTRL+B)","STRONG","",''],underline:["_se_command_underline",e.toolbar.underline+" (CTRL+U)","INS","",''],italic:["_se_command_italic",e.toolbar.italic+" (CTRL+I)","EM","",''],strike:["_se_command_strike",e.toolbar.strike+" (CTRL+SHIFT+S)","DEL","",''],subscript:["_se_command_subscript",e.toolbar.subscript,"SUB","",''],superscript:["_se_command_superscript",e.toolbar.superscript,"SUP","",''],removeFormat:["",e.toolbar.removeFormat,"removeFormat","",''],indent:["",e.toolbar.indent+" (CTRL+])","indent","",''],outdent:["_se_command_outdent",e.toolbar.outdent+" (CTRL+[)","outdent","",'',!0],fullScreen:["code-view-enabled",e.toolbar.fullScreen,"fullScreen","",''],showBlocks:["",e.toolbar.showBlocks,"showBlocks","",''],codeView:["code-view-enabled",e.toolbar.codeView,"codeView","",''],undo:["_se_command_undo",e.toolbar.undo+" (CTRL+Z)","undo","",'',!0],redo:["_se_command_redo",e.toolbar.redo+" (CTRL+Y / CTRL+SHIFT+Z)","redo","",'',!0],preview:["",e.toolbar.preview,"preview","",''],print:["",e.toolbar.print,"print","",''],save:["_se_command_save",e.toolbar.save,"save","",'',!0],font:["se-btn-select se-btn-tool-font _se_command_font_family",e.toolbar.font,"font","submenu",''+e.toolbar.font+''],formatBlock:["se-btn-select se-btn-tool-format",e.toolbar.formats,"formatBlock","submenu",''+e.toolbar.formats+''],fontSize:["se-btn-select se-btn-tool-size",e.toolbar.fontSize,"fontSize","submenu",''+e.toolbar.fontSize+''],fontColor:["",e.toolbar.fontColor,"fontColor","submenu",''],hiliteColor:["",e.toolbar.hiliteColor,"hiliteColor","submenu",''],align:["se-btn-align",e.toolbar.align,"align","submenu",''],list:["_se_command_list",e.toolbar.list,"list","submenu",''],horizontalRule:["btn_line",e.toolbar.horizontalRule,"horizontalRule","submenu",''],table:["",e.toolbar.table,"table","submenu",''],lineHeight:["",e.toolbar.lineHeight,"lineHeight","submenu",''],template:["",e.toolbar.template,"template","submenu",''],paragraphStyle:["",e.toolbar.paragraphStyle,"paragraphStyle","submenu",''],textStyle:["",e.toolbar.textStyle,"textStyle","submenu",''],link:["",e.toolbar.link,"link","dialog",''],image:["",e.toolbar.image,"image","dialog",''],video:["",e.toolbar.video,"video","dialog",'']}},_createModuleGroup:function(e){const t=u.createElement("DIV");t.className="se-btn-module"+(e?"":" se-btn-module-border");const i=u.createElement("UL");return i.className="se-menu-list",t.appendChild(i),{div:t,ul:i}},_createButton:function(e,t,i,n,l,o){const s=u.createElement("LI"),a=u.createElement("BUTTON");return a.setAttribute("type","button"),a.setAttribute("class","se-btn"+(e?" "+e:"")+" se-tooltip"),a.setAttribute("data-command",i),a.setAttribute("data-display",n),l+=''+t+"",o&&a.setAttribute("disabled",!0),a.innerHTML=l,s.appendChild(a),{li:s,button:a}},_createToolBar:function(e,t,i,n){const l=e.createElement("DIV");l.className="se-toolbar-separator-vertical";const o=e.createElement("DIV");o.className="se-toolbar sun-editor-common";const s=this._defaultButtons(n),a={},r={};if(i){const e=i.length?i:Object.keys(i).map((function(e){return i[e]}));for(let t,i=0,n=e.length;i0){for(let e=0;e":i),this.history.push(!0)},focus:function(){if("none"!==e.element.wysiwygFrame.style.display){try{const e=this.getRange();this.setRange(e.startContainer,e.startOffset,e.endContainer,e.endOffset)}catch(t){const i=r.getParentElement(this.getSelectionNode(),"figcaption");i?i.focus():e.element.wysiwyg.focus(),this._editorRange()}d._applyTagEffects()}},focusEdge:function(e){if(r.isComponent(e)){const t=e.querySelector("IMG"),i=e.querySelector("IFRAME");t?this.selectComponent(t,"image"):i&&this.selectComponent(i,"video")}else e=r.getChildElement(e,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!0),this.setRange(e,e.textContent.length,e,e.textContent.length)},setRange:function(e,t,i,n){if(!e||!i)return;t>e.textContent.length&&(t=e.textContent.length),n>i.textContent.length&&(n=i.textContent.length);const l=this._wd.createRange();l.setStart(e,t),l.setEnd(i,n);const o=this.getSelection();o.removeAllRanges&&o.removeAllRanges(),o.addRange(l),this._editorRange()},removeRange:function(){this.getSelection().removeAllRanges();const e=this.commandMap;r.changeTxt(e.FORMAT,n.toolbar.formats),r.changeTxt(e.FONT,n.toolbar.font),r.changeTxt(e.FONT_TOOLTIP,n.toolbar.font),r.changeTxt(e.SIZE,n.toolbar.fontSize),r.removeClass(e.LI_ICON,"se-icon-list-bullets"),r.addClass(e.LI_ICON,"se-icon-list-number"),r.removeClass(e.LI,"active"),r.removeClass(e.STRONG,"active"),r.removeClass(e.INS,"active"),r.removeClass(e.EM,"active"),r.removeClass(e.DEL,"active"),r.removeClass(e.SUB,"active"),r.removeClass(e.SUP,"active"),e.OUTDENT&&e.OUTDENT.setAttribute("disabled",!0),e.LI&&e.LI.removeAttribute("data-focus"),e.ALIGN&&(e.ALIGN.className="se-icon-align-left",e.ALIGN.removeAttribute("data-focus"))},getRange:function(){return this._variable._range||this._createDefaultRange()},getSelection:function(){return this._ww.getSelection()},getSelectionNode:function(){return this._variable._selectionNode&&!r.isWysiwygDiv(this._variable._selectionNode)||this._editorRange(),this._variable._selectionNode||e.element.wysiwyg.firstChild},_editorRange:function(){const e=this.getSelection();let t=null,i=null;t=e.rangeCount>0?e.getRangeAt(0):this._createDefaultRange(),this._variable._range=t,i=t.collapsed?t.commonAncestorContainer:e.extentNode||e.anchorNode,this._variable._selectionNode=i},_createDefaultRange:function(){e.element.wysiwyg.focus();const t=this._wd.createRange();return e.element.wysiwyg.firstChild||this.execCommand("formatBlock",!1,"P"),t.setStart(e.element.wysiwyg.firstChild,0),t.setEnd(e.element.wysiwyg.firstChild,0),t},getSelectedElements:function(t){let i=this.getRange();if(r.isWysiwygDiv(i.startContainer)){const t=e.element.wysiwyg.children;if(0===t.length)return null;this.setRange(t[0],0,t[t.length-1],t[t.length-1].textContent.trim().length),i=this.getRange()}const n=i.startContainer,l=i.endContainer,o=i.commonAncestorContainer,s=r.getListChildren(o,(function(e){return t?t(e):r.isFormatElement(e)}));if(r.isWysiwygDiv(o)||r.isRangeFormatElement(o)||s.unshift(r.getFormatElement(o)),n===l||1===s.length)return s;let a=r.getFormatElement(n),c=r.getFormatElement(l),d=null,u=null;const h=function(e){return!r.isTable(e)||/^TABLE$/i.test(e.nodeName)},p=r.getRangeFormatElement(a,h),g=r.getRangeFormatElement(c,h),m=p===g;for(let e,t=0,i=s.length;t=0;e--)c[e]===n.parentNode&&c[e].firstChild===n&&0===i&&(d=e,n=n.parentNode);for(let e=u-1,t=n;e>d;e--)c[e]===t.parentNode&&1===c[e].nodeType&&(c.splice(e,1),t=t.parentNode,--u);for(let e=d;e<=u;e++){const o=c[e];0===o.length||3===o.nodeType&&void 0===o.data?r.removeItem(o):o!==t?o!==n?(r.removeItem(o),this.history.push(!1)):(a=1===n.nodeType?r.createTextNode(n.textContent):r.createTextNode(n.substringData(l,n.length-l)),a.length>0?n.data=a.data:r.removeItem(n)):(s=1===t.nodeType?r.createTextNode(t.textContent):r.createTextNode(t.substringData(0,i)),s.length>0?t.data=s.data:r.removeItem(t))}},applyRangeFormatElement:function(e){const t=this.getSelectedElementsAndComponents();if(!t||0===t.length)return;let i,n,l,o=t[t.length-1];i=r.isRangeFormatElement(o)||r.isFormatElement(o)?o:r.getRangeFormatElement(o)||r.getFormatElement(o),r.isCell(i)?(n=null,l=i):(n=i.nextSibling,l=i.parentNode);let s=r.getElementDepth(i),a=null;const c=[],d=function(e,t,i){let n=null;return e===t||r.isTable(t)||(n=r.removeItemAllParents(t)),n?n.ec:i};for(let i,o,u,h,p=0,g=t.length;p=u?(s=u,l=t.cc,n=d(l,o,t.ec),n&&(l=n.parentNode)):l===t.cc&&(n=t.ec),l!==t.cc&&(h=d(l,t.cc),void 0!==h&&(n=h)),e.appendChild(a),a=null}}else s>=u&&(s=u,l=o,n=i.nextSibling),e.appendChild(i),l!==o&&(h=d(l,o),void 0!==h&&(n=h));l.insertBefore(e,n),d(e,n),this.history.push(!1);const u=r.getEdgeChildNodes(e.firstElementChild,e.lastElementChild);t.length>1?this.setRange(u.sc,0,u.ec,u.ec.textContent.length):this.setRange(u.ec,u.ec.textContent.length,u.ec,u.ec.textContent.length)},detachRangeFormatElement:function(e,t,i,n,l){const o=this.getRange(),s=o.startOffset,a=o.endOffset,c=e.childNodes,u=e.parentNode;let h=null,p=null,g=e.cloneNode(!1);const m=r.isList(i);let f=!1;function _(e,t,i){if(r.onlyZeroWidthSpace(t)&&(t.innerHTML=r.zeroWidthSpace),3===t.nodeType)return e.insertBefore(t,i),t;const n=t.childNodes;let l=t.cloneNode(!1),o=null,s=null;for(;n[0];)s=n[0],r.isIgnoreNodeChange(s)&&!r.isListCell(l)?(l.childNodes.length>0&&(o||(o=l),e.insertBefore(l,i),l=t.cloneNode(!1)),e.insertBefore(s,i),o||(o=s)):l.appendChild(s);return l.childNodes.length>0&&(e.insertBefore(l,i),o||(o=l)),o}for(let l,o=0,s=c.length;o0&&(u.insertBefore(g,e),g=null),!m&&r.isListCell(l)){const t=l;l=r.isCell(e.parentNode)?r.createElement("DIV"):r.createElement("P"),l.innerHTML=t.innerHTML,r.copyFormatAttributes(l,t)}else l=l.cloneNode(!0);n||(i?(f||(u.insertBefore(i,e),f=!0),l=_(i,l,null)):l=_(u,l,e),t?(p=l,h||(h=l)):h||(h=p=l))}const b=e.parentNode,y=e.nextSibling;g&&g.children.length>0&&b.insertBefore(g,y),r.removeItem(e);const v=n?{cc:b,sc:h,ec:h&&h.parentNode?h.nextSibling:g&&g.children.length>0?g:y||null}:r.getEdgeChildNodes(h,p);if(l)return v;!n&&v&&(t?this.setRange(v.sc,s,v.ec,a):this.setRange(v.sc,0,v.sc,0)),this.history.push(!1),d._applyTagEffects()},nodeChange:function(t,i,n,l){const o=this.getRange();i=!!(i&&i.length>0)&&i,n=!!(n&&n.length>0)&&n;const s=!t,c=s&&!n&&!i;let d,u,h,p=o.startContainer,g=o.startOffset,m=o.endContainer,f=o.endOffset;if(c&&o.collapsed&&r.isFormatElement(p.parentNode)&&r.isFormatElement(m.parentNode))return;s&&(t=r.createElement("DIV"));const _=t.nodeName;if(!c&&p===m&&!n&&t){let e=p,i=0;const n=[],l=t.style;for(let e=0,t=l.length;e0){for(;!r.isFormatElement(e)&&!r.isWysiwygDiv(e);){for(let l=0;l=n.length)return}}if(d=r.isWysiwygDiv(p)?e.element.wysiwyg.firstChild:p,u=g,r.isBreak(d)||1===d.nodeType&&d.childNodes.length>0){const e=r.isBreak(d);if(!e){for(;d&&!r.isBreak(d)&&1===d.nodeType;)d=d.childNodes[u]||d.nextElementSibling||d.nextSibling,u=0;let e=r.getFormatElement(d);e===r.getRangeFormatElement(e)&&(e=r.createElement(r.isCell(d)?"DIV":"P"),d.parentNode.insertBefore(e,d),e.appendChild(d))}if(r.isBreak(d)){const t=r.createTextNode(r.zeroWidthSpace);d.parentNode.insertBefore(t,d),d=t,e&&(p===m&&(m=d,f=1),r.removeItem(p))}}if(p=d,g=u,d=r.isWysiwygDiv(m)?e.element.wysiwyg.lastChild:m,u=f,r.isBreak(d)||1===d.nodeType&&d.childNodes.length>0){const e=r.isBreak(d);if(!e){for(;d&&!r.isBreak(d)&&1===d.nodeType;)h=d.childNodes,d=h[u>0?u-1:u]||!/FIGURE/i.test(h[0].nodeName)?h[0]:d.previousElementSibling||d.previousSibling||p,u=u>0?d.textContent.length:u;let e=r.getFormatElement(d);e===r.getRangeFormatElement(e)&&(e=r.createElement(r.isCell(e)?"DIV":"P"),d.parentNode.insertBefore(e,d),e.appendChild(d))}if(r.isBreak(d)){const t=r.createTextNode(r.zeroWidthSpace);d.parentNode.insertBefore(t,d),d=t,u=1,e&&r.removeItem(m)}}m=d,f=u,this.setRange(p,g,m,f);let b,y={},v={},C="",x="",w="";if(i){for(let e,t=0,n=i.length;t0&&(o=n.replace(C,"").trim(),o!==n&&(S.v=!0));const d=t.className;let u="";return x&&d.length>0&&(u=d.replace(x,"").trim(),u!==d&&(S.v=!0)),(!s||!x&&d||!C&&n||o||u||!i)&&(o||u||t.nodeName!==_||a.Boolean(C)!==a.Boolean(n)||a.Boolean(x)!==a.Boolean(d))?(C&&n.length>0&&(t.style.cssText=o),t.style.cssText||t.removeAttribute("style"),x&&d.length>0&&(t.className=u.trim()),t.className.trim()||t.removeAttribute("class"),t.style.cssText||t.className||t.nodeName!==_&&!i?t:(S.v=!0,null)):(S.v=!0,null)},E=this.getSelectedElements();r.getFormatElement(p)||(p=r.getChildElement(E[0],(function(e){return 3===e.nodeType})),g=0),r.getFormatElement(m)||(m=r.getChildElement(E[E.length-1],(function(e){return 3===e.nodeType})),f=m.textContent.length);const k=r.getFormatElement(p)===r.getFormatElement(m),z=E.length-(k?0:1);b=t.cloneNode(!1);const T=c||s&&function(e,t){for(let i=0,n=e.length;i0?(b=t.cloneNode(!1),v=this._nodeChange_endLine(E[z],b,N,m,f,c,s,S,A,L)):v=y}this.controllersOff(),this.setRange(y.container,y.offset,v.container,v.offset),this.history.push(!1)},_stripRemoveNode:function(e){const t=e.parentNode;if(!e||3===e.nodeType||!t)return;const i=e.childNodes;for(;i[0];)t.insertBefore(i[0],e);t.removeChild(e)},_removeEmptyNode:function(e,t){const i=r.onlyZeroWidthSpace(t.textContent);i&&(t.textContent=" "),r.removeEmptyNode(e),i&&(t.textContent=r.zeroWidthSpace)},_mergeSameTags:function(e,t,i){const n=this,l={a:0,b:0};return function e(o,s,a,r,c){const d=o.childNodes;for(let u,h,p=0,g=d.length;p0&&o++;const d=u.lastChild,g=h.firstChild,m=d&&g&&3===d.nodeType&&3===g.nodeType;let f=d.textContent.length,_=d.previousSibling;for(;_&&3===_.nodeType;)f+=_.textContent.length,_=_.previousSibling;o>0&&d&&g&&3===d.nodeType&&3===g.nodeType&&(d.textContent.length>0||g.textContent.length>0)&&o--,r&&t&&t[s]>p&&(s>0&&t[s-1]!==a?r=!1:(t[s]-=1,t[s+1]>=0&&t[s]===p&&(t[s+1]+=o,m&&d&&3===d.nodeType&&g&&3===g.nodeType&&(l.a+=f)))),c&&i&&i[s]>p&&(s>0&&i[s-1]!==a?c=!1:(i[s]-=1,i[s+1]>=0&&i[s]===p&&(i[s+1]+=o,m&&d&&3===d.nodeType&&g&&3===g.nodeType&&(l.b+=f)))),3===u.nodeType?u.textContent+=h.textContent:u.innerHTML+=h.innerHTML,n.util.removeItem(h),p--}else 1===u.nodeType&&e(u,s+1,p,r,c)}}(e,0,0,!0,!0),l},_util_getAnchor:function(e,t){return t&&!e?this.getParentElement(t,function(e){return this.isAnchor(e)}.bind(this)):null},_util_isAnchor:function(e,t){return t&&!e&&3!==t.nodeType&&this.isAnchor(t)},_nodeChange_oneLine:function(e,t,i,n,l,o,s,c,d,u,h,p,g){let m=n.parentNode;for(;!(m.nextSibling||m.previousSibling||r.isFormatElement(m.parentNode)||r.isWysiwygDiv(m.parentNode))&&m.nodeName!==t.nodeName;)m=m.parentNode;if(!d&&m===o.parentNode&&m.nodeName===t.nodeName&&r.onlyZeroWidthSpace(n.textContent.slice(0,l))&&r.onlyZeroWidthSpace(o.textContent.slice(s))){const e=m.childNodes;let i=!0;for(let t,l,s,a,c=0,d=e.length;c0&&(i=t.test(e.style.cssText)),!i}if(function e(n,l){const o=n.childNodes;for(let n,s=0,a=o.length;s=E?z-E:N.data.length-E));if(S){const t=p(l);if(t&&t.parentNode!==e){let i=t,n=null;for(;i.parentNode!==e;){for(l=n=i.parentNode.cloneNode(!1);i.childNodes[0];)n.appendChild(i.childNodes[0]);i.appendChild(n),i=i.parentNode}i.parentNode.appendChild(t)}S=S.cloneNode(!1)}o.data.length>0&&l.appendChild(o);const c=p(l);for(c&&(S=c),S&&(e=S),C=a,v=[],w="";C!==e&&C!==f&&null!==C;)n=g(C)?null:i(C),n&&1===C.nodeType&&L(C)&&(v.push(n),w+=C.style.cssText.substr(0,C.style.cssText.indexOf(":"))+"|"),C=C.parentNode;const d=v.pop()||s;for(x=C=d;v.length>0;)C=v.pop(),x.appendChild(C),x=C;if(t.appendChild(d),e.appendChild(t),S&&!p(k)&&(t=t.cloneNode(!1),b.appendChild(t),_.push(t)),N=s,E=0,T=!0,C!==s&&C.appendChild(N),!y)continue}if(A||a!==k){if(T){if(1===a.nodeType&&!r.isBreak(a)){!u&&r.isIgnoreNodeChange(a)?(t=t.cloneNode(!1),b.appendChild(a),b.appendChild(t),_.push(t),s--):e(a,a);continue}C=a,v=[],w="";const o=[];for(;null!==C.parentNode&&C!==f&&C!==t;)n=A?C.cloneNode(!1):i(C),1===C.nodeType&&!r.isBreak(a)&&n&&L(C)&&(n&&(g(n)?S||o.push(n):v.push(n)),w+=C.style.cssText.substr(0,C.style.cssText.indexOf(":"))+"|"),C=C.parentNode;v=v.concat(o);const c=v.pop()||a;for(x=C=c;v.length>0;)C=v.pop(),x.appendChild(C),x=C;if(g(t.parentNode)&&!g(c)&&(t=t.cloneNode(!1),b.appendChild(t),_.push(t)),A||S||!g(c))c===a?l=A?b:t:A?(b.appendChild(c),l=C):(t.appendChild(c),l=C);else{t=t.cloneNode(!1);const e=c.childNodes;for(let i=0,n=e.length;i0?C:t}if(S&&3===a.nodeType)if(p(a)){const e=r.getParentElement(l,function(e){return this.isAnchor(e.parentNode)||e.parentNode===b}.bind(r));S.appendChild(e),t=e.cloneNode(!1),_.push(t),b.appendChild(t)}else S=null}d=a.cloneNode(!1),l.appendChild(d),1!==a.nodeType||r.isBreak(a)||(h=d),e(a,h)}else{S=p(a);const e=r.createTextNode(1===k.nodeType?"":k.substringData(z,k.length-z)),l=r.createTextNode(y||1===k.nodeType?"":k.substringData(0,z));if(S?S=S.cloneNode(!1):g(t.parentNode)&&!S&&(t=t.cloneNode(!1),b.appendChild(t),_.push(t)),e.data.length>0){C=a,w="",v=[];const t=[];for(;C!==b&&C!==f&&null!==C;)1===C.nodeType&&L(C)&&(g(C)?t.push(C.cloneNode(!1)):v.push(C.cloneNode(!1)),w+=C.style.cssText.substr(0,C.style.cssText.indexOf(":"))+"|"),C=C.parentNode;for(v=v.concat(t),d=x=C=v.pop()||e;v.length>0;)C=v.pop(),x.appendChild(C),x=C;b.appendChild(d),C.textContent=e.data}if(S&&d){const e=p(d);e&&(S=e)}for(C=a,v=[],w="";C!==b&&C!==f&&null!==C;)n=g(C)?null:i(C),n&&1===C.nodeType&&L(C)&&(v.push(n),w+=C.style.cssText.substr(0,C.style.cssText.indexOf(":"))+"|"),C=C.parentNode;const o=v.pop()||l;for(x=C=o;v.length>0;)C=v.pop(),x.appendChild(C),x=C;S?((t=t.cloneNode(!1)).appendChild(o),S.insertBefore(t,S.firstChild),b.appendChild(S),_.push(t),S=null):t.appendChild(o),k=l,z=l.data.length,A=!0,!c&&u&&(t=l,l.textContent=r.zeroWidthSpace),C!==l&&C.appendChild(k)}}}(e,b),d&&!c&&!h.v)return{startContainer:n,startOffset:l,endContainer:o,endOffset:s};if(c=c&&d)for(let e=0;e<_.length;e++){let t=_[e],i=r.createTextNode(u?r.zeroWidthSpace:t.textContent);b.insertBefore(i,t),b.removeChild(t),0===e&&(N=k=i)}else{if(d)for(let e=0;e<_.length;e++)this._stripRemoveNode(_[e]);u&&(N=k=t)}this._removeEmptyNode(b,t),u&&(E=N.textContent.length,z=k.textContent.length);const I=c||0===k.textContent.length;0===k.textContent.length&&(r.removeItem(k),k=N),z=I?k.textContent.length:z;const B={s:0,e:0},R=r.getNodePath(N,b,B),D=!k.parentNode;D&&(k=N);const M={s:0,e:0},O=r.getNodePath(k,b,D||I?null:M);E+=B.s,z=u?E:D?N.textContent.length:I?z+B.s:z+M.s;const P=this._mergeSameTags(b,R,O);return e.innerHTML=b.innerHTML,N=r.getNodeFromPath(R,e),k=r.getNodeFromPath(O,e),{startContainer:N,startOffset:E+P.a,endContainer:k,endOffset:z+P.b}},_nodeChange_startLine:function(e,t,i,n,l,o,s,a,c,d){let u=n.parentNode;for(;!(u.nextSibling||u.previousSibling||r.isFormatElement(u.parentNode)||r.isWysiwygDiv(u.parentNode))&&u.nodeName!==t.nodeName;)u=u.parentNode;if(!s&&u.nodeName===t.nodeName&&!r.isFormatElement(u)&&!u.nextSibling&&r.onlyZeroWidthSpace(n.textContent.slice(0,l))){let e=!0,i=n.previousSibling;for(;i;){if(!r.onlyZeroWidthSpace(i)){e=!1;break}i=i.previousSibling}if(e)return r.copyTagAttributes(u,t),{container:n,offset:l}}a.v=!1;const h=e,p=[t],g=e.cloneNode(!1);let m,f,_,b,y=n,v=l,C=!1;if(function e(n,l){const o=n.childNodes;for(let n,s=0,a=o.length;s0,y=m.pop()||a;for(_=f=y;m.length>0;)f=m.pop(),_.appendChild(f),_=f;if(d(t.parentNode)&&!d(y)&&(t=t.cloneNode(!1),g.appendChild(t),p.push(t)),!b&&d(y)){t=t.cloneNode(!1);const e=y.childNodes;for(let i=0,n=e.length;i0&&l.appendChild(o);const d=c(l);for(d&&(b=d),b&&(e=b),f=l,m=[];f!==e&&null!==f;)n=i(f),1===f.nodeType&&n&&m.push(n),f=f.parentNode;const u=m.pop()||l;for(_=f=u;m.length>0;)f=m.pop(),_.appendChild(f),_=f;u!==l?(t.appendChild(u),l=f):l=t,r.isBreak(a)&&t.appendChild(a.cloneNode(!1)),e.appendChild(t),y=s,v=0,C=!0,l.appendChild(y)}}}(e,g),s&&!o&&!a.v)return{container:n,offset:l};if(o=o&&s)for(let e=0;e0&&c===d)return void(e.innerHTML=i.innerHTML)}o.v=!1;const s=e.cloneNode(!1),a=[t];let c=!0;if(function e(n,l){const o=n.childNodes;for(let n,d=0,u=o.length;d0,y=m.pop()||a;for(_=f=y;m.length>0;)f=m.pop(),_.appendChild(f),_=f;if(d(t.parentNode)&&!d(y)&&(t=t.cloneNode(!1),g.insertBefore(t,g.firstChild),p.push(t)),!b&&d(y)){t=t.cloneNode(!1);const e=y.childNodes;for(let i=0,n=e.length;i0?f:t}else u?(t.insertBefore(y,t.firstChild),l=f):l=t;if(b&&3===a.nodeType)if(c(a)){const e=r.getParentElement(l,function(e){return this.isAnchor(e.parentNode)||e.parentNode===g}.bind(r));b.appendChild(e),t=e.cloneNode(!1),p.push(t),g.insertBefore(t,g.firstChild)}else b=null}if(C||a!==y)n=C?i(a):a.cloneNode(!1),n&&(l.insertBefore(n,l.firstChild),1!==a.nodeType||r.isBreak(a)||(u=n)),e(a,u);else{b=c(a);const e=r.createTextNode(1===y.nodeType?"":y.substringData(v,y.length-v)),o=r.createTextNode(1===y.nodeType?"":y.substringData(0,v));if(b){b=b.cloneNode(!1);const e=c(l);if(e&&e.parentNode!==g){let t=e,i=null;for(;t.parentNode!==g;){for(l=i=t.parentNode.cloneNode(!1);t.childNodes[0];)i.appendChild(t.childNodes[0]);t.appendChild(i),t=t.parentNode}t.parentNode.insertBefore(e,t.parentNode.firstChild)}b=b.cloneNode(!1)}else d(t.parentNode)&&!b&&(t=t.cloneNode(!1),g.appendChild(t),p.push(t));for(e.data.length>0&&l.insertBefore(e,l.firstChild),f=l,m=[];f!==g&&null!==f;)n=d(f)?null:i(f),n&&1===f.nodeType&&m.push(n),f=f.parentNode;const s=m.pop()||l;for(_=f=s;m.length>0;)f=m.pop(),_.appendChild(f),_=f;s!==l?(t.insertBefore(s,t.firstChild),l=f):l=t,r.isBreak(a)&&t.appendChild(a.cloneNode(!1)),b?(b.insertBefore(t,b.firstChild),g.insertBefore(b,g.firstChild),b=null):g.insertBefore(t,g.firstChild),y=o,v=o.data.length,C=!0,l.insertBefore(y,l.firstChild)}}}(e,g),s&&!o&&!a.v)return{container:n,offset:l};if(o=o&&s)for(let e=0;e0?e.element.code.scrollHeight+"px":"auto"),e.option.codeMirrorEditor&&e.option.codeMirrorEditor.refresh(),this._variable.isCodeView=!0,this._variable.isFullScreen||(this._notHideToolbar=!0,this._isBalloon&&(e.element._arrow.style.display="none",e.element.toolbar.style.left="",this._isInline=!0,this._isBalloon=!1,d._showToolbarInline())),this._variable._range=null,e.element.code.focus()),this._checkPlaceholder()},_setCodeDataToEditor:function(){const t=this._getCodeView();if(e.option.fullPage){const e=(new this._w.DOMParser).parseFromString(t,"text/html"),i=e.head.children;for(let t=0,n=i.length;t0?r.convertContentsForEditor(t):"


    "},_setEditorDataToCodeView:function(){const t=r.convertHTMLForCodeView(e.element.wysiwyg,this._variable.codeIndent);let i="";if(e.option.fullPage){const e=r.getAttributesToString(this._wd.body,null);i="\n\n"+this._wd.head.outerHTML.replace(/>(?!\n)/g,">\n")+"\n"+t+"\n"}else i=t;e.element.code.style.display="block",e.element.wysiwygFrame.style.display="none",this._setCodeView(i)},toggleFullScreen:function(t){const i=e.element.topArea,n=e.element.toolbar,l=e.element.editorArea,s=e.element.wysiwygFrame,c=e.element.code,u=this._variable;u.isFullScreen?(u.isFullScreen=!1,s.style.cssText=u._wysiwygOriginCssText,c.style.cssText=u._codeOriginCssText,n.style.cssText="",l.style.cssText=u._editorAreaOriginCssText,i.style.cssText=u._originCssText,o.body.style.overflow=u._bodyOverflow,e.option.stickyToolbar>-1&&r.removeClass(n,"se-toolbar-sticky"),u._fullScreenAttrs.sticky&&(u._fullScreenAttrs.sticky=!1,e.element._stickyDummy.style.display="block",r.addClass(n,"se-toolbar-sticky")),this._isInline=u._fullScreenAttrs.inline,this._isBalloon=u._fullScreenAttrs.balloon,this._isInline&&d._showToolbarInline(),d.onScroll_window(),r.removeClass(t.firstElementChild,"se-icon-reduction"),r.addClass(t.firstElementChild,"se-icon-expansion")):(u.isFullScreen=!0,u._fullScreenAttrs.inline=this._isInline,u._fullScreenAttrs.balloon=this._isBalloon,(this._isInline||this._isBalloon)&&(this._isInline=!1,this._isBalloon=!1),i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.width="100%",i.style.height="100%",i.style.zIndex="2147483647",""!==e.element._stickyDummy.style.display&&(u._fullScreenAttrs.sticky=!0,e.element._stickyDummy.style.display="none",r.removeClass(n,"se-toolbar-sticky")),u._bodyOverflow=o.body.style.overflow,o.body.style.overflow="hidden",u._editorAreaOriginCssText=l.style.cssText,u._wysiwygOriginCssText=s.style.cssText,u._codeOriginCssText=c.style.cssText,l.style.cssText=n.style.cssText="",s.style.cssText=(s.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0],c.style.cssText=(c.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0],n.style.width=s.style.height=c.style.height="100%",n.style.position="relative",n.style.display="block",u.innerHeight_fullScreen=a.innerHeight-n.offsetHeight,l.style.height=u.innerHeight_fullScreen+"px",r.removeClass(t.firstElementChild,"se-icon-expansion"),r.addClass(t.firstElementChild,"se-icon-reduction"),e.option.iframe&&"auto"===e.option.height&&(l.style.overflow="auto",this._iframeAutoHeight()))},print:function(){const t=r.createElement("IFRAME");t.style.display="none",o.body.appendChild(t);const i=r.getIframeDocument(t),n=this.getContents(!0);if(e.option.iframe){const t=r.getIframeDocument(e.element.wysiwygFrame),l=e.option.fullPage?r.getAttributesToString(t.body,["contenteditable"]):'class="sun-editor-editable"';i.write(""+t.head.innerHTML+""+n+"")}else{const e=r.createElement("DIV"),t=r.createElement("STYLE");t.innerHTML=r.getPageStyle(),e.className="sun-editor-editable",e.innerHTML=n,i.head.appendChild(t),i.body.appendChild(e)}try{if(t.focus(),-1!==a.navigator.userAgent.indexOf("MSIE")||o.documentMode||a.StyleMedia)try{t.contentWindow.document.execCommand("print",!1,null)}catch(e){t.contentWindow.print()}else t.contentWindow.print()}catch(e){throw Error("[SUNEDITOR.core.print.fail] error: "+e)}finally{r.removeItem(t)}},preview:function(){const t=this.getContents(!0),i=a.open("","_blank");if(i.mimeType="text/html",e.option.iframe){const n=r.getIframeDocument(e.element.wysiwygFrame),l=e.option.fullPage?r.getAttributesToString(n.body,["contenteditable"]):'class="sun-editor-editable"';i.document.write(""+n.head.innerHTML+""+t+"")}else i.document.write(''+n.toolbar.preview+"'+t+"")},setContents:function(t){const i=r.convertContentsForEditor(t);if(c._variable.isCodeView){const e=r.convertHTMLForCodeView(i,c._variable.codeIndent);c._setCodeView(e)}else e.element.wysiwyg.innerHTML=i,c.history.push(!1)},getContents:function(t){const i=e.element.wysiwyg.innerHTML,n=r.createElement("DIV");n.innerHTML=i;const l=r.getListChildren(n,(function(e){return/FIGCAPTION/i.test(e.nodeName)}));for(let e=0,t=l.length;e"+this._wd.head.outerHTML+""+n.innerHTML+""}return n.innerHTML},addDocEvent:function(t,i,n){o.addEventListener(t,i,n),e.option.iframe&&this._wd.addEventListener(t,i)},removeDocEvent:function(t,i){o.removeEventListener(t,i),e.option.iframe&&this._wd.removeEventListener(t,i)},_charCount:function(t,i){const n=e.element.charCounter;if(!n)return!0;(!t||t<0)&&(t=0);const l=e.option.maxCharCount;if(a.setTimeout((function(){n.textContent=e.element.wysiwyg.textContent.length})),l>0){let o=!1;const s=e.element.wysiwyg.textContent.length;if(s>l){c._editorRange();const e=c.getRange(),t=e.endOffset-1,i=c.getSelectionNode().textContent;c.getSelectionNode().textContent=i.slice(0,e.endOffset-1)+i.slice(e.endOffset,i.length),c.setRange(e.endContainer,t,e.endContainer,t),o=!0}else s+t>l&&(o=!0);if(o)return i&&!r.hasClass(n,"se-blink")&&(r.addClass(n,"se-blink"),a.setTimeout((function(){r.removeClass(n,"se-blink")}),600)),!1}return!0},_checkComponents:function(){this.plugins.image&&(this.initPlugins.image?this.plugins.image.checkImagesInfo.call(this):this.callPlugin("image",this.plugins.image.checkImagesInfo.bind(this))),this.plugins.video&&(this.initPlugins.video?this.plugins.video.checkVideosInfo.call(this):this.callPlugin("video",this.plugins.video.checkVideosInfo.bind(this)))},_setCodeView:function(t){e.option.codeMirrorEditor?e.option.codeMirrorEditor.getDoc().setValue(t):e.element.code.value=t},_getCodeView:function(){return e.option.codeMirrorEditor?e.option.codeMirrorEditor.getDoc().getValue():e.element.code.value},_init:function(t){this._ww=e.option.iframe?e.element.wysiwygFrame.contentWindow:a,this._wd=o,a.setTimeout(function(){if(this._checkComponents(),this._imagesInfoInit=!1,this._imagesInfoReset=!1,this.history.reset(!0),l.iframe&&(this._wd=e.element.wysiwygFrame.contentDocument,e.element.wysiwyg=this._wd.body,"auto"===l.height&&(this._iframeAuto=this._wd.body),this._iframeAutoHeight()),"function"==typeof g.onload)return g.onload(c,t)}.bind(this)),this.codeViewDisabledButtons=e.element.toolbar.querySelectorAll('.se-toolbar button:not([class~="code-view-enabled"])'),this._isInline=/inline/i.test(e.option.mode),this._isBalloon=/balloon/i.test(e.option.mode),this.commandMap={FORMAT:e.tool.format,FONT:e.tool.font,FONT_TOOLTIP:e.tool.fontTooltip,SIZE:e.tool.fontSize,ALIGN:e.tool.align,LI:e.tool.list,LI_ICON:e.tool.list&&e.tool.list.querySelector("i"),STRONG:e.tool.bold,INS:e.tool.underline,EM:e.tool.italic,DEL:e.tool.strike,SUB:e.tool.subscript,SUP:e.tool.superscript,OUTDENT:e.tool.outdent},this._variable._originCssText=e.element.topArea.style.cssText,this._placeholder=e.element.placeholder,this._checkPlaceholder(),this.history=function(e,t){const i=window,n=e.context.element,l=e.util,o=e.context.tool.undo,s=e.context.tool.redo;let a=null,r=0,c=[];function d(){const i=c[r];n.wysiwyg.innerHTML=i.contents,e.setRange(l.getNodeFromPath(i.s.path,n.wysiwyg),i.s.offset,l.getNodeFromPath(i.e.path,n.wysiwyg),i.e.offset),e.focus(),0===r?(o&&o.setAttribute("disabled",!0),s&&s.removeAttribute("disabled")):r===c.length-1?(o&&o.removeAttribute("disabled"),s&&s.setAttribute("disabled",!0)):(o&&o.removeAttribute("disabled"),s&&s.removeAttribute("disabled")),e._checkComponents(),e._charCount(0,!1),e._resourcesStateChange(),t()}function u(){const i=e.getContents(!0);if(c[r]&&i===c[r].contents)return;r++;const n=e.getRange();c.length>r&&(c=c.slice(0,r),s&&s.setAttribute("disabled",!0)),c[r]={contents:i,s:{path:l.getNodePath(n.startContainer,null),offset:n.startOffset},e:{path:l.getNodePath(n.endContainer,null),offset:n.endOffset}},1===r&&o&&o.removeAttribute("disabled"),e._checkComponents(),e._charCount(0,!1),t()}return{stack:c,push:function(t){i.setTimeout(e._resourcesStateChange),t&&!a||(i.clearTimeout(a),t)?a=i.setTimeout((function(){i.clearTimeout(a),a=null,u()}),500):u()},undo:function(){r>0&&(r--,d())},redo:function(){c.length-1>r&&(r++,d())},go:function(e){r=e<0?c.length-1:e,d()},reset:function(i){o&&o.setAttribute("disabled",!0),s&&s.setAttribute("disabled",!0),e.context.tool.save&&e.context.tool.save.setAttribute("disabled",!0),c.splice(0),r=0,c[r]={contents:e.getContents(!0),s:{path:[0,0],offset:0},e:{path:[0,0],offset:0}},i||t()}}}(this,d._onChange_historyStack)},_resourcesStateChange:function(){c._iframeAutoHeight(),c._checkPlaceholder()},_iframeAutoHeight:function(){this._iframeAuto&&(e.element.wysiwygFrame.style.height=this._iframeAuto.offsetHeight+"px")},_checkPlaceholder:function(){if(this._placeholder){if(this._variable.isCodeView)return void(this._placeholder.style.display="none");const t=e.element.wysiwyg;!r.onlyZeroWidthSpace(t.textContent)||t.querySelector(".se-component, pre, blockquote, hr, li, table, img, iframe, video")||(t.innerText.match(/\n/g)||"").length>1?this._placeholder.style.display="none":this._placeholder.style.display="block"}}},d={_directionKeyCode:new a.RegExp("^(8|13|32|46|3[3-9]|40|46)$"),_nonTextKeyCode:new a.RegExp("^(8|13|1[6-9]|20|27|3[3-9]|40|45|46|11[2-9]|12[0-3]|144|145)$"),_historyIgnoreKeyCode:new a.RegExp("^(1[6-9]|20|27|3[3-9]|40|45|11[2-9]|12[0-3]|144|145)$"),_onButtonsCheck:new a.RegExp("^(STRONG|INS|EM|DEL|SUB|SUP|LI)$"),_frontZeroWidthReg:new a.RegExp(r.zeroWidthSpace+"+",""),_keyCodeShortcut:{65:"A",66:"B",83:"S",85:"U",73:"I",89:"Y",90:"Z",219:"[",221:"]"},_shortcutCommand:function(e,t){let i=null;switch(d._keyCodeShortcut[e]){case"A":i="selectAll";break;case"B":i="STRONG";break;case"S":t&&(i="DEL");break;case"U":i="INS";break;case"I":i="EM";break;case"Z":i=t?"redo":"undo";break;case"Y":i="redo";break;case"[":i="outdent";break;case"]":i="indent"}return!!i&&(c.commandHandler(c.commandMap[i],i),!0)},_applyTagEffects:function(){const t=c.commandMap,i=this._onButtonsCheck,l=[],o=[];let s=!0,a=!0,d=!0,u=!0,h=!0,p=!0,g=!0,m="";for(let f=c.getSelectionNode();!r.isWysiwygDiv(f)&&f;f=f.parentNode)if(1===f.nodeType&&!r.isBreak(f))if(m=f.nodeName.toUpperCase(),o.push(m),r.isFormatElement(f)){s&&t.FORMAT&&(l.push("FORMAT"),r.changeTxt(t.FORMAT,m),t.FORMAT.setAttribute("data-focus",m),s=!1);const e=f.style.textAlign;a&&e&&t.ALIGN&&(l.push("ALIGN"),t.ALIGN.className="se-icon-align-"+e,t.ALIGN.setAttribute("data-focus",e),a=!1),p&&f.style.marginLeft&&r.getNumber(f.style.marginLeft,0)>0&&t.OUTDENT&&(l.push("OUTDENT"),t.OUTDENT.removeAttribute("disabled"),p=!1)}else{if(d&&r.isList(m)&&t.LI&&(l.push("LI"),t.LI.setAttribute("data-focus",m),/UL/i.test(m)?(r.removeClass(t.LI_ICON,"se-icon-list-number"),r.addClass(t.LI_ICON,"se-icon-list-bullets")):(r.removeClass(t.LI_ICON,"se-icon-list-bullets"),r.addClass(t.LI_ICON,"se-icon-list-number")),d=!1),u&&f.style.fontFamily.length>0&&t.FONT){l.push("FONT");const e=(f.style.fontFamily||f.face||n.toolbar.font).replace(/["']/g,"");r.changeTxt(t.FONT,e),r.changeTxt(t.FONT_TOOLTIP,e),u=!1}h&&f.style.fontSize.length>0&&t.SIZE&&(l.push("SIZE"),r.changeTxt(t.SIZE,f.style.fontSize),h=!1),g&&/^A$/.test(m)&&null===f.getAttribute("data-image-link")&&c.plugins.link?(e.link&&c.controllerArray[0]===e.link.linkBtn||c.callPlugin("link",(function(){c.plugins.link.call_controller_linkButton.call(c,f)})),g=!1):g&&e.link&&c.controllerArray[0]===e.link.linkBtn&&c.controllersOff(),i.test(m)&&l.push(m)}for(let e=0;e-1||(t.FONT&&/^FONT$/i.test(e)?(r.changeTxt(t.FONT,n.toolbar.font),r.changeTxt(t.FONT_TOOLTIP,n.toolbar.font)):t.SIZE&&/^SIZE$/i.test(e)?r.changeTxt(t.SIZE,n.toolbar.fontSize):t.ALIGN&&/^ALIGN$/i.test(e)?(t.ALIGN.className="se-icon-align-left",t.ALIGN.removeAttribute("data-focus")):t.OUTDENT&&/^OUTDENT$/i.test(e)?t.OUTDENT.setAttribute("disabled",!0):t.LI&&r.isListCell(e)?(t.LI.removeAttribute("data-focus"),r.removeClass(t.LI_ICON,"se-icon-list-bullets"),r.addClass(t.LI_ICON,"se-icon-list-number"),r.removeClass(t.LI,"active")):r.removeClass(t[e],"active"));c._variable.currentNodes=o.reverse(),e.option.showPathLabel&&(e.element.navigation.textContent=c._variable.currentNodes.join(" > "))},_cancelCaptionEdit:function(){this.setAttribute("contenteditable",!1),this.removeEventListener("blur",d._cancelCaptionEdit)},onMouseDown_toolbar:function(e){let t=e.target;if(r.getParentElement(t,".se-submenu"))e.stopPropagation(),c._notHideToolbar=!0;else{e.preventDefault();let i=t.getAttribute("data-command"),n=t.className;for(;!i&&!/se-menu-list/.test(n)&&!/se-toolbar/.test(n);)t=t.parentNode,i=t.getAttribute("data-command"),n=t.className;i===c._submenuName&&e.stopPropagation()}},onClick_toolbar:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,i=t.getAttribute("data-display"),n=t.getAttribute("data-command"),l=t.className;for(;!n&&!/se-menu-list/.test(l)&&!/se-toolbar/.test(l);)t=t.parentNode,n=t.getAttribute("data-command"),i=t.getAttribute("data-display"),l=t.className;if((n||i)&&!t.disabled){if(c.focus(),i)return!/submenu/.test(i)||null!==t.nextElementSibling&&t===c.submenuActiveButton?/dialog/.test(i)?void c.callPlugin(n,(function(){c.plugins.dialog.open.call(c,n,!1)})):void c.submenuOff():void c.callPlugin(n,(function(){c.submenuOn(t)}));n&&c.commandHandler(t,n)}},onMouseDown_wysiwyg:function(e){c._isBalloon&&d._hideToolbar();const t=r.getParentElement(e.target,r.isCell);if(!t)return;const i=c.plugins.table;t===i._fixedCell||i._shift||c.callPlugin("table",(function(){i.onTableCellMultiSelect.call(c,t,!1)}))},onClick_wysiwyg:function(t){const i=t.target;if("false"===e.element.wysiwyg.getAttribute("contenteditable"))return;if(t.stopPropagation(),/^FIGURE$/i.test(i.nodeName)){const e=i.querySelector("IMG"),n=i.querySelector("IFRAME");if(e)return t.preventDefault(),void c.selectComponent(e,"image");if(n)return t.preventDefault(),void c.selectComponent(n,"video")}const n=r.getParentElement(i,"FIGCAPTION");if(n&&(!n.getAttribute("contenteditable")||"false"===n.getAttribute("contenteditable"))&&(t.preventDefault(),n.setAttribute("contenteditable",!0),n.focus(),c._isInline&&!c._inlineToolbarAttr.isShow)){d._showToolbarInline();const e=function(){d._hideToolbar(),n.removeEventListener("blur",e)};n.addEventListener("blur",e)}c._editorRange();const l=c.getSelectionNode(),o=r.getFormatElement(l),s=r.getRangeFormatElement(l);if(c.getRange().collapsed&&(!o||o===s)&&"false"!==i.getAttribute("contenteditable")){if(r.isList(s)){const e=r.createElement("LI"),t=l.nextElementSibling;e.appendChild(l),s.insertBefore(e,t)}else c.execCommand("formatBlock",!1,r.isRangeFormatElement(s)?"DIV":"P");c.focus()}if(d._applyTagEffects(),c._isBalloon){const e=c.getRange();e.collapsed?d._hideToolbar():d._showToolbarBalloon(e)}g.onClick&&g.onClick(t)},_showToolbarBalloon:function(t){if(!c._isBalloon)return;const i=t||c.getRange(),n=e.element.toolbar,l=c.getSelection();let s;if(l.focusNode===l.anchorNode)s=l.focusOffsetn.offsetWidth?n.offsetWidth-u:b"),n.parentNode.insertBefore(o,n),c.callPlugin(p,(function(){const e=c.plugins.resizing.call_controller_resize.call(c,i._element,p);c.plugins[p].onModifyMode.call(c,i._element,e)}))}}if(n&&/16/.test(i)){t.preventDefault(),t.stopPropagation();const e=c.plugins.table;if(e&&!e._shift&&!e._ref){const t=r.getParentElement(m,r.isCell);if(t)return void e.onTableCellMultiSelect.call(c,t,!0)}}const _=!(l||o||h||d._nonTextKeyCode.test(i));if(!c._charCount(1,_)&&_)return t.preventDefault(),t.stopPropagation(),!1;g.onKeyDown&&g.onKeyDown(t)},onKeyUp_wysiwyg:function(e){if(d._onShortcutKey)return;c._editorRange();const t=e.keyCode,i=e.ctrlKey||e.metaKey||91===t||92===t,n=e.altKey;let l=c.getSelectionNode();if(c._isBalloon&&!c.getRange().collapsed)return void d._showToolbarBalloon();if(8===t&&r.isWysiwygDiv(l)&&""===l.textContent){e.preventDefault(),e.stopPropagation(),l.innerHTML="";const t=r.createElement(r.isFormatElement(c._variable.currentNodes[0])?c._variable.currentNodes[0]:"P");return t.innerHTML="
    ",l.appendChild(t),c.setRange(t,0,t,0),d._applyTagEffects(),c._checkComponents(),void c.history.push(!1)}const o=r.getFormatElement(l),s=r.getRangeFormatElement(l);o&&o!==s||(c.execCommand("formatBlock",!1,r.isRangeFormatElement(s)?"DIV":"P"),c.focus(),l=c.getSelectionNode()),d._directionKeyCode.test(t)&&d._applyTagEffects(),c._checkComponents();const a=!i&&!n&&!d._historyIgnoreKeyCode.test(t);if(a&&r.zeroWidthRegExp.test(l.textContent)){const e=c.getRange();let t=e.startOffset,i=e.endOffset;const n=(l.textContent.substring(0,i).match(d._frontZeroWidthReg)||"").length;t=e.startOffset-n,i=e.endOffset-n,l.textContent=l.textContent.replace(r.zeroWidthRegExp,""),c.setRange(l,t<0?0:t,l,i<0?0:i)}const u=!i&&!n&&!d._nonTextKeyCode.test(t);if(!c._charCount(1,u)&&1===e.key.length)return e.preventDefault(),e.stopPropagation(),!1;a&&c.history.push(!0),g.onKeyUp&&g.onKeyUp(e)},onScroll_wysiwyg:function(e){c.controllersOff(),c._isBalloon&&d._hideToolbar(),g.onScroll&&g.onScroll(e)},onMouseDown_resizingBar:function(t){t.stopPropagation(),c._variable.resizeClientY=t.clientY,e.element.resizeBackground.style.display="block",o.addEventListener("mousemove",d._resize_editor),o.addEventListener("mouseup",(function t(){e.element.resizeBackground.style.display="none",o.removeEventListener("mousemove",d._resize_editor),o.removeEventListener("mouseup",t)}))},_resize_editor:function(t){const i=e.element.editorArea.offsetHeight+(t.clientY-c._variable.resizeClientY);e.element.wysiwygFrame.style.height=e.element.code.style.height=(i=i+l?(c._sticky||d._onStickyToolbar(),t.toolbar.style.top=i+l+e.option.stickyToolbar-n-c._variable.minResizingSize+"px"):n>=l&&d._onStickyToolbar()},_getStickyOffsetTop:function(){let t=e.element.topArea,i=0;for(;t;)i+=t.offsetTop,t=t.offsetParent;return i},_onStickyToolbar:function(){const t=e.element;c._isInline||(t._stickyDummy.style.height=t.toolbar.offsetHeight+"px",t._stickyDummy.style.display="block"),t.toolbar.style.top=e.option.stickyToolbar+"px",t.toolbar.style.width=c._isInline?c._inlineToolbarAttr.width:t.toolbar.offsetWidth+"px",r.addClass(t.toolbar,"se-toolbar-sticky"),c._sticky=!0},_offStickyToolbar:function(){const t=e.element;t._stickyDummy.style.display="none",t.toolbar.style.top=c._isInline?c._inlineToolbarAttr.top:"",t.toolbar.style.width=c._isInline?c._inlineToolbarAttr.width:"",t.editorArea.style.marginTop="",r.removeClass(t.toolbar,"se-toolbar-sticky"),c._sticky=!1},_codeViewAutoHeight:function(){e.element.code.style.height=e.element.code.scrollHeight+"px"},onPaste_wysiwyg:function(e){const t=e.clipboardData;if(!t)return!0;const i=c._charCount(t.getData("text/plain").length,!0),n=r.cleanHTML(t.getData("text/html"));return("function"!=typeof g.onPaste||g.onPaste(e,n,i))&&i?void(n?(e.stopPropagation(),e.preventDefault(),c.execCommand("insertHTML",!1,n)):c.history.push(!0)):(e.preventDefault(),e.stopPropagation(),!1)},onCut_wysiwyg:function(){a.setTimeout((function(){c._resourcesStateChange(),c._charCount(0,!1),c.history.push(!1)}))},onDragOver_wysiwyg:function(e){e.preventDefault()},onDrop_wysiwyg:function(t){const i=t.dataTransfer;if(!i)return!0;const n=i.files;if(n.length>0&&c.plugins.image)d._setDropLocationSelection(t),c.callPlugin("image",(function(){e.image.imgInputFile.files=n,c.plugins.image.onRender_imgInput.call(c),e.image.imgInputFile.files=null}));else{if(!c._charCount(i.getData("text/plain").length,!0))return t.preventDefault(),t.stopPropagation(),!1;{const e=r.cleanHTML(i.getData("text/html"));e&&(d._setDropLocationSelection(t),c.execCommand("insertHTML",!1,e))}}g.onDrop&&g.onDrop(t)},_setDropLocationSelection:function(e){e.stopPropagation(),e.preventDefault();const t=c.getRange();c.setRange(t.startContainer,t.startOffset,t.endContainer,t.endOffset)},_onChange_historyStack:function(){e.tool.save&&e.tool.save.removeAttribute("disabled"),g.onChange&&g.onChange(c.getContents(!0))},_addEvent:function(){const t=l.iframe?c._ww:e.element.wysiwyg;e.element.toolbar.addEventListener("mousedown",d.onMouseDown_toolbar,!1),e.element.toolbar.addEventListener("click",d.onClick_toolbar,!1),t.addEventListener("click",d.onClick_wysiwyg,!1),t.addEventListener("keydown",d.onKeyDown_wysiwyg,!1),t.addEventListener("keyup",d.onKeyUp_wysiwyg,!1),t.addEventListener("paste",d.onPaste_wysiwyg,!1),t.addEventListener("cut",d.onCut_wysiwyg,!1),t.addEventListener("dragover",d.onDragOver_wysiwyg,!1),t.addEventListener("drop",d.onDrop_wysiwyg,!1),t.addEventListener("scroll",d.onScroll_wysiwyg,!1),(c._isBalloon||c.plugins.table)&&t.addEventListener("mousedown",d.onMouseDown_wysiwyg,!1),c.plugins.table&&t.addEventListener("touchstart",d.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),"auto"!==e.option.height||e.option.codeMirrorEditor||(e.element.code.addEventListener("keydown",d._codeViewAutoHeight,!1),e.element.code.addEventListener("keyup",d._codeViewAutoHeight,!1),e.element.code.addEventListener("paste",d._codeViewAutoHeight,!1)),e.element.resizingBar&&(/\d+/.test(e.option.height)?e.element.resizingBar.addEventListener("mousedown",d.onMouseDown_resizingBar,!1):r.addClass(e.element.resizingBar,"se-resizing-none")),c._isInline&&t.addEventListener("focus",d._showToolbarInline,!1),(c._isInline||c._isBalloon)&&t.addEventListener("blur",d._hideToolbar,!1),a.removeEventListener("resize",d.onResize_window),a.removeEventListener("scroll",d.onScroll_window),a.addEventListener("resize",d.onResize_window,!1),e.option.stickyToolbar>-1&&a.addEventListener("scroll",d.onScroll_window,!1)},_removeEvent:function(){const t=l.iframe?c._ww:e.element.wysiwyg;e.element.toolbar.removeEventListener("mousedown",d.onMouseDown_toolbar),e.element.toolbar.removeEventListener("click",d.onClick_toolbar),t.removeEventListener("click",d.onClick_wysiwyg),t.removeEventListener("keydown",d.onKeyDown_wysiwyg),t.removeEventListener("keyup",d.onKeyUp_wysiwyg),t.removeEventListener("paste",d.onPaste_wysiwyg),t.removeEventListener("cut",d.onCut_wysiwyg),t.removeEventListener("dragover",d.onDragOver_wysiwyg),t.removeEventListener("drop",d.onDrop_wysiwyg),t.removeEventListener("scroll",d.onScroll_wysiwyg),t.removeEventListener("mousedown",d.onMouseDown_wysiwyg),t.removeEventListener("touchstart",d.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),t.removeEventListener("focus",d._showToolbarInline),t.removeEventListener("blur",d._hideToolbar),e.element.code.removeEventListener("keydown",d._codeViewAutoHeight),e.element.code.removeEventListener("keyup",d._codeViewAutoHeight),e.element.code.removeEventListener("paste",d._codeViewAutoHeight),e.element.resizingBar&&e.element.resizingBar.removeEventListener("mousedown",d.onMouseDown_resizingBar),a.removeEventListener("resize",d.onResize_window),a.removeEventListener("scroll",d.onScroll_window)}},g={core:c,util:r,onload:null,onScroll:null,onClick:null,onKeyDown:null,onKeyUp:null,onDrop:null,onChange:null,onPaste:null,showInline:null,onImageUpload:null,onImageUploadError:null,setOptions:function(o){d._removeEvent(),c.plugins=o.plugins||c.plugins;const s=[e.option,o].reduce((function(e,t){return Object.keys(t).forEach((function(i){e[i]=t[i]})),e}),{}),a=h._setOptions(s,e,c.plugins,e.option);a.callButtons&&(t=a.callButtons,c.initPlugins={}),a.plugins&&(c.plugins=i=a.plugins);const r=e.element,u={_top:r.topArea,_relative:r.relative,_toolBar:r.toolbar,_editorArea:r.editorArea,_wysiwygArea:r.wysiwygFrame,_codeArea:r.code,_placeholder:r.placeholder,_resizingBar:r.resizingBar,_navigation:r.navigation,_charCounter:r.charCounter,_loading:r.loading,_resizeBack:r.resizeBackground,_stickyDummy:r._stickyDummy,_arrow:r._arrow};l=s,c.lang=n=l.lang,c.context=e=p(e.element.originElement,u,l),c._imagesInfoReset=!0,c._init(!0),d._addEvent(),c._charCount(0,!1),d._offStickyToolbar(),d.onResize_window(),c.focus()},noticeOpen:function(e){c.addModule([s]),s.open.call(c,e)},noticeClose:function(){c.addModule([s]),s.close.call(c)},save:function(){e.element.originElement.value=c.getContents(!1)},getContext:function(){return e},getContents:function(e){return c.getContents(e)},getImagesInfo:function(){return c._variable._imagesInfo},insertImage:function(e){c.plugins.image&&e&&(c.initPlugins.image?c.plugins.image.submitAction.call(c,e):c.callPlugin("image",c.plugins.image.submitAction.bind(c,e)),c.focus())},insertHTML:function(e){if(!e.nodeType||1!==e.nodeType){const t=r.createElement("DIV");t.innerHTML=e,e=t.firstChild||t.content.firstChild}let t=null;(r.isFormatElement(e)||/^(IMG|IFRAME)$/i.test(e.nodeName))&&(t=r.getFormatElement(c.getSelectionNode())),r.isComponent(e)?c.insertComponent(e,!1):c.insertNode(e,t),c.focus()},setContents:function(e){c.setContents(e)},appendContents:function(t){const i=r.convertContentsForEditor(t);c._variable.isCodeView?c._setCodeView(c._getCodeView()+"\n"+r.convertHTMLForCodeView(i,c._variable.codeIndent)):e.element.wysiwyg.innerHTML+=i,c.history.push(!1)},disabled:function(){e.tool.cover.style.display="block",e.element.wysiwyg.setAttribute("contenteditable",!1),e.option.codeMirrorEditor?e.option.codeMirrorEditor.setOption("readOnly",!0):e.element.code.setAttribute("disabled","disabled")},enabled:function(){e.tool.cover.style.display="none",e.element.wysiwyg.setAttribute("contenteditable",!0),e.option.codeMirrorEditor?e.option.codeMirrorEditor.setOption("readOnly",!1):e.element.code.removeAttribute("disabled")},show:function(){const t=e.element.topArea.style;"none"===t.display&&(t.display=e.option.display)},hide:function(){e.element.topArea.style.display="none"},destroy:function(){d._removeEvent(),r.removeItem(e.element.topArea),a.Object.keys(c).forEach((function(e){delete c[e]})),a.Object.keys(d).forEach((function(e){delete d[e]})),a.Object.keys(e).forEach((function(t){delete e[t]})),a.Object.keys(t).forEach((function(e){delete t[e]})),a.Object.keys(this).forEach(function(e){delete this[e]}.bind(this))},toolbar:{disabled:function(){e.tool.cover.style.display="block"},enabled:function(){e.tool.cover.style.display="none"},show:function(){c._isInline?d._showToolbarInline():(e.element.toolbar.style.display="",e.element._stickyDummy.style.display="")},hide:function(){c._isInline?d._hideToolbar():(e.element.toolbar.style.display="none",e.element._stickyDummy.style.display="none")}}};return c._init(!1),d._addEvent(),c._charCount(0,!1),g},m={init:function(e){return{create:function(t,i){return this.create(t,i,e)}.bind(this)}},create:function(e,t,i){"object"!=typeof t&&(t={}),i&&(t=[i,t].reduce((function(e,t){return Object.keys(t).forEach((function(i){if("plugins"===i&&t[i]&&e[i]){let n=e[i],l=t[i];n=n.length?n:Object.keys(n).map((function(e){return n[e]})),l=l.length?l:Object.keys(l).map((function(e){return l[e]})),e[i]=l.filter((function(e){return-1===n.indexOf(e)})).concat(n)}else e[i]=t[i]})),e}),{}));const n="string"==typeof e?document.getElementById(e):e;if(!n){if("string"==typeof e)throw Error('[SUNEDITOR.create.fail] The element for that id was not found (ID:"'+e+'")');throw Error("[SUNEDITOR.create.fail] suneditor requires textarea's element or id value")}const l=h.init(n,t);if(l.constructed._top.id&&document.getElementById(l.constructed._top.id))throw Error('[SUNEDITOR.create.fail] The ID of the suneditor you are trying to create already exists (ID:"'+l.constructed._top.id+'")');return n.style.display="none",l.constructed._top.style.display="block","object"==typeof n.nextElementSibling?n.parentNode.insertBefore(l.constructed._top,n.nextElementSibling):n.parentNode.appendChild(l.constructed._top),g(p(n,l.constructed,l.options),l.pluginCallButtons,l.plugins,l.options.lang,t)}};window.SUNEDITOR=m.init({plugins:a})}}); \ No newline at end of file +!function(e){var t={};function i(n){if(t[n])return t[n].exports;var l=t[n]={i:n,l:!1,exports:{}};return e[n].call(l.exports,l,l.exports,i),l.l=!0,l.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"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&t&&"string"!=typeof e)for(var l in e)i.d(n,l,function(t){return e[t]}.bind(null,l));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="XJR1")}({"3FqI":function(e,t,i){},P6u4:function(e,t,i){"use strict";var n,l;n="undefined"!=typeof window?window:this,l=function(e,t){const i={toolbar:{default:"Default",save:"Save",font:"Font",formats:"Formats",fontSize:"Size",bold:"Bold",underline:"Underline",italic:"Italic",strike:"Strike",subscript:"Subscript",superscript:"Superscript",removeFormat:"Remove Format",fontColor:"Font Color",hiliteColor:"Highlight Color",indent:"Indent",outdent:"Outdent",align:"Align",alignLeft:"Align left",alignRight:"Align right",alignCenter:"Align center",alignJustify:"Align justify",list:"List",orderList:"Ordered list",unorderList:"Unordered list",horizontalRule:"Horizontal line",hr_solid:"Solid",hr_dotted:"Dotted",hr_dashed:"Dashed",table:"Table",link:"Link",math:"Math",image:"Image",video:"Video",fullScreen:"Full screen",showBlocks:"Show blocks",codeView:"Code view",undo:"Undo",redo:"Redo",preview:"Preview",print:"print",tag_p:"Paragraph",tag_div:"Normal (DIV)",tag_h:"Header",tag_blockquote:"Quote",tag_pre:"Code",template:"Template",lineHeight:"Line height",paragraphStyle:"Paragraph style",textStyle:"Text style"},dialogBox:{linkBox:{title:"Insert Link",url:"URL to link",text:"Text to display",newWindowCheck:"Open in new window"},mathBox:{title:"Math",inputLabel:"Mathematical Notation",fontSizeLabel:"Font Size",previewLabel:"Preview"},imageBox:{title:"Insert image",file:"Select from files",url:"Image URL",altText:"Alternative text"},videoBox:{title:"Insert Video",url:"Media embed URL, YouTube"},caption:"Insert description",close:"Close",submitButton:"Submit",revertButton:"Revert",proportion:"Constrain proportions",basic:"Basic",left:"Left",right:"Right",center:"Center",width:"Width",height:"Height",size:"Size",ratio:"Ratio"},controller:{edit:"Edit",unlink:"Unlink",remove:"Remove",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:"Delete row",insertColumnBefore:"Insert column before",insertColumnAfter:"Insert column after",deleteColumn:"Delete column",resize100:"Resize 100%",resize75:"Resize 75%",resize50:"Resize 50%",resize25:"Resize 25%",autoSize:"Auto size",mirrorHorizontal:"Mirror, Horizontal",mirrorVertical:"Mirror, Vertical",rotateLeft:"Rotate left",rotateRight:"Rotate right",maxSize:"Max size",minSize:"Min size",tableHeader:"Table header",mergeCells:"Merge cells",splitCells:"Split Cells",HorizontalSplit:"Horizontal split",VerticalSplit:"Vertical split"},menu:{spaced:"Spaced",bordered:"Bordered",neon:"Neon",translucent:"Translucent",shadow:"Shadow"}};return void 0===t&&(e.SUNEDITOR_LANG||(e.SUNEDITOR_LANG={}),e.SUNEDITOR_LANG.en=i),i},"object"==typeof e.exports?e.exports=n.document?l(n,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return l(e)}:l(n)},WUQj:function(e,t,i){},XJR1:function(e,t,i){"use strict";i.r(t);i("3FqI"),i("WUQj");var n={name:"colorPicker",add:function(e){const t=e.context;t.colorPicker={colorListHTML:"",_colorInput:"",_defaultColor:"#000",_styleProperty:"color",_currentColor:"",_colorList:[]};let i=this.createColorList(e.context.option,e.lang,this._makeColorList);t.colorPicker.colorListHTML=i,i=null},createColorList:function(e,t,i){const n=e.colorList&&0!==e.colorList.length?e.colorList:["#ff0000","#ff5e00","#ffe400","#abf200","#00d8ff","#0055ff","#6600ff","#ff00dd","#000000","#ffd8d8","#fae0d4","#faf4c0","#e4f7ba","#d4f4fa","#d9e5ff","#e8d9ff","#ffd9fa","#f1f1f1","#ffa7a7","#ffc19e","#faed7d","#cef279","#b2ebf4","#b2ccff","#d1b2ff","#ffb2f5","#bdbdbd","#f15f5f","#f29661","#e5d85c","#bce55c","#5cd1e5","#6699ff","#a366ff","#f261df","#8c8c8c","#980000","#993800","#998a00","#6b9900","#008299","#003399","#3d0099","#990085","#353535","#670000","#662500","#665c00","#476600","#005766","#002266","#290066","#660058","#222222"];let l=[],s='
    ';for(let e,t=0,o=n.length;t0&&(s+='
    '+i(l)+"
    ",l=[]),"object"==typeof e&&(s+='
    '+i(e)+"
    ")));return s+='
    ",s},_makeColorList:function(e){let t="";t+='
      ';for(let i,n=0,l=e.length;n');return t+="
    ",t},init:function(e,t){const i=this.plugins.colorPicker;let n=t||(i.getColorInNode.call(this,e)||this.context.colorPicker._defaultColor);n=i.isHexColor(n)?n:i.rgb2hex(n)||n;const l=this.context.colorPicker._colorList;if(l)for(let e=0,t=l.length;e=3&&"#"+((1<<24)+(i[0]<<16)+(i[1]<<8)+i[2]).toString(16).substr(1)}},l={name:"dialog",add:function(e){const t=e.context;t.dialog={kind:"",updateModal:!1,_closeSignal:!1};let i=e.util.createElement("DIV");i.className="se-dialog sun-editor-common";let n=e.util.createElement("DIV");n.className="se-dialog-back",n.style.display="none";let l=e.util.createElement("DIV");l.className="se-dialog-inner",l.style.display="none",i.appendChild(n),i.appendChild(l),t.dialog.modalArea=i,t.dialog.back=n,t.dialog.modal=l,t.dialog.modal.addEventListener("mousedown",this.onMouseDown_dialog.bind(e)),t.dialog.modal.addEventListener("click",this.onClick_dialog.bind(e)),t.element.relative.appendChild(i),i=null,n=null,l=null},onMouseDown_dialog:function(e){/se-dialog-inner/.test(e.target.className)?this.context.dialog._closeSignal=!0:this.context.dialog._closeSignal=!1},onClick_dialog:function(e){e.stopPropagation(),(/close/.test(e.target.getAttribute("data-command"))||this.context.dialog._closeSignal)&&this.plugins.dialog.close.call(this)},open:function(e,t){if(this.modalForm)return!1;this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null),this.plugins.dialog._bindClose=function(e){/27/.test(e.keyCode)&&this.plugins.dialog.close.call(this)}.bind(this),this._d.addEventListener("keydown",this.plugins.dialog._bindClose),this.context.dialog.updateModal=t,"full"===this.context.option.popupDisplay?this.context.dialog.modalArea.style.position="fixed":this.context.dialog.modalArea.style.position="absolute",this.context.dialog.kind=e,this.modalForm=this.context[e].modal;const i=this.context[e].focusElement;"function"==typeof this.plugins[e].on&&this.plugins[e].on.call(this,t),this.context.dialog.modalArea.style.display="block",this.context.dialog.back.style.display="block",this.context.dialog.modal.style.display="block",this.modalForm.style.display="block",i&&i.focus()},_bindClose:null,close:function(){this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null);const e=this.context.dialog.kind;this.modalForm.style.display="none",this.context.dialog.back.style.display="none",this.context.dialog.modalArea.style.display="none",this.context.dialog.updateModal=!1,this.plugins[e].init.call(this),this.context.dialog.kind="",this.modalForm=null,this.focus()}},s={name:"resizing",add:function(e){const t=e.context;t.resizing={_resizeClientX:0,_resizeClientY:0,_resize_plugin:"",_resize_w:0,_resize_h:0,_origin_w:0,_origin_h:0,_rotateVertical:!1,_resize_direction:"",_move_path:null,_isChange:!1};let i=this.setController_resize.call(e);t.resizing.resizeContainer=i,t.resizing.resizeDiv=i.querySelector(".se-modal-resize"),t.resizing.resizeDot=i.querySelector(".se-resize-dot"),t.resizing.resizeDisplay=i.querySelector(".se-resize-display");let n=this.setController_button.call(e);t.resizing.resizeButton=n,n.addEventListener("mousedown",(function(e){e.stopPropagation()}),!1);let l=t.resizing.resizeHandles=t.resizing.resizeDot.querySelectorAll("span");t.resizing.resizeButtonGroup=n.querySelector("._se_resizing_btn_group"),t.resizing.rotationButtons=n.querySelectorAll("._se_resizing_btn_group ._se_rotation"),t.resizing.percentageButtons=n.querySelectorAll("._se_resizing_btn_group ._se_percentage"),t.resizing.alignMenu=n.querySelector(".se-resizing-align-list"),t.resizing.alignMenuList=t.resizing.alignMenu.querySelectorAll("button"),t.resizing.alignButton=n.querySelector("._se_resizing_align_button"),t.resizing.alignButtonIcon=t.resizing.alignButton.querySelector("i"),t.resizing.autoSizeButton=n.querySelector("._se_resizing_btn_group ._se_auto_size"),t.resizing.captionButton=n.querySelector("._se_resizing_caption_button"),l[0].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[1].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[2].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[3].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[4].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[5].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[6].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[7].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),n.addEventListener("click",this.onClick_resizeButton.bind(e)),t.element.relative.appendChild(i),t.element.relative.appendChild(n),i=null,n=null,l=null},setController_resize:function(){const e=this.util.createElement("DIV");return e.className="se-resizing-container",e.style.display="none",e.innerHTML='
    ',e},setController_button:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-resizing",t.innerHTML='
    ",t},_module_getSizeX:function(e,t,i,n){return t||(t=e._element),i||(i=e._cover),n||(n=e._container),n&&i&&t?/%$/.test(t.style.width)?(this.util.getNumber(n.style.width,2)||100)+"%":t.style.width:""},_module_getSizeY:function(e,t,i,n){return t||(t=e._element),i||(i=e._cover),n||(n=e._container),n&&i&&t?this.util.getNumber(i.style.paddingBottom)>0&&!this.context.resizing._rotateVertical?i.style.height:/%$/.test(t.style.height)&&/%$/.test(t.style.width)?(this.util.getNumber(n.style.height,2)||100)+"%":t.style.height:""},_module_setModifyInputSize:function(e,t){const i=e._onlyPercentage&&this.context.resizing._rotateVertical;e.proportion.checked=e._proportionChecked="false"!==e._element.getAttribute("data-proportion");let n=i?"":this.plugins.resizing._module_getSizeX.call(this,e);if(n===e._defaultSizeX&&(n=""),e._onlyPercentage&&(n=this.util.getNumber(n,2)),e.inputX.value=n,t.setInputSize.call(this,"x"),!e._onlyPercentage){let t=i?"":this.plugins.resizing._module_getSizeY.call(this,e);t===e._defaultSizeY&&(t=""),e._onlyPercentage&&(t=this.util.getNumber(t,2)),e.inputY.value=t}e.inputX.disabled=!!i,e.inputY.disabled=!!i,e.proportion.disabled=!!i,t.setRatio.call(this)},_module_setInputSize:function(e,t){if(e._onlyPercentage)"x"===t&&e.inputX.value>100&&(e.inputX.value=100);else if(e.proportion.checked&&e._ratio&&/\d/.test(e.inputX.value)&&/\d/.test(e.inputY.value)){const i=e.inputX.value.replace(/\d+|\./g,"")||e.sizeUnit,n=e.inputY.value.replace(/\d+|\./g,"")||e.sizeUnit;if(i!==n)return;const l="%"===i?2:0;"x"===t?e.inputY.value=this.util.getNumber(e._ratioY*this.util.getNumber(e.inputX.value,l),l)+n:e.inputX.value=this.util.getNumber(e._ratioX*this.util.getNumber(e.inputY.value,l),l)+i}},_module_setRatio:function(e){const t=e.inputX.value,i=e.inputY.value;if(e.proportion.checked&&/\d+/.test(t)&&/\d+/.test(i)){if((t.replace(/\d+|\./g,"")||e.sizeUnit)!==(i.replace(/\d+|\./g,"")||e.sizeUnit))e._ratio=!1;else if(!e._ratio){const n=this.util.getNumber(t),l=this.util.getNumber(i);e._ratio=!0,e._ratioX=n/l,e._ratioY=l/n}}else e._ratio=!1},_module_sizeRevert:function(e){e._onlyPercentage?e.inputX.value=e._origin_w>100?100:e._origin_w:(e.inputX.value=e._origin_w,e.inputY.value=e._origin_h)},_module_saveCurrentSize:function(e){const t=this.plugins.resizing._module_getSizeX.call(this,e),i=this.plugins.resizing._module_getSizeY.call(this,e);e._element.setAttribute("data-size",t+","+i),e._videoRatio&&(e._videoRatio=i)},call_controller_resize:function(e,t){const i=this.context.resizing,n=this.context[t];i._resize_plugin=t;const l=i.resizeContainer,s=i.resizeDiv,o=this.util.getOffset(e,this.context.element.wysiwygFrame),a=i._rotateVertical=/^(90|270)$/.test(Math.abs(e.getAttribute("data-rotate")).toString()),r=a?e.offsetHeight:e.offsetWidth,c=a?e.offsetWidth:e.offsetHeight,d=o.top,u=o.left-this.context.element.wysiwygFrame.scrollLeft;l.style.top=d+"px",l.style.left=u+"px",l.style.width=r+"px",l.style.height=c+"px",s.style.top="0px",s.style.left="0px",s.style.width=r+"px",s.style.height=c+"px";let h=e.getAttribute("data-align")||"basic";h="none"===h?"basic":h;const p=this.util.getParentElement(e,this.util.isComponent),g=this.util.getParentElement(e,"FIGURE"),m=this.plugins.resizing._module_getSizeX.call(this,n,e,g,p)||"auto",f=n._onlyPercentage&&"image"===t?"":", "+(this.plugins.resizing._module_getSizeY.call(this,n,e,g,p)||"auto");this.util.changeTxt(i.resizeDisplay,this.lang.dialogBox[h]+" ("+m+f+")"),i.resizeButtonGroup.style.display=n._resizing?"":"none";const _=!n._resizing||n._resizeDotHide||n._onlyPercentage?"none":"flex",b=i.resizeHandles;for(let e=0,t=b.length;e",e},set_cover:function(e){const t=this.util.createElement("FIGURE");return t.appendChild(e),t},set_container:function(e,t){const i=this.util.createElement("DIV");return i.className="se-component "+t,i.setAttribute("contenteditable",!1),i.appendChild(e),i},onClick_resizeButton:function(e){e.stopPropagation();const t=e.target,i=t.getAttribute("data-command")||t.parentNode.getAttribute("data-command");if(!i)return;const n=t.getAttribute("data-value")||t.parentNode.getAttribute("data-value"),l=this.context.resizing._resize_plugin,s=this.context[l],o=s._element,a=this.plugins[l];if(e.preventDefault(),"function"!=typeof this.plugins.resizing._closeAlignMenu||(this.plugins.resizing._closeAlignMenu(),"onalign"!==i)){switch(i){case"auto":a.setAutoSize.call(this),a.onModifyMode.call(this,o,this.plugins.resizing.call_controller_resize.call(this,o,l));break;case"percent":let e=this.plugins.resizing._module_getSizeY.call(this,s);if(this.context.resizing._rotateVertical){const t=o.getAttribute("data-percentage");t&&(e=t.split(",")[1])}this.plugins.resizing.resetTransform.call(this,o),a.setPercentSize.call(this,100*n,e),a.onModifyMode.call(this,o,this.plugins.resizing.call_controller_resize.call(this,o,l));break;case"mirror":const t=o.getAttribute("data-rotate")||"0";let i=o.getAttribute("data-rotateX")||"",r=o.getAttribute("data-rotateY")||"";"h"===n&&!this.context.resizing._rotateVertical||"v"===n&&this.context.resizing._rotateVertical?r=r?"":"180":i=i?"":"180",o.setAttribute("data-rotateX",i),o.setAttribute("data-rotateY",r),this.plugins.resizing._setTransForm(o,t,i,r);break;case"rotate":const c=this.context.resizing,d=1*o.getAttribute("data-rotate")+1*n,u=this._w.Math.abs(d)>=360?0:d;o.setAttribute("data-rotate",u),c._rotateVertical=/^(90|270)$/.test(this._w.Math.abs(u).toString()),this.plugins.resizing.setTransformSize.call(this,o,null,null),a.onModifyMode.call(this,o,this.plugins.resizing.call_controller_resize.call(this,o,l));break;case"onalign":this.plugins.resizing.openAlignMenu.call(this);break;case"align":const h="basic"===n?"none":n;a.setAlign.call(this,h,null,null,null),a.onModifyMode.call(this,o,this.plugins.resizing.call_controller_resize.call(this,o,l));break;case"caption":const p=!s._captionChecked;if(a.openModify.call(this,!0),s._captionChecked=s.captionCheckEl.checked=p,"image"===l?a.update_image.call(this,!1,!1,!1):"video"===l&&(this.context.dialog.updateModal=!0,a.submitAction.call(this)),p){const e=this.util.getChildElement(s._caption,(function(e){return 3===e.nodeType}));e?this.setRange(e,0,e,e.textContent.length):s._caption.focus(),this.controllersOff()}else a.onModifyMode.call(this,o,this.plugins.resizing.call_controller_resize.call(this,o,l)),a.openModify.call(this,!0);break;case"revert":a.setOriginSize.call(this),a.onModifyMode.call(this,o,this.plugins.resizing.call_controller_resize.call(this,o,l));break;case"update":a.openModify.call(this),this.controllersOff();break;case"delete":a.destroy.call(this)}this.history.push(!1)}},resetTransform:function(e){const t=(e.getAttribute("data-size")||e.getAttribute("data-origin")||"").split(",");this.context.resizing._rotateVertical=!1,e.style.maxWidth="",e.style.transform="",e.style.transformOrigin="",e.setAttribute("data-rotate",""),e.setAttribute("data-rotateX",""),e.setAttribute("data-rotateY",""),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,t[0]?t[0]:"auto",t[1]?t[1]:"",!0)},setTransformSize:function(e,t,i){let n=e.getAttribute("data-percentage");const l=this.context.resizing._rotateVertical,s=1*e.getAttribute("data-rotate");let o="";if(n&&!l)n=n.split(","),"auto"===n[0]&&"auto"===n[1]?this.plugins[this.context.resizing._resize_plugin].setAutoSize.call(this):this.plugins[this.context.resizing._resize_plugin].setPercentSize.call(this,n[0],n[1]);else{const n=this.util.getParentElement(e,"FIGURE"),a=t||e.offsetWidth,r=i||e.offsetHeight,c=(l?r:a)+"px",d=(l?a:r)+"px";if(this.plugins[this.context.resizing._resize_plugin].cancelPercentAttr.call(this),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,a+"px",r+"px",!0),n.style.width=c,n.style.height=this.context[this.context.resizing._resize_plugin]._caption?"":d,l){let e=a/2+"px "+a/2+"px 0",t=r/2+"px "+r/2+"px 0";o=90===s||-270===s?t:e}}e.style.transformOrigin=o,this.plugins.resizing._setTransForm(e,s.toString(),e.getAttribute("data-rotateX")||"",e.getAttribute("data-rotateY")||""),e.style.maxWidth=l?"none":"",this.plugins.resizing.setCaptionPosition.call(this,e)},_setTransForm:function(e,t,i,n){let l=(e.offsetWidth-e.offsetHeight)*(/-/.test(t)?1:-1),s="";if(/[1-9]/.test(t)&&(i||n))switch(s=i?"Y":"X",t){case"90":s=i&&n?"X":n?s:"";break;case"270":l*=-1,s=i&&n?"Y":i?s:"";break;case"-90":s=i&&n?"Y":i?s:"";break;case"-270":l*=-1,s=i&&n?"X":n?s:"";break;default:s=""}t%180==0&&(e.style.maxWidth=""),e.style.transform="rotate("+t+"deg)"+(i?" rotateX("+i+"deg)":"")+(n?" rotateY("+n+"deg)":"")+(s?" translate"+s+"("+l+"px)":"")},setCaptionPosition:function(e){const t=this.util.getChildElement(this.util.getParentElement(e,"FIGURE"),"FIGCAPTION");t&&(t.style.marginTop=(this.context.resizing._rotateVertical?e.offsetWidth-e.offsetHeight:0)+"px")},onMouseDown_resize_handle:function(e){const t=this.context.resizing,i=t._resize_direction=e.target.classList[0];e.stopPropagation(),e.preventDefault();const n=this.context.resizing._resize_plugin,l=this.context[n]._element,s=this.plugins[n];t._resizeClientX=e.clientX,t._resizeClientY=e.clientY,this.context.element.resizeBackground.style.display="block",t.resizeButton.style.display="none",t.resizeDiv.style.float=/l/.test(i)?"right":/r/.test(i)?"left":"none";const o=function(e){if("keydown"===e.type&&27!==e.keyCode)return;const i=t._isChange;t._isChange=!1,this.removeDocEvent("mousemove",a),this.removeDocEvent("mouseup",o),this.removeDocEvent("keydown",o),"keydown"===e.type?(this.controllersOff(),this.context.element.resizeBackground.style.display="none",this.plugins[this.context.resizing._resize_plugin].init.call(this)):(this.plugins.resizing.cancel_controller_resize.call(this),i&&this.history.push(!1)),s.onModifyMode.call(this,l,this.plugins.resizing.call_controller_resize.call(this,l,t._resize_plugin))}.bind(this),a=this.plugins.resizing.resizing_element.bind(this,t,i,this.context[t._resize_plugin]);this.addDocEvent("mousemove",a),this.addDocEvent("mouseup",o),this.addDocEvent("keydown",o)},resizing_element:function(e,t,i,n){const l=n.clientX,s=n.clientY;let o=i._element_w,a=i._element_h;const r=i._element_w+(/r/.test(t)?l-e._resizeClientX:e._resizeClientX-l),c=i._element_h+(/b/.test(t)?s-e._resizeClientY:e._resizeClientY-s),d=i._element_h/i._element_w*r;/t/.test(t)&&(e.resizeDiv.style.top=i._element_h-(/h/.test(t)?c:d)+"px"),/l/.test(t)&&(e.resizeDiv.style.left=i._element_w-r+"px"),/r|l/.test(t)&&(e.resizeDiv.style.width=r+"px",o=r),/^(t|b)[^h]$/.test(t)?(e.resizeDiv.style.height=d+"px",a=d):/^(t|b)h$/.test(t)&&(e.resizeDiv.style.height=c+"px",a=c),e._resize_w=o,e._resize_h=a,this.util.changeTxt(e.resizeDisplay,this._w.Math.round(o)+" x "+this._w.Math.round(a)),e._isChange=!0},cancel_controller_resize:function(){const e=this.context.resizing._rotateVertical;this.controllersOff(),this.context.element.resizeBackground.style.display="none";let t=this._w.Math.round(e?this.context.resizing._resize_h:this.context.resizing._resize_w),i=this._w.Math.round(e?this.context.resizing._resize_w:this.context.resizing._resize_h);if(!e&&!/%$/.test(t)){const e=16,n=this.context.element.wysiwygFrame.clientWidth-2*e-2;this.util.getNumber(t)>n&&(i=this._w.Math.round(i/t*n),t=n)}this.plugins[this.context.resizing._resize_plugin].setSize.call(this,t,i,!1),this.plugins[this.context.resizing._resize_plugin].init.call(this)}},o={name:"notice",add:function(e){const t=e.context;t.notice={};let i=e.util.createElement("DIV"),n=e.util.createElement("SPAN"),l=e.util.createElement("BUTTON");i.className="se-notice",l.className="close",l.setAttribute("aria-label","Close"),l.setAttribute("title",e.lang.dialogBox.close),l.innerHTML='',i.appendChild(n),i.appendChild(l),t.notice.modal=i,t.notice.message=n,l.addEventListener("click",this.onClick_cancel.bind(e)),t.element.relative.insertBefore(i,t.element.editorArea),i=null},onClick_cancel:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.notice.close.call(this)},open:function(e){this.context.notice.message.textContent=e,this.context.notice.modal.style.display="block"},close:function(){this.context.notice.modal.style.display="none"}},a={blockquote:{name:"blockquote",display:"command",add:function(e,t){e.context.blockquote={targetButton:t,tag:e.util.createElement("BLOCKQUOTE")}},active:function(e){if(e){if(/blockquote/i.test(e.nodeName))return this.util.addClass(this.context.blockquote.targetButton,"active"),!0}else this.util.removeClass(this.context.blockquote.targetButton,"active");return!1},action:function(){const e=this.util.getParentElement(this.getSelectionNode(),"blockquote");e?this.detachRangeFormatElement(e,null,null,!1,!1):this.applyRangeFormatElement(this.context.blockquote.tag.cloneNode(!1))}},align:{name:"align",display:"submenu",add:function(e,t){const i=e.context;i.align={targetIcon:t.querySelector("i"),_alignList:null,currentAlign:""};let n=this.setSubmenu.call(e),l=n.querySelector("ul");l.addEventListener("click",this.pickup.bind(e)),i.align._alignList=l.querySelectorAll("li button"),t.parentNode.appendChild(n),n=null,l=null},setSubmenu:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-list-layer",t.innerHTML='
    ",t},active:function(e){const t=this.context.align.targetIcon;if(e){if(this.util.isFormatElement(e)){const i=e.style.textAlign;return i&&(t.className="se-icon-align-"+i,t.setAttribute("data-focus",i)),!0}}else t.className="se-icon-align-left",t.removeAttribute("data-focus");return!1},on:function(){const e=this.context.align,t=e._alignList,i=e.targetIcon.getAttribute("data-focus")||"left";if(i!==e.currentAlign){for(let e=0,n=t.length;e('+t.toolbar.default+")";for(s=0,o=a.length;s";return r+="",i.innerHTML=r,i},active:function(e){const t=this.context.font.targetText,i=this.context.font.targetTooltip;if(e){if(e.style&&e.style.fontFamily.length>0){const n=e.style.fontFamily.replace(/["']/g,"");return this.util.changeTxt(t,n),this.util.changeTxt(i,n),!0}}else{const e=this.lang.toolbar.font;this.util.changeTxt(t,e),this.util.changeTxt(i,e)}return!1},on:function(){const e=this.context.font,t=e._fontList,i=e.targetText.textContent;if(i!==e.currentFont){for(let e=0,n=t.length;e('+t.toolbar.default+")";for(let t,i=0,s=e.fontSizeUnit,o=n.length;i";return l+="",i.innerHTML=l,i},active:function(e){if(e){if(e.style&&e.style.fontSize.length>0)return this.util.changeTxt(this.context.fontSize.targetText,e.style.fontSize),!0}else this.util.changeTxt(this.context.fontSize.targetText,this.lang.toolbar.fontSize);return!1},on:function(){const e=this.context.fontSize,t=e._sizeList,i=e.targetText.textContent;if(i!==e.currentSize){for(let e=0,n=t.length;e
  • ",t},appendHr:function(e){const t=this.util.createElement("HR");t.className=e,this.focus();let i=this.insertComponent(t,!1);this.setRange(i,0,i,0)},horizontalRulePick:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,i=null;for(;!i&&!/UL/i.test(t.tagName);)i=t.getAttribute("data-value"),t=t.parentNode;i&&(this.plugins.horizontalRule.appendHr.call(this,"__se__"+i),this.submenuOff())}},list:{name:"list",display:"submenu",add:function(e,t){const i=e.context;i.list={targetButton:t,targetIcon:t.querySelector("i"),_list:null,currentList:""};let n=this.setSubmenu.call(e),l=n.querySelector("ul");l.addEventListener("click",this.pickup.bind(e)),i.list._list=l.querySelectorAll("li button"),t.parentNode.appendChild(n),n=null,l=null},setSubmenu:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-submenu se-list-layer",t.innerHTML='
    ",t},active:function(e){const t=this.context.list.targetButton,i=this.context.list.targetIcon,n=this.util;if(e){if(n.isList(e)){const l=e.nodeName;return t.setAttribute("data-focus",l),n.addClass(t,"active"),/UL/i.test(l)?(n.removeClass(i,"se-icon-list-number"),n.addClass(i,"se-icon-list-bullets")):(n.removeClass(i,"se-icon-list-bullets"),n.addClass(i,"se-icon-list-number")),!0}}else t.removeAttribute("data-focus"),n.removeClass(i,"se-icon-list-bullets"),n.addClass(i,"se-icon-list-number"),n.removeClass(t,"active");return!1},on:function(){const e=this.context.list,t=e._list,i=e.targetButton.getAttribute("data-focus")||"";if(i!==e.currentList){for(let e=0,n=t.length;e"),t.innerHTML+=i.outerHTML,e&&(t.innerHTML+="
    ")}else{const e=i.childNodes;for(;e[0];)t.appendChild(e[0])}c.appendChild(t),a||(p=c),a&&u===d&&!l.isRangeFormatElement(m)||(h||(h=c),s&&a&&u===d||a&&l.isList(d)&&d===r||c.parentNode!==u&&u.insertBefore(c,m)),l.removeItem(i),s&&null===g&&(g=c.children.length-1),a&&l.getRangeFormatElement(d,f)!==l.getRangeFormatElement(r,f)&&(c=l.createElement(e)),_&&0===_.children.length&&l.removeItem(_)}else l.removeItem(i);g&&(h=h.children[g]),r&&(m=c.children.length-1,c.innerHTML+=u.innerHTML,p=c.children[m],l.removeItem(u)),o=a=l.getEdgeChildNodes(h.firstChild,p.lastChild)}else{if(i)for(let e=0,t=n.length;e=0;i--)if(n[i].contains(n[e])){n.splice(e,1),e--,t--;break}const t=l.getRangeFormatElement(r),s=t&&t.tagName===e;let c,d,u;const h=function(e){return!this.isComponent(e)}.bind(l);s||(d=l.createElement(e));for(let t,r,p=0,g=n.length;p0){const e=l.cloneNode(!1),t=l.childNodes,s=this.util.getPositionIndex(n);for(;t[s];)e.appendChild(t[s]);i.appendChild(e)}0===l.children.length&&this.util.removeItem(l);const a=this.util.getEdgeChildNodes(t,i);return{cc:t.parentNode,sc:a.sc,ec:a.ec}},editInsideList:function(e,t){const i=(t=t||this.getSelectedElements().filter(function(e){return this.isListCell(e)}.bind(this.util))).length;if(0===i||!e&&!this.util.isListCell(t[0].previousElementSibling)&&!this.util.isListCell(t[i-1].nextElementSibling))return{sc:t[0],so:0,ec:t[i-1],eo:1};let n=t[0].parentNode,l=t[i-1],s=null;if(e){if(n!==l.parentNode&&this.util.isList(l.parentNode.parentNode)&&l.nextElementSibling)for(l=l.nextElementSibling;l;)t.push(l),l=l.nextElementSibling;s=this.plugins.list.editList.call(this,n.nodeName.toUpperCase(),t,!0)}else{s={sc:t[0],so:i>1||!this.getRange().collapsed?0:1,ec:l,eo:1};let e=this.util.createElement(n.nodeName),o=s.sc.previousElementSibling,a=s.sc.nextElementSibling;for(let l,s=0,r=i;s i"),i.table.resizeText=s.querySelector("._se_table_resize > span > span"),i.table.headerButton=s.querySelector("._se_table_header"),s.addEventListener("mousedown",(function(e){e.stopPropagation()}),!1);let o=this.setController_tableEditor.call(e);i.table.resizeDiv=o,i.table.splitMenu=o.querySelector(".se-btn-group-sub"),i.table.mergeButton=o.querySelector("._se_table_merge_button"),i.table.splitButton=o.querySelector("._se_table_split_button"),o.addEventListener("mousedown",(function(e){e.stopPropagation()}),!1),l.addEventListener("mousemove",this.onMouseMove_tablePicker.bind(e)),l.addEventListener("click",this.appendTable.bind(e)),o.addEventListener("click",this.onClick_tableController.bind(e)),s.addEventListener("click",this.onClick_tableController.bind(e)),t.parentNode.appendChild(n),i.element.relative.appendChild(o),i.element.relative.appendChild(s),n=null,l=null,o=null,s=null},setSubmenu:function(){const e=this.util.createElement("DIV");return e.className="se-submenu se-selector-table",e.innerHTML='
    1 x 1
    ',e},setController_table:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-table",t.innerHTML='
    ",t},setController_tableEditor:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-table-cell",t.innerHTML='
    • '+e.controller.VerticalSplit+'
    • '+e.controller.HorizontalSplit+"
    ",t},appendTable:function(){const e=this.util.createElement("TABLE"),t=this.plugins.table.createCells,i=this.context.table._tableXY[0];let n=this.context.table._tableXY[1],l="";for(;n>0;)l+=""+t.call(this,"td",i)+"",--n;l+="",e.innerHTML=l,this.insertComponent(e,!1);const s=e.querySelector("td div");this.setRange(s,0,s,0),this.plugins.table.reset_table_picker.call(this)},createCells:function(e,t,i){if(e=e.toLowerCase(),i){const t=this.util.createElement(e);return t.innerHTML="

    ",t}{let i="";for(;t>0;)i+="<"+e+">

    ",t--;return i}},onMouseMove_tablePicker:function(e){e.stopPropagation();let t=this._w.Math.ceil(e.offsetX/18),i=this._w.Math.ceil(e.offsetY/18);t=t<1?1:t,i=i<1?1:i,this.context.table.tableHighlight.style.width=t+"em",this.context.table.tableHighlight.style.height=i+"em";let n=t<5?5:t>9?10:t+1,l=i<5?5:i>9?10:i+1;this.context.table.tableUnHighlight.style.width=n+"em",this.context.table.tableUnHighlight.style.height=l+"em",this.util.changeTxt(this.context.table.tableDisplay,t+" x "+i),this.context.table._tableXY=[t,i]},reset_table_picker:function(){if(!this.context.table.tableHighlight)return;const e=this.context.table.tableHighlight.style,t=this.context.table.tableUnHighlight.style;e.width="1em",e.height="1em",t.width="5em",t.height="5em",this.util.changeTxt(this.context.table.tableDisplay,"1 x 1"),this.submenuOff()},init:function(){const e=this.context.table,t=this.plugins.table;if(t._removeEvents.call(this),t._selectedTable){const e=t._selectedTable.querySelectorAll(".se-table-selected-cell");for(let t=0,i=e.length;t0)for(let e,t=0;ts||(u>=e.index?(n+=e.cs,u+=e.cs,e.rs-=1,e.row=s+1,e.rs<1&&(r.splice(t,1),t--)):h===p-1&&(e.rs-=1,e.row=s+1,e.rs<1&&(r.splice(t,1),t--)));if(s===o&&h===l){i._logical_cellIndex=u;break}d>0&&a.push({index:u,cs:c+1,rs:d,row:-1}),n+=c}r=r.concat(a).sort((function(e,t){return e.index-t.index})),a=[]}a=null,r=null}},editTable:function(e,t){const i=this.plugins.table,n=this.context.table,l=n._element,s="row"===e;if(s){const e=n._trElement.parentNode;if(/^THEAD$/i.test(e.nodeName)){if("up"===t)return;if(!e.nextElementSibling||!/^TBODY$/i.test(e.nextElementSibling.nodeName))return void(l.innerHTML+=""+i.createCells.call(this,"td",n._logical_cellCnt,!1)+"")}}if(i._ref){const e=n._tdElement,l=i._selectedCells;if(s)if(t)i.setCellInfo.call(this,"up"===t?l[0]:l[l.length-1],!0),i.editRow.call(this,t,e);else{let e=l[0].parentNode;const n=[l[0]];for(let t,i=1,s=l.length;io&&o>t&&(e[l].rowSpan=i+a,c-=n)}if(n){const e=r[s+1];if(e){const t=[];let i=r[s].cells,n=0;for(let e,l,s=0,o=i.length;s1&&(e.rowSpan-=1,t.push({cell:e.cloneNode(!1),index:l}));if(t.length>0){let l=t.shift();i=e.cells,n=0;for(let s,o,a=0,r=i.length;a=l.index)||(a--,n--,n+=l.cell.colSpan-1,e.insertBefore(l.cell,s),l=t.shift(),l));a++);if(l){e.appendChild(l.cell);for(let i=0,n=t.length;i0){const e=!s[b+1];for(let t,i=0;i_||(g>=t.index?(f+=t.cs,g=b+f,t.rs-=1,t.row=_+1,t.rs<1&&(d.splice(i,1),i--)):e&&(t.rs-=1,t.row=_+1,t.rs<1&&(d.splice(i,1),i--)))}i>0&&c.push({rs:i,cs:r+1,index:g,row:-1}),g>=t&&g+r<=t+o?h.push(e):g<=t+o&&g+r>=t?e.colSpan-=n.getOverlapRangeAtIndex(a,a+o,g,g+r):i>0&&(gt+o)&&p.push({cell:e,i:_,rs:_+i}),f+=r}else{if(b>=t)break;if(r>0){if(u<1&&r+b>=t){e.colSpan+=1,t=null,u=i+1;break}t-=r}if(!m){for(let e,i=0;i0){u-=1;continue}null!==t&&s.length>0&&(g=this.plugins.table.createCells.call(this,s[0].nodeName,0,!0),g=e.insertBefore(g,s[t]))}}if(l){let e,t;for(let i,l=0,s=h.length;l1)c.colSpan=this._w.Math.floor(e/2),l.colSpan=e-c.colSpan,o.insertBefore(c,l.nextElementSibling);else{let t=[],i=[];for(let o,r,c=0,d=n._rowCnt;c0)for(let e,t=0;tc||(u>=e.index?(r+=e.cs,u+=e.cs,e.rs-=1,e.row=c+1,e.rs<1&&(i.splice(t,1),t--)):h===p-1&&(e.rs-=1,e.row=c+1,e.rs<1&&(i.splice(t,1),t--)));if(u<=a&&d>0&&t.push({index:u,cs:s+1,rs:d,row:-1}),n!==l&&u<=a&&u+s>=a+e-1){n.colSpan+=1;break}if(u>a)break;r+=s}i=i.concat(t).sort((function(e,t){return e.index-t.index})),t=[]}o.insertBefore(c,l.nextElementSibling)}}else{const e=l.rowSpan;if(c.colSpan=l.colSpan,e>1){c.rowSpan=this._w.Math.floor(e/2);const i=e-c.rowSpan,n=[],r=t.getArrayIndex(s,o)+i;for(let e,t,i=0;i=a));c++)l=e[c],s=l.rowSpan-1,s>0&&s+i>=r&&o=h.index&&(r+=h.cs,l+=h.cs,h=n.shift()),l>=a||s===o-1){d.insertBefore(c,e.nextElementSibling);break}r+=t}l.rowSpan=i}else{c.rowSpan=l.rowSpan;const e=t.createElement("TR");e.appendChild(c);for(let e,t=0;t=r&&(e[i].rowSpan+=1)}const i=n._physical_cellIndex,a=o.cells;for(let e=0,t=a.length;e0&&o+s>=n&&(e.rowSpan-=i.getOverlapRangeAtIndex(n,l,o,o+s));else s.push(e[o]);for(let e=0,t=s.length;e"+this.plugins.table.createCells.call(this,"th",this.context.table._logical_cellCnt,!1)+"",n.insertBefore(t,n.firstElementChild)}e.toggleClass(t,"active"),/TH/i.test(this.context.table._tdElement.nodeName)?this.controllersOff():this.plugins.table.setPositionControllerDiv.call(this,this.context.table._tdElement,!1)},resizeTable:function(){const e=this.context.table,t=e.resizeIcon,i=e.resizeText;let n="se-icon-expansion",l="se-icon-reduction",s=e.minText,o="100%";e._maxWidth||(n="se-icon-reduction",l="se-icon-expansion",s=e.maxText,o="auto"),this.util.removeClass(t,n),this.util.addClass(t,l),this.util.changeTxt(i,s),e._element.style.width=o},setActiveButton:function(e,t){const i=this.context.table;t&&e!==t?(i.splitButton.setAttribute("disabled",!0),i.mergeButton.removeAttribute("disabled")):(i.splitButton.removeAttribute("disabled"),i.mergeButton.setAttribute("disabled",!0))},_bindOnSelect:null,_bindOffSelect:null,_bindOffShift:null,_selectedCells:null,_shift:!1,_fixedCell:null,_fixedCellName:null,_selectedCell:null,_selectedTable:null,_ref:null,_toggleEditor:function(e){this.context.element.wysiwyg.setAttribute("contenteditable",e),e?this.util.removeClass(this.context.element.wysiwyg,"se-disabled"):this.util.addClass(this.context.element.wysiwyg,"se-disabled")},_offCellMultiSelect:function(e){e.stopPropagation();const t=this.plugins.table;t._shift?t._initBind&&(this._wd.removeEventListener("touchmove",t._initBind),t._initBind=null):(t._removeEvents.call(this),t._toggleEditor.call(this,!0)),t._fixedCell&&t._selectedTable&&(t.setActiveButton.call(this,t._fixedCell,t._selectedCell),t.call_controller_tableEdit.call(this,t._selectedCell||t._fixedCell),t._selectedCells=t._selectedTable.querySelectorAll(".se-table-selected-cell"),t._selectedCell&&t._fixedCell&&this.focusEdge(t._selectedCell),t._shift||(t._fixedCell=null,t._selectedCell=null,t._fixedCellName=null))},_onCellMultiSelect:function(e){const t=this.plugins.table,i=this.util.getParentElement(e.target,this.util.isCell);if(t._shift)i===t._fixedCell?t._toggleEditor.call(this,!0):t._toggleEditor.call(this,!1);else if(!t._ref){if(i===t._fixedCell)return;t._toggleEditor.call(this,!1)}i&&i!==t._selectedCell&&t._fixedCellName===i.nodeName&&t._selectedTable===this.util.getParentElement(i,"TABLE")&&(t._selectedCell=i,t._setMultiCells.call(this,t._fixedCell,i))},_setMultiCells:function(e,t){const i=this.plugins.table,n=i._selectedTable.rows,l=this.util,s=i._selectedTable.querySelectorAll(".se-table-selected-cell");for(let e=0,t=s.length;e0)for(let e,t=0;td||(u>=e.index?(s+=e.cs,u+=e.cs,e.rs-=1,e.row=d+1,e.rs<1&&(a.splice(t,1),t--)):g===m-1&&(e.rs-=1,e.row=d+1,e.rs<1&&(a.splice(t,1),t--)));if(o){if(n!==e&&n!==t||(c.cs=null!==c.cs&&c.csu+h?c.ce:u+h,c.rs=null!==c.rs&&c.rsd+p?c.re:d+p,c._i+=1),2===c._i){o=!1,a=[],r=[],d=-1;break}}else if(l.getOverlapRangeAtIndex(c.cs,c.ce,u,u+h)&&l.getOverlapRangeAtIndex(c.rs,c.re,d,d+p)){const e=c.csu+h?c.ce:u+h,i=c.rsd+p?c.re:d+p;if(c.cs!==e||c.ce!==t||c.rs!==i||c.re!==s){c.cs=e,c.ce=t,c.rs=i,c.re=s,d=-1,a=[],r=[];break}l.addClass(n,"se-table-selected-cell")}p>0&&r.push({index:u,cs:h+1,rs:p,row:-1}),s+=n.colSpan-1}a=a.concat(r).sort((function(e,t){return e.index-t.index})),r=[]}},_removeEvents:function(){const e=this.plugins.table;e._initBind&&(this._wd.removeEventListener("touchmove",e._initBind),e._initBind=null),e._bindOnSelect&&(this._wd.removeEventListener("mousedown",e._bindOnSelect),this._wd.removeEventListener("mousemove",e._bindOnSelect),e._bindOnSelect=null),e._bindOffSelect&&(this._wd.removeEventListener("mouseup",e._bindOffSelect),e._bindOffSelect=null),e._bindOffShift&&(this._wd.removeEventListener("keyup",e._bindOffShift),e._bindOffShift=null)},_initBind:null,onTableCellMultiSelect:function(e,t){const i=this.plugins.table;i._removeEvents.call(this),this.controllersOff(),i._shift=t,i._fixedCell=e,i._fixedCellName=e.nodeName,i._selectedTable=this.util.getParentElement(e,"TABLE");const n=i._selectedTable.querySelectorAll(".se-table-selected-cell");for(let e=0,t=n.length;e-1?(i=e.toLowerCase(),o="blockquote"===i?"range":"pre"===i?"free":"replace",r=/^h/.test(i)?i.match(/\d+/)[0]:"",a=t["tag_"+(r?"h":i)]+r,d="",c=""):(i=e.tag.toLowerCase(),o=e.command,a=e.name||i,d=e.class,c=d?' class="'+d+'"':""),s+='
  • ";return s+="",i.innerHTML=s,i},active:function(e){let t=this.lang.toolbar.formats;const i=this.context.formatBlock.targetText,n=this.context.formatBlock.targetTooltip;if(e){if(this.util.isFormatElement(e)){const l=this.context.formatBlock._formatList,s=e.nodeName.toLowerCase(),o=(e.className.match(/(\s|^)__se__format__[^\s]+/)||[""])[0].trim();for(let e,i=0,n=l.length;i=0;u--)if(n=g[u],n!==(g[u+1]?g[u+1].parentNode:null)){if(d=a.isComponent(n),s=d?"":n.innerHTML.replace(/(?!>)\s+(?=<)|\n/g," "),o=a.getParentElement(n,(function(e){return e.parentNode===t})),(t!==n.parentNode||d)&&(a.isFormatElement(t)?(t.parentNode.insertBefore(i,t.nextSibling),t=t.parentNode):(t.insertBefore(i,o?o.nextSibling:null),t=n.parentNode),r=i.nextSibling,r&&i.nodeName===r.nodeName&&a.isSameAttributes(i,r)&&(i.innerHTML+="
    "+r.innerHTML,a.removeItem(r)),i=l.cloneNode(!1),h=!0),c=i.innerHTML,i.innerHTML=(h||!s||!c||/
    $/i.test(s)?s:s+"
    ")+c,0===u){t.insertBefore(i,n),r=n.nextSibling,r&&i.nodeName===r.nodeName&&a.isSameAttributes(i,r)&&(i.innerHTML+="
    "+r.innerHTML,a.removeItem(r));const e=i.previousSibling;e&&i.nodeName===e.nodeName&&a.isSameAttributes(i,e)&&(e.innerHTML+="
    "+i.innerHTML,a.removeItem(i))}d||a.removeItem(n),s&&(h=!1)}this.setRange(n,0,n,0)}else{for(let e,t,i=0,o=g.length;i('+t.toolbar.default+")";for(let e,t=0,i=n.length;t";return l+="",i.innerHTML=l,i},on:function(){const e=this.context.lineHeight,t=e._sizeList,i=this.util.getFormatElement(this.getSelectionNode()).style.lineHeight+"";if(i!==e.currentSize){for(let e=0,n=t.length;e";return i+="",t.innerHTML=i,t},pickup:function(e){if(!/^BUTTON$/i.test(e.target.tagName))return!1;e.preventDefault(),e.stopPropagation();const t=this.context.option.templates[e.target.getAttribute("data-value")];if(!t.html)throw this.submenuOff(),Error('[SUNEDITOR.template.fail] cause : "templates[i].html not found"');this.setContents(t.html),this.submenuOff()}},paragraphStyle:{name:"paragraphStyle",display:"submenu",add:function(e,t){const i=e.context;i.paragraphStyle={_classList:null};let n=this.setSubmenu.call(e);n.querySelector("ul").addEventListener("click",this.pickUp.bind(e)),i.paragraphStyle._classList=n.querySelectorAll("li button"),t.parentNode.appendChild(n),n=null},setSubmenu:function(){const e=this.context.option,t=this.util.createElement("DIV");t.className="se-submenu se-list-layer";const i=this.lang.menu,n={spaced:{name:i.spaced,class:"__se__p-spaced",_class:""},bordered:{name:i.bordered,class:"__se__p-bordered",_class:""},neon:{name:i.neon,class:"__se__p-neon",_class:""}},l=e.paragraphStyles&&0!==e.paragraphStyles.length?e.paragraphStyles:["spaced","bordered","neon"];let s='
      ';for(let e,t,i,o,a=0,r=l.length;a
    "}return s+="",t.innerHTML=s,t},on:function(){const e=this.context.paragraphStyle._classList,t=this.util.getFormatElement(this.getSelectionNode());for(let i=0,n=e.length;i"}return l+="",t.innerHTML=l,t},on:function(){const e=this.util,t=this.context.textStyle._styleList,i=this.getSelectionNode();for(let n,l,s,o=0,a=t.length;o'+e.dialogBox.linkBox.title+'
    ",t},setController_LinkButton:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-link",t.innerHTML='
    ",t},open:function(){this.plugins.dialog.open.call(this,"link","link"===this.currentControllerName)},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();const t=function(){if(0===this.context.link.focusElement.value.trim().length)return!1;const e=this.context.link,t=e.focusElement.value,i=e.linkAnchorText,n=0===i.value.length?t:i.value;if(this.context.dialog.updateModal)e._linkAnchor.href=t,e._linkAnchor.textContent=n,e._linkAnchor.target=e.linkNewWindowCheck.checked?"_blank":"",this.setRange(e._linkAnchor.childNodes[0],0,e._linkAnchor.childNodes[0],e._linkAnchor.textContent.length);else{const i=this.util.createElement("A");i.href=t,i.textContent=n,i.target=e.linkNewWindowCheck.checked?"_blank":"";const l=this.getSelectedElements();if(l.length>1){const e=this.util.createElement(l[0].nodeName);e.appendChild(i),this.insertNode(e)}else this.insertNode(i);this.setRange(i.childNodes[0],0,i.childNodes[0],i.textContent.length)}this.history.push(!1),e.focusElement.value="",e.linkAnchorText.value=""}.bind(this);try{t()}finally{this.plugins.dialog.close.call(this),this.closeLoading(),this.focus()}return!1},active:function(e){if(e){if(this.util.isAnchor(e)&&null===e.getAttribute("data-image-link"))return this.controllerArray[0]!==this.context.link.linkBtn&&this.plugins.link.call_controller_linkButton.call(this,e),!0}else this.controllerArray[0]===this.context.link.linkBtn&&this.controllersOff();return!1},on:function(e){e||(this.context.link.linkAnchorText.value=this.getSelection().toString()),this.context.link._linkAnchor&&(this.context.dialog.updateModal=!0,this.context.link.focusElement.value=this.context.link._linkAnchor.href,this.context.link.linkAnchorText.value=this.context.link._linkAnchor.textContent,this.context.link.linkNewWindowCheck.checked=!!/_blank/i.test(this.context.link._linkAnchor.target))},call_controller_linkButton:function(e){this.editLink=this.context.link._linkAnchor=e;const t=this.context.link.linkBtn,i=t.querySelector("a");i.href=e.href,i.title=e.textContent,i.textContent=e.textContent;const n=this.util.getOffset(e,this.context.element.wysiwygFrame);t.style.top=n.top+e.offsetHeight+10+"px",t.style.left=n.left-this.context.element.wysiwygFrame.scrollLeft+"px",t.style.display="block";const l=this.context.element.wysiwygFrame.offsetWidth-(t.offsetLeft+t.offsetWidth);l<0?(t.style.left=t.offsetLeft+l+"px",t.firstElementChild.style.left=20-l+"px"):t.firstElementChild.style.left="20px",this.controllersOn(t,this.plugins.link.init.bind(this),"link")},onClick_linkBtn:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")||e.target.parentNode.getAttribute("data-command");if(t){if(e.preventDefault(),/update/.test(t))this.context.link.focusElement.value=this.context.link._linkAnchor.href,this.context.link.linkAnchorText.value=this.context.link._linkAnchor.textContent,this.context.link.linkNewWindowCheck.checked=!!/_blank/i.test(this.context.link._linkAnchor.target),this.plugins.dialog.open.call(this,"link",!0);else if(/unlink/.test(t)){const e=this.util.getChildElement(this.context.link._linkAnchor,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!1),t=this.util.getChildElement(this.context.link._linkAnchor,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!0);this.setRange(e,0,t,t.textContent.length),this.nodeChange(null,null,["A"],!1)}else this.util.removeItem(this.context.link._linkAnchor),this.context.link._linkAnchor=null,this.focus(),this.history.push(!1);this.controllersOff()}},init:function(){if(!/link/i.test(this.context.dialog.kind)){const e=this.context.link;e.linkBtn.style.display="none",e._linkAnchor=null,e.focusElement.value="",e.linkAnchorText.value="",e.linkNewWindowCheck.checked=!1}}},image:{name:"image",display:"dialog",add:function(e){e.addModule([l,s,o]);const t=e.context;t.image={sizeUnit:t.option._imageSizeUnit,_linkElement:null,_container:null,_cover:null,_element:null,_element_w:1,_element_h:1,_element_l:0,_element_t:0,_defaultSizeX:"auto",_defaultSizeY:"auto",_origin_w:"auto"===t.option.imageWidth?"":t.option.imageWidth,_origin_h:"",_altText:"",_caption:null,captionCheckEl:null,_linkValue:"",_align:"none",_captionChecked:!1,_proportionChecked:!0,_floatClassRegExp:"__se__float\\-[a-z]+",_xmlHttp:null,_captionShow:!0,_resizing:t.option.imageResizing,_rotation:t.option.imageRotation,_resizeDotHide:!t.option.imageHeightShow,_uploadFileLength:0,_onlyPercentage:t.option.imageSizeOnlyPercentage,_ratio:!1,_ratioX:1,_ratioY:1};let i=this.setDialog.call(e);t.image.modal=i,t.image.imgUrlFile=i.querySelector("._se_image_url"),t.image.imgInputFile=t.image.focusElement=i.querySelector("._se_image_file")||i.querySelector("._se_image_url"),t.image.altText=i.querySelector("._se_image_alt"),t.image.imgLink=i.querySelector("._se_image_link"),t.image.imgLinkNewWindowCheck=i.querySelector("._se_image_link_check"),t.image.captionCheckEl=i.querySelector("._se_image_check_caption"),t.image.modal.querySelector(".se-dialog-tabs").addEventListener("click",this.openTab.bind(e)),t.image.modal.querySelector(".se-btn-primary").addEventListener("click",this.submit.bind(e)),t.image.proportion={},t.image.inputX={},t.image.inputY={},t.option.imageResizing&&(t.image.proportion=i.querySelector("._se_image_check_proportion"),t.image.inputX=i.querySelector("._se_image_size_x"),t.image.inputY=i.querySelector("._se_image_size_y"),t.image.inputX.value=t.option.imageWidth,t.image.inputX.addEventListener("keyup",this.setInputSize.bind(e,"x")),t.image.inputY.addEventListener("keyup",this.setInputSize.bind(e,"y")),t.image.inputX.addEventListener("change",this.setRatio.bind(e)),t.image.inputY.addEventListener("change",this.setRatio.bind(e)),t.image.proportion.addEventListener("change",this.setRatio.bind(e)),i.querySelector(".se-dialog-btn-revert").addEventListener("click",this.sizeRevert.bind(e))),t.dialog.modal.appendChild(i),i=null},setDialog:function(){const e=this.context.option,t=this.lang,i=this.util.createElement("DIV");i.className="se-dialog-content",i.style.display="none";let n='
    '+t.dialogBox.imageBox.title+'
    ';if(e.imageFileInput&&(n+='
    '),e.imageUrlInput&&(n+='
    '),n+='
    ',e.imageResizing){const i=e.imageSizeOnlyPercentage,l=i?' style="display: none !important;"':"",s=e.imageHeightShow?"":' style="display: none !important;"';n+='
    ',i||!e.imageHeightShow?n+='
    ":n+='
    ",n+=' '+t.dialogBox.proportion+'
    '}return n+='
    ",i.innerHTML=n,i},open:function(){this.plugins.dialog.open.call(this,"image","image"===this.currentControllerName)},openTab:function(e){const t=this.context.image.modal,i="init"===e?t.querySelector("._se_tab_link"):e.target;if(!/^BUTTON$/i.test(i.tagName))return!1;const n=i.getAttribute("data-tab-link");let l,s,o;for(s=t.getElementsByClassName("_se_tab_content"),l=0;l0){let t=0;const i=[];for(let n=0,l=e.length;n0){let e=0;const i=this._variable._imagesInfo;for(let t=0,n=i.length;tn){const i="[SUNEDITOR.imageUpload.fail] Size of uploadable total images: "+n/1e3+"KB";return this._imageUploadError(i,{limitSize:n,currentSize:e,uploadSize:t})&&o.open.call(this,i),void this.closeLoading()}}this.context.image._uploadFileLength=i.length;const l=this.context.option.imageUploadUrl,s=this.context.option.imageUploadHeader,a=this.context.dialog.updateModal?1:i.length,r={linkValue:this.context.image._linkValue,linkNewWindow:this.context.image.imgLinkNewWindowCheck.checked,inputWidth:this.context.image.inputX.value,inputHeight:this.context.image.inputY.value,align:this.context.image._align,isUpdate:this.context.dialog.updateModal,currentImage:this.context.image._element};if(!this._imageUploadBefore(i,r))return;if("string"==typeof l&&l.length>0){const e=new FormData;for(let t=0;t0)for(let e in s)this.context.image._xmlHttp.setRequestHeader(e,s[e]);this.context.image._xmlHttp.send(e)}else for(let e=0;e0){const n=this.util.createElement("A");return n.href=/^https?:\/\//.test(t)?t:"http://"+t,n.target=i?"_blank":"",n.setAttribute("data-image-link","image"),e.setAttribute("data-image-link",t),n.appendChild(e),n}return e},setInputSize:function(e,t){t&&32===t.keyCode?t.preventDefault():this.plugins.resizing._module_setInputSize.call(this,this.context.image,e)},setRatio:function(){this.plugins.resizing._module_setRatio.call(this,this.context.image)},submit:function(e){const t=this.context.image,i=this.plugins.image;this.showLoading(),e.preventDefault(),e.stopPropagation(),t._linkValue=t.imgLink.value,t._altText=t.altText.value,t._align=t.modal.querySelector('input[name="suneditor_image_radio"]:checked').value,t._captionChecked=t.captionCheckEl.checked,t._resizing&&(t._proportionChecked=t.proportion.checked);try{this.context.dialog.updateModal&&i.update_image.call(this,!1,!1,!1),t.imgInputFile&&t.imgInputFile.files.length>0?i.onRender_imgInput.call(this):t.imgUrlFile&&t.imgUrlFile.value.trim().length>0?i.onRender_imgUrl.call(this):this.closeLoading()}catch(e){throw this.closeLoading(),Error('[SUNEDITOR.image.submit.fail] cause : "'+e.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},setImagesInfo:function(e,t){const i=this._variable._imagesInfo;let n=e.getAttribute("data-index"),l=null,s="";if(!n||this._imagesInfoInit)s="create",n=this._variable._imageIndex,this._variable._imageIndex++,e.setAttribute("data-index",n),e.setAttribute("data-file-name",t.name),e.setAttribute("data-file-size",t.size),l={src:e.src,index:1*n,name:t.name,size:t.size},i.push(l);else{s="update",n*=1;for(let e=0,t=i.length;e-1||(i.splice(t,1),this._imageUpload(null,e,"delete",null,0),t--);this.context.resizing._resize_plugin=""},_onload_image:function(e,t){t&&(this.plugins.image.setImagesInfo.call(this,e,t),this.history.push(!0))},create_image:function(e,t,i,n,l,s,o){const a=this.context.image;this.context.resizing._resize_plugin="image";let r=this.util.createElement("IMG");r.addEventListener("load",this.plugins.image._onload_image.bind(this,r,o)),r.src=e,r.alt=a._altText,r=this.plugins.image.onRender_link.call(this,r,t,i),r.setAttribute("data-rotate","0"),a._resizing&&r.setAttribute("data-proportion",a._proportionChecked);const c=this.plugins.resizing.set_cover.call(this,r),d=this.plugins.resizing.set_container.call(this,c,"se-image-container");a._captionChecked&&(a._caption=this.plugins.resizing.create_caption.call(this),a._caption.setAttribute("contenteditable",!1),c.appendChild(a._caption)),a._element=r,a._cover=c,a._container=d,this.plugins.image.applySize.call(this,n,l),this.plugins.image.setAlign.call(this,s,r,c,d),this.insertComponent(d,!0),this.context.resizing._resize_plugin=""},update_image:function(e,t,i){const n=this.context.image,l=n._linkValue;let s,o=n._element,a=n._cover,r=n._container,c=!1;null===a&&(c=!0,o=n._element.cloneNode(!0),a=this.plugins.resizing.set_cover.call(this,o)),null===r&&(a=a.cloneNode(!0),c=!0,r=this.plugins.resizing.set_container.call(this,a,"se-image-container")),c&&(r.innerHTML="",r.appendChild(a));const d=this.util.isNumber(n.inputX.value)?n.inputX.value+n.sizeUnit:n.inputX.value,u=this.util.isNumber(n.inputY.value)?n.inputY.value+n.sizeUnit:n.inputY.value;if(s=/%$/.test(o.style.width)?d!==r.style.width||u!==r.style.height:d!==o.style.width||u!==o.style.height,o.alt=n._altText,n._captionChecked?n._caption||(n._caption=this.plugins.resizing.create_caption.call(this),a.appendChild(n._caption)):n._caption&&(this.util.removeItem(n._caption),n._caption=null),l.trim().length>0)if(null!==n._linkElement)n._linkElement.href=l,n._linkElement.target=n.imgLinkNewWindowCheck.checked?"_blank":"",o.setAttribute("data-image-link",l);else{let e=this.plugins.image.onRender_link.call(this,o,l,this.context.image.imgLinkNewWindowCheck.checked);a.insertBefore(e,n._caption)}else if(null!==n._linkElement){const e=o;e.setAttribute("data-image-link","");let t=e.cloneNode(!0);a.removeChild(n._linkElement),a.insertBefore(t,n._caption),o=t}if(c){const e=this.util.isRangeFormatElement(n._element.parentNode)||this.util.isWysiwygDiv(n._element.parentNode)?n._element:/^A$/i.test(n._element.parentNode.nodeName)?n._element.parentNode:this.util.getFormatElement(n._element)||n._element;e.parentNode.replaceChild(r,e),o=r.querySelector("img"),n._element=o,n._cover=a,n._container=r}!n._onlyPercentage&&s&&!e&&(/\d+/.test(o.style.height)||this.context.resizing._rotateVertical&&n._captionChecked)&&(/%$/.test(n.inputX.value)||/%$/.test(n.inputY.value)?this.plugins.resizing.resetTransform.call(this,o):this.plugins.resizing.setTransformSize.call(this,o,this.util.getNumber(n.inputX.value,0),this.util.getNumber(n.inputY.value,0)));if(n._resizing&&(o.setAttribute("data-proportion",n._proportionChecked),s&&this.plugins.image.applySize.call(this)),this.plugins.image.setAlign.call(this,null,o,null,null),e&&this.plugins.image.setImagesInfo.call(this,o,{name:o.getAttribute("data-file-name")||o.src.split("/").pop(),size:o.getAttribute("data-file-size")||0}),t){this.plugins.image.init.call(this);const e=this.plugins.resizing.call_controller_resize.call(this,o,"image");this.plugins.image.onModifyMode.call(this,o,e)}i||this.history.push(!1)},update_src:function(e,t,i){t.src=e,this._w.setTimeout(this.plugins.image.setImagesInfo.bind(this,t,i))},onModifyMode:function(e,t){if(!e)return;const i=this.context.image;i._linkElement=/^A$/i.test(e.parentNode.nodeName)?e.parentNode:null,i._element=e,i._cover=this.util.getParentElement(e,"FIGURE"),i._container=this.util.getParentElement(e,this.util.isMediaComponent),i._caption=this.util.getChildElement(i._cover,"FIGCAPTION"),i._align=e.getAttribute("data-align")||"none",t&&(i._element_w=t.w,i._element_h=t.h,i._element_t=t.t,i._element_l=t.l);let n=i._element.getAttribute("data-size")||i._element.getAttribute("data-origin");n?(n=n.split(","),i._origin_w=n[0],i._origin_h=n[1]):t&&(i._origin_w=t.w,i._origin_h=t.h)},openModify:function(e){const t=this.context.image;t.imgUrlFile.value=t._element.src,t._altText=t.altText.value=t._element.alt,t._linkValue=t.imgLink.value=null===t._linkElement?"":t._linkElement.href,t.imgLinkNewWindowCheck.checked=t._linkElement&&"_blank"===t._linkElement.target,t.modal.querySelector('input[name="suneditor_image_radio"][value="'+t._align+'"]').checked=!0,t._align=t.modal.querySelector('input[name="suneditor_image_radio"]:checked').value,t._captionChecked=t.captionCheckEl.checked=!!t._caption,t._resizing&&this.plugins.resizing._module_setModifyInputSize.call(this,t,this.plugins.image),e||this.plugins.dialog.open.call(this,"image",!0)},on:function(e){if(!e){const e=this.context.image;e.inputX.value=e._origin_w=this.context.option.imageWidth===e._defaultSizeX?"":this.context.option.imageWidth,e.inputY.value=e._origin_h="",e.inputY.disabled=!0,e.proportion.disabled=!0}},sizeRevert:function(){this.plugins.resizing._module_sizeRevert.call(this,this.context.image)},applySize:function(e,t){const i=this.context.image;return e||(e=i.inputX.value),t||(t=i.inputY.value),i._onlyPercentage&&e||/%$/.test(e)?(this.plugins.image.setPercentSize.call(this,e,t),!0):(e&&"auto"!==e||t&&"auto"!==t?this.plugins.image.setSize.call(this,e,t,!1):this.plugins.image.setAutoSize.call(this),!1)},setSize:function(e,t,i){const n=this.context.image;this.plugins.image.cancelPercentAttr.call(this),n._element.style.width=this.util.isNumber(e)?e+n.sizeUnit:e,n._element.style.height=this.util.isNumber(t)?t+n.sizeUnit:/%$/.test(t)?"":t,"center"===n._align&&this.plugins.image.setAlign.call(this,null,null,null,null),i||n._element.removeAttribute("data-percentage"),this.plugins.resizing._module_saveCurrentSize.call(this,n)},setAutoSize:function(){const e=this.context.image;this.plugins.resizing.resetTransform.call(this,e._element),this.plugins.image.cancelPercentAttr.call(this),e._element.style.maxWidth="",e._element.style.width="",e._element.style.height="",e._cover.style.width="",e._cover.style.height="",this.plugins.image.setAlign.call(this,null,null,null,null),e._element.setAttribute("data-percentage","auto,auto"),this.plugins.resizing._module_saveCurrentSize.call(this,e)},setOriginSize:function(){const e=this.context.image;e._element.removeAttribute("data-percentage"),this.plugins.resizing.resetTransform.call(this,e._element),this.plugins.image.cancelPercentAttr.call(this);const t=(e._element.getAttribute("data-origin")||"").split(","),i=t[0],n=t[1];t&&(e._onlyPercentage||/%$/.test(i)&&(/%$/.test(n)||!/\d/.test(n))?this.plugins.image.setPercentSize.call(this,i,n):this.plugins.image.setSize.call(this,i,n),this.plugins.resizing._module_saveCurrentSize.call(this,e))},setPercentSize:function(e,t){const i=this.context.image;t=!t||/%$/.test(t)||this.util.getNumber(t,0)?this.util.isNumber(t)?t+i.sizeUnit:t||"":this.util.isNumber(t)?t+"%":t;const n=/%$/.test(t);i._container.style.width=this.util.isNumber(e)?e+"%":e,i._container.style.height="",i._cover.style.width="100%",i._cover.style.height=n?t:"",i._element.style.width="100%",i._element.style.height=n?"":t,i._element.style.maxWidth="","center"===i._align&&this.plugins.image.setAlign.call(this,null,null,null,null),i._element.setAttribute("data-percentage",e+","+t),this.plugins.resizing.setCaptionPosition.call(this,i._element),this.plugins.resizing._module_saveCurrentSize.call(this,i)},cancelPercentAttr:function(){const e=this.context.image;e._cover.style.width="",e._cover.style.height="",e._container.style.width="",e._container.style.height="",this.util.removeClass(e._container,this.context.image._floatClassRegExp),this.util.addClass(e._container,"__se__float-"+e._align),"center"===e._align&&this.plugins.image.setAlign.call(this,null,null,null,null)},setAlign:function(e,t,i,n){const l=this.context.image;e||(e=l._align),t||(t=l._element),i||(i=l._cover),n||(n=l._container),i.style.margin=e&&"none"!==e?"auto":"0",/%$/.test(t.style.width)&&"center"===e?(n.style.minWidth="100%",i.style.width=n.style.width):(n.style.minWidth="",i.style.width=this.context.resizing._rotateVertical?t.style.height||t.offsetHeight:t.style.width&&"auto"!==t.style.width?t.style.width||"100%":""),this.util.hasClass(n,"__se__float-"+e)||(this.util.removeClass(n,l._floatClassRegExp),this.util.addClass(n,"__se__float-"+e)),t.setAttribute("data-align",e)},resetAlign:function(){const e=this.context.image;e._element.setAttribute("data-align",""),e._align="none",e._cover.style.margin="0",this.util.removeClass(e._container,e._floatClassRegExp)},destroy:function(e){const t=e||this.context.image._element,i=this.util.getParentElement(t,this.util.isMediaComponent)||t,n=1*t.getAttribute("data-index");let l=i.previousElementSibling||i.nextElementSibling;if(this.util.removeItem(i),this.plugins.image.init.call(this),this.controllersOff(),this.focusEdge(l),n>=0){const e=this._variable._imagesInfo;for(let t=0,i=e.length;t'+t.dialogBox.videoBox.title+'
    ';if(e.videoResizing){const i=e.videoRatioList||[{name:"16:9",value:.5625},{name:"4:3",value:.75},{name:"21:9",value:.4285}],l=e.videoRatio,s=e.videoSizeOnlyPercentage,o=s?' style="display: none !important;"':"",a=e.videoHeightShow?"":' style="display: none !important;"',r=e.videoRatioShow?"":' style="display: none !important;"',c=s||e.videoHeightShow||e.videoRatioShow?"":' style="display: none !important;"';n+='
    "}return n+='
    ",i.innerHTML=n,i},open:function(){this.plugins.dialog.open.call(this,"video","video"===this.currentControllerName)},setVideoRatio:function(e){const t=this.context.video,i=e.target.options[e.target.selectedIndex].value;t._defaultSizeY=t._videoRatio=i?100*i+"%":t._defaultSizeY,t.inputY.placeholder=i?100*i+"%":"",t.inputY.value=""},setInputSize:function(e,t){if(t&&32===t.keyCode)return void t.preventDefault();const i=this.context.video;this.plugins.resizing._module_setInputSize.call(this,i,e),"y"===e&&this.plugins.video.setVideoRatioSelect.call(this,t.target.value||i._videoRatio)},setRatio:function(){this.plugins.resizing._module_setRatio.call(this,this.context.video)},_onload_video:function(e){this.plugins.video.setVideosInfo.call(this,e)},submitAction:function(){if(0===this.context.video.focusElement.value.trim().length)return!1;this.context.resizing._resize_plugin="video";const e=this.context.video;let t=null,i=null,n=null,l=e.focusElement.value.trim();if(e._align=e.modal.querySelector('input[name="suneditor_video_radio"]:checked').value,/^$/.test(l))t=(new this._w.DOMParser).parseFromString(l,"text/html").querySelector("iframe");else{if(t=this.util.createElement("IFRAME"),/youtu\.?be/.test(l)&&(/^http/.test(l)||(l="https://"+l),l=l.replace("watch?v=",""),/^\/\/.+\/embed\//.test(l)||(l=l.replace(l.match(/\/\/.+\//)[0],"//www.youtube.com/embed/").replace("&","?&")),e._youtubeQuery.length>0))if(/\?/.test(l)){const t=l.split("?");l=t[0]+"?"+e._youtubeQuery+"&"+t[1]}else l+="?"+e._youtubeQuery;t.src=l}this.context.dialog.updateModal?(e._element.src!==t.src&&(e._element.src=t.src),n=e._container,i=this.util.getParentElement(e._element,"FIGURE"),t=e._element):(t.frameBorder="0",t.allowFullscreen=!0,t.addEventListener("load",this.plugins.video._onload_video.bind(this,t)),e._element=t,i=this.plugins.resizing.set_cover.call(this,t),n=this.plugins.resizing.set_container.call(this,i,"se-video-container"),this._variable._videosCnt++),e._cover=i,e._container=n;const s=this.plugins.resizing._module_getSizeX.call(this,e)!==(e.inputX.value||e._defaultSizeX)||this.plugins.resizing._module_getSizeY.call(this,e)!==(e.inputY.value||e._videoRatio),o=!this.context.dialog.updateModal||s;e._resizing&&(this.context.video._proportionChecked=e.proportion.checked,t.setAttribute("data-proportion",e._proportionChecked));let a=!1;o&&(a=this.plugins.video.applySize.call(this)),a&&"center"===e._align||this.plugins.video.setAlign.call(this,null,t,i,n),this.context.dialog.updateModal?e._resizing&&this.context.resizing._rotateVertical&&o&&this.plugins.resizing.setTransformSize.call(this,t,null,null):this.insertComponent(n,!1),this.context.resizing._resize_plugin="",this.context.dialog.updateModal&&this.history.push(!1)},setVideosInfo:function(e){if(!e.getAttribute("data-origin")){const t=this.util.getParentElement(e,this.util.isMediaComponent),i=this.util.getParentElement(e,"FIGURE"),n=this.plugins.resizing._module_getSizeX.call(this,this.context.video,e,i,t),l=this.plugins.resizing._module_getSizeY.call(this,this.context.video,e,i,t);e.setAttribute("data-origin",n+","+l),e.setAttribute("data-size",n+","+l)}},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();try{this.plugins.video.submitAction.call(this)}finally{this.plugins.dialog.close.call(this),this.closeLoading()}return this.focus(),!1},_update_videoCover:function(e){if(!e)return;const t=this.context.video;e.frameBorder="0",e.allowFullscreen=!0,e.onload=e.addEventListener("load",this.plugins.video._onload_video.bind(this,e));const i=this.util.getParentElement(e,this.util.isMediaComponent)||this.util.getParentElement(e,function(e){return this.isWysiwygDiv(e.parentNode)}.bind(this.util));t._element=e=e.cloneNode(!1);const n=t._cover=this.plugins.resizing.set_cover.call(this,e),l=t._container=this.plugins.resizing.set_container.call(this,n,"se-video-container"),s=i.querySelector("figcaption");let o=null;s&&(o=this.util.createElement("DIV"),o.innerHTML=s.innerHTML,this.util.removeItem(s));const a=(e.getAttribute("data-size")||e.getAttribute("data-origin")||"").split(",");this.plugins.video.applySize.call(this,a[0]||this.context.option.videoWidth,a[1]||""),i.parentNode.replaceChild(l,i),o&&i.parentNode.insertBefore(o,l.nextElementSibling)},onModifyMode:function(e,t){const i=this.context.video;i._element=e,i._cover=this.util.getParentElement(e,"FIGURE"),i._container=this.util.getParentElement(e,this.util.isMediaComponent),i._align=e.getAttribute("data-align")||"none",i._element_w=t.w,i._element_h=t.h,i._element_t=t.t,i._element_l=t.l;let n=i._element.getAttribute("data-size")||i._element.getAttribute("data-origin");n?(n=n.split(","),i._origin_w=n[0],i._origin_h=n[1]):(i._origin_w=t.w,i._origin_h=t.h)},openModify:function(e){const t=this.context.video;if(t.focusElement.value=t._element.src,t.modal.querySelector('input[name="suneditor_video_radio"][value="'+t._align+'"]').checked=!0,t._resizing){this.plugins.resizing._module_setModifyInputSize.call(this,t,this.plugins.video);const e=t._videoRatio=this.plugins.resizing._module_getSizeY.call(this,t);this.plugins.video.setVideoRatioSelect.call(this,e)||(t.inputY.value=t._onlyPercentage?this.util.getNumber(e,2):e)}e||this.plugins.dialog.open.call(this,"video",!0)},on:function(e){if(!e){const e=this.context.video;e.inputX.value=e._origin_w=this.context.option.videoWidth===e._defaultSizeX?"":this.context.option.videoWidth,e.inputY.value=e._origin_h="",e.proportion.disabled=!0}},setVideoRatioSelect:function(e){let t=!1;const i=this.context.video,n=i.videoRatioOption.options;/%$/.test(e)||i._onlyPercentage?e=this.util.getNumber(e,2)/100+"":(!this.util.isNumber(e)||1*e>=1)&&(e=""),i.inputY.placeholder="";for(let l=0,s=n.length;l0||!i.style.width)&&t._update_videoCover.call(this,i);this.context.resizing._resize_plugin=""},sizeRevert:function(){this.plugins.resizing._module_sizeRevert.call(this,this.context.video)},applySize:function(e,t){const i=this.context.video;return e||(e=i.inputX.value),t||(t=i.inputY.value),i._onlyPercentage||/%$/.test(e)||!e?(this.plugins.video.setPercentSize.call(this,e||"100%",t||i._videoRatio),!0):(e&&"auto"!==e||t&&"auto"!==t?this.plugins.video.setSize.call(this,e,t||i._defaultRatio,!1):this.plugins.video.setAutoSize.call(this),!1)},setSize:function(e,t,i){const n=this.context.video;e=this.util.getNumber(e,0),t=this.util.isNumber(t)?t+n.sizeUnit:t||"",n._element.style.width=e?e+n.sizeUnit:"",n._cover.style.paddingBottom=n._cover.style.height=t,/%$/.test(t)?n._element.style.height="":n._element.style.height=t,i||n._element.removeAttribute("data-percentage"),this.plugins.resizing._module_saveCurrentSize.call(this,n)},setAutoSize:function(){this.plugins.video.setPercentSize.call(this,100,this.context.video._defaultRatio)},setOriginSize:function(e){const t=this.context.video;t._element.removeAttribute("data-percentage"),this.plugins.resizing.resetTransform.call(this,t._element),this.plugins.video.cancelPercentAttr.call(this);const i=((e?t._element.getAttribute("data-size"):"")||t._element.getAttribute("data-origin")||"").split(",");if(i){const e=i[0],n=i[1];t._onlyPercentage||/%$/.test(e)&&(/%$/.test(n)||!/\d/.test(n))?this.plugins.video.setPercentSize.call(this,e,n):this.plugins.video.setSize.call(this,e,n),this.plugins.resizing._module_saveCurrentSize.call(this,t)}},setPercentSize:function(e,t){const i=this.context.video;t=!t||/%$/.test(t)||this.util.getNumber(t,0)?this.util.isNumber(t)?t+i.sizeUnit:t||i._videoRatio:this.util.isNumber(t)?t+"%":t,i._container.style.width=this.util.isNumber(e)?e+"%":e,i._container.style.height="",i._cover.style.width="100%",i._cover.style.height=t,i._cover.style.paddingBottom=t,i._element.style.width="100%",i._element.style.height="100%",i._element.style.maxWidth="","center"===i._align&&this.plugins.video.setAlign.call(this,null,null,null,null),i._element.setAttribute("data-percentage",e+","+t),this.plugins.resizing._module_saveCurrentSize.call(this,i)},cancelPercentAttr:function(){const e=this.context.video;e._cover.style.width="",e._cover.style.height="",e._cover.style.paddingBottom="",e._container.style.width="",e._container.style.height="",this.util.removeClass(e._container,this.context.video._floatClassRegExp),this.util.addClass(e._container,"__se__float-"+e._align),"center"===e._align&&this.plugins.video.setAlign.call(this,null,null,null,null)},setAlign:function(e,t,i,n){const l=this.context.video;e||(e=l._align),t||(t=l._element),i||(i=l._cover),n||(n=l._container),i.style.margin=e&&"none"!==e?"auto":"0",/%$/.test(t.style.width)&&"center"===e?(n.style.minWidth="100%",i.style.width=n.style.width,i.style.height=i.style.paddingBottom,i.style.paddingBottom=this.util.getNumber(this.util.getNumber(i.style.paddingBottom,2)/100*this.util.getNumber(i.style.width,2),2)+"%"):(n.style.minWidth="",i.style.width=this.context.resizing._rotateVertical?t.style.height||t.offsetHeight:t.style.width||"100%",i.style.paddingBottom=i.style.height),this.util.hasClass(n,"__se__float-"+e)||(this.util.removeClass(n,l._floatClassRegExp),this.util.addClass(n,"__se__float-"+e)),t.setAttribute("data-align",e)},resetAlign:function(){const e=this.context.video;e._element.setAttribute("data-align",""),e._align="none",e._cover.style.margin="0",this.util.removeClass(e._container,e._floatClassRegExp)},destroy:function(){this._variable._videosCnt--;const e=this.context.video._container;let t=e.previousElementSibling||e.nextElementSibling;this.util.removeItem(e),this.plugins.video.init.call(this),this.controllersOff(),this.focusEdge(t),this.history.push(!1)},init:function(){const e=this.context.video;e.focusElement.value="",e._origin_w=this.context.option.videoWidth,e._origin_h="",e.modal.querySelector('input[name="suneditor_video_radio"][value="none"]').checked=!0,e._resizing&&(e.inputX.value=this.context.option.videoWidth===e._defaultSizeX?"":this.context.option.videoWidth,e.inputY.value="",e.proportion.checked=!0,e.proportion.disabled=!0,this.plugins.video.setVideoRatioSelect.call(this,e._defaultRatio))}},math:{name:"math",display:"dialog",add:function(e){e.addModule([l]);const t=e.context;t.math={focusElement:null,previewElement:null,fontSizeElement:null,_mathExp:null,_renderer:null};let i=this.setDialog.call(e);t.math.modal=i,t.math.focusElement=i.querySelector(".se-math-exp"),t.math.previewElement=i.querySelector(".se-math-preview"),t.math.fontSizeElement=i.querySelector(".se-math-size"),t.math._renderer=function(e){return this.src.renderToString(e,this.options)}.bind(e.context.option.katex),t.math.focusElement.addEventListener("keyup",this._renderMathExp.bind(t.math),!1),t.math.focusElement.addEventListener("change",this._renderMathExp.bind(t.math),!1),t.math.fontSizeElement.addEventListener("change",function(e){this.fontSize=e.target.value}.bind(t.math.previewElement.style),!1);let n=this.setController_MathButton.call(e);t.math.mathBtn=n,t.math._mathExp=null,n.addEventListener("mousedown",(function(e){e.stopPropagation()}),!1),i.querySelector(".se-btn-primary").addEventListener("click",this.submit.bind(e),!1),n.addEventListener("click",this.onClick_mathBtn.bind(e)),t.dialog.modal.appendChild(i),t.element.relative.appendChild(n),i=null,n=null},setDialog:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-dialog-content",t.style.display="none",t.innerHTML='
    '+e.dialogBox.mathBox.title+'

    ",t},setController_MathButton:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-link",t.innerHTML='
    ",t},open:function(){this.plugins.dialog.open.call(this,"math","math"===this.currentControllerName)},_renderMathExp:function(e){this.previewElement.innerHTML=this._renderer(e.target.value)},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();const t=function(){if(0===this.context.math.focusElement.value.trim().length)return!1;const e=this.context.math,t=e.focusElement.value,i=e.previewElement.querySelector(".katex");if(!i)return!1;if(i.setAttribute("contenteditable",!1),i.setAttribute("data-exp",t),i.setAttribute("data-font-size",e.fontSizeElement.value),i.style.fontSize=e.fontSizeElement.value,this.context.dialog.updateModal){const t=function(e,i){if(e.classList.contains(i))return e;const n=e.parentNode;return n!==document.body?n.classList.contains(i)?n:void t(n,i):void 0},n=t(e._mathExp,"katex");n.parentNode.replaceChild(i,n),this.setRange(i,0,i,1)}else{const e=this.getSelectedElements();if(e.length>1){const t=this.util.createElement(e[0].nodeName);t.appendChild(i),this.insertNode(t)}else this.insertNode(i);const t=this.util.createTextNode(this.util.zeroWidthSpace);i.parentNode.insertBefore(t,i.nextSibling),this.setRange(i,0,i,1)}return e.focusElement.value="",e.fontSizeElement.value="1em",e.previewElement.style.fontSize="1em",e.previewElement.innerHTML="",!0}.bind(this);try{t()&&(this.plugins.dialog.close.call(this),this.history.push(!1))}catch(e){this.plugins.dialog.close.call(this)}finally{this.closeLoading()}return!1},active:function(e){if(e){if(e.getAttribute("data-exp"))return this.controllerArray[0]!==this.context.math.mathBtn&&(this.setRange(e,0,e,1),this.plugins.math.call_controller_mathButton.call(this,e)),!0}else this.controllerArray[0]===this.context.math.mathBtn&&this.controllersOff();return!1},on:function(e){const t=this.context.math;if(t._mathExp&&e){const e=t._mathExp.getAttribute("data-exp"),i=t._mathExp.getAttribute("data-font-size")||"1em";this.context.dialog.updateModal=!0,t.focusElement.value=e,t.fontSizeElement.value=i,t.previewElement.innerHTML=t._renderer(e),t.previewElement.style.fontSize=i}},call_controller_mathButton:function(e){this.context.math._mathExp=e;const t=this.context.math.mathBtn,i=this.util.getOffset(e,this.context.element.wysiwygFrame);t.style.top=i.top+e.offsetHeight+10+"px",t.style.left=i.left-this.context.element.wysiwygFrame.scrollLeft+"px",t.style.display="block";const n=this.context.element.wysiwygFrame.offsetWidth-(t.offsetLeft+t.offsetWidth);n<0?(t.style.left=t.offsetLeft+n+"px",t.firstElementChild.style.left=20-n+"px"):t.firstElementChild.style.left="20px",this.controllersOn(t,this.plugins.math.init.bind(this),"math")},onClick_mathBtn:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")||e.target.parentNode.getAttribute("data-command");t&&(e.preventDefault(),/update/.test(t)?(this.context.math.focusElement.value=this.context.math._mathExp.getAttribute("data-exp"),this.plugins.dialog.open.call(this,"math",!0)):(this.util.removeItem(this.context.math._mathExp),this.context.math._mathExp=null,this.focus(),this.history.push(!1)),this.controllersOff())},init:function(){if(!/math/i.test(this.context.dialog.kind)){const e=this.context.math;e.mathBtn.style.display="none",e._mathExp=null,e.focusElement.value="",e.previewElement.innerHTML=""}}}},r=i("P6u4"),c=i.n(r);const d={_d:document,_w:window,_tagConvertor:function(e){const t={b:"strong",i:"em",u:"ins",strike:"del",s:"del"};return e.replace(/(<\/?)(b|strong|i|em|u|ins|s|strike|del)\b\s*(?:[^>^<]+)?\s*(?=>)/gi,(function(e,i,n){return i+("string"==typeof t[n]?t[n]:n)}))},_HTMLConvertor:function(e){const t={"&":"&"," ":" ","'":""","<":"<",">":">"};return e.replace(/&|\u00A0|'|<|>/g,(function(e){return"string"==typeof t[e]?t[e]:e}))},zeroWidthSpace:"​",zeroWidthRegExp:new RegExp(String.fromCharCode(8203),"g"),onlyZeroWidthRegExp:new RegExp("^"+String.fromCharCode(8203)+"+$"),onlyZeroWidthSpace:function(e){return"string"!=typeof e&&(e=e.textContent),""===e||this.onlyZeroWidthRegExp.test(e)},getXMLHttpRequest:function(){if(!this._w.ActiveXObject)return this._w.XMLHttpRequest?new XMLHttpRequest:null;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return null}}},createElement:function(e){return this._d.createElement(e)},createTextNode:function(e){return this._d.createTextNode(e||"")},getIncludePath:function(e,t){let i="";const n=[],l="js"===t?"script":"link",s="js"===t?"src":"href";let o="(?:";for(let t=0,i=e.length;t0?n[0][s]:""),-1===i.indexOf(":/")&&"//"!==i.slice(0,2)&&(i=0===i.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+i:location.href.match(/^[^\?]*\/(?:)/)[0]+i),!i)throw"[SUNEDITOR.util.getIncludePath.fail] The SUNEDITOR installation path could not be automatically detected. (name: +"+name+", extension: "+t+")";return i},getPageStyle:function(e){let t="";const i=(e?this.getIframeDocument(e):this._d).styleSheets;for(let e,n=0,l=i.length;n-1||(n+=i[e].name+'="'+i[e].value+'" ');return n},isWysiwygDiv:function(e){return!(!e||1!==e.nodeType||!this.hasClass(e,"se-wrapper-wysiwyg")&&!/^BODY$/i.test(e.nodeName))},isFormatElement:function(e){return!(!e||1!==e.nodeType||!/^(P|DIV|H[1-6]|PRE|LI)$/i.test(e.nodeName)&&!this.hasClass(e,"(\\s|^)__se__format__replace_.+(\\s|$)|(\\s|^)__se__format__free_.+(\\s|$)")||this.isComponent(e)||this.isWysiwygDiv(e))},isRangeFormatElement:function(e){return!(!e||1!==e.nodeType||!/^(BLOCKQUOTE|OL|UL|FIGCAPTION|TABLE|THEAD|TBODY|TR|TH|TD)$/i.test(e.nodeName)&&!this.hasClass(e,"(\\s|^)__se__format__range_.+(\\s|$)"))},isFreeFormatElement:function(e){return!(!e||1!==e.nodeType||!/^PRE$/i.test(e.nodeName)&&!this.hasClass(e,"(\\s|^)__se__format__free_.+(\\s|$)")||this.isComponent(e)||this.isWysiwygDiv(e))},isComponent:function(e){return e&&(/se-component/.test(e.className)||/^(TABLE|HR)$/.test(e.nodeName))},isMediaComponent:function(e){return e&&/se-component/.test(e.className)},getFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&e.firstElementChild,this.isFormatElement(e)&&t(e))return e;e=e.parentNode}return null},getRangeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&!/^(THEAD|TBODY|TR)$/i.test(e.nodeName)&&t(e))return e;e=e.parentNode}return null},getFreeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isFreeFormatElement(e)&&t(e))return e;e=e.parentNode}return null},copyTagAttributes:function(e,t){t.style.cssText&&(e.style.cssText+=t.style.cssText);const i=t.classList;for(let t=0,n=i.length;t0&&!this.isBreak(e);)e=e.firstChild;for(;t&&1===t.nodeType&&t.childNodes.length>0&&!this.isBreak(t);)t=t.lastChild;return{sc:e,ec:t||e}}},getOffset:function(e,t){let i=0,n=0,l=3===e.nodeType?e.parentElement:e;const s=this.getParentElement(e,this.isWysiwygDiv.bind(this));for(;l&&!this.hasClass(l,"se-container")&&l!==s;)i+=l.offsetLeft,n+=l.offsetTop,l=l.offsetParent;const o=t&&/iframe/i.test(t.nodeName);return{left:i+(o?t.parentElement.offsetLeft:0),top:n-s.scrollTop+(o?t.parentElement.offsetTop:0)}},getOverlapRangeAtIndex:function(e,t,i,n){if(e<=n?ti)return 0;const l=(e>i?e:i)-(t0?" ":"")+t)},removeClass:function(e,t){if(!e)return;const i=new this._w.RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(i," ").trim(),e.className.trim()||e.removeAttribute("class")},toggleClass:function(e,t){if(!e)return;const i=new this._w.RegExp("(\\s|^)"+t+"(\\s|$)");i.test(e.className)?e.className=e.className.replace(i," ").trim():e.className+=" "+t,e.className.trim()||e.removeAttribute("class")},removeItem:function(e){if(e)try{e.remove()}catch(t){e.parentNode.removeChild(e)}},removeItemAllParents:function(e,t,i){if(!e)return null;let n=null;return t||(t=function(e){if(e===i||this.isComponent(e))return!1;const t=e.textContent.trim();return 0===t.length||/^(\n|\u200B)+$/.test(t)}.bind(this)),function e(i){if(!d.isWysiwygDiv(i)){const l=i.parentNode;l&&t(i)&&(n={sc:i.previousElementSibling,ec:i.nextElementSibling},d.removeItem(i),e(l))}}(e),n},detachNestedList:function(e,t){const i=this.__deleteNestedList(e);let n,l,s;if(i){n=i.cloneNode(!1),l=i.childNodes;const t=this.getPositionIndex(e);for(;l[t];)n.appendChild(l[t])}else n=e;if(t)s=this.getListChildren(n,function(e){return this.isListCell(e)&&!e.previousElementSibling}.bind(this));else{const t=this.getElementDepth(e)+2;s=this.getListChildren(e,function(e){return this.isListCell(e)&&!e.previousElementSibling&&this.getElementDepth(e)===t}.bind(this))}for(let e=0,t=s.length;e=0){e.splitText(t);const i=this.getNodeFromPath([a+1],n);this.onlyZeroWidthSpace(i)&&(i.data=this.zeroWidthSpace)}}else 1===e.nodeType&&(e.previousSibling?e=e.previousSibling:this.getElementDepth(e)===i&&(r=!1));let c=e;for(;this.getElementDepth(c)>i;)for(a=this.getPositionIndex(c)+1,c=c.parentNode,o=l,l=c.cloneNode(!1),s=c.childNodes,o&&(this.isListCell(l)&&this.isList(o)&&o.firstElementChild&&(l.innerHTML=o.firstElementChild.innerHTML,d.removeItem(o.firstElementChild),o.children.length>0&&l.appendChild(o)),l.appendChild(o));s[a];)l.appendChild(s[a]);const u=c.parentNode;return r&&(c=c.nextSibling),l?(this.mergeSameTags(l,null,null,!1),this.mergeNestedTags(l,function(e){return this.isList(e)}.bind(this)),l.childNodes.length>0?u.insertBefore(l,c):l=c,0===n.childNodes.length&&this.removeItem(n),l):c},mergeSameTags:function(e,t,i,n){const l=this,s={a:0,b:0};return function e(o,a,r,c,d){const u=o.childNodes;for(let h,p,g=0,m=u.length;g0&&n++;const o=h.lastChild,u=p.firstChild;if(o&&u){const e=3===o.nodeType&&3===u.nodeType;let l=o.textContent.length,h=o.previousSibling;for(;h&&3===h.nodeType;)l+=h.textContent.length,h=h.previousSibling;n>0&&3===o.nodeType&&3===u.nodeType&&(o.textContent.length>0||u.textContent.length>0)&&n--,c&&t&&t[a]>g&&(a>0&&t[a-1]!==r?c=!1:(t[a]-=1,t[a+1]>=0&&t[a]===g&&(t[a+1]+=n,e&&o&&3===o.nodeType&&u&&3===u.nodeType&&(s.a+=l)))),d&&i&&i[a]>g&&(a>0&&i[a-1]!==r?d=!1:(i[a]-=1,i[a+1]>=0&&i[a]===g&&(i[a+1]+=n,e&&o&&3===o.nodeType&&u&&3===u.nodeType&&(s.b+=l))))}3===h.nodeType?h.textContent+=p.textContent:h.innerHTML+=p.innerHTML,l.removeItem(p),g--}else 1===h.nodeType&&e(h,a+1,g,c,d)}}(e,0,0,!0,!0),s},mergeNestedTags:function(e,t){"string"==typeof t?t=function(e){return this.test(e.tagName)}.bind(new this._w.RegExp("^("+(t||".+")+")$","i")):"function"!=typeof t&&(t=function(){return!0}),function e(i){let n=i.children;if(1===n.length&&n[0].nodeName===i.nodeName&&t(i)){const e=n[0];for(n=e.children;n[0];)i.appendChild(n[0]);i.removeChild(e)}for(let t=0,n=i.children.length;t")},sortByDepth:function(e,t){const i=t?1:-1,n=-1*i;e.sort(function(e,t){return this.isListCell(e)&&this.isListCell(t)?(e=this.getElementDepth(e))>(t=this.getElementDepth(t))?i:e'}return i}()+("auto"===e.height?"":"");l.allowFullscreen=!0,l.frameBorder=0,l.addEventListener("load",(function(){this.setAttribute("scrolling","auto"),this.contentDocument.head.innerHTML=''+t,this.contentDocument.body.className="sun-editor-editable",this.contentDocument.body.setAttribute("contenteditable",!0)}))}else l.setAttribute("contenteditable",!0),l.setAttribute("scrolling","auto"),l.className+=" sun-editor-editable";l.style.height=e.height,l.style.minHeight=e.minHeight,l.style.maxHeight=e.maxHeight;const s=document.createElement("TEXTAREA");s.className="se-wrapper-inner se-wrapper-code",s.style.display="none",s.style.height=e.height,s.style.minHeight=e.minHeight,s.style.maxHeight=e.maxHeight,"auto"===e.height&&(s.style.overflow="hidden");let o=null,a=null,r=null;if(e.resizingBar&&(o=document.createElement("DIV"),o.className="se-resizing-bar sun-editor-common",a=document.createElement("DIV"),a.className="se-navigation sun-editor-common",o.appendChild(a),e.charCounter)){const t=document.createElement("DIV");if(t.className="se-char-counter-wrapper",r=document.createElement("SPAN"),r.className="se-char-counter",r.textContent="0",t.appendChild(r),e.maxCharCount>0){const i=document.createElement("SPAN");i.textContent=" / "+e.maxCharCount,t.appendChild(i)}o.appendChild(t)}let c=null;return e.placeholder&&(c=document.createElement("SPAN"),c.className="se-placeholder",c.innerText=e.placeholder),{bottomBar:{resizingBar:o,navigation:a,charCounter:r},wysiwygFrame:l,codeView:s,placeholder:c}},_initOptions:function(e,t){t.lang=t.lang||c.a,t._defaultTagsWhitelist="string"==typeof t._defaultTagsWhitelist?t._defaultTagsWhitelist:"br|p|div|pre|blockquote|h[1-6]|ol|ul|li|hr|figure|figcaption|img|iframe|audio|video|table|thead|tbody|tr|th|td|a|b|strong|var|i|em|u|ins|s|span|strike|del|sub|sup",t._editorTagsWhitelist=t._defaultTagsWhitelist+("string"==typeof t.addTagsWhitelist&&t.addTagsWhitelist.length>0?"|"+t.addTagsWhitelist:""),t.pasteTagsWhitelist="string"==typeof t.pasteTagsWhitelist?t.pasteTagsWhitelist:t._editorTagsWhitelist,t.attributesWhitelist=t.attributesWhitelist&&"object"==typeof t.attributesWhitelist?t.attributesWhitelist:null,t.mode=t.mode||"classic",t.toolbarWidth=t.toolbarWidth?u.isNumber(t.toolbarWidth)?t.toolbarWidth+"px":t.toolbarWidth:"auto",t.stickyToolbar=/balloon/i.test(t.mode)?-1:void 0===t.stickyToolbar?0:/^\d+/.test(t.stickyToolbar)?u.getNumber(t.stickyToolbar,0):-1,t.iframe=t.fullPage||t.iframe,t.iframeCSSFileName=t.iframe?"string"==typeof t.iframeCSSFileName?[t.iframeCSSFileName]:t.iframeCSSFileName||["suneditor"]:null,t.codeMirror=t.codeMirror?t.codeMirror.src?t.codeMirror:{src:t.codeMirror}:null,t.display=t.display||("none"!==e.style.display&&e.style.display?e.style.display:"block"),t.popupDisplay=t.popupDisplay||"full",t.resizingBar=void 0===t.resizingBar?!/inline|balloon/i.test(t.mode):t.resizingBar,t.showPathLabel=!!t.resizingBar&&("boolean"!=typeof t.showPathLabel||t.showPathLabel),t.charCounter=t.maxCharCount>0||"boolean"==typeof t.charCounter&&t.charCounter,t.maxCharCount=u.isNumber(t.maxCharCount)&&t.maxCharCount>-1?1*t.maxCharCount:null,t.width=t.width?u.isNumber(t.width)?t.width+"px":t.width:e.clientWidth?e.clientWidth+"px":"100%",t.minWidth=(u.isNumber(t.minWidth)?t.minWidth+"px":t.minWidth)||"",t.maxWidth=(u.isNumber(t.maxWidth)?t.maxWidth+"px":t.maxWidth)||"",t.height=t.height?u.isNumber(t.height)?t.height+"px":t.height:e.clientHeight?e.clientHeight+"px":"auto",t.minHeight=(u.isNumber(t.minHeight)?t.minHeight+"px":t.minHeight)||"",t.maxHeight=(u.isNumber(t.maxHeight)?t.maxHeight+"px":t.maxHeight)||"",t.font=t.font?t.font:null,t.fontSize=t.fontSize?t.fontSize:null,t.formats=t.formats?t.formats:null,t.colorList=t.colorList?t.colorList:null,t.lineHeights=t.lineHeights?t.lineHeights:null,t.paragraphStyles=t.paragraphStyles?t.paragraphStyles:null,t.textStyles=t.textStyles?t.textStyles:null,t.fontSizeUnit="string"==typeof t.fontSizeUnit&&t.fontSizeUnit.trim()||"px",t.imageResizing=void 0===t.imageResizing||t.imageResizing,t.imageHeightShow=void 0===t.imageHeightShow||!!t.imageHeightShow,t.imageWidth=t.imageWidth?u.isNumber(t.imageWidth)?t.imageWidth+"px":t.imageWidth:"auto",t.imageSizeOnlyPercentage=!!t.imageSizeOnlyPercentage,t._imageSizeUnit=t.imageSizeOnlyPercentage?"%":"px",t.imageRotation=void 0!==t.imageRotation?t.imageRotation:!(t.imageSizeOnlyPercentage||!t.imageHeightShow),t.imageFileInput=void 0===t.imageFileInput||t.imageFileInput,t.imageUrlInput=void 0===t.imageUrlInput||!t.imageFileInput||t.imageUrlInput,t.imageUploadHeader=t.imageUploadHeader||null,t.imageUploadUrl=t.imageUploadUrl||null,t.imageUploadSizeLimit=/\d+/.test(t.imageUploadSizeLimit)?u.getNumber(t.imageUploadSizeLimit,0):null,t.videoResizing=void 0===t.videoResizing||t.videoResizing,t.videoHeightShow=void 0===t.videoHeightShow||!!t.videoHeightShow,t.videoRatioShow=void 0===t.videoRatioShow||!!t.videoRatioShow,t.videoWidth=t.videoWidth&&u.getNumber(t.videoWidth)?u.isNumber(t.videoWidth)?t.videoWidth+"px":t.videoWidth:"100%",t.videoSizeOnlyPercentage=!!t.videoSizeOnlyPercentage,t._videoSizeUnit=t.videoSizeOnlyPercentage?"%":"px",t.videoRotation=void 0!==t.videoRotation?t.videoRotation:!(t.videoSizeOnlyPercentage||!t.videoHeightShow),t.videoRatio=u.getNumber(t.videoRatio,4)||.5625,t.videoRatioList=t.videoRatioList?t.videoRatioList:null,t.youtubeQuery=(t.youtubeQuery||"").replace("?",""),t.callBackSave=t.callBackSave?t.callBackSave:null,t.templates=t.templates?t.templates:null,t.placeholder="string"==typeof t.placeholder?t.placeholder:null,t.katex=t.katex?t.katex.src?t.katex:{src:t.katex}:null,t.buttonList=t.buttonList||[["undo","redo"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],["outdent","indent"],["fullScreen","showBlocks","codeView"],["preview","print"]]},_defaultButtons:function(e){return{bold:["_se_command_bold",e.toolbar.bold+" (CTRL+B)","STRONG","",''],underline:["_se_command_underline",e.toolbar.underline+" (CTRL+U)","INS","",''],italic:["_se_command_italic",e.toolbar.italic+" (CTRL+I)","EM","",''],strike:["_se_command_strike",e.toolbar.strike+" (CTRL+SHIFT+S)","DEL","",''],subscript:["_se_command_subscript",e.toolbar.subscript,"SUB","",''],superscript:["_se_command_superscript",e.toolbar.superscript,"SUP","",''],removeFormat:["",e.toolbar.removeFormat,"removeFormat","",''],indent:["_se_command_indent",e.toolbar.indent+" (CTRL+])","indent","",''],outdent:["_se_command_outdent",e.toolbar.outdent+" (CTRL+[)","outdent","",'',!0],fullScreen:["code-view-enabled",e.toolbar.fullScreen,"fullScreen","",''],showBlocks:["",e.toolbar.showBlocks,"showBlocks","",''],codeView:["code-view-enabled",e.toolbar.codeView,"codeView","",''],undo:["_se_command_undo",e.toolbar.undo+" (CTRL+Z)","undo","",'',!0],redo:["_se_command_redo",e.toolbar.redo+" (CTRL+Y / CTRL+SHIFT+Z)","redo","",'',!0],preview:["",e.toolbar.preview,"preview","",''],print:["",e.toolbar.print,"print","",''],save:["_se_command_save",e.toolbar.save,"save","",'',!0],blockquote:["",e.toolbar.tag_blockquote,"blockquote","command",''],font:["se-btn-select se-btn-tool-font",e.toolbar.font,"font","submenu",''+e.toolbar.font+''],formatBlock:["se-btn-select se-btn-tool-format",e.toolbar.formats,"formatBlock","submenu",''+e.toolbar.formats+''],fontSize:["se-btn-select se-btn-tool-size",e.toolbar.fontSize,"fontSize","submenu",''+e.toolbar.fontSize+''],fontColor:["",e.toolbar.fontColor,"fontColor","submenu",''],hiliteColor:["",e.toolbar.hiliteColor,"hiliteColor","submenu",''],align:["se-btn-align",e.toolbar.align,"align","submenu",''],list:["",e.toolbar.list,"list","submenu",''],horizontalRule:["btn_line",e.toolbar.horizontalRule,"horizontalRule","submenu",''],table:["",e.toolbar.table,"table","submenu",''],lineHeight:["",e.toolbar.lineHeight,"lineHeight","submenu",''],template:["",e.toolbar.template,"template","submenu",''],paragraphStyle:["",e.toolbar.paragraphStyle,"paragraphStyle","submenu",''],textStyle:["",e.toolbar.textStyle,"textStyle","submenu",''],link:["",e.toolbar.link,"link","dialog",''],image:["",e.toolbar.image,"image","dialog",''],video:["",e.toolbar.video,"video","dialog",''],math:["",e.toolbar.math,"math","dialog",'']}},_createModuleGroup:function(e){const t=u.createElement("DIV");t.className="se-btn-module"+(e?"":" se-btn-module-border");const i=u.createElement("UL");return i.className="se-menu-list",t.appendChild(i),{div:t,ul:i}},_createButton:function(e,t,i,n,l,s){const o=u.createElement("LI"),a=u.createElement("BUTTON");return a.setAttribute("type","button"),a.setAttribute("class","se-btn"+(e?" "+e:"")+" se-tooltip"),a.setAttribute("data-command",i),a.setAttribute("data-display",n),l+=''+t+"",s&&a.setAttribute("disabled",!0),a.innerHTML=l,o.appendChild(a),{li:o,button:a}},_createToolBar:function(e,t,i,n){const l=e.createElement("DIV");l.className="se-toolbar-separator-vertical";const s=e.createElement("DIV");s.className="se-toolbar sun-editor-common";const o=this._defaultButtons(n),a={},r={};if(i){const e=i.length?i:Object.keys(i).map((function(e){return i[e]}));for(let t,i=0,n=e.length;i0){for(let e=0;e":i),this.history.push(!0)},_nativeFocus:function(){const t=r.getParentElement(this.getSelectionNode(),"figcaption");t?t.focus():e.element.wysiwyg.focus(),this._editorRange()},focus:function(){if("none"!==e.element.wysiwygFrame.style.display){if(l.iframe)this._nativeFocus();else try{const e=this.getRange();this.setRange(e.startContainer,e.startOffset,e.endContainer,e.endOffset)}catch(e){this._nativeFocus()}d._applyTagEffects(),c._isBalloon&&d._toggleToolbarBalloon()}},focusEdge:function(e){if(r.isComponent(e)){const t=e.querySelector("IMG"),i=e.querySelector("IFRAME");t?this.selectComponent(t,"image"):i&&this.selectComponent(i,"video")}else e=r.getChildElement(e,(function(e){return 0===e.childNodes.length||3===e.nodeType}),!0),this.setRange(e,e.textContent.length,e,e.textContent.length)},setRange:function(e,t,i,n){if(!e||!i)return;t>e.textContent.length&&(t=e.textContent.length),n>i.textContent.length&&(n=i.textContent.length);const l=this._wd.createRange();l.setStart(e,t),l.setEnd(i,n);const s=this.getSelection();s.removeAllRanges&&s.removeAllRanges(),s.addRange(l),this._editorRange()},removeRange:function(){this.getSelection().removeAllRanges();const e=this.commandMap;r.removeClass(e.STRONG,"active"),r.removeClass(e.INS,"active"),r.removeClass(e.EM,"active"),r.removeClass(e.DEL,"active"),r.removeClass(e.SUB,"active"),r.removeClass(e.SUP,"active"),e.OUTDENT&&e.OUTDENT.setAttribute("disabled",!0),e.INDENT&&e.INDENT.removeAttribute("disabled")},getRange:function(){return this._variable._range||this._createDefaultRange()},getSelection:function(){return this._ww.getSelection()},getSelectionNode:function(){return this._variable._selectionNode&&!r.isWysiwygDiv(this._variable._selectionNode)||this._editorRange(),this._variable._selectionNode||e.element.wysiwyg.firstChild},_editorRange:function(){const e=this.getSelection();let t=null,i=null;t=e.rangeCount>0?e.getRangeAt(0):this._createDefaultRange(),this._variable._range=t,i=t.collapsed?t.commonAncestorContainer:e.extentNode||e.anchorNode,this._variable._selectionNode=i},_createDefaultRange:function(){e.element.wysiwyg.focus();const t=this._wd.createRange();return e.element.wysiwyg.firstChild||this.execCommand("formatBlock",!1,"P"),t.setStart(e.element.wysiwyg.firstChild,0),t.setEnd(e.element.wysiwyg.firstChild,0),t},_resetRangeToTextNode:function(){const t=this.getRange();let i,n,l,s=t.startContainer,o=t.startOffset,a=t.endContainer,c=t.endOffset;if(i=r.isWysiwygDiv(s)?e.element.wysiwyg.firstChild:s,n=o,r.isBreak(i)||1===i.nodeType&&i.childNodes.length>0){const e=r.isBreak(i);if(!e){for(;i&&!r.isBreak(i)&&1===i.nodeType;)i=i.childNodes[n]||i.nextElementSibling||i.nextSibling,n=0;let e=r.getFormatElement(i);e===r.getRangeFormatElement(e)&&(e=r.createElement(r.isCell(i)?"DIV":"P"),i.parentNode.insertBefore(e,i),e.appendChild(i))}if(r.isBreak(i)){const t=r.createTextNode(r.zeroWidthSpace);i.parentNode.insertBefore(t,i),i=t,e&&(s===a&&(a=i,c=1),r.removeItem(s))}}if(s=i,o=n,i=r.isWysiwygDiv(a)?e.element.wysiwyg.lastChild:a,n=c,r.isBreak(i)||1===i.nodeType&&i.childNodes.length>0){const e=r.isBreak(i);if(!e){for(;i&&!r.isBreak(i)&&1===i.nodeType&&(l=i.childNodes,0!==l.length);)i=l[n>0?n-1:n]||!/FIGURE/i.test(l[0].nodeName)?l[0]:i.previousElementSibling||i.previousSibling||s,n=n>0?i.textContent.length:n;let e=r.getFormatElement(i);e===r.getRangeFormatElement(e)&&(e=r.createElement(r.isCell(e)?"DIV":"P"),i.parentNode.insertBefore(e,i),e.appendChild(i))}if(r.isBreak(i)){const t=r.createTextNode(r.zeroWidthSpace);i.parentNode.insertBefore(t,i),i=t,n=1,e&&r.removeItem(a)}}a=i,c=n,this.setRange(s,o,a,c)},getSelectedElements:function(t){this._resetRangeToTextNode();let i=this.getRange();if(r.isWysiwygDiv(i.startContainer)){const t=e.element.wysiwyg.children;if(0===t.length)return null;this.setRange(t[0],0,t[t.length-1],t[t.length-1].textContent.trim().length),i=this.getRange()}const n=i.startContainer,l=i.endContainer,s=i.commonAncestorContainer,o=r.getListChildren(s,(function(e){return t?t(e):r.isFormatElement(e)}));if(r.isWysiwygDiv(s)||r.isRangeFormatElement(s)||o.unshift(r.getFormatElement(s)),n===l||1===o.length)return o;let a=r.getFormatElement(n),c=r.getFormatElement(l),d=null,u=null;const h=function(e){return!r.isTable(e)||/^TABLE$/i.test(e.nodeName)};let p=r.getRangeFormatElement(a,h),g=r.getRangeFormatElement(c,h);r.isTable(p)&&r.isListCell(p.parentNode)&&(p=p.parentNode),r.isTable(g)&&r.isListCell(g.parentNode)&&(g=g.parentNode);const m=p===g;for(let e,t=0,i=o.length;t=0;i--)if(n[i].contains(n[e])){n.splice(e,1),e--,t--;break}return n},isEdgePoint:function(e,t){return 0===t||!e.nodeValue&&1===t||t===e.nodeValue.length},showLoading:function(){e.element.loading.style.display="block"},closeLoading:function(){e.element.loading.style.display="none"},appendFormatTag:function(e,t){const i=r.getFormatElement(this.getSelectionNode()),n=t?"string"==typeof t?t:t.nodeName:r.isFormatElement(i)?i.nodeName:"P",l=r.createElement(n);return l.innerHTML="
    ",(t&&"string"!=typeof t||!t&&r.isFormatElement(i))&&r.copyTagAttributes(l,t||i),r.isCell(e)?e.insertBefore(l,e.nextElementSibling):e.parentNode.insertBefore(l,e.nextElementSibling),l},insertComponent:function(e,t){const i=this.removeNode();let n=null,l=this.getSelectionNode(),s=r.getFormatElement(l);if(r.isListCell(s))if(/^HR$/i.test(e.nodeName)){const t=r.createElement("LI"),i=r.createTextNode(r.zeroWidthSpace);t.appendChild(e),t.appendChild(i),s.parentNode.insertBefore(t,s.nextElementSibling),this.setRange(i,1,i,1)}else this.insertNode(e,l===s?null:i.container.nextSibling),e.nextSibling||e.parentNode.appendChild(r.createElement("BR")),n=r.createElement("LI"),s.parentNode.insertBefore(n,s.nextElementSibling);else{if(this.getRange().collapsed&&(3===i.container.nodeType||r.isBreak(i.container))){const e=r.getParentElement(i.container,function(e){return this.isRangeFormatElement(e)}.bind(r));n=r.splitElement(i.container,i.offset,e?r.getElementDepth(e)+1:0),n&&(s=n.previousSibling)}this.insertNode(e,s),n||(n=this.appendFormatTag(e,r.isFormatElement(s)?s:null))}return this.setRange(n,0,n,0),t||this.history.push(!1),n},selectComponent:function(e,t){if("image"===t){if(!c.plugins.image)return;c.removeRange(),c.callPlugin("image",(function(){const t=c.plugins.resizing.call_controller_resize.call(c,e,"image");c.plugins.image.onModifyMode.call(c,e,t),r.getParentElement(e,".se-image-container")||(c.plugins.image.openModify.call(c,!0),c.plugins.image.update_image.call(c,!0,!0,!0))}))}else if("video"===t){if(!c.plugins.video)return;c.removeRange(),c.callPlugin("video",(function(){const t=c.plugins.resizing.call_controller_resize.call(c,e,"video");c.plugins.video.onModifyMode.call(c,e,t)}))}},insertNode:function(e,t){const i=this.getRange();let n=null,l=null;if(t)n=t.parentNode,t=t.nextSibling,l=!0;else{const e=i.startContainer,l=i.startOffset,s=i.endContainer,o=i.endOffset,a=i.commonAncestorContainer;if(n=e,3===e.nodeType&&(n=e.parentNode),i.collapsed)if(3===a.nodeType)t=a.textContent.length>o?a.splitText(o):a.nextSibling;else if(r.isBreak(n))t=n,n=n.parentNode;else{const e=n.childNodes[l];e?e.nextSibling?t=r.isBreak(e)?e:e.nextSibling:(n.removeChild(e),t=null):t=null}else{if(e===s){t=this.isEdgePoint(s,o)?s.nextSibling:s.splitText(o);let i=e;this.isEdgePoint(e,l)||(i=e.splitText(l)),n.removeChild(i)}else for(this.removeNode(),n=a,t=s;t.parentNode!==a;)t=t.parentNode}}try{if(r.isFormatElement(e)||r.isRangeFormatElement(e)||!r.isListCell(n)&&r.isComponent(e))if(r.isList(t))n=t,t=null;else if(!l&&!t){const e=this.removeNode(),i=3===e.container.nodeType?r.isListCell(r.getFormatElement(e.container))?e.container:r.getFormatElement(e.container)||e.container.parentNode:e.container;n=i.parentNode,t=i.nextSibling}n.insertBefore(e,t)}catch(t){n.appendChild(e)}finally{if(3===e.nodeType){const t=e.previousSibling,i=e.nextSibling,n=!t||3!==t.nodeType||r.onlyZeroWidthSpace(t)?"":t.textContent,l=!i||3!==i.nodeType||r.onlyZeroWidthSpace(i)?"":i.textContent;return t&&n.length>0&&(e.textContent=n+e.textContent,r.removeItem(t)),i&&i.length>0&&(e.textContent+=l,r.removeItem(i)),{startOffset:n.length,endOffset:e.textContent.length-l.length}}this.setRange(e,1,e,1),this.history.push(!0)}},removeNode:function(){const e=this.getRange();let t,i=0,n=e.startContainer,l=e.endContainer;const s=e.startOffset,o=e.endOffset,a=e.commonAncestorContainer;let c=null,d=null;const u=r.getListChildNodes(a);let h=r.getArrayIndex(u,n),p=r.getArrayIndex(u,l);if(u.length>0&&h>-1&&p>-1){for(let e=h+1,t=n;e>=0;e--)u[e]===t.parentNode&&u[e].firstChild===t&&0===s&&(h=e,t=t.parentNode);for(let e=p-1,t=l;e>h;e--)u[e]===t.parentNode&&1===u[e].nodeType&&(u.splice(e,1),t=t.parentNode,--p)}else{if(0===u.length)u.push(a),n=l=a;else if(n=l=u[0],r.isBreak(n))return{container:n,offset:0};h=p=0}function g(e){const t=r.getFormatElement(e);if(r.removeItem(e),r.isListCell(t)){const e=r.getArrayItem(t.children,r.isList,!1);if(e){const i=e.firstElementChild,n=i.childNodes;for(;n[0];)t.insertBefore(n[0],e);r.removeItemAllParents(i)}}}for(let e=h;e<=p;e++){const t=u[e];if(0===t.length||3===t.nodeType&&void 0===t.data)g(t);else if(t!==n)t!==l?g(t):(d=1===l.nodeType?r.createTextNode(l.textContent):r.createTextNode(l.substringData(o,l.length-o)),d.length>0?l.data=d.data:g(l));else if(1===n.nodeType?c=r.createTextNode(n.textContent):t===l?(c=r.createTextNode(n.substringData(0,s)+l.substringData(o,l.length-o)),i=s):c=r.createTextNode(n.substringData(0,s)),c.length>0?n.data=c.data:g(n),t===l)break}return t=l&&l.parentNode?l:n&&n.parentNode?n:e.endContainer||e.startContainer,this.setRange(t,i,t,i),this.history.push(!0),{container:t,offset:i}},applyRangeFormatElement:function(e){const t=this.getSelectedElementsAndComponents(!1);if(!t||0===t.length)return;e:for(let e,i,n,l,s,o,a=0,c=t.length;a-1&&(l=i.lastElementChild,t.indexOf(l)>-1)){let e=null;for(;e=l.lastElementChild;)if(r.isList(e)){if(!(t.indexOf(e.lastElementChild)>-1))continue e;l=e.lastElementChild}n=i.firstElementChild,s=t.indexOf(n),o=t.indexOf(l),t.splice(s,o-s+1),c=t.length}else;let i,n,l,s=t[t.length-1];i=r.isRangeFormatElement(s)||r.isFormatElement(s)?s:r.getRangeFormatElement(s)||r.getFormatElement(s),r.isCell(i)?(n=null,l=i):(n=i.nextSibling,l=i.parentNode);let o=r.getElementDepth(i),a=null;const c=[],d=function(e,t,i){let n=null;if(e!==t&&!r.isTable(t)){if(t&&r.getElementDepth(e)===r.getElementDepth(t))return i;n=r.removeItemAllParents(t,null,e)}return n?n.ec:i};for(let i,s,u,h,p,g,m,f=0,_=t.length;f<_;f++)if(i=t[f],s=i.parentNode,s&&!e.contains(s))if(u=r.getElementDepth(i),r.isList(s)){if(null===a&&(g?(a=g,m=!0,g=null):a=s.cloneNode(!1)),c.push(i),p=t[f+1],f===_-1||p&&p.parentNode!==s){p&&i.contains(p.parentNode)&&(g=p.parentNode.cloneNode(!1));let t,f=s.parentNode;for(;r.isList(f);)t=r.createElement(f.nodeName),t.appendChild(a),a=t,f=f.parentNode;const _=this.detachRangeFormatElement(s,c,null,!0,!0);o>=u?(o=u,l=_.cc,n=d(l,s,_.ec),n&&(l=n.parentNode)):l===_.cc&&(n=_.ec),l!==_.cc&&(h=d(l,_.cc,h),n=void 0!==h?h:_.cc);for(let e=0,t=_.removeArray.length;e=u&&(o=u,l=s,n=i.nextSibling),e.appendChild(i),l!==s&&(h=d(l,s),void 0!==h&&(n=h));if(this._lastEffectNode=null,r.mergeSameTags(e,null,null,!1),r.mergeNestedTags(e,function(e){return this.isList(e)}.bind(r)),n&&r.getElementDepth(n)>0&&(r.isList(n.parentNode)||r.isList(n.parentNode.parentNode))){const t=r.getParentElement(n,function(e){return this.isRangeFormatElement(e)&&!this.isList(e)}.bind(r)),i=r.splitElement(n,null,t?r.getElementDepth(t)+1:0);i.parentNode.insertBefore(e,i)}else l.insertBefore(e,n),d(e,n);const u=r.getEdgeChildNodes(e.firstElementChild,e.lastElementChild);t.length>1?this.setRange(u.sc,0,u.ec,u.ec.textContent.length):this.setRange(u.ec,u.ec.textContent.length,u.ec,u.ec.textContent.length),this.history.push(!1)},detachRangeFormatElement:function(e,t,i,n,l){const s=this.getRange(),o=s.startOffset,a=s.endOffset;let c=r.getListChildNodes(e,(function(t){return t.parentNode===e})),d=e.parentNode,u=null,h=null,p=e.cloneNode(!1);const g=[],m=r.isList(i);let f=!1,_=!1,b=!1;function y(t,i,n,l){if(r.onlyZeroWidthSpace(i)&&(i.innerHTML=r.zeroWidthSpace),3===i.nodeType)return t.insertBefore(i,n),i;const s=(b?i:l).childNodes;let o=i.cloneNode(!1),a=null,c=null;for(;s[0];)c=s[0],!r._notTextNode(c)||r.isBreak(c)||r.isListCell(o)?o.appendChild(c):(o.childNodes.length>0&&(a||(a=o),t.insertBefore(o,n),o=i.cloneNode(!1)),t.insertBefore(c,n),a||(a=c));if(o.childNodes.length>0){if(r.isListCell(t)&&r.isListCell(o)&&r.isList(n))if(m){for(a=n;n;)o.appendChild(n),n=n.nextSibling;t.parentNode.insertBefore(o,t.nextElementSibling)}else{const t=l.nextElementSibling,i=r.detachNestedList(l,!1);e===i&&t===l.nextElementSibling||(e=i,_=!0)}else t.insertBefore(o,n);a||(a=o)}return a}for(let l,s,o,a=0,v=c.length;a0&&(d.insertBefore(p,e),p=null),!m&&r.isListCell(l))if(r.getElementDepth(l)!==r.getElementDepth(o)&&(r.isListCell(d)||r.getArrayItem(l.children,r.isList,!1))){const t=l.nextElementSibling,i=r.detachNestedList(l,!1);e===i&&t===l.nextElementSibling||(e=i,_=!0)}else{const t=l;l=r.createElement(n?t.nodeName:r.isList(e.parentNode)||r.isListCell(e.parentNode)?"LI":r.isCell(e.parentNode)?"DIV":"P");const i=t.childNodes;for(;i[0];)l.appendChild(i[0]);r.copyFormatAttributes(l,t),b=!0}else l=l.cloneNode(!1);if(_){_=b=!1,c=r.getListChildNodes(e,(function(t){return t.parentNode===e})),p=e.cloneNode(!1),d=e.parentNode,a=-1,v=c.length;continue}n?(g.push(l),r.removeItem(c[a])):(i?(f||(d.insertBefore(i,e),f=!0),l=y(i,l,null,c[a])):l=y(d,l,e,c[a]),t?(h=l,u||(u=l)):u||(u=h=l))}const v=e.parentNode;let x=e.nextSibling;p&&p.children.length>0&&v.insertBefore(p,x),i?u=i.previousSibling:u||(u=e.previousSibling),x=e.nextSibling,r.removeItem(e);let C=null;if(n)C={cc:v,sc:u,ec:x,removeArray:g};else{const e=r.getEdgeChildNodes(u,h&&h.parentNode?h:u);C={cc:(e.sc||e.ec).parentNode,sc:e.sc,ec:e.ec}}if(this._lastEffectNode=null,l)return C;!n&&C&&(t?this.setRange(C.sc,o,C.ec,a):this.setRange(C.sc,0,C.sc,0)),this.history.push(!1)},detachList:function(e,t){let i={},n=!1,l=!1,s=null,o=null;const a=function(e){return!this.isComponent(e)}.bind(r);for(let c,d,u,h,p=0,g=e.length;p0)&&t,i=!!(i&&i.length>0)&&i;const s=!e,o=s&&!i&&!t;let c=l.startContainer,d=l.startOffset,u=l.endContainer,h=l.endOffset;if(o&&l.collapsed&&r.isFormatElement(c.parentNode)&&r.isFormatElement(u.parentNode)||c===u&&1===c.nodeType&&"false"===c.getAttribute("contenteditable"))return;if(l.collapsed&&!o&&1===c.nodeType&&!r.isBreak(c)){let e=null;const t=c.childNodes[d];t&&(t.nextSibling?e=r.isBreak(t)?t:t.nextSibling:(c.removeChild(t),e=null));const i=r.createTextNode(r.zeroWidthSpace);c.insertBefore(i,e),this.setRange(i,1,i,1),l=this.getRange(),c=l.startContainer,d=l.startOffset,u=l.endContainer,h=l.endOffset}r.isFormatElement(c)&&(c=c.childNodes[d],d=0),r.isFormatElement(u)&&(u=u.childNodes[h],h=u.textContent.length),s&&(e=r.createElement("DIV"));const p=e.nodeName;if(!o&&c===u&&!i&&e){let t=c,i=0;const n=[],l=e.style;for(let e=0,t=l.length;e0){for(;!r.isFormatElement(t)&&!r.isWysiwygDiv(t);){for(let l=0;l=n.length)return}}let g,m={},f={},_="",b="",y="";if(t){for(let e,i=0,n=t.length;i0&&(c=l.replace(_,"").trim(),c!==l&&(v.v=!0));const d=t.className;let u="";return b&&d.length>0&&(u=d.replace(b,"").trim(),u!==d&&(v.v=!0)),(!s||!b&&d||!_&&l||c||u||!i)&&(c||u||t.nodeName!==p||a.Boolean(_)!==a.Boolean(l)||a.Boolean(b)!==a.Boolean(d))?(_&&l.length>0&&(t.style.cssText=c),t.style.cssText||t.removeAttribute("style"),b&&d.length>0&&(t.className=u.trim()),t.className.trim()||t.removeAttribute("class"),t.style.cssText||t.className||t.nodeName!==p&&!i?t:(v.v=!0,null)):(v.v=!0,null)},C=this.getSelectedElements();r.getFormatElement(c)||(c=r.getChildElement(C[0],(function(e){return 3===e.nodeType})),d=0),r.getFormatElement(u)||(u=r.getChildElement(C[C.length-1],(function(e){return 3===e.nodeType})),h=u.textContent.length);const w=r.getFormatElement(c)===r.getFormatElement(u),N=C.length-(w?0:1);g=e.cloneNode(!1);const E=o||s&&function(e,t){for(let i=0,n=e.length;i0&&(g=e.cloneNode(!1),f=this._nodeChange_endLine(C[N],g,x,u,h,o,s,v,S,k));for(let t=N-1;t>0;t--)g=e.cloneNode(!1),this._nodeChange_middleLine(C[t],g,x,o,s,v);g=e.cloneNode(!1),m=this._nodeChange_startLine(C[0],g,x,c,d,o,s,v,S,k),N<=0&&(f=m)}this.controllersOff(),this.setRange(m.container,m.offset,f.container,f.offset),this.history.push(!1)},_stripRemoveNode:function(e){const t=e.parentNode;if(!e||3===e.nodeType||!t)return;const i=e.childNodes;for(;i[0];)t.insertBefore(i[0],e);t.removeChild(e)},_util_getMaintainedNode:function(e,t){return t&&!e?this.getParentElement(t,function(e){return this._isMaintainedNode(e)}.bind(this)):null},_util_isMaintainedNode:function(e,t){return t&&!e&&3!==t.nodeType&&this._isMaintainedNode(t)},_nodeChange_oneLine:function(e,t,i,n,l,s,o,c,d,u,h,p,g){let m=n.parentNode;for(;!(m.nextSibling||m.previousSibling||r.isFormatElement(m.parentNode)||r.isWysiwygDiv(m.parentNode))&&m.nodeName!==t.nodeName;)m=m.parentNode;if(!d&&m===s.parentNode&&m.nodeName===t.nodeName&&r.onlyZeroWidthSpace(n.textContent.slice(0,l))&&r.onlyZeroWidthSpace(s.textContent.slice(o))){const e=m.childNodes;let i=!0;for(let t,l,o,a,c=0,d=e.length;c0&&(i=t.test(e.style.cssText)),!i}if(function e(n,l){const s=n.childNodes;for(let n,o=0,a=s.length;o=S?T-S:E.data.length-S));if(N){const t=p(l);if(t&&t.parentNode!==e){let i=t,n=null;for(;i.parentNode!==e;){for(l=n=i.parentNode.cloneNode(!1);i.childNodes[0];)n.appendChild(i.childNodes[0]);i.appendChild(n),i=i.parentNode}i.parentNode.appendChild(t)}N=N.cloneNode(!1)}r.onlyZeroWidthSpace(s)||l.appendChild(s);const a=p(l);for(a&&(N=a),N&&(e=N),x=d,v=[],w="";x!==e&&x!==f&&null!==x;)n=g(x)?null:i(x),n&&1===x.nodeType&&A(x)&&(v.push(n),w+=x.style.cssText.substr(0,x.style.cssText.indexOf(":"))+"|"),x=x.parentNode;const c=v.pop()||o;for(C=x=c;v.length>0;)x=v.pop(),C.appendChild(x),C=x;if(t.appendChild(c),e.appendChild(t),N&&!p(k)&&(t=t.cloneNode(!1),b.appendChild(t),_.push(t)),E=o,S=0,z=!0,x!==o&&x.appendChild(E),!y)continue}if(L||d!==k){if(z){if(1===d.nodeType&&!r.isBreak(d)){r._isIgnoreNodeChange(d)?(b.appendChild(d),o--,a--,u||(t=t.cloneNode(!1),b.appendChild(t),_.push(t))):e(d,d);continue}x=d,v=[],w="";const s=[];for(;null!==x.parentNode&&x!==f&&x!==t;)n=L?x.cloneNode(!1):i(x),1===x.nodeType&&!r.isBreak(d)&&n&&A(x)&&(n&&(g(n)?N||s.push(n):v.push(n)),w+=x.style.cssText.substr(0,x.style.cssText.indexOf(":"))+"|"),x=x.parentNode;v=v.concat(s);const c=v.pop()||d;for(C=x=c;v.length>0;)x=v.pop(),C.appendChild(x),C=x;if(g(t.parentNode)&&!g(c)&&(t=t.cloneNode(!1),b.appendChild(t),_.push(t)),L||N||!g(c))c===d?l=L?b:t:L?(b.appendChild(c),l=x):(t.appendChild(c),l=x);else{t=t.cloneNode(!1);const e=c.childNodes;for(let i=0,n=e.length;i0?x:t}if(N&&3===d.nodeType)if(p(d)){const e=r.getParentElement(l,function(e){return this._isMaintainedNode(e.parentNode)||e.parentNode===b}.bind(r));N.appendChild(e),t=e.cloneNode(!1),_.push(t),b.appendChild(t)}else N=null}h=d.cloneNode(!1),l.appendChild(h),1!==d.nodeType||r.isBreak(d)||(m=h),e(d,m)}else{N=p(d);const e=r.createTextNode(1===k.nodeType?"":k.substringData(T,k.length-T)),l=r.createTextNode(y||1===k.nodeType?"":k.substringData(0,T));if(N?N=N.cloneNode(!1):g(t.parentNode)&&!N&&(t=t.cloneNode(!1),b.appendChild(t),_.push(t)),!r.onlyZeroWidthSpace(e)){x=d,w="",v=[];const t=[];for(;x!==b&&x!==f&&null!==x;)1===x.nodeType&&A(x)&&(g(x)?t.push(x.cloneNode(!1)):v.push(x.cloneNode(!1)),w+=x.style.cssText.substr(0,x.style.cssText.indexOf(":"))+"|"),x=x.parentNode;for(v=v.concat(t),h=C=x=v.pop()||e;v.length>0;)x=v.pop(),C.appendChild(x),C=x;b.appendChild(h),x.textContent=e.data}if(N&&h){const e=p(h);e&&(N=e)}for(x=d,v=[],w="";x!==b&&x!==f&&null!==x;)n=g(x)?null:i(x),n&&1===x.nodeType&&A(x)&&(v.push(n),w+=x.style.cssText.substr(0,x.style.cssText.indexOf(":"))+"|"),x=x.parentNode;const s=v.pop()||l;for(C=x=s;v.length>0;)x=v.pop(),C.appendChild(x),C=x;N?((t=t.cloneNode(!1)).appendChild(s),N.insertBefore(t,N.firstChild),b.appendChild(N),_.push(t),N=null):t.appendChild(s),k=l,T=l.data.length,L=!0,!c&&u&&(t=l,l.textContent=r.zeroWidthSpace),x!==l&&x.appendChild(k)}}}(e,b),d&&!c&&!h.v)return{startContainer:n,startOffset:l,endContainer:s,endOffset:o};if(c=c&&d)for(let e=0;e<_.length;e++){let t=_[e],i=r.createTextNode(r.zeroWidthSpace);if(u)b.replaceChild(i,t);else{const e=t.childNodes;for(;e[0];)i=e[0],b.insertBefore(i,t);r.removeItem(t)}0===e&&(E=k=i)}else{if(d)for(let e=0;e<_.length;e++)this._stripRemoveNode(_[e]);u&&(E=k=t)}r.removeEmptyNode(b,t),u&&(S=E.textContent.length,T=k.textContent.length);const B=c||0===k.textContent.length;0===k.textContent.length&&(r.removeItem(k),k=E),T=B?k.textContent.length:T;const I={s:0,e:0},R=r.getNodePath(E,b,I),D=!k.parentNode;D&&(k=E);const M={s:0,e:0},O=r.getNodePath(k,b,D||B?null:M);S+=I.s,T=u?S:D?E.textContent.length:B?T+I.s:T+M.s;const P=r.mergeSameTags(b,R,O,!0);return e.parentNode.replaceChild(b,e),E=r.getNodeFromPath(R,b),k=r.getNodeFromPath(O,b),{startContainer:E,startOffset:S+P.a,endContainer:k,endOffset:T+P.b}},_nodeChange_startLine:function(e,t,i,n,l,s,o,a,c,d){let u=n.parentNode;for(;!(u.nextSibling||u.previousSibling||r.isFormatElement(u.parentNode)||r.isWysiwygDiv(u.parentNode))&&u.nodeName!==t.nodeName;)u=u.parentNode;if(!o&&u.nodeName===t.nodeName&&!r.isFormatElement(u)&&!u.nextSibling&&r.onlyZeroWidthSpace(n.textContent.slice(0,l))){let e=!0,i=n.previousSibling;for(;i;){if(!r.onlyZeroWidthSpace(i)){e=!1;break}i=i.previousSibling}if(e)return r.copyTagAttributes(u,t),{container:n,offset:l}}a.v=!1;const h=e,p=[t],g=e.cloneNode(!1);let m,f,_,b,y=n,v=l,x=!1;if(function e(n,l){const s=n.childNodes;for(let n,o=0,a=s.length;o0,v=m.pop()||u;for(_=f=v;m.length>0;)f=m.pop(),_.appendChild(f),_=f;if(d(t.parentNode)&&!d(v)&&(t=t.cloneNode(!1),g.appendChild(t),p.push(t)),!b&&d(v)){t=t.cloneNode(!1);const e=v.childNodes;for(let i=0,n=e.length;i0;)f=m.pop(),_.appendChild(f),_=f;d!==l?(t.appendChild(d),l=f):l=t,r.isBreak(u)&&t.appendChild(u.cloneNode(!1)),e.appendChild(t),y=o,v=0,x=!0,l.appendChild(y)}}}(e,g),o&&!s&&!a.v)return{container:n,offset:l};if(s=s&&o)for(let e=0;e0&&c===d)return void(e.innerHTML=i.innerHTML)}s.v=!1;const o=e.cloneNode(!1),a=[t];let c=!0;if(function e(n,l){const s=n.childNodes;for(let n,d=0,u=s.length;d0&&(o.appendChild(t),t=t.cloneNode(!1)),o.appendChild(h),o.appendChild(t),a.push(t),l=t,d--,u--)}}(e,t),!c&&(!l||n||s.v)){if(o.appendChild(t),n&&l)for(let e=0;e0,y=m.pop()||a;for(_=f=y;m.length>0;)f=m.pop(),_.appendChild(f),_=f;if(d(t.parentNode)&&!d(y)&&(t=t.cloneNode(!1),g.insertBefore(t,g.firstChild),p.push(t)),!b&&d(y)){t=t.cloneNode(!1);const e=y.childNodes;for(let i=0,n=e.length;i0?f:t}else u?(t.insertBefore(y,t.firstChild),l=f):l=t;if(b&&3===a.nodeType)if(c(a)){const e=r.getParentElement(l,function(e){return this._isMaintainedNode(e.parentNode)||e.parentNode===g}.bind(r));b.appendChild(e),t=e.cloneNode(!1),p.push(t),g.insertBefore(t,g.firstChild)}else b=null}if(x||a!==y)n=x?i(a):a.cloneNode(!1),n&&(l.insertBefore(n,l.firstChild),1!==a.nodeType||r.isBreak(a)||(u=n)),e(a,u);else{b=c(a);const e=r.createTextNode(1===y.nodeType?"":y.substringData(v,y.length-v)),s=r.createTextNode(1===y.nodeType?"":y.substringData(0,v));if(b){b=b.cloneNode(!1);const e=c(l);if(e&&e.parentNode!==g){let t=e,i=null;for(;t.parentNode!==g;){for(l=i=t.parentNode.cloneNode(!1);t.childNodes[0];)i.appendChild(t.childNodes[0]);t.appendChild(i),t=t.parentNode}t.parentNode.insertBefore(e,t.parentNode.firstChild)}b=b.cloneNode(!1)}else d(t.parentNode)&&!b&&(t=t.cloneNode(!1),g.appendChild(t),p.push(t));for(r.onlyZeroWidthSpace(e)||l.insertBefore(e,l.firstChild),f=l,m=[];f!==g&&null!==f;)n=d(f)?null:i(f),n&&1===f.nodeType&&m.push(n),f=f.parentNode;const o=m.pop()||l;for(_=f=o;m.length>0;)f=m.pop(),_.appendChild(f),_=f;o!==l?(t.insertBefore(o,t.firstChild),l=f):l=t,r.isBreak(a)&&t.appendChild(a.cloneNode(!1)),b?(b.insertBefore(t,b.firstChild),g.insertBefore(b,g.firstChild),b=null):g.insertBefore(t,g.firstChild),y=s,v=s.data.length,x=!0,l.insertBefore(y,l.firstChild)}}}(e,g),o&&!s&&!a.v)return{container:n,offset:l};if(s=s&&o)for(let e=0;e0&&this.plugins.list.editInsideList.call(this,l,n),this._lastEffectNode=null,this.setRange(s,a,o,c),this.history.push(!1)},toggleDisplayBlocks:function(){r.toggleClass(e.element.wysiwyg,"se-show-block"),this._resourcesStateChange()},toggleCodeView:function(){const t=this._variable.isCodeView,i=this.codeViewDisabledButtons;for(let e=0,n=i.length;e0?e.element.code.scrollHeight+"px":"auto"),l.codeMirrorEditor&&l.codeMirrorEditor.refresh(),this._variable.isCodeView=!0,this._variable.isFullScreen||(this._notHideToolbar=!0,this._isBalloon&&(e.element._arrow.style.display="none",e.element.toolbar.style.left="",this._isInline=!0,this._isBalloon=!1,d._showToolbarInline())),this._variable._range=null,e.element.code.focus()),this._checkPlaceholder()},_setCodeDataToEditor:function(){const t=this._getCodeView();if(l.fullPage){const e=(new this._w.DOMParser).parseFromString(t,"text/html"),i=e.head.children;for(let t=0,n=i.length;t0?this.convertContentsForEditor(t):"


    "},_setEditorDataToCodeView:function(){const t=this.convertHTMLForCodeView(e.element.wysiwyg);let i="";if(l.fullPage){const e=r.getAttributesToString(this._wd.body,null);i="\n\n"+this._wd.head.outerHTML.replace(/>(?!\n)/g,">\n")+"\n"+t+"\n"}else i=t;e.element.code.style.display="block",e.element.wysiwygFrame.style.display="none",this._setCodeView(i)},toggleFullScreen:function(t){const i=e.element.topArea,n=e.element.toolbar,o=e.element.editorArea,c=e.element.wysiwygFrame,u=e.element.code,h=this._variable;h.isFullScreen?(h.isFullScreen=!1,c.style.cssText=h._wysiwygOriginCssText,u.style.cssText=h._codeOriginCssText,n.style.cssText="",o.style.cssText=h._editorAreaOriginCssText,i.style.cssText=h._originCssText,s.body.style.overflow=h._bodyOverflow,l.stickyToolbar>-1&&r.removeClass(n,"se-toolbar-sticky"),h._fullScreenAttrs.sticky&&(h._fullScreenAttrs.sticky=!1,e.element._stickyDummy.style.display="block",r.addClass(n,"se-toolbar-sticky")),this._isInline=h._fullScreenAttrs.inline,this._isBalloon=h._fullScreenAttrs.balloon,this._isInline&&d._showToolbarInline(),d.onScroll_window(),r.removeClass(t.firstElementChild,"se-icon-reduction"),r.addClass(t.firstElementChild,"se-icon-expansion")):(h.isFullScreen=!0,h._fullScreenAttrs.inline=this._isInline,h._fullScreenAttrs.balloon=this._isBalloon,(this._isInline||this._isBalloon)&&(this._isInline=!1,this._isBalloon=!1),i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.width="100%",i.style.height="100%",i.style.zIndex="2147483647",""!==e.element._stickyDummy.style.display&&(h._fullScreenAttrs.sticky=!0,e.element._stickyDummy.style.display="none",r.removeClass(n,"se-toolbar-sticky")),h._bodyOverflow=s.body.style.overflow,s.body.style.overflow="hidden",h._editorAreaOriginCssText=o.style.cssText,h._wysiwygOriginCssText=c.style.cssText,h._codeOriginCssText=u.style.cssText,o.style.cssText=n.style.cssText="",c.style.cssText=(c.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0],u.style.cssText=(u.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0],n.style.width=c.style.height=u.style.height="100%",n.style.position="relative",n.style.display="block",h.innerHeight_fullScreen=a.innerHeight-n.offsetHeight,o.style.height=h.innerHeight_fullScreen+"px",r.removeClass(t.firstElementChild,"se-icon-expansion"),r.addClass(t.firstElementChild,"se-icon-reduction"),l.iframe&&"auto"===l.height&&(o.style.overflow="auto",this._iframeAutoHeight()))},print:function(){const t=r.createElement("IFRAME");t.style.display="none",s.body.appendChild(t);const i=r.getIframeDocument(t),n=this.getContents(!0);if(l.iframe){const t=r.getIframeDocument(e.element.wysiwygFrame),s=l.fullPage?r.getAttributesToString(t.body,["contenteditable"]):'class="sun-editor-editable"';i.write(""+t.head.innerHTML+""+n+"")}else{const e=r.createElement("DIV"),t=r.createElement("STYLE");t.innerHTML=r.getPageStyle(),e.className="sun-editor-editable",e.innerHTML=n,i.head.appendChild(t),i.body.appendChild(e)}try{if(t.focus(),-1!==a.navigator.userAgent.indexOf("MSIE")||s.documentMode||a.StyleMedia)try{t.contentWindow.document.execCommand("print",!1,null)}catch(e){t.contentWindow.print()}else t.contentWindow.print()}catch(e){throw Error("[SUNEDITOR.core.print.fail] error: "+e)}finally{r.removeItem(t)}},preview:function(){const t=this.getContents(!0),i=a.open("","_blank");if(i.mimeType="text/html",l.iframe){const n=r.getIframeDocument(e.element.wysiwygFrame),s=l.fullPage?r.getAttributesToString(n.body,["contenteditable"]):'class="sun-editor-editable"';i.document.write(""+n.head.innerHTML+""+t+"")}else i.document.write(''+n.toolbar.preview+"'+t+"")},setContents:function(t){const i=this.convertContentsForEditor(t);if(this._resetComponents(),c._variable.isCodeView){const e=this.convertHTMLForCodeView(i);c._setCodeView(e)}else e.element.wysiwyg.innerHTML=i,c.history.push(!1)},getContents:function(t){const i=e.element.wysiwyg.innerHTML,n=r.createElement("DIV");n.innerHTML=i;const s=r.getListChildren(n,(function(e){return/FIGCAPTION/i.test(e.nodeName)}));for(let e=0,t=s.length;e"+this._wd.head.outerHTML+""+n.innerHTML+""}return n.innerHTML},cleanHTML:function(e,t){const i=new this._w.RegExp("^(meta|script|link|style|[a-z]+:[a-z]+)$","i"),n=this._d.createRange().createContextualFragment(e).childNodes;let l="";for(let e=0,t=n.length;e(\n|.)*<\/(script|style)>/g,"").replace(/(<[a-zA-Z0-9]+)[^>]*(?=>)/g,function(e,t){let i=null;const n=this._attributesTagsWhitelist[t.match(/(?!<)[a-zA-Z]+/)[0].toLowerCase()];if(i=n?e.match(n):e.match(this._attributesWhitelistRegExp),i)for(let e=0,n=i.length;e^<]*)>/g,""),r._tagConvertor(l?t?l.replace("string"==typeof t?r.createTagsWhitelist(t):t,""):l:e)},addDocEvent:function(e,t,i){s.addEventListener(e,t,i),l.iframe&&this._wd.addEventListener(e,t)},removeDocEvent:function(e,t){s.removeEventListener(e,t),l.iframe&&this._wd.removeEventListener(e,t)},convertContentsForEditor:function(e){let t="",i=this._d.createRange().createContextualFragment(e).childNodes;for(let e,n=0,l=i.length;n0&&(t+="

    "+n+"

    ")}else t+=e.replace(/<(?!span|font|b|strong|var|i|em|u|ins|s|strike|del|sub|sup|mark|a|label)[^>^<]+>\s+(?=<)/g,(function(e){return e.trim()}));return 0===t.length&&(t="

    "+((e=r._HTMLConvertor(e)).length>0?e:"
    ")+"

    "),r._tagConvertor(t.replace(this.editorTagsWhitelistRegExp,""))},convertHTMLForCodeView:function(e){let t="";const i=this._w.RegExp,n=new i("^(BLOCKQUOTE|PRE|TABLE|THEAD|TBODY|TR|TH|TD|OL|UL|IMG|IFRAME|VIDEO|AUDIO|FIGURE|FIGCAPTION|HR|BR|CANVAS|SELECT)$","i"),l=r.isFormatElement.bind(r),s="string"==typeof e?this._d.createRange().createContextualFragment(e):e;let o=1*this._variable.codeIndent;return o=o>0?new this._w.Array(o+1).join(" "):"",function e(s,a,c){const d=s.childNodes,u=n.test(s.nodeName),h=u?a:"";for(let p,g,m,f=0,_=d.length;f<_;f++){if(p=d[f],m=n.test(p.nodeName),g=m?"\n":"",c=!l(p)||u||/^(TH|TD)$/i.test(s.nodeName)?"":"\n",3===p.nodeType){t+=r._HTMLConvertor(/^\n+$/.test(p.data)?"":p.data);continue}if(0===p.childNodes.length){t+=(/^(HR)$/i.test(p.nodeName)?"\n":"")+h+p.outerHTML+g;continue}p.innerHTML=p.innerHTML;const _=p.nodeName.toLowerCase();t+=(c||(u?"":g))+(h||m?a:"")+p.outerHTML.match(i("<"+_+"[^>]*>","i"))[0]+g,e(p,a+o,""),t+=(m?a:"")+""+(c||g||u?"\n":/^(TH|TD)$/i.test(p.nodeName)?"\n":"")}}(s,"","\n"),t.trim()+"\n"},_charCount:function(t,i){const n=e.element.charCounter;if(!n)return!0;(!t||t<0)&&(t=0);const s=l.maxCharCount;if(a.setTimeout((function(){n.textContent=e.element.wysiwyg.textContent.length})),s>0){let l=!1;const o=e.element.wysiwyg.textContent.length;if(o>s){c._editorRange();const e=c.getRange(),t=e.endOffset-1,i=c.getSelectionNode().textContent;c.getSelectionNode().textContent=i.slice(0,e.endOffset-1)+i.slice(e.endOffset,i.length),c.setRange(e.endContainer,t,e.endContainer,t),l=!0}else o+t>s&&(l=!0);if(l)return i&&!r.hasClass(n,"se-blink")&&(r.addClass(n,"se-blink"),a.setTimeout((function(){r.removeClass(n,"se-blink")}),600)),!1}return!0},_checkComponents:function(){this.plugins.image&&(this.initPlugins.image?this.plugins.image.checkImagesInfo.call(this):this.callPlugin("image",this.plugins.image.checkImagesInfo.bind(this))),this.plugins.video&&(this.initPlugins.video?this.plugins.video.checkVideosInfo.call(this):this.callPlugin("video",this.plugins.video.checkVideosInfo.bind(this)))},_resetComponents:function(){this._variable._imagesInfo=[],this._variable._imageIndex=0,this._variable._videosCnt=0},_setCodeView:function(t){l.codeMirrorEditor?l.codeMirrorEditor.getDoc().setValue(t):e.element.code.value=t},_getCodeView:function(){return l.codeMirrorEditor?l.codeMirrorEditor.getDoc().getValue():e.element.code.value},_init:function(n,o){this._ww=l.iframe?e.element.wysiwygFrame.contentWindow:a,this._wd=s,a.setTimeout(function(){if(this._checkComponents(),this._imagesInfoInit=!1,this._imagesInfoReset=!1,this.history.reset(!0),l.iframe&&(this._wd=e.element.wysiwygFrame.contentDocument,e.element.wysiwyg=this._wd.body,"auto"===l.height&&(this._iframeAuto=this._wd.body),this._iframeAutoHeight()),"function"==typeof g.onload)return g.onload(c,n)}.bind(this)),this.editorTagsWhitelistRegExp=r.createTagsWhitelist(l._editorTagsWhitelist),this.pasteTagsWhitelistRegExp=r.createTagsWhitelist(l.pasteTagsWhitelist);const u=l.attributesWhitelist,h={};let p,m,f="";if(u){const e=a.Object.keys(u);for(let t,i=0,n=e.length;ir&&(c=c.slice(0,r),o&&o.setAttribute("disabled",!0)),c[r]={contents:i,s:{path:l.getNodePath(n.startContainer,null),offset:n.startOffset},e:{path:l.getNodePath(n.endContainer,null),offset:n.endOffset}},1===r&&s&&s.removeAttribute("disabled"),e._checkComponents(),e._charCount(0,!1),t()}return{stack:c,push:function(t){i.setTimeout(e._resourcesStateChange),t&&!a||(i.clearTimeout(a),t)?a=i.setTimeout((function(){i.clearTimeout(a),a=null,u()}),350):u()},undo:function(){r>0&&(r--,d())},redo:function(){c.length-1>r&&(r++,d())},go:function(e){r=e<0?c.length-1:e,d()},reset:function(i){s&&s.setAttribute("disabled",!0),o&&o.setAttribute("disabled",!0),e.context.tool.save&&e.context.tool.save.setAttribute("disabled",!0),c.splice(0),r=0,c[r]={contents:e.getContents(!0),s:{path:[0,0],offset:0},e:{path:[0,0],offset:0}},i||t()},_destroy:function(){a&&i.clearTimeout(a),c=null}}}(this,d._onChange_historyStack)},_resourcesStateChange:function(){c._iframeAutoHeight(),c._checkPlaceholder()},_iframeAutoHeight:function(){this._iframeAuto&&(e.element.wysiwygFrame.style.height=this._iframeAuto.offsetHeight+"px")},_checkPlaceholder:function(){if(this._placeholder){if(this._variable.isCodeView)return void(this._placeholder.style.display="none");const t=e.element.wysiwyg;!r.onlyZeroWidthSpace(t.textContent)||t.querySelector(".se-component, pre, blockquote, hr, li, table, img, iframe, video")||(t.innerText.match(/\n/g)||"").length>1?this._placeholder.style.display="none":this._placeholder.style.display="block"}}},d={_directionKeyCode:new a.RegExp("^(8|13|3[2-9]|40|46)$"),_nonTextKeyCode:new a.RegExp("^(8|13|1[6-9]|20|27|3[3-9]|40|45|46|11[2-9]|12[0-3]|144|145)$"),_historyIgnoreKeyCode:new a.RegExp("^(1[6-9]|20|27|3[3-9]|40|45|11[2-9]|12[0-3]|144|145)$"),_onButtonsCheck:new a.RegExp("^(STRONG|INS|EM|DEL|SUB|SUP)$"),_frontZeroWidthReg:new a.RegExp(r.zeroWidthSpace+"+",""),_keyCodeShortcut:{65:"A",66:"B",83:"S",85:"U",73:"I",89:"Y",90:"Z",219:"[",221:"]"},_shortcutCommand:function(e,t){let i=null;switch(d._keyCodeShortcut[e]){case"A":i="selectAll";break;case"B":i="STRONG";break;case"S":t&&(i="DEL");break;case"U":i="INS";break;case"I":i="EM";break;case"Z":i=t?"redo":"undo";break;case"Y":i="redo";break;case"[":i="outdent";break;case"]":i="indent"}return!!i&&(c.commandHandler(c.commandMap[i],i),!0)},_applyTagEffects:function(){let t=c.getSelectionNode();if(t===c._lastEffectNode)return;c._lastEffectNode=t;const n=c.commandMap,s=this._onButtonsCheck,o=[],a=[],d=c.activePlugins,u=d.length;let h="";for(;t.firstChild;)t=t.firstChild;for(let e=t;!r.isWysiwygDiv(e)&&e;e=e.parentNode)if(1===e.nodeType&&!r.isBreak(e)){h=e.nodeName.toUpperCase(),a.push(h);for(let t,n=0;n0)&&(o.push("OUTDENT"),n.OUTDENT.removeAttribute("disabled")),-1===o.indexOf("INDENT")&&n.INDENT&&r.isListCell(e)&&!e.previousElementSibling&&(o.push("INDENT"),n.INDENT.setAttribute("disabled",!0))):s.test(h)&&(o.push(h),r.addClass(n[h],"active"))}for(let e in n)o.indexOf(e)>-1||(d.indexOf(e)>-1?i[e].active.call(c,null):n.OUTDENT&&/^OUTDENT$/i.test(e)?n.OUTDENT.setAttribute("disabled",!0):n.INDENT&&/^INDENT$/i.test(e)?n.INDENT.removeAttribute("disabled"):r.removeClass(n[e],"active"));c._variable.currentNodes=a.reverse(),l.showPathLabel&&(e.element.navigation.textContent=c._variable.currentNodes.join(" > "))},_cancelCaptionEdit:function(){this.setAttribute("contenteditable",!1),this.removeEventListener("blur",d._cancelCaptionEdit)},onMouseDown_toolbar:function(e){let t=e.target;if(r.getParentElement(t,".se-submenu"))e.stopPropagation(),c._notHideToolbar=!0;else{e.preventDefault();let i=t.getAttribute("data-command"),n=t.className;for(;!i&&!/se-menu-list/.test(n)&&!/se-toolbar/.test(n);)t=t.parentNode,i=t.getAttribute("data-command"),n=t.className;i!==c._submenuName&&i!==c._containerName||e.stopPropagation()}},onClick_toolbar:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,i=t.getAttribute("data-display"),n=t.getAttribute("data-command"),l=t.className;for(;!n&&!/se-menu-list/.test(l)&&!/se-toolbar/.test(l);)t=t.parentNode,n=t.getAttribute("data-command"),i=t.getAttribute("data-display"),l=t.className;(n||i)&&(t.disabled||(c.hasFocus||c.focus(),c._editorRange(),c.actionCall(n,i,t)))},onMouseDown_wysiwyg:function(t){if("false"===e.element.wysiwyg.getAttribute("contenteditable"))return;const i=r.getParentElement(t.target,r.isCell);if(i){const e=c.plugins.table;e&&i!==e._fixedCell&&!e._shift&&c.callPlugin("table",(function(){e.onTableCellMultiSelect.call(c,i,!1)}))}c._isBalloon&&d._hideToolbar(),g.onMouseDown&&g.onMouseDown(t,c)},onClick_wysiwyg:function(t){const i=t.target;if("false"===e.element.wysiwyg.getAttribute("contenteditable"))return;if(t.stopPropagation(),/^FIGURE$/i.test(i.nodeName)){const e=i.querySelector("IMG"),n=i.querySelector("IFRAME");if(e)return t.preventDefault(),void c.selectComponent(e,"image");if(n)return t.preventDefault(),void c.selectComponent(n,"video")}const n=r.getParentElement(i,"FIGCAPTION");if(n&&(!n.getAttribute("contenteditable")||"false"===n.getAttribute("contenteditable"))&&(t.preventDefault(),n.setAttribute("contenteditable",!0),n.focus(),c._isInline&&!c._inlineToolbarAttr.isShow)){d._showToolbarInline();const e=function(){d._hideToolbar(),n.removeEventListener("blur",e)};n.addEventListener("blur",e)}c._editorRange(),a.setTimeout(c._editorRange.bind(c));const l=c.getSelectionNode(),s=r.getFormatElement(l),o=r.getRangeFormatElement(l);if(!c.getRange().collapsed||s&&s!==o||"false"===i.getAttribute("contenteditable"))d._applyTagEffects();else{if(r.isList(o)){const e=r.createElement("LI"),t=l.nextElementSibling;e.appendChild(l),o.insertBefore(e,t)}else c.execCommand("formatBlock",!1,r.isRangeFormatElement(o)?"DIV":"P");t.preventDefault(),c.focus()}c._isBalloon&&a.setTimeout(d._toggleToolbarBalloon),g.onClick&&g.onClick(t,c)},_balloonDelay:null,_showToolbarBalloonDelay:function(){d._balloonDelay&&a.clearTimeout(d._balloonDelay),d._balloonDelay=a.setTimeout(function(){a.clearTimeout(this._balloonDelay),this._balloonDelay=null,this._showToolbarBalloon()}.bind(d),350)},_toggleToolbarBalloon:function(){c._editorRange();const e=c.getRange();"table"===c.currentControllerName||!c._isBalloonAlways&&e.collapsed?d._hideToolbar():d._showToolbarBalloon(e)},_showToolbarBalloon:function(t){if(!c._isBalloon)return;const i=t||c.getRange(),n=e.element.toolbar,l=c.getSelection();let s;if(l.focusNode===l.anchorNode)s=l.focusOffsetn.offsetWidth?n.offsetWidth-u:b",!o.nextElementSibling){const e=o.attributes;for(;e[0];)o.removeAttribute(e[0].name);c.execCommand("formatBlock",!1,"P")}return!1}}const i=u.commonAncestorContainer;if(m=r.getFormatElement(u.startContainer),f=r.getRangeFormatElement(m),f&&m&&!r.isCell(f)&&!/^FIGCAPTION$/i.test(f.nodeName)){if(r.isListCell(m)&&r.isList(f)&&(r.isListCell(f.parentNode)||m.previousElementSibling)&&(o===m||3===o.nodeType&&(!o.previousSibling||r.isList(o.previousSibling)))&&(r.getFormatElement(u.startContainer)!==r.getFormatElement(u.endContainer)?f.contains(u.startContainer):0===u.startOffset&&u.collapsed)){if(u.startContainer!==u.endContainer)t.preventDefault(),c.removeNode(),3===u.startContainer.nodeType&&c.setRange(u.startContainer,u.startContainer.textContent.length,u.startContainer,u.startContainer.textContent.length),c.history.push(!0);else{let e=m.previousElementSibling||f.parentNode;if(r.isListCell(e)){t.preventDefault();const i=e.lastElementChild;r.isList(i)&&(e=i.lastElementChild);let n=e===f.parentNode?f.previousSibling:e.lastChild;n||(n=r.createTextNode(r.zeroWidthSpace),f.parentNode.insertBefore(n,f.parentNode.firstChild));const l=3===n.nodeType?n.textContent.length:1,s=m.childNodes;let o=n,a=s[0];for(;a=s[0];)e.insertBefore(a,o.nextSibling),o=a;r.removeItem(m),0===f.children.length&&r.removeItem(f),c.setRange(n,l,n,l),c.history.push(!0)}}break}if(!h&&0===u.startOffset){let e=!0,n=i;for(;n&&n!==f&&!r.isWysiwygDiv(n);){if(n.previousSibling&&(1===n.previousSibling.nodeType||!r.onlyZeroWidthSpace(n.previousSibling.textContent.trim()))){e=!1;break}n=n.parentNode}if(e&&f.parentNode){t.preventDefault(),c.detachRangeFormatElement(f,r.isListCell(m)?[m]:null,null,!1,!1),c.history.push(!0);break}}}if(!h&&0===u.startOffset&&(r.isComponent(i.previousSibling)||3===i.nodeType&&!i.previousSibling&&0===u.startOffset&&0===u.endOffset&&r.isComponent(m.previousSibling))){const e=m.previousSibling;r.removeItem(e)}break;case 46:if(p){t.preventDefault(),t.stopPropagation(),c.plugins[p].destroy.call(c);break}if((r.isFormatElement(o)||null===o.nextSibling)&&u.startOffset===o.textContent.length){let e=m.nextElementSibling;if(r.isComponent(e)){t.preventDefault(),r.onlyZeroWidthSpace(m)&&r.removeItem(m),(r.hasClass(e,"se-component")||/^IMG$/i.test(e.nodeName))&&(t.stopPropagation(),r.hasClass(e,"se-image-container")||/^IMG$/i.test(e.nodeName)?(e=/^IMG$/i.test(e.nodeName)?e:e.querySelector("img"),c.selectComponent(e,"image")):r.hasClass(e,"se-video-container")&&c.selectComponent(e.querySelector("iframe"),"video"));break}}if(m=r.getFormatElement(u.startContainer),f=r.getRangeFormatElement(m),r.isListCell(m)&&r.isList(f)&&(o===m||3===o.nodeType&&(!o.nextSibling||r.isList(o.nextSibling))&&(r.getFormatElement(u.startContainer)!==r.getFormatElement(u.endContainer)?f.contains(u.endContainer):u.endOffset===o.textContent.length&&u.collapsed))){u.startContainer!==u.endContainer&&c.removeNode();let e=r.getArrayItem(m.children,r.isList,!1);if(e=e||m.nextElementSibling||f.parentNode.nextElementSibling,e&&(r.isList(e)||r.getArrayItem(e.children,r.isList,!1))){let i,n;if(t.preventDefault(),r.isList(e)){const t=e.firstElementChild;for(n=t.childNodes,i=n[0];n[0];)m.insertBefore(n[0],e);r.removeItem(t)}else{for(i=e.firstChild,n=e.childNodes;n[0];)m.appendChild(n[0]);r.removeItem(e)}c.setRange(i,0,i,0),c.history.push(!0)}break}break;case 9:if(t.preventDefault(),l||s||r.isWysiwygDiv(o))break;c.controllersOff();const g=!u.collapsed||c.isEdgePoint(u.startContainer,u.startOffset),_=c.getSelectedElements(),b=[];let y=[],v=r.isListCell(_[0]),x=r.isListCell(_[_.length-1]),C={sc:u.startContainer,so:u.startOffset,ec:u.endContainer,eo:u.endOffset};for(let e,t=0,i=_.length;t0&&g&&c.plugins.list)c.plugins.list.editInsideList.call(c,n,b);else{const e=r.getParentElement(o,r.isCell);if(e&&g){const t=r.getParentElement(e,"table"),i=r.getListChildren(t,r.isCell);let l=n?r.prevIdx(i,e):r.nextIdx(i,e);l!==i.length||n||(l=0),-1===l&&n&&(l=i.length-1);const s=i[l];if(!s)return!1;c.setRange(s,0,s,0);break}y=y.concat(b),v=x=null}if(y.length>0)if(n){const e=y.length-1;for(let t,i=0;i<=e;i++){t=y[i].childNodes;for(let e,i=0,n=t.length;i0&&r.isBreak(n[l-1])||!e&&r.onlyZeroWidthSpace(o.textContent)&&r.isBreak(s)&&(r.isBreak(s.previousSibling)||!r.onlyZeroWidthSpace(s.previousSibling.textContent))&&(!a||!r.isBreak(a)&&r.onlyZeroWidthSpace(a.textContent))){e?r.removeItem(n[l-1]):r.removeItem(o);const t=c.appendFormatTag(w,r.isFormatElement(w.nextElementSibling)?w.nextElementSibling:null);r.copyFormatAttributes(t,w),c.setRange(t,1,t,1);break}if(e){c.execCommand("insertHTML",!1,"

    ");let e=i.focusNode;const t=i.focusOffset;e=w===e?e.childNodes[t-l>1?t-1:t]:e.previousSibling,c.setRange(e,1,e,1)}else{const e=i.focusNode.nextSibling,t=r.createElement("BR");c.insertNode(t);const n=t.previousSibling,l=t.nextSibling;r.isBreak(e)||r.isBreak(n)||l&&!r.onlyZeroWidthSpace(l)?c.setRange(l,0,l,0):(t.parentNode.insertBefore(t.cloneNode(!1),t),c.setRange(t,1,t,1))}d._onShortcutKey=!0;break}if(h)break;if(f&&m&&!r.isCell(f)&&!/^FIGCAPTION$/i.test(f.nodeName)){const e=c.getRange();if((3!==e.commonAncestorContainer.nodeType||!e.commonAncestorContainer.nextElementSibling)&&r.onlyZeroWidthSpace(m.innerText.trim())){t.preventDefault();let e=null;if(r.isListCell(f.parentNode)){f=m.parentNode.parentNode.parentNode;const t=r.splitElement(m,null,r.getElementDepth(m)-2);e=r.createElement("LI"),f.insertBefore(e,t)}else{const t=r.isCell(f.parentNode)?"DIV":r.isList(f.parentNode)?"LI":r.isFormatElement(f.nextElementSibling)?f.nextElementSibling.nodeName:r.isFormatElement(f.previousElementSibling)?f.previousElementSibling.nodeName:"P";e=r.createElement(t);const i=c.detachRangeFormatElement(f,[m],null,!0,!0);i.cc.insertBefore(e,i.ec)}e.innerHTML="
    ",r.copyFormatAttributes(e,m),r.removeItemAllParents(m,null),c.setRange(e,1,e,1);break}}if(f&&r.getParentElement(f,"FIGCAPTION")&&r.getParentElement(f,r.isList)&&(t.preventDefault(),m=c.appendFormatTag(m,null),c.setRange(m,0,m,0)),p){t.preventDefault(),t.stopPropagation();const i=e[p],n=i._container,l=n.previousElementSibling||n.nextElementSibling;let s=null;r.isListCell(n.parentNode)?s=r.createElement("BR"):(s=r.createElement(r.isFormatElement(l)?l.nodeName:"P"),s.innerHTML="
    "),n.parentNode.insertBefore(s,n),c.callPlugin(p,(function(){const e=c.plugins.resizing.call_controller_resize.call(c,i._element,p);c.plugins[p].onModifyMode.call(c,i._element,e)}))}}if(n&&/16/.test(i)){t.preventDefault(),t.stopPropagation();const e=c.plugins.table;if(e&&!e._shift&&!e._ref){const t=r.getParentElement(m,r.isCell);if(t)return void e.onTableCellMultiSelect.call(c,t,!0)}}const _=!(l||s||h||d._nonTextKeyCode.test(i));if(!c._charCount(1,_)&&_)return t.preventDefault(),t.stopPropagation(),!1;g.onKeyDown&&g.onKeyDown(t,c)},onKeyUp_wysiwyg:function(e){if(d._onShortcutKey)return;c._editorRange();const t=c.getRange(),i=e.keyCode,n=e.ctrlKey||e.metaKey||91===i||92===i,l=e.altKey;let s=c.getSelectionNode();if(c._isBalloon&&(c._isBalloonAlways&&27!==i||!t.collapsed)){if(!c._isBalloonAlways)return void d._showToolbarBalloon();d._showToolbarBalloonDelay()}if(8===i&&r.isWysiwygDiv(s)&&""===s.textContent){e.preventDefault(),e.stopPropagation(),s.innerHTML="";const t=r.createElement(r.isFormatElement(c._variable.currentNodes[0])?c._variable.currentNodes[0]:"P");return t.innerHTML="
    ",s.appendChild(t),c.setRange(t,0,t,0),d._applyTagEffects(),c._checkComponents(),void c.history.push(!1)}const o=r.getFormatElement(s),a=r.getRangeFormatElement(s);(!o&&t.collapsed||o===a)&&(c.execCommand("formatBlock",!1,r.isRangeFormatElement(a)?"DIV":"P"),c.focus(),s=c.getSelectionNode()),d._directionKeyCode.test(i)&&d._applyTagEffects(),c._checkComponents();const u=!n&&!l&&!d._nonTextKeyCode.test(i);if(u&&3===s.nodeType&&r.zeroWidthRegExp.test(s.textContent)){let e=t.startOffset,i=t.endOffset;const n=(s.textContent.substring(0,i).match(d._frontZeroWidthReg)||"").length;e=t.startOffset-n,i=t.endOffset-n,s.textContent=s.textContent.replace(r.zeroWidthRegExp,""),c.setRange(s,e<0?0:e,s,i<0?0:i)}if(!c._charCount(1,u)&&1===e.key.length)return e.preventDefault(),e.stopPropagation(),!1;!n&&!l&&!d._historyIgnoreKeyCode.test(i)&&c.history.push(!0),g.onKeyUp&&g.onKeyUp(e,c)},onScroll_wysiwyg:function(e){c.controllersOff(),c._isBalloon&&d._hideToolbar(),g.onScroll&&g.onScroll(e,c)},onFocus_wysiwyg:function(e){c.hasFocus=!0,c._isInline&&d._showToolbarInline(),g.onFocus&&g.onFocus(e,c)},onBlur_wysiwyg:function(e){c.hasFocus=!1,(c._isInline||c._isBalloon)&&d._hideToolbar(),g.onBlur&&g.onBlur(e,c)},onMouseDown_resizingBar:function(t){t.stopPropagation(),c._variable.resizeClientY=t.clientY,e.element.resizeBackground.style.display="block",s.addEventListener("mousemove",d._resize_editor),s.addEventListener("mouseup",(function t(){e.element.resizeBackground.style.display="none",s.removeEventListener("mousemove",d._resize_editor),s.removeEventListener("mouseup",t)}))},_resize_editor:function(t){const i=e.element.editorArea.offsetHeight+(t.clientY-c._variable.resizeClientY);e.element.wysiwygFrame.style.height=e.element.code.style.height=(i=i+o?(c._sticky||d._onStickyToolbar(),t.toolbar.style.top=i+o+l.stickyToolbar-n-c._variable.minResizingSize+"px"):n>=o&&d._onStickyToolbar()},_getStickyOffsetTop:function(){let t=e.element.topArea,i=0;for(;t;)i+=t.offsetTop,t=t.offsetParent;return i},_onStickyToolbar:function(){const t=e.element;c._isInline||(t._stickyDummy.style.height=t.toolbar.offsetHeight+"px",t._stickyDummy.style.display="block"),t.toolbar.style.top=l.stickyToolbar+"px",t.toolbar.style.width=c._isInline?c._inlineToolbarAttr.width:t.toolbar.offsetWidth+"px",r.addClass(t.toolbar,"se-toolbar-sticky"),c._sticky=!0},_offStickyToolbar:function(){const t=e.element;t._stickyDummy.style.display="none",t.toolbar.style.top=c._isInline?c._inlineToolbarAttr.top:"",t.toolbar.style.width=c._isInline?c._inlineToolbarAttr.width:"",t.editorArea.style.marginTop="",r.removeClass(t.toolbar,"se-toolbar-sticky"),c._sticky=!1},_codeViewAutoHeight:function(){e.element.code.style.height=e.element.code.scrollHeight+"px"},onPaste_wysiwyg:function(e){const t=e.clipboardData;if(!t)return!0;const i=c._charCount(t.getData("text/plain").length,!0),n=c.cleanHTML(t.getData("text/html"),c.pasteTagsWhitelistRegExp);return("function"!=typeof g.onPaste||g.onPaste(e,n,i,c))&&i?void(n?(e.stopPropagation(),e.preventDefault(),c.execCommand("insertHTML",!1,n)):c.history.push(!0)):(e.preventDefault(),e.stopPropagation(),!1)},onCut_wysiwyg:function(){a.setTimeout((function(){c._resourcesStateChange(),c._charCount(0,!1),c.history.push(!1)}))},onDragOver_wysiwyg:function(e){e.preventDefault()},onDrop_wysiwyg:function(t){const i=t.dataTransfer;if(!i)return!0;const n=i.files;if(n.length>0&&c.plugins.image)d._setDropLocationSelection(t),c.callPlugin("image",(function(){e.image.imgInputFile.files=n,c.plugins.image.onRender_imgInput.call(c),e.image.imgInputFile.files=null}));else{if(!c._charCount(i.getData("text/plain").length,!0))return t.preventDefault(),t.stopPropagation(),!1;{const e=c.cleanHTML(i.getData("text/html"),c.pasteTagsWhitelistRegExp);e&&(d._setDropLocationSelection(t),c.execCommand("insertHTML",!1,e))}}g.onDrop&&g.onDrop(t,c)},_setDropLocationSelection:function(e){e.stopPropagation(),e.preventDefault();const t=c.getRange();c.setRange(t.startContainer,t.startOffset,t.endContainer,t.endOffset)},_onChange_historyStack:function(){d._applyTagEffects(),e.tool.save&&e.tool.save.removeAttribute("disabled"),g.onChange&&g.onChange(c.getContents(!0),c)},_addEvent:function(){const t=l.iframe?c._ww:e.element.wysiwyg;e.element.toolbar.addEventListener("mousedown",d.onMouseDown_toolbar,!1),e.element.toolbar.addEventListener("click",d.onClick_toolbar,!1),t.addEventListener("mousedown",d.onMouseDown_wysiwyg,!1),t.addEventListener("click",d.onClick_wysiwyg,!1),t.addEventListener("keydown",d.onKeyDown_wysiwyg,!1),t.addEventListener("keyup",d.onKeyUp_wysiwyg,!1),t.addEventListener("paste",d.onPaste_wysiwyg,!1),t.addEventListener("cut",d.onCut_wysiwyg,!1),t.addEventListener("dragover",d.onDragOver_wysiwyg,!1),t.addEventListener("drop",d.onDrop_wysiwyg,!1),t.addEventListener("scroll",d.onScroll_wysiwyg,!1),t.addEventListener("focus",d.onFocus_wysiwyg,!1),t.addEventListener("blur",d.onBlur_wysiwyg,!1),c.plugins.table&&t.addEventListener("touchstart",d.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),"auto"!==l.height||l.codeMirrorEditor||(e.element.code.addEventListener("keydown",d._codeViewAutoHeight,!1),e.element.code.addEventListener("keyup",d._codeViewAutoHeight,!1),e.element.code.addEventListener("paste",d._codeViewAutoHeight,!1)),e.element.resizingBar&&(/\d+/.test(l.height)?e.element.resizingBar.addEventListener("mousedown",d.onMouseDown_resizingBar,!1):r.addClass(e.element.resizingBar,"se-resizing-none")),a.removeEventListener("resize",d.onResize_window),a.removeEventListener("scroll",d.onScroll_window),a.addEventListener("resize",d.onResize_window,!1),l.stickyToolbar>-1&&a.addEventListener("scroll",d.onScroll_window,!1)},_removeEvent:function(){const t=l.iframe?c._ww:e.element.wysiwyg;e.element.toolbar.removeEventListener("mousedown",d.onMouseDown_toolbar),e.element.toolbar.removeEventListener("click",d.onClick_toolbar),t.removeEventListener("click",d.onClick_wysiwyg),t.removeEventListener("keydown",d.onKeyDown_wysiwyg),t.removeEventListener("keyup",d.onKeyUp_wysiwyg),t.removeEventListener("paste",d.onPaste_wysiwyg),t.removeEventListener("cut",d.onCut_wysiwyg),t.removeEventListener("dragover",d.onDragOver_wysiwyg),t.removeEventListener("drop",d.onDrop_wysiwyg),t.removeEventListener("scroll",d.onScroll_wysiwyg),t.removeEventListener("mousedown",d.onMouseDown_wysiwyg),t.removeEventListener("touchstart",d.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),t.removeEventListener("focus",d.onFocus_wysiwyg),t.removeEventListener("blur",d.onBlur_wysiwyg),e.element.code.removeEventListener("keydown",d._codeViewAutoHeight),e.element.code.removeEventListener("keyup",d._codeViewAutoHeight),e.element.code.removeEventListener("paste",d._codeViewAutoHeight),e.element.resizingBar&&e.element.resizingBar.removeEventListener("mousedown",d.onMouseDown_resizingBar),a.removeEventListener("resize",d.onResize_window),a.removeEventListener("scroll",d.onScroll_window)}},g={core:c,util:r,onload:null,onScroll:null,onMouseDown:null,onClick:null,onKeyDown:null,onKeyUp:null,onDrop:null,onChange:null,onPaste:null,onFocus:null,onBlur:null,showInline:null,imageUploadHandler:null,onImageUploadBefore:null,onImageUpload:null,onImageUploadError:null,setOptions:function(s){d._removeEvent(),c.plugins=s.plugins||c.plugins;const o=[s,s].reduce((function(e,t){for(let i in t)if("plugins"===i&&t[i]&&e[i]){let n=e[i],l=t[i];n=n.length?n:a.Object.keys(n).map((function(e){return n[e]})),l=l.length?l:a.Object.keys(l).map((function(e){return l[e]})),e[i]=l.filter((function(e){return-1===n.indexOf(e)})).concat(n)}else e[i]=t[i];return e}),{}),r=h._setOptions(o,e,c.plugins,s);r.callButtons&&(t=r.callButtons,c.initPlugins={}),r.plugins&&(c.plugins=i=r.plugins);const u=e.element.wysiwyg.innerHTML,g=e.element,m={_top:g.topArea,_relative:g.relative,_toolBar:g.toolbar,_editorArea:g.editorArea,_wysiwygArea:g.wysiwygFrame,_codeArea:g.code,_placeholder:g.placeholder,_resizingBar:g.resizingBar,_navigation:g.navigation,_charCounter:g.charCounter,_loading:g.loading,_resizeBack:g.resizeBackground,_stickyDummy:g._stickyDummy,_arrow:g._arrow};l=o,c.lang=n=l.lang,c.context=e=p(e.element.originElement,m,l),c._imagesInfoReset=!0,c._init(!0,u),d._addEvent(),c._charCount(0,!1),d._offStickyToolbar(),d.onResize_window(),c.focus()},noticeOpen:function(e){c.addModule([o]),o.open.call(c,e)},noticeClose:function(){c.addModule([o]),o.close.call(c)},save:function(){e.element.originElement.value=c.getContents(!1)},getContext:function(){return e},getContents:function(e){return c.getContents(e)},getImagesInfo:function(){return c._variable._imagesInfo},insertImage:function(e){c.plugins.image&&e&&(c.initPlugins.image?c.plugins.image.submitAction.call(c,e):c.callPlugin("image",c.plugins.image.submitAction.bind(c,e)),c.focus())},insertHTML:function(e){if(!e.nodeType||1!==e.nodeType){const t=r.createElement("DIV");t.innerHTML=e,e=t.firstChild||t.content.firstChild}let t=null;(r.isFormatElement(e)||/^(IMG|IFRAME)$/i.test(e.nodeName))&&(t=r.getFormatElement(c.getSelectionNode())),r.isComponent(e)?c.insertComponent(e,!1):c.insertNode(e,t),c.focus()},setContents:function(e){c.setContents(e)},appendContents:function(t){const i=c.convertContentsForEditor(t);if(c._variable.isCodeView)c._setCodeView(c._getCodeView()+"\n"+c.convertHTMLForCodeView(i));else{const t=r.createElement("DIV");t.innerHTML=i;const n=e.element.wysiwyg,l=t.children;for(let e=0,t=l.length;e + + -
    +
    - + +
    -
    +
    - + +
    + -
    -
    - +
    +
    - +
    +
    -
    @@ -166,6 +209,9 @@

    The Suneditor is based on pure JavaScript, with no dependencies.

    + + +