diff --git a/changelog.txt b/changelog.txt index 3a125e6c..7683c222 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +Version 5.3.1 (2020-05-27) + Fixed the image upload error alert also incorrectly closing the image dialog #TINY-6020 + Fixed editor content scrolling incorrectly on focus in Firefox by reverting default content CSS html and body heights added in 5.3.0 #TINY-6019 Version 5.3.0 (2020-05-21) Added html and body height styles to the default oxide content CSS #TINY-5978 Added `uploadUri` and `blobInfo` to the data returned by `editor.uploadImages()` #TINY-4579 diff --git a/composer.json b/composer.json index f04a701d..49f9cc61 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "tinymce/tinymce", - "version": "5.3.0", + "version": "5.3.1", "description": "Web based JavaScript HTML WYSIWYG editor control.", "license": [ "LGPL-2.1-only" diff --git a/package.json b/package.json index d66f0df2..b409f2da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tinymce", - "version": "5.3.0", + "version": "5.3.1", "repository": { "type": "git", "url": "https://github.com/tinymce/tinymce-dist.git" diff --git a/plugins/advlist/plugin.js b/plugins/advlist/plugin.js index 09bc1f0d..8a1227dd 100644 --- a/plugins/advlist/plugin.js +++ b/plugins/advlist/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function () { 'use strict'; diff --git a/plugins/advlist/plugin.min.js b/plugins/advlist/plugin.min.js index 23d0b566..0089b99a 100644 --- a/plugins/advlist/plugin.min.js +++ b/plugins/advlist/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ !function(){"use strict";var n,t,e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(n,t,e){var r="UL"===t?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===e?null:{"list-style-type":e})},o=function(n){return function(){return n}},u=o(!1),l=o(!0),i=function(){return a},a=(n=function(n){return n.isNone()},{fold:function(n,t){return n()},is:u,isSome:u,isNone:l,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:e,orThunk:t,map:i,each:function(){},bind:i,exists:u,forall:l,filter:i,equals:n,equals_:n,toArray:function(){return[]},toString:o("none()")}),f=function(e){var n=o(e),t=function(){return i},r=function(n){return n(e)},i={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:l,isNone:u,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return f(n(e))},each:function(n){n(e)},bind:r,exists:r,forall:r,filter:function(n){return n(e)?i:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(u,function(n){return t(e,n)})}};return i},d=function(n){return null===n||n===undefined?a:f(n)},g=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},p=function(r){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&(e=n,(t=r).$.contains(t.getBody(),e));var t,e}},m=function(n,t,e){var r=function(n,t){for(var e=0;ev(e)&&(i=o+c);var m=e.getParam("max_height",0,"number");if(m&&m]*>((\xa0| |[ \t]|]*>)+?|)|
$","i").test(e)},f=function(t){var e=parseInt(o.getItem(u(t)+"time"),10)||0;return!((new Date).getTime()-e>i(t.settings.autosave_retention,"20m"))||(c(t,!1),!1)},c=function(t,e){var r=u(t);o.removeItem(r+"draft"),o.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},m=function(t){var e=u(t);!s(t)&&t.isDirty()&&(o.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),o.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))},l=function(t){var e=u(t);f(t)&&(t.setContent(o.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))},v=function(t){var e=i(t.settings.autosave_interval,"30s");n.setInterval(function(){t.removed||m(t)},e)},d=function(t){t.undoManager.transact(function(){l(t),c(t)}),t.focus()},g=tinymce.util.Tools.resolve("tinymce.EditorManager"),y=function(r){return function(t){t.setDisabled(!f(r));var e=function(){return t.setDisabled(!f(r))};return r.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return r.off("StoreDraft RestoreDraft RemoveDraft",e)}}};!function e(){t.add("autosave",function(t){var e,r;return t.editorManager.on("BeforeUnload",function(t){var e;a.each(g.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)}),v(e=t),e.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){d(e)},onSetup:y(e)}),e.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){d(e)},onSetup:y(e)}),t.on("init",function(){t.getParam("autosave_restore_when_empty",!1)&&t.dom.isEmpty(t.getBody())&&l(t)}),r=t,{hasDraft:function(){return f(r)},storeDraft:function(){return m(r)},restoreDraft:function(){return l(r)},removeDraft:function(t){return c(r,t)},isEmpty:function(t){return s(r,t)}}})}()}(window); \ No newline at end of file diff --git a/plugins/bbcode/plugin.js b/plugins/bbcode/plugin.js index f0d42fb6..5c0abb8d 100644 --- a/plugins/bbcode/plugin.js +++ b/plugins/bbcode/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function () { 'use strict'; diff --git a/plugins/bbcode/plugin.min.js b/plugins/bbcode/plugin.min.js index a4d4f9ac..bac05099 100644 --- a/plugins/bbcode/plugin.min.js +++ b/plugins/bbcode/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ !function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};return o(/\n/gi,"
"),o(/\[b\]/gi,""),o(/\[\/b\]/gi,""),o(/\[i\]/gi,""),o(/\[\/i\]/gi,""),o(/\[u\]/gi,""),o(/\[\/u\]/gi,""),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),o(/\[url\](.*?)\[\/url\]/gi,'$1'),o(/\[img\](.*?)\[\/img\]/gi,''),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),o(/\[code\](.*?)\[\/code\]/gi,'$1 '),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),t};!function i(){o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=t(o.content)}),o.on("PostProcess",function(o){o.set&&(o.content=t(o.content)),o.get&&(o.content=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};return o(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"),o(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"),o(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"),o(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"),o(/(.*?)<\/font>/gi,"$1"),o(//gi,"[img]$1[/img]"),o(/(.*?)<\/span>/gi,"[code]$1[/code]"),o(/(.*?)<\/span>/gi,"[quote]$1[/quote]"),o(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),o(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),o(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),o(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),o(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),o(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),o(/<\/(strong|b)>/gi,"[/b]"),o(/<(strong|b)>/gi,"[b]"),o(/<\/(em|i)>/gi,"[/i]"),o(/<(em|i)>/gi,"[i]"),o(/<\/u>/gi,"[/u]"),o(/(.*?)<\/span>/gi,"[u]$1[/u]"),o(//gi,"[u]"),o(/]*>/gi,"[quote]"),o(/<\/blockquote>/gi,"[/quote]"),o(/
/gi,"\n"),o(//gi,"\n"),o(/
/gi,"\n"),o(/

/gi,""),o(/<\/p>/gi,"\n"),o(/ |\u00a0/gi," "),o(/"/gi,'"'),o(/</gi,"<"),o(/>/gi,">"),o(/&/gi,"&"),t}(o.content))})})}()}(); \ No newline at end of file diff --git a/plugins/charmap/plugin.js b/plugins/charmap/plugin.js index 943b0e44..b052f72d 100644 --- a/plugins/charmap/plugin.js +++ b/plugins/charmap/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function (domGlobals) { 'use strict'; diff --git a/plugins/charmap/plugin.min.js b/plugins/charmap/plugin.min.js index 7881fcba..942b0ab3 100644 --- a/plugins/charmap/plugin.min.js +++ b/plugins/charmap/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ !function(s){"use strict";var e,n,r,t,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=function(e,n){var r,t=(r=n,e.fire("insertCustomChar",{chr:r}).chr);e.execCommand("mceInsertContent",!1,t)},i=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=function(e){return function(){return e}},c=o(!1),u=o(!0),g=function(){return m},m=(e=function(e){return e.isNone()},{fold:function(e,n){return e()},is:c,isSome:c,isNone:u,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:r,orThunk:n,map:g,each:function(){},bind:g,exists:c,forall:u,filter:g,equals:e,equals_:e,toArray:function(){return[]},toString:o("none()")}),f=function(r){var e=o(r),n=function(){return a},t=function(e){return e(r)},a={fold:function(e,n){return n(r)},is:function(e){return r===e},isSome:u,isNone:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return f(e(r))},each:function(e){e(r)},bind:t,exists:t,forall:t,filter:function(e){return e(r)?a:m},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,n){return e.fold(c,function(e){return n(r,e)})}};return a},h={some:f,none:g,from:function(e){return null===e||e===undefined?m:f(e)}},d=(t="array",function(e){return r=typeof(n=e),(null===n?"null":"object"==r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}),p=Array.prototype.push,y=function(e,n){for(var r=e.length,t=new Array(r),a=0;a>>0===o))throw RangeError("Invalid code point: "+o);16383<=(o<=65535?r.push(o):(o-=65536,r.push(55296+(o>>10),o%1024+56320)))&&(t+=String.fromCharCode.apply(null,r),r.length=0)}return t+String.fromCharCode.apply(null,r)},T=function(e,n){var a=[],i=n.toLowerCase();return function(e,n){for(var r=0,t=e.length;r>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/,number:/(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(?:define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete Prism.languages.c["boolean"]},{}],2:[function(e,n,t){Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(?:true|false)\b/,"function":/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},{}],3:[function(e,t,n){(function(e){var n=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,n=0,C={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof O?new O(e.type,C.util.encode(e.content),e.alias):Array.isArray(e)?e.map(C.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof O)){if(g&&b!=n.length-1){if(c.lastIndex=y,!(P=c.exec(e)))break;for(var v=P.index+(p&&P[1]?P[1].length:0),k=P.index+P[0].length,x=b,_=y,F=n.length;x"+t.content+""},!u.document)return u.addEventListener&&(C.disableWorkerMessageHandler||u.addEventListener("message",function(e){var n=JSON.parse(e.data),t=n.language,a=n.code,r=n.immediateClose;u.postMessage(C.highlight(a,C.languages[t],t)),r&&u.close()},!1)),C;var e=C.util.currentScript();if(e&&(C.filename=e.src,e.hasAttribute("data-manual")&&(C.manual=!0)),!C.manual){var t=function(){C.manual||C.highlightAll()},a=document.readyState;"loading"===a||"interactive"===a&&e&&e.defer?document.addEventListener("DOMContentLoaded",t):window.requestAnimationFrame?window.requestAnimationFrame(t):window.setTimeout(t,16)}return C}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});void 0!==t&&t.exports&&(t.exports=n),void 0!==e&&(e.Prism=n)}).call(this,void 0!==y?y:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,n,t){Prism.languages.cpp=Prism.languages.extend("c",{"class-name":{pattern:/(\b(?:class|enum|struct)\s+)\w+/,lookbehind:!0},keyword:/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i,greedy:!0},operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,"boolean":/\b(?:true|false)\b/}),Prism.languages.insertBefore("cpp","string",{"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}})},{}],5:[function(e,n,t){Prism.languages.csharp=Prism.languages.extend("clike",{keyword:/\b(?:abstract|add|alias|as|ascending|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|descending|do|double|dynamic|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|from|get|global|goto|group|if|implicit|in|int|interface|internal|into|is|join|let|lock|long|namespace|new|null|object|operator|orderby|out|override|params|partial|private|protected|public|readonly|ref|remove|return|sbyte|sealed|select|set|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|value|var|virtual|void|volatile|where|while|yield)\b/,string:[{pattern:/@("|')(?:\1\1|\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*?\1/,greedy:!0}],"class-name":[{pattern:/\b[A-Z]\w*(?:\.\w+)*\b(?=\s+\w+)/,inside:{punctuation:/\./}},{pattern:/(\[)[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/(\b(?:class|interface)\s+[A-Z]\w*(?:\.\w+)*\s*:\s*)[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/((?:\b(?:class|interface|new)\s+)|(?:catch\s+\())[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}}],number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)f?/i,operator:/>>=?|<<=?|[-=]>|([-+&|?])\1|~|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),Prism.languages.insertBefore("csharp","class-name",{"generic-method":{pattern:/\w+\s*<[^>\r\n]+?>\s*(?=\()/,inside:{"function":/^\w+/,"class-name":{pattern:/\b[A-Z]\w*(?:\.\w+)*\b/,inside:{punctuation:/\./}},keyword:Prism.languages.csharp.keyword,punctuation:/[<>(),.:]/}},preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(\s*#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}}),Prism.languages.dotnet=Prism.languages.cs=Prism.languages.csharp},{}],6:[function(e,n,t){!function(e){var n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,inside:{rule:/@[\w-]+/}},url:{pattern:RegExp("url\\((?:"+n.source+"|[^\n\r()]*)\\)","i"),inside:{"function":/^url/i,punctuation:/^\(|\)$/}},selector:RegExp("[^{}\\s](?:[^{};\"']|"+n.source+")*?(?=\\s*\\{)"),string:{pattern:n,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var t=e.languages.markup;t&&(t.tag.addInlined("style","css"),e.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:t.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:e.languages.css}},alias:"language-css"}},t.tag))}(Prism)},{}],7:[function(e,n,t){var a,r,i;a=Prism,r=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|null|open|opens|package|private|protected|provides|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,i=/\b[A-Z](?:\w*[a-z]\w*)?\b/,a.languages.java=a.languages.extend("clike",{"class-name":[i,/\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/],keyword:r,"function":[a.languages.clike["function"],{pattern:/(\:\:)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),a.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),a.languages.insertBefore("java","class-name",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0},namespace:{pattern:/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)[a-z]\w*(?:\.[a-z]\w*)+/,lookbehind:!0,inside:{punctuation:/\./}},generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:r,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})},{}],8:[function(e,n,t){Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,"function":/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/--|\+\+|\*\*=?|=>|&&|\|\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?[.?]?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*[\s\S]*?\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript},{}],9:[function(e,n,t){function b(e,n){return"___"+e.toUpperCase()+n+"___"}var y;y=Prism,Object.defineProperties(y.languages["markup-templating"]={},{buildPlaceholders:{value:function(a,r,e,i){if(a.language===r){var s=a.tokenStack=[];a.code=a.code.replace(e,function(e){if("function"==typeof i&&!i(e))return e;for(var n,t=s.length;-1!==a.code.indexOf(n=b(r,t));)++t;return s[t]=e,n}),a.grammar=y.languages.markup}}},tokenizePlaceholders:{value:function(p,g){if(p.language===g&&p.tokenStack){p.grammar=y.languages[g];var m=0,f=Object.keys(p.tokenStack);!function h(e){for(var n=0;n=f.length);n++){var t=e[n];if("string"==typeof t||t.content&&"string"==typeof t.content){var a=f[m],r=p.tokenStack[a],i="string"==typeof t?t:t.content,s=b(g,a),o=i.indexOf(s);if(-1/,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:(?!)*\]\s*)?>/i,greedy:!0},cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,n){var t={};t["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[n]},t.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:t}};a["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var r={};r[e]={pattern:RegExp(/(<__[\s\S]*?>)(?:\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g,e),"i"),lookbehind:!0,greedy:!0,inside:a},Prism.languages.insertBefore("markup","cdata",r)}}),Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup},{}],11:[function(e,n,t){!function(n){n.languages.php=n.languages.extend("clike",{keyword:/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,"boolean":{pattern:/\b(?:false|true)\b/i,alias:"constant"},constant:[/\b[A-Z_][A-Z0-9_]*\b/,/\b(?:null)\b/i],comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0}}),n.languages.insertBefore("php","string",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),n.languages.insertBefore("php","comment",{delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"}}),n.languages.insertBefore("php","keyword",{variable:/\$+(?:\w+\b|(?={))/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),n.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}});var e={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[.+?]|->\w+)*)/,lookbehind:!0,inside:n.languages.php};n.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;|([a-z_]\w*)(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\2;)/i,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:e}},"single-quoted-string":{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,alias:"string",inside:{interpolation:e}}}),delete n.languages.php.string,n.hooks.add("before-tokenize",function(e){if(/<\?/.test(e.code)){n.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism)},{}],12:[function(e,n,t){Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]+?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^\s*)@\w+(?:\.\w+)*/im,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,"boolean":/\b(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},{}],13:[function(e,n,t){!function(e){e.languages.ruby=e.languages.extend("clike",{comment:[/#.*/,{pattern:/^=begin\s[\s\S]*?^=end/m,greedy:!0}],"class-name":{pattern:/(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/});var n={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.languages.ruby}};delete e.languages.ruby["function"],e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/(^|[^/])\/(?!\/)(?:\[.+?]|\\.|[^/\\\r\n])+\/[gim]{0,3}(?=\s*(?:$|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:{pattern:/(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,lookbehind:!0},"method-definition":{pattern:/(\bdef\s+)[\w.]+/,lookbehind:!0,inside:{"function":/\w+$/,rest:e.languages.ruby}}}),e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z]\w*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,greedy:!0,inside:{interpolation:n}},{pattern:/("|')(?:#\{[^}]+\}|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:n}}],e.languages.rb=e.languages.ruby}(Prism)},{}],14:[function(e,n,t){var a=e("prismjs/components/prism-core");e("prismjs/components/prism-clike"),e("prismjs/components/prism-markup-templating"),e("prismjs/components/prism-c"),e("prismjs/components/prism-cpp"),e("prismjs/components/prism-csharp"),e("prismjs/components/prism-css"),e("prismjs/components/prism-java"),e("prismjs/components/prism-javascript"),e("prismjs/components/prism-markup"),e("prismjs/components/prism-php"),e("prismjs/components/prism-python"),e("prismjs/components/prism-ruby"),n.exports={boltExport:a}},{"prismjs/components/prism-c":1,"prismjs/components/prism-clike":2,"prismjs/components/prism-core":3,"prismjs/components/prism-cpp":4,"prismjs/components/prism-csharp":5,"prismjs/components/prism-css":6,"prismjs/components/prism-java":7,"prismjs/components/prism-javascript":8,"prismjs/components/prism-markup":10,"prismjs/components/prism-markup-templating":9,"prismjs/components/prism-php":11,"prismjs/components/prism-python":12,"prismjs/components/prism-ruby":13}]},{},[14])(14)});var r=window.Prism;window.Prism=e}(undefined,h,b,undefined);var w=b.exports.boltExport,v=function(e){return f.Prism&&e.getParam("codesample_global_prismjs",!1,"boolean")?f.Prism:w},k=function(e){var n=e.selection?e.selection.getNode():null;return g(n)?d.some(n):d.none()},x=function(i){var e,t,n=i.getParam("codesample_languages")||[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}],a=(0===(e=n).length?d.none():d.some(e[0])).fold(function(){return""},function(e){return e.value}),r=(t=a,k(i).fold(function(){return t},function(e){var n=e.className.match(/language-(\w+)/);return n?n[1]:t})),s=k(i).fold(function(){return""},function(e){return e.textContent});i.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:n},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:r,code:s},onSubmit:function(e){var n,t,a,r=e.getData();n=i,t=r.language,a=r.code,n.undoManager.transact(function(){var e=k(n);return a=p.DOM.encode(a),e.fold(function(){n.insertContent('

'+a+"
"),n.selection.select(n.$("#__new").removeAttr("id")[0])},function(e){n.dom.setAttrib(e,"class","language-"+t),e.innerHTML=a,v(n).highlightElement(e),n.selection.select(e)})}),e.close()}})},_=function(a){a.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:function(){return x(a)},onSetup:function(t){var e=function(){var e,n;t.setActive((n=(e=a).selection.getStart(),e.dom.is(n,'pre[class*="language-"]')))};return a.on("NodeChange",e),function(){return a.off("NodeChange",e)}}}),a.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:function(){return x(a)}})};!function F(){r.add("codesample",function(n){var t,r,a;r=(t=n).$,t.on("PreProcess",function(e){r("pre[contenteditable=false]",e.node).filter(m(g)).each(function(e,n){var t=r(n),a=n.textContent;t.attr("class",r.trim(t.attr("class"))),t.removeAttr("contentEditable"),t.empty().append(r("").each(function(){this.textContent=a}))})}),t.on("SetContent",function(){var e=r("pre").filter(m(g)).filter(function(e,n){return"false"!==n.contentEditable});e.length&&t.undoManager.transact(function(){e.each(function(e,n){r(n).find("br").each(function(e,n){n.parentNode.replaceChild(t.getDoc().createTextNode("\n"),n)}),n.contentEditable="false",n.innerHTML=t.dom.encode(n.textContent),v(t).highlightElement(n),n.className=r.trim(n.className)})})}),_(n),(a=n).addCommand("codesample",function(){var e=a.selection.getNode();a.selection.isCollapsed()||g(e)?x(a):a.formatter.toggle("code")}),n.on("dblclick",function(e){g(e.target)&&x(n)})})}()}(window); \ No newline at end of file diff --git a/plugins/colorpicker/plugin.js b/plugins/colorpicker/plugin.js index 1d899483..0f5346f0 100644 --- a/plugins/colorpicker/plugin.js +++ b/plugins/colorpicker/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function (domGlobals) { 'use strict'; diff --git a/plugins/colorpicker/plugin.min.js b/plugins/colorpicker/plugin.min.js index 93afdae2..5914ac89 100644 --- a/plugins/colorpicker/plugin.min.js +++ b/plugins/colorpicker/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ !function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("colorpicker",function(){o.console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); \ No newline at end of file diff --git a/plugins/contextmenu/plugin.js b/plugins/contextmenu/plugin.js index 1bdafe8a..70807bd6 100644 --- a/plugins/contextmenu/plugin.js +++ b/plugins/contextmenu/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function (domGlobals) { 'use strict'; diff --git a/plugins/contextmenu/plugin.min.js b/plugins/contextmenu/plugin.min.js index 021829ba..18bb92fa 100644 --- a/plugins/contextmenu/plugin.min.js +++ b/plugins/contextmenu/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ !function(n){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager");!function e(){o.add("contextmenu",function(){n.console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); \ No newline at end of file diff --git a/plugins/directionality/plugin.js b/plugins/directionality/plugin.js index ebe8385c..f688f80e 100644 --- a/plugins/directionality/plugin.js +++ b/plugins/directionality/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function (domGlobals) { 'use strict'; diff --git a/plugins/directionality/plugin.min.js b/plugins/directionality/plugin.min.js index 340b50cb..058f580f 100644 --- a/plugins/directionality/plugin.min.js +++ b/plugins/directionality/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ !function(u){"use strict";var n,t,e,r,o,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(n,t){var e,r=n.dom,o=n.selection.getSelectedBlocks();o.length&&(e=r.getAttrib(o[0],"dir"),c.each(o,function(n){r.getParent(n.parentNode,'*[dir="'+t+'"]',r.getRoot())||r.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},d=function(n){return function(){return n}},f=d(!1),a=d(!0),m=function(){return s},s=(n=function(n){return n.isNone()},{fold:function(n,t){return n()},is:f,isSome:f,isNone:a,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(undefined),or:e,orThunk:t,map:m,each:function(){},bind:m,exists:f,forall:a,filter:m,equals:n,equals_:n,toArray:function(){return[]},toString:d("none()")}),g=function(e){var n=d(e),t=function(){return o},r=function(n){return n(e)},o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:a,isNone:f,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return g(n(e))},each:function(n){n(e)},bind:r,exists:r,forall:r,filter:function(n){return n(e)?o:s},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(f,function(n){return t(e,n)})}};return o},h=function(n){return null===n||n===undefined?s:g(n)},y=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:d(n)}},T={fromHtml:function(n,t){var e=(t||u.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1Could not load emoticons

"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),f.focus(S),f.unblock()}))};!function E(){o.add("emoticons",function(n,t){var e,o,r,i,u,a,c,l=(o=t,(e=n).getParam("emoticons_database_url",o+"/js/emojis"+e.suffix+".js")),s=n.getParam("emoticons_database_id","tinymce.plugins.emoticons","string"),f=L(n,l,s);i=f,u=function(){return N(r,i)},(r=n).ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:u}),r.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:u}),c=f,(a=n).ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(t,e){return c.waitForLoad().then(function(){var n=c.listAll();return y(n,t,g.some(e))})},onAction:function(n,t,e){a.selection.setRng(t),a.insertContent(e),n.hide()}})})}()}(window); \ No newline at end of file diff --git a/plugins/fullpage/plugin.js b/plugins/fullpage/plugin.js index 84c02b9f..1c2f77e6 100644 --- a/plugins/fullpage/plugin.js +++ b/plugins/fullpage/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function (domGlobals) { 'use strict'; diff --git a/plugins/fullpage/plugin.min.js b/plugins/fullpage/plugin.min.js index e371dc73..7f64b3b1 100644 --- a/plugins/fullpage/plugin.min.js +++ b/plugins/fullpage/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ !function(p){"use strict";var s=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){return(u=Object.assign||function(e){for(var t,n=1,l=arguments.length;n"),(n=r.getAll("title")[0])&&n.firstChild&&(a.title=n.firstChild.value),y.each(r.getAll("meta"),function(e){var t,n=e.attr("name"),l=e.attr("http-equiv");n?a[n.toLowerCase()]=e.attr("content"):"Content-Type"===l&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")))&&(a.docencoding=t[1])}),(n=r.getAll("html")[0])&&(a.langcode=s(n,"lang")||s(n,"xml:lang")),a.stylesheets=[],y.each(r.getAll("link"),function(e){"stylesheet"===e.attr("rel")&&a.stylesheets.push(e.attr("href"))}),(n=r.getAll("body")[0])&&(a.langdir=s(n,"dir"),a.style=s(n,"style"),a.visited_color=s(n,"vlink"),a.link_color=s(n,"link"),a.active_color=s(n,"alink")),a);function s(e,t){return e.attr(t)||""}var d=u(u({},{title:"",keywords:"",description:"",robots:"",author:"",docencoding:""}),c);l.windowManager.open({title:"Metadata and Document Properties",size:"normal",body:{type:"panel",items:[{name:"title",type:"input",label:"Title"},{name:"keywords",type:"input",label:"Keywords"},{name:"description",type:"input",label:"Description"},{name:"robots",type:"input",label:"Robots"},{name:"author",type:"input",label:"Author"},{name:"docencoding",type:"input",label:"Encoding"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:d,onSubmit:function(e){var t=e.getData(),n=function(e,o,t){var r,n,l,a,i,c=e.dom;function s(e,t,n){e.attr(t,n||undefined)}function d(e){n.firstChild?n.insert(e,n.firstChild):n.append(e)}r=_(t),(n=r.getAll("head")[0])||(a=r.getAll("html")[0],n=new m("head",1),a.firstChild?a.insert(n,a.firstChild,!0):a.append(n)),a=r.firstChild,o.xml_pi?(i='version="1.0"',o.docencoding&&(i+=' encoding="'+o.docencoding+'"'),7!==a.type&&(a=new m("xml",7),r.insert(a,r.firstChild,!0)),a.value=i):a&&7===a.type&&a.remove(),a=r.getAll("#doctype")[0],o.doctype?(a||(a=new m("#doctype",10),o.xml_pi?r.insert(a,r.firstChild):d(a)),a.value=o.doctype.substring(9,o.doctype.length-1)):a&&a.remove(),a=null,y.each(r.getAll("meta"),function(e){"Content-Type"===e.attr("http-equiv")&&(a=e)}),o.docencoding?(a||((a=new m("meta",1)).attr("http-equiv","Content-Type"),a.shortEnded=!0,d(a)),a.attr("content","text/html; charset="+o.docencoding)):a&&a.remove(),a=r.getAll("title")[0],o.title?(a?a.empty():d(a=new m("title",1)),a.append(new m("#text",3)).value=o.title):a&&a.remove(),y.each("keywords,description,author,copyright,robots".split(","),function(e){var t,n,l=r.getAll("meta"),i=o[e];for(t=0;t"))}(l,y.extend(c,t),i.get());i.set(n),e.close()}})},b=y.each,x=function(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})},k=function(e,t,n,l){var i,o,r,a,c,s,d="",u=e.dom;if(!l.selection&&(c=e.settings.protect,s=l.content,y.each(c,function(e){s=s.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})}),r=s,!("raw"===l.format&&t.get()||l.source_view&&h(e)))){0!==r.length||l.source_view||(r=y.trim(t.get())+"\n"+y.trim(r)+"\n"+y.trim(n.get())),-1!==(i=(r=r.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("",i),t.set(x(r.substring(0,i+1))),-1===(o=r.indexOf("\n")),a=_(t.get()),b(a.getAll("style"),function(e){e.firstChild&&(d+=e.firstChild.value)});var m=a.getAll("body")[0];m&&u.setAttribs(e.getBody(),{style:m.attr("style")||"",dir:m.attr("dir")||"",vLink:m.attr("vlink")||"",link:m.attr("link")||"",aLink:m.attr("alink")||""}),u.remove("fullpage_styles");var f=e.getDoc().getElementsByTagName("head")[0];if(d)u.add(f,"style",{id:"fullpage_styles"}).appendChild(p.document.createTextNode(d));var g={};y.each(f.getElementsByTagName("link"),function(e){"stylesheet"===e.rel&&e.getAttribute("data-mce-fullpage")&&(g[e.href]=e)}),y.each(a.getAll("link"),function(e){var t=e.attr("href");if(!t)return!0;g[t]||"stylesheet"!==e.attr("rel")||u.add(f,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete g[t]}),y.each(g,function(e){e.parentNode.removeChild(e)})}},C=function(e){var t,n="",l="";if(e.getParam("fullpage_default_xml_pi")){var i=o(e);n+='\n'}return n+=e.getParam("fullpage_default_doctype",""),n+="\n\n\n",(t=e.getParam("fullpage_default_title"))&&(n+=""+t+"\n"),(t=o(e))&&(n+='\n'),(t=g(e))&&(l+="font-family: "+t+";"),(t=v(e))&&(l+="font-size: "+t+";"),(t=e.getParam("fullpage_default_text_color"))&&(l+="color: "+t+";"),n+=" \n\n"},A=function(e,t,n,l){l.selection||l.source_view&&h(e)||(l.content=(y.trim(t)+"\n"+y.trim(l.content)+"\n"+y.trim(n)).replace(//g,function(e,t){return unescape(t)}))};!function n(){e.add("fullpage",function(e){var t,n,l,i,o,r,a=s(""),c=s("");n=a,(t=e).addCommand("mceFullPageProperties",function(){d(t,n)}),(l=e).ui.registry.addButton("fullpage",{tooltip:"Metadata and document properties",icon:"document-properties",onAction:function(){l.execCommand("mceFullPageProperties")}}),l.ui.registry.addMenuItem("fullpage",{text:"Metadata and document properties",icon:"document-properties",onAction:function(){l.execCommand("mceFullPageProperties")}}),o=a,r=c,(i=e).on("BeforeSetContent",function(e){k(i,o,r,e)}),i.on("GetContent",function(e){A(i,o.get(),r.get(),e)})})}()}(window); \ No newline at end of file diff --git a/plugins/fullscreen/plugin.js b/plugins/fullscreen/plugin.js index 3b5ccb56..59a6078c 100644 --- a/plugins/fullscreen/plugin.js +++ b/plugins/fullscreen/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function (domGlobals) { 'use strict'; diff --git a/plugins/fullscreen/plugin.min.js b/plugins/fullscreen/plugin.min.js index c19618dc..8215a0db 100644 --- a/plugins/fullscreen/plugin.min.js +++ b/plugins/fullscreen/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ !function(g){"use strict";var n,t,e,r,c=function(n){var t=n;return{get:function(){return t},set:function(n){t=n}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(n){return{isFullscreen:function(){return null!==n.get()}}},i=function(){},a=function(n){return function(){return n}},l=a(!1),f=a(!0),d=function(){return s},s=(n=function(n){return n.isNone()},{fold:function(n,t){return n()},is:l,isSome:l,isNone:f,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:e,orThunk:t,map:d,each:i,bind:d,exists:l,forall:f,filter:d,equals:n,equals_:n,toArray:function(){return[]},toString:a("none()")}),m=function(e){var n=a(e),t=function(){return o},r=function(n){return n(e)},o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:f,isNone:l,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return m(n(e))},each:function(n){n(e)},bind:r,exists:r,forall:r,filter:function(n){return n(e)?o:s},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(l,function(n){return t(e,n)})}};return o},h={some:m,none:d,from:function(n){return null===n||n===undefined?s:m(n)}},p=function(){return n=function(n){n.unbind()},t=c(h.none()),e=function(){t.get().each(n)},{clear:function(){e(),t.set(h.none())},isSet:function(){return t.get().isSome()},set:function(n){e(),t.set(h.some(n))}};var n,t,e},v=function(r){return function(n){return e=typeof(t=n),(null===t?"null":"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e)===r;var t,e}},y=function(t){return function(n){return typeof n===t}},w=v("string"),b=v("array"),S=y("boolean"),T=y("function"),x=y("number"),C=Array.prototype.push,A=function(n,t){for(var e=n.length,r=new Array(e),o=0;o'+e.name+""};return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[null==(n=e)?"":'
'+function(a){var t,e,n=(e=f((t=a).plugins),t.settings.forced_plugins===undefined?e:function(e,t){for(var n=[],a=0,o=e.length;a"+(t=a,n=e,g(C,function(e){return e.key===n}).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?s(e()):n},function(e){return s({name:e.name,url:"https://www.tiny.cloud/docs/plugins/"+e.key})}))+"";var t,n}),i=o.length,r=o.join("");return"

"+A.translate(["Plugins installed ({0}):",i])+"

    "+r+"
"}(n)+"
",(t=p(["Accessibility Checker","Advanced Code Editor","Advanced Tables","Case Change","Checklist","Tiny Comments","Tiny Drive","Enhanced Media Embed","Format Painter","Link Checker","Mentions","MoxieManager","Page Embed","Permanent Pen","PowerPaste","Spell Checker Pro"],function(e){return"
  • "+A.translate(e)+"
  • "}).join(""),'

    '+A.translate("Premium plugins:")+"

    ")].join("")}]}},x=tinymce.util.Tools.resolve("tinymce.EditorManager"),M=function(e,t){var n,a,o,i,r,s={name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:p(k,function(e){var t=p(e.shortcuts,w).join(" or ");return[e.action,t]})}]},c={name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:"

    Editor UI keyboard navigation

    \n\n

    Activating keyboard navigation

    \n\n

    The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:

    \n
      \n
    • Focus the menubar: Alt + F9 (Windows) or ⌥F9 (MacOS)
    • \n
    • Focus the toolbar: Alt + F10 (Windows) or ⌥F10 (MacOS)
    • \n
    • Focus the footer: Alt + F11 (Windows) or ⌥F11 (MacOS)
    • \n
    \n\n

    Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline.

    \n\n

    Moving between UI sections

    \n\n

    When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:

    \n
      \n
    • the menubar
    • \n
    • each group of the toolbar
    • \n
    • the sidebar
    • \n
    • the element path in the footer
    • \n
    • the wordcount toggle button in the footer
    • \n
    • the branding link in the footer
    • \n
    \n\n

    Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.

    \n\n

    Moving within UI sections

    \n\n

    Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:

    \n
      \n
    • moving between menus in the menubar
    • \n
    • moving between buttons in a toolbar group
    • \n
    • moving between items in the element path
    • \n
    \n\n

    In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group.

    \n\n

    Executing buttons

    \n\n

    To execute a button, navigate the selection to the desired button and hit space or enter.

    \n\n

    Opening, navigating and closing menus

    \n\n

    When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.

    \n\n

    To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.

    \n\n

    Context toolbars and menus

    \n\n

    To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or ⌃F9 (MacOS).

    \n\n

    Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.

    \n\n

    Dialog navigation

    \n\n

    There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.

    \n\n

    When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.

    \n\n

    When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.

    "}]},l=T(e),u=(i='TinyMCE '+(a=x.majorVersion,o=x.minorVersion,0===a.indexOf("@")?"X.X.X":a+"."+o)+"",{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"

    "+A.translate(["You are using {0}",i])+"

    ",presets:"document"}]}),h=m(((n={})[s.name]=s,n[c.name]=c,n[l.name]=l,n[u.name]=u,n),t.get());return r=e,d.from(r.getParam("help_tabs")).fold(function(){return t=f(e=h),-1!==(n=t.indexOf("versions"))&&(t.splice(n,1),t.push("versions")),{tabs:e,names:t};var e,t,n},function(e){return t=h,n={},a=p(e,function(e){return"string"==typeof e?(y(t,e)&&(n[e]=t[e]),e):(n[e.name]=e).name}),{tabs:n,names:a};var t,n,a})},P=function(o,i){return function(){var e=M(o,i),a=e.tabs,t=e.names,n={type:"tabpanel",tabs:function(e){for(var t=[],n=function(e){t.push(e)},a=0;a")}),(t=n).ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}})})}()}(); \ No newline at end of file diff --git a/plugins/image/plugin.js b/plugins/image/plugin.js index 41dfe30d..96099feb 100644 --- a/plugins/image/plugin.js +++ b/plugins/image/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function (domGlobals) { 'use strict'; @@ -1429,7 +1429,7 @@ finalize(); }).catch(function (err) { finalize(); - helpers.alertErr(api, err); + helpers.alertErr(err); }); } else { helpers.addToBlobCache(blobInfo); @@ -1549,8 +1549,8 @@ }; }; var alertErr = function (editor) { - return function (api, message) { - editor.windowManager.alert(message, api.close); + return function (message) { + editor.windowManager.alert(message); }; }; var normalizeCss$1 = function (editor) { diff --git a/plugins/image/plugin.min.js b/plugins/image/plugin.min.js index 32bfc564..e0d8d225 100644 --- a/plugins/image/plugin.min.js +++ b/plugins/image/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ -!function(m){"use strict";var e,t,n,r,o,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(){},l=function(e){return function(){return e}},s=l(!1),u=l(!0),c=function(){return d},d=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:s,isSome:s,isNone:u,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:l(null),getOrUndefined:l(undefined),or:n,orThunk:t,map:c,each:i,bind:c,exists:s,forall:u,filter:c,equals:e,equals_:e,toArray:function(){return[]},toString:l("none()")}),g=function(n){var e=l(n),t=function(){return a},r=function(e){return e(n)},a={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:u,isNone:s,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return g(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?a:d},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(s,function(e){return t(n,e)})}};return a},A={some:g,none:c,from:function(e){return null===e||e===undefined?d:g(e)}},f=function(r){return function(e){return n=typeof(t=e),(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n)===r;var t,n}},p=function(t){return function(e){return typeof e===t}},S=f("string"),h=f("object"),b=f("array"),v=(r=null,function(e){return r===e}),y=p("boolean"),w=p("number"),D=Array.prototype.push,x=function(e){for(var t=[],n=0,r=e.length;n'+n+"")}else e.insertContent(s(e,t));var i,o,u,c,m},t=function(t){t.addCommand("mceInsertDate",function(){var e;l(t,(e=t).getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),t.addCommand("mceInsertTime",function(){l(t,u(t))})},d=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(n){var e,t,r,a,i=c(n),o=(a=c(r=n),e=0]+>[^<]+<\/a>$/.test(t)||-1===t.indexOf("href=")))},G=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},J=function(t){return n=["title","rel","class","target"],e=function(n,e){return t[e].each(function(t){n[e]=0e.length?hn:vn)(t,e,n)},[]),P(r).map(function(e){return e.list}).toArray()},xn=function(a,e,s){var n,t=wn(e,(n=D(Je(a),ge.fromDom),Ne(B(n,c(Sn)),B(R(n),c(Sn)),function(e,n){return{start:e,end:n}})));k(t,function(e){var n,t;n=e.entries,t=s,k(x(n,Cn),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}n.dirty=!0}(t,e)});var r,o,i,u=(r=a,o=e.entries,I(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i=e.childNodes.length?t.data.length:0}:t.previousSibling&&_e(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&_e(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}},Pn=function(e){var n=e.cloneRange(),t=Rn(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=Rn(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},Mn=function(e,n){var t,r=D(nn(e),ge.fromDom),o=D(x(Je(e),qe),ge.fromDom),i=!1;if(r.length||o.length){var u=e.selection.getBookmark();xn(e,r,n),t=e,k(o,"Indent"===n?In:function(e){return Bn(t,e)}),e.selection.moveToBookmark(u),e.selection.setRng(Pn(e.selection.getRng())),e.nodeChanged(),i=!0}return i},Un=function(e){return Mn(e,"Indent")},_n=function(e){return Mn(e,"Outdent")},Fn=function(e){return Mn(e,"Flatten")},$n=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Hn=An.DOM,jn=function(o){var i={},e=function(e){var n,t,r;t=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"],1===t.nodeType&&(n=Hn.create("span",{"data-mce-type":"bookmark"}),t.hasChildNodes()?(r=Math.min(r,t.childNodes.length-1),e?t.insertBefore(n,t.childNodes[r]):Hn.insertAfter(n,t.childNodes[r])):t.appendChild(n),t=n,r=0),i[e?"startContainer":"endContainer"]=t,i[e?"startOffset":"endOffset"]=r};return e(!0),o.collapsed||e(),i},qn=function(o){function e(e){var n,t,r;n=r=o[e?"startContainer":"endContainer"],t=o[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(t=function(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n===e)return t;1===n.nodeType&&"bookmark"===n.getAttribute("data-mce-type")||t++,n=n.nextSibling}return-1}(n),n=n.parentNode,Hn.remove(r),!n.hasChildNodes()&&Hn.isBlock(n)&&n.appendChild(Hn.create("br"))),o[e?"startContainer":"endContainer"]=n,o[e?"startOffset":"endOffset"]=t)}e(!0),e();var n=Hn.createRng();return n.setStart(o.startContainer,o.startOffset),o.endContainer&&n.setEnd(o.endContainer,o.endOffset),Pn(n)},Kn=function(e){return/\btox\-/.test(e.className)},Vn=function(n,t,r){return function(){var e=function(e){var n=E(e.parents,Fe,Ke).filter(function(e){return e.nodeName===t&&!Kn(e)}).isSome();r(n)};return n.on("NodeChange",e),function(){return n.off("NodeChange",e)}}},Wn=function(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Qn=function(t,e){Pe.each(e,function(e,n){t.setAttribute(n,e)})},Xn=function(e,n,t){var r,o,i,u,a,s,c;r=e,o=n,u=(i=t)["list-style-type"]?i["list-style-type"]:null,r.setStyle(o,"list-style-type",u),a=e,Qn(s=n,(c=t)["list-attributes"]),Pe.each(a.select("li",s),function(e){Qn(e,c["list-item-attributes"])})},zn=function(e,n,t,r){var o,i;for(o=n[t?"startContainer":"endContainer"],i=n[t?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!t&&Ve(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(We(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Yn=function(f,d,l){void 0===l&&(l={});var e,n=f.selection.getRng(!0),m="LI",t=Ze(f,f.selection.getStart(!0)),p=f.dom;"false"!==p.getContentEditable(f.selection.getNode())&&("DL"===(d=d.toUpperCase())&&(m="DT"),e=jn(n),Pe.each(function(t,e,r){for(var o,i=[],u=t.dom,n=zn(t,e,!0,r),a=zn(t,e,!1,r),s=[],c=n;c&&(s.push(c),c!==a);c=c.nextSibling);return Pe.each(s,function(e){if(We(t,e))return i.push(e),void(o=null);if(u.isBlock(e)||Ve(e))return Ve(e)&&u.remove(e),void(o=null);var n=e.nextSibling;$n.isBookmarkNode(e)&&(We(t,n)||!n&&e.parentNode===r)?o=null:(o||(o=u.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(f,n,t),function(e){var n,t,r,o,i,u,a,s,c;(t=e.previousSibling)&&Fe(t)&&t.nodeName===d&&(r=t,o=l,i=p.getStyle(r,"list-style-type"),u=o?o["list-style-type"]:"",i===(u=null===u?"":u))?(n=t,e=p.rename(e,m),t.appendChild(e)):(n=p.create(d),e.parentNode.insertBefore(n,e),n.appendChild(e),e=p.rename(e,m)),a=p,s=e,c=["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],Pe.each(c,function(e){var n;return a.setStyle(s,((n={})[e]="",n))}),Xn(p,n,l),Jn(f.dom,n)}),f.selection.setRng(qn(e)))},Gn=function(e,n,t){return s=t,(a=n)&&s&&Fe(a)&&a.nodeName===s.nodeName&&(i=n,u=t,(o=e).getStyle(i,"list-style-type",!0)===o.getStyle(u,"list-style-type",!0))&&(r=t,n.className===r.className);var r,o,i,u,a,s},Jn=function(e,n){var t,r;if(t=n.nextSibling,Gn(e,n,t)){for(;r=t.firstChild;)n.appendChild(r);e.remove(t)}if(t=n.previousSibling,Gn(e,n,t)){for(;r=t.lastChild;)n.insertBefore(r,n.firstChild);e.remove(t)}},Zn=function(n,e,t,r,o){if(e.nodeName!==r||et(o)){var i=jn(n.selection.getRng(!0));Pe.each([e].concat(t),function(e){!function(e,n,t,r){if(n.nodeName!==t){var o=e.dom.rename(n,t);Xn(e.dom,o,r),Ie(e,Wn(t),o)}else Xn(e.dom,n,r),Ie(e,Wn(t),n)}(n,e,r,o)}),n.selection.setRng(qn(i))}else Fn(n)},et=function(e){return"list-style-type"in e},nt=function(e,n,t){var r=Ye(e),o=Ge(e);t=t||{},r&&0"):"application/x-shockwave-flash"===n.sourcemime?(l='',s.poster&&(l+=''),l+=""):-1!==n.sourcemime.indexOf("audio")?(c=n,(u=h)?u(c):'"):"script"===n.type?' "+t.getContent()+c+""}(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:t}}).focus("close")};!function t(){e.add("preview",function(e){var t,n;(t=e).addCommand("mcePreview",function(){i(t)}),(n=e).ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:function(){return n.execCommand("mcePreview")}}),n.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:function(){return n.execCommand("mcePreview")}})})}()}(); \ No newline at end of file diff --git a/plugins/print/plugin.js b/plugins/print/plugin.js index fd273a44..f11d02e6 100644 --- a/plugins/print/plugin.js +++ b/plugins/print/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function () { 'use strict'; diff --git a/plugins/print/plugin.min.js b/plugins/print/plugin.min.js index da2b30bc..d45c8d84 100644 --- a/plugins/print/plugin.min.js +++ b/plugins/print/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ !function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env");!function t(){n.add("print",function(n){var t,i;(t=n).addCommand("mcePrint",function(){e.browser.isIE()?t.getDoc().execCommand("print",!1,null):t.getWin().print()}),(i=n).ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:function(){return i.execCommand("mcePrint")}}),i.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:function(){return i.execCommand("mcePrint")}}),n.addShortcut("Meta+P","","mcePrint")})}()}(); \ No newline at end of file diff --git a/plugins/quickbars/plugin.js b/plugins/quickbars/plugin.js index 49263708..4b635f9b 100644 --- a/plugins/quickbars/plugin.js +++ b/plugins/quickbars/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function (domGlobals) { 'use strict'; diff --git a/plugins/quickbars/plugin.min.js b/plugins/quickbars/plugin.min.js index 8a8e1d1a..f471f1df 100644 --- a/plugins/quickbars/plugin.min.js +++ b/plugins/quickbars/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ !function(c){"use strict";var e,t,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=0,l=function(e,t,n){var r,o,i,u;o=(r=e.editorUpload.blobCache).create((i="mceu",u=(new Date).getTime(),i+"_"+Math.floor(1e9*Math.random())+ ++a+String(u)),n,t),r.add(o),e.insertContent(e.dom.createHTML("img",{src:o.blobUri()}))},f=tinymce.util.Tools.resolve("tinymce.util.Promise"),s=tinymce.util.Tools.resolve("tinymce.Env"),d=tinymce.util.Tools.resolve("tinymce.util.Delay"),i=function(u){u.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:function(){var i;i=u,new f(function(n){var r=c.document.createElement("input");r.type="file",r.accept="image/*",r.style.position="fixed",r.style.left="0",r.style.top="0",r.style.opacity="0.001",c.document.body.appendChild(r),r.addEventListener("change",function(e){n(Array.prototype.slice.call(e.target.files))});var o=function(e){var t=function(){n([]),r.parentNode.removeChild(r)};s.os.isAndroid()&&"remove"!==e.type?d.setEditorTimeout(i,t,0):t(),i.off("focusin remove",o)};i.on("focusin remove",o),r.click()}).then(function(e){if(0",n=0;n
    ";o+=""}return o+="",o+=""}(o,i)),(e=r.dom.select("*[data-mce-id]")[0]).removeAttribute("data-mce-id"),t=r.dom.select("td,th",e),r.selection.setCursorLocation(t[0],0)}))}})},u=function(e){return function(){return e}},m=u(!1),g=u(!0),h=function(){return p},p=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:m,isSome:m,isNone:g,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:n,orThunk:t,map:h,each:function(){},bind:h,exists:m,forall:g,filter:h,equals:e,equals_:e,toArray:function(){return[]},toString:u("none()")}),b=function(n){var e=u(n),t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:g,isNone:m,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return b(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?o:p},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(m,function(e){return t(n,e)})}};return o},v={some:b,none:h,from:function(e){return null===e||e===undefined?p:b(e)}},y=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:u(e)}},w={fromHtml:function(e,t){var n=(t||c.document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1r?[{element:n,start:Math.max(r,e.start)-r,finish:Math.min(o,e.finish)-r,matchId:t}]:[]});return{results:e.results.concat(i),last:o}},n={results:[],last:0},k(e,function(e){n=t(n,e)}),n.results),function(e){return e.matchId})},ne=function(o,e){return A(e,function(e){var t=e.elements,n=E(t,_).join(""),r=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=e.length);var o=t.regex;o.lastIndex=n;for(var i,a=[];i=o.exec(e);){var c=i[t.matchIndex],u=i.index+i[0].indexOf(c),l=u+c.length;if(r?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)};function T(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var r=function(a,r){var n,o,g,h,p,i=[],v=r.dom;function c(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function s(e){for(var t=e.parentNode;0=c.end?(o=u,a=c.end-l):r&&s.push(u),!r&&u.length+l>c.start&&(r=u,i=c.start-l),l+=u.length),r&&o){if(u=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:s,match:c.text,matchIndex:d}),l-=o.length-a,o=r=null,s=[],d++,!(c=t.shift()))break}else if(h[u.nodeName]&&!g[u.nodeName]||!u.firstChild){if(u.nextSibling){u=u.nextSibling;continue}}else if(!T(u)){u=u.firstChild;continue}for(;;){if(u.nextSibling){u=u.nextSibling;break}if(u.parentNode===e)break e;u=u.parentNode}}}(a,i,function t(o){function m(e,t){var n=i[t];n.stencil||(n.stencil=o(n));var r=n.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(v.doc.createTextNode(e)),r}return function(e){var t,n,r,o=e.startNode,i=e.endNode,a=e.matchIndex,c=v.doc;if(o===i){var s=o;r=s.parentNode,0=n.length&&e.substr(t,t+n.length)===n},le=function(e,n){return-1!==e.indexOf(n)},fe=function(e,n){return ae(e,n,0)},se=(r=/^\s+|\s+$/g,function(e){return e.replace(r,"")}),de=function(e){return e.style!==undefined&&w(e.style.getPropertyValue)},me=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:b(e)}},ge={fromHtml:function(e,n){var t=(n||p.document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1t.maxRow||st.maxCol))Qn.getAt(n,l,s).filter(r).isNone()?(o=f,0,i=e[l].element(),u=ge.fromTag("td"),pn(u,ge.fromTag("br")),(o?pn:gn)(i,u)):f=!0}}(m,g,p,d),f=p,s=N(qn(o=e,"tr"),function(e){return 0===e.dom().childElementCount}),B(s,yn),f.minCol!==f.maxCol&&f.minRow!==f.maxRow||B(qn(o,"th,td"),function(e){ue(e,"rowspan"),ue(e,"colspan")}),ue(o,"width"),ue(o,"height"),Ce(o,"width"),Ce(o,"height"),e};var et=function bf(t,r){var n=function(e){return t(e)?C.from(e.dom().nodeValue):C.none()};return{get:function(e){if(!t(e))throw new Error("Can only get "+r+" value of a "+r+" node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw "+r+" value of a "+r+" node");e.dom().nodeValue=n}}}(Z,"text"),nt=function(e){return et.get(e)},tt=function(e){return et.getOption(e)},rt=function(e,n){return et.set(e,n)},ot=function(e){return"img"===$(e)?1:tt(e).fold(function(){return fn(e).length},function(e){return e.length})},it=["img","br"],ut=function(e){return tt(e).filter(function(e){return 0!==e.trim().length||-1=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},St=function(e,n){return n.column()>=e.startCol()&&n.column()+n.colspan()-1<=e.finishCol()&&n.row()>=e.startRow()&&n.row()+n.rowspan()-1<=e.finishRow()},xt=function(e,n){return t=Math.min(e.row(),n.row()),r=Math.min(e.column(),n.column()),o=Math.max(e.row()+e.rowspan()-1,n.row()+n.rowspan()-1),i=Math.max(e.column()+e.colspan()-1,n.column()+n.colspan()-1),{startRow:b(t),startCol:b(r),finishRow:b(o),finishCol:b(i)};var t,r,o,i},Ct=function(e,n,t){var r=Qn.findItem(e,n,en),o=Qn.findItem(e,t,en);return r.bind(function(n){return o.map(function(e){return xt(n,e)})})},Rt=function(n,e,t){return Ct(n,e,t).bind(function(e){return function(e,n){for(var t=!0,r=y(St,n),o=n.startRow();o<=n.finishRow();o++)for(var i=n.startCol();i<=n.finishCol();i++)t=t&&Qn.getAt(e,o,i).exists(r);return t?C.some(n):C.none()}(n,e)})},Tt=function(t,e,n){return Ct(t,e,n).map(function(e){var n=Qn.filterItems(t,y(yt,e));return k(n,function(e){return e.element()})})},Ot=function(e,n){return Qn.findItem(e,n,function(e,n){return tn(n,e)}).map(function(e){return e.element()})},Dt=function(u,c,a){return $n(u).bind(function(e){var r,n,o,i,t=Et(e);return r=t,n=u,o=c,i=a,Qn.findItem(r,n,en).bind(function(e){var n=0=r.length-1)return C.none();var e=r[o].fold(function(){var e,n,t=(e=r.slice(0,o),(n=T.call(e,0)).reverse(),n);return L(t,function(e,n){return e.map(function(e){return{value:e,delta:n+1}})})},function(e){return C.some({value:e,delta:0})}),n=r[o+1].fold(function(){var e=r.slice(o+1);return L(e,function(e,n){return e.map(function(e){return{value:e,delta:n+1}})})},function(e){return C.some({value:e,delta:1})});return e.bind(function(t){return n.map(function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n})})},mo=function(t){var e=t.grid,n=fo(0,e.columns()),r=fo(0,e.rows());return k(n,function(n){return go(function(){return j(r,function(e){return Qn.getAt(t,e,n).filter(function(e){return e.column()===n}).fold(b([]),function(e){return[e]})})},function(e){return 1===e.colspan()},function(){return Qn.getAt(t,0,n)})})},go=function(e,n,t){var r=e();return M(r,n).orThunk(function(){return C.from(r[0]).orThunk(t)}).map(function(e){return e.element()})},po=function(t){var e=t.grid,n=fo(0,e.rows()),r=fo(0,e.columns());return k(n,function(n){return go(function(){return j(r,function(e){return Qn.getAt(t,n,e).filter(function(e){return e.row()===n}).fold(b([]),function(e){return[e]})})},function(e){return 1===e.rowspan()},function(){return Qn.getAt(t,n,0)})})},ho=function(e){var n=e.replace(/\./g,"-");return{resolve:function(e){return n+"-"+e}}},vo=ho("ephox-snooker").resolve,bo=vo("resizer-bar"),wo=vo("resizer-rows"),yo=vo("resizer-cols"),So=function(e){var n=En(e.parent(),"."+bo);B(n,yn)},xo=function(t,e,r){var o=t.origin();B(e,function(e){e.each(function(e){var n=r(o,e);co(n,bo),pn(t.parent(),n)})})},Co=function(e,n,l,f){xo(e,n,function(e,n){var t,r,o,i,u,c,a=(t=n.col,r=n.x-e.left(),o=l.top()-e.top(),i=7,u=f,c=ge.fromTag("div"),we(c,{position:"absolute",left:r-i/2+"px",top:o+"px",height:u+"px",width:i+"px"}),te(c,{"data-column":t,role:"presentation"}),c);return co(a,yo),a})},Ro=function(e,n,l,f){xo(e,n,function(e,n){var t,r,o,i,u,c,a=(t=n.row,r=l.left()-e.left(),o=n.y-e.top(),i=f,u=7,c=ge.fromTag("div"),we(c,{position:"absolute",left:r+"px",top:o-u/2+"px",height:u+"px",width:i+"px"}),te(c,{"data-row":t,role:"presentation"}),c);return co(a,wo),a})},To=function(e,n,t,r){So(e);var o=Gn(n),i=Qn.generate(o);!function(e,n,t,r,o,i){var u=jr(n),c=0=n.length||e.column()>Po(n[0]))return $o.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=n.slice(e.row()),o=r[0].cells().slice(e.column()),i=Po(t[0]),u=t.length;return $o.value({rowDelta:r.length-u,colDelta:o.length-i})}(t,r,o).map(function(e){var n=Zo(r,e,i);return function(e,n,t,r,o){for(var i,u,c,a,l,f=e.row(),s=e.column(),d=f+t.length,m=s+Po(t[0]),g=f;g',r.insertBefore(o,r.firstChild)),""===u.align?Xu(t,r):Vu(t,r,u.align),t.focus(),t.addVisual()})},xc=function(e,n){var t,r,o,i,u,c,a,l,f=e.dom,s=nc(e,Cu(e));!1===n?(t=f.getParent(e.selection.getStart(),"table"))?(o=t,i=Cu(r=e),l=r.dom,s=Re(Re({width:l.getStyle(o,"width")||l.getAttrib(o,"width"),height:l.getStyle(o,"height")||l.getAttrib(o,"height"),cellspacing:l.getStyle(o,"border-spacing")||l.getAttrib(o,"cellspacing"),cellpadding:l.getAttrib(o,"cellpadding")||Uu(r.dom,o,"padding"),border:(u=l,c=o,a=xe(ge.fromDom(c),"border-width"),Ru(r)&&a.isSome()?a.getOr(""):u.getAttrib(c,"border")||Uu(r.dom,c,"border-width")||Uu(r.dom,c,"border")),caption:!!l.select("caption",o)[0],"class":l.getAttrib(o,"class","")},Zu("align","align",r,o)),i?Gu(l,o):{})):Cu(e)&&(s.borderstyle="",s.bordercolor="",s.backgroundcolor=""):(s.cols="1",s.rows="1",Cu(e)&&(s.borderstyle="",s.bordercolor="",s.backgroundcolor=""));var d=0=e.left&&n<=e.right&&t>=e.top&&t<=e.bottom}),ga=function(t,r,e,n,o){var i=function(e){var n=t.dom().createRange();return n.setStart(r.dom(),e),n.collapse(!0),n},u=nt(r).length,c=function(e,n,t,r,o){if(0===o)return 0;if(n===r)return o-1;for(var i=r,u=1;ur.left&&o.leftt.right;var n,t})});var t},El={point:function(e){return e.bottom},adjuster:function(e,n,t,r,o){var i=yl(o,5);return Math.abs(t.bottom-r.bottom)<1||t.top>o.bottom?Dl.retry(i):t.top===o.bottom?Dl.retry(yl(o,1)):Al(e,n,o)?Dl.retry(xl(i,5,0)):Dl.none()},move:yl,gather:fl},kl=function(t,r,o,i,u){return 0===u?C.some(i):(a=t,l=i.left,f=r.point(i),a.elementFromPoint(l,f).filter(function(e){return"table"===$(e)}).isSome()?(n=i,c=u-1,kl(t,e=r,o,e.move(n,5),c)):t.situsFromPoint(i.left,r.point(i)).bind(function(e){return e.start().fold(C.none,function(n){return Ol(t,n).bind(function(e){return r.adjuster(t,n,e,o,i).fold(C.none,function(e){return kl(t,r,o,e,u-1)})}).orThunk(function(){return C.some(i)})},C.none)}));var e,n,c,a,l,f},Bl=function(n,t,e){var r,o,i,u=n.move(e,5),c=kl(t,n,e,u,100).getOr(u);return o=c,i=t,((r=n).point(o)>i.getInnerHeight()?C.some(r.point(o)-i.getInnerHeight()):r.point(o)<0?C.some(-r.point(o)):C.none()).fold(function(){return t.situsFromPoint(c.left,n.point(c))},function(e){return t.scrollBy(0,e),t.situsFromPoint(c.left,n.point(c)-e)})},Nl={tryUp:y(Bl,{point:function(e){return e.top},adjuster:function(e,n,t,r,o){var i=Sl(o,5);return Math.abs(t.top-r.top)<1||t.bottom":">","&":"&","'":"'"},C=function(e){return e.replace(/["'<>&]/g,function(e){return(P(t=D,n=e)?O.from(t[n]):O.none()).getOr(e);var t,n})},A=function(l,t){var e=function(e){return function(e,t){for(var n=e.length,r=new Array(n),a=0;a")){var n="";p.each(t.contentCSS,function(e){n+=''});var r=t.settings.body_class||"";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_class","","hash"))[t.id]||"");var a=t.dom.encode,o=t.getBody().dir,u=o?' dir="'+a(o)+'"':"";e=""+n+' "+e+""}return g(e,t.getParam("template_preview_replace_values"))}(l,n),a=[{type:"selectbox",name:"template",label:"Templates",items:u},{type:"htmlpanel",html:'

    '+C(t.value.description)+"

    "},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],o={template:t.text,preview:r};e.unblock(),e.redial(i(a,o)),e.focus("template")},t=l.windowManager.open(i([],{template:"",preview:""}));t.block("Loading..."),m(o[0]).then(function(e){c(t,o[0],e)})["catch"](function(){c(t,o[0],""),t.disable("save"),f(t)})})},N=function(t){return function(e){A(t,e)}};!function H(){e.add("template",function(e){var t,r;(t=e).ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:d(t.settings,N(t))}),t.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:d(t.settings,N(t))}),b(e),(r=e).on("PreProcess",function(e){var t=r.dom,n=s(r);p.each(t.select("div",e.node),function(e){t.hasClass(e,"mceTmpl")&&(p.each(t.select("*",e),function(e){t.hasClass(e,r.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(e.innerHTML=m(r,n))}),v(r,e))})})})}()}(); \ No newline at end of file diff --git a/plugins/textcolor/plugin.js b/plugins/textcolor/plugin.js index 836a6d54..d7c370c0 100644 --- a/plugins/textcolor/plugin.js +++ b/plugins/textcolor/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function (domGlobals) { 'use strict'; diff --git a/plugins/textcolor/plugin.min.js b/plugins/textcolor/plugin.min.js index c8b8ab20..b625ffb9 100644 --- a/plugins/textcolor/plugin.min.js +++ b/plugins/textcolor/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ !function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("textcolor",function(){o.console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); \ No newline at end of file diff --git a/plugins/textpattern/plugin.js b/plugins/textpattern/plugin.js index c8b16643..d3461838 100644 --- a/plugins/textpattern/plugin.js +++ b/plugins/textpattern/plugin.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function (domGlobals) { 'use strict'; diff --git a/plugins/textpattern/plugin.min.js b/plugins/textpattern/plugin.min.js index 37daf82c..b74b1f1a 100644 --- a/plugins/textpattern/plugin.min.js +++ b/plugins/textpattern/plugin.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ !function(f){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){return(u=Object.assign||function(t){for(var n,r=1,e=arguments.length;rn.start.length?-1:1},(e=b.call(n,0)).sort(r),e;var n,r,e},U=function(o){var a=function(t){return D.error({message:t,pattern:o})},t=function(t,n,r){if(o.format===undefined)return o.cmd!==undefined?p(o.cmd)?D.value(r(o.cmd,o.value)):a(t+" pattern has non-string `cmd` parameter"):a(t+" pattern is missing both `format` and `cmd` parameters");var e=void 0;if(v(o.format)){if(!T(o.format,p))return a(t+" pattern has non-string items in the `format` array");e=o.format}else{if(!p(o.format))return a(t+" pattern has non-string `format` parameter");e=[o.format]}return D.value(n(e))};if(!h(o))return a("Raw pattern is not an object");if(!p(o.start))return a("Raw pattern is missing `start` parameter");if(o.end===undefined)return o.replacement!==undefined?p(o.replacement)?0===o.start.length?a("Replacement pattern has empty `start` parameter"):D.value({type:"inline-command",start:"",end:o.start,cmd:"mceInsertContent",value:o.replacement}):a("Replacement pattern has non-string `replacement` parameter"):0===o.start.length?a("Block pattern has empty `start` parameter"):t("Block",function(t){return{type:"block-format",start:o.start,format:t[0]}},function(t,n){return{type:"block-command",start:o.start,cmd:t,value:n}});if(!p(o.end))return a("Inline pattern has non-string `end` parameter");if(0===o.start.length&&0===o.end.length)return a("Inline pattern has empty `start` and `end` parameters");var r=o.start,e=o.end;return 0===e.length&&(e=r,r=""),t("Inline",function(t){return{type:"inline-format",start:r,end:e,format:t}},function(t,n){return{type:"inline-command",start:r,end:e,cmd:t,value:n}})},q=function(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{start:t.start,end:t.end,format:1===t.format.length?t.format[0]:t.format}:void 0},L=function(t){return{inlinePatterns:E(t,I),blockPatterns:_(E(t,j))}},V=function(e){return{setPatterns:function(t){var n=M(w(t,U));if(0n.data.length))return[];for(var e=[r],o=n;o!==t&&o.parentNode;){for(var a=o.parentNode,i=0;i=t.length)return y.some(Z(t,n));var e=Y(at);return y.from(e.forwards(t,n,it(t),r)).map(function(t){return Z(t.container,0)})})(o,0,o).each(function(t){var r=t.container;ct(r,n.start.length,o).each(function(t){var n=e.createRng();n.setStart(r,0),n.setEnd(t.container,t.offset),nt(e,n,function(t){return t===o})})})},ht=function(e,a){var i=e.dom,t=e.selection.getRng();return ot(e,t).filter(function(t){var n=J(e),r=""===n&&i.is(t,"body")||i.is(t,n);return null!==t&&r}).bind(function(n){var t,r,e,o=n.textContent;return(t=a,e=(r=o).replace("\xa0"," "),R(t,function(t){return 0===r.indexOf(t.start)||0===e.indexOf(t.start)})).map(function(t){return z.trim(o).length===t.start.length?[]:[{pattern:t,range:dt(i.getRoot(),n,0,n,0)}]})}).getOr([])},vt=function(i,t){if(0!==t.length){var n=i.selection.getBookmark();C(t,function(t){return r=t,e=(n=i).dom,o=r.pattern,a=gt(e.getRoot(),r.range).getOrDie("Unable to resolve path range"),ot(n,a).each(function(t){"block-format"===o.type?rt(o.format,n.formatter)&&n.undoManager.transact(function(){pt(n.dom,t,o),n.formatter.apply(o.format)}):"block-command"===o.type&&n.undoManager.transact(function(){pt(n.dom,t,o),n.execCommand(o.cmd,!1,o.value)})}),1;var n,r,e,o,a}),i.selection.moveToBookmark(n)}},yt=0,bt=function(t,n){return t.create("span",{"data-mce-type":"bookmark",id:n})},kt=function(t,n){var r=t.createRng();return r.setStartAfter(n.start),r.setEndBefore(n.end),r},Ot=function(t,n,r){var e=gt(t.getRoot(),r).getOrDie("Unable to resolve path range"),o=e.startContainer,a=e.endContainer,i=0===e.endOffset?a:a.splitText(e.endOffset),u=0===e.startOffset?o:o.splitText(e.startOffset);return{prefix:n,end:i.parentNode.insertBefore(bt(t,n+"-end"),i),start:u.parentNode.insertBefore(bt(t,n+"-start"),u)}},wt=function(t,n,r){tt(t,t.get(n.prefix+"-end"),r),tt(t,t.get(n.prefix+"-start"),r)},Ct=function(e,o,a,t){var i,u=o.start;return st(e,t.container,t.offset,(i=u,function(t,n){var r=t.data.substring(0,n),e=r.lastIndexOf(i.charAt(i.length-1)),o=r.lastIndexOf(i);return-1!==o?o+i.length:-1!==e?e+1:-1}),a).bind(function(r){if(r.offset>=u.length){var t=e.createRng();return t.setStart(r.container,r.offset-u.length),t.setEnd(r.container,r.offset),y.some(t)}var n=r.offset-u.length;return ft(r.container,n,a).map(function(t){var n=e.createRng();return n.setStart(t.container,t.offset),n.setEnd(r.container,r.offset),n}).filter(function(t){return t.toString()===u}).orThunk(function(){return Ct(e,o,a,Z(r.container,0))})})},Et=function(a,i,u){var f=a.dom,c=f.getRoot(),s=u.pattern,l=u.position.container,d=u.position.offset;return ft(l,d-u.pattern.end.length,i).bind(function(t){var e=dt(c,t.container,t.offset,l,d);if(et(s))return y.some({matches:[{pattern:s,startRng:e,endRng:e}],position:t});var n=xt(a,u.remainingPatterns,t.container,t.offset,i),o=n.getOr({matches:[],position:t}),r=o.position;return function(t,r,n,e,o,a){if(void 0===a&&(a=!1),0!==r.start.length||a)return ut(n,e,o).bind(function(n){return Ct(t,r,o,n).bind(function(t){if(a){if(t.endContainer===n.container&&t.endOffset===n.offset)return y.none();if(0===n.offset&&t.endContainer.textContent.length===t.endOffset)return y.none()}return y.some(t)})});var i=t.createRng();return i.setStart(n,e),i.setEnd(n,e),y.some(i)}(f,s,r.container,r.offset,i,n.isNone()).map(function(t){var n,r=dt(c,(n=t).startContainer,n.startOffset,n.endContainer,n.endOffset);return{matches:o.matches.concat([{pattern:s,startRng:r,endRng:e}]),position:Z(t.startContainer,t.startOffset)}})})},xt=function(d,m,g,p,h){var v=d.dom;return ut(g,p,v.getRoot()).bind(function(t){var n=v.createRng();n.setStart(h,0),n.setEnd(g,p);for(var r,e,o,a,i,u=n.toString(),f=0;f=a.length&&o.substr(i,i+a.length)===a){var s=m.slice();s.splice(f,1);var l=Et(d,h,{pattern:c,remainingPatterns:s,position:t});if(l.isSome())return l}}return y.none()})},Rt=function(n,t,r){n.selection.setRng(r),"inline-format"===t.type?C(t.format,function(t){n.formatter.apply(t)}):n.execCommand(t.cmd,!1,t.value)},Tt=function(o,t){var n,r,a=(n="mce_textpattern",r=(new Date).getTime(),n+"_"+Math.floor(1e9*Math.random())+ ++yt+String(r)),i=x(t,function(t,n){var r=Ot(o,a+"_end"+t.length,n.endRng);return t.concat([u(u({},n),{endMarker:r})])},[]);return x(i,function(t,n){var r=i.length-t.length-1,e=et(n.pattern)?n.endMarker:Ot(o,a+"_start"+r,n.startRng);return t.concat([u(u({},n),{startMarker:e})])},[])},Nt=function(r,e,o){var a=r.selection.getRng();return!1===a.collapsed?[]:ot(r,a).bind(function(t){var n=a.startOffset-(o?1:0);return xt(r,e,a.startContainer,n,t)}).fold(function(){return[]},function(t){return t.matches})},Pt=function(f,t){if(0!==t.length){var c=f.dom,n=f.selection.getBookmark(),r=Tt(c,t);C(r,function(t){var n,r,e,o,a,i=c.getParent(t.startMarker.start,c.isBlock),u=function(t){return t===i};et(t.pattern)?(n=f,r=t.pattern,e=t.endMarker,o=u,a=kt(n.dom,e),nt(n.dom,a,o),Rt(n,r,a)):function(t,n,r,e,o){var a=t.dom,i=kt(a,e),u=kt(a,r);nt(a,u,o),nt(a,i,o);var f={prefix:r.prefix,start:r.end,end:e.start},c=kt(a,f);Rt(t,n,c)}(f,t.pattern,t.startMarker,t.endMarker,u),wt(c,t.endMarker,u),wt(c,t.startMarker,u)}),f.selection.moveToBookmark(n)}},St=function(t,n){var r=Nt(t,n.inlinePatterns,!0);0","<"+r+' contenteditable="true">'+s.DOM.encode(c)+l),e=0;e";else for(n=d;n
  • ";if(a+=''+o.title+"",i!==o.level&&i)for(n=o.level;i
  • ";else a+="
  • ",i||(a+="");d=o.level}return a},r=function(t){var e,n,o,i,r=l(t),c=t.$("."+r);o=t,!(i=c).length||0'+n+"")):g(t)},g=function(t){var e=l(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(d(t))})},o=function(n){return function(t){var e=function(){return t.setDisabled(n.mode.isReadOnly()||!(0'+n+"
    "},F=function(n){var t=T(n);return k(n)&&t!==undefined&&_.test(t)},I=function(n,t){var e=[],r=function(n,t){for(var e=n.length,r=new Array(e),o=0;ou.length-1&&0!==c||s===m&&g===m||(a=u[c+2],s===m&&(g===W||g===E||g===B)&&a===m||(i=u[c-1],(s===W||s===E||g===B)&&g===m&&i===m||!(s!==R&&s!==m||g!==R&&g!==m)||(s===x||s===E)&&g===R&&i===R||s===R&&(g===x||g===E)&&a===R||s===j||s===A||i===j||i===A||g===j||g===A||s===b&&g===S||s!==F&&s!==b&&s!==S&&g!==F&&g!==b&&g!==S&&(s===D&&g===D||g===T&&(s===m||s===R||s===D||s===T)||s===T&&(g===m||g===R||g===D)||s===B))))){var f=e[d];if((r.includeWhitespace||!M.test(f))&&(r.includePunctuation||!O.test(f))){var h=d-p.length+1,C=d+1,y=e.slice(h,C).join("");if("http"===(o=y)||"https"===o){var v=U(e,d),w=t.slice(C,v);Array.prototype.push.apply(p,w),d=v}l.push(p)}p=[]}return l}(r,o,P(o),n)},N=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),$=function(t,e){for(var n,r=e.getBlockElements(),o=e.getShortEndedElements(),u=[],c="",i=new N(t,t);t=i.next();)3===t.nodeType?c+=t.data.replace(/\uFEFF/g,""):(r[(n=t).nodeName]||o[n.nodeName])&&c.length&&(u.push(c),c="");return c.length&&u.push(c),u},z=function(t){return t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length},I=function(t,e){var n=$(t,e).join("\n");return _(n.split(""),r).length},Z=function(t,e){var n=$(t,e).join("");return z(n)},q=function(t,e){var n=$(t,e).join("").replace(/\s/g,"");return z(n)},G=function(t,e){return function(){return e(t.getBody(),t.schema)}},H=function(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}},J=function(t){return G(t,I)},K=tinymce.util.Tools.resolve("tinymce.util.Delay"),L=function(t,e){var n;n=e,t.fire("wordCountUpdate",{wordCount:{words:n.body.getWordCount(),characters:n.body.getCharacterCount(),charactersWithoutSpaces:n.body.getCharacterCountWithoutSpaces()}})},Q=function(t,e){t.windowManager.open({title:"Word Count",body:{type:"panel",items:[{type:"table",header:["Count","Document","Selection"],cells:[["Words",String(e.body.getWordCount()),String(e.selection.getWordCount())],["Characters (no spaces)",String(e.body.getCharacterCountWithoutSpaces()),String(e.selection.getCharacterCountWithoutSpaces())],["Characters",String(e.body.getCharacterCount()),String(e.selection.getCharacterCount())]]}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}]})};!function V(s){void 0===s&&(s=300),t.add("wordcount",function(t){var e,n,r,o,u,c,i,a={body:{getWordCount:J(e=t),getCharacterCount:G(e,Z),getCharacterCountWithoutSpaces:G(e,q)},selection:{getWordCount:H(e,I),getCharacterCount:H(e,Z),getCharacterCountWithoutSpaces:H(e,q)},getCount:J(e)};return r=a,(n=t).ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return Q(n,r)}}),n.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return Q(n,r)}}),o=t,u=a,c=s,i=K.debounce(function(){return L(o,u)},c),o.on("init",function(){L(o,u),K.setEditorTimeout(o,function(){o.on("SetContent BeforeAddUndo Undo Redo keyup",i)},0)}),a})}()}(); \ No newline at end of file diff --git a/skins/content/dark/content.css b/skins/content/dark/content.css index d71d87e9..10ce487b 100644 --- a/skins/content/dark/content.css +++ b/skins/content/dark/content.css @@ -4,14 +4,10 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ -html { - height: 100%; -} body { background-color: #2f3742; color: #dfe0e4; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - height: calc(100% - 2rem); line-height: 1.4; margin: 1rem; } diff --git a/skins/content/dark/content.min.css b/skins/content/dark/content.min.css index df323f6d..764ae9a1 100644 --- a/skins/content/dark/content.min.css +++ b/skins/content/dark/content.min.css @@ -4,4 +4,4 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ -html{height:100%}body{background-color:#2f3742;color:#dfe0e4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;height:calc(100% - 2rem);line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table td,table th{border:1px solid #6d737b;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}td[data-mce-selected],th[data-mce-selected]{color:#333}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem} +body{background-color:#2f3742;color:#dfe0e4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table td,table th{border:1px solid #6d737b;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}td[data-mce-selected],th[data-mce-selected]{color:#333}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem} diff --git a/skins/content/default/content.css b/skins/content/default/content.css index 131dfc30..e57e8398 100644 --- a/skins/content/default/content.css +++ b/skins/content/default/content.css @@ -4,12 +4,8 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ -html { - height: 100%; -} body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - height: calc(100% - 2rem); line-height: 1.4; margin: 1rem; } diff --git a/skins/content/default/content.min.css b/skins/content/default/content.min.css index 5b7a9d8b..81811bce 100644 --- a/skins/content/default/content.min.css +++ b/skins/content/default/content.min.css @@ -4,4 +4,4 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ -html{height:100%}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;height:calc(100% - 2rem);line-height:1.4;margin:1rem}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} +body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} diff --git a/skins/content/document/content.css b/skins/content/document/content.css index 6720d08b..2d79e43c 100644 --- a/skins/content/document/content.css +++ b/skins/content/document/content.css @@ -7,7 +7,7 @@ @media screen { html { background: #f4f4f4; - height: 100%; + min-height: 100%; } } body { @@ -18,9 +18,9 @@ body { background-color: #fff; box-shadow: 0 0 4px rgba(0, 0, 0, 0.15); box-sizing: border-box; - height: calc(100% - 1rem); margin: 1rem auto 0; max-width: 820px; + min-height: calc(100vh - 1rem); padding: 4rem 6rem 6rem 6rem; } } diff --git a/skins/content/document/content.min.css b/skins/content/document/content.min.css index a29a4bc7..f26eaf66 100644 --- a/skins/content/document/content.min.css +++ b/skins/content/document/content.min.css @@ -4,4 +4,4 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ -@media screen{html{background:#f4f4f4;height:100%}}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}@media screen{body{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);box-sizing:border-box;height:calc(100% - 1rem);margin:1rem auto 0;max-width:820px;padding:4rem 6rem 6rem 6rem}}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure figcaption{color:#999;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} +@media screen{html{background:#f4f4f4;min-height:100%}}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}@media screen{body{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);box-sizing:border-box;margin:1rem auto 0;max-width:820px;min-height:calc(100vh - 1rem);padding:4rem 6rem 6rem 6rem}}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure figcaption{color:#999;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} diff --git a/skins/content/writer/content.css b/skins/content/writer/content.css index f015baa2..00ae0fb6 100644 --- a/skins/content/writer/content.css +++ b/skins/content/writer/content.css @@ -4,12 +4,8 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ -html { - height: 100%; -} body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - height: calc(100% - 2rem); line-height: 1.4; margin: 1rem auto; max-width: 900px; diff --git a/skins/content/writer/content.min.css b/skins/content/writer/content.min.css index 2e53d87a..29837911 100644 --- a/skins/content/writer/content.min.css +++ b/skins/content/writer/content.min.css @@ -4,4 +4,4 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ -html{height:100%}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;height:calc(100% - 2rem);line-height:1.4;margin:1rem auto;max-width:900px}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} +body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem auto;max-width:900px}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} diff --git a/themes/mobile/theme.js b/themes/mobile/theme.js index 641bb39a..5d82c856 100644 --- a/themes/mobile/theme.js +++ b/themes/mobile/theme.js @@ -4,7 +4,7 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ (function (domGlobals) { 'use strict'; @@ -7760,7 +7760,8 @@ ], 'alloy.receive': [ 'receiving', - 'reflecting' + 'reflecting', + 'tooltipping' ] }), anyValue$1()), option('domModification') diff --git a/themes/mobile/theme.min.js b/themes/mobile/theme.min.js index d6735daf..db11e8ca 100644 --- a/themes/mobile/theme.min.js +++ b/themes/mobile/theme.min.js @@ -4,6 +4,6 @@ * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * - * Version: 5.3.0 (2020-05-21) + * Version: 5.3.1 (2020-05-27) */ -!function(v){"use strict";var x=function(){return(x=Object.assign||function(n){for(var e,t=1,r=arguments.length;t "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"}}},Xt=function(t,i){var u=function(n,e){return o=$t(t),function(t,r,n){var e=gn(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return jt(e)}(n,b,e);var o};return{extract:function(t,r,o){var n=T(o),e=u(t,n);return xt(e,function(n){var e=gn(n,function(n){return Pt.field(n,n,Et(),i)});return Wt(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"}}},qt=y($t(vt)),Yt=Pt.state,Kt=Pt.field,Jt=function(t,e,r,o,i){return I(o,i).fold(function(){return n=o,e=i,Nt(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Ht(n)});var n,e},function(n){return n.extract(t.concat(["branch: "+i]),e,r)})},Qt=function(o,i){return{extract:function(e,t,r){return I(r,o).fold(function(){return n=o,Nt(e,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return Jt(e,t,r,i,n)})},toString:function(){return"chooseOn("+o+"). Possible values: "+T(i)}}},Zt=$t(vt),nr=function(e){return $t(function(n){return e(n).fold(bt,vt)})},er=function(e,n){return Xt(function(n){return pt(e(n))},n)},tr=function(n,e,t){return ht((r=n,o=b,i=t,u=e.extract([r],o,i),Ot(u,function(n){return{input:i,errors:n}})));var r,o,i,u},rr=function(n){return n.fold(function(n){throw new Error(ir(n))},b)},or=function(n,e,t){return rr(tr(n,e,t))},ir=function(n){return"Errors: \n"+(e=n.errors,t=10 ")+")\n"+n.getErrorInfo()}).join("\n"))+"\n\nInput object: "+Ht(n.input);var e,t},ur=function(n,e){return Qt(n,C(e,Wt))},cr=y(Zt),ar=(ft=cn,st="function",$t(function(n){var e=typeof n;return ft(n)?vt(n):bt("Expected type: "+st+" but got: "+e)})),fr=function(n){return Kt(n,n,Et(),qt())},sr=function(n,e){return Kt(n,n,Et(),e)},lr=function(n,e){return Kt(n,n,Et(),Wt(e))},dr=function(n){return Kt(n,n,Ct(),qt())},mr=function(n,e){return Kt(n,n,Ct(),e)},gr=function(n,e){return mr(n,Wt(e))},pr=function(n,e){return mr(n,Ut(e))},hr=function(n,e){return Kt(n,n,kt(e),qt())},vr=function(n,e,t){return Kt(n,n,kt(e),t)},yr=function(n,e){return Yt(n,e)},br=function(n){return cn(n)?n:y(!1)},xr=function(n,e,t){var r=e(n),o=br(t);return r.orThunk(function(){return o(n)?O.none():function(n,e,t){for(var r=n.dom(),o=br(t);r.parentNode;){r=r.parentNode;var i=Te.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return O.none()}(n,e,o)})},wr=function(n,e){return Ae(n.element(),e.event().target())},Sr=function(n){if(!R(n,"can")&&!R(n,"abort")&&!R(n,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(n,null,2)+" does not have can, abort, or run!");return or("Extracting event.handler",Ut([hr("can",y(!0)),hr("abort",y(!1)),hr("run",w)]),n)},Or=function(t){var e,r,o,i,n=(r=function(n){return n.can},function(){for(var t=[],n=0;n=r.length&&t.substr(o,o+r.length)===r?n.substring(0,n.length-"/*".length):n;var e,t,r,o})},jr=function(n,e){var t=n.toString(),r=t.indexOf(")")+1,o=t.indexOf("("),i=t.substring(o+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:e,parameters:Ar(i)}},n},Hr=function(n){return{classes:n.classes!==undefined?n.classes:[],attributes:n.attributes!==undefined?n.attributes:{},styles:n.styles!==undefined?n.styles:{}}},Nr=function(t,r,o){return Vr(function(n,e){o(n,t,r)})},Pr=function(o,i,u){var n,e,t,r,c,a;return n=function(t){for(var n=[],e=1;e"}),cr()),Fa=yr("schema",function(){return[dr("preprocess")]}),Ra=hr("defaults",y({})),Va=hr("overrides",y({})),Ba=Wt([Ma,_a,Da,Ia,Ra,Va]),Aa=Wt([Ma,_a,Da,Ra,Va]),ja=Wt([Ma,_a,Da,Ia,Ra,Va]),Ha=Wt([Ma,Fa,Da,fr("unit"),Ia,Ra,Va]),Na=function(n){var e=function(n){return n.name};return n.fold(e,e,e,e)},Pa=function(t,r){return function(n){var e=or("Converting part type",r,n);return t(e)}},za=Pa(Ca.required,Ba),La=(Pa(Ca.external,Aa),Pa(Ca.optional,ja)),Ga=Pa(Ca.group,Ha),$a=y("entirety"),Ua=function(n,e,t,r){return ct(e.defaults(n,t,r),t,{uid:n.partUids[e.name]},e.overrides(n,t,r))},Wa=function(o,n){var e={};return pn(n,function(n){n.fold(O.some,O.none,O.some,O.some).each(function(t){var r=Xa(o,t.pname);e[t.name]=function(n){var e=or("Part: "+t.name+" in "+o,Wt(t.schema),n);return x(x({},r),{config:n,validated:e})}})}),e},Xa=function(n,e){return{uiType:Ta(),owner:n,name:e}},qa=function(n,e,t){return r=e,i={},o={},pn(t,function(n){n.fold(function(r){i[r.pname]=Sa(!0,function(n,e,t){return r.factory.sketch(Ua(n,r,e,t))})},function(n){var e=r.parts[n.name];o[n.name]=y(n.factory.sketch(Ua(r,n,e[$a()]),e))},function(r){i[r.pname]=Sa(!1,function(n,e,t){return r.factory.sketch(Ua(n,r,e,t))})},function(o){i[o.pname]=Oa(!0,function(e,n,t){var r=e[o.name];return gn(r,function(n){return o.factory.sketch(ct(o.defaults(e,n,t),n,o.overrides(e,n)))})})})}),{internals:y(i),externals:y(o)};var r,i,o},Ya=function(n,e,t){return wa(O.some(n),e,e.components,t)},Ka=function(n,e,t){var r=e.partUids[t];return n.getSystem().getByUid(r).toOption()},Ja=function(n,e,t){return Ka(n,e,t).getOrDie("Could not find part: "+t)},Qa=function(e,n){var t=gn(n,Na);return Rt(gn(t,function(n){return{key:n,value:e+"-"+n}}))},Za=function(e){return Kt("partUids","partUids",_t(function(n){return Qa(n.uid,e)}),cr())},nf=Ea("alloy-premade"),ef=function(n){return Ft(nf,n)},tf=function(r){return n=function(n){for(var e=[],t=1;t
    ')},function(n){return Tf(''+n+"")})},_f=function(n,e,t,r){return wf.sketch({dom:Mf(n,r),action:e,buttonBehaviours:ct(Ur([Sf.config({})]),t)})},Df=La({schema:[fr("dom")],name:"label"}),If=function(e){return La({name:e+"-edge",overrides:function(n){return n.model.manager.edgeActions[e].fold(function(){return{}},function(r){return{events:Tr([Cr(Gn(),function(n,e,t){return r(n,t)},[n]),Cr(Wn(),function(n,e,t){return r(n,t)},[n]),Cr(Xn(),function(n,e,t){t.mouseIsDown.get()&&r(n,t)},[n])])}})}})},Ff=If("top-left"),Rf=If("top"),Vf=If("top-right"),Bf=If("right"),Af=If("bottom-right"),jf=If("bottom"),Hf=If("bottom-left"),Nf=[Df,If("left"),Bf,Rf,jf,Ff,Vf,Hf,Af,za({name:"thumb",defaults:y({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:Tr([Dr(Gn(),n,"spectrum"),Dr($n(),n,"spectrum"),Dr(Un(),n,"spectrum"),Dr(Wn(),n,"spectrum"),Dr(Xn(),n,"spectrum"),Dr(qn(),n,"spectrum")])}}}),za({schema:[yr("mouseIsDown",function(){return ho(!1)})],name:"spectrum",overrides:function(t){var r=t.model.manager,o=function(e,n){return r.getValueFromEvent(n).map(function(n){return r.setValueFrom(e,t,n)})};return{behaviours:Ur([sa.config({mode:"special",onLeft:function(n){return r.onLeft(n,t)},onRight:function(n){return r.onRight(n,t)},onUp:function(n){return r.onUp(n,t)},onDown:function(n){return r.onDown(n,t)}}),ki.config({})]),events:Tr([Er(Gn(),o),Er($n(),o),Er(Wn(),o),Er(Xn(),function(n,e){t.mouseIsDown.get()&&o(n,e)})])}}})],Pf=function(n,e,t){e.store.manager.onLoad(n,e,t)},zf=function(n,e,t){e.store.manager.onUnload(n,e,t)},Lf=/* */Object.freeze({__proto__:null,onLoad:Pf,onUnload:zf,setValue:function(n,e,t,r){e.store.manager.setValue(n,e,t,r)},getValue:function(n,e,t){return e.store.manager.getValue(n,e,t)},getState:function(n,e,t){return t}}),Gf=/* */Object.freeze({__proto__:null,events:function(t,r){var n=t.resetOnDom?[Fr(function(n,e){Pf(n,t,r)}),Rr(function(n,e){zf(n,t,r)})]:[Nr(t,r,Pf)];return Tr(n)}}),$f=function(){var n=ho(null);return $r({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})},Uf=function(){var i=ho({}),u=ho({});return $r({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return I(i.get(),n).orThunk(function(){return I(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),r={},o={};pn(n,function(e){r[e.value]=e,I(e,"meta").each(function(n){I(n,"text").each(function(n){o[n]=e})})}),i.set(x(x({},e),r)),u.set(x(x({},t),o))},clear:function(){i.set({}),u.set({})}})},Wf=/* */Object.freeze({__proto__:null,memory:$f,dataset:Uf,manual:function(){return $r({readState:function(){}})},init:function(n){return n.store.manager.state(n)}}),Xf=function(n,e,t,r){var o=e.store;t.update([r]),o.setValue(n,r),e.onSetValue(n,r)},qf=[dr("initialValue"),fr("getFallbackEntry"),fr("getDataKey"),fr("setValue"),Qo("manager",{setValue:Xf,getValue:function(n,e,t){var r=e.store,o=r.getDataKey(n);return t.lookup(o).fold(function(){return r.getFallbackEntry(o)},function(n){return n})},onLoad:function(e,t,r){t.store.initialValue.each(function(n){Xf(e,t,r,n)})},onUnload:function(n,e,t){t.clear()},state:Uf})],Yf=[fr("getValue"),hr("setValue",w),dr("initialValue"),Qo("manager",{setValue:function(n,e,t,r){e.store.setValue(n,r),e.onSetValue(n,r)},getValue:function(n,e,t){return e.store.getValue(n)},onLoad:function(e,t,n){t.store.initialValue.each(function(n){t.store.setValue(e,n)})},onUnload:w,state:Gr.init})],Kf=[dr("initialValue"),Qo("manager",{setValue:function(n,e,t,r){t.set(r),e.onSetValue(n,r)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store.initialValue.each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:$f})],Jf=[vr("store",{mode:"memory"},ur("mode",{memory:Kf,manual:Yf,dataset:qf})),qo("onSetValue"),hr("resetOnDom",!1)],Qf=Xr({fields:Jf,name:"representing",active:Gf,apis:Lf,extra:{setValueFrom:function(n,e){var t=Qf.getValue(e);Qf.setValue(n,t)}},state:Wf}),Zf=Bi("width",function(n){return n.dom().offsetWidth}),ns=function(n,e){return Zf.set(n,e)},es=function(n){return Zf.get(n)},ts=function(t,r){return{left:y(t),top:y(r),translate:function(n,e){return ts(t+n,r+e)}}},rs=ts,os=y("slider.change.value"),is=function(n){var e=n.event().raw();if(-1!==e.type.indexOf("touch")){return e.touches!==undefined&&1===e.touches.length?O.some(e.touches[0]).map(function(n){return rs(n.clientX,n.clientY)}):O.none()}return e.clientX!==undefined?O.some(e).map(function(n){return rs(n.clientX,n.clientY)}):O.none()},us=function(n){return n.model.minX},cs=function(n){return n.model.minY},as=function(n){return n.model.minX-1},fs=function(n){return n.model.minY-1},ss=function(n){return n.model.maxX},ls=function(n){return n.model.maxY},ds=function(n){return n.model.maxX+1},ms=function(n){return n.model.maxY+1},gs=function(n,e,t){return e(n)-t(n)},ps=function(n){return gs(n,ss,us)},hs=function(n){return gs(n,ls,cs)},vs=function(n){return ps(n)/2},ys=function(n){return hs(n)/2},bs=function(n){return n.stepSize},xs=function(n){return n.snapToGrid},ws=function(n){return n.snapStart},Ss=function(n){return n.rounded},Os=function(n,e){return n[e+"-edge"]!==undefined},Ts=function(n){return Os(n,"left")},ks=function(n){return Os(n,"right")},Es=function(n){return Os(n,"top")},Cs=function(n){return Os(n,"bottom")},Ms=function(n){return n.model.value.get()},_s=function(n){return{x:y(n)}},Ds=function(n){return{y:y(n)}},Is=function(n,e){return{x:y(n),y:y(e)}},Fs=function(n,e){be(n,os(),{value:e})},Rs=function(n,e,t,r){return n'),components:[_l.parts()["left-edge"](kf('
    ')),_l.parts().spectrum({dom:Tf('
    '),components:[kf('
    ')],behaviours:Ur([gi.config({toggleClass:bi("thumb-active")})])}),_l.parts()["right-edge"](kf('
    ')),_l.parts().thumb({dom:Tf('
    '),behaviours:Ur([gi.config({toggleClass:bi("thumb-active")})])})],onChange:function(n,e,t){var r=i(t.x());Mi(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){gi.on(e)},onDragEnd:function(n,e){gi.off(e)},onInit:function(n,e,t,r){var o=i(r.x());Mi(e.element(),"background-color",o)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:function(){return o.getInitialValue()}}}},sliderBehaviours:Ur([hi(_l.refresh)])}))];var o,i},Fl=Ut([fr("getInitialValue"),fr("onChange"),fr("category"),fr("sizes")]),Rl=function(n){var i=or("SizeSlider",Fl,n);return _l.sketch({dom:{tag:"div",classes:[bi("slider-"+i.category+"-size-container"),bi("slider"),bi("slider-size-container")]},onChange:function(n,e,t){var r,o=t.x();0<=(r=o)&&r'),components:[kf('
    ')]}),_l.parts().thumb({dom:Tf('
    '),behaviours:Ur([gi.config({toggleClass:bi("thumb-active")})])})]})},Vl=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Bl=function(e,n){return(Ce(n)?O.some(n):He(n).filter(Ce)).map(function(n){return vo(function(n,e){return e(n)},xo,n,function(n){return Fi(n,"font-size").isSome()},e).bind(function(n){return Fi(n,"font-size")}).getOrThunk(function(){return Di(n,"font-size")})}).getOr("")},Al=function(n){var e=n.selection.getStart(),t=Te.fromDom(e),r=Te.fromDom(n.getBody()),o=Bl(function(n){return Ae(r,n)},t);return bn(Vl,function(n){return o===n}).getOr("medium")},jl=function(n){var e,t=Al(n);return e=t,xn(Vl,function(n){return n===e}).getOr(2)},Hl=function(r,n){var e;e=n,O.from(Vl[e]).each(function(n){var e,t;t=n,Al(e=r)!==t&&e.execCommand("fontSize",!1,t)})},Nl=y(Vl)(),Pl=function(n){return[kf(''),Rl({onChange:(e=n).onChange,sizes:Nl,category:"font",getInitialValue:e.getInitialValue}),kf('')];var e},zl=function(n){var e=function t(n){return n.uid!==undefined}(n)&&R(n,"uid")?n.uid:sf("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).toOption()},asSpec:function(){return x(x({},n),{uid:e})}}},Ll=window.Promise?window.Promise:(pf=(gf=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],Yl(n,Gl(Ul,this),Gl(Wl,this))}).immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){v.setTimeout(n,1)},hf=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},gf.prototype["catch"]=function(n){return this.then(null,n)},gf.prototype.then=function(t,r){var o=this;return new gf(function(n,e){$l.call(o,new ql(t,r,n,e))})},gf.all=function(){for(var n=[],e=0;e'),action:function(n){var e=t.get(n);Qf.setValue(e,"")}}));return{name:n,spec:dd.sketch({dom:Tf('
    '),components:[t.asSpec(),r.asSpec()],containerBehaviours:Ur([gi.config({toggleClass:bi("input-container-empty")}),ld.config({find:function(n){return O.some(t.get(n))}}),ad("input-clearing",[Er(Qn(),function(n){var e=t.get(n);(0"},Pd=function(o,n){return{uid:o.uid,dom:o.dom,components:n,behaviours:ma(o.formBehaviours,[Qf.config({store:{mode:"manual",getValue:function(n){var e,t,r=(e=o,t=n.getSystem(),C(e.partUids,function(n,e){return y(t.getByUid(n))}));return C(r,function(n,o){return n().bind(function(n){var e,t,r=ld.getCurrent(n);return e=r,t=new Error("Cannot find a current component to extract the value from for form part '"+o+"': "+Vo(n.element())),e.fold(function(){return rt.error(t)},rt.value)}).map(Qf.getValue)})},setValue:function(t,n){E(n,function(e,n){Ka(t,o,n).each(function(n){ld.getCurrent(n).each(function(n){Qf.setValue(n,e)})})})}}})]),apis:{getField:function(n,e){return Ka(n,o,e).bind(ld.getCurrent)}}}},zd=(tf(function(n,e,t){return n.getField(e,t)}),function(n){var i,e=(i=[],{field:function(n,e){return i.push(n),t="form",r=Nd(n),o=e,{uiType:Ta(),owner:t,name:r,config:o,validated:{}};var t,r,o},record:function(){return i}}),t=n(e),r=e.record(),o=gn(r,function(n){return za({name:n,pname:Nd(n)})});return df("form",Hd,o,Pd,t)}),Ld=function(){var e=ho(O.none()),t=function(){e.get().each(function(n){n.destroy()})};return{clear:function(){t(),e.set(O.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(O.some(n))},run:function(n){e.get().each(n)}}},Gd=function(){var e=ho(O.none());return{clear:function(){e.set(O.none())},set:function(n){e.set(O.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}},$d=function(n){var r="navigateEvent",e=Wt([fr("fields"),hr("maxFieldIndex",n.fields.length-1),fr("onExecute"),fr("getInitialValue"),yr("state",function(){return{dialogSwipeState:Gd(),currentScreen:ho(0)}})]),u=or("SerialisedDialog",e,n),o=function(e,n,t){return wf.sketch({dom:Tf(''),action:function(n){be(n,r,{direction:e})},buttonBehaviours:Ur([jd.config({disableClass:bi("toolbar-navigation-disabled"),disabled:function(){return!t}})])})},i=function(n,o){var i=Li(n.element(),"."+bi("serialised-dialog-screen"));Ui(n.element(),"."+bi("serialised-dialog-chain")).each(function(r){0<=u.state.currentScreen.get()+o&&u.state.currentScreen.get()+o'),components:[dd.sketch({dom:Tf('
    '),components:gn(u.fields,function(n,e){return e<=u.maxFieldIndex?dd.sketch({dom:Tf('
    '),components:[o(-1,"previous",0'),behaviours:Ur([Ou.config({highlightClass:bi("dot-active"),itemClass:bi("dot-item")})]),components:Sn(u.fields,function(n,e){return e<=u.maxFieldIndex?[kf('
    ')]:[]})});return{dom:Tf('
    '),components:[a.asSpec(),f.asSpec()],behaviours:Ur([sa.config({mode:"special",focusIn:function(n){var e=a.get(n);sa.focusIn(e)}}),ad("serializer-wrapper-events",[Er(Gn(),function(n,e){var t=e.event();u.state.dialogSwipeState.set({xValue:t.raw().touches[0].clientX,points:[]})}),Er($n(),function(n,e){var t=e.event();u.state.dialogSwipeState.on(function(n){e.event().prevent(),u.state.dialogSwipeState.set(function(n,e){if(e===n.xValue)return n;var t=0 "):r[0].name();return Ft(o,{handler:e,purpose:y(t)})})});return Vt(e,{})},am=function(n){return tr("custom.definition",Wt([Kt("dom","dom",Et(),Wt([fr("tag"),hr("styles",{}),hr("classes",[]),hr("attributes",{}),dr("value"),dr("innerHtml")])),fr("components"),fr("uid"),hr("events",{}),hr("apis",{}),Kt("eventOrder","eventOrder",Tt.mergeWithThunk(y({"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"],"alloy.receive":["receiving","reflecting"]})),cr()),dr("domModification")]),n)},fm=function(e,n){pn(n,function(n){co(e,n)})},sm=function(e,n){pn(n,function(n){fo(e,n)})},lm=function(n,e){return t=n,o=gn(r=e,function(n){return gr(n.name(),[fr("config"),hr("state",Gr)])}),i=tr("component.behaviours",Wt(o),t.behaviours).fold(function(n){throw new Error(ir(n)+"\nComplete spec:\n"+JSON.stringify(t,null,2))},function(n){return n}),{list:r,data:C(i,function(n){var e=n.map(function(n){return{config:n.config,state:n.state.init(n.config)}});return function(){return e}})};var t,r,o,i},dm=function(n){var e,t,r=(e=I(n,"behaviours").getOr({}),t=hn(T(e),function(n){return e[n]!==undefined}),gn(t,function(n){return e[n].me}));return lm(n,r)},mm=function(n,e,t){var r,o,i,u=x(x({},(r=n).dom),{uid:r.uid,domChildren:gn(r.components,function(n){return n.element()})}),c=n.domModification.fold(function(){return Hr({})},Hr),a={"alloy.base.modification":c},f=0");r[t[0]]=Ft(t[1],n),r[t[1]]=Ft(t[0],n)}),r},createBistate:function(n,e,t){return Rt([{key:n,value:Ft(e,t)},{key:e,value:Ft(n,t)}])},createTristate:function(n,e,t,r){return Rt([{key:n,value:Rt([{key:e,value:r},{key:t,value:r}])},{key:e,value:Rt([{key:n,value:r},{key:t,value:r}])},{key:t,value:Rt([{key:n,value:r},{key:e,value:r}])}])}}}),ig=bi("scrollable"),ug=function(n){co(n,ig)},cg=function(n){fo(n,ig)},ag=ig,fg=function(n){return I(n,"format").getOr(n.title)},sg=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[bi("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:bi("format-matches"),selected:t},itemBehaviours:Ur(o?[]:[pi(n,function(n,e){(e?gi.on:gi.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},lg=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[wf.sketch({dom:{tag:"div",classes:[bi("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[bi("styles-collapse-icon")]}},vm(n)]:[vm(n)],action:function(n){if(r){var e=t().get(n);Ym.collapseMenu(e)}}}),{dom:{tag:"div",classes:[bi("styles-menu-items-container")]},components:[jm.parts().items({})],behaviours:Ur([ad("adhoc-scrollable-menu",[Fr(function(n,e){Mi(n.element(),"overflow-y","auto"),Mi(n.element(),"-webkit-overflow-scrolling","touch"),ug(n.element())}),Rr(function(n){Ri(n.element(),"overflow-y"),Ri(n.element(),"-webkit-overflow-scrolling"),cg(n.element())})])])}],items:e,menuBehaviours:Ur([og.config({initialState:"after",routes:og.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},dg=function(r){var o,i,n,e,t,u=(o=r.formats,i=function(){return c},n=lg("Styles",[].concat(gn(o.items,function(n){return sg(fg(n),n.title,n.isSelected(),n.getPreview(),R(o.expansions,fg(n)))})),i,!1),e=C(o.menus,function(n,e){var t=gn(n,function(n){return sg(fg(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",R(o.expansions,fg(n)))});return lg(e,t,i,!0)}),t=ct(e,Ft("styles",n)),{tmenu:Ym.tieredData("styles",t,o.expansions)}),c=zl(Ym.sketch({dom:{tag:"div",classes:[bi("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=Qf.getValue(e);return r.handle(e,t.value),O.none()},onEscape:function(){return O.none()},onOpenMenu:function(n,e){var t=es(n.element());ns(e.element(),t),og.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=es(n.element()),o=$i(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();ns(t.element(),r),og.progressTo(i,"before"),og.jumpTo(t,"after"),og.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=$i(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();og.progressTo(o,"after"),og.progressTo(t,"current")},navigateOnHover:!1,highlightImmediately:!0,data:u.tmenu,markers:{backgroundMenu:bi("styles-background-menu"),menu:bi("styles-menu"),selectedMenu:bi("styles-selected-menu"),item:bi("styles-item"),selectedItem:bi("styles-selected-item")}}));return c.asSpec()},mg=function(n){return R(n,"items")?(t=ct(It(e=n,["items"]),{menu:!0}),r=gg(e.items),{item:t,menus:ct(r.menus,Ft(e.title,r.items)),expansions:ct(r.expansions,Ft(e.title,e.title))}):{item:n,menus:{},expansions:{}};var e,t,r},gg=function(n){return vn(n,function(n,e){var t=mg(e);return{menus:ct(n.menus,t.menus),items:[t.item].concat(n.items),expansions:ct(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},pg=function(u,n){var c=function(n){return function(){return u.formatter.match(n)}},a=function(n){return function(){return u.formatter.getCssText(n)}},e=I(n,"style_formats").getOr(Xd),f=function(n){return gn(n,function(n){if(R(n,"items")){var e=f(n.items);return ct(ct(n,{isSelected:y(!1),getPreview:y("")}),{items:e})}return R(n,"format")?ct(i=n,{isSelected:c(i.format),getPreview:a(i.format)}):(r=Ea((t=n).title),o=ct(t,{format:r,isSelected:c(r),getPreview:a(r)}),u.formatter.register(r,o),o);var t,r,o,i})};return f(e)},hg=function(t,n,r){var e,o,i,u=(e=t,i=(o=function(n){return Sn(n,function(n){return n.items===undefined?!R(n,"format")||e.formatter.canApply(n.format)?[n]:[]:0e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!=t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0==Vg?[]:[Eg(Te.fromDom(r.win()),"blur",function(){t.getByDom(e).each(gi.off)}),Eg(i,"select",n),Eg(r.doc(),"selectionchange",n)]);return{destroy:function(){pn(c,function(n){n.unbind()})}}},Ag=function(n,e){var t=parseInt(Zr(n,e),10);return isNaN(t)?0:t};var jg,Hg,Ng=function _v(t,r){var e=function(n){return t(n)?O.from(n.dom().nodeValue):O.none()};return{get:function(n){if(!t(n))throw new Error("Can only get "+r+" value of a "+r+" node");return e(n).getOr("")},getOption:e,set:function(n,e){if(!t(n))throw new Error("Can only set raw "+r+" value of a "+r+" node");n.dom().nodeValue=e}}}(Me,"text"),Pg=function(n){return"img"===ke(n)?1:(e=n,Ng.getOption(e).fold(function(){return Ne(n).length},function(n){return n.length}));var e},zg=function(n,e,t,r){return{start:y(n),soffset:y(e),finish:y(t),foffset:y(r)}},Lg=ot([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Gg={before:Lg.before,on:Lg.on,after:Lg.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(b,b,b)}},$g=ot([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ug={domRange:$g.domRange,relative:$g.relative,exact:$g.exact,exactFromRange:function(n){return $g.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){var e,t=n.match({domRange:function(n){return Te.fromDom(n.startContainer)},relative:function(n,e){return Gg.getStart(n)},exact:function(n,e,t,r){return n}});return e=t,Te.fromDom(e.dom().ownerDocument.defaultView)},range:zg},Wg=function(n,e,t){var r,o,i=n.document.createRange();return r=i,e.fold(function(n){r.setStartBefore(n.dom())},function(n,e){r.setStart(n.dom(),e)},function(n){r.setStartAfter(n.dom())}),o=i,t.fold(function(n){o.setEndBefore(n.dom())},function(n,e){o.setEnd(n.dom(),e)},function(n){o.setEndAfter(n.dom())}),i},Xg=function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i},qg=function(n){return{left:y(n.left),top:y(n.top),right:y(n.right),bottom:y(n.bottom),width:y(n.width),height:y(n.height)}},Yg=ot([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Kg=function(n,e,t){return e(Te.fromDom(t.startContainer),t.startOffset,Te.fromDom(t.endContainer),t.endOffset)},Jg=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:y(n),rtl:O.none}},relative:function(n,e){return{ltr:V(function(){return Wg(o,n,e)}),rtl:V(function(){return O.some(Wg(o,e,n))})}},exact:function(n,e,t,r){return{ltr:V(function(){return Xg(o,n,e,t,r)}),rtl:V(function(){return O.some(Xg(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Yg.rtl(Te.fromDom(n.endContainer),n.endOffset,Te.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Kg(0,Yg.ltr,r)}):Kg(0,Yg.ltr,r)},Qg=(Yg.ltr,Yg.rtl,function(n,e){var t=ke(n);return"input"===t?Gg.after(n):dn(["br","img"],t)?0===e?Gg.before(n):Gg.after(n):Gg.on(n,e)}),Zg=function(n,e,t,r){var o,i,u,c,a,f=(i=e,u=t,c=r,(a=je(o=n).dom().createRange()).setStart(o.dom(),i),a.setEnd(u.dom(),c),a),s=Ae(n,t)&&e===r;return f.collapsed&&!s},np=function(n,e,t,r,o){var i,u,c=Xg(n,e,t,r,o);i=n,u=c,O.from(i.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(u)})},ep=function(l,n){return Jg(l,n).match({ltr:function(n,e,t,r){np(l,n,e,t,r)},rtl:function(n,e,t,r){var o,i,u,c,a,f=l.getSelection();if(f.setBaseAndExtent)f.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(f.extend)try{i=n,u=e,c=t,a=r,(o=f).collapse(i.dom(),u),o.extend(c.dom(),a)}catch(s){np(l,t,r,n,e)}else np(l,t,r,n,e)}})},tp=function(n,e,t,r,o){var i,u,c,a,f=(i=r,u=o,c=Qg(e,t),a=Qg(i,u),Ug.relative(c,a));ep(n,f)},rp=function(n){var e=Te.fromDom(n.anchorNode),t=Te.fromDom(n.focusNode);return Zg(e,n.anchorOffset,t,n.focusOffset)?O.some(zg(e,n.anchorOffset,t,n.focusOffset)):function(n){if(0e.innerHeight||t.bottom()>e.innerHeight?Math.min(r,t.bottom()-e.innerHeight+50):0);0!==o&&u.scrollTo(u.pageXOffset,u.pageYOffset+o)})}),lp(e,n.innerHeight)});lp(e,n.innerHeight);return{toEditing:function(){fp(u)},destroy:function(){t.unbind()}}},pp=function(n){return O.from(n.dom().contentWindow)},hp=function(n){return pp(n).bind(op)},vp=function(n){return n.getFrame()},yp=function(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return Eg(e,r,n)}})},bp=function(n){return{left:y(n.left),top:y(n.top),right:y(n.right),bottom:y(n.bottom),width:y(n.width),height:y(n.height)}},xp=function(c){var n,a=vp(c);return n=a,O.some(Te.fromDom(n.dom().contentWindow.document.body)).bind(function(u){return n=a,O.some(Te.fromDom(n.dom().contentWindow.document)).bind(function(i){return pp(a).map(function(o){var n=Te.fromDom(i.dom().documentElement),e=c.getCursorBox.getOrThunk(function(){return function(){return op(o).map(function(n){return Ug.exact(n.start(),n.soffset(),n.finish(),n.foffset())}).bind(function(n){return ip(o,n).orThunk(function(){return op(o).filter(function(n){return Ae(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0
    ')},function(n){return Tf(''+n+"")})},_f=function(n,e,t,r){return wf.sketch({dom:Mf(n,r),action:e,buttonBehaviours:ct(Ur([Sf.config({})]),t)})},Df=La({schema:[fr("dom")],name:"label"}),If=function(e){return La({name:e+"-edge",overrides:function(n){return n.model.manager.edgeActions[e].fold(function(){return{}},function(r){return{events:Tr([Cr(Gn(),function(n,e,t){return r(n,t)},[n]),Cr(Wn(),function(n,e,t){return r(n,t)},[n]),Cr(Xn(),function(n,e,t){t.mouseIsDown.get()&&r(n,t)},[n])])}})}})},Ff=If("top-left"),Rf=If("top"),Vf=If("top-right"),Bf=If("right"),Af=If("bottom-right"),jf=If("bottom"),Hf=If("bottom-left"),Nf=[Df,If("left"),Bf,Rf,jf,Ff,Vf,Hf,Af,za({name:"thumb",defaults:y({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:Tr([Dr(Gn(),n,"spectrum"),Dr($n(),n,"spectrum"),Dr(Un(),n,"spectrum"),Dr(Wn(),n,"spectrum"),Dr(Xn(),n,"spectrum"),Dr(qn(),n,"spectrum")])}}}),za({schema:[yr("mouseIsDown",function(){return ho(!1)})],name:"spectrum",overrides:function(t){var r=t.model.manager,o=function(e,n){return r.getValueFromEvent(n).map(function(n){return r.setValueFrom(e,t,n)})};return{behaviours:Ur([sa.config({mode:"special",onLeft:function(n){return r.onLeft(n,t)},onRight:function(n){return r.onRight(n,t)},onUp:function(n){return r.onUp(n,t)},onDown:function(n){return r.onDown(n,t)}}),ki.config({})]),events:Tr([Er(Gn(),o),Er($n(),o),Er(Wn(),o),Er(Xn(),function(n,e){t.mouseIsDown.get()&&o(n,e)})])}}})],Pf=function(n,e,t){e.store.manager.onLoad(n,e,t)},zf=function(n,e,t){e.store.manager.onUnload(n,e,t)},Lf=/* */Object.freeze({__proto__:null,onLoad:Pf,onUnload:zf,setValue:function(n,e,t,r){e.store.manager.setValue(n,e,t,r)},getValue:function(n,e,t){return e.store.manager.getValue(n,e,t)},getState:function(n,e,t){return t}}),Gf=/* */Object.freeze({__proto__:null,events:function(t,r){var n=t.resetOnDom?[Fr(function(n,e){Pf(n,t,r)}),Rr(function(n,e){zf(n,t,r)})]:[Nr(t,r,Pf)];return Tr(n)}}),$f=function(){var n=ho(null);return $r({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})},Uf=function(){var i=ho({}),u=ho({});return $r({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return I(i.get(),n).orThunk(function(){return I(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),r={},o={};pn(n,function(e){r[e.value]=e,I(e,"meta").each(function(n){I(n,"text").each(function(n){o[n]=e})})}),i.set(x(x({},e),r)),u.set(x(x({},t),o))},clear:function(){i.set({}),u.set({})}})},Wf=/* */Object.freeze({__proto__:null,memory:$f,dataset:Uf,manual:function(){return $r({readState:function(){}})},init:function(n){return n.store.manager.state(n)}}),Xf=function(n,e,t,r){var o=e.store;t.update([r]),o.setValue(n,r),e.onSetValue(n,r)},qf=[dr("initialValue"),fr("getFallbackEntry"),fr("getDataKey"),fr("setValue"),Qo("manager",{setValue:Xf,getValue:function(n,e,t){var r=e.store,o=r.getDataKey(n);return t.lookup(o).fold(function(){return r.getFallbackEntry(o)},function(n){return n})},onLoad:function(e,t,r){t.store.initialValue.each(function(n){Xf(e,t,r,n)})},onUnload:function(n,e,t){t.clear()},state:Uf})],Yf=[fr("getValue"),hr("setValue",w),dr("initialValue"),Qo("manager",{setValue:function(n,e,t,r){e.store.setValue(n,r),e.onSetValue(n,r)},getValue:function(n,e,t){return e.store.getValue(n)},onLoad:function(e,t,n){t.store.initialValue.each(function(n){t.store.setValue(e,n)})},onUnload:w,state:Gr.init})],Kf=[dr("initialValue"),Qo("manager",{setValue:function(n,e,t,r){t.set(r),e.onSetValue(n,r)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store.initialValue.each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:$f})],Jf=[vr("store",{mode:"memory"},ur("mode",{memory:Kf,manual:Yf,dataset:qf})),qo("onSetValue"),hr("resetOnDom",!1)],Qf=Xr({fields:Jf,name:"representing",active:Gf,apis:Lf,extra:{setValueFrom:function(n,e){var t=Qf.getValue(e);Qf.setValue(n,t)}},state:Wf}),Zf=Bi("width",function(n){return n.dom().offsetWidth}),ns=function(n,e){return Zf.set(n,e)},es=function(n){return Zf.get(n)},ts=function(t,r){return{left:y(t),top:y(r),translate:function(n,e){return ts(t+n,r+e)}}},rs=ts,os=y("slider.change.value"),is=function(n){var e=n.event().raw();if(-1!==e.type.indexOf("touch")){return e.touches!==undefined&&1===e.touches.length?O.some(e.touches[0]).map(function(n){return rs(n.clientX,n.clientY)}):O.none()}return e.clientX!==undefined?O.some(e).map(function(n){return rs(n.clientX,n.clientY)}):O.none()},us=function(n){return n.model.minX},cs=function(n){return n.model.minY},as=function(n){return n.model.minX-1},fs=function(n){return n.model.minY-1},ss=function(n){return n.model.maxX},ls=function(n){return n.model.maxY},ds=function(n){return n.model.maxX+1},ms=function(n){return n.model.maxY+1},gs=function(n,e,t){return e(n)-t(n)},ps=function(n){return gs(n,ss,us)},hs=function(n){return gs(n,ls,cs)},vs=function(n){return ps(n)/2},ys=function(n){return hs(n)/2},bs=function(n){return n.stepSize},xs=function(n){return n.snapToGrid},ws=function(n){return n.snapStart},Ss=function(n){return n.rounded},Os=function(n,e){return n[e+"-edge"]!==undefined},Ts=function(n){return Os(n,"left")},ks=function(n){return Os(n,"right")},Es=function(n){return Os(n,"top")},Cs=function(n){return Os(n,"bottom")},Ms=function(n){return n.model.value.get()},_s=function(n){return{x:y(n)}},Ds=function(n){return{y:y(n)}},Is=function(n,e){return{x:y(n),y:y(e)}},Fs=function(n,e){be(n,os(),{value:e})},Rs=function(n,e,t,r){return n'),components:[_l.parts()["left-edge"](kf('
    ')),_l.parts().spectrum({dom:Tf('
    '),components:[kf('
    ')],behaviours:Ur([gi.config({toggleClass:bi("thumb-active")})])}),_l.parts()["right-edge"](kf('
    ')),_l.parts().thumb({dom:Tf('
    '),behaviours:Ur([gi.config({toggleClass:bi("thumb-active")})])})],onChange:function(n,e,t){var r=i(t.x());Mi(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){gi.on(e)},onDragEnd:function(n,e){gi.off(e)},onInit:function(n,e,t,r){var o=i(r.x());Mi(e.element(),"background-color",o)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:function(){return o.getInitialValue()}}}},sliderBehaviours:Ur([hi(_l.refresh)])}))];var o,i},Fl=Ut([fr("getInitialValue"),fr("onChange"),fr("category"),fr("sizes")]),Rl=function(n){var i=or("SizeSlider",Fl,n);return _l.sketch({dom:{tag:"div",classes:[bi("slider-"+i.category+"-size-container"),bi("slider"),bi("slider-size-container")]},onChange:function(n,e,t){var r,o=t.x();0<=(r=o)&&r'),components:[kf('
    ')]}),_l.parts().thumb({dom:Tf('
    '),behaviours:Ur([gi.config({toggleClass:bi("thumb-active")})])})]})},Vl=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],Bl=function(e,n){return(Ce(n)?O.some(n):He(n).filter(Ce)).map(function(n){return vo(function(n,e){return e(n)},xo,n,function(n){return Fi(n,"font-size").isSome()},e).bind(function(n){return Fi(n,"font-size")}).getOrThunk(function(){return Di(n,"font-size")})}).getOr("")},Al=function(n){var e=n.selection.getStart(),t=Te.fromDom(e),r=Te.fromDom(n.getBody()),o=Bl(function(n){return Ae(r,n)},t);return bn(Vl,function(n){return o===n}).getOr("medium")},jl=function(n){var e,t=Al(n);return e=t,xn(Vl,function(n){return n===e}).getOr(2)},Hl=function(r,n){var e;e=n,O.from(Vl[e]).each(function(n){var e,t;t=n,Al(e=r)!==t&&e.execCommand("fontSize",!1,t)})},Nl=y(Vl)(),Pl=function(n){return[kf(''),Rl({onChange:(e=n).onChange,sizes:Nl,category:"font",getInitialValue:e.getInitialValue}),kf('')];var e},zl=function(n){var e=function t(n){return n.uid!==undefined}(n)&&R(n,"uid")?n.uid:sf("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).toOption()},asSpec:function(){return x(x({},n),{uid:e})}}},Ll=window.Promise?window.Promise:(pf=(gf=function(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],Yl(n,Gl(Ul,this),Gl(Wl,this))}).immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){v.setTimeout(n,1)},hf=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},gf.prototype["catch"]=function(n){return this.then(null,n)},gf.prototype.then=function(t,r){var o=this;return new gf(function(n,e){$l.call(o,new ql(t,r,n,e))})},gf.all=function(){for(var n=[],e=0;e'),action:function(n){var e=t.get(n);Qf.setValue(e,"")}}));return{name:n,spec:dd.sketch({dom:Tf('
    '),components:[t.asSpec(),r.asSpec()],containerBehaviours:Ur([gi.config({toggleClass:bi("input-container-empty")}),ld.config({find:function(n){return O.some(t.get(n))}}),ad("input-clearing",[Er(Qn(),function(n){var e=t.get(n);(0"},Pd=function(o,n){return{uid:o.uid,dom:o.dom,components:n,behaviours:ma(o.formBehaviours,[Qf.config({store:{mode:"manual",getValue:function(n){var e,t,r=(e=o,t=n.getSystem(),C(e.partUids,function(n,e){return y(t.getByUid(n))}));return C(r,function(n,o){return n().bind(function(n){var e,t,r=ld.getCurrent(n);return e=r,t=new Error("Cannot find a current component to extract the value from for form part '"+o+"': "+Vo(n.element())),e.fold(function(){return rt.error(t)},rt.value)}).map(Qf.getValue)})},setValue:function(t,n){E(n,function(e,n){Ka(t,o,n).each(function(n){ld.getCurrent(n).each(function(n){Qf.setValue(n,e)})})})}}})]),apis:{getField:function(n,e){return Ka(n,o,e).bind(ld.getCurrent)}}}},zd=(tf(function(n,e,t){return n.getField(e,t)}),function(n){var i,e=(i=[],{field:function(n,e){return i.push(n),t="form",r=Nd(n),o=e,{uiType:Ta(),owner:t,name:r,config:o,validated:{}};var t,r,o},record:function(){return i}}),t=n(e),r=e.record(),o=gn(r,function(n){return za({name:n,pname:Nd(n)})});return df("form",Hd,o,Pd,t)}),Ld=function(){var e=ho(O.none()),t=function(){e.get().each(function(n){n.destroy()})};return{clear:function(){t(),e.set(O.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(O.some(n))},run:function(n){e.get().each(n)}}},Gd=function(){var e=ho(O.none());return{clear:function(){e.set(O.none())},set:function(n){e.set(O.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}},$d=function(n){var r="navigateEvent",e=Wt([fr("fields"),hr("maxFieldIndex",n.fields.length-1),fr("onExecute"),fr("getInitialValue"),yr("state",function(){return{dialogSwipeState:Gd(),currentScreen:ho(0)}})]),u=or("SerialisedDialog",e,n),o=function(e,n,t){return wf.sketch({dom:Tf(''),action:function(n){be(n,r,{direction:e})},buttonBehaviours:Ur([jd.config({disableClass:bi("toolbar-navigation-disabled"),disabled:function(){return!t}})])})},i=function(n,o){var i=Li(n.element(),"."+bi("serialised-dialog-screen"));Ui(n.element(),"."+bi("serialised-dialog-chain")).each(function(r){0<=u.state.currentScreen.get()+o&&u.state.currentScreen.get()+o'),components:[dd.sketch({dom:Tf('
    '),components:gn(u.fields,function(n,e){return e<=u.maxFieldIndex?dd.sketch({dom:Tf('
    '),components:[o(-1,"previous",0'),behaviours:Ur([Ou.config({highlightClass:bi("dot-active"),itemClass:bi("dot-item")})]),components:Sn(u.fields,function(n,e){return e<=u.maxFieldIndex?[kf('
    ')]:[]})});return{dom:Tf('
    '),components:[a.asSpec(),f.asSpec()],behaviours:Ur([sa.config({mode:"special",focusIn:function(n){var e=a.get(n);sa.focusIn(e)}}),ad("serializer-wrapper-events",[Er(Gn(),function(n,e){var t=e.event();u.state.dialogSwipeState.set({xValue:t.raw().touches[0].clientX,points:[]})}),Er($n(),function(n,e){var t=e.event();u.state.dialogSwipeState.on(function(n){e.event().prevent(),u.state.dialogSwipeState.set(function(n,e){if(e===n.xValue)return n;var t=0 "):r[0].name();return Ft(o,{handler:e,purpose:y(t)})})});return Vt(e,{})},am=function(n){return tr("custom.definition",Wt([Kt("dom","dom",Et(),Wt([fr("tag"),hr("styles",{}),hr("classes",[]),hr("attributes",{}),dr("value"),dr("innerHtml")])),fr("components"),fr("uid"),hr("events",{}),hr("apis",{}),Kt("eventOrder","eventOrder",Tt.mergeWithThunk(y({"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"],"alloy.receive":["receiving","reflecting","tooltipping"]})),cr()),dr("domModification")]),n)},fm=function(e,n){pn(n,function(n){co(e,n)})},sm=function(e,n){pn(n,function(n){fo(e,n)})},lm=function(n,e){return t=n,o=gn(r=e,function(n){return gr(n.name(),[fr("config"),hr("state",Gr)])}),i=tr("component.behaviours",Wt(o),t.behaviours).fold(function(n){throw new Error(ir(n)+"\nComplete spec:\n"+JSON.stringify(t,null,2))},function(n){return n}),{list:r,data:C(i,function(n){var e=n.map(function(n){return{config:n.config,state:n.state.init(n.config)}});return function(){return e}})};var t,r,o,i},dm=function(n){var e,t,r=(e=I(n,"behaviours").getOr({}),t=hn(T(e),function(n){return e[n]!==undefined}),gn(t,function(n){return e[n].me}));return lm(n,r)},mm=function(n,e,t){var r,o,i,u=x(x({},(r=n).dom),{uid:r.uid,domChildren:gn(r.components,function(n){return n.element()})}),c=n.domModification.fold(function(){return Hr({})},Hr),a={"alloy.base.modification":c},f=0");r[t[0]]=Ft(t[1],n),r[t[1]]=Ft(t[0],n)}),r},createBistate:function(n,e,t){return Rt([{key:n,value:Ft(e,t)},{key:e,value:Ft(n,t)}])},createTristate:function(n,e,t,r){return Rt([{key:n,value:Rt([{key:e,value:r},{key:t,value:r}])},{key:e,value:Rt([{key:n,value:r},{key:t,value:r}])},{key:t,value:Rt([{key:n,value:r},{key:e,value:r}])}])}}}),ig=bi("scrollable"),ug=function(n){co(n,ig)},cg=function(n){fo(n,ig)},ag=ig,fg=function(n){return I(n,"format").getOr(n.title)},sg=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[bi("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:bi("format-matches"),selected:t},itemBehaviours:Ur(o?[]:[pi(n,function(n,e){(e?gi.on:gi.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},lg=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[wf.sketch({dom:{tag:"div",classes:[bi("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[bi("styles-collapse-icon")]}},vm(n)]:[vm(n)],action:function(n){if(r){var e=t().get(n);Ym.collapseMenu(e)}}}),{dom:{tag:"div",classes:[bi("styles-menu-items-container")]},components:[jm.parts().items({})],behaviours:Ur([ad("adhoc-scrollable-menu",[Fr(function(n,e){Mi(n.element(),"overflow-y","auto"),Mi(n.element(),"-webkit-overflow-scrolling","touch"),ug(n.element())}),Rr(function(n){Ri(n.element(),"overflow-y"),Ri(n.element(),"-webkit-overflow-scrolling"),cg(n.element())})])])}],items:e,menuBehaviours:Ur([og.config({initialState:"after",routes:og.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},dg=function(r){var o,i,n,e,t,u=(o=r.formats,i=function(){return c},n=lg("Styles",[].concat(gn(o.items,function(n){return sg(fg(n),n.title,n.isSelected(),n.getPreview(),R(o.expansions,fg(n)))})),i,!1),e=C(o.menus,function(n,e){var t=gn(n,function(n){return sg(fg(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",R(o.expansions,fg(n)))});return lg(e,t,i,!0)}),t=ct(e,Ft("styles",n)),{tmenu:Ym.tieredData("styles",t,o.expansions)}),c=zl(Ym.sketch({dom:{tag:"div",classes:[bi("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=Qf.getValue(e);return r.handle(e,t.value),O.none()},onEscape:function(){return O.none()},onOpenMenu:function(n,e){var t=es(n.element());ns(e.element(),t),og.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=es(n.element()),o=$i(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();ns(t.element(),r),og.progressTo(i,"before"),og.jumpTo(t,"after"),og.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=$i(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();og.progressTo(o,"after"),og.progressTo(t,"current")},navigateOnHover:!1,highlightImmediately:!0,data:u.tmenu,markers:{backgroundMenu:bi("styles-background-menu"),menu:bi("styles-menu"),selectedMenu:bi("styles-selected-menu"),item:bi("styles-item"),selectedItem:bi("styles-selected-item")}}));return c.asSpec()},mg=function(n){return R(n,"items")?(t=ct(It(e=n,["items"]),{menu:!0}),r=gg(e.items),{item:t,menus:ct(r.menus,Ft(e.title,r.items)),expansions:ct(r.expansions,Ft(e.title,e.title))}):{item:n,menus:{},expansions:{}};var e,t,r},gg=function(n){return vn(n,function(n,e){var t=mg(e);return{menus:ct(n.menus,t.menus),items:[t.item].concat(n.items),expansions:ct(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},pg=function(u,n){var c=function(n){return function(){return u.formatter.match(n)}},a=function(n){return function(){return u.formatter.getCssText(n)}},e=I(n,"style_formats").getOr(Xd),f=function(n){return gn(n,function(n){if(R(n,"items")){var e=f(n.items);return ct(ct(n,{isSelected:y(!1),getPreview:y("")}),{items:e})}return R(n,"format")?ct(i=n,{isSelected:c(i.format),getPreview:a(i.format)}):(r=Ea((t=n).title),o=ct(t,{format:r,isSelected:c(r),getPreview:a(r)}),u.formatter.register(r,o),o);var t,r,o,i})};return f(e)},hg=function(t,n,r){var e,o,i,u=(e=t,i=(o=function(n){return Sn(n,function(n){return n.items===undefined?!R(n,"format")||e.formatter.canApply(n.format)?[n]:[]:0e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!=t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0==Vg?[]:[Eg(Te.fromDom(r.win()),"blur",function(){t.getByDom(e).each(gi.off)}),Eg(i,"select",n),Eg(r.doc(),"selectionchange",n)]);return{destroy:function(){pn(c,function(n){n.unbind()})}}},Ag=function(n,e){var t=parseInt(Zr(n,e),10);return isNaN(t)?0:t};var jg,Hg,Ng=function _v(t,r){var e=function(n){return t(n)?O.from(n.dom().nodeValue):O.none()};return{get:function(n){if(!t(n))throw new Error("Can only get "+r+" value of a "+r+" node");return e(n).getOr("")},getOption:e,set:function(n,e){if(!t(n))throw new Error("Can only set raw "+r+" value of a "+r+" node");n.dom().nodeValue=e}}}(Me,"text"),Pg=function(n){return"img"===ke(n)?1:(e=n,Ng.getOption(e).fold(function(){return Ne(n).length},function(n){return n.length}));var e},zg=function(n,e,t,r){return{start:y(n),soffset:y(e),finish:y(t),foffset:y(r)}},Lg=ot([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Gg={before:Lg.before,on:Lg.on,after:Lg.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(b,b,b)}},$g=ot([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Ug={domRange:$g.domRange,relative:$g.relative,exact:$g.exact,exactFromRange:function(n){return $g.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){var e,t=n.match({domRange:function(n){return Te.fromDom(n.startContainer)},relative:function(n,e){return Gg.getStart(n)},exact:function(n,e,t,r){return n}});return e=t,Te.fromDom(e.dom().ownerDocument.defaultView)},range:zg},Wg=function(n,e,t){var r,o,i=n.document.createRange();return r=i,e.fold(function(n){r.setStartBefore(n.dom())},function(n,e){r.setStart(n.dom(),e)},function(n){r.setStartAfter(n.dom())}),o=i,t.fold(function(n){o.setEndBefore(n.dom())},function(n,e){o.setEnd(n.dom(),e)},function(n){o.setEndAfter(n.dom())}),i},Xg=function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom(),t),i.setEnd(r.dom(),o),i},qg=function(n){return{left:y(n.left),top:y(n.top),right:y(n.right),bottom:y(n.bottom),width:y(n.width),height:y(n.height)}},Yg=ot([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Kg=function(n,e,t){return e(Te.fromDom(t.startContainer),t.startOffset,Te.fromDom(t.endContainer),t.endOffset)},Jg=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:y(n),rtl:O.none}},relative:function(n,e){return{ltr:V(function(){return Wg(o,n,e)}),rtl:V(function(){return O.some(Wg(o,e,n))})}},exact:function(n,e,t,r){return{ltr:V(function(){return Xg(o,n,e,t,r)}),rtl:V(function(){return O.some(Xg(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Yg.rtl(Te.fromDom(n.endContainer),n.endOffset,Te.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Kg(0,Yg.ltr,r)}):Kg(0,Yg.ltr,r)},Qg=(Yg.ltr,Yg.rtl,function(n,e){var t=ke(n);return"input"===t?Gg.after(n):dn(["br","img"],t)?0===e?Gg.before(n):Gg.after(n):Gg.on(n,e)}),Zg=function(n,e,t,r){var o,i,u,c,a,f=(i=e,u=t,c=r,(a=je(o=n).dom().createRange()).setStart(o.dom(),i),a.setEnd(u.dom(),c),a),s=Ae(n,t)&&e===r;return f.collapsed&&!s},np=function(n,e,t,r,o){var i,u,c=Xg(n,e,t,r,o);i=n,u=c,O.from(i.getSelection()).each(function(n){n.removeAllRanges(),n.addRange(u)})},ep=function(l,n){return Jg(l,n).match({ltr:function(n,e,t,r){np(l,n,e,t,r)},rtl:function(n,e,t,r){var o,i,u,c,a,f=l.getSelection();if(f.setBaseAndExtent)f.setBaseAndExtent(n.dom(),e,t.dom(),r);else if(f.extend)try{i=n,u=e,c=t,a=r,(o=f).collapse(i.dom(),u),o.extend(c.dom(),a)}catch(s){np(l,t,r,n,e)}else np(l,t,r,n,e)}})},tp=function(n,e,t,r,o){var i,u,c,a,f=(i=r,u=o,c=Qg(e,t),a=Qg(i,u),Ug.relative(c,a));ep(n,f)},rp=function(n){var e=Te.fromDom(n.anchorNode),t=Te.fromDom(n.focusNode);return Zg(e,n.anchorOffset,t,n.focusOffset)?O.some(zg(e,n.anchorOffset,t,n.focusOffset)):function(n){if(0e.innerHeight||t.bottom()>e.innerHeight?Math.min(r,t.bottom()-e.innerHeight+50):0);0!==o&&u.scrollTo(u.pageXOffset,u.pageYOffset+o)})}),lp(e,n.innerHeight)});lp(e,n.innerHeight);return{toEditing:function(){fp(u)},destroy:function(){t.unbind()}}},pp=function(n){return O.from(n.dom().contentWindow)},hp=function(n){return pp(n).bind(op)},vp=function(n){return n.getFrame()},yp=function(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return Eg(e,r,n)}})},bp=function(n){return{left:y(n.left),top:y(n.top),right:y(n.right),bottom:y(n.bottom),width:y(n.width),height:y(n.height)}},xp=function(c){var n,a=vp(c);return n=a,O.some(Te.fromDom(n.dom().contentWindow.document.body)).bind(function(u){return n=a,O.some(Te.fromDom(n.dom().contentWindow.document)).bind(function(i){return pp(a).map(function(o){var n=Te.fromDom(i.dom().documentElement),e=c.getCursorBox.getOrThunk(function(){return function(){return op(o).map(function(n){return Ug.exact(n.start(),n.soffset(),n.finish(),n.foffset())}).bind(function(n){return ip(o,n).orThunk(function(){return op(o).filter(function(n){return Ae(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0
    ',e.getDoc());return vr(t,le.fromDom(n.extractContents())),n.insertNode(t.dom()),lr(t).each(function(t){return t.dom().normalize()}),Xc(t,Gc).map(function(t){var n;e.selection.setCursorLocation(t.dom(),"img"===Cr(n=t)?1:Uc(n).fold(function(){return dr(n).length},function(t){return t.length}))}),t})},np=function(t){return Au(t,"[data-mce-autocompleter]")},ep=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},op=function(t){return""!==t&&-1!==" \xa0\f\n\r\t\x0B".indexOf(t)},rp=function(t,n){return t.substring(n.length)},ip=function(t,o,r,i){if(void 0===i&&(i=0),!(n=o).collapsed||3!==n.startContainer.nodeType)return st.none();var n,e=t.getParent(o.startContainer,t.isBlock)||t.getRoot();return Zg(t,o.startContainer,o.startOffset,function(t,n,e){return function(t,n,e){var o;for(o=n-1;0<=o;o--){var r=t.charAt(o);if(op(r))return st.none();if(r===e)break}return st.some(o)}(e,n,r).getOr(n)},e).bind(function(t){var n=o.cloneRange();if(n.setStart(t.container,t.offset),n.setEnd(o.endContainer,o.endOffset),n.collapsed)return st.none();var e=ep(n);return 0!==e.lastIndexOf(r)||rp(e,r).length=t.minChars&&t.matches.getOrThunk(function(){return dp(n.dom)})(e.range,i,e.text)});if(0===u.length)return st.none();var a=cp.all(V(u,function(n){return n.fetch(e.text,n.maxResults,o).then(function(t){return{matchText:e.text,items:t,columns:n.columns,onAction:n.onAction}})}));return st.some({lookupData:a,context:e})},pp=ln([Ln("type"),Jn("text")]),hp=ln([ae("type",function(){return"autocompleteitem"}),ae("active",function(){return!1}),ae("disabled",function(){return!1}),Zn("meta",{}),Ln("value"),Jn("text"),Jn("icon")]),vp=ln([Ln("type"),Ln("ch"),ne("minChars",1),Zn("columns",1),ne("maxResults",10),$n("matches"),Un("fetch"),Un("onAction")]),bp=function(t){var n,e,o=t.ui.registry.getAll().popups,r=dt(o,function(t){return Cn("Autocompleter",vp,t).fold(function(t){throw new Error(Tn(t))},function(t){return t})}),i=(n=pt(r,function(t){return t.ch}),e={},it(n,function(t){e[t]={}}),lt(e)),u=vt(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return P(u,function(t){return t.ch===n})}}},yp=[re("disabled",!1),Jn("text"),Jn("shortcut"),hn("value","value",Gt(function(){return Nr("menuitem-value")}),Dn()),Zn("meta",{})],xp=ln([Ln("type"),ie("onSetup",function(){return Z}),ie("onAction",Z),Jn("icon")].concat(yp)),wp=ln([Ln("type"),Un("getSubmenuItems"),ie("onSetup",function(){return Z}),Jn("icon")].concat(yp)),Sp=ln([Ln("type"),Jn("icon"),re("active",!1),ie("onSetup",function(){return Z}),Un("onAction")].concat(yp)),kp=ln([Ln("type"),re("active",!1),Jn("icon")].concat(yp)),Cp=ln([Ln("type"),jn("fancytype",["inserttable","colorswatch"]),ie("onAction",Z)]),Op=function(t,o,n){var r=Yc(t.element(),"."+n);if(0o}).getOr(r.length);return st.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return st.none()},_p=function(t,n){return za([Lm(t,n)])},Tp=function(t){return _p(Nr("unnamed-events"),t)},Ep=[zn("lazySink"),zn("tooltipDom"),Zn("exclusive",!0),Zn("tooltipComponents",[]),Zn("delay",300),oe("mode","normal",["normal","follow-highlight"]),Zn("anchor",function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:at([_a,Oa,wa,ka,Sa,Ca]),onRtl:at([_a,Oa,wa,ka,Sa,Ca])}}}),$u("onHide"),$u("onShow")],Bp=/* */Object.freeze({__proto__:null,init:function(){var e=ce(st.none()),n=ce(st.none()),o=function(){e.get().each(function(t){nt.clearTimeout(t)})},t=at("not-implemented");return oi({getTooltip:function(){return n.get()},isShowing:function(){return n.get().isSome()},setTooltip:function(t){n.set(st.some(t))},clearTooltip:function(){n.set(st.none())},clearTimer:o,resetTimer:function(t,n){o(),e.set(st.some(nt.setTimeout(function(){t()},n)))},readState:t})}}),Dp=Nr("tooltip.exclusive"),Mp=Nr("tooltip.show"),Ap=Nr("tooltip.hide"),Fp=function(t,n,e){t.getSystem().broadcastOn([Dp],{})},Ip=/* */Object.freeze({__proto__:null,hideAllExclusive:Fp,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&Nm.set(t,o)})}}),Rp=La({fields:Ep,name:"tooltipping",active:/* */Object.freeze({__proto__:null,events:function(o,r){var e=function(n){r.getTooltip().each(function(t){Ps(t),o.onHide(n,t),r.clearTooltip()}),r.clearTimer()};return Yo(ut([[Jo(Mp,function(t){r.resetTimer(function(){!function(n){if(!r.isShowing()){Fp(n);var t=o.lazySink(n).getOrDie(),e=n.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:Yo("normal"===o.mode?[Jo(ro(),function(t){Lo(n,Mp)}),Jo(eo(),function(t){Lo(n,Ap)})]:[]),behaviours:za([Nm.config({})])});r.setTooltip(e),Rs(t,e),o.onShow(n,e),Ds.position(t,o.anchor(n),e)}}(t)},o.delay)}),Jo(Ap,function(t){r.resetTimer(function(){e(t)},o.delay)}),Jo(yo(),function(t,n){F(n.channels(),Dp)&&e(t)}),rr(function(t){e(t)})],"normal"===o.mode?[Jo(io(),function(t){Lo(t,Mp)}),Jo(vo(),function(t){Lo(t,Ap)}),Jo(ro(),function(t){Lo(t,Mp)}),Jo(eo(),function(t){Lo(t,Ap)})]:[Jo(zo(),function(t,n){Lo(t,Mp)}),Jo(No(),function(t){Lo(t,Ap)})]]))}}),state:Bp,apis:Ip}),Vp=tinymce.util.Tools.resolve("tinymce.util.I18n"),Hp="tox-menu-nav__js",Pp="tox-collection__item",zp="tox-swatch",Np={normal:Hp,color:zp},Lp="tox-collection__item--enabled",jp="tox-collection__item-label",Up="tox-collection__item-caret",Wp="tox-collection__item--active",Gp=function(t){return bt(Np,t).getOr(Hp)},Xp=tinymce.util.Tools.resolve("tinymce.Env"),Yp=function(t){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:t}}},qp=function(t){return{dom:{tag:"div",classes:[jp]},components:[Yi(Vp.translate(t))]}},Kp=function(t,n){return{dom:{tag:"div",classes:[jp]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Yi(Vp.translate(n))]}]}},Jp=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:(n=t,e=Xp.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},o=n.split("+"),r=V(o,function(t){var n=t.toLowerCase().trim();return yt(e,n)?e[n]:t}),Xp.mac?r.join(""):r.join("+"))}};var n,e,o,r},$p=function(t){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:Gg("checkmark",t)}}},Qp=function(t,n,e,o,r){var i=e?n.or(st.some("")).map(Yp):st.none(),u=t.checkMark,a=t.ariaLabel.map(function(t){return{attributes:{title:Vp.translate(t)}}}).getOr({});return{dom:et({tag:"div",classes:[Hp,Pp].concat(r?["tox-collection__item-icon-rtl"]:[])},a),optComponents:[i,t.htmlContent.fold(function(){return t.textContent.map(o)},function(t){return st.some({dom:{tag:"div",classes:[jp],innerHtml:t}})}),t.shortcutContent.map(Jp),u,t.caret]}},Zp=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],th=["list-bull-circle","list-bull-default","list-bull-square"],nh=function(t,r,n,i){void 0===i&&(i=st.none());var e,o,u,a,c,s=Vp.isRtl()&&t.iconContent.exists(function(t){return F(th,t)}),l=t.iconContent.map(function(t){return Vp.isRtl()&&F(Zp,t)?t+"-rtl":t}).map(function(t){return n=t,e=r.icons,o=i,st.from(e()[n]).or(o).getOrThunk(function(){return Wg(e)});var n,e,o}),f=st.from(t.meta).fold(function(){return qp},function(t){return yt(t,"style")?g(Kp,t.style):qp});return"color"===t.presets?(e=t.ariaLabel,o=t.value,u=r,{dom:(a=l.getOr(""),c={tag:"div",attributes:e.map(function(t){return{title:u.translate(t)}}).getOr({}),classes:["tox-swatch"]},et(et({},c),"custom"===o?{tag:"button",classes:b(c.classes,["tox-swatches__picker-btn"]),innerHtml:a}:"remove"===o?{classes:b(c.classes,["tox-swatch--remove"]),innerHtml:a}:{attributes:et(et({},c.attributes),{"data-mce-color":o}),styles:{"background-color":o}})),optComponents:[]}):Qp(t,l,n,f,s)},eh=["input","button","textarea","select"],oh=function(t,n,e){(n.disabled()?sh:lh)(t,n,e)},rh=function(t,n){return!0===n.useNative&&F(eh,Cr(t.element()))},ih=function(t){Br(t.element(),"disabled","disabled")},uh=function(t){Fr(t.element(),"disabled")},ah=function(t){Br(t.element(),"aria-disabled","true")},ch=function(t){Br(t.element(),"aria-disabled","false")},sh=function(n,t,e){t.disableClass.each(function(t){bi(n.element(),t)}),(rh(n,t)?ih:ah)(n),t.onDisabled(n)},lh=function(n,t,e){t.disableClass.each(function(t){xi(n.element(),t)}),(rh(n,t)?uh:ch)(n),t.onEnabled(n)},fh=function(t,n){return rh(t,n)?Ar(t.element(),"disabled"):"true"===Dr(t.element(),"aria-disabled")},dh=/* */Object.freeze({__proto__:null,enable:lh,disable:sh,isDisabled:fh,onLoad:oh,set:function(t,n,e,o){(o?sh:lh)(t,n,e)}}),mh=/* */Object.freeze({__proto__:null,exhibit:function(t,n){return ii({classes:n.disabled?n.disableClass.map(Y).getOr([]):[]})},events:function(e,t){return Yo([qo(xo(),function(t,n){return fh(t,e)}),Ia(e,t,oh)])}}),gh=[ie("disabled",c),Zn("useNative",!0),Yn("disableClass"),$u("onDisabled"),$u("onEnabled")],ph=La({fields:gh,name:"disabling",active:mh,apis:dh}),hh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),vh=tinymce.util.Tools.resolve("tinymce.EditorManager"),bh=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},yh=function(t){return t.getParam("width",hh.DOM.getStyle(t.getElement(),"width"))},xh=function(t){return st.from(t.settings.min_width).filter(rt)},wh=function(t){return st.from(t.settings.min_height).filter(rt)},Sh=function(t){return st.from(t.getParam("max_width")).filter(rt)},kh=function(t){return st.from(t.getParam("max_height")).filter(rt)},Ch=function(t){return!1!==t.getParam("menubar",!0,"boolean")},Oh=function(t){var n=t.getParam("toolbar",!0),e=!0===n,o=S(n),r=C(n)&&0'+t+"
    "})}return r},ov=at(nf(pg(),hg())),rv=Nr("cell-over"),iv=Nr("cell-execute"),uv=function(n,e,t){var o,r=function(t){return jo(t,iv,{row:n,col:e})},i=function(t,n){n.stop(),r(t)};return Ji({dom:{tag:"div",attributes:((o={role:"button"})["aria-labelledby"]=t,o)},behaviours:za([Lm("insert-table-picker-cell",[Jo(ro(),Xm.focus),Jo(xo(),r),Jo(fo(),i),Jo(So(),i)]),rg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Xm.config({onFocus:function(t){return jo(t,rv,{row:n,col:e})}})])})},av=function(t){return{value:t}},cv=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,sv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,lv=function(t){return cv.test(t)||sv.test(t)},fv=function(t){var n={value:t.value.replace(cv,function(t,n,e,o){return n+n+e+e+o+o})},e=sv.exec(n.value);return null===e?["FFFFFF","FF","FF","FF"]:e},dv=function(t){var n=t.toString(16);return 1===n.length?"0"+n:n},mv=function(t){var n=dv(t.red)+dv(t.green)+dv(t.blue);return av(n)},gv=Math.min,pv=Math.max,hv=Math.round,vv=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,bv=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,yv=function(t,n,e,o){return{red:t,green:n,blue:e,alpha:o}},xv=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},wv=function(t){var n,e,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=pv(0,gv(i,1)),u=pv(0,gv(u,1)),0===i)return n=e=o=hv(255*u),yv(n,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:n=c,e=s,o=0;break;case 1:n=s,e=c,o=0;break;case 2:n=0,e=c,o=s;break;case 3:n=0,e=s,o=c;break;case 4:n=s,e=0,o=c;break;case 5:n=c,e=0,o=s;break;default:n=e=o=0}return n=hv(255*(n+l)),e=hv(255*(e+l)),o=hv(255*(o+l)),yv(n,e,o,1)},Sv=function(t){var n=fv(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return yv(e,o,r,1)},kv=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return yv(r,i,u,a)},Cv=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},Ov=yv(255,0,0,1),_v=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Tv="tinymce-custom-colors";var Ev="choiceitem",Bv=[{type:Ev,text:"Light Green",value:"#BFEDD2"},{type:Ev,text:"Light Yellow",value:"#FBEEB8"},{type:Ev,text:"Light Red",value:"#F8CAC6"},{type:Ev,text:"Light Purple",value:"#ECCAFA"},{type:Ev,text:"Light Blue",value:"#C2E0F4"},{type:Ev,text:"Green",value:"#2DC26B"},{type:Ev,text:"Yellow",value:"#F1C40F"},{type:Ev,text:"Red",value:"#E03E2D"},{type:Ev,text:"Purple",value:"#B96AD9"},{type:Ev,text:"Blue",value:"#3598DB"},{type:Ev,text:"Dark Turquoise",value:"#169179"},{type:Ev,text:"Orange",value:"#E67E23"},{type:Ev,text:"Dark Red",value:"#BA372A"},{type:Ev,text:"Dark Purple",value:"#843FA1"},{type:Ev,text:"Dark Blue",value:"#236FA1"},{type:Ev,text:"Light Gray",value:"#ECF0F1"},{type:Ev,text:"Medium Gray",value:"#CED4D9"},{type:Ev,text:"Gray",value:"#95A5A6"},{type:Ev,text:"Dark Gray",value:"#7E8C8D"},{type:Ev,text:"Navy Blue",value:"#34495E"},{type:Ev,text:"Black",value:"#000000"},{type:Ev,text:"White",value:"#ffffff"}],Dv=function zF(e){void 0===e&&(e=10);var t,n=_v.getItem(Tv),o=S(n)?JSON.parse(n):[],r=e-(t=o).length<0?t.slice(0,e):t,i=function(t){r.splice(t,1)};return{add:function(t){var n;(-1===(n=A(r,t))?st.none():st.some(n)).each(i),r.unshift(t),r.length>e&&r.pop(),_v.setItem(Tv,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),Mv=function(t){return!1!==t.getParam("custom_colors")},Av=function(t){var n=t.getParam("color_map");return n!==undefined?function(t){var n=[],u=nt.document.createElement("canvas");u.height=1,u.width=1;for(var a=u.getContext("2d"),c=function(t,n){var e=n/255;return("0"+Math.round(t*e+255*(1-e)).toString(16)).slice(-2).toUpperCase()},e=function(t){if(/^[0-9A-Fa-f]{6}$/.test(t))return"#"+t.toUpperCase();a.clearRect(0,0,u.width,u.height),a.fillStyle="#FFFFFF",a.fillStyle=t,a.fillRect(0,0,1,1);var n=a.getImageData(0,0,1,1).data,e=n[0],o=n[1],r=n[2],i=n[3];return"#"+c(e,i)+c(o,i)+c(r,i)},o=0;o"},Ww=function(o,t){return{uid:o.uid,dom:o.dom,components:t,behaviours:wl(o.formBehaviours,[bl.config({store:{mode:"manual",getValue:function(t){var n=df(t,o);return dt(n,function(t,r){return t().bind(function(t){var n,e,o=Mf.getCurrent(t);return n=o,e=new Error("Cannot find a current component to extract the value from for form part '"+r+"': "+Vr(t.element())),n.fold(function(){return ot.error(e)},ot.value)}).map(bl.getValue)})},setValue:function(e,t){ft(t,function(n,t){sf(e,o,t).each(function(t){Mf.getCurrent(t).each(function(t){bl.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return sf(t,o,n).bind(Mf.getCurrent)}}}},Gw={getField:ni(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),of("form",Uw(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=V(r,function(t){return ql({name:t,pname:Uw(t)})});return yf("form",jw,i,Ww,o)}},Xw=Nr("valid-input"),Yw=Nr("invalid-input"),qw=Nr("validating-input"),Kw="colorcustom.rgb.",Jw=function(d,m,g,p){var h=function(t,n,e,o,r){var i,u,a=d(Kw+"range"),c=[ey.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),ey.parts().field({data:r,factory:uy,inputAttributes:et({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:za([(i=n,u=t,Ty.config({invalidClass:m("invalid"),notify:{onValidate:function(t){jo(t,qw,{type:i})},onValid:function(t){jo(t,Xw,{type:i,value:bl.getValue(t)})},onInvalid:function(t){jo(t,Yw,{type:i,value:bl.getValue(t)})}},validator:{validate:function(t){var n=bl.getValue(t),e=u(n)?ot.value(!0):ot.error(d("aria.input.invalid"));return vy(e)},validateOnLoad:!1}})),Dy.config({})]),onSetValue:function(t){Ty.isInvalid(t)&&Ty.run(t).get(Z)}})],s="hex"!==n?[ey.parts()["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}},v=function(t,n){var e=n.red,o=n.green,r=n.blue;bl.setValue(t,{red:e,green:o,blue:r})},b=Ug({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),y=function(t,n){b.getOpt(t).each(function(t){Di(t.element(),"background-color","#"+n.value)})};return Of({factory:function(){var e={red:ce(st.some(255)),green:ce(st.some(255)),blue:ce(st.some(255)),hex:ce(st.some("ffffff"))},o=function(t){return e[t].get()},i=function(t,n){e[t].set(n)},r=function(t){var n=t.red,e=t.green,o=t.blue;i("red",st.some(n)),i("green",st.some(e)),i("blue",st.some(o))},n=function(t,n){var e=n.event();"hex"!==e.type()?i(e.type(),st.none()):p(t)},u=function(r,t,n){var e=parseInt(n,10);i(t,st.some(e)),o("red").bind(function(e){return o("green").bind(function(n){return o("blue").map(function(t){return yv(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=mv(t),Gw.getField(n,"hex").each(function(t){Xm.isFocused(t)||bl.setValue(n,{hex:e.value})}),e);y(r,o)})},a=function(t,n){var e=n.event();"hex"===e.type()?function(t,n){g(t);var e=av(n);i("hex",st.some(n));var o=Sv(e);v(t,o),r(o),jo(t,ix,{hex:e}),y(t,e)}(t,e.value()):u(t,e.type(),e.value())},t=function(t){return{label:d(Kw+t+".label"),description:d(Kw+t+".description")}},c=t("red"),s=t("green"),l=t("blue"),f=t("hex");return Ct(Gw.sketch(function(t){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[t.field("red",ey.sketch(h(xv,"red",c.label,c.description,255))),t.field("green",ey.sketch(h(xv,"green",s.label,s.description,255))),t.field("blue",ey.sketch(h(xv,"blue",l.label,l.description,255))),t.field("hex",ey.sketch(h(lv,"hex",f.label,f.description,"ffffff"))),b.asSpec()],formBehaviours:za([Ty.config({invalidClass:m("form-invalid")}),Lm("rgb-form-events",[Jo(Xw,a),Jo(Yw,n),Jo(qw,n)])])}}),{apis:{updateHex:function(t,n){var e,o;bl.setValue(t,{hex:n.value}),e=t,o=Sv(n),v(e,o),r(o),y(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},$w=function(t,o){var r=Lw.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=Lw.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"'}}),u=function(t,n){var e=t.width,o=t.height,r=t.getContext("2d");if(null!==r){r.fillStyle=n,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)}};return Of({factory:function(t){var n=at({x:at(0),y:at(0)}),e=za([Mf.config({find:st.some}),Xm.config({})]);return Lw.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:n},rounded:!1,components:[r,i],onChange:function(t,n,e){jo(t,ax,{value:e})},onInit:function(t,n,e,o){u(e.element().dom(),Cv(Ov))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element().dom(),u(r,Cv(o))}},extraApis:{}})},Qw=function(f,d){return Of({name:"ColourPicker",configFields:[zn("dom"),Zn("onValidHex",Z),Zn("onInvalidHex",Z)],factory:function(t){var a,v,n,e,o,r=Jw(f,d,t.onValidHex,t.onInvalidHex),i=$w(0,d),b={paletteRgba:ce(Ov)},u=Ug(i.sketch({})),c=Ug(r.sketch({})),s=function(t,e){u.getOpt(t).each(function(t){var n=Sv(e);b.paletteRgba.set(n),i.setRgba(t,n)})},l=function(t,n){c.getOpt(t).each(function(t){r.updateHex(t,n)})},y=function(n,e,t){it(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[u.asSpec(),(n=d,e=Lw.parts().spectrum({dom:{tag:"div",classes:[n("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=Lw.parts().thumb({dom:{tag:"div",classes:[n("hue-slider-thumb")],attributes:{role:"presentation"}}}),Lw.sketch({dom:{tag:"div",classes:[n("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:at({y:at(0)})},components:[e,o],sliderBehaviours:za([Xm.config({})]),onChange:function(t,n,e){jo(t,ux,{value:e})}})),c.asSpec()],behaviours:za([Lm("colour-picker-events",[Jo(ax,(v=[l],function(t,n){var e,o,r,i,u,a,c,s,l,f=n.event().value(),d=b.paletteRgba.get(),m=(i=r=0,u=(e=d).red/255,a=e.green/255,c=e.blue/255,s=Math.min(u,Math.min(a,c)),l=Math.max(u,Math.max(a,c)),s===l?rx(0,0,100*(i=s)):(r=60*((r=u===s?3:c===s?1:5)-(u===s?a-c:c===s?u-a:c-u)/(l-s)),o=(l-s)/l,i=l,rx(Math.round(r),Math.round(100*o),Math.round(100*i)))),g=rx(m.hue,f.x(),100-f.y()),p=wv(g),h=mv(p);y(t,h,v)})),Jo(ux,(a=[s,l],function(t,n){var e,o,r,i=n.event().value(),u=(e=i.y(),o=rx((100-e)/100*360,100,100),r=wv(o),mv(r));y(t,u,a)}))]),Mf.config({find:function(t){return c.getOpt(t)}}),Rm.config({mode:"acyclic"})])}}})},Zw=function(){return Mf.config({find:st.some})},tS=function(t){return Mf.config({find:t.getOpt})},nS=function(t){return Mf.config({find:function(n){return mr(n.element(),t).bind(function(t){return n.getSystem().getByDom(t).toOption()})}})},eS={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},oS=function(t){return eS[t]},rS=tinymce.util.Tools.resolve("tinymce.Resource"),iS=ln([Zn("preprocess",ct),Zn("postprocess",ct)]),uS=function(t,n,e){return bl.config(Ct({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},aS=function(t,n,e){return uS(t,function(t){return n(t.element())},function(t,n){return e(t.element(),n)})},cS=function(r,t){var i=_n("RepresentingConfigs.memento processors",iS,t);return bl.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=bl.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);bl.setValue(o,e)}}})},sS=uS,lS=function(t){return aS(t,Sr,kr)},fS=function(t){return bl.config({store:{mode:"memory",initialValue:t}})},dS=function(r,n){var e=function(t,n){n.stop()},o=function(t){return function(n,e){it(t,function(t){t(n,e)})}},i=function(t,n){if(!ph.isDisabled(t)){var e=n.event().raw();a(t,e.dataTransfer.files)}},u=function(t,n){var e=n.event().raw().target.files;a(t,e)},a=function(t,n){var e,o;bl.setValue(t,(e=n,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),P($(e),function(t){return o.test(t.name)}))),jo(t,Gb,{name:r.name})},c=Ug({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:za([Lm("input-file-events",[nr(fo()),nr(So())])])}),t=r.label.map(function(t){return Iy(t,n)}),s=ey.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:za([fS([]),Zw(),ph.config({}),rg.config({toggleClass:"dragenter",toggleOnExecute:!1}),Lm("dropzone-events",[Jo("dragenter",o([e,rg.toggle])),Jo("dragleave",o([e,rg.toggle])),Jo("dragover",e),Jo("drop",o([e,i])),Jo(lo(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:n.translate("Drop an image here")}},jg.sketch({dom:{tag:"button",innerHtml:n.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element().dom().click()},buttonBehaviours:za([Dy.config({}),Gh(n.isReadOnly),Uh()])})]}]}}}});return My(t,s,["tox-form__group--stretched"],[])},mS=Nr("alloy-fake-before-tabstop"),gS=Nr("alloy-fake-after-tabstop"),pS=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:za([Xm.config({ignore:!0}),Dy.config({})])}},hS=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[pS([mS]),t,pS([gS])],behaviours:za([nS(1)])}},vS=function(t,n){jo(t,ao(),{raw:{which:9,shiftKey:n}})},bS=function(t,n){var e=n.element();wi(e,mS)?vS(t,!0):wi(e,gS)&&vS(t,!1)},yS=function(t){return Sb(t,["."+mS,"."+gS].join(","),at(!1))},xS=!(Pe().browser.isIE()||Pe().browser.isEdge()),wS=function(t,n){var o,r,e=xS&&t.sandboxed,i=et(et({},t.label.map(function(t){return{title:t}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),u=(o=e,r=ce(""),{getValue:function(t){return r.get()},setValue:function(t,n){if(o)Br(t.element(),"srcdoc",n);else{Br(t.element(),"src","javascript:''");var e=t.element().dom().contentWindow.document;e.open(),e.write(n),e.close()}r.set(n)}}),a=t.label.map(function(t){return Iy(t,n)}),c=ey.parts().field({factory:{sketch:function(t){return hS({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:za([Dy.config({}),Xm.config({}),sS(st.none(),u.getValue,u.setValue)])})}}});return My(a,c,["tox-form__group--stretched"],[])};function SS(t,n){return OS(nt.document.createElement("canvas"),t,n)}function kS(t){var n=SS(t.width,t.height);return CS(n).drawImage(t,0,0),n}function CS(t){return t.getContext("2d")}function OS(t,n,e){return t.width=n,t.height=e,t}function _S(t){return t.naturalWidth||t.width}function TS(t){return t.naturalHeight||t.height}var ES,BS,DS,MS=window.Promise?window.Promise:(BS=(ES=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],PS(t,AS(IS,this),AS(RS,this))}).immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){nt.setTimeout(t,1)},DS=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},ES.prototype["catch"]=function(t){return this.then(null,t)},ES.prototype.then=function(e,o){var r=this;return new ES(function(t,n){FS.call(r,new HS(e,o,t,n))})},ES.all=function(){for(var t=[],n=0;n").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:e}).appendTo(d.body),oC(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(t)},c=function(t){if(cC(t),t.button!==u)return a(t);t.deltaX=t.screenX-l,t.deltaY=t.screenY-f,t.preventDefault(),r.drag(t)},a=function(t){cC(t),oC(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(t)},this.destroy=function(){oC(m).off()},oC(m).on("mousedown touchstart",n)}var lC=0,fC=function(s,e,l,o,r){var f,n,i,u="tox-",a="tox-crid-"+lC++,c=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}];i=["top","right","bottom","left"];var d=function(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}},m=function(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}};function g(t,n,e,o){var r,i,u,a,c;r=n.x,i=n.y,u=n.w,a=n.h,r+=e*t.deltaX,i+=o*t.deltaY,(u+=e*t.deltaW)<20&&(u=20),(a+=o*t.deltaH)<20&&(a=20),c=s=rC.clamp({x:r,y:i,w:u,h:a},l,"move"===t.name),c=m(l,c),f.fire("updateRect",{rect:c}),v(c)}function p(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),oC("#"+a+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}uC.each(c,function(t){oC("#"+a+"-"+t.name,o).css({left:n.w*t.xMul+n.x,top:n.h*t.yMul+n.y})}),t("top",{x:e.x,y:e.y,w:e.w,h:n.y-e.y}),t("right",{x:n.x+n.w,y:n.y,w:e.w-n.x-n.w+e.x,h:n.h}),t("bottom",{x:e.x,y:n.y+n.h,w:e.w,h:e.h-n.y-n.h+e.y}),t("left",{x:e.x,y:n.y,w:n.x-e.x,h:n.h}),t("move",n)}function h(t){p(s=t)}function v(t){h(d(l,t))}return function b(){oC('
    ').appendTo(o),uC.each(i,function(t){oC("#"+a,o).append('").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:e}).appendTo(d.body),oC(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(t)},c=function(t){if(cC(t),t.button!==u)return a(t);t.deltaX=t.screenX-l,t.deltaY=t.screenY-f,t.preventDefault(),r.drag(t)},a=function(t){cC(t),oC(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(t)},this.destroy=function(){oC(m).off()},oC(m).on("mousedown touchstart",n)}var lC=0,fC=function(s,e,l,o,r){var f,n,i,u="tox-",a="tox-crid-"+lC++,c=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}];i=["top","right","bottom","left"];var d=function(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}},m=function(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}};function g(t,n,e,o){var r,i,u,a,c;r=n.x,i=n.y,u=n.w,a=n.h,r+=e*t.deltaX,i+=o*t.deltaY,(u+=e*t.deltaW)<20&&(u=20),(a+=o*t.deltaH)<20&&(a=20),c=s=rC.clamp({x:r,y:i,w:u,h:a},l,"move"===t.name),c=m(l,c),f.fire("updateRect",{rect:c}),v(c)}function p(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),oC("#"+a+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}uC.each(c,function(t){oC("#"+a+"-"+t.name,o).css({left:n.w*t.xMul+n.x,top:n.h*t.yMul+n.y})}),t("top",{x:e.x,y:e.y,w:e.w,h:n.y-e.y}),t("right",{x:n.x+n.w,y:n.y,w:e.w-n.x-n.w+e.x,h:n.h}),t("bottom",{x:e.x,y:n.y+n.h,w:e.w,h:e.h-n.y-n.h+e.y}),t("left",{x:e.x,y:n.y,w:n.x-e.x,h:n.h}),t("move",n)}function h(t){p(s=t)}function v(t){h(d(l,t))}return function b(){oC('
    ').appendTo(o),uC.each(i,function(t){oC("#"+a,o).append('').css(n).appendTo(a)[0];return c.set(R.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&na(e.caret).addClass("mce-visual-caret-before")}),d(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:f,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){c.get().each(function(e){var t=ac(a,e.element,e.before);na(e.caret).css(pe({},t))})},destroy:function(){return Xn.clearInterval(n)}}},sc=function(){return oc.isIE()||oc.isEdge()||oc.isFirefox()},cc=function(e){return ic(e)||Gt(e)&&sc()},lc=an,fc=Kt("display","block table table-cell table-caption list-item"),dc=gu,mc=mu,pc=$t,gc=Du,hc=function(e,t){for(var n;n=e(t);)if(!mc(n))return n;return null},vc=function(e,t,n,r,o){var i=new ra(e,r);if(t<0){if((lc(e)||mc(e))&&n(e=hc(i.prev,!0)))return e;for(;e=hc(i.prev,o);)if(n(e))return e}if(0=o.data.length-1)return 1===e&&(r=s(o))?Sc(r):n;if(Cu(o)&&i<=1)return-1===e&&(r=u(o))?Nc(r):n;if(i===o.data.length)return(r=s(o))?Sc(r):n;if(0===i)return(r=u(o))?Nc(r):n}return n},kc=function(e,t){return R.from(Cc(e?0:-1,t)).filter(lc)},_c=function(e,t,n){var r=Ec(e,t,n);return-1===e?ls.fromRangeStart(r):ls.fromRangeEnd(r)},Rc=function(e){return R.from(e.getNode()).map(Ne.fromDom)},Tc=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Ac=function(e,t){var n=bc(e,t);return!(n||!rn(e.getNode()))||n};(ds=fs=fs||{})[ds.Backwards=-1]="Backwards",ds[ds.Forwards=1]="Forwards";var Dc,Oc=an,Bc=Zt,Pc=$t,Lc=rn,Ic=Du,Mc=function(e){return Ru(e)||!!Ou(t=e)&&!0!==W(te(t.getElementsByTagName("*")),function(e,t){return e||Su(t)},!1);var t},Fc=Bu,Uc=function(e,t){return e.hasChildNodes()&&tu.length-1)return!!rl(c,i,r)||nl(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},il=function(e){return Zt(e)&&0=n.length?t=n.length-1:t<0&&(t=0),n[t]||e},jl=function(e,t,u){var n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=function(e){var t;return 3===(t=e[0]).nodeType&&t===n&&r>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===i&&0":" />",n&&u&&c[e]&&0"),u&&c[e]&&0")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push(""):d.push(""),u&&d.push("\n")},doctype:function(e){d.push("",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}},hf=function(t,p){void 0===p&&(p=no());var g=gf(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(e){var f,d;d=t.validate,f={3:function(e){g.text(e.value,e.raw)},8:function(e){g.comment(e.value)},7:function(e){g.pi(e.name,e.value)},10:function(e){g.doctype(e.value)},4:function(e){g.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},g.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r},bf=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function Cf(W,K){void 0===K&&(K=no());var e=function(){};!1!==(W=W||{}).fix_self_closing&&(W.fix_self_closing=!0);var X=W.comment?W.comment:e,Y=W.cdata?W.cdata:e,G=W.text?W.text:e,J=W.start?W.start:e,Q=W.end?W.end:e,Z=W.pi?W.pi:e,ee=W.doctype?W.doctype:e,n=function(m,e){void 0===e&&(e="html");var t,n,r,p,o,i,a,g,u,s,h,c,v,l,f,d,y,b,C,w,x,S,N,E,k,_,R,T,A,D=m.html,O=0,B=[],P=0,L=$r.decode,I=hr.makeMap("src,href,data,background,formaction,poster,xlink:href"),M=/((java|vb)script|mhtml):/i,F="html"===e?0:1,U=function(e){var t,n;for(t=B.length;t--&&B[t].name!==e;);if(0<=t){for(n=B.length-1;t<=n;n--)(e=B[n]).valid&&Q(e.name);B.length=t}},z=function(e,t){return G(vf(e,m),t)},j=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),W.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),X(vf(e,m)))},H=function(e,t){var n=e||"",r=!Ve(n,"--"),o=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&(u=n,/^\s*\[if [\w\W]+\]>.*/.test(r.substr(u)))){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/;a.lastIndex=n;var u,s=a.exec(e);return s?s.index+s[0].length:r.length}(D,r,t);return e=D.substr(t,o-t),j(r?n+e:e),o+1},V=function(e,t,n,r,o){var i,a,u,s,c,l;if(t=t.toLowerCase(),u=t in h?t:L(n||r||o||""),n=de(m.uris,u).getOr(u),v&&!g&&!1==(0===(s=t).indexOf("data-")||0===s.indexOf("aria-"))){if(!(i=b[t])&&C){for(a=C.length;a--&&!(i=C[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(I[t]&&!W.allow_script_urls){var f=n.replace(/[\s\u0000-\u001F]+/g,"");try{f=decodeURIComponent(f)}catch(d){f=unescape(f)}if(M.test(f))return;if(l=f,!(c=W).allow_html_data_urls&&(/^data:image\//i.test(l)?!1===c.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(l):/^data:/i.test(l)))return}g&&(t in I||0===t.indexOf("on"))||(p.map[t]=n,p.push({name:t,value:n}))};for(k=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),_=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=K.getShortEndedElements(),E=W.self_closing_elements||K.getSelfClosingElements(),h=K.getBoolAttrs(),v=W.validate,u=W.remove_internals,A=W.fix_self_closing,R=K.getSpecialElements(),N=D+">";t=k.exec(N);){var q=t[0];if(OD.length){z(L(D.substr(t.index))),O=t.index+q.length;continue}":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,A&&E[n]&&0]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=l,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),l=s.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:kf.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return lu(l)},Rf=_f,Tf=function(e,t,n,r){var o,i,a,u,s;if(t.format=n,t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)o=hr.trim(Rf(e.serializer,r.innerHTML));else if("text"===t.format)o=lu(r.innerText||r.textContent);else{if("tree"===t.format)return e.serializer.serialize(r,t);a=(i=e).serializer.serialize(r,t),u=Hs(i),s=new RegExp("^(<"+u+"[^>]*>( | |\\s|\xa0|
    |)<\\/"+u+">[\r\n]*|
    [\r\n]*)$"),o=a.replace(s,"")}return"text"===t.format||Or(Ne.fromDom(r))?t.content=o:t.content=hr.trim(o),t.no_events||e.fire("GetContent",t),t.content},Af=hr.each,Df=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return Af(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!!r(n(e),n(t))&&(!!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))&&(!ll(e)&&!ll(t)))}},Of=function(n,r,o){return R.from(o.container()).filter(Zt).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})},Bf=N(Of,!0,dl),Pf=N(Of,!1,dl),Lf=function(e){var t=e.container();return Zt(t)&&0===t.data.length},If=function(t,n){return function(e){return R.from(Cc(t?0:-1,e)).filter(n).isSome()}},Mf=function(e){return"IMG"===e.nodeName&&"block"===mn(Ne.fromDom(e),"display")},Ff=function(e){return an(e)&&!($t(t=e)&&"all"===t.getAttribute("data-mce-bogus"));var t},Uf=If(!0,Mf),zf=If(!1,Mf),jf=If(!0,Gt),Hf=If(!1,Gt),Vf=If(!0,Ff),qf=If(!1,Ff),$f=function(e,t){var n,r,o,i=Ne.fromDom(e),a=Ne.fromDom(t);return n=a,r="pre,code",o=N(at,i),qa(n,r,o).isSome()},Wf=function(e,t){return Du(t)&&!1===(r=e,Zt(o=t)&&/^[ \t\r\n]*$/.test(o.data)&&!1===$f(r,o))||$t(n=t)&&"A"===n.nodeName&&n.hasAttribute("name")||Kf(t);var n,r,o},Kf=Xt("data-mce-bookmark"),Xf=Xt("data-mce-bogus"),Yf=(wf="data-mce-bogus",xf="all",function(e){return $t(e)&&e.getAttribute(wf)===xf}),Gf=function(e,t){return void 0===t&&(t=!0),function(e,t){var n,r=0;if(Wf(e,e))return!1;if(!(n=e.firstChild))return!0;var o=new ra(n,e);do{if(t){if(Yf(n)){n=o.next(!0);continue}if(Xf(n)){n=o.next();continue}}if(rn(n))r++,n=o.next();else{if(Wf(e,n))return!1;n=o.next()}}while(n);return r<=1}(e.dom(),t)},Jf=function(e){var t=Ua(e,"br"),n=H(function(e){for(var t=[],n=e.dom();n;)t.push(Ne.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),Er);t.length===n.length&&z(n,kt)},Qf=function(e){Et(e),St(e,Ne.fromHtml('
    '))},Zf=function(n){bt(n).each(function(t){dt(t).each(function(e){Sr(n)&&Er(t)&&Sr(e)&&kt(t)})})},ed=function(e,t,n){return st(t,e)?function(e,t){for(var n=D(t)?t:g,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=Ne.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||at(e,t)}).slice(0,-1):[]},td=function(e,t){return ed(e,t,x(!1))},nd=function(e,t){return[e].concat(td(e,t))},rd=function(e,t,n){if(0!==n){var r,o,i,a=e.data.slice(t,t+n),u=t+n>=e.data.length,s=0===t;e.replaceData(t,n,(o=s,i=u,W(r=a,function(e,t){return dl(t)||fl(t)?e.previousCharIsSpace||""===e.str&&o||e.str.length===r.length-1&&i?{previousCharIsSpace:!1,str:e.str+oo}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str))}},od=function(e,t){var n=e.data.slice(t),r=n.length-We(n).length;return rd(e,t,r)},id=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===ms.isTextPosition(n)&&o===r.parentNode&&i>ms.before(r).offset()?ms(t.container(),t.offset()-1):t;var n,r,o,i},ad=function(e){return Du(e.previousSibling)?R.some((t=e.previousSibling,Zt(t)?ms(t,t.data.length):ms.after(t))):e.previousSibling?el(e.previousSibling):R.none();var t},ud=function(e){return Du(e.nextSibling)?R.some((t=e.nextSibling,Zt(t)?ms(t,0):ms.before(t))):e.nextSibling?Zc(e.nextSibling):R.none();var t},sd=function(r,o){return ad(o).orThunk(function(){return ud(o)}).orThunk(function(){return e=r,t=o,n=ms.before(t.previousSibling?t.previousSibling:t.parentNode),Qc(e,n).fold(function(){return Jc(e,ms.after(t))},R.some);var e,t,n})},cd=function(n,r){return ud(r).orThunk(function(){return ad(r)}).orThunk(function(){return t=r,Jc(e=n,ms.after(t)).fold(function(){return Qc(e,ms.before(t))},R.some);var e,t})},ld=function(e,t,n){return(e?cd:sd)(t,n).map(N(id,n))},fd=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},dd=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(Rt(t))},md=function(e){if(Gf(e)){var t=Ne.fromHtml('
    ');return Et(e),St(e,t),R.some(ms.before(t.dom()))}return R.none()},pd=function(e,t,l){var n,r,o,i,a=dt(e).filter(Ot),u=mt(e).filter(Ot);return kt(e),r=u,o=t,i=function(e,t,n){var r,o,i,a,u=e.dom(),s=t.dom(),c=u.data.length;return o=s,i=l,a=Ke((r=u).data).length,r.appendData(o.data),kt(Ne.fromDom(o)),i&&od(r,a),n.container()===s?ms(u,c):n},((n=a).isSome()&&r.isSome()&&o.isSome()?R.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):R.none()).orThunk(function(){return l&&(a.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Ke(r).length,rd(t,n-o,o);var t,n,r,o}),u.each(function(e){return od(e.dom(),0)})),t})},gd=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=ld(n,t.getBody(),e.dom()),u=Ha(e,N(dd,t),(o=t.getBody(),function(e){return e.dom()===o})),s=pd(e,a,(i=e,me(t.schema.getTextInlineElements(),Rt(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(md).fold(function(){r&&fd(t,n,s)},function(e){r&&fd(t,n,R.some(e))})},hd=function(a){if(!k(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return z(a,function(e,r){var t=ne(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!k(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t|)$/," "):o("nextSibling")||(t=t.replace(/( | )(
    |)$/," "))),t}(p.getRng(),t)),r=e.parser,m=n.merge,o=hf({validate:e.settings.validate},e.schema),d='​',s={content:t,format:"html",selection:!0,paste:n.paste},(s=e.fire("BeforeSetContent",s)).isDefaultPrevented())e.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=s.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var h,v,y,b,C,w,x=(l=p.getRng()).startContainer||(l.parentElement?l.parentElement():null),S=e.getBody();x===S&&p.isCollapsed()&&g.isBlock(S.firstChild)&&(h=e,(v=S.firstChild)&&!h.schema.getShortEndedElements()[v.nodeName])&&g.isEmpty(S.firstChild)&&((l=g.createRng()).setStart(S.firstChild,0),l.setEnd(S.firstChild,0),p.setRng(l)),p.isCollapsed()||(nm(e),y=e.selection.getRng(),b=t,C=y.startContainer,w=y.startOffset,3===C.nodeType&&y.collapsed&&(C.data[w]===oo?(C.deleteData(w,1),/[\u00a0| ]$/.test(b)||(b+=" ")):C.data[w-1]===oo&&(C.deleteData(w-1,1),/[\u00a0| ]$/.test(b)||(b=" "+b))),t=b);var N,E,k,_={context:(i=p.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,_),!0===n.paste&&Kd(e.schema,u)&&Gd(g,i))return l=Zd(o,g,e.selection.getRng(),u),e.selection.setRng(l),void e.fire("SetContent",s);if(!function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!g.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),_.invalid){for(tm(e,d),i=p.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;t=i===a?a.innerHTML:g.getOuterHTML(i),t=o.serialize(r.parse(t.replace(//i,function(){return o.serialize(u)}))),i===a?g.setHTML(a,t):g.setOuterHTML(i,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):tm(e,t)}}(e,t=o.serialize(u),i);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new Df(r);hr.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,m),function(n,e){var t,r,o,i,a,u=n.dom,s=n.selection;if(e){if(n.selection.scrollIntoView(e),t=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===n.dom.getContentEditable(e))return e;return null}(e))return u.remove(e),s.select(t);var c=u.createRng();(i=e.previousSibling)&&3===i.nodeType?(c.setStart(i,i.nodeValue.length),rr.ie||(a=e.nextSibling)&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a))):(c.setStartBefore(e),c.setEndBefore(e));r=u.getParent(e,u.isBlock),u.remove(e),r&&u.isEmpty(r)&&(n.$(r).empty(),c.setStart(r,0),c.setEnd(r,0),em(r)||r.getAttribute("data-mce-fragment")||!(o=function(e){var t=ms.fromRangeStart(e);if(t=Hc(n.getBody()).next(t))return t.toRange()}(c))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(c=o,u.remove(r))),s.setRng(c)}}(e,g.get("mce_marker")),N=e.getBody(),hr.each(N.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),E=e.dom,k=e.selection.getStart(),R.from(E.getParent(k,"td,th")).map(Ne.fromDom).each(Zf),e.fire("SetContent",s),e.addVisual()}},om=function(e){var t=ct(e).dom();return e.dom()===t.activeElement},im=function(e){var t=e!==undefined?e.dom():V.document;return R.from(t.activeElement).map(Ne.fromDom)},am=function(e,t,n,r){return{start:x(e),soffset:x(t),finish:x(n),foffset:x(r)}},um=hd([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),sm=(um.before,um.on,um.after,function(e){return e.fold(d,d,d)}),cm=hd([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),lm={domRange:cm.domRange,relative:cm.relative,exact:cm.exact,exactFromRange:function(e){return cm.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t=e.match({domRange:function(e){return Ne.fromDom(e.startContainer)},relative:function(e,t){return sm(e)},exact:function(e,t,n,r){return e}});return lt(t)},range:am},fm=nt().browser,dm=function(e,t){var n=Ot(t)?ef(t).length:ht(t).length+1;return n',"TABLE"===n.nodeName?r=""+a+"":/^(UL|OL)$/.test(n.nodeName)&&(r="
  • "+a+"
  • "),r=(i=Hs(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||'
    ',zm(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=hf({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=Or(Ne.fromDom(n))?r:hr.trim(r),zm(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Hm=function(e,t){return e.splitText(t)},Vm=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Zt(t)?0
    ").append(n.childNodes)}))},dp[Nf="pre"]||(dp[Nf]=[]),dp[Nf].push(Ef);var gp,hp,vp=/^(src|href|style)$/,yp=hr.each,bp=wl,Cp=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},wp=function(e,t,n){var r,o;if(r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],$t(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[i=r.nodeValue.length&&(r=new ra(r,e.getBody()).next()||r),Zt(r)&&!n&&0===o&&(r=new ra(r,e.getBody()).prev()||r),r},xp=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Sp=function(e,t,n,r,o){var i=Ne.fromDom(t),a=Ne.fromDom(e.create(r,o)),u=(n?gt:pt)(i);return Nt(a,u),n?(Ct(i,a),xt(a,i)):(wt(i,a),St(a,i)),a.dom()},Np=function(e,t,n,r){return!(t=hl(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},Ep=function(e,r,o,t,i){var n,a,u,s,c,l=e.dom;if(u=l,!(bp(s=t,(c=r).inline)||bp(s,c.block)||c.selector&&($t(s)&&u.is(s,c.selector))||(a=t,r.links&&"A"===a.nodeName)))return!1;var f,d,m,p,g,h,v,y=t;if(r.inline&&"all"===r.remove&&k(r.preserve_attributes)){var b=H(l.getAttribs(y),function(e){return M(r.preserve_attributes,e.name.toLowerCase())});if(l.removeAllAttribs(y),z(b,function(e){return l.setAttrib(y,e.name,e.value)}),0e?t.cells().length:e},0)},qp=function(e,t){for(var n,r=e.rows(),o=0;o")?{type:"fragmented",fragments:r,content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}},ug=function(e,t,n){"fragmented"===t.type?og(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},sg=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},cg=function(e){var t=Ne.fromTag("body",ig.get().getOrThunk(function(){var e=V.document.implementation.createHTMLDocument("undo");return ig.set(R.some(e)),e}));return nu(t,sg(e)),z(Ua(t,"*[data-mce-bogus]"),_t),t.dom().innerHTML},lg=function(e,t){return!(!e||!t)&&(r=t,sg(e)===sg(r)||(n=t,cg(e)===cg(n)));var n,r},fg=function(e){return 0===e.get()},dg=function(e,t,n){fg(n)&&(e.typing=t)},mg=function(e,t){e.typing&&(dg(e,!1,t),e.add())},pg=function(e){return e instanceof df},gg=function(e,t){Fm(e.serializer.getNodeFilters(),e.serializer.getAttributeFilters(),t)},hg=function(){return{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},vg=function(s){return{undoManager:{beforeChange:function(e,t){return n=s,r=t,void(fg(e)&&r.set(R.some(Ls(n.selection))));var n,r},addUndoLevel:function(e,t,n,r,o,i){return function(e,t,n,r,o,i,a){var u=e.settings,s=ag(e);if(i=i||{},i=hr.extend(i,s),!1===fg(r)||e.removed)return null;var c=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&lg(c,i))return null;if(t.data[n.get()]&&o.get().each(function(e){t.data[n.get()].beforeBookmark=e}),u.custom_undo_redo_levels&&t.data.length>u.custom_undo_redo_levels){for(var l=0;l",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:u.convertURL,url_converter_scope:u},pe(pe({},s),a?Lg:{}));return jg(Og||Bg,Og,c,r,o)},Vg=function(e,t,n){return R.from(t.settings[n]).filter(e)},qg=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?z(0\ufeff
    ');return Ct(n.element,r),hh(r,function(){return kt(r)})},yh=function(n,r,o,i){xh(n,function(e,t){return Ch(n,r,o,i)},o)},bh=function(e,t,n,r,o){var i,a,u={elm:r.element.dom(),alignToTop:o};i=u,e.fire("ScrollIntoView",i).isDefaultPrevented()||(n(t,Ft(t).top(),r,o),a=u,e.fire("AfterScrollIntoView",a))},Ch=function(e,t,n,r){var o=Ne.fromDom(e.getBody()),i=Ne.fromDom(e.getDoc());o.dom().offsetWidth;var a=vh(Ne.fromDom(n.startContainer),n.startOffset);bh(e,i,t,a,r),a.cleanup()},wh=function(e,t,n,r){var o,i=Ne.fromDom(e.getDoc());bh(e,i,n,(o=t,hh(Ne.fromDom(o),f)),r)},xh=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(Ne.fromDom(r),Ne.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n)},Sh=function(e,t,n,r){var o=e.pos;if(n)Ut(o.left(),o.top(),r);else{var i=o.top()-t+e.height;Ut(o.left(),i,r)}},Nh=function(e,t,n,r,o){var i=n+t,a=r.pos.top(),u=r.bottom,s=n<=u-a;if(aa.bottom&&zt(n.element,!0===r)},_h=function(e,t,n){return yh(e,Eh,t,n)},Rh=function(e,t,n){return wh(e,t,Eh,n)},Th=function(e,t,n){return yh(e,kh,t,n)},Ah=function(e,t,n){return wh(e,t,kh,n)},Dh=function(e,t,n){(e.inline?_h:Th)(e,t,n)},Oh=function(e){return on(e)||an(e)},Bh=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=hr.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,an(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Oh))?null:i}return r},Ph=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return R.from(i).map(Ne.fromDom).map(function(e){return r&&t.collapsed?e:vt(e,o(e,a)).getOr(e)}).bind(function(e){return Dt(e)?R.some(e):ft(e).filter(Dt)}).map(function(e){return e.dom()}).getOr(e)},Lh=function(e,t,n){return Ph(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},Ih=function(e,t,n){return Ph(e,t,!1,n,function(e,t){return 0o.childNodes.length-1&&(s=!1),tn(o)&&(o=m,i=0),o===m){if(s&&(a=o.childNodes[0R(n)?(x=T(w*b),w=T(x/b)):(w=T(x/b),x=T(w*b))),P(l,w,x),r=0<(r=d.startPos.x+t)?r:0,o=0<(o=d.startPos.y+n)?o:0,E.setStyles(f,{left:r,top:o,display:"block"}),f.innerHTML=w+" × "+x,d[2]<0&&l.clientWidth<=w&&E.setStyle(l,"left",g+(v-w)),d[3]<0&&l.clientHeight<=x&&E.setStyle(l,"top",h+(y-x)),(t=A.scrollWidth-S)+(n=A.scrollHeight-N)!==0&&E.setStyles(f,{left:r-t,top:o-n}),C||(i=c,a=v,u=y,s.fire("ObjectResizeStart",{target:i,width:a,height:u}),C=!0)},I=function(){var e=C;C=!1;var t,n,r,o=function(e,t){t&&(c.style[e]||!s.schema.isValid(c.nodeName.toLowerCase(),e)?E.setStyle(O(c),e,t):E.setAttrib(O(c),e,""+t))};e&&(o("width",w),o("height",x)),E.unbind(k,"mousemove",L),E.unbind(k,"mouseup",I),_!==k&&(E.unbind(_,"mousemove",L),E.unbind(_,"mouseup",I)),E.remove(l),E.remove(f),i(c),e&&(t=c,n=w,r=x,s.fire("ObjectResized",{target:t,width:n,height:r}),E.setAttrib(c,"style",E.getAttrib(c,"style"))),s.nodeChanged()},i=function(e){var t,r,o,n,i;M(),U(),t=E.getPos(e,A),g=t.x,h=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,c!==e&&(c=e,w=x=0),n=s.fire("ObjectSelected",{target:e}),B(e)&&!n.isDefaultPrevented()?u(a,function(n,e){var t;(t=E.get("mceResizeHandle"+e))&&E.remove(t),t=E.add(A,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===rr.ie&&(t.contentEditable=!1),E.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),m=(t=e).screenX,p=t.screenY,v=O(c).clientWidth,y=O(c).clientHeight,b=y/v,(d=n).startPos={x:r*n[0]+g,y:o*n[1]+h},S=A.scrollWidth,N=A.scrollHeight,l=c.cloneNode(!0),E.addClass(l,"mce-clonedresizable"),E.setAttrib(l,"data-mce-bogus","all"),l.contentEditable=!1,l.unSelectabe=!0,E.setStyles(l,{left:g,top:h,margin:0}),P(l,r,o),l.removeAttribute("data-mce-selected"),A.appendChild(l),E.bind(k,"mousemove",L),E.bind(k,"mouseup",I),_!==k&&(E.bind(_,"mousemove",L),E.bind(_,"mouseup",I)),f=E.add(A,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},v+" × "+y)}),n.elm=t,E.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+h-t.offsetHeight/2})}):M(),c.setAttribute("data-mce-selected","1")},M=function(){U(),c&&c.removeAttribute("data-mce-selected"),oe(a,function(e,t){var n=E.get("mceResizeHandle"+t);n&&(E.unbind(n),E.remove(n))})},o=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};C||s.removed||(u(E.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=E.$(t).closest("table,img,figure.image,hr")[0],A)&&(z(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?i(t):M())},F=function(e){return ev(function(e,t){for(;t&&t!==e;){if(tv(t)||ev(t))return t;t=t.parentNode}return null}(s.getBody(),e))},U=function(){oe(a,function(e){e.elm&&(E.unbind(e.elm),delete e.elm)})},z=function(){try{s.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};s.on("init",function(){if(z(),rr.browser.isIE()||rr.browser.isEdge()){s.on("mousedown click",function(e){var t=e.target,n=t.nodeName;C||!/^(TABLE|IMG|HR)$/.test(n)||F(t)||(2!==e.button&&s.selection.select(t,"TABLE"===n),"mousedown"===e.type&&s.nodeChanged())});var e=function(e){var t=function(e){Xn.setEditorTimeout(s,function(){return s.selection.select(e)})};if(F(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))};E.bind(A,"mscontrolselect",e),s.on("remove",function(){return E.unbind(A,"mscontrolselect",e)})}var t=Xn.throttle(function(e){s.composing||o(e)});s.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",t),s.on("keyup compositionend",function(e){c&&"TABLE"===c.nodeName&&t(e)}),s.on("hide blur",M),s.on("contextmenu longpress",n,!0)}),s.on("remove",U);return{isResizable:B,showResizeRect:i,hideResizeRect:M,updateResizeRect:o,destroy:function(){c=l=null}}},rv=function(e,t,n){if(e&&e.hasOwnProperty(t)){var r=H(e[t],function(e){return e!==n});0===r.length?delete e[t]:e[t]=r}};var ov=function(e){return!!e.select},iv=function(e){return!(!e||!e.ownerDocument)&&st(Ne.fromDom(e.ownerDocument),Ne.fromDom(e))},av=function(u,s,e,c){var n,t,l,f,r=function h(i,n){var a,u;return{selectorChangedWithUnbind:function(e,t){return a||(a={},u={},n.on("NodeChange",function(e){var n=e.element,r=i.getParents(n,null,i.getRoot()),o={};hr.each(a,function(e,n){hr.each(r,function(t){if(i.is(t,n))return u[n]||(hr.each(e,function(e){e(!0,{node:t,selector:n,parents:r})}),u[n]=e),o[n]=e,!1})}),hr.each(u,function(e,t){o[t]||(delete u[t],hr.each(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),{unbind:function(){rv(a,e,t),rv(u,e,t)}}}}}(u,c).selectorChangedWithUnbind,o=function(e,t){return Yh(c,e,t)},i=function(e){var t=m();t.collapse(!!e),a(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},m=function(){var e,t,n,r,o=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;if(null==(r=s.document))return null;if(c.bookmark!==undefined&&!1===Pm(c)){var i=wm(c);if(i.isSome())return i.map(function(e){return Fp(c,[e])[0]}).getOr(r.createRange())}try{(e=d())&&!qt(e.anchorNode)&&(t=0t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return r=e,o=t,void((n=c).inline?Rh:Ah)(n,r,o);var n,r,o},placeCaretAt:function(e,t){return a(Bh(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?ms.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=Jh(g),t=nv(g,c),g.bookmarkManager=n,g.controlSelection=t,g},uv=function(e,a,u){e.addNodeFilter("font",function(e){z(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,z(["color","face","size"],function(e){t.attr(e,null)})})})},sv=function(e,t){var n,r=ao();t.convert_fonts_to_spans&&uv(e,r,hr.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){z(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},cv=function(e){var t,n,r=decodeURIComponent(e).split(",");return(n=/data:([^;]+)/.exec(r[0]))&&(t=n[1]),{type:t,data:r[1]}},lv=function(e,t){var n;try{n=V.atob(t)}catch(pE){return R.none()}for(var r=new Uint8Array(n.length),o=0;o)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0")):"xhtml"===s.element_format&&0)\s*/g,"$1"),hr.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=hr.map(e.split(/(?:~\+|~|\+)/),qv),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]).length?(i[0].name||(i[0].name=t),t=e.selector,Vv(i,n)):Vv([t],n),o=Hv.select(t,r)[0]||r.firstChild,jv(e.styles,function(e,t){(e=l(e))&&Hv.setStyle(o,t,e)}),jv(e.attributes,function(e,t){(e=l(e))&&Hv.setAttrib(o,t,e)}),jv(e.classes,function(e){e=l(e),Hv.hasClass(o,e)||Hv.addClass(o,e)}),n.fire("PreviewFormats"),Hv.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=Hv.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,jv(u.split(" "),function(e){var t=Hv.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=Hv.getStyle(n.getBody(),e,!0),"#ffffff"===Hv.toHex(t).toLowerCase())||"color"===e&&"#000000"===Hv.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),Hv.remove(r),s)},Wv=function(s){var e=Fv(s),t=xa(null);return function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])}(s),lp(s),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,t,n){var r,o,i;r=e,o=t,i=n,wg(s).formatter.apply(r,o,i)},remove:function(e,t,n,r){var o,i,a,u;o=e,i=t,a=n,u=r,wg(s).formatter.remove(o,i,a,u)},toggle:function(e,t,n){var r,o,i;r=e,o=t,i=n,wg(s).formatter.toggle(r,o,i)},match:N(Gm,s),matchAll:N(Jm,s),matchNode:N(Ym,s),canApply:N(Qm,s),formatChanged:N(Mv,s,t),getCssText:N($v,s)}},Kv=function(n,r,o){var i=xa(!1),a=function(e){dg(r,!1,o),r.add({},e)};n.on("init",function(){r.add()}),n.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(mg(r,o),r.beforeChange())}),n.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),n.on("ObjectResizeStart cut",function(){r.beforeChange()}),n.on("SaveContent ObjectResized blur",a),n.on("dragend",a),n.on("keyup",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),n.nodeChanged()),46!==t&&8!==t||n.nodeChanged(),i.get()&&r.typing&&!1===lg(ag(n),r.data[0])&&(!1===n.isDirty()&&(n.setDirty(!0),n.fire("change",{level:r.data[0],lastLevel:null})),n.fire("TypingUndo"),i.set(!1),n.nodeChanged()))}),n.on("keydown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)r.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20t;var t}},ab=function(n){return function(e){return t=n,e.line===t;var t}},ub=an,sb=vc,cb=function(e,t){return Math.abs(e.left-t)},lb=function(e,t){return Math.abs(e.right-t)},fb=function(e,t){return e>=t.left&&e<=t.right},db=function(e,o){return cr(e,function(e,t){var n,r;return n=Math.min(cb(e,o),lb(e,o)),r=Math.min(cb(t,o),lb(t,o)),fb(o,t)||!fb(o,e)&&(r===n&&ub(t.node)||r=e.top&&n<=e.bottom});return(r=(r=db(f,t))&&db((a=e,c=function(t,e){var n;return n=H(Zy([e]),function(e){return!t(e,u)}),s=s.concat(n),0===n.length},(s=[]).push(u=r),mb(Uv.Up,a,N(c,Fu),u.node),mb(Uv.Down,a,N(c,Uu),u.node),s),t))&&cc(r.node)?(i=t,{node:(o=r).node,before:cb(o,i)'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},Lb=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Hc((e=l).getBody()),o=N(Tc,r.next),i=N(Tc,r.prev),a=t?fs.Forwards:fs.Backwards,u=t?o:i,s=e.selection.getRng(),(n=Ob(a,e,u,s))?n:(n=Pb(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},Ib=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?ob:rb,i=(e=u).selection.getRng(),(n=Bb(r,e,o,i))?n:(n=Pb(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}},Mb=function(r,o){return function(){var t,e=o?ms.fromRangeEnd(r.selection.getRng()):ms.fromRangeStart(r.selection.getRng()),n=(o?_b:kb)(r.getBody(),e);return(o?ee:Z)(n.positions).filter((t=o,function(e){return(t?qf:Vf)(e)})).fold(x(!1),function(e){return r.selection.setRng(e.toRange()),!0})}},Fb=function(o,e){return Y(e,function(e){var t,n,r=(t=Lu(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:o(r),cell:e},{x:r.right,y:o(r),cell:e}]})},Ub=function(e,t,n,r,o){var i,a,u=Ua(Ne.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),s=H(Fb(e,u),function(e){return t(e,o)});return i=r,a=o,W(s,function(e,r){return e.fold(function(){return R.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-i)+Math.abs(e.y-a)),n=Math.sqrt(Math.abs(r.x-i)+Math.abs(r.y-a));return R.some(nt}),Hb=function(t,n){return Z(n.getClientRects()).bind(function(e){return zb(t,e.left,e.top)}).bind(function(e){return Eb(el(t=e).map(function(e){return kb(t,e).positions.concat(e)}).getOr([]),n);var t})},Vb=function(t,n){return ee(n.getClientRects()).bind(function(e){return jb(t,e.left,e.top)}).bind(function(e){return Eb(Zc(t=e).map(function(e){return[e].concat(_b(t,e).positions)}).getOr([]),n);var t})},qb=function(e,t){e.selection.setRng(t),Dh(e,t)},$b=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===eb.Wrap&&0===a.positions.length||!rn(n.getNode())&&((i=u).breakType===eb.Br&&1===i.positions.length)?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},Wb=N($b,kb),Kb=N($b,_b),Xb=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(sc()&&(o=t,i=s,a=n,u=ms.fromRangeStart(i),Gc(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=vb(c,e,n,!t,!0);return qb(e,l),!0}return!1},Yb=function(e,t){var n=t.getNode(e);return $t(n)&&"TABLE"===n.nodeName?R.some(n):R.none()},Gb=function(u,s,c){var e=Yb(!!s,c),t=!1===s;e.fold(function(){return qb(u,c.toRange())},function(a){return Gc(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return qb(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=Hs(r=u))?r.undoManager.transact(function(){var e=Ne.fromTag(i);ln(e,Vs(r)),St(e,Ne.fromTag("br")),(n?wt:Ct)(Ne.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),qb(r,t)}):qb(r,t.toRange()));var n,r,o,t,i})})},Jb=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=ms.fromRangeStart(l),d=e.getBody();if(!t&&Wb(r,f)){var m=(u=d,Hb(s=n,c=f).orThunk(function(){return Z(c.getClientRects()).bind(function(e){return Nb(Rb(u,ms.before(s)),e.left)})}).getOr(ms.before(s)));return Gb(e,t,m),!0}if(t&&Kb(r,f)){m=(o=d,Vb(i=n,a=f).orThunk(function(){return Z(a.getClientRects()).bind(function(e){return Nb(Tb(o,ms.after(i)),e.left)})}).getOr(ms.after(i)));return Gb(e,t,m),!0}return!1},Qb=function(t,n){return function(){return R.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return R.from(t.dom.getParent(e,"table")).map(function(e){return Xb(t,n,e)})}).getOr(!1)}},Zb=function(n,r){return function(){return R.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return R.from(n.dom.getParent(t,"table")).map(function(e){return Jb(n,r,e,t)})}).getOr(!1)}},eC=function(e){return M(["figcaption"],Rt(e))},tC=function(e){var t=V.document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},nC=function(e,t,n){(n?St:xt)(e,t)},rC=function(e,t,n,r){return""===t?(l=e,f=r,d=Ne.fromTag("br"),nC(l,d,f),tC(d)):(o=e,i=r,a=t,u=n,s=Ne.fromTag(a),c=Ne.fromTag("br"),ln(s,u),St(s,c),nC(o,s,i),tC(c));var o,i,a,u,s,c,l,f,d},oC=function(e,t,n){return t?(o=e.dom(),_b(o,n).breakAt.isNone()):(r=e.dom(),kb(r,n).breakAt.isNone());var r,o},iC=function(t,n){var e,r,o=Ne.fromDom(t.getBody()),i=ms.fromRangeStart(t.selection.getRng()),a=Hs(t),u=Vs(t);return e=i,r=N(at,o),Va(Ne.fromDom(e.container()),Sr,r).filter(eC).exists(function(){if(oC(o,n,i)){var e=rC(o,a,u,n);return t.selection.setRng(e),!0}return!1})},aC=function(e,t){return function(){return!!e.selection.isCollapsed()&&iC(e,t)}},uC=function(e,r){return Y(U(e,function(e){return pe({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:f},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},sC=function(e){for(var t=[],n=1;n'},kw=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},_w=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},Rw=function(e,t,n){return!1===Zt(t)?n:e?1===n&&t.data.charAt(n-1)===su?0:n:n===t.data.length-1&&t.data.charAt(n)===su?t.data.length:n},Tw=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},Aw=function(o,i,e){R.from(e.style).map(o.dom.parseStyle).each(function(e){var t=function(e){var t={},n=e.dom();if(un(n))for(var r=0;rs.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=p&&Zt(s)?s.nodeValue.length:0),(u=Tw(g,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,p=Tw(m,r);if(!(a=m.getParent(r,m.isBlock))||!_w(m,a)){if(l=(a=a||p)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),Dw(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),Dw(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,y,s,i)),c=g.getParent(s,g.isBlock),l=c?g.getParent(c.parentNode,g.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||R||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&g.isEmpty(c)?Nw(a,b,l,c,m):m&&c===a.getBody()||(m=m||"P",mu(c)?(r=xu(c),g.isEmpty(c)&&Ew(c),Dw(a,r),yw(a,r)):C()?w():C(!0)?(r=c.parentNode.insertBefore(b(),c),yw(a,kw(c,"HR")?r:c)):((_=(k=y).cloneRange()).setStart(k.startContainer,Rw(!0,k.startContainer,k.startOffset)),_.setEnd(k.endContainer,Rw(!1,k.endContainer,k.endOffset)),(t=_.cloneRange()).setEndAfter(c),o=t.extractContents(),E=o,z(Fa(Ne.fromDom(E),Ot),function(e){var t=e.dom();t.nodeValue=lu(t.nodeValue)}),function(e){for(;Zt(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o),r=o.firstChild,g.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;$t(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=e,(u=o)&&"A"===u.nodeName&&a.isEmpty(u)&&e.remove(o));var a,u}}(g,v,r),x=g,(S=c).normalize(),(N=S.lastChild)&&!/^(left|right)$/gi.test(x.getStyle(N,"float",!0))||x.add(S,"br"),g.isEmpty(c)&&Ew(c),r.normalize(),g.isEmpty(r)?(g.remove(r),w()):(Dw(a,r),yw(a,r))),g.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},Bw=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},Pw=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},Lw=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Wh(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var c=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&!function(e,t,n){for(var r,o=new ra(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}}},jx=function(l,f){return function(e){if(l.dragging&&(s=(i=f).selection,c=s.getSel().getRangeAt(0).startContainer,a=3===c.nodeType?c.parentNode:c,u=l.element,a!==u&&!i.dom.isChildOf(a,u)&&!Ix(a))){var t=(r=l.element,(o=r.cloneNode(!0)).removeAttribute("data-mce-selected"),o),n=f.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){Fx(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;Hx(l)}},Hx=function(e){e.dragging=!1,e.element=null,Fx(e.ghost)},Vx=function(e){var t,n,r,o,i,a,u,s,c={};t=ga.DOM,a=V.document,n=Ux(c,e),r=zx(c,e),o=jx(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),Hx(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},qx=function(e){var n;Vx(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Ix(t)||Ix(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},$x=on,Wx=an,Kx=function(e,t){for(var n=e.getBody();t&&t!==n;){if($x(t)||Wx(t))return t;t=t.parentNode}return null},Xx=function(g){var h,v=g.getBody(),o=uc(g,v,function(e){return g.dom.isBlock(e)},function(){return Pm(g)}),y="sel-"+g.dom.uniqueId(),a=function(e){e&&g.selection.setRng(e)},r=function(){return g.selection.getRng()},b=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},t=function(e){return gu(e)||Cu(e)||wu(e)},C=function(e){return t(e.startContainer)||t(e.endContainer)},u=function(e){var t=g.schema.getShortEndedElements(),n=g.dom.createRng(),r=e.startContainer,o=e.startOffset,i=e.endContainer,a=e.endOffset;return me(t,r.nodeName.toLowerCase())?0===o?n.setStartBefore(r):n.setStartAfter(r):n.setStart(r,o),me(t,i.nodeName.toLowerCase())?0===a?n.setEndBefore(i):n.setEndAfter(i):n.setEnd(i,a),n},s=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!C(e))if(!1===t){if(c=_c(-1,v,e),cc(c.getNode(!0)))return b(-1,c.getNode(!0),!1,!1);if(cc(c.getNode()))return b(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=_c(1,v,e),cc(c.getNode()))return b(1,c.getNode(),!c.isAtEnd(),!1);if(cc(c.getNode(!0)))return b(1,c.getNode(!0),!1,!1)}return null}if(i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&Wx(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType)return null;if(u===a+1&&i===e.endContainer&&(n=i.childNodes[a]),!Wx(n))return null;if(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented())return null;r=$a(Ne.fromDom(g.getBody()),"#"+y).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('
    ').attr("id",y)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&rr.ie?(r.empty().append('

    \xa0

    ').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append(oo).append(l).append(oo),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e);var p=Ne.fromDom(n);return z(Ua(Ne.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){at(p,e)||dn(e,"data-mce-selected")}),g.dom.getAttrib(n,"data-mce-selected")||n.setAttribute("data-mce-selected","1"),h=n,w(),e},c=function(){h&&(h.removeAttribute("data-mce-selected"),$a(Ne.fromDom(g.getBody()),"#"+y).each(kt),h=null),$a(Ne.fromDom(g.getBody()),"#"+y).each(kt),h=null},w=function(){o.hide()};return rr.ceFalse&&function(){g.on("mouseup",function(e){var t=r();t.collapsed&&Qg(g,e.clientX,e.clientY)&&a(bb(g,t,!1))}),g.on("click",function(e){var t;(t=Kx(g,e.target))&&(Wx(t)&&(e.preventDefault(),g.focus()),$x(t)&&g.dom.isChildOf(t,g.selection.getNode())&&c())}),g.on("blur NewBlock",function(){c()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==Wx(Kx(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Hc(e);if(!e.firstChild)return!1;var n=ms.before(e.firstChild),r=t.next(n);return r&&!Vf(r)&&!qf(r)}(o)};(n=g).on("tap",function(e){var t=Kx(n,e.target);Wx(t)&&(e.preventDefault(),s(yb(n,t)))},!0),g.on("mousedown",function(e){var t,n=e.target;if((n===v||"HTML"===n.nodeName||g.dom.isChildOf(n,v))&&!1!==Qg(g,e.clientX,e.clientY))if(t=Kx(g,n))Wx(t)?(e.preventDefault(),s(yb(g,t))):(c(),$x(t)&&e.shiftKey||Qh(e.clientX,e.clientY,g.selection.getRng())||(w(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===cc(n)){c(),w();var r=pb(v,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=b(1,r.node,r.before,!1);g.getBody().focus(),a(o)}}}),g.on("keypress",function(e){Zh.modifierPressed(e)||(e.keyCode,Wx(g.selection.getNode())&&e.preventDefault())}),g.on("GetSelectionRange",function(e){var t=e.range;if(h){if(!h.parentNode)return void(h=null);(t=t.cloneRange()).selectNode(h),e.range=t}}),g.on("SetSelectionRange",function(e){e.range=u(e.range);var t=s(e.range,e.forward);t&&(e.range=t)});var t,e;g.on("AfterSetSelectionRange",function(e){var t,n=e.range;C(n)||"mcepastebin"===n.startContainer.parentNode.id||w(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||c()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!rr.ie){var r=(t=g.dom.get(y))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),qx(g),e=Ta(function(){if(!t.removed&&t.getBody().contains(V.document.activeElement)&&t.selection.getRng().collapsed){var e=Cb(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0),(t=g).on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})}(),{showCaret:b,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(xu(e),a(r()),g.selection.scrollIntoView(e))},hideFakeCaret:w,destroy:function(){o.destroy(),h=null}}},Yx=function(u){var s,n,r,o=hr.each,c=Zh.BACKSPACE,l=Zh.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=rr.gecko,a=rr.ie,m=rr.webkit,p="data:text/mce-internal,",g=a?"Text":"URL",h=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},v=function(e){return e.isDefaultPrevented()},y=function(){u.shortcuts.add("meta+a",null,"SelectAll")},b=function(){u.on("keydown",function(e){if(!v(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11")+"",e.getParam("document_base_url","")!==e.documentBaseUrl&&(r+=''),r+='',t=zs(e,"body_id","tinymce"),n=zs(e,"body_class",""),js(e)&&(r+=''),r+='
    '},iS=function(e,t){var n,r,o,i,a=e.editorManager.translate("Rich Text Area. Press ALT-0 for help."),u=(n=e.id,r=a,t.height,o=e.getParam("iframe_attrs",{}),i=Ne.fromTag("iframe"),ln(i,o),ln(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),La(i,"tox-edit-area__iframe"),i.dom());u.onload=function(){u.onload=null,e.fire("load")};var s=function(e,t){if(V.document.domain!==V.window.location.hostname&&rr.browser.isIE()){var n=Bv("mce");e[n]=function(){nS(e)};var r='javascript:(function(){document.open();document.domain="'+V.document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return rS.setAttrib(t,"src",r),!0}return!1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=oS(e),rS.add(t.iframeContainer,u),s},aS=ga.DOM,uS=function(t,n,e){var r=th.get(e),o=th.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=hr.trim(e),r&&-1===hr.inArray(n,e)){if(hr.each(th.dependencies(e),function(e){uS(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(pE){!function(e,t,n){var r=ka.translate(["Failed to initialize plugin: {0}",t]);ch(r,n),ih(e,r)}(t,e,pE)}}},sS=function(e){return e.replace(/^\-/,"")},cS=function(e){return{editorContainer:e,iframeContainer:e}},lS=function(e){var t,n,r=e.getElement();return e.inline?cS(null):(t=r,n=aS.create("div"),aS.insertAfter(n,t),cS(n))},fS=function(e){var n,t,r,o,i,a;e.fire("ScriptsLoaded"),n=e,t=hr.trim($s(n)),r=n.ui.registry.getAll().icons,o=pe(pe({},$g.get("default").icons),$g.get(t).icons),oe(o,function(e,t){me(r,t)||n.ui.registry.addIcon(t,e)}),function(e){var t=e.settings.theme;if(q(t)){e.settings.theme=sS(t);var n=nh.get(t);e.theme=new n(e,nh.urls[t]),e.theme.init&&e.theme.init(e,nh.urls[t]||e.documentBaseUrl.replace(/\/$/,""),e.$)}else e.theme={}}(e),i=e,a=[],hr.each(i.settings.plugins.split(/[ ,]/),function(e){uS(i,a,sS(e))});var u,s,c,l,f,d,m,p,g,h=(f=(u=e).getElement(),u.orgDisplay=f.style.display,q(u.settings.theme)?u.theme.renderUI():D(u.settings.theme)?(c=(s=u).getElement(),(l=(0,s.settings.theme)(s,c)).editorContainer.nodeType&&(l.editorContainer.id=l.editorContainer.id||s.id+"_parent"),l.iframeContainer&&l.iframeContainer.nodeType&&(l.iframeContainer.id=l.iframeContainer.id||s.id+"_iframecontainer"),l.height=l.iframeHeight?l.iframeHeight:c.offsetHeight,l):lS(u));return e.editorContainer=h.editorContainer?h.editorContainer:null,(d=e).contentCSS=d.contentCSS.concat(lh(d)),e.inline?nS(e):(g=iS(m=e,p=h),p.editorContainer&&(rS.get(p.editorContainer).style.display=m.orgDisplay,m.hidden=rS.isHidden(p.editorContainer)),m.getElement().style.display="none",rS.setAttrib(m.id,"aria-hidden","true"),void(g||nS(m)))},dS=ga.DOM,mS=function(e){return"-"===e.charAt(0)},pS=function(e,t){var n=Ws(t),r=t.getParam("language_url","","string");if(!1===ka.hasCode(n)&&"en"!==n){var o=""!==r?r:t.editorManager.baseURL+"/langs/"+n+".js";e.add(o,f,undefined,function(){ah(t,"LanguageLoadError",uh("language",o,n))})}},gS=function(t,e,n){return R.from(e).filter(function(e){return 0")},mceToggleVisualAid:function(){i.hasVisual=!i.hasVisual,i.addVisual()},mceReplaceContent:function(e,t,n){i.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.selection.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=i.dom.getParent(i.selection.getNode(),"a"),n.href=n.href.replace(/ /g,"%20"),r&&n.href||i.formatter.remove("link"),n.href&&i.formatter.apply("link",n,r)},selectAll:function(){var e=i.dom.getParent(i.selection.getStart(),on);if(e){var t=i.dom.createRng();t.selectNodeContents(e),i.selection.setRng(t)}},"delete":function(){var e;hw(e=i)||qC(e,!1)||WC(e,!1)||GC(e,!1)||NC(e,!1)||Vd(e)||RC(e)||ew(e,!1)||(bS(e,"Delete"),dC(e))},forwardDelete:function(){var e;qC(e=i,!0)||WC(e,!0)||GC(e,!0)||NC(e,!0)||Vd(e)||RC(e)||ew(e,!0)||bS(e,"ForwardDelete")},mceNewDocument:function(){i.setContent("")},InsertLineBreak:function(e,t,n){return Hw(i,n),!0}});var e=function(n){return function(){var e=i.selection.isCollapsed()?[i.dom.getParent(i.selection.getNode(),i.dom.isBlock)]:i.selection.getSelectedBlocks(),t=OS(e,function(e){return!!i.formatter.matchNode(e,n)});return-1!==BS(t,!0)}};a.addCommands({JustifyLeft:e("alignleft"),JustifyCenter:e("aligncenter"),JustifyRight:e("alignright"),JustifyFull:e("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return a.isFormatMatch(e)},mceBlockQuote:function(){return a.isFormatMatch("blockquote")},Outdent:function(){return ow(i)},"InsertUnorderedList,InsertOrderedList":function(e){var t=i.dom.getParent(i.selection.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),a.addCommands({Undo:function(){i.undoManager.undo()},Redo:function(){i.undoManager.redo()}}),a.addQueryValueHandler("FontName",function(){return RS(t=i).fold(function(){return _S(t).map(function(e){return kS(t.getBody(),e)}).getOr("")},function(e){return kS(t.getBody(),e)});var t},this),a.addQueryValueHandler("FontSize",function(){return RS(t=i).fold(function(){return _S(t).map(function(e){return ES(t.getBody(),e)}).getOr("")},function(e){return ES(t.getBody(),e)});var t},this)},LS);function LS(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e)}var IS=hr.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),MS=(FS.isNative=function(e){return!!IS[e.toLowerCase()]},FS.prototype.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=this.scope),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=h},t.stopPropagation=function(){t.isPropagationStopped=h},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=h},t.isDefaultPrevented=g,t.isPropagationStopped=g,t.isImmediatePropagationStopped=g),this.settings.beforeFire&&this.settings.beforeFire(t),n=this.bindings[e])for(r=0,o=n.length;r"),this.parseShortcut))[o.length-1]=hr.extend(o[o.length-1],{func:n,scope:r||this.editor}),hr.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},sN.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},sN.prototype.isFunctionKey=function(e){return"keydown"===e.type&&112<=e.keyCode&&e.keyCode<=123},sN.prototype.matchShortcut=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},sN.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},sN);function sN(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var n=this;e.on("keyup keypress keydown",function(t){!n.hasModifier(t)&&!n.isFunctionKey(t)||t.isDefaultPrevented()||(rN(n.shortcuts,function(e){if(n.matchShortcut(t,e))return n.pendingPatterns=e.subpatterns.slice(0),"keydown"===t.type&&n.executeShortcutAction(e),!0}),n.matchShortcut(t,n.pendingPatterns[0])&&(1===n.pendingPatterns.length&&"keydown"===t.type&&n.executeShortcutAction(n.pendingPatterns[0]),n.pendingPatterns.shift()))})}var cN=function(){var e,t,n,r,o,i,a,u,s=(t={},n={},r={},o={},i={},a={},{addButton:(u=function(n,r){return function(e,t){return n[e.toLowerCase()]=pe(pe({},t),{type:r})}})(e={},"button"),addGroupToolbarButton:u(e,"grouptoolbarbutton"),addToggleButton:u(e,"togglebutton"),addMenuButton:u(e,"menubutton"),addSplitButton:u(e,"splitbutton"),addMenuItem:u(t,"menuitem"),addNestedMenuItem:u(t,"nestedmenuitem"),addToggleMenuItem:u(t,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(e,t){return r[e.toLowerCase()]=t},getAll:function(){return{buttons:e,menuItems:t,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}});return{addAutocompleter:s.addAutocompleter,addButton:s.addButton,addContextForm:s.addContextForm,addContextMenu:s.addContextMenu,addContextToolbar:s.addContextToolbar,addIcon:s.addIcon,addMenuButton:s.addMenuButton,addMenuItem:s.addMenuItem,addNestedMenuItem:s.addNestedMenuItem,addSidebar:s.addSidebar,addSplitButton:s.addSplitButton,addToggleButton:s.addToggleButton,addGroupToolbarButton:s.addGroupToolbarButton,addToggleMenuItem:s.addToggleMenuItem,getAll:s.getAll}},lN=hr.each,fN=hr.trim,dN="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),mN={ftp:21,http:80,https:443,mailto:25},pN=(gN.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},gN.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},gN.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source="",this.getURI()},gN.prototype.toRelative=function(e){var t;if("./"===e)return e;var n=new gN(e,{base_uri:this});if("mce_host"!==n.host&&this.host!==n.host&&n.host||this.port!==n.port||this.protocol!==n.protocol&&""!==n.protocol)return n.getURI();var r=this.getURI(),o=n.getURI();return r===o||"/"===r.charAt(r.length-1)&&r.substr(0,r.length-1)===o?r:(t=this.toRelPath(this.path,n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),t)},gN.prototype.toAbsolute=function(e,t){var n=new gN(e,{base_uri:this});return n.getURI(t&&this.isSameOrigin(n))},gN.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=mN[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},gN.prototype.toRelPath=function(e,t){var n,r,o,i=0,a="",u=e.substring(0,e.lastIndexOf("/")).split("/");if(n=t.split("/"),u.length>=n.length)for(r=0,o=u.length;r=n.length||u[r]!==n[r]){i=r+1;break}if(u.length=u.length||u[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=u.length-(i-1);r=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=WN(e.x,t.x),r=WN(e.y,t.y),o=$N(e.x+e.w,t.x+t.w),i=$N(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:YN(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=WN(0,t.x-u),o=WN(0,t.y-s),i=WN(0,c-f),a=WN(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),YN(u,s,(c-=i)-u,(l-=a)-s)},create:YN,fromClientRect:function(e){return YN(e.left,e.top,e.width,e.height)}},JN=hr.each,QN=hr.extend,ZN=function(){};ZN.extend=jN=function(n){var o,i=this.prototype,r=function(){var e,t,n;if(!HN&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},t=function(){return this};return HN=!0,o=new this,HN=!1,n.Mixins&&(JN(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),i.Mixins&&(n.Mixins=i.Mixins.concat(n.Mixins))),n.Methods&&JN(n.Methods.split(","),function(e){n[e]=t}),n.Properties&&JN(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&JN(n.Statics,function(e,t){r[t]=e}),n.Defaults&&i.Defaults&&(n.Defaults=QN({},i.Defaults,n.Defaults)),oe(n,function(e,t){var n,r;"function"==typeof e&&i[t]?o[t]=(n=t,r=e,function(){var e,t=this._super;return this._super=i[n],e=r.apply(this,arguments),this._super=t,e}):o[t]=e}),r.prototype=o,(r.constructor=r).extend=jN,r};var eE=Math.min,tE=Math.max,nE=Math.round,rE={serialize:function(e){var t=JSON.stringify(e);return q(t)?t.replace(/[\u0080-\uFFFF]/g,function(e){var t=e.charCodeAt(0).toString(16);return"\\u"+"0000".substring(t.length)+t}):t},parse:function(e){try{return JSON.parse(e)}catch(t){}}},oE={callbacks:{},count:0,send:function(t){var n=this,r=ga.DOM,o=t.count!==undefined?t.count:n.count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},iE=pe(pe({},jS),{send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4=r.length&&n.substr(o,o+r.length)===r;var n,r,o},qe=function(t){return function(e){return e.replace(t,"")}},$e=qe(/^\s+|\s+$/g),We=qe(/^\s+/g),Ke=qe(/\s+$/g),Xe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ye=function(t){return function(e){return He(e,t)}},Ge=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return He(e,"edge/")&&He(e,"chrome")&&He(e,"safari")&&He(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Xe],search:function(e){return He(e,"chrome")&&!He(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return He(e,"msie")||He(e,"trident")}},{name:"Opera",versionRegexes:[Xe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ye("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ye("firefox")},{name:"Safari",versionRegexes:[Xe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(He(e,"safari")||He(e,"mobile/"))&&He(e,"applewebkit")}}],Je=[{name:"Windows",search:Ye("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return He(e,"iphone")||He(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ye("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Ye("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ye("linux"),versionRegexes:[]},{name:"Solaris",search:Ye("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ye("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Ye("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Qe={browsers:x(Ge),oses:x(Je)},Ze=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,p=Qe.browsers(),g=Qe.oses(),h=ze(p,e).fold(De.unknown,De.nu),v=je(g,e).fold(Fe.unknown,Fe.nu);return{browser:h,os:v,deviceType:(r=h,o=e,i=t,a=(n=v).isiOS()&&!0===/ipad/i.test(o),u=n.isiOS()&&!a,s=n.isiOS()||n.isAndroid(),c=s||i("(pointer:coarse)"),l=a||!u&&s&&i("(min-device-width:768px)"),f=u||s&&!l,d=r.isSafari()&&n.isiOS()&&!1===/safari/i.test(o),m=!f&&!l&&!d,{isiPad:x(a),isiPhone:x(u),isTablet:x(l),isPhone:x(f),isTouch:x(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:x(d),isDesktop:x(m)})}},et=function(e){return V.window.matchMedia(e).matches},tt=(ye=!(he=function(){return Ze(V.navigator.userAgent,et)}),function(){for(var e=[],t=0;t=a.length&&r(o)}))})})},Bn=function(e){return On(e,Dn.nu)},Pn=function(n){return{is:function(e){return n===e},isValue:h,isError:g,getOr:x(n),getOrThunk:x(n),getOrDie:x(n),or:function(e){return Pn(n)},orThunk:function(e){return Pn(n)},fold:function(e,t){return t(n)},map:function(e){return Pn(e(n))},mapError:function(e){return Pn(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return R.some(n)}}},Ln=function(n){return{is:g,isValue:g,isError:h,getOr:d,getOrThunk:function(e){return e()},getOrDie:function(){return p(String(n))()},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return Ln(n)},mapError:function(e){return Ln(e(n))},each:f,bind:function(e){return Ln(n)},exists:g,forall:h,toOption:R.none}},In={value:Pn,error:Ln,fromOption:function(e,t){return e.fold(function(){return Ln(t)},Pn)}},Mn=window.Promise?window.Promise:(xn=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},Nn=(Sn=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],qn(e,Fn(zn,this),Fn(jn,this))}).immediateFn||"function"==typeof V.setImmediate&&V.setImmediate||function(e){V.setTimeout(e,1)},Sn.prototype["catch"]=function(e){return this.then(null,e)},Sn.prototype.then=function(n,r){var o=this;return new Sn(function(e,t){Un.call(o,new Vn(n,r,e,t))})},Sn.all=function(){var s=Array.prototype.slice.call(1===arguments.length&&xn(arguments[0])?arguments[0]:arguments);return new Sn(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Mr=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Fr=/[<>&\"\']/g,Ur=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,zr={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};br={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Cr={"<":"<",">":">","&":"&",""":'"',"'":"'"};var jr=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n>10),56320+(1023&t))):zr[t]||String.fromCharCode(t):Cr[e]||yr[e]||(n=e,(r=Ne.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},Wr={},Kr={},Xr=hr.makeMap,Yr=hr.each,Gr=hr.extend,Jr=hr.explode,Qr=hr.inArray,Zr=function(e,t){return(e=hr.trim(e))?e.split(t||" "):[]},eo=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n
    ').css(n).appendTo(a)[0];return c.set(R.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&na(e.caret).addClass("mce-visual-caret-before")}),d(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:f,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){c.get().each(function(e){var t=ac(a,e.element,e.before);na(e.caret).css(pe({},t))})},destroy:function(){return Xn.clearInterval(n)}}},sc=function(){return oc.isIE()||oc.isEdge()||oc.isFirefox()},cc=function(e){return ic(e)||Gt(e)&&sc()},lc=an,fc=Kt("display","block table table-cell table-caption list-item"),dc=gu,mc=mu,pc=$t,gc=Du,hc=function(e,t){for(var n;n=e(t);)if(!mc(n))return n;return null},vc=function(e,t,n,r,o){var i=new ra(e,r);if(t<0){if((lc(e)||mc(e))&&n(e=hc(i.prev,!0)))return e;for(;e=hc(i.prev,o);)if(n(e))return e}if(0=o.data.length-1)return 1===e&&(r=s(o))?Sc(r):n;if(Cu(o)&&i<=1)return-1===e&&(r=u(o))?Nc(r):n;if(i===o.data.length)return(r=s(o))?Sc(r):n;if(0===i)return(r=u(o))?Nc(r):n}return n},kc=function(e,t){return R.from(Cc(e?0:-1,t)).filter(lc)},_c=function(e,t,n){var r=Ec(e,t,n);return-1===e?ls.fromRangeStart(r):ls.fromRangeEnd(r)},Rc=function(e){return R.from(e.getNode()).map(Ne.fromDom)},Tc=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Ac=function(e,t){var n=bc(e,t);return!(n||!rn(e.getNode()))||n};(ds=fs=fs||{})[ds.Backwards=-1]="Backwards",ds[ds.Forwards=1]="Forwards";var Dc,Oc=an,Bc=Zt,Pc=$t,Lc=rn,Ic=Du,Mc=function(e){return Ru(e)||!!Ou(t=e)&&!0!==W(te(t.getElementsByTagName("*")),function(e,t){return e||Su(t)},!1);var t},Fc=Bu,Uc=function(e,t){return e.hasChildNodes()&&tu.length-1)return!!rl(c,i,r)||nl(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},il=function(e){return Zt(e)&&0=n.length?t=n.length-1:t<0&&(t=0),n[t]||e},jl=function(e,t,u){var n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=function(e){var t;return 3===(t=e[0]).nodeType&&t===n&&r>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===i&&0":" />",n&&u&&c[e]&&0"),u&&c[e]&&0")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push(""):d.push(""),u&&d.push("\n")},doctype:function(e){d.push("",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}},hf=function(t,p){void 0===p&&(p=no());var g=gf(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(e){var f,d;d=t.validate,f={3:function(e){g.text(e.value,e.raw)},8:function(e){g.comment(e.value)},7:function(e){g.pi(e.name,e.value)},10:function(e){g.doctype(e.value)},4:function(e){g.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},g.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r},bf=function(e,t){var n=e.exec(t);if(n){var r=n[1],o=n[2];return"string"==typeof r&&"data-mce-bogus"===r.toLowerCase()?o:null}return null};function Cf(W,K){void 0===K&&(K=no());var e=function(){};!1!==(W=W||{}).fix_self_closing&&(W.fix_self_closing=!0);var X=W.comment?W.comment:e,Y=W.cdata?W.cdata:e,G=W.text?W.text:e,J=W.start?W.start:e,Q=W.end?W.end:e,Z=W.pi?W.pi:e,ee=W.doctype?W.doctype:e,n=function(m,e){void 0===e&&(e="html");var t,n,r,p,o,i,a,g,u,s,h,c,v,l,f,d,y,b,C,w,x,S,N,E,k,_,R,T,A,D=m.html,O=0,B=[],P=0,L=$r.decode,I=hr.makeMap("src,href,data,background,formaction,poster,xlink:href"),M=/((java|vb)script|mhtml):/i,F="html"===e?0:1,U=function(e){var t,n;for(t=B.length;t--&&B[t].name!==e;);if(0<=t){for(n=B.length-1;t<=n;n--)(e=B[n]).valid&&Q(e.name);B.length=t}},z=function(e,t){return G(vf(e,m),t)},j=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),W.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),X(vf(e,m)))},H=function(e,t){var n=e||"",r=!Ve(n,"--"),o=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&(u=n,/^\s*\[if [\w\W]+\]>.*/.test(r.substr(u)))){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/;a.lastIndex=n;var u,s=a.exec(e);return s?s.index+s[0].length:r.length}(D,r,t);return e=D.substr(t,o-t),j(r?n+e:e),o+1},V=function(e,t,n,r,o){var i,a,u,s,c,l;if(t=t.toLowerCase(),u=t in h?t:L(n||r||o||""),n=de(m.uris,u).getOr(u),v&&!g&&!1==(0===(s=t).indexOf("data-")||0===s.indexOf("aria-"))){if(!(i=b[t])&&C){for(a=C.length;a--&&!(i=C[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(I[t]&&!W.allow_script_urls){var f=n.replace(/[\s\u0000-\u001F]+/g,"");try{f=decodeURIComponent(f)}catch(d){f=unescape(f)}if(M.test(f))return;if(l=f,!(c=W).allow_html_data_urls&&(/^data:image\//i.test(l)?!1===c.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(l):/^data:/i.test(l)))return}g&&(t in I||0===t.indexOf("on"))||(p.map[t]=n,p.push({name:t,value:n}))};for(k=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),_=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=K.getShortEndedElements(),E=W.self_closing_elements||K.getSelfClosingElements(),h=K.getBoolAttrs(),v=W.validate,u=W.remove_internals,A=W.fix_self_closing,R=K.getSpecialElements(),N=D+">";t=k.exec(N);){var q=t[0];if(OD.length){z(L(D.substr(t.index))),O=t.index+q.length;continue}":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,A&&E[n]&&0]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=l,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),l=s.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:kf.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return lu(l)},Rf=_f,Tf=function(e,t,n,r){var o,i,a,u,s;if(t.format=n,t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)o=hr.trim(Rf(e.serializer,r.innerHTML));else if("text"===t.format)o=lu(r.innerText||r.textContent);else{if("tree"===t.format)return e.serializer.serialize(r,t);a=(i=e).serializer.serialize(r,t),u=Hs(i),s=new RegExp("^(<"+u+"[^>]*>( | |\\s|\xa0|
    |)<\\/"+u+">[\r\n]*|
    [\r\n]*)$"),o=a.replace(s,"")}return"text"===t.format||Or(Ne.fromDom(r))?t.content=o:t.content=hr.trim(o),t.no_events||e.fire("GetContent",t),t.content},Af=hr.each,Df=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return Af(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!!r(n(e),n(t))&&(!!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))&&(!ll(e)&&!ll(t)))}},Of=function(n,r,o){return R.from(o.container()).filter(Zt).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})},Bf=N(Of,!0,dl),Pf=N(Of,!1,dl),Lf=function(e){var t=e.container();return Zt(t)&&0===t.data.length},If=function(t,n){return function(e){return R.from(Cc(t?0:-1,e)).filter(n).isSome()}},Mf=function(e){return"IMG"===e.nodeName&&"block"===mn(Ne.fromDom(e),"display")},Ff=function(e){return an(e)&&!($t(t=e)&&"all"===t.getAttribute("data-mce-bogus"));var t},Uf=If(!0,Mf),zf=If(!1,Mf),jf=If(!0,Gt),Hf=If(!1,Gt),Vf=If(!0,Ff),qf=If(!1,Ff),$f=function(e,t){var n,r,o,i=Ne.fromDom(e),a=Ne.fromDom(t);return n=a,r="pre,code",o=N(at,i),qa(n,r,o).isSome()},Wf=function(e,t){return Du(t)&&!1===(r=e,Zt(o=t)&&/^[ \t\r\n]*$/.test(o.data)&&!1===$f(r,o))||$t(n=t)&&"A"===n.nodeName&&n.hasAttribute("name")||Kf(t);var n,r,o},Kf=Xt("data-mce-bookmark"),Xf=Xt("data-mce-bogus"),Yf=(wf="data-mce-bogus",xf="all",function(e){return $t(e)&&e.getAttribute(wf)===xf}),Gf=function(e,t){return void 0===t&&(t=!0),function(e,t){var n,r=0;if(Wf(e,e))return!1;if(!(n=e.firstChild))return!0;var o=new ra(n,e);do{if(t){if(Yf(n)){n=o.next(!0);continue}if(Xf(n)){n=o.next();continue}}if(rn(n))r++,n=o.next();else{if(Wf(e,n))return!1;n=o.next()}}while(n);return r<=1}(e.dom(),t)},Jf=function(e){var t=Ua(e,"br"),n=H(function(e){for(var t=[],n=e.dom();n;)t.push(Ne.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),Er);t.length===n.length&&z(n,kt)},Qf=function(e){Et(e),St(e,Ne.fromHtml('
    '))},Zf=function(n){bt(n).each(function(t){dt(t).each(function(e){Sr(n)&&Er(t)&&Sr(e)&&kt(t)})})},ed=function(e,t,n){return st(t,e)?function(e,t){for(var n=D(t)?t:g,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=Ne.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||at(e,t)}).slice(0,-1):[]},td=function(e,t){return ed(e,t,x(!1))},nd=function(e,t){return[e].concat(td(e,t))},rd=function(e,t,n){if(0!==n){var r,o,i,a=e.data.slice(t,t+n),u=t+n>=e.data.length,s=0===t;e.replaceData(t,n,(o=s,i=u,W(r=a,function(e,t){return dl(t)||fl(t)?e.previousCharIsSpace||""===e.str&&o||e.str.length===r.length-1&&i?{previousCharIsSpace:!1,str:e.str+oo}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str))}},od=function(e,t){var n=e.data.slice(t),r=n.length-We(n).length;return rd(e,t,r)},id=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===ms.isTextPosition(n)&&o===r.parentNode&&i>ms.before(r).offset()?ms(t.container(),t.offset()-1):t;var n,r,o,i},ad=function(e){return Du(e.previousSibling)?R.some((t=e.previousSibling,Zt(t)?ms(t,t.data.length):ms.after(t))):e.previousSibling?el(e.previousSibling):R.none();var t},ud=function(e){return Du(e.nextSibling)?R.some((t=e.nextSibling,Zt(t)?ms(t,0):ms.before(t))):e.nextSibling?Zc(e.nextSibling):R.none();var t},sd=function(r,o){return ad(o).orThunk(function(){return ud(o)}).orThunk(function(){return e=r,t=o,n=ms.before(t.previousSibling?t.previousSibling:t.parentNode),Qc(e,n).fold(function(){return Jc(e,ms.after(t))},R.some);var e,t,n})},cd=function(n,r){return ud(r).orThunk(function(){return ad(r)}).orThunk(function(){return t=r,Jc(e=n,ms.after(t)).fold(function(){return Qc(e,ms.before(t))},R.some);var e,t})},ld=function(e,t,n){return(e?cd:sd)(t,n).map(N(id,n))},fd=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},dd=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(Rt(t))},md=function(e){if(Gf(e)){var t=Ne.fromHtml('
    ');return Et(e),St(e,t),R.some(ms.before(t.dom()))}return R.none()},pd=function(e,t,l){var n,r,o,i,a=dt(e).filter(Ot),u=mt(e).filter(Ot);return kt(e),r=u,o=t,i=function(e,t,n){var r,o,i,a,u=e.dom(),s=t.dom(),c=u.data.length;return o=s,i=l,a=Ke((r=u).data).length,r.appendData(o.data),kt(Ne.fromDom(o)),i&&od(r,a),n.container()===s?ms(u,c):n},((n=a).isSome()&&r.isSome()&&o.isSome()?R.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):R.none()).orThunk(function(){return l&&(a.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Ke(r).length,rd(t,n-o,o);var t,n,r,o}),u.each(function(e){return od(e.dom(),0)})),t})},gd=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=ld(n,t.getBody(),e.dom()),u=Ha(e,N(dd,t),(o=t.getBody(),function(e){return e.dom()===o})),s=pd(e,a,(i=e,me(t.schema.getTextInlineElements(),Rt(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(md).fold(function(){r&&fd(t,n,s)},function(e){r&&fd(t,n,R.some(e))})},hd=function(a){if(!k(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return z(a,function(e,r){var t=ne(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!k(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t|)$/," "):o("nextSibling")||(t=t.replace(/( | )(
    |)$/," "))),t}(p.getRng(),t)),r=e.parser,m=n.merge,o=hf({validate:e.settings.validate},e.schema),d='​',s={content:t,format:"html",selection:!0,paste:n.paste},(s=e.fire("BeforeSetContent",s)).isDefaultPrevented())e.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=s.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var h,v,y,b,C,w,x=(l=p.getRng()).startContainer||(l.parentElement?l.parentElement():null),S=e.getBody();x===S&&p.isCollapsed()&&g.isBlock(S.firstChild)&&(h=e,(v=S.firstChild)&&!h.schema.getShortEndedElements()[v.nodeName])&&g.isEmpty(S.firstChild)&&((l=g.createRng()).setStart(S.firstChild,0),l.setEnd(S.firstChild,0),p.setRng(l)),p.isCollapsed()||(nm(e),y=e.selection.getRng(),b=t,C=y.startContainer,w=y.startOffset,3===C.nodeType&&y.collapsed&&(C.data[w]===oo?(C.deleteData(w,1),/[\u00a0| ]$/.test(b)||(b+=" ")):C.data[w-1]===oo&&(C.deleteData(w-1,1),/[\u00a0| ]$/.test(b)||(b=" "+b))),t=b);var N,E,k,_={context:(i=p.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,_),!0===n.paste&&Kd(e.schema,u)&&Gd(g,i))return l=Zd(o,g,e.selection.getRng(),u),e.selection.setRng(l),void e.fire("SetContent",s);if(!function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!g.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),_.invalid){for(tm(e,d),i=p.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;t=i===a?a.innerHTML:g.getOuterHTML(i),t=o.serialize(r.parse(t.replace(//i,function(){return o.serialize(u)}))),i===a?g.setHTML(a,t):g.setOuterHTML(i,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):tm(e,t)}}(e,t=o.serialize(u),i);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new Df(r);hr.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,m),function(n,e){var t,r,o,i,a,u=n.dom,s=n.selection;if(e){if(n.selection.scrollIntoView(e),t=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===n.dom.getContentEditable(e))return e;return null}(e))return u.remove(e),s.select(t);var c=u.createRng();(i=e.previousSibling)&&3===i.nodeType?(c.setStart(i,i.nodeValue.length),rr.ie||(a=e.nextSibling)&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a))):(c.setStartBefore(e),c.setEndBefore(e));r=u.getParent(e,u.isBlock),u.remove(e),r&&u.isEmpty(r)&&(n.$(r).empty(),c.setStart(r,0),c.setEnd(r,0),em(r)||r.getAttribute("data-mce-fragment")||!(o=function(e){var t=ms.fromRangeStart(e);if(t=Hc(n.getBody()).next(t))return t.toRange()}(c))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(c=o,u.remove(r))),s.setRng(c)}}(e,g.get("mce_marker")),N=e.getBody(),hr.each(N.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),E=e.dom,k=e.selection.getStart(),R.from(E.getParent(k,"td,th")).map(Ne.fromDom).each(Zf),e.fire("SetContent",s),e.addVisual()}},om=function(e){var t=ct(e).dom();return e.dom()===t.activeElement},im=function(e){var t=e!==undefined?e.dom():V.document;return R.from(t.activeElement).map(Ne.fromDom)},am=function(e,t,n,r){return{start:x(e),soffset:x(t),finish:x(n),foffset:x(r)}},um=hd([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),sm=(um.before,um.on,um.after,function(e){return e.fold(d,d,d)}),cm=hd([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),lm={domRange:cm.domRange,relative:cm.relative,exact:cm.exact,exactFromRange:function(e){return cm.exact(e.start(),e.soffset(),e.finish(),e.foffset())},getWin:function(e){var t=e.match({domRange:function(e){return Ne.fromDom(e.startContainer)},relative:function(e,t){return sm(e)},exact:function(e,t,n,r){return e}});return lt(t)},range:am},fm=nt().browser,dm=function(e,t){var n=Ot(t)?ef(t).length:ht(t).length+1;return n',"TABLE"===n.nodeName?r=""+a+"":/^(UL|OL)$/.test(n.nodeName)&&(r="
  • "+a+"
  • "),r=(i=Hs(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||'
    ',zm(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=hf({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=Or(Ne.fromDom(n))?r:hr.trim(r),zm(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Hm=function(e,t){return e.splitText(t)},Vm=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Zt(t)?0
    ").append(n.childNodes)}))},dp[Nf="pre"]||(dp[Nf]=[]),dp[Nf].push(Ef);var gp,hp,vp=/^(src|href|style)$/,yp=hr.each,bp=wl,Cp=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},wp=function(e,t,n){var r,o;if(r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],$t(r)){var i=r.childNodes.length-1;!n&&o&&o--,r=r.childNodes[i=r.nodeValue.length&&(r=new ra(r,e.getBody()).next()||r),Zt(r)&&!n&&0===o&&(r=new ra(r,e.getBody()).prev()||r),r},xp=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Sp=function(e,t,n,r,o){var i=Ne.fromDom(t),a=Ne.fromDom(e.create(r,o)),u=(n?gt:pt)(i);return Nt(a,u),n?(Ct(i,a),xt(a,i)):(wt(i,a),St(a,i)),a.dom()},Np=function(e,t,n,r){return!(t=hl(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},Ep=function(e,r,o,t,i){var n,a,u,s,c,l=e.dom;if(u=l,!(bp(s=t,(c=r).inline)||bp(s,c.block)||c.selector&&($t(s)&&u.is(s,c.selector))||(a=t,r.links&&"A"===a.nodeName)))return!1;var f,d,m,p,g,h,v,y=t;if(r.inline&&"all"===r.remove&&k(r.preserve_attributes)){var b=H(l.getAttribs(y),function(e){return M(r.preserve_attributes,e.name.toLowerCase())});if(l.removeAllAttribs(y),z(b,function(e){return l.setAttrib(y,e.name,e.value)}),0e?t.cells().length:e},0)},qp=function(e,t){for(var n,r=e.rows(),o=0;o")?{type:"fragmented",fragments:r,content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:t,bookmark:null,beforeBookmark:null}},ug=function(e,t,n){"fragmented"===t.type?og(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},sg=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},cg=function(e){var t=Ne.fromTag("body",ig.get().getOrThunk(function(){var e=V.document.implementation.createHTMLDocument("undo");return ig.set(R.some(e)),e}));return nu(t,sg(e)),z(Ua(t,"*[data-mce-bogus]"),_t),t.dom().innerHTML},lg=function(e,t){return!(!e||!t)&&(r=t,sg(e)===sg(r)||(n=t,cg(e)===cg(n)));var n,r},fg=function(e){return 0===e.get()},dg=function(e,t,n){fg(n)&&(e.typing=t)},mg=function(e,t){e.typing&&(dg(e,!1,t),e.add())},pg=function(e){return e instanceof df},gg=function(e,t){Fm(e.serializer.getNodeFilters(),e.serializer.getAttributeFilters(),t)},hg=function(){return{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},vg=function(s){return{undoManager:{beforeChange:function(e,t){return n=s,r=t,void(fg(e)&&r.set(R.some(Ls(n.selection))));var n,r},addUndoLevel:function(e,t,n,r,o,i){return function(e,t,n,r,o,i,a){var u=e.settings,s=ag(e);if(i=i||{},i=hr.extend(i,s),!1===fg(r)||e.removed)return null;var c=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:c,originalEvent:a}).isDefaultPrevented())return null;if(c&&lg(c,i))return null;if(t.data[n.get()]&&o.get().each(function(e){t.data[n.get()].beforeBookmark=e}),u.custom_undo_redo_levels&&t.data.length>u.custom_undo_redo_levels){for(var l=0;l",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:u.convertURL,url_converter_scope:u},pe(pe({},s),a?Lg:{}));return jg(Og||Bg,Og,c,r,o)},Vg=function(e,t,n){return R.from(t.settings[n]).filter(e)},qg=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?z(0\ufeff
    ');return Ct(n.element,r),hh(r,function(){return kt(r)})},yh=function(n,r,o,i){xh(n,function(e,t){return Ch(n,r,o,i)},o)},bh=function(e,t,n,r,o){var i,a,u={elm:r.element.dom(),alignToTop:o};i=u,e.fire("ScrollIntoView",i).isDefaultPrevented()||(n(t,Ft(t).top(),r,o),a=u,e.fire("AfterScrollIntoView",a))},Ch=function(e,t,n,r){var o=Ne.fromDom(e.getBody()),i=Ne.fromDom(e.getDoc());o.dom().offsetWidth;var a=vh(Ne.fromDom(n.startContainer),n.startOffset);bh(e,i,t,a,r),a.cleanup()},wh=function(e,t,n,r){var o,i=Ne.fromDom(e.getDoc());bh(e,i,n,(o=t,hh(Ne.fromDom(o),f)),r)},xh=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(Ne.fromDom(r),Ne.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n)},Sh=function(e,t,n,r){var o=e.pos;if(n)Ut(o.left(),o.top(),r);else{var i=o.top()-t+e.height;Ut(o.left(),i,r)}},Nh=function(e,t,n,r,o){var i=n+t,a=r.pos.top(),u=r.bottom,s=n<=u-a;if(aa.bottom&&zt(n.element,!0===r)},_h=function(e,t,n){return yh(e,Eh,t,n)},Rh=function(e,t,n){return wh(e,t,Eh,n)},Th=function(e,t,n){return yh(e,kh,t,n)},Ah=function(e,t,n){return wh(e,t,kh,n)},Dh=function(e,t,n){(e.inline?_h:Th)(e,t,n)},Oh=function(e){return on(e)||an(e)},Bh=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=hr.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,an(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,Oh))?null:i}return r},Ph=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return R.from(i).map(Ne.fromDom).map(function(e){return r&&t.collapsed?e:vt(e,o(e,a)).getOr(e)}).bind(function(e){return Dt(e)?R.some(e):ft(e).filter(Dt)}).map(function(e){return e.dom()}).getOr(e)},Lh=function(e,t,n){return Ph(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},Ih=function(e,t,n){return Ph(e,t,!1,n,function(e,t){return 0o.childNodes.length-1&&(s=!1),tn(o)&&(o=m,i=0),o===m){if(s&&(a=o.childNodes[0R(n)?(x=T(w*b),w=T(x/b)):(w=T(x/b),x=T(w*b))),P(l,w,x),r=0<(r=d.startPos.x+t)?r:0,o=0<(o=d.startPos.y+n)?o:0,E.setStyles(f,{left:r,top:o,display:"block"}),f.innerHTML=w+" × "+x,d[2]<0&&l.clientWidth<=w&&E.setStyle(l,"left",g+(v-w)),d[3]<0&&l.clientHeight<=x&&E.setStyle(l,"top",h+(y-x)),(t=A.scrollWidth-S)+(n=A.scrollHeight-N)!==0&&E.setStyles(f,{left:r-t,top:o-n}),C||(i=c,a=v,u=y,s.fire("ObjectResizeStart",{target:i,width:a,height:u}),C=!0)},I=function(){var e=C;C=!1;var t,n,r,o=function(e,t){t&&(c.style[e]||!s.schema.isValid(c.nodeName.toLowerCase(),e)?E.setStyle(O(c),e,t):E.setAttrib(O(c),e,""+t))};e&&(o("width",w),o("height",x)),E.unbind(k,"mousemove",L),E.unbind(k,"mouseup",I),_!==k&&(E.unbind(_,"mousemove",L),E.unbind(_,"mouseup",I)),E.remove(l),E.remove(f),i(c),e&&(t=c,n=w,r=x,s.fire("ObjectResized",{target:t,width:n,height:r}),E.setAttrib(c,"style",E.getAttrib(c,"style"))),s.nodeChanged()},i=function(e){var t,r,o,n,i;M(),U(),t=E.getPos(e,A),g=t.x,h=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,c!==e&&(c=e,w=x=0),n=s.fire("ObjectSelected",{target:e}),B(e)&&!n.isDefaultPrevented()?u(a,function(n,e){var t;(t=E.get("mceResizeHandle"+e))&&E.remove(t),t=E.add(A,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===rr.ie&&(t.contentEditable=!1),E.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),m=(t=e).screenX,p=t.screenY,v=O(c).clientWidth,y=O(c).clientHeight,b=y/v,(d=n).startPos={x:r*n[0]+g,y:o*n[1]+h},S=A.scrollWidth,N=A.scrollHeight,l=c.cloneNode(!0),E.addClass(l,"mce-clonedresizable"),E.setAttrib(l,"data-mce-bogus","all"),l.contentEditable=!1,l.unSelectabe=!0,E.setStyles(l,{left:g,top:h,margin:0}),P(l,r,o),l.removeAttribute("data-mce-selected"),A.appendChild(l),E.bind(k,"mousemove",L),E.bind(k,"mouseup",I),_!==k&&(E.bind(_,"mousemove",L),E.bind(_,"mouseup",I)),f=E.add(A,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},v+" × "+y)}),n.elm=t,E.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+h-t.offsetHeight/2})}):M(),c.setAttribute("data-mce-selected","1")},M=function(){U(),c&&c.removeAttribute("data-mce-selected"),oe(a,function(e,t){var n=E.get("mceResizeHandle"+t);n&&(E.unbind(n),E.remove(n))})},o=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};C||s.removed||(u(E.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=E.$(t).closest("table,img,figure.image,hr")[0],A)&&(z(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?i(t):M())},F=function(e){return ev(function(e,t){for(;t&&t!==e;){if(tv(t)||ev(t))return t;t=t.parentNode}return null}(s.getBody(),e))},U=function(){oe(a,function(e){e.elm&&(E.unbind(e.elm),delete e.elm)})},z=function(){try{s.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};s.on("init",function(){if(z(),rr.browser.isIE()||rr.browser.isEdge()){s.on("mousedown click",function(e){var t=e.target,n=t.nodeName;C||!/^(TABLE|IMG|HR)$/.test(n)||F(t)||(2!==e.button&&s.selection.select(t,"TABLE"===n),"mousedown"===e.type&&s.nodeChanged())});var e=function(e){var t=function(e){Xn.setEditorTimeout(s,function(){return s.selection.select(e)})};if(F(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))};E.bind(A,"mscontrolselect",e),s.on("remove",function(){return E.unbind(A,"mscontrolselect",e)})}var t=Xn.throttle(function(e){s.composing||o(e)});s.on("nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged",t),s.on("keyup compositionend",function(e){c&&"TABLE"===c.nodeName&&t(e)}),s.on("hide blur",M),s.on("contextmenu longpress",n,!0)}),s.on("remove",U);return{isResizable:B,showResizeRect:i,hideResizeRect:M,updateResizeRect:o,destroy:function(){c=l=null}}},rv=function(e,t,n){if(e&&e.hasOwnProperty(t)){var r=H(e[t],function(e){return e!==n});0===r.length?delete e[t]:e[t]=r}};var ov=function(e){return!!e.select},iv=function(e){return!(!e||!e.ownerDocument)&&st(Ne.fromDom(e.ownerDocument),Ne.fromDom(e))},av=function(u,s,e,c){var n,t,l,f,r=function h(i,n){var a,u;return{selectorChangedWithUnbind:function(e,t){return a||(a={},u={},n.on("NodeChange",function(e){var n=e.element,r=i.getParents(n,null,i.getRoot()),o={};hr.each(a,function(e,n){hr.each(r,function(t){if(i.is(t,n))return u[n]||(hr.each(e,function(e){e(!0,{node:t,selector:n,parents:r})}),u[n]=e),o[n]=e,!1})}),hr.each(u,function(e,t){o[t]||(delete u[t],hr.each(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),{unbind:function(){rv(a,e,t),rv(u,e,t)}}}}}(u,c).selectorChangedWithUnbind,o=function(e,t){return Yh(c,e,t)},i=function(e){var t=m();t.collapse(!!e),a(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},m=function(){var e,t,n,r,o=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;if(null==(r=s.document))return null;if(c.bookmark!==undefined&&!1===Pm(c)){var i=wm(c);if(i.isSome())return i.map(function(e){return Fp(c,[e])[0]}).getOr(r.createRange())}try{(e=d())&&!qt(e.anchorNode)&&(t=0t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return r=e,o=t,void((n=c).inline?Rh:Ah)(n,r,o);var n,r,o},placeCaretAt:function(e,t){return a(Bh(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?ms.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=Jh(g),t=nv(g,c),g.bookmarkManager=n,g.controlSelection=t,g},uv=function(e,a,u){e.addNodeFilter("font",function(e){z(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,z(["color","face","size"],function(e){t.attr(e,null)})})})},sv=function(e,t){var n,r=ao();t.convert_fonts_to_spans&&uv(e,r,hr.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){z(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},cv=function(e){var t,n,r=decodeURIComponent(e).split(",");return(n=/data:([^;]+)/.exec(r[0]))&&(t=n[1]),{type:t,data:r[1]}},lv=function(e,t){var n;try{n=V.atob(t)}catch(pE){return R.none()}for(var r=new Uint8Array(n.length),o=0;o)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0")):"xhtml"===s.element_format&&0)\s*/g,"$1"),hr.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=hr.map(e.split(/(?:~\+|~|\+)/),qv),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]).length?(i[0].name||(i[0].name=t),t=e.selector,Vv(i,n)):Vv([t],n),o=Hv.select(t,r)[0]||r.firstChild,jv(e.styles,function(e,t){(e=l(e))&&Hv.setStyle(o,t,e)}),jv(e.attributes,function(e,t){(e=l(e))&&Hv.setAttrib(o,t,e)}),jv(e.classes,function(e){e=l(e),Hv.hasClass(o,e)||Hv.addClass(o,e)}),n.fire("PreviewFormats"),Hv.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=Hv.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,jv(u.split(" "),function(e){var t=Hv.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=Hv.getStyle(n.getBody(),e,!0),"#ffffff"===Hv.toHex(t).toLowerCase())||"color"===e&&"#000000"===Hv.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),Hv.remove(r),s)},Wv=function(s){var e=Fv(s),t=xa(null);return function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])}(s),lp(s),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,t,n){var r,o,i;r=e,o=t,i=n,wg(s).formatter.apply(r,o,i)},remove:function(e,t,n,r){var o,i,a,u;o=e,i=t,a=n,u=r,wg(s).formatter.remove(o,i,a,u)},toggle:function(e,t,n){var r,o,i;r=e,o=t,i=n,wg(s).formatter.toggle(r,o,i)},match:N(Gm,s),matchAll:N(Jm,s),matchNode:N(Ym,s),canApply:N(Qm,s),formatChanged:N(Mv,s,t),getCssText:N($v,s)}},Kv=function(n,r,o){var i=xa(!1),a=function(e){dg(r,!1,o),r.add({},e)};n.on("init",function(){r.add()}),n.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(mg(r,o),r.beforeChange())}),n.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),n.on("ObjectResizeStart cut",function(){r.beforeChange()}),n.on("SaveContent ObjectResized blur",a),n.on("dragend",a),n.on("keyup",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),n.nodeChanged()),46!==t&&8!==t||n.nodeChanged(),i.get()&&r.typing&&!1===lg(ag(n),r.data[0])&&(!1===n.isDirty()&&(n.setDirty(!0),n.fire("change",{level:r.data[0],lastLevel:null})),n.fire("TypingUndo"),i.set(!1),n.nodeChanged()))}),n.on("keydown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)r.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20t;var t}},ab=function(n){return function(e){return t=n,e.line===t;var t}},ub=an,sb=vc,cb=function(e,t){return Math.abs(e.left-t)},lb=function(e,t){return Math.abs(e.right-t)},fb=function(e,t){return e>=t.left&&e<=t.right},db=function(e,o){return cr(e,function(e,t){var n,r;return n=Math.min(cb(e,o),lb(e,o)),r=Math.min(cb(t,o),lb(t,o)),fb(o,t)||!fb(o,e)&&(r===n&&ub(t.node)||r=e.top&&n<=e.bottom});return(r=(r=db(f,t))&&db((a=e,c=function(t,e){var n;return n=H(Zy([e]),function(e){return!t(e,u)}),s=s.concat(n),0===n.length},(s=[]).push(u=r),mb(Uv.Up,a,N(c,Fu),u.node),mb(Uv.Down,a,N(c,Uu),u.node),s),t))&&cc(r.node)?(i=t,{node:(o=r).node,before:cb(o,i)'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},Lb=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Hc((e=l).getBody()),o=N(Tc,r.next),i=N(Tc,r.prev),a=t?fs.Forwards:fs.Backwards,u=t?o:i,s=e.selection.getRng(),(n=Ob(a,e,u,s))?n:(n=Pb(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},Ib=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?ob:rb,i=(e=u).selection.getRng(),(n=Bb(r,e,o,i))?n:(n=Pb(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}},Mb=function(r,o){return function(){var t,e=o?ms.fromRangeEnd(r.selection.getRng()):ms.fromRangeStart(r.selection.getRng()),n=(o?_b:kb)(r.getBody(),e);return(o?ee:Z)(n.positions).filter((t=o,function(e){return(t?qf:Vf)(e)})).fold(x(!1),function(e){return r.selection.setRng(e.toRange()),!0})}},Fb=function(o,e){return Y(e,function(e){var t,n,r=(t=Lu(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:o(r),cell:e},{x:r.right,y:o(r),cell:e}]})},Ub=function(e,t,n,r,o){var i,a,u=Ua(Ne.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),s=H(Fb(e,u),function(e){return t(e,o)});return i=r,a=o,W(s,function(e,r){return e.fold(function(){return R.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-i)+Math.abs(e.y-a)),n=Math.sqrt(Math.abs(r.x-i)+Math.abs(r.y-a));return R.some(nt}),Hb=function(t,n){return Z(n.getClientRects()).bind(function(e){return zb(t,e.left,e.top)}).bind(function(e){return Eb(el(t=e).map(function(e){return kb(t,e).positions.concat(e)}).getOr([]),n);var t})},Vb=function(t,n){return ee(n.getClientRects()).bind(function(e){return jb(t,e.left,e.top)}).bind(function(e){return Eb(Zc(t=e).map(function(e){return[e].concat(_b(t,e).positions)}).getOr([]),n);var t})},qb=function(e,t){e.selection.setRng(t),Dh(e,t)},$b=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===eb.Wrap&&0===a.positions.length||!rn(n.getNode())&&((i=u).breakType===eb.Br&&1===i.positions.length)?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},Wb=N($b,kb),Kb=N($b,_b),Xb=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(sc()&&(o=t,i=s,a=n,u=ms.fromRangeStart(i),Gc(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=vb(c,e,n,!t,!0);return qb(e,l),!0}return!1},Yb=function(e,t){var n=t.getNode(e);return $t(n)&&"TABLE"===n.nodeName?R.some(n):R.none()},Gb=function(u,s,c){var e=Yb(!!s,c),t=!1===s;e.fold(function(){return qb(u,c.toRange())},function(a){return Gc(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return qb(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=Hs(r=u))?r.undoManager.transact(function(){var e=Ne.fromTag(i);ln(e,Vs(r)),St(e,Ne.fromTag("br")),(n?wt:Ct)(Ne.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),qb(r,t)}):qb(r,t.toRange()));var n,r,o,t,i})})},Jb=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=ms.fromRangeStart(l),d=e.getBody();if(!t&&Wb(r,f)){var m=(u=d,Hb(s=n,c=f).orThunk(function(){return Z(c.getClientRects()).bind(function(e){return Nb(Rb(u,ms.before(s)),e.left)})}).getOr(ms.before(s)));return Gb(e,t,m),!0}if(t&&Kb(r,f)){m=(o=d,Vb(i=n,a=f).orThunk(function(){return Z(a.getClientRects()).bind(function(e){return Nb(Tb(o,ms.after(i)),e.left)})}).getOr(ms.after(i)));return Gb(e,t,m),!0}return!1},Qb=function(t,n){return function(){return R.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return R.from(t.dom.getParent(e,"table")).map(function(e){return Xb(t,n,e)})}).getOr(!1)}},Zb=function(n,r){return function(){return R.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return R.from(n.dom.getParent(t,"table")).map(function(e){return Jb(n,r,e,t)})}).getOr(!1)}},eC=function(e){return M(["figcaption"],Rt(e))},tC=function(e){var t=V.document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},nC=function(e,t,n){(n?St:xt)(e,t)},rC=function(e,t,n,r){return""===t?(l=e,f=r,d=Ne.fromTag("br"),nC(l,d,f),tC(d)):(o=e,i=r,a=t,u=n,s=Ne.fromTag(a),c=Ne.fromTag("br"),ln(s,u),St(s,c),nC(o,s,i),tC(c));var o,i,a,u,s,c,l,f,d},oC=function(e,t,n){return t?(o=e.dom(),_b(o,n).breakAt.isNone()):(r=e.dom(),kb(r,n).breakAt.isNone());var r,o},iC=function(t,n){var e,r,o=Ne.fromDom(t.getBody()),i=ms.fromRangeStart(t.selection.getRng()),a=Hs(t),u=Vs(t);return e=i,r=N(at,o),Va(Ne.fromDom(e.container()),Sr,r).filter(eC).exists(function(){if(oC(o,n,i)){var e=rC(o,a,u,n);return t.selection.setRng(e),!0}return!1})},aC=function(e,t){return function(){return!!e.selection.isCollapsed()&&iC(e,t)}},uC=function(e,r){return Y(U(e,function(e){return pe({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:f},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},sC=function(e){for(var t=[],n=1;n'},kw=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},_w=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},Rw=function(e,t,n){return!1===Zt(t)?n:e?1===n&&t.data.charAt(n-1)===su?0:n:n===t.data.length-1&&t.data.charAt(n)===su?t.data.length:n},Tw=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},Aw=function(o,i,e){R.from(e.style).map(o.dom.parseStyle).each(function(e){var t=function(e){var t={},n=e.dom();if(un(n))for(var r=0;rs.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=p&&Zt(s)?s.nodeValue.length:0),(u=Tw(g,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,p=Tw(m,r);if(!(a=m.getParent(r,m.isBlock))||!_w(m,a)){if(l=(a=a||p)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),Dw(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),Dw(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,y,s,i)),c=g.getParent(s,g.isBlock),l=c?g.getParent(c.parentNode,g.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||R||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&g.isEmpty(c)?Nw(a,b,l,c,m):m&&c===a.getBody()||(m=m||"P",mu(c)?(r=xu(c),g.isEmpty(c)&&Ew(c),Dw(a,r),yw(a,r)):C()?w():C(!0)?(r=c.parentNode.insertBefore(b(),c),yw(a,kw(c,"HR")?r:c)):((_=(k=y).cloneRange()).setStart(k.startContainer,Rw(!0,k.startContainer,k.startOffset)),_.setEnd(k.endContainer,Rw(!1,k.endContainer,k.endOffset)),(t=_.cloneRange()).setEndAfter(c),o=t.extractContents(),E=o,z(Fa(Ne.fromDom(E),Ot),function(e){var t=e.dom();t.nodeValue=lu(t.nodeValue)}),function(e){for(;Zt(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o),r=o.firstChild,g.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;$t(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=e,(u=o)&&"A"===u.nodeName&&a.isEmpty(u)&&e.remove(o));var a,u}}(g,v,r),x=g,(S=c).normalize(),(N=S.lastChild)&&!/^(left|right)$/gi.test(x.getStyle(N,"float",!0))||x.add(S,"br"),g.isEmpty(c)&&Ew(c),r.normalize(),g.isEmpty(r)?(g.remove(r),w()):(Dw(a,r),yw(a,r))),g.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},Bw=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},Pw=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},Lw=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();Wh(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var c=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&!function(e,t,n){for(var r,o=new ra(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}}},jx=function(l,f){return function(e){if(l.dragging&&(s=(i=f).selection,c=s.getSel().getRangeAt(0).startContainer,a=3===c.nodeType?c.parentNode:c,u=l.element,a!==u&&!i.dom.isChildOf(a,u)&&!Ix(a))){var t=(r=l.element,(o=r.cloneNode(!0)).removeAttribute("data-mce-selected"),o),n=f.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){Fx(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;Hx(l)}},Hx=function(e){e.dragging=!1,e.element=null,Fx(e.ghost)},Vx=function(e){var t,n,r,o,i,a,u,s,c={};t=ga.DOM,a=V.document,n=Ux(c,e),r=zx(c,e),o=jx(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),Hx(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},qx=function(e){var n;Vx(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(Ix(t)||Ix(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},$x=on,Wx=an,Kx=function(e,t){for(var n=e.getBody();t&&t!==n;){if($x(t)||Wx(t))return t;t=t.parentNode}return null},Xx=function(g){var h,v=g.getBody(),o=uc(g,v,function(e){return g.dom.isBlock(e)},function(){return Pm(g)}),y="sel-"+g.dom.uniqueId(),a=function(e){e&&g.selection.setRng(e)},r=function(){return g.selection.getRng()},b=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},t=function(e){return gu(e)||Cu(e)||wu(e)},C=function(e){return t(e.startContainer)||t(e.endContainer)},u=function(e){var t=g.schema.getShortEndedElements(),n=g.dom.createRng(),r=e.startContainer,o=e.startOffset,i=e.endContainer,a=e.endOffset;return me(t,r.nodeName.toLowerCase())?0===o?n.setStartBefore(r):n.setStartAfter(r):n.setStart(r,o),me(t,i.nodeName.toLowerCase())?0===a?n.setEndBefore(i):n.setEndAfter(i):n.setEnd(i,a),n},s=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!C(e))if(!1===t){if(c=_c(-1,v,e),cc(c.getNode(!0)))return b(-1,c.getNode(!0),!1,!1);if(cc(c.getNode()))return b(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=_c(1,v,e),cc(c.getNode()))return b(1,c.getNode(),!c.isAtEnd(),!1);if(cc(c.getNode(!0)))return b(1,c.getNode(!0),!1,!1)}return null}if(i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&Wx(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType)return null;if(u===a+1&&i===e.endContainer&&(n=i.childNodes[a]),!Wx(n))return null;if(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented())return null;r=$a(Ne.fromDom(g.getBody()),"#"+y).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('
    ').attr("id",y)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&rr.ie?(r.empty().append('

    \xa0

    ').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append(oo).append(l).append(oo),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e);var p=Ne.fromDom(n);return z(Ua(Ne.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){at(p,e)||dn(e,"data-mce-selected")}),g.dom.getAttrib(n,"data-mce-selected")||n.setAttribute("data-mce-selected","1"),h=n,w(),e},c=function(){h&&(h.removeAttribute("data-mce-selected"),$a(Ne.fromDom(g.getBody()),"#"+y).each(kt),h=null),$a(Ne.fromDom(g.getBody()),"#"+y).each(kt),h=null},w=function(){o.hide()};return rr.ceFalse&&function(){g.on("mouseup",function(e){var t=r();t.collapsed&&Qg(g,e.clientX,e.clientY)&&a(bb(g,t,!1))}),g.on("click",function(e){var t;(t=Kx(g,e.target))&&(Wx(t)&&(e.preventDefault(),g.focus()),$x(t)&&g.dom.isChildOf(t,g.selection.getNode())&&c())}),g.on("blur NewBlock",function(){c()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==Wx(Kx(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Hc(e);if(!e.firstChild)return!1;var n=ms.before(e.firstChild),r=t.next(n);return r&&!Vf(r)&&!qf(r)}(o)};(n=g).on("tap",function(e){var t=Kx(n,e.target);Wx(t)&&(e.preventDefault(),s(yb(n,t)))},!0),g.on("mousedown",function(e){var t,n=e.target;if((n===v||"HTML"===n.nodeName||g.dom.isChildOf(n,v))&&!1!==Qg(g,e.clientX,e.clientY))if(t=Kx(g,n))Wx(t)?(e.preventDefault(),s(yb(g,t))):(c(),$x(t)&&e.shiftKey||Qh(e.clientX,e.clientY,g.selection.getRng())||(w(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===cc(n)){c(),w();var r=pb(v,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=b(1,r.node,r.before,!1);g.getBody().focus(),a(o)}}}),g.on("keypress",function(e){Zh.modifierPressed(e)||(e.keyCode,Wx(g.selection.getNode())&&e.preventDefault())}),g.on("GetSelectionRange",function(e){var t=e.range;if(h){if(!h.parentNode)return void(h=null);(t=t.cloneRange()).selectNode(h),e.range=t}}),g.on("SetSelectionRange",function(e){e.range=u(e.range);var t=s(e.range,e.forward);t&&(e.range=t)});var t,e;g.on("AfterSetSelectionRange",function(e){var t,n=e.range;C(n)||"mcepastebin"===n.startContainer.parentNode.id||w(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||c()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!rr.ie){var r=(t=g.dom.get(y))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),qx(g),e=Ta(function(){if(!t.removed&&t.getBody().contains(V.document.activeElement)&&t.selection.getRng().collapsed){var e=Cb(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0),(t=g).on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})}(),{showCaret:b,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(xu(e),a(r()),g.selection.scrollIntoView(e))},hideFakeCaret:w,destroy:function(){o.destroy(),h=null}}},Yx=function(u){var s,n,r,o=hr.each,c=Zh.BACKSPACE,l=Zh.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=rr.gecko,a=rr.ie,m=rr.webkit,p="data:text/mce-internal,",g=a?"Text":"URL",h=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},v=function(e){return e.isDefaultPrevented()},y=function(){u.shortcuts.add("meta+a",null,"SelectAll")},b=function(){u.on("keydown",function(e){if(!v(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11")+"",e.getParam("document_base_url","")!==e.documentBaseUrl&&(r+=''),r+='',t=zs(e,"body_id","tinymce"),n=zs(e,"body_class",""),js(e)&&(r+=''),r+='
    '},iS=function(e,t){var n,r,o,i,a=e.editorManager.translate("Rich Text Area. Press ALT-0 for help."),u=(n=e.id,r=a,t.height,o=e.getParam("iframe_attrs",{}),i=Ne.fromTag("iframe"),ln(i,o),ln(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),La(i,"tox-edit-area__iframe"),i.dom());u.onload=function(){u.onload=null,e.fire("load")};var s=function(e,t){if(V.document.domain!==V.window.location.hostname&&rr.browser.isIE()){var n=Bv("mce");e[n]=function(){nS(e)};var r='javascript:(function(){document.open();document.domain="'+V.document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return rS.setAttrib(t,"src",r),!0}return!1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=oS(e),rS.add(t.iframeContainer,u),s},aS=ga.DOM,uS=function(t,n,e){var r=th.get(e),o=th.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=hr.trim(e),r&&-1===hr.inArray(n,e)){if(hr.each(th.dependencies(e),function(e){uS(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(pE){!function(e,t,n){var r=ka.translate(["Failed to initialize plugin: {0}",t]);ch(r,n),ih(e,r)}(t,e,pE)}}},sS=function(e){return e.replace(/^\-/,"")},cS=function(e){return{editorContainer:e,iframeContainer:e}},lS=function(e){var t,n,r=e.getElement();return e.inline?cS(null):(t=r,n=aS.create("div"),aS.insertAfter(n,t),cS(n))},fS=function(e){var n,t,r,o,i,a;e.fire("ScriptsLoaded"),n=e,t=hr.trim($s(n)),r=n.ui.registry.getAll().icons,o=pe(pe({},$g.get("default").icons),$g.get(t).icons),oe(o,function(e,t){me(r,t)||n.ui.registry.addIcon(t,e)}),function(e){var t=e.settings.theme;if(q(t)){e.settings.theme=sS(t);var n=nh.get(t);e.theme=new n(e,nh.urls[t]),e.theme.init&&e.theme.init(e,nh.urls[t]||e.documentBaseUrl.replace(/\/$/,""),e.$)}else e.theme={}}(e),i=e,a=[],hr.each(i.settings.plugins.split(/[ ,]/),function(e){uS(i,a,sS(e))});var u,s,c,l,f,d,m,p,g,h=(f=(u=e).getElement(),u.orgDisplay=f.style.display,q(u.settings.theme)?u.theme.renderUI():D(u.settings.theme)?(c=(s=u).getElement(),(l=(0,s.settings.theme)(s,c)).editorContainer.nodeType&&(l.editorContainer.id=l.editorContainer.id||s.id+"_parent"),l.iframeContainer&&l.iframeContainer.nodeType&&(l.iframeContainer.id=l.iframeContainer.id||s.id+"_iframecontainer"),l.height=l.iframeHeight?l.iframeHeight:c.offsetHeight,l):lS(u));return e.editorContainer=h.editorContainer?h.editorContainer:null,(d=e).contentCSS=d.contentCSS.concat(lh(d)),e.inline?nS(e):(g=iS(m=e,p=h),p.editorContainer&&(rS.get(p.editorContainer).style.display=m.orgDisplay,m.hidden=rS.isHidden(p.editorContainer)),m.getElement().style.display="none",rS.setAttrib(m.id,"aria-hidden","true"),void(g||nS(m)))},dS=ga.DOM,mS=function(e){return"-"===e.charAt(0)},pS=function(e,t){var n=Ws(t),r=t.getParam("language_url","","string");if(!1===ka.hasCode(n)&&"en"!==n){var o=""!==r?r:t.editorManager.baseURL+"/langs/"+n+".js";e.add(o,f,undefined,function(){ah(t,"LanguageLoadError",uh("language",o,n))})}},gS=function(t,e,n){return R.from(e).filter(function(e){return 0")},mceToggleVisualAid:function(){i.hasVisual=!i.hasVisual,i.addVisual()},mceReplaceContent:function(e,t,n){i.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.selection.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=i.dom.getParent(i.selection.getNode(),"a"),n.href=n.href.replace(/ /g,"%20"),r&&n.href||i.formatter.remove("link"),n.href&&i.formatter.apply("link",n,r)},selectAll:function(){var e=i.dom.getParent(i.selection.getStart(),on);if(e){var t=i.dom.createRng();t.selectNodeContents(e),i.selection.setRng(t)}},"delete":function(){var e;hw(e=i)||qC(e,!1)||WC(e,!1)||GC(e,!1)||NC(e,!1)||Vd(e)||RC(e)||ew(e,!1)||(bS(e,"Delete"),dC(e))},forwardDelete:function(){var e;qC(e=i,!0)||WC(e,!0)||GC(e,!0)||NC(e,!0)||Vd(e)||RC(e)||ew(e,!0)||bS(e,"ForwardDelete")},mceNewDocument:function(){i.setContent("")},InsertLineBreak:function(e,t,n){return Hw(i,n),!0}});var e=function(n){return function(){var e=i.selection.isCollapsed()?[i.dom.getParent(i.selection.getNode(),i.dom.isBlock)]:i.selection.getSelectedBlocks(),t=OS(e,function(e){return!!i.formatter.matchNode(e,n)});return-1!==BS(t,!0)}};a.addCommands({JustifyLeft:e("alignleft"),JustifyCenter:e("aligncenter"),JustifyRight:e("alignright"),JustifyFull:e("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return a.isFormatMatch(e)},mceBlockQuote:function(){return a.isFormatMatch("blockquote")},Outdent:function(){return ow(i)},"InsertUnorderedList,InsertOrderedList":function(e){var t=i.dom.getParent(i.selection.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),a.addCommands({Undo:function(){i.undoManager.undo()},Redo:function(){i.undoManager.redo()}}),a.addQueryValueHandler("FontName",function(){return RS(t=i).fold(function(){return _S(t).map(function(e){return kS(t.getBody(),e)}).getOr("")},function(e){return kS(t.getBody(),e)});var t},this),a.addQueryValueHandler("FontSize",function(){return RS(t=i).fold(function(){return _S(t).map(function(e){return ES(t.getBody(),e)}).getOr("")},function(e){return ES(t.getBody(),e)});var t},this)},LS);function LS(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e)}var IS=hr.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),MS=(FS.isNative=function(e){return!!IS[e.toLowerCase()]},FS.prototype.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=this.scope),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=h},t.stopPropagation=function(){t.isPropagationStopped=h},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=h},t.isDefaultPrevented=g,t.isPropagationStopped=g,t.isImmediatePropagationStopped=g),this.settings.beforeFire&&this.settings.beforeFire(t),n=this.bindings[e])for(r=0,o=n.length;r"),this.parseShortcut))[o.length-1]=hr.extend(o[o.length-1],{func:n,scope:r||this.editor}),hr.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},sN.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},sN.prototype.isFunctionKey=function(e){return"keydown"===e.type&&112<=e.keyCode&&e.keyCode<=123},sN.prototype.matchShortcut=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},sN.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},sN);function sN(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var n=this;e.on("keyup keypress keydown",function(t){!n.hasModifier(t)&&!n.isFunctionKey(t)||t.isDefaultPrevented()||(rN(n.shortcuts,function(e){if(n.matchShortcut(t,e))return n.pendingPatterns=e.subpatterns.slice(0),"keydown"===t.type&&n.executeShortcutAction(e),!0}),n.matchShortcut(t,n.pendingPatterns[0])&&(1===n.pendingPatterns.length&&"keydown"===t.type&&n.executeShortcutAction(n.pendingPatterns[0]),n.pendingPatterns.shift()))})}var cN=function(){var e,t,n,r,o,i,a,u,s=(t={},n={},r={},o={},i={},a={},{addButton:(u=function(n,r){return function(e,t){return n[e.toLowerCase()]=pe(pe({},t),{type:r})}})(e={},"button"),addGroupToolbarButton:u(e,"grouptoolbarbutton"),addToggleButton:u(e,"togglebutton"),addMenuButton:u(e,"menubutton"),addSplitButton:u(e,"splitbutton"),addMenuItem:u(t,"menuitem"),addNestedMenuItem:u(t,"nestedmenuitem"),addToggleMenuItem:u(t,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(e,t){return r[e.toLowerCase()]=t},getAll:function(){return{buttons:e,menuItems:t,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}});return{addAutocompleter:s.addAutocompleter,addButton:s.addButton,addContextForm:s.addContextForm,addContextMenu:s.addContextMenu,addContextToolbar:s.addContextToolbar,addIcon:s.addIcon,addMenuButton:s.addMenuButton,addMenuItem:s.addMenuItem,addNestedMenuItem:s.addNestedMenuItem,addSidebar:s.addSidebar,addSplitButton:s.addSplitButton,addToggleButton:s.addToggleButton,addGroupToolbarButton:s.addGroupToolbarButton,addToggleMenuItem:s.addToggleMenuItem,getAll:s.getAll}},lN=hr.each,fN=hr.trim,dN="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),mN={ftp:21,http:80,https:443,mailto:25},pN=(gN.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},gN.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},gN.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source="",this.getURI()},gN.prototype.toRelative=function(e){var t;if("./"===e)return e;var n=new gN(e,{base_uri:this});if("mce_host"!==n.host&&this.host!==n.host&&n.host||this.port!==n.port||this.protocol!==n.protocol&&""!==n.protocol)return n.getURI();var r=this.getURI(),o=n.getURI();return r===o||"/"===r.charAt(r.length-1)&&r.substr(0,r.length-1)===o?r:(t=this.toRelPath(this.path,n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),t)},gN.prototype.toAbsolute=function(e,t){var n=new gN(e,{base_uri:this});return n.getURI(t&&this.isSameOrigin(n))},gN.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=mN[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},gN.prototype.toRelPath=function(e,t){var n,r,o,i=0,a="",u=e.substring(0,e.lastIndexOf("/")).split("/");if(n=t.split("/"),u.length>=n.length)for(r=0,o=u.length;r=n.length||u[r]!==n[r]){i=r+1;break}if(u.length=u.length||u[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=u.length-(i-1);r=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=WN(e.x,t.x),r=WN(e.y,t.y),o=$N(e.x+e.w,t.x+t.w),i=$N(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:YN(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=WN(0,t.x-u),o=WN(0,t.y-s),i=WN(0,c-f),a=WN(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),YN(u,s,(c-=i)-u,(l-=a)-s)},create:YN,fromClientRect:function(e){return YN(e.left,e.top,e.width,e.height)}},JN=hr.each,QN=hr.extend,ZN=function(){};ZN.extend=jN=function(n){var o,i=this.prototype,r=function(){var e,t,n;if(!HN&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},t=function(){return this};return HN=!0,o=new this,HN=!1,n.Mixins&&(JN(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),i.Mixins&&(n.Mixins=i.Mixins.concat(n.Mixins))),n.Methods&&JN(n.Methods.split(","),function(e){n[e]=t}),n.Properties&&JN(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&JN(n.Statics,function(e,t){r[t]=e}),n.Defaults&&i.Defaults&&(n.Defaults=QN({},i.Defaults,n.Defaults)),oe(n,function(e,t){var n,r;"function"==typeof e&&i[t]?o[t]=(n=t,r=e,function(){var e,t=this._super;return this._super=i[n],e=r.apply(this,arguments),this._super=t,e}):o[t]=e}),r.prototype=o,(r.constructor=r).extend=jN,r};var eE=Math.min,tE=Math.max,nE=Math.round,rE={serialize:function(e){var t=JSON.stringify(e);return q(t)?t.replace(/[\u0080-\uFFFF]/g,function(e){var t=e.charCodeAt(0).toString(16);return"\\u"+"0000".substring(t.length)+t}):t},parse:function(e){try{return JSON.parse(e)}catch(t){}}},oE={callbacks:{},count:0,send:function(t){var n=this,r=ga.DOM,o=t.count!==undefined?t.count:n.count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},iE=pe(pe({},jS),{send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4