tinymce-rails 5.6.1 → 5.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/source/tinymce/tinymce.js +3 -3
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +1 -1
- data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +1 -1
- data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -2
- data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d491e52271301e60ad19c3140e88cdd34db8683e2da56daa8f590f507f20659
|
4
|
+
data.tar.gz: e5b165b06bf8abb9cced34b26939ff34a52916b91f72af836c724c719858899a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e86eae512a802233e70ecc5e9de00265f2fdf3110d6a94f72bb423689f26612ded4d266ec277a388c0d2f300caa14a91efb1783ca39f9e6b854e7b28c4b440e
|
7
|
+
data.tar.gz: e4e18abd76b8f984d1364003eab9671d800c3c487f4766a257a70e710b8d8ef9b6f6f26c9e2d55a792201c7b022dae9a4c9f50255df7d1ce62408b62fd693f8e
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
(function () {
|
10
10
|
'use strict';
|
@@ -28739,8 +28739,8 @@
|
|
28739
28739
|
suffix: null,
|
28740
28740
|
$: DomQuery,
|
28741
28741
|
majorVersion: '5',
|
28742
|
-
minorVersion: '6.
|
28743
|
-
releaseDate: '2020-
|
28742
|
+
minorVersion: '6.2',
|
28743
|
+
releaseDate: '2020-12-08',
|
28744
28744
|
editors: legacyEditors,
|
28745
28745
|
i18n: I18n,
|
28746
28746
|
activeEditor: null,
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var n,e,t,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(n,e,t){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===t?null:{"list-style-type":t})},l=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(n){return function(){return n}},c=i(!1),s=i(!0),o=function(){return a},a=(n=function(n){return n.isNone()},{fold:function(n,e){return n()},is:c,isSome:c,isNone:s,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:t,orThunk:e,map:o,each:function(){},bind:o,exists:c,forall:s,filter:o,equals:n,equals_:n,toArray:function(){return[]},toString:i("none()")}),f=function(t){var n=i(t),e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:s,isNone:c,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return f(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){return n(t)?o:a},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(c,function(n){return e(t,n)})}};return o},d=function(n){return null===n||n===undefined?a:f(n)},g=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},m=function(r){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&(t=n,(e=r).$.contains(e.getBody(),t));var e,t}},p=function(n,e,t){var r=function(n,e){for(var t=0;t<n.length;t++){if(e(n[t]))return t}return-1}(e.parents,g),o=-1!==r?e.parents.slice(0,r):e.parents,i=l.grep(o,m(n));return 0<i.length&&i[0].nodeName===t},y=function(o,n,e,t,r,i){o.ui.registry.addSplitButton(n,{tooltip:e,icon:"OL"===r?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(n){n(l.map(i,function(n){return{type:"choiceitem",value:"default"===n?"":n,icon:"list-"+("OL"===r?"num":"bull")+"-"+("disc"===n||"decimal"===n?"default":n),text:n.replace(/\-/g," ").replace(/\b\w/g,function(n){return n.toUpperCase()})}}))},onAction:function(){return o.execCommand(t)},onItemAction:function(n,e){u(o,r,e)},select:function(e){var n,t,r;return(t=(n=o).dom.getParent(n.selection.getNode(),"ol,ul"),r=n.dom.getStyle(t,"listStyleType"),d(r)).map(function(n){return e===n}).getOr(!1)},onSetup:function(e){var n=function(n){e.setActive(p(o,n,r))};return o.on("NodeChange",n),function(){return o.off("NodeChange",n)}}})},v=function(n,e,t,r,o,i){var u,l,c,s,a;1<i.length?y(n,e,t,r,o,i):(l=e,c=t,s=r,a=o,(u=n).ui.registry.addToggleButton(l,{active:!1,tooltip:c,icon:"OL"===a?"ordered-list":"unordered-list",onSetup:function(e){var n=function(n){e.setActive(p(u,n,a))};return u.on("NodeChange",n),function(){return u.off("NodeChange",n)}},onAction:function(){return u.execCommand(s)}}))};r.add("advlist",function(n){var t,e,r,o;n.hasPlugin("lists")&&(v(e=n,"numlist","Numbered list","InsertOrderedList","OL",(r=e.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"))?r.split(/[ ,]/):[]),v(e,"bullist","Bullet list","InsertUnorderedList","UL",(o=e.getParam("advlist_bullet_styles","default,circle,square"))?o.split(/[ ,]/):[]),(t=n).addCommand("ApplyUnorderedListStyle",function(n,e){u(t,"UL",e["list-style-type"])}),t.addCommand("ApplyOrderedListStyle",function(n,e){u(t,"OL",e["list-style-type"])}))})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),a="a:not([href])",n=function(e){return e.getAttribute("id")||e.getAttribute("name")||""},r=function(e){return(t=e)&&"a"===t.nodeName.toLowerCase()&&!e.getAttribute("href")&&""!==n(e);var t},c=function(e){var n=e.dom;t(n).walk(e.selection.getRng(),function(e){o.each(e,function(e){var t;r(t=e)&&!t.firstChild&&n.remove(e,!1)})})},u=function(e){return e.dom.getParent(e.selection.getStart(),a)},i=function(e,t){var n,o,a,r,i,l=u(e);l?(a=e,r=t,(i=l).removeAttribute("name"),i.id=r,a.addVisual(),a.undoManager.add()):(o=t,(n=e).undoManager.transact(function(){n.getParam("allow_html_in_named_anchor",!1,"boolean")||n.selection.collapse(!0),n.selection.isCollapsed()?n.insertContent(n.dom.createHTML("a",{id:o})):(c(n),n.formatter.remove("namedAnchor",null,null,!0),n.formatter.apply("namedAnchor",{value:o}),n.addVisual())})),e.focus()},l=function(o){var e,t=(e=u(o))?n(e):"";o.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:function(e){var t,n;t=o,n=e.getData().id,(/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(n)?(i(t,n),1):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),0))&&e.close()}})},d=function(r){return function(e){for(var t,n,o=0;o<e.length;o++){var a=e[o];n=void 0,!(n=t=a)||n.attr("href")||!n.attr("id")&&!n.attr("name")||t.firstChild||a.attr("contenteditable",r)}}};e.add("anchor",function(e){var t,n,o;(t=e).on("PreInit",function(){t.parser.addNodeFilter("a",d("false")),t.serializer.addNodeFilter("a",d(null))}),(n=e).addCommand("mceAnchor",function(){l(n)}),(o=e).ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return o.execCommand("mceAnchor")},onSetup:function(e){return o.selection.selectorChangedWithUnbind("a:not([href])",e.setActive).unbind}}),o.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return o.execCommand("mceAnchor")}}),e.on("PreInit",function(){e.formatter.register("namedAnchor",{inline:"a",selector:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:function(e,t,n){return r(e)}})})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),i=function(e,t){var n;return t<0&&(t=0),3!==e.nodeType||(n=e.data.length)<t&&(t=n),t},y=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,i(t,n)):e.setStartBefore(t)},k=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,i(t,n)):e.setEndAfter(t)},r=function(e,t,n){var o,i,r,a,s,d,f,l=e.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i),c=e.getParam("default_link_target",!1);if("A"!==e.selection.getNode().tagName){var g=e.selection.getRng().cloneRange();if(g.startOffset<5){if(!(s=g.endContainer.previousSibling)){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;s=g.endContainer.firstChild.nextSibling}if(d=s.length,y(g,s,d),k(g,s,d),g.endOffset<5)return;o=g.endOffset,i=s}else{if(3!==(i=g.endContainer).nodeType&&i.firstChild){for(;3!==i.nodeType&&i.firstChild;)i=i.firstChild;3===i.nodeType&&(y(g,i,0),k(g,i,i.nodeValue.length))}o=1===g.endOffset?2:g.endOffset-1-t}for(var u,h=o;y(g,i,2<=o?o-2:0),k(g,i,1<=o?o-1:0),--o," "!==(f=g.toString())&&""!==f&&160!==f.charCodeAt(0)&&0<=o-2&&f!==n;);(u=g.toString())===n||" "===u||160===u.charCodeAt(0)?(y(g,i,o),k(g,i,h),o+=1):(0===g.startOffset?y(g,i,0):y(g,i,o),k(g,i,h)),"."===(a=g.toString()).charAt(a.length-1)&&k(g,i,h-1);var m=(a=g.toString().trim()).match(l),C=e.getParam("link_default_protocol","http","string");m&&("www."===m[1]?m[1]=C+"://www.":/@$/.test(m[1])&&!/^mailto:/.test(m[1])&&(m[1]="mailto:"+m[1]),r=e.selection.getBookmark(),e.selection.setRng(g),e.execCommand("createlink",!1,m[1]+m[2]),!1!==c&&e.dom.setAttrib(e.selection.getNode(),"target",c),e.selection.moveToBookmark(r),e.nodeChanged())}},t=function(t){var n;t.on("keydown",function(e){13!==e.keyCode||r(t,-1,"")}),o.browser.isIE()?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){41!==e.keyCode||r(t,-1,"(")}),t.on("keyup",function(e){32!==e.keyCode||r(t,0,"")}))};e.add("autolink",function(e){t(e)})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),h=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},a=function(e,t,n,i,o){r.setEditorTimeout(e,function(){b(e,t),n--?a(e,t,n,i,o):o&&o()},i)},p=function(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))},v=function(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o},b=function(e,t){var n,i,o,r,s,a,g,u,l,c,m,f=e.dom,d=e.getDoc();d&&((n=e).plugins.fullscreen&&n.plugins.fullscreen.isFullscreen()?p(e,!0):(i=d.documentElement,o=e.getParam("autoresize_bottom_margin",50,"number"),r=y(e),s=v(f,i,"margin-top",!0),a=v(f,i,"margin-bottom",!0),(g=i.offsetHeight+s+a+o)<0&&(g=0),g+(u=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight)>y(e)&&(r=g+u),(l=e.getParam("max_height",0,"number"))&&l<r?(r=l,p(e,!0)):p(e,!1),r!==t.get()&&(c=r-t.get(),f.setStyle(e.getContainer(),"height",r+"px"),t.set(r),e.fire("ResizeEditor"),h.browser.isSafari()&&h.mac&&(m=e.getWin()).scrollTo(m.pageXOffset,m.pageYOffset),e.hasFocus()&&e.selection.scrollIntoView(e.selection.getNode()),h.webkit&&c<0&&b(e,t))))};e.add("autoresize",function(e){var t,n,i,o,r,s;e.settings.hasOwnProperty("resize")||(e.settings.resize=!1),e.inline||(s=0,r=t={get:function(){return s},set:function(e){s=e}},(o=e).addCommand("mceAutoResize",function(){b(o,r)}),i=t,(n=e).on("init",function(){var e=n.getParam("autoresize_overflow_padding",1,"number"),t=n.dom;t.setStyles(n.getDoc().documentElement,{height:"auto"}),t.setStyles(n.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),n.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(){b(n,i)}),n.getParam("autoresize_on_init",!0,"boolean")&&n.on("init",function(){a(n,i,20,100,function(){a(n,i,5,1e3)})}))})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=(e=undefined,function(t){return e===t}),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),n=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,e){var r=t||e,n=/^(\d+)([ms]?)$/.exec(""+r);return(n[2]?{s:1e3,m:6e4}[n[2]]:1)*parseInt(r,10)},u=function(t){var e=document.location;return t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},s=function(t,e){if(a(e))return t.dom.isEmpty(t.getBody());var r=o.trim(e);if(""===r)return!0;var n=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(n)},f=function(t){var e=parseInt(n.getItem(u(t)+"time"),10)||0;return!((new Date).getTime()-e>i(t.getParam("autosave_retention"),"20m"))||(c(t,!1),!1)},c=function(t,e){var r=u(t);n.removeItem(r+"draft"),n.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},m=function(t){var e=u(t);!s(t)&&t.isDirty()&&(n.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),n.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))},l=function(t){var e=u(t);f(t)&&(t.setContent(n.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))},v=function(t){var e=i(t.getParam("autosave_interval"),"30s");r.setEditorInterval(t,function(){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)}}};t.add("autosave",function(t){var e,r;return t.editorManager.on("BeforeUnload",function(t){var e;o.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)}}})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!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,"<br />"),o(/\[b\]/gi,"<strong>"),o(/\[\/b\]/gi,"</strong>"),o(/\[i\]/gi,"<em>"),o(/\[\/i\]/gi,"</em>"),o(/\[u\]/gi,"<u>"),o(/\[\/u\]/gi,"</u>"),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),o(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),o(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),o(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span> '),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span> '),t};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.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),o(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),o(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),o(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),o(/<font>(.*?)<\/font>/gi,"$1"),o(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),o(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),o(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),o(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),o(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),o(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),o(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),o(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),o(/<u class=\"quoteStyle\">(.*?)<\/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 style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),o(/<u>/gi,"[u]"),o(/<blockquote[^>]*>/gi,"[quote]"),o(/<\/blockquote>/gi,"[/quote]"),o(/<br \/>/gi,"\n"),o(/<br\/>/gi,"\n"),o(/<br>/gi,"\n"),o(/<p>/gi,""),o(/<\/p>/gi,"\n"),o(/ |\u00a0/gi," "),o(/"/gi,'"'),o(/</gi,"<"),o(/>/gi,">"),o(/&/gi,"&"),t}(o.content))})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e,n,r,t,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=function(e,n){var r,t=(r=n,e.fire("insertCustomChar",{chr:r}).chr);e.execCommand("mceInsertContent",!1,t)},i=function(e){return function(){return e}},o=i(!1),c=i(!0),u=function(){return l},l=(e=function(e){return e.isNone()},{fold:function(e,n){return e()},is:o,isSome:o,isNone:c,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:i(null),getOrUndefined:i(undefined),or:r,orThunk:n,map:u,each:function(){},bind:u,exists:o,forall:c,filter:u,equals:e,equals_:e,toArray:function(){return[]},toString:i("none()")}),g=function(r){var e=i(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:c,isNone:o,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return g(e(r))},each:function(e){e(r)},bind:t,exists:t,forall:t,filter:function(e){return e(r)?a:l},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,n){return e.fold(o,function(e){return n(r,e)})}};return a},m={some:g,none:u,from:function(e){return null===e||e===undefined?l:g(e)}},f=(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}),h=Array.prototype.push,p=function(e,n){for(var r=e.length,t=new Array(r),a=0;a<r;a++){var i=e[a];t[a]=n(i,a)}return t},d=function(e,n){return function(e,n,r){for(var t=0,a=e.length;t<a;t++){var i=e[t];if(n(i,t))return m.some(i);if(r(i,t))break}return m.none()}(e,n,o)},y=function(e,n){return function(e){for(var n=[],r=0,t=e.length;r<t;++r){if(!f(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);h.apply(n,e[r])}return n}(p(e,n))},v=tinymce.util.Tools.resolve("tinymce.util.Tools"),w=v.isArray,b="User Defined",k=function(e){return w(e)?[].concat((n=e,v.grep(n,function(e){return w(e)&&2===e.length}))):"function"==typeof e?e():[];var n},C=function(e){var n=function(e,n){var r=e.getParam("charmap");r&&(n=[{name:b,characters:k(r)}]);var t=e.getParam("charmap_append");if(t){var a=v.grep(n,function(e){return e.name===b});return a.length?(a[0].characters=[].concat(a[0].characters).concat(k(t)),n):[].concat(n).concat({name:b,characters:k(t)})}return n}(e,[{name:"Currency",characters:[[36,"dollar sign"],[162,"cent sign"],[8364,"euro sign"],[163,"pound sign"],[165,"yen sign"],[164,"currency sign"],[8352,"euro-currency sign"],[8353,"colon sign"],[8354,"cruzeiro sign"],[8355,"french franc sign"],[8356,"lira sign"],[8357,"mill sign"],[8358,"naira sign"],[8359,"peseta sign"],[8360,"rupee sign"],[8361,"won sign"],[8362,"new sheqel sign"],[8363,"dong sign"],[8365,"kip sign"],[8366,"tugrik sign"],[8367,"drachma sign"],[8368,"german penny symbol"],[8369,"peso sign"],[8370,"guarani sign"],[8371,"austral sign"],[8372,"hryvnia sign"],[8373,"cedi sign"],[8374,"livre tournois sign"],[8375,"spesmilo sign"],[8376,"tenge sign"],[8377,"indian rupee sign"],[8378,"turkish lira sign"],[8379,"nordic mark sign"],[8380,"manat sign"],[8381,"ruble sign"],[20870,"yen character"],[20803,"yuan character"],[22291,"yuan character, in hong kong and taiwan"],[22278,"yen/yuan character variant one"]]},{name:"Text",characters:[[169,"copyright sign"],[174,"registered sign"],[8482,"trade mark sign"],[8240,"per mille sign"],[181,"micro sign"],[183,"middle dot"],[8226,"bullet"],[8230,"three dot leader"],[8242,"minutes / feet"],[8243,"seconds / inches"],[167,"section sign"],[182,"paragraph sign"],[223,"sharp s / ess-zed"]]},{name:"Quotations",characters:[[8249,"single left-pointing angle quotation mark"],[8250,"single right-pointing angle quotation mark"],[171,"left pointing guillemet"],[187,"right pointing guillemet"],[8216,"left single quotation mark"],[8217,"right single quotation mark"],[8220,"left double quotation mark"],[8221,"right double quotation mark"],[8218,"single low-9 quotation mark"],[8222,"double low-9 quotation mark"],[60,"less-than sign"],[62,"greater-than sign"],[8804,"less-than or equal to"],[8805,"greater-than or equal to"],[8211,"en dash"],[8212,"em dash"],[175,"macron"],[8254,"overline"],[164,"currency sign"],[166,"broken bar"],[168,"diaeresis"],[161,"inverted exclamation mark"],[191,"turned question mark"],[710,"circumflex accent"],[732,"small tilde"],[176,"degree sign"],[8722,"minus sign"],[177,"plus-minus sign"],[247,"division sign"],[8260,"fraction slash"],[215,"multiplication sign"],[185,"superscript one"],[178,"superscript two"],[179,"superscript three"],[188,"fraction one quarter"],[189,"fraction one half"],[190,"fraction three quarters"]]},{name:"Mathematical",characters:[[402,"function / florin"],[8747,"integral"],[8721,"n-ary sumation"],[8734,"infinity"],[8730,"square root"],[8764,"similar to"],[8773,"approximately equal to"],[8776,"almost equal to"],[8800,"not equal to"],[8801,"identical to"],[8712,"element of"],[8713,"not an element of"],[8715,"contains as member"],[8719,"n-ary product"],[8743,"logical and"],[8744,"logical or"],[172,"not sign"],[8745,"intersection"],[8746,"union"],[8706,"partial differential"],[8704,"for all"],[8707,"there exists"],[8709,"diameter"],[8711,"backward difference"],[8727,"asterisk operator"],[8733,"proportional to"],[8736,"angle"]]},{name:"Extended Latin",characters:[[192,"A - grave"],[193,"A - acute"],[194,"A - circumflex"],[195,"A - tilde"],[196,"A - diaeresis"],[197,"A - ring above"],[256,"A - macron"],[198,"ligature AE"],[199,"C - cedilla"],[200,"E - grave"],[201,"E - acute"],[202,"E - circumflex"],[203,"E - diaeresis"],[274,"E - macron"],[204,"I - grave"],[205,"I - acute"],[206,"I - circumflex"],[207,"I - diaeresis"],[298,"I - macron"],[208,"ETH"],[209,"N - tilde"],[210,"O - grave"],[211,"O - acute"],[212,"O - circumflex"],[213,"O - tilde"],[214,"O - diaeresis"],[216,"O - slash"],[332,"O - macron"],[338,"ligature OE"],[352,"S - caron"],[217,"U - grave"],[218,"U - acute"],[219,"U - circumflex"],[220,"U - diaeresis"],[362,"U - macron"],[221,"Y - acute"],[376,"Y - diaeresis"],[562,"Y - macron"],[222,"THORN"],[224,"a - grave"],[225,"a - acute"],[226,"a - circumflex"],[227,"a - tilde"],[228,"a - diaeresis"],[229,"a - ring above"],[257,"a - macron"],[230,"ligature ae"],[231,"c - cedilla"],[232,"e - grave"],[233,"e - acute"],[234,"e - circumflex"],[235,"e - diaeresis"],[275,"e - macron"],[236,"i - grave"],[237,"i - acute"],[238,"i - circumflex"],[239,"i - diaeresis"],[299,"i - macron"],[240,"eth"],[241,"n - tilde"],[242,"o - grave"],[243,"o - acute"],[244,"o - circumflex"],[245,"o - tilde"],[246,"o - diaeresis"],[248,"o slash"],[333,"o macron"],[339,"ligature oe"],[353,"s - caron"],[249,"u - grave"],[250,"u - acute"],[251,"u - circumflex"],[252,"u - diaeresis"],[363,"u - macron"],[253,"y - acute"],[254,"thorn"],[255,"y - diaeresis"],[563,"y - macron"],[913,"Alpha"],[914,"Beta"],[915,"Gamma"],[916,"Delta"],[917,"Epsilon"],[918,"Zeta"],[919,"Eta"],[920,"Theta"],[921,"Iota"],[922,"Kappa"],[923,"Lambda"],[924,"Mu"],[925,"Nu"],[926,"Xi"],[927,"Omicron"],[928,"Pi"],[929,"Rho"],[931,"Sigma"],[932,"Tau"],[933,"Upsilon"],[934,"Phi"],[935,"Chi"],[936,"Psi"],[937,"Omega"],[945,"alpha"],[946,"beta"],[947,"gamma"],[948,"delta"],[949,"epsilon"],[950,"zeta"],[951,"eta"],[952,"theta"],[953,"iota"],[954,"kappa"],[955,"lambda"],[956,"mu"],[957,"nu"],[958,"xi"],[959,"omicron"],[960,"pi"],[961,"rho"],[962,"final sigma"],[963,"sigma"],[964,"tau"],[965,"upsilon"],[966,"phi"],[967,"chi"],[968,"psi"],[969,"omega"]]},{name:"Symbols",characters:[[8501,"alef symbol"],[982,"pi symbol"],[8476,"real part symbol"],[978,"upsilon - hook symbol"],[8472,"Weierstrass p"],[8465,"imaginary part"]]},{name:"Arrows",characters:[[8592,"leftwards arrow"],[8593,"upwards arrow"],[8594,"rightwards arrow"],[8595,"downwards arrow"],[8596,"left right arrow"],[8629,"carriage return"],[8656,"leftwards double arrow"],[8657,"upwards double arrow"],[8658,"rightwards double arrow"],[8659,"downwards double arrow"],[8660,"left right double arrow"],[8756,"therefore"],[8834,"subset of"],[8835,"superset of"],[8836,"not a subset of"],[8838,"subset of or equal to"],[8839,"superset of or equal to"],[8853,"circled plus"],[8855,"circled times"],[8869,"perpendicular"],[8901,"dot operator"],[8968,"left ceiling"],[8969,"right ceiling"],[8970,"left floor"],[8971,"right floor"],[9001,"left-pointing angle bracket"],[9002,"right-pointing angle bracket"],[9674,"lozenge"],[9824,"black spade suit"],[9827,"black club suit"],[9829,"black heart suit"],[9830,"black diamond suit"],[8194,"en space"],[8195,"em space"],[8201,"thin space"],[8204,"zero width non-joiner"],[8205,"zero width joiner"],[8206,"left-to-right mark"],[8207,"right-to-left mark"]]}]);return 1<n.length?[{name:"All",characters:y(n,function(e){return e.characters})}].concat(n):n},x=function(e){var n=e;return{get:function(){return n},set:function(e){n=e}}},A=String.fromCodePoint,O=function(e,n){return-1!==e.indexOf(n)},q=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(A)return A.apply(void 0,e);for(var r=[],t="",a=0,i=e.length;a!==i;++a){var o=+e[a];if(!(o<1114111&&o>>>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)},S=function(e,n){var a=[],i=n.toLowerCase();return function(e,n){for(var r=0,t=e.length;r<t;r++){n(e[r],r)}}(e.characters,function(e){var n,r,t;n=e[0],r=e[1],t=i,(O(q(n).toLowerCase(),t)||O(r.toLowerCase(),t)||O(r.toLowerCase().replace(/\s+/g,""),t))&&a.push(e)}),p(a,function(e){return{text:e[1],value:q(e[0]),icon:q(e[0])}})},T="pattern",E=function(r,a){var t,i,o,n=function(){return[{label:"Search",type:"input",name:T},{type:"collection",name:"results"}]},c=1===a.length?x(b):x("All"),u=(t=function(e){var r,t,n=e.getData().pattern;r=e,t=n,d(a,function(e){return e.name===c.get()}).each(function(e){var n=S(e,t);r.setData({results:n})})},i=40,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];null!==o&&clearTimeout(o),o=setTimeout(function(){t.apply(null,e),o=null},i)}}),e={title:"Special Character",size:"normal",body:1===a.length?{type:"panel",items:n()}:{type:"tabpanel",tabs:p(a,function(e){return{title:e.name,name:e.name,items:n()}})},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{pattern:"",results:S(a[0],"")},onAction:function(e,n){"results"===n.name&&(s(r,n.value),e.close())},onTabChange:function(e,n){c.set(n.newTabName),u.throttle(e)},onChange:function(e,n){n.name===T&&u.throttle(e)}};r.windowManager.open(e).focus(T)},P=tinymce.util.Tools.resolve("tinymce.util.Promise");a.add("charmap",function(e){var n,r,t,a,i,o,c=C(e);return r=c,(n=e).addCommand("mceShowCharmap",function(){E(n,r)}),(t=e).ui.registry.addButton("charmap",{icon:"insert-character",tooltip:"Special character",onAction:function(){return t.execCommand("mceShowCharmap")}}),t.ui.registry.addMenuItem("charmap",{icon:"insert-character",text:"Special character...",onAction:function(){return t.execCommand("mceShowCharmap")}}),a=e,i=c[0],a.ui.registry.addAutocompleter("charmap",{ch:":",columns:"auto",minChars:2,fetch:function(r,e){return new P(function(e,n){e(S(i,r))})},onAction:function(e,n,r){a.selection.setRng(n),a.insertContent(r),e.hide()}}),o=e,{getCharMap:function(){return C(o)},insertChar:function(e){s(o,e)}}})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(o){var e=o.getContent({source_view:!0});o.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){var t,n;t=o,n=e.getData().code,t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged(),e.close()}})};e.add("code",function(e){var t,n;return(t=e).addCommand("mceCodeEditor",function(){o(t)}),(n=e).ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return o(n)}}),n.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return o(n)}}),{}})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e,n,t,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=function(e){return function(){return e}},i=s(!1),o=s(!0),a=function(){return l},l=(e=function(e){return e.isNone()},{fold:function(e,n){return e()},is:i,isSome:i,isNone:o,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:s(null),getOrUndefined:s(undefined),or:t,orThunk:n,map:a,each:function(){},bind:a,exists:i,forall:o,filter:a,equals:e,equals_:e,toArray:function(){return[]},toString:s("none()")}),u=function(t){var e=s(t),n=function(){return a},r=function(e){return e(t)},a={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:o,isNone:i,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return u(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?a:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(i,function(e){return n(t,e)})}};return a},c={some:u,none:a,from:function(e){return null===e||e===undefined?l:u(e)}},p=function(e){return n=e,(t=0)<=t&&t<n.length?c.some(n[t]):c.none();var n,t},d=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");function g(e){return e&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-")}function m(t){return function(e,n){return t(n)}}var f="undefined"!=typeof window?window:Function("return this;")(),h={},b={exports:h},y={};!function(n,t,r,p){var e=window.Prism;window.Prism={manual:!0},function(e){"object"==typeof t&&void 0!==r?r.exports=e():"function"==typeof n&&n.amd?n([],e):("undefined"!=typeof window?window:void 0!==y?y:"undefined"!=typeof self?self:this).EphoxContactWrapper=e()}(function(){return function c(s,i,o){function l(n,e){if(!i[n]){if(!s[n]){var t="function"==typeof p&&p;if(!e&&t)return t(n,!0);if(u)return u(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}var a=i[n]={exports:{}};s[n][0].call(a.exports,function(e){return l(s[n][1][e]||e)},a,a.exports,c,s,i,o)}return i[n].exports}for(var u="function"==typeof p&&p,e=0;e<o.length;e++)l(o[e]);return l}({1:[function(e,n,t){Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+/,lookbehind:!0},keyword:/\b(?:__attribute__|_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,"function":/[a-z_]\w*(?=\s*\()/i,operator:/>>=?|<<=?|->|([-+&|:])\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,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],comment:Prism.languages.c.comment,directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}},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(n){(function(){var e=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,n=0,O={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function a(e){return e instanceof N?new N(e.type,a(e.content),e.alias):Array.isArray(e)?e.map(a):e.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++n}),e.__id},clone:function i(e,t){var r,n;switch(t=t||{},O.util.type(e)){case"Object":if(n=O.util.objId(e),t[n])return t[n];for(var a in r={},t[n]=r,e)e.hasOwnProperty(a)&&(r[a]=i(e[a],t));return r;case"Array":return(n=O.util.objId(e),t[n])?t[n]:(r=[],t[n]=r,e.forEach(function(e,n){r[n]=i(e,t)}),r);default:return e}},getLanguage:function(e){for(;e&&!c.test(e.className);)e=e.parentElement;return e?(e.className.match(c)||[,"none"])[1].toLowerCase():"none"},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(r){var e=(/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(r.stack)||[])[1];if(e){var n=document.getElementsByTagName("script");for(var t in n)if(n[t].src==e)return n[t]}return null}},isActive:function(e,n,t){for(var r="no-"+n;e;){var a=e.classList;if(a.contains(n))return!0;if(a.contains(r))return!1;e=e.parentElement}return!!t}},languages:{extend:function(e,n){var t=O.util.clone(O.languages[e]);for(var r in n)t[r]=n[r];return t},insertBefore:function(t,e,n,r){var a=(r=r||O.languages)[t],s={};for(var i in a)if(a.hasOwnProperty(i)){if(i==e)for(var o in n)n.hasOwnProperty(o)&&(s[o]=n[o]);n.hasOwnProperty(i)||(s[i]=a[i])}var l=r[t];return r[t]=s,O.languages.DFS(O.languages,function(e,n){n===l&&e!=t&&(this[e]=s)}),s},DFS:function l(e,n,t,r){r=r||{};var a,s,i=O.util.objId;for(var o in e){e.hasOwnProperty(o)&&(n.call(e,o,e[o],t||o),a=e[o],"Object"!==(s=O.util.type(a))||r[i(a)]?"Array"!==s||r[i(a)]||(r[i(a)]=!0,l(a,n,o,r)):(r[i(a)]=!0,l(a,n,null,r)))}}},plugins:{},highlightAll:function(e,n){O.highlightAllUnder(document,e,n)},highlightAllUnder:function(e,n,t){var r={callback:t,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};O.hooks.run("before-highlightall",r),r.elements=Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)),O.hooks.run("before-all-elements-highlight",r);for(var a,s=0;a=r.elements[s++];)O.highlightElement(a,!0===n,r.callback)},highlightElement:function(e,n,t){var r=O.util.getLanguage(e),a=O.languages[r];e.className=e.className.replace(c,"").replace(/\s+/g," ")+" language-"+r;var s=e.parentElement;s&&"pre"===s.nodeName.toLowerCase()&&(s.className=s.className.replace(c,"").replace(/\s+/g," ")+" language-"+r);var i,o={element:e,language:r,grammar:a,code:e.textContent};function l(e){o.highlightedCode=e,O.hooks.run("before-insert",o),o.element.innerHTML=o.highlightedCode,O.hooks.run("after-highlight",o),O.hooks.run("complete",o),t&&t.call(o.element)}if(O.hooks.run("before-sanity-check",o),!o.code)return O.hooks.run("complete",o),void(t&&t.call(o.element));O.hooks.run("before-highlight",o),o.grammar?n&&u.Worker?((i=new Worker(O.filename)).onmessage=function(e){l(e.data)},i.postMessage(JSON.stringify({language:o.language,code:o.code,immediateClose:!0}))):l(O.highlight(o.code,o.grammar,o.language)):l(O.util.encode(o.code))},highlight:function(e,n,t){var r={code:e,grammar:n,language:t};return O.hooks.run("before-tokenize",r),r.tokens=O.tokenize(r.code,r.grammar),O.hooks.run("after-tokenize",r),N.stringify(O.util.encode(r.tokens),r.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var r in t)n[r]=t[r];delete n.rest}var a=new s;return B(a,a.head,e),function C(e,n,t,r,a,s){for(var i in t)if(t.hasOwnProperty(i)&&t[i]){var o=t[i];o=Array.isArray(o)?o:[o];for(var l=0;l<o.length;++l){if(s&&s.cause==i+","+l)return;var u,c=o[l],p=c.inside,d=!!c.lookbehind,g=!!c.greedy,m=0,f=c.alias;g&&!c.pattern.global&&(u=c.pattern.toString().match(/[imsuy]*$/)[0],c.pattern=RegExp(c.pattern.source,u+"g"));for(var h=c.pattern||c,b=r.next,y=a;b!==n.tail&&!(s&&y>=s.reach);y+=b.value.length,b=b.next){var v=b.value;if(n.length>e.length)return;if(!(v instanceof N)){var w,k,x,_,P,F,A=1;if(g&&b!=n.tail.prev){h.lastIndex=y;var S=h.exec(e);if(!S)break;var $=S.index+(d&&S[1]?S[1].length:0),j=S.index+S[0].length,E=y;for(E+=b.value.length;E<=$;)b=b.next,E+=b.value.length;if(E-=b.value.length,y=E,b.value instanceof N)continue;for(var z=b;z!==n.tail&&(E<j||"string"==typeof z.value);z=z.next)A++,E+=z.value.length;A--,v=e.slice(y,E),S.index-=y}else{h.lastIndex=0;var S=h.exec(v)}S&&(d&&(m=S[1]?S[1].length:0),$=S.index+m,w=S[0].slice(m),j=$+w.length,k=v.slice(0,$),x=v.slice(j),_=y+v.length,s&&_>s.reach&&(s.reach=_),P=b.prev,k&&(P=B(n,P,k),y+=k.length),T(n,P,A),F=new N(i,p?O.tokenize(w,p):w,f,w),b=B(n,P,F),x&&B(n,b,x),1<A&&C(e,n,t,b.prev,y,{cause:i+","+l,reach:_}))}}}}}(e,a,n,a.head,0),function(e){var n=[],t=e.head.next;for(;t!==e.tail;)n.push(t.value),t=t.next;return n}(a)},hooks:{all:{},add:function(e,n){var t=O.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=O.hooks.all[e];if(t&&t.length)for(var r,a=0;r=t[a++];)r(n)}},Token:N};function N(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=0|(r||"").length}function s(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function B(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function T(e,n,t){for(var r=n.next,a=0;a<t&&r!==e.tail;a++)r=r.next;(n.next=r).prev=n,e.length-=a}if(u.Prism=O,N.stringify=function o(e,n){if("string"==typeof e)return e;if(Array.isArray(e)){var t="";return e.forEach(function(e){t+=o(e,n)}),t}var r={type:e.type,content:o(e.content,n),tag:"span",classes:["token",e.type],attributes:{},language:n},a=e.alias;a&&(Array.isArray(a)?Array.prototype.push.apply(r.classes,a):r.classes.push(a)),O.hooks.run("wrap",r);var s="";for(var i in r.attributes)s+=" "+i+'="'+(r.attributes[i]||"").replace(/"/g,""")+'"';return"<"+r.tag+' class="'+r.classes.join(" ")+'"'+s+">"+r.content+"</"+r.tag+">"},!u.document)return u.addEventListener&&(O.disableWorkerMessageHandler||u.addEventListener("message",function(e){var n=JSON.parse(e.data),t=n.language,r=n.code,a=n.immediateClose;u.postMessage(O.highlight(r,O.languages[t],t)),a&&u.close()},!1)),O;var e,t=O.util.currentScript();function r(){O.manual||O.highlightAll()}return t&&(O.filename=t.src,t.hasAttribute("data-manual")&&(O.manual=!0)),O.manual||("loading"===(e=document.readyState)||"interactive"===e&&t&&t.defer?document.addEventListener("DOMContentLoaded",r):window.requestAnimationFrame?window.requestAnimationFrame(r):window.setTimeout(r,16)),O}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});void 0!==t&&t.exports&&(t.exports=e),void 0!==n&&(n.Prism=e)}).call(this)}).call(this,void 0!==y?y:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,n,t){var r,a;r=Prism,a=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char8_t|char16_t|char32_t|class|compl|concept|const|consteval|constexpr|constinit|const_cast|continue|co_await|co_return|co_yield|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|requires|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/,r.languages.cpp=r.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return a.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:a,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/}),r.languages.insertBefore("cpp","string",{"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),r.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)(?:[^;{}"'])+?(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:r.languages.extend("cpp",{})}}),r.languages.insertBefore("inside","operator",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},r.languages.cpp["base-clause"])},{}],5:[function(e,n,t){!function(t){function r(e,t){return e.replace(/<<(\d+)>>/g,function(e,n){return"(?:"+t[+n]+")"})}function a(e,n,t){return RegExp(r(e,n),t||"")}function e(e,n){for(var t=0;t<n;t++)e=e.replace(/<<self>>/g,function(){return"(?:"+e+")"});return e.replace(/<<self>>/g,"[^\\s\\S]")}var n="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",s="class enum interface struct",i="add alias and ascending async await by descending from get global group into join let nameof not notnull on or orderby partial remove select set unmanaged value when where where",o="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function l(e){return"\\b(?:"+e.trim().replace(/ /g,"|")+")\\b"}var u=l(s),c=RegExp(l(n+" "+s+" "+i+" "+o)),p=l(s+" "+i+" "+o),d=l(n+" "+s+" "+o),g=e(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),m=e(/\((?:[^()]|<<self>>)*\)/.source,2),f=/@?\b[A-Za-z_]\w*\b/.source,h=r(/<<0>>(?:\s*<<1>>)?/.source,[f,g]),b=r(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[p,h]),y=/\[\s*(?:,\s*)*\]/.source,v=r(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[b,y]),w=r(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[g,m,y]),k=r(/\(<<0>>+(?:,<<0>>+)+\)/.source,[w]),x=r(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[k,b,y]),_={keyword:c,punctuation:/[<>()?,.:[\]]/},P=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,F=/"(?:\\.|[^\\"\r\n])*"/.source,A=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:a(/(^|[^$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0},{pattern:a(/(^|[^@$\\])<<0>>/.source,[F]),lookbehind:!0,greedy:!0},{pattern:RegExp(P),greedy:!0,alias:"character"}],"class-name":[{pattern:a(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[b]),lookbehind:!0,inside:_},{pattern:a(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[f,x]),lookbehind:!0,inside:_},{pattern:a(/(\busing\s+)<<0>>(?=\s*=)/.source,[f]),lookbehind:!0},{pattern:a(/(\b<<0>>\s+)<<1>>/.source,[u,h]),lookbehind:!0,inside:_},{pattern:a(/(\bcatch\s*\(\s*)<<0>>/.source,[b]),lookbehind:!0,inside:_},{pattern:a(/(\bwhere\s+)<<0>>/.source,[f]),lookbehind:!0},{pattern:a(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[v]),lookbehind:!0,inside:_},{pattern:a(/\b<<0>>(?=\s+(?!<<1>>)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[x,d,f]),inside:_}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:ul|lu|[dflmu])?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:a(/([(,]\s*)<<0>>(?=\s*:)/.source,[f]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:a(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[f]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:a(/(\b(?:default|typeof|sizeof)\s*\(\s*)(?:[^()\s]|\s(?!\s*\))|<<0>>)*(?=\s*\))/.source,[m]),lookbehind:!0,alias:"class-name",inside:_},"return-type":{pattern:a(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[x,b]),inside:_,alias:"class-name"},"constructor-invocation":{pattern:a(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[x]),lookbehind:!0,inside:_,alias:"class-name"},"generic-method":{pattern:a(/<<0>>\s*<<1>>(?=\s*\()/.source,[f,g]),inside:{"function":a(/^<<0>>/.source,[f]),generic:{pattern:RegExp(g),alias:"class-name",inside:_}}},"type-list":{pattern:a(/\b((?:<<0>>\s+<<1>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>)(?:\s*,\s*(?:<<3>>|<<4>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[u,h,f,x,c.source]),lookbehind:!0,inside:{keyword:c,"class-name":{pattern:RegExp(x),greedy:!0,inside:_},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"}}}});var S=F+"|"+P,$=r(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[S]),j=e(r(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[$]),2),E=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,z=r(/<<0>>(?:\s*\(<<1>>*\))?/.source,[b,j]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:a(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[E,z]),lookbehind:!0,greedy:!0,inside:{target:{pattern:a(/^<<0>>(?=\s*:)/.source,[E]),alias:"keyword"},"attribute-arguments":{pattern:a(/\(<<0>>*\)/.source,[j]),inside:t.languages.csharp},"class-name":{pattern:RegExp(b),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var C=/:[^}\r\n]+/.source,O=e(r(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[$]),2),N=r(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[O,C]),B=e(r(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[S]),2),T=r(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[B,C]);function D(e,n){return{interpolation:{pattern:a(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[e]),lookbehind:!0,inside:{"format-string":{pattern:a(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[n,C]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:a(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[N]),lookbehind:!0,greedy:!0,inside:D(N,O)},{pattern:a(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[T]),lookbehind:!0,greedy:!0,inside:D(T,B)}]})}(Prism),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-]+/,"selector-function-argument":{pattern:/(\bselector\s*\((?!\s*\))\s*)(?:[^()]|\((?:[^()]|\([^()]*\))*\))+?(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{"function":/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},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 r,a,s;r=Prism,a=/\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|record|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,s=/\b[A-Z](?:\w*[a-z]\w*)?\b/,r.languages.java=r.languages.extend("clike",{"class-name":[s,/\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/],keyword:a,"function":[r.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}}),r.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),r.languages.insertBefore("java","class-name",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0},namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return a.source})),lookbehind:!0,inside:{punctuation:/\./}},generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":s,keyword:a,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|set)(?=\s*[\[$\w\xA0-\uFFFF])|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|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]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-flags":/[a-z]+$/,"regex-delimiter":/^\/|\/$/}},"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)(?:[^()]|\([^()]*\))+?(?=\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(r,a,e,s){var i;r.language===a&&(i=r.tokenStack=[],r.code=r.code.replace(e,function(e){if("function"==typeof s&&!s(e))return e;for(var n,t=i.length;-1!==r.code.indexOf(n=b(a,t));)++t;return i[t]=e,n}),r.grammar=y.languages.markup)}},tokenizePlaceholders:{value:function(d,g){var m,f;d.language===g&&d.tokenStack&&(d.grammar=y.languages[g],m=0,f=Object.keys(d.tokenStack),function h(e){for(var n=0;n<e.length&&!(m>=f.length);n++){var t,r,a,s,i,o,l,u,c,p=e[n];"string"==typeof p||p.content&&"string"==typeof p.content?(t=f[m],r=d.tokenStack[t],a="string"==typeof p?p:p.content,s=b(g,t),-1<(i=a.indexOf(s))&&(++m,o=a.substring(0,i),l=new y.Token(g,y.tokenize(r,d.grammar),"language-"+g,r),u=a.substring(i+s.length),c=[],o&&c.push.apply(c,h([o])),c.push(l),u&&c.push.apply(c,h([u])),"string"==typeof p?e.splice.apply(e,[n,1].concat(c)):p.content=c)):p.content&&h(p.content)}return e}(d.tokens))}}})},{}],10:[function(e,n,t){Prism.languages.markup={comment:/<!--[\s\S]*?-->/,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/,name:/[^\s<>'"]+/}},cdata:/<!\[CDATA\[[\s\S]*?]]>/i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,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:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},t.cdata=/^<!\[CDATA\[|\]\]>$/i;var r={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:t}};r["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var a={};a[e]={pattern:RegExp(/(<__[\s\S]*?>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:r},Prism.languages.insertBefore("markup","cdata",a)}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml},{}],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|match|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+(?:\[[^\r\n\[\]]+\]|->\w+)*)/,lookbehind:!0,inside:n.languages.php};n.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\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){/<\?/.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:RegExp(/%r/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[gim]{0,3}/.source,/\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/.source,/\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/.source,/\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/.source,/<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/.source].join("|")+")"),greedy:!0,inside:{interpolation:n}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\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:RegExp(/%[qQiIwWxs]?/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S])*\)/.source,/\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S])*\]/.source,/<(?:[^<>\\]|\\[\s\S])*>/.source].join("|")+")"),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 r=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:r}},{"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 a=window.Prism;window.Prism=e}(undefined,h,b,undefined);var v=b.exports.boltExport,w=function(e){return f.Prism&&e.getParam("codesample_global_prismjs",!1,"boolean")?f.Prism:v},k=function(e){var n=e.selection?e.selection.getNode():null;return g(n)?c.some(n):c.none()},x=function(s){var t,e=s.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"}],n=p(e).fold(function(){return""},function(e){return e.value}),r=(t=n,k(s).fold(function(){return t},function(e){var n=e.className.match(/language-(\w+)/);return n?n[1]:t})),a=k(s).fold(function(){return""},function(e){return e.textContent});s.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:e},{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:a},onSubmit:function(e){var n,t,r,a=e.getData();n=s,t=a.language,r=a.code,n.undoManager.transact(function(){var e=k(n);return r=d.DOM.encode(r),e.fold(function(){n.insertContent('<pre id="__new" class="language-'+t+'">'+r+"</pre>"),n.selection.select(n.$("#__new").removeAttr("id")[0])},function(e){n.dom.setAttrib(e,"class","language-"+t),e.innerHTML=r,w(n).highlightElement(e),n.selection.select(e)})}),e.close()}})},_=function(r){r.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:function(){return x(r)},onSetup:function(t){var e=function(){var e,n;t.setActive((n=(e=r).selection.getStart(),e.dom.is(n,'pre[class*="language-"]')))};return r.on("NodeChange",e),function(){return r.off("NodeChange",e)}}}),r.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:function(){return x(r)}})};r.add("codesample",function(n){var t,a,r;a=(t=n).$,t.on("PreProcess",function(e){a("pre[contenteditable=false]",e.node).filter(m(g)).each(function(e,n){var t=a(n),r=n.textContent;t.attr("class",a.trim(t.attr("class"))),t.removeAttr("contentEditable"),t.empty().append(a("<code></code>").each(function(){this.textContent=r}))})}),t.on("SetContent",function(){var e=a("pre").filter(m(g)).filter(function(e,n){return"false"!==n.contentEditable});e.length&&t.undoManager.transact(function(){e.each(function(e,n){a(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),w(t).highlightElement(n),n.className=a.trim(n.className)})})}),_(n),(r=n).addCommand("codesample",function(){var e=r.selection.getNode();r.selection.isCollapsed()||g(e)?x(r):r.formatter.toggle("code")}),n.on("dblclick",function(e){g(e.target)&&x(n)})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("colorpicker",function(){console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("contextmenu",function(){console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var n,t,e,o,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(n,t){var e,o=n.dom,r=n.selection.getSelectedBlocks();r.length&&(e=o.getAttrib(r[0],"dir"),u.each(r,function(n){o.getParent(n.parentNode,'*[dir="'+t+'"]',o.getRoot())||o.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},c=function(n){return function(){return n}},f=c(!1),d=c(!0),l=function(){return m},m=(n=function(n){return n.isNone()},{fold:function(n,t){return n()},is:f,isSome:f,isNone:d,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:c(null),getOrUndefined:c(undefined),or:e,orThunk:t,map:l,each:function(){},bind:l,exists:f,forall:d,filter:l,equals:n,equals_:n,toArray:function(){return[]},toString:c("none()")}),a=function(e){var n=c(e),t=function(){return r},o=function(n){return n(e)},r={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:d,isNone:f,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return a(n(e))},each:function(n){n(e)},bind:o,exists:o,forall:o,filter:function(n){return n(e)?r:m},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 r},s={some:a,none:l,from:function(n){return null===n||n===undefined?m:a(n)}},g=(o="function",function(n){return typeof n===o}),h=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:n}},y={fromHtml:function(n,t){var e=(t||document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return h(e.childNodes[0])},fromTag:function(n,t){var e=(t||document).createElement(n);return h(e)},fromText:function(n,t){var e=(t||document).createTextNode(n);return h(e)},fromDom:h,fromPoint:function(n,t,e){return s.from(n.dom.elementFromPoint(t,e)).map(h)}},v=("undefined"!=typeof window||Function("return this;")(),function(t){return function(n){return n.dom.nodeType===t}}),p=v(3),T=v(9),N=v(11),D=g(Element.prototype.attachShadow)&&g(Node.prototype.getRootNode)?function(n){return y.fromDom(n.dom.getRootNode())}:function(n){return T(n)?n:(t=n,y.fromDom(t.dom.ownerDocument));var t},w=function(n){var t=D(n);return N(t)?s.some(t):s.none()},O=function(n){return y.fromDom(n.dom.host)},C=function(n){var t=p(n)?n.dom.parentNode:n.dom;if(t===undefined||null===t||null===t.ownerDocument)return!1;var e,o,r=t.ownerDocument;return w(y.fromDom(t)).fold(function(){return r.body.contains(t)},(e=C,o=O,function(n){return e(o(n))}))},S=function(n,t){return(e=n).style!==undefined&&g(e.style.getPropertyValue)?n.style.getPropertyValue(t):"";var e},L=function(n){return"rtl"===(e="direction",o=(t=n).dom,""!==(r=window.getComputedStyle(o).getPropertyValue(e))||C(t)?r:S(o,e))?"rtl":"ltr";var t,e,o,r},R=function(t,o){return function(e){var n=function(n){var t=y.fromDom(n.element);e.setActive(L(t)===o)};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}};r.add("directionality",function(n){var t,e;(t=n).addCommand("mceDirectionLTR",function(){i(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){i(t,"rtl")}),(e=n).ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return e.execCommand("mceDirectionLTR")},onSetup:R(e,"ltr")}),e.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return e.execCommand("mceDirectionRTL")},onSetup:R(e,"rtl")})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var u,t,n,e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(){return(o=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},m=function(t){var n=t;return{get:function(){return n},set:function(t){n=t}}},a=Object.prototype.hasOwnProperty,c=function(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var e={},r=0;r<t.length;r++){var o=t[r];for(var i in o)a.call(o,i)&&(e[i]=u(e[i],o[i]))}return e},i=function(t){return function(){return t}},l=i(!(u=function(t,n){return n})),s=i(!0),f=function(){return g},g=(t=function(t){return t.isNone()},{fold:function(t,n){return t()},is:l,isSome:l,isNone:s,getOr:e=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:e,orThunk:n,map:f,each:function(){},bind:f,exists:l,forall:s,filter:f,equals:t,equals_:t,toArray:function(){return[]},toString:i("none()")}),d=function(e){var t=i(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:s,isNone:l,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return d(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:g},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(l,function(t){return n(e,t)})}};return o},h={some:d,none:f,from:function(t){return null===t||t===undefined?g:d(t)}},y=Object.keys,v=Object.hasOwnProperty,p=function(t,n){for(var e=y(t),r=0,o=e.length;r<o;r++){var i=e[r];n(t[i],i)}},b=function(t,r){var o={};return p(t,function(t,n){var e=r(t,n);o[e.k]=e.v}),o},w=function(t,n){return-1!==t.indexOf(n)},O=tinymce.util.Tools.resolve("tinymce.Resource"),C=tinymce.util.Tools.resolve("tinymce.util.Delay"),j=tinymce.util.Tools.resolve("tinymce.util.Promise"),k="All",A={symbols:"Symbols",people:"People",animals_and_nature:"Animals and Nature",food_and_drink:"Food and Drink",activity:"Activity",travel_and_places:"Travel and Places",objects:"Objects",flags:"Flags",user:"User Defined"},_=function(t,n){return e=t,r=n,v.call(e,r)?t[n]:n;var e,r},T=function(t){var e,n=t.getParam("emoticons_append",{},"object");return e=function(t){return o({keywords:[],category:"user"},t)},b(n,function(t,n){return{k:n,v:e(t,n)}})},P=function(e,o,t){var r=m(h.none()),n=m(h.none()),f=e.getParam("emoticons_images_url","https://twemoji.maxcdn.com/v/13.0.1/72x72/","string"),i=function(t){var l={},s=[];p(t,function(t,n){var e,r,o,i,u,a={title:n,keywords:t.keywords,"char":(r=(e=t)["char"],u=0,i="<img",(o=r).length>=i.length&&o.substr(u,u+i.length)===i?e["char"].replace(/src="([^"]+)"/,function(t,n){return'src="'+f+n+'"'}):e["char"]),category:_(A,t.category)},c=l[a.category]!==undefined?l[a.category]:[];l[a.category]=c.concat([a]),s.push(a)}),r.set(h.some(l)),n.set(h.some(s))};e.on("init",function(){O.load(t,o).then(function(t){var n=T(e);i(c(t,n))},function(t){console.log("Failed to load emoticons: "+t),r.set(h.some({})),n.set(h.some([]))})});var u=function(){return n.get().getOr([])},a=function(){return r.get().isSome()&&n.get().isSome()};return{listCategories:function(){return[k].concat(y(r.get().getOr({})))},hasLoaded:a,waitForLoad:function(){return a()?j.resolve(!0):new j(function(t,n){var e=15,r=C.setInterval(function(){a()?(C.clearInterval(r),t(!0)):--e<0&&(console.log("Could not load emojis from url: "+o),C.clearInterval(r),n(!1))},100)})},listAll:u,listCategory:function(n){return n===k?u():r.get().bind(function(t){return h.from(t[n])}).getOr([])}}},x=function(t,n,e){for(var r=[],o=n.toLowerCase(),i=e.fold(function(){return l},function(n){return function(t){return n<=t}}),u=0;u<t.length&&(0!==n.length&&!function(t,n){return w(t.title.toLowerCase(),n)||function(t,n){for(var e=0,r=t.length;e<r;e++){if(n(t[e],e))return!0}return!1}(t.keywords,function(t){return w(t.toLowerCase(),n)})}(t[u],o)||(r.push({value:t[u]["char"],text:t[u].title,icon:t[u]["char"]}),!i(r.length)));u++);return r},D="pattern",L=function(o,u){var e,r,i,t={pattern:"",results:x(u.listAll(),"",h.some(300))},a=m(k),c=(e=function(t){var n,e,r,o,i;e=(n=t).getData(),r=a.get(),o=u.listCategory(r),i=x(o,e[D],r===k?h.some(300):h.none()),n.setData({results:i})},r=200,i=null,{cancel:function(){null!==i&&(clearTimeout(i),i=null)},throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null!==i&&clearTimeout(i),i=setTimeout(function(){e.apply(null,t),i=null},r)}}),n={label:"Search",type:"input",name:D},l={type:"collection",name:"results"},s=function(){return{title:"Emoticons",size:"normal",body:{type:"tabpanel",tabs:function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o)}return r}(u.listCategories(),function(t){return{title:t,name:t,items:[n,l]}})},initialData:t,onTabChange:function(t,n){a.set(n.newTabName),c.throttle(t)},onChange:c.throttle,onAction:function(t,n){var e,r;"results"===n.name&&(e=o,r=n.value,e.insertContent(r),t.close())},buttons:[{type:"cancel",text:"Close",primary:!0}]}},f=o.windowManager.open(s());f.focus(D),u.hasLoaded()||(f.block("Loading emoticons..."),u.waitForLoad().then(function(){f.redial(s()),c.throttle(f),f.focus(D),f.unblock()})["catch"](function(t){f.redial({title:"Emoticons",body:{type:"panel",items:[{type:"alertbanner",level:"error",icon:"warning",text:"<p>Could not load emoticons</p>"}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),f.focus(D),f.unblock()}))};r.add("emoticons",function(t,n){var e,r,o,i,u,a,c,l,s,f=(r=n,o=(e=t).getParam("emoticons_database","emojis","string"),e.getParam("emoticons_database_url",r+"/js/"+o+e.suffix+".js","string")),m=t.getParam("emoticons_database_id","tinymce.plugins.emoticons","string"),g=P(t,f,m);u=g,a=function(){return L(i,u)},(i=t).ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:a}),i.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:a}),l=g,(c=t).ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(n,e){return l.waitForLoad().then(function(){var t=l.listAll();return x(t,n,h.some(e))})},onAction:function(t,n,e){c.selection.setRng(n),c.insertContent(e),t.hide()}}),(s=t).on("PreInit",function(){s.parser.addAttributeFilter("data-emoticon",function(t){!function(t,n){for(var e=0,r=t.length;e<r;e++){n(t[e],e)}}(t,function(t){t.attr("data-mce-resize","false"),t.attr("data-mce-placeholder","1")})})})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"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<l;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},p=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=tinymce.util.Tools.resolve("tinymce.html.DomParser"),m=tinymce.util.Tools.resolve("tinymce.html.Node"),f=tinymce.util.Tools.resolve("tinymce.html.Serializer"),h=function(e){return e.getParam("fullpage_hide_in_source_view")},i=function(e){return e.getParam("fullpage_default_encoding")},g=function(e){return e.getParam("fullpage_default_font_family")},y=function(e){return e.getParam("fullpage_default_font_size")},v=function(e){return t({validate:!1,root_name:"#document"}).parse(e,{format:"xhtml"})},d=function(l,i){var e,t,n,o,r,a,c=(e=l,t=i.get(),r=v(t),(a={}).fontface=g(e),a.fontsize=y(e),7===(n=r.firstChild).type&&(a.xml_pi=!0,(o=/encoding="([^"]+)"/.exec(n.value))&&(a.docencoding=o[1])),(n=r.getAll("#doctype")[0])&&(a.doctype="<!DOCTYPE"+n.value+">"),(n=r.getAll("title")[0])&&n.firstChild&&(a.title=n.firstChild.value),p.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=[],p.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=e.dom;function i(e,t,n){e.attr(t,n||undefined)}function a(e){c.firstChild?c.insert(e,c.firstChild):c.append(e)}var c,s=v(t);(c=s.getAll("head")[0])||(r=s.getAll("html")[0],c=new m("head",1),r.firstChild?r.insert(c,r.firstChild,!0):r.append(c)),r=s.firstChild,o.xml_pi?(n='version="1.0"',o.docencoding&&(n+=' encoding="'+o.docencoding+'"'),7!==r.type&&(r=new m("xml",7),s.insert(r,s.firstChild,!0)),r.value=n):r&&7===r.type&&r.remove(),r=s.getAll("#doctype")[0],o.doctype?(r||(r=new m("#doctype",10),o.xml_pi?s.insert(r,s.firstChild):a(r)),r.value=o.doctype.substring(9,o.doctype.length-1)):r&&r.remove(),r=null,p.each(s.getAll("meta"),function(e){"Content-Type"===e.attr("http-equiv")&&(r=e)}),o.docencoding?(r||((r=new m("meta",1)).attr("http-equiv","Content-Type"),r.shortEnded=!0,a(r)),r.attr("content","text/html; charset="+o.docencoding)):r&&r.remove(),r=s.getAll("title")[0],o.title?(r?r.empty():a(r=new m("title",1)),r.append(new m("#text",3)).value=o.title):r&&r.remove(),p.each("keywords,description,author,copyright,robots".split(","),function(e){for(var t,n=s.getAll("meta"),l=o[e],i=0;i<n.length;i++)if((t=n[i]).attr("name")===e)return void(l?t.attr("content",l):t.remove());l&&((r=new m("meta",1)).attr("name",e),r.attr("content",l),r.shortEnded=!0,a(r))});var d={};p.each(s.getAll("link"),function(e){"stylesheet"===e.attr("rel")&&(d[e.attr("href")]=e)}),p.each(o.stylesheets,function(e){d[e]||((r=new m("link",1)).attr({rel:"stylesheet",text:"text/css",href:e}),r.shortEnded=!0,a(r)),delete d[e]}),p.each(d,function(e){e.remove()}),(r=s.getAll("body")[0])&&(i(r,"dir",o.langdir),i(r,"style",o.style),i(r,"vlink",o.visited_color),i(r,"link",o.link_color),i(r,"alink",o.active_color),l.setAttribs(e.getBody(),{style:o.style,dir:o.dir,vLink:o.visited_color,link:o.link_color,aLink:o.active_color})),(r=s.getAll("html")[0])&&(i(r,"lang",o.langcode),i(r,"xml:lang",o.langcode)),c.firstChild||c.remove();var u=f({validate:!1,indent:!0,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(s);return u.substring(0,u.indexOf("</body>"))}(l,p.extend(c,t),i.get());i.set(n),e.close()}})},_=p.each,b=function(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})},x=function(e,t,n,l){var i,o,r,a,c,s,d,u,m,f="",g=e.dom;l.selection||(a=e.getParam("protect"),c=l.content,p.each(a,function(e){c=c.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})}),r=c,"raw"===l.format&&t.get()||l.source_view&&h(e)||(0!==r.length||l.source_view||(r=p.trim(t.get())+"\n"+p.trim(r)+"\n"+p.trim(n.get())),-1!==(i=(r=r.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("<body"))?(i=r.indexOf(">",i),t.set(b(r.substring(0,i+1))),-1===(o=r.indexOf("</body",i))&&(o=r.length),l.content=p.trim(r.substring(i+1,o)),n.set(b(r.substring(o)))):(t.set(k(e)),n.set("\n</body>\n</html>")),s=v(t.get()),_(s.getAll("style"),function(e){e.firstChild&&(f+=e.firstChild.value)}),(d=s.getAll("body")[0])&&g.setAttribs(e.getBody(),{style:d.attr("style")||"",dir:d.attr("dir")||"",vLink:d.attr("vlink")||"",link:d.attr("link")||"",aLink:d.attr("alink")||""}),g.remove("fullpage_styles"),u=e.getDoc().getElementsByTagName("head")[0],f&&g.add(u,"style",{id:"fullpage_styles"}).appendChild(document.createTextNode(f)),m={},p.each(u.getElementsByTagName("link"),function(e){"stylesheet"===e.rel&&e.getAttribute("data-mce-fullpage")&&(m[e.href]=e)}),p.each(s.getAll("link"),function(e){var t=e.attr("href");if(!t)return!0;m[t]||"stylesheet"!==e.attr("rel")||g.add(u,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete m[t]}),p.each(m,function(e){e.parentNode.removeChild(e)})))},k=function(e){var t,n="",l="";return e.getParam("fullpage_default_xml_pi")&&(n+='<?xml version="1.0" encoding="'+(i(e)||"ISO-8859-1")+'" ?>\n'),n+=e.getParam("fullpage_default_doctype","<!DOCTYPE html>"),n+="\n<html>\n<head>\n",(t=e.getParam("fullpage_default_title"))&&(n+="<title>"+t+"</title>\n"),(t=i(e))&&(n+='<meta http-equiv="Content-Type" content="text/html; charset='+t+'" />\n'),(t=g(e))&&(l+="font-family: "+t+";"),(t=y(e))&&(l+="font-size: "+t+";"),(t=e.getParam("fullpage_default_text_color"))&&(l+="color: "+t+";"),n+="</head>\n<body"+(l?' style="'+l+'"':"")+">\n"},C=function(e,t,n,l){"html"!==l.format||l.selection||l.source_view&&h(e)||(l.content=(p.trim(t)+"\n"+p.trim(l.content)+"\n"+p.trim(n)).replace(/<!--mce:protected ([\s\S]*?)-->/g,function(e,t){return unescape(t)}))};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){x(i,o,r,e)}),i.on("GetContent",function(e){C(i,o.get(),r.get(),e)})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var c=function(n){var e=n;return{get:function(){return e},set:function(n){e=n}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n){return{isFullscreen:function(){return null!==n.get()}}},e=function(){},u=function(n){return function(){return n}};var t,r,o,l=u(!1),f=u(!0),a=function(){return d},d=(t=function(n){return n.isNone()},{fold:function(n,e){return n()},is:l,isSome:l,isNone:f,getOr:o=function(n){return n},getOrThunk:r=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:o,orThunk:r,map:a,each:e,bind:a,exists:l,forall:f,filter:a,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),s=function(t){var n=u(t),e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:f,isNone:l,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return s(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){return n(t)?o:d},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(l,function(n){return e(t,n)})}};return o},S={some:s,none:a,from:function(n){return null===n||n===undefined?d:s(n)}},m=function(){return n=function(n){return n.unbind()},e=c(S.none()),t=function(){return e.get().each(n)},{clear:function(){t(),e.set(S.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(S.some(n))}};var n,e,t},h=function(r){return function(n){return t=typeof(e=n),(null===e?"null":"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t)===r;var e,t}},g=function(e){return function(n){return typeof n===e}},p=h("string"),v=h("array"),y=g("boolean"),w=function(n){return!(null===(e=n)||e===undefined);var e},b=g("function"),E=g("number"),F=Array.prototype.push,T=function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var u=n[o];r[o]=e(u,o)}return r},x=function(n,e){for(var t=0,r=n.length;t<r;t++){e(n[t],t)}},D=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var u=n[r];e(u,r)&&t.push(u)}return t},k=function(n,e){return function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!v(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);F.apply(e,n[t])}return e}(T(n,e))},C=function(n){return e=n,(t=0)<=t&&t<e.length?S.some(e[t]):S.none();var e,t},O=Object.keys,A=function(n){return n.style!==undefined&&b(n.style.getPropertyValue)},N=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:n}},M={fromHtml:function(n,e){var t=(e||document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return N(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return N(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return N(t)},fromDom:N,fromPoint:function(n,e,t){return S.from(n.dom.elementFromPoint(e,t)).map(N)}},P=("undefined"!=typeof window||Function("return this;")(),function(e){return function(n){return n.dom.nodeType===e}}),L=P(1),q=P(3),H=P(9),R=P(11),V=function(n,e){var t=n.dom;if(1!==t.nodeType)return!1;var r=t;if(r.matches!==undefined)return r.matches(e);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(e);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(e);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},W=function(n){return M.fromDom(n.dom.ownerDocument)},B=function(t){var n;return n=t,S.from(n.dom.parentNode).map(M.fromDom).map(j).map(function(n){return D(n,function(n){return e=n,t.dom!==e.dom;var e})}).getOr([])},j=function(n){return T(n.dom.childNodes,M.fromDom)},z=b(Element.prototype.attachShadow)&&b(Node.prototype.getRootNode),I=u(z),U=z?function(n){return M.fromDom(n.dom.getRootNode())}:function(n){return H(n)?n:W(n)},_=function(n){var e=U(n);return R(e)?S.some(e):S.none()},K=function(n){return M.fromDom(n.dom.host)},X=function(n){return w(n.dom.shadowRoot)},Y=function(n){var e=q(n)?n.dom.parentNode:n.dom;if(e===undefined||null===e||null===e.ownerDocument)return!1;var t,r,o=e.ownerDocument;return _(M.fromDom(e)).fold(function(){return o.body.contains(e)},(t=Y,r=K,function(n){return t(r(n))}))},G=function(n,e,t){!function(n,e,t){if(!(p(t)||y(t)||E(t)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")}(n.dom,e,t)},J=function(n,e){var t=n.dom.getAttribute(e);return null===t?undefined:t},Q=function(n,e){n.dom.removeAttribute(e)},Z=function(n,e){var t=n.dom;!function(n,e){for(var t=O(n),r=0,o=t.length;r<o;r++){var u=t[r];e(n[u],u)}}(e,function(n,e){!function(n,e,t){if(!p(t))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);A(n)&&n.style.setProperty(e,t)}(t,e,n)})},$=function(n,e){return A(n)?n.style.getPropertyValue(e):""},nn=function(n){var t,r,e=M.fromDom(function(n){if(I()&&w(n.target)){var e=M.fromDom(n.target);if(L(e)&&X(e)&&n.composed&&n.composedPath){var t=n.composedPath();if(t)return C(t)}}return S.from(n.target)}(n).getOr(n.target)),o=function(){return n.stopPropagation()},u=function(){return n.preventDefault()},i=(t=u,r=o,function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,n))});return{target:e,x:n.clientX,y:n.clientY,stop:o,prevent:u,kill:i,raw:n}},en=function(n,e,t,r,o){var u,i,c=(u=t,i=r,function(n){u(n)&&i(nn(n))});return n.dom.addEventListener(e,c,o),{unbind:function(r){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=o.concat(n);return r.apply(null,t)}}(tn,n,e,c,o)}},tn=function(n,e,t,r){n.dom.removeEventListener(e,t,r)},rn=f,on=function(n,e,t){return en(n,e,rn,t,!1)},un=function(t,r){return{left:t,top:r,translate:function(n,e){return un(t+n,r+e)}}},cn=un,ln=function(n){var e=n===undefined?window:n;return S.from(e.visualViewport)},fn=function(n,e,t,r){return{x:n,y:e,width:t,height:r,right:n+t,bottom:e+r}},an=function(n){var e,t,r,o,u=n===undefined?window:n,i=u.document,c=(e=M.fromDom(i),t=e!==undefined?e.dom:document,r=t.body.scrollLeft||t.documentElement.scrollLeft,o=t.body.scrollTop||t.documentElement.scrollTop,cn(r,o));return ln(u).fold(function(){var n=u.document.documentElement,e=n.clientWidth,t=n.clientHeight;return fn(c.left,c.top,e,t)},function(n){return fn(Math.max(n.pageLeft,c.left),Math.max(n.pageTop,c.top),n.width,n.height)})},dn=function(t,r,n){return ln(n).map(function(n){var e=function(n){return r(nn(n))};return n.addEventListener(t,e),{unbind:function(){return n.removeEventListener(t,e)}}}).getOrThunk(function(){return{unbind:e}})},sn=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),mn=tinymce.util.Tools.resolve("tinymce.Env"),hn=tinymce.util.Tools.resolve("tinymce.util.Delay"),gn=function(n,e){n.fire("FullscreenStateChanged",{state:e})},pn=function(n){return n.getParam("fullscreen_native",!1,"boolean")},vn=function(n){var e=M.fromDom(n.getElement());return _(e).map(K).getOrThunk(function(){return function(n){var e=n.dom.body;if(null===e||e===undefined)throw new Error("Body is not available yet");return M.fromDom(e)}(W(e))})},yn=function(n){return n.dom===((e=W(n).dom).fullscreenElement!==undefined?e.fullscreenElement:e.msFullscreenElement!==undefined?e.msFullscreenElement:e.webkitFullscreenElement!==undefined?e.webkitFullscreenElement:null);var e},wn=function(n,e,t){return D(function(n,e){for(var t=b(e)?e:l,r=n.dom,o=[];null!==r.parentNode&&r.parentNode!==undefined;){var u=r.parentNode,i=M.fromDom(u);if(o.push(i),!0===t(i))break;r=u}return o}(n,t),e)},bn=function(n){return e=n,o=t===undefined?document:t.dom,1!==(r=o).nodeType&&9!==r.nodeType&&11!==r.nodeType||0===r.childElementCount?[]:T(o.querySelectorAll(e),M.fromDom);var e,t,r,o},Sn=function(n,e){return t=function(n){return V(n,e)},D(B(n),t);var t},En="data-ephox-mobile-fullscreen-style",Fn="position:absolute!important;",Tn="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",xn=mn.os.isAndroid(),Dn=function(n){var e,t,r,o,u=(t="background-color",r=(e=n).dom,""!==(o=window.getComputedStyle(r).getPropertyValue(t))||Y(e)?o:$(r,t));return u!==undefined&&""!==u?"background-color:"+u+"!important":"background-color:rgb(255,255,255)!important;"},kn=function(o,n,e){var t,r,u=function(r){return function(n){var e=J(n,"style"),t=e===undefined?"no-styles":e.trim();t!==r&&(G(n,En,t),Z(n,o.parseStyle(r)))}},i=(t="*",wn(n,function(n){return V(n,t)},r)),c=k(i,function(n){return Sn(n,"*:not(.tox-silver-sink)")}),l=Dn(e);x(c,u("display:none!important;")),x(i,u(Fn+Tn+l)),u((!0===xn?"":Fn)+Tn+l)(n)},Cn=sn.DOM,On=ln().fold(function(){return{bind:e,unbind:e}},function(e){var t,r=(t=c(S.none()),{clear:function(){return t.set(S.none())},set:function(n){return t.set(S.some(n))},isSet:function(){return t.get().isSome()},on:function(n){return t.get().each(n)}}),o=m(),u=m(),i=hn.throttle(function(){document.body.scrollTop=0,document.documentElement.scrollTop=0,window.requestAnimationFrame(function(){r.on(function(n){return Z(n,{top:e.offsetTop+"px",left:e.offsetLeft+"px",height:e.height+"px",width:e.width+"px"})})})},50);return{bind:function(n){r.set(n),i(),o.set(dn("resize",i)),u.set(dn("scroll",i))},unbind:function(){r.on(function(){o.clear(),u.clear()}),r.clear()}}}),An=function(e,r){var n,t,o,u,i,c,l,f=document.body,a=document.documentElement,d=e.getContainer(),s=M.fromDom(d),m=vn(e),h=r.get(),g=M.fromDom(e.getBody()),p=mn.deviceType.isTouch(),v=d.style,y=e.iframeElement.style,w=function(e){e(f,"tox-fullscreen"),e(a,"tox-fullscreen"),e(d,"tox-fullscreen"),_(s).map(function(n){return K(n).dom}).each(function(n){e(n,"tox-fullscreen"),e(n,"tox-shadowhost")})},b=function(){var t,n;p&&(t=e.dom,n=bn("["+En+"]"),x(n,function(n){var e=J(n,En);"no-styles"!==e?Z(n,t.parseStyle(e)):Q(n,"style"),Q(n,En)})),w(Cn.removeClass),On.unbind(),S.from(r.get()).each(function(n){return n.fullscreenChangeHandler.unbind()})};h?(h.fullscreenChangeHandler.unbind(),pn(e)&&yn(m)&&(u=W(m),(i=u.dom).exitFullscreen?i.exitFullscreen():i.msExitFullscreen?i.msExitFullscreen():i.webkitCancelFullScreen&&i.webkitCancelFullScreen()),y.width=h.iframeWidth,y.height=h.iframeHeight,v.width=h.containerWidth,v.height=h.containerHeight,v.top=h.containerTop,v.left=h.containerLeft,o=h.scrollPos,window.scrollTo(o.x,o.y),r.set(null),gn(e,!1),b(),e.off("remove",b)):(n=on(W(m),document.fullscreenElement!==undefined?"fullscreenchange":document.msFullscreenElement!==undefined?"MSFullscreenChange":document.webkitFullscreenElement!==undefined?"webkitfullscreenchange":"fullscreenchange",function(n){pn(e)&&(yn(m)||null===r.get()||An(e,r))}),t={scrollPos:{x:(l=an(window)).x,y:l.y},containerWidth:v.width,containerHeight:v.height,containerTop:v.top,containerLeft:v.left,iframeWidth:y.width,iframeHeight:y.height,fullscreenChangeHandler:n},p&&kn(e.dom,s,g),y.width=y.height="100%",v.width=v.height="",w(Cn.addClass),On.bind(s),e.on("remove",b),r.set(t),pn(e)&&((c=m.dom).requestFullscreen?c.requestFullscreen():c.msRequestFullscreen?c.msRequestFullscreen():c.webkitRequestFullScreen&&c.webkitRequestFullScreen()),gn(e,!0))},Nn=function(t,r){return function(e){e.setActive(null!==r.get());var n=function(n){return e.setActive(n.state)};return t.on("FullscreenStateChanged",n),function(){return t.off("FullscreenStateChanged",n)}}};n.add("fullscreen",function(n){var e,t,r,o,u=c(null);return n.inline||(t=u,(e=n).addCommand("mceFullScreen",function(){An(e,t)}),o=u,(r=n).ui.registry.addToggleMenuItem("fullscreen",{text:"Fullscreen",icon:"fullscreen",shortcut:"Meta+Shift+F",onAction:function(){return r.execCommand("mceFullScreen")},onSetup:Nn(r,o)}),r.ui.registry.addToggleButton("fullscreen",{tooltip:"Fullscreen",icon:"fullscreen",onAction:function(){return r.execCommand("mceFullScreen")},onSetup:Nn(r,o)}),n.addShortcut("Meta+Shift+F","","mceFullScreen")),i(u)})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e,t,n,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=function(){return(m=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=function(e){return function(){return e}},r=i(!1),s=i(!0),o=function(){return l},l=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:r,isSome:r,isNone:s,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:i(null),getOrUndefined:i(undefined),or:n,orThunk:t,map:o,each:function(){},bind:o,exists:r,forall:s,filter:o,equals:e,equals_:e,toArray:function(){return[]},toString:i("none()")}),c=function(n){var e=i(n),t=function(){return o},a=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:s,isNone:r,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return c(e(n))},each:function(e){e(n)},bind:a,exists:a,forall:a,filter:function(e){return e(n)?o:l},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(r,function(e){return t(n,e)})}};return o},d={some:c,none:o,from:function(e){return null===e||e===undefined?l:c(e)}},u=Array.prototype.indexOf,h=function(e,t){return n=e,a=t,-1<u.call(n,a);var n,a},p=function(e,t){for(var n=e.length,a=new Array(n),o=0;o<n;o++){var i=e[o];a[o]=t(i,o)}return a},g=function(e,t){return function(e,t,n){for(var a=0,o=e.length;a<o;a++){var i=e[a];if(t(i,a))return d.some(i);if(n(i,a))break}return d.none()}(e,t,r)},f=Object.keys,b=Object.hasOwnProperty,y=function(e,t){return b.call(e,t)},k=tinymce.util.Tools.resolve("tinymce.Env"),v=function(e){var n=k.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl ",access:"Shift + Alt "},t=e.split("+"),a=p(t,function(e){var t=e.toLowerCase().trim();return y(n,t)?n[t]:e});return k.mac?a.join("").replace(/\s/,""):a.join("+")},w=[{shortcuts:["Meta + B"],action:"Bold"},{shortcuts:["Meta + I"],action:"Italic"},{shortcuts:["Meta + U"],action:"Underline"},{shortcuts:["Meta + A"],action:"Select all"},{shortcuts:["Meta + Y","Meta + Shift + Z"],action:"Redo"},{shortcuts:["Meta + Z"],action:"Undo"},{shortcuts:["Access + 1"],action:"Heading 1"},{shortcuts:["Access + 2"],action:"Heading 2"},{shortcuts:["Access + 3"],action:"Heading 3"},{shortcuts:["Access + 4"],action:"Heading 4"},{shortcuts:["Access + 5"],action:"Heading 5"},{shortcuts:["Access + 6"],action:"Heading 6"},{shortcuts:["Access + 7"],action:"Paragraph"},{shortcuts:["Access + 8"],action:"Div"},{shortcuts:["Access + 9"],action:"Address"},{shortcuts:["Alt + 0"],action:"Open help dialog"},{shortcuts:["Alt + F9"],action:"Focus to menubar"},{shortcuts:["Alt + F10"],action:"Focus to toolbar"},{shortcuts:["Alt + F11"],action:"Focus to element path"},{shortcuts:["Ctrl + F9"],action:"Focus to contextual toolbar"},{shortcuts:["Shift + Enter"],action:"Open popup menu for split buttons"},{shortcuts:["Meta + K"],action:"Insert link (if link plugin activated)"},{shortcuts:["Meta + S"],action:"Save (if save plugin activated)"},{shortcuts:["Meta + F"],action:"Find (if searchreplace plugin activated)"},{shortcuts:["Meta + Shift + F"],action:"Switch to or from fullscreen mode"}],A=tinymce.util.Tools.resolve("tinymce.util.I18n"),C=[{key:"advlist",name:"Advanced List"},{key:"anchor",name:"Anchor"},{key:"autolink",name:"Autolink"},{key:"autoresize",name:"Autoresize"},{key:"autosave",name:"Autosave"},{key:"bbcode",name:"BBCode"},{key:"charmap",name:"Character Map"},{key:"code",name:"Code"},{key:"codesample",name:"Code Sample"},{key:"colorpicker",name:"Color Picker"},{key:"directionality",name:"Directionality"},{key:"emoticons",name:"Emoticons"},{key:"fullpage",name:"Full Page"},{key:"fullscreen",name:"Full Screen"},{key:"help",name:"Help"},{key:"hr",name:"Horizontal Rule"},{key:"image",name:"Image"},{key:"imagetools",name:"Image Tools"},{key:"importcss",name:"Import CSS"},{key:"insertdatetime",name:"Insert Date/Time"},{key:"legacyoutput",name:"Legacy Output"},{key:"link",name:"Link"},{key:"lists",name:"Lists"},{key:"media",name:"Media"},{key:"nonbreaking",name:"Nonbreaking"},{key:"noneditable",name:"Noneditable"},{key:"pagebreak",name:"Page Break"},{key:"paste",name:"Paste"},{key:"preview",name:"Preview"},{key:"print",name:"Print"},{key:"save",name:"Save"},{key:"searchreplace",name:"Search and Replace"},{key:"spellchecker",name:"Spell Checker"},{key:"tabfocus",name:"Tab Focus"},{key:"table",name:"Table"},{key:"template",name:"Template"},{key:"textcolor",name:"Text Color"},{key:"textpattern",name:"Text Pattern"},{key:"toc",name:"Table of Contents"},{key:"visualblocks",name:"Visual Blocks"},{key:"visualchars",name:"Visual Characters"},{key:"wordcount",name:"Word Count"},{key:"advcode",name:"Advanced Code Editor*"},{key:"formatpainter",name:"Format Painter*"},{key:"powerpaste",name:"PowerPaste*"},{key:"tinydrive",name:"Tiny Drive*",slug:"drive"},{key:"tinymcespellchecker",name:"Spell Checker Pro*"},{key:"a11ychecker",name:"Accessibility Checker*"},{key:"linkchecker",name:"Link Checker*"},{key:"mentions",name:"Mentions*"},{key:"mediaembed",name:"Enhanced Media Embed*"},{key:"checklist",name:"Checklist*"},{key:"casechange",name:"Case Change*"},{key:"permanentpen",name:"Permanent Pen*"},{key:"pageembed",name:"Page Embed*"},{key:"tinycomments",name:"Tiny Comments*",slug:"comments"},{key:"advtable",name:"Advanced Tables*"},{key:"autocorrect",name:"Autocorrect*"}],T=function(e){var t,n,l=function(e){return'<a href="'+e.url+'" target="_blank" rel="noopener">'+e.name+"</a>"};return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[null==(n=e)?"":'<div data-mce-tabstop="1" tabindex="-1">'+function(a){var e,t,n,o=(t=f((e=a).plugins),(n=e.getParam("forced_plugins"))===undefined?t:function(e,t){for(var n=[],a=0,o=e.length;a<o;a++){var i=e[a];t(i,a)&&n.push(i)}return n}(t,function(e){return!h(n,e)})),i=p(o,function(e){return"<li>"+(t=a,n=e,g(C,function(e){return e.key===n}).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?l(e()):n},function(e){var t=e.slug||e.key;return l({name:e.name,url:"https://www.tiny.cloud/docs/plugins/"+t})}))+"</li>";var t,n}),r=i.length,s=i.join("");return"<p><b>"+A.translate(["Plugins installed ({0}):",r])+"</b></p><ul>"+s+"</ul>"}(n)+"</div>",(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"<li>"+A.translate(e)+"</li>"}).join(""),'<div data-mce-tabstop="1" tabindex="-1"><p><b>'+A.translate("Premium plugins:")+"</b></p><ul>"+t+'<li class="tox-help__more-link" "><a href="https://www.tiny.cloud/pricing/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">'+A.translate("Learn more...")+"</a></li></ul></div>")].join("")}]}},x=tinymce.util.Tools.resolve("tinymce.EditorManager"),P=function(e,t){var n,a,o,i,r,s={name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:p(w,function(e){var t=p(e.shortcuts,v).join(" or ");return[e.action,t]})}]},l={name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:"<h1>Editor UI keyboard navigation</h1>\n\n<h2>Activating keyboard navigation</h2>\n\n<p>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:</p>\n<ul>\n <li>Focus the menubar: Alt + F9 (Windows) or ⌥F9 (MacOS)</li>\n <li>Focus the toolbar: Alt + F10 (Windows) or ⌥F10 (MacOS)</li>\n <li>Focus the footer: Alt + F11 (Windows) or ⌥F11 (MacOS)</li>\n</ul>\n\n<p>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. </p>\n\n<h2>Moving between UI sections</h2>\n\n<p>When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:</p>\n<ul>\n <li>the menubar</li>\n <li>each group of the toolbar </li>\n <li>the sidebar</li>\n <li>the element path in the footer </li>\n <li>the wordcount toggle button in the footer </li>\n <li>the branding link in the footer </li>\n</ul>\n\n<p>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.</p>\n\n<h2>Moving within UI sections</h2>\n\n<p>Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:</p>\n<ul>\n <li>moving between menus in the menubar</li>\n <li>moving between buttons in a toolbar group</li>\n <li>moving between items in the element path</li>\n</ul>\n\n<p>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. </p>\n\n<h1>Executing buttons</h1>\n\n<p>To execute a button, navigate the selection to the desired button and hit space or enter.</p>\n\n<h1>Opening, navigating and closing menus</h1>\n\n<p>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.</p>\n\n<p>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.</p>\n\n<h1>Context toolbars and menus</h1>\n\n<p>To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or ⌃F9 (MacOS).</p>\n\n<p>Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.</p>\n\n<h1>Dialog navigation</h1>\n\n<p>There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.</p>\n\n<p>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.</p>\n\n<p>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.</p>"}]},c=T(e),u=(i='<a href="https://www.tinymce.com/docs/changelog/?utm_campaign=editor_referral&utm_medium=help_dialog&utm_source=tinymce" target="_blank">TinyMCE '+(a=x.majorVersion,o=x.minorVersion,0===a.indexOf("@")?"X.X.X":a+"."+o)+"</a>",{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"<p>"+A.translate(["You are using {0}",i])+"</p>",presets:"document"}]}),h=m(((n={})[s.name]=s,n[l.name]=l,n[c.name]=c,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})},M=function(o,i){return function(){var e=P(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<e.length;a++)e[a].each(n);return t}(p(t,function(e){return y(t=a,n=e)?d.from(t[n]):d.none();var t,n}))};o.windowManager.open({title:"Help",size:"medium",body:n,buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{}})}};a.add("help",function(e){var t,n,a,o,i,r=(t={},{get:function(){return t},set:function(e){t=e}}),s={addTab:function(e){var t=n.get();t[e.name]=e,n.set(t)}},l=M(e,n=r);return o=l,(a=e).ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:o}),a.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:o}),i=l,e.addCommand("mceHelp",i),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),s})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager");n.add("hr",function(n){var o,t;(o=n).addCommand("InsertHorizontalRule",function(){o.execCommand("mceInsertContent",!1,"<hr />")}),(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")}})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var t,e,n,r,o,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},i=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}},l=function(t){return function(e){return typeof e===t}},A=i("string"),s=i("object"),u=i("array"),m=function(e){return t===e},d=l("boolean"),g=l("number"),f=function(){},p=function(e){return function(){return e}},h=p(!1),b=p(!(t=null)),v=function(){return y},y=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:h,isSome:h,isNone:b,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:p(null),getOrUndefined:p(undefined),or:r,orThunk:n,map:v,each:f,bind:v,exists:h,forall:b,filter:v,equals:e,equals_:e,toArray:function(){return[]},toString:p("none()")}),D=function(n){var e=p(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:b,isNone:h,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return D(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?a:y},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(h,function(e){return t(n,e)})}};return a},S={some:D,none:v,from:function(e){return null===e||e===undefined?y:D(e)}},w=Array.prototype.push,x=function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!u(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);w.apply(t,e[n])}return t},T=function(e){return t=e,(n=0)<=n&&n<t.length?S.some(t[n]):S.none();var t,n},C=("undefined"!=typeof window||Function("return this;")(),function(e,t,n){!function(e,t,n){if(!(A(n)||d(n)||g(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)}),U=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:e}},O={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return U(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return U(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return U(n)},fromDom:U,fromPoint:function(e,t,n){return S.from(e.dom.elementFromPoint(t,n)).map(U)}},I=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),N=tinymce.util.Tools.resolve("tinymce.util.Promise"),P=tinymce.util.Tools.resolve("tinymce.util.XHR"),_=function(e){return e.getParam("image_dimensions",!0,"boolean")},L=function(e){return e.getParam("images_upload_url","","string")},E=function(e){return e.getParam("images_upload_handler",undefined,"function")},M=function(e,t){return Math.max(parseInt(e,10),parseInt(t,10))},R=function(e){return e=e&&e.replace(/px$/,"")},z=function(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e},H=function(e){if(e.margin){var t=String(e.margin).split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e},k=function(e){return"IMG"===e.nodeName&&(e.hasAttribute("data-mce-object")||e.hasAttribute("data-mce-placeholder"))},j=I.DOM,B=function(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?R(e.style.marginLeft):""},F=function(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?R(e.style.marginTop):""},G=function(e){return e.style.borderWidth?R(e.style.borderWidth):""},W=function(e,t){return e.hasAttribute(t)?e.getAttribute(t):""},q=function(e,t){return e.style[t]?e.style[t]:""},$=function(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName},J=function(e,t,n){""===n?e.removeAttribute(t):e.setAttribute(t,n)},X=function(e){var t,n,r,a;$(e)?(a=(r=e).parentNode,j.insertAfter(r,a),j.remove(a)):(t=e,n=j.create("figure",{"class":"image"}),j.insertAfter(n,t),n.appendChild(t),n.appendChild(j.create("figcaption",{contentEditable:"true"},"Caption")),n.contentEditable="false")},V=function(e,t){var n=e.getAttribute("style"),r=t(null!==n?n:"");0<r.length?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")},K=function(e,r){return function(e,t,n){e.style[t]?(e.style[t]=z(n),V(e,r)):J(e,t,n)}},Z=function(e,t){return e.style[t]?R(e.style[t]):W(e,t)},Q=function(e,t){var n=z(t);e.style.marginLeft=n,e.style.marginRight=n},Y=function(e,t){var n=z(t);e.style.marginTop=n,e.style.marginBottom=n},ee=function(e,t){var n=z(t);e.style.borderWidth=n},te=function(e,t){e.style.borderStyle=t},ne=function(e){return"FIGURE"===e.nodeName},re=function(e){return 0===j.getAttrib(e,"alt").length&&"presentation"===j.getAttrib(e,"role")},ae=function(){return{src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:"",isDecorative:!1}},ie=function(e,t){var n=document.createElement("img");return J(n,"style",t.style),!B(n)&&""===t.hspace||Q(n,t.hspace),!F(n)&&""===t.vspace||Y(n,t.vspace),!G(n)&&""===t.border||ee(n,t.border),!q(n,"borderStyle")&&""===t.borderStyle||te(n,t.borderStyle),e(n.getAttribute("style"))},oe=function(e,t){return{src:W(t,"src"),alt:re(n=t)?"":W(n,"alt"),title:W(t,"title"),width:Z(t,"width"),height:Z(t,"height"),"class":W(t,"class"),style:e(W(t,"style")),caption:$(t),hspace:B(t),vspace:F(t),border:G(t),borderStyle:q(t,"borderStyle"),isDecorative:re(t)};var n},le=function(e,t,n,r,a){n[r]!==t[r]&&a(e,r,n[r])},se=function(e,t,n){var r,a;n?(j.setAttrib(e,"role","presentation"),r=O.fromDom(e),C(r,"alt","")):(m(t)?(r=O.fromDom(e),a="alt",r.dom.removeAttribute(a)):(r=O.fromDom(e),C(r,"alt",t)),"presentation"===j.getAttrib(e,"role")&&j.setAttrib(e,"role",""))},ue=function(r,a){return function(e,t,n){r(e,n),V(e,a)}},ce=function(e,t,n){var r,a,i,o=oe(e,n);le(n,o,t,"caption",function(e,t,n){return X(e),0}),le(n,o,t,"src",J),le(n,o,t,"title",J),le(n,o,t,"width",K(0,e)),le(n,o,t,"height",K(0,e)),le(n,o,t,"class",J),le(n,o,t,"style",ue(function(e,t){return J(e,"style",t),0},e)),le(n,o,t,"hspace",ue(Q,e)),le(n,o,t,"vspace",ue(Y,e)),le(n,o,t,"border",ue(ee,e)),le(n,o,t,"borderStyle",ue(te,e)),r=n,a=o,(i=t).alt===a.alt&&i.isDecorative===a.isDecorative||se(r,i.alt,i.isDecorative)},me=function(e,t){var n=e.dom.styles.parse(t),r=H(n),a=e.dom.styles.parse(e.dom.styles.serialize(r));return e.dom.styles.serialize(a)},de=function(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return n?e.dom.select("img",n)[0]:t&&("IMG"!==t.nodeName||k(t))?null:t},ge=function(t,e){var n=t.dom,r=n.getParent(e.parentNode,function(e){return!!t.schema.getTextBlockElements()[e.nodeName]},t.getBody());return r?n.split(r,e):e},fe=function(t,e){var n=function(e,t){var n=document.createElement("img");if(ce(e,c(c({},t),{caption:!1}),n),se(n,t.alt,t.isDecorative),t.caption){var r=j.create("figure",{"class":"image"});return r.appendChild(n),r.appendChild(j.create("figcaption",{contentEditable:"true"},"Caption")),r.contentEditable="false",r}return n}(function(e){return me(t,e)},e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var r,a=t.dom.select('*[data-mce-id="__mcenew"]')[0];t.dom.setAttrib(a,"data-mce-id",null),ne(a)?(r=ge(t,a),t.selection.select(r)):t.selection.select(a)},pe=function(t,e){var n,r,a,i,o,l,s=de(t);ce(function(e){return me(t,e)},e,s),n=s,t.dom.setAttrib(n,"src",n.getAttribute("src")),ne(s.parentNode)?(r=s.parentNode,ge(t,r),t.selection.select(s.parentNode)):(t.selection.select(s),a=t,i=e,l=function(){o.onload=o.onerror=null,a.selection&&(a.selection.select(o),a.nodeChanged())},(o=s).onload=function(){i.width||i.height||!_(a)||a.dom.setAttribs(o,{width:String(o.clientWidth),height:String(o.clientHeight)}),l()},o.onerror=l)},he=Object.prototype.hasOwnProperty,be=(o=function(e,t){return s(e)&&s(t)?be(e,t):t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var a=e[r];for(var i in a)he.call(a,i)&&(n[i]=o(n[i],a[i]))}return n}),ve=tinymce.util.Tools.resolve("tinymce.util.Tools"),ye=function(e){return A(e.value)?e.value:""},De=function(e,i){var o=[];return ve.each(e,function(e){var t,n,r,a=A((t=e).text)?t.text:A(t.title)?t.title:"";e.menu!==undefined?(n=De(e.menu,i),o.push({text:a,items:n})):(r=i(e),o.push({text:a,value:r}))}),o},we=function(t){return void 0===t&&(t=ye),function(e){return e?S.from(e).map(function(e){return De(e,t)}):S.none()}},Ae=function(e,n){return function(e,t){for(var n=0;n<e.length;n++){var r=t(e[n],n);if(r.isSome())return r}return S.none()}(e,function(e){return t=e,Object.prototype.hasOwnProperty.call(t,"items")?Ae(e.items,n):e.value===n?S.some(e):S.none();var t})},Se=we,xe=function(e){return we(ye)(e)},Te=function(e,t){return e.bind(function(e){return Ae(e,t)})};function Ce(o){var t=function(e,r,a,t){var i=new XMLHttpRequest;i.open("POST",o.url),i.withCredentials=o.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){a("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?a("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?r((t=o.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):a("Invalid JSON: "+i.responseText)};var n=new FormData;n.append("file",e.blob(),e.filename()),i.send(n)};return o=ve.extend({credentials:!1,handler:t},o),{upload:function(e){return o.url||o.handler!==t?(r=e,a=o.handler,new N(function(e,t){try{a(r,e,t,f)}catch(n){t(n.message)}})):N.reject("Upload url missing from the settings.");var r,a}}}var Ue=function(e){return{title:"Advanced",name:"advanced",items:[{type:"input",label:"Style",name:"style"},{type:"grid",columns:2,items:[{type:"input",label:"Vertical space",name:"vspace",inputMode:"numeric"},{type:"input",label:"Horizontal space",name:"hspace",inputMode:"numeric"},{type:"input",label:"Border width",name:"border",inputMode:"numeric"},{type:"listbox",name:"borderstyle",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]}},Oe=function(r){var t,e,a=Se(function(e){return r.convertURL(e.value||e.url,"src")}),n=new N(function(t){var n,e;n=function(e){t(a(e).map(function(e){return x([[{text:"None",value:""}],e])}))},"string"==typeof(e=r.getParam("image_list",!1))?P.send({url:e,success:function(e){n(JSON.parse(e))}}):"function"==typeof e?e(n):n(e)}),i=xe(r.getParam("image_class_list")),o=r.getParam("image_advtab",!1,"boolean"),l=r.getParam("image_uploadtab",!0,"boolean"),s=!!L(r),u=!!E(r),c=(e=de(t=r))?oe(function(e){return me(t,e)},e):ae(),m=r.getParam("image_description",!0,"boolean"),d=r.getParam("image_title",!1,"boolean"),g=_(r),f=r.getParam("image_caption",!1,"boolean"),p=r.getParam("a11y_advanced_options",!1,"boolean"),h=L(r),b=r.getParam("images_upload_base_path",undefined,"string"),v=r.getParam("images_upload_credentials",!1,"boolean"),y=E(r),D=r.getParam("automatic_uploads",!0,"boolean"),w=S.some(r.getParam("image_prepend_url","","string")).filter(function(e){return A(e)&&0<e.length});return n.then(function(e){return{image:c,imageList:e,classList:i,hasAdvTab:o,hasUploadTab:l,hasUploadUrl:s,hasUploadHandler:u,hasDescription:m,hasImageTitle:d,hasDimensions:g,hasImageCaption:f,url:h,basePath:b,credentials:v,handler:y,prependURL:w,hasAccessibilityOptions:p,automaticUploads:D}})},Ie=function(e){var t=e.imageList.map(function(e){return{name:"images",type:"listbox",label:"Image list",items:e}}),n={name:"alt",type:"input",label:"Alternative description",disabled:e.hasAccessibilityOptions&&e.image.isDecorative},r=e.classList.map(function(e){return{name:"classes",type:"listbox",label:"Class",items:e}});return x([[{name:"src",type:"urlinput",filetype:"image",label:"Source"}],t.toArray(),e.hasAccessibilityOptions&&e.hasDescription?[{type:"label",label:"Accessibility",items:[{name:"isDecorative",type:"checkbox",label:"Image is decorative"}]}]:[],e.hasDescription?[n]:[],e.hasImageTitle?[{name:"title",type:"input",label:"Image title"}]:[],e.hasDimensions?[{name:"dimensions",type:"sizeinput"}]:[],[{type:"grid",columns:2,items:x([r.toArray(),e.hasImageCaption?[{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[]])}]])},Ne=function(e){return{title:"General",name:"general",items:Ie(e)}},Pe=Ie,_e=function(e){return{title:"Upload",name:"upload",items:[{type:"dropzone",name:"fileinput"}]}},Le=function(e){return{src:{value:e.src,meta:{}},images:e.src,alt:e.alt,title:e.title,dimensions:{width:e.width,height:e.height},classes:e["class"],caption:e.caption,style:e.style,vspace:e.vspace,border:e.border,hspace:e.hspace,borderstyle:e.borderStyle,fileinput:[],isDecorative:e.isDecorative}},Ee=function(e,t){return{src:e.src.value,alt:0===e.alt.length&&t?null:e.alt,title:e.title,width:e.dimensions.width,height:e.dimensions.height,"class":e.classes,style:e.style,caption:e.caption,hspace:e.hspace,vspace:e.vspace,border:e.border,borderStyle:e.borderstyle,isDecorative:e.isDecorative}},Me=function(e,t){var n,r,a=t.getData();n=e,r=a.src.value,(/^(?:[a-zA-Z]+:)?\/\//.test(r)?S.none():n.prependURL.bind(function(e){return r.substring(0,e.length)!==e?S.some(e+r):S.none()})).each(function(e){t.setData({src:{value:e,meta:a.src.meta}})})},Re=function(e,t){var n,r,a,i,o=t.getData(),l=o.src.meta;l!==undefined&&(n=be({},o),a=n,i=l,(r=e).hasDescription&&A(i.alt)&&(a.alt=i.alt),r.hasAccessibilityOptions&&(a.isDecorative=i.isDecorative||a.isDecorative||!1),r.hasImageTitle&&A(i.title)&&(a.title=i.title),r.hasDimensions&&(A(i.width)&&(a.dimensions.width=i.width),A(i.height)&&(a.dimensions.height=i.height)),A(i["class"])&&Te(r.classList,i["class"]).each(function(e){a.classes=e.value}),r.hasImageCaption&&d(i.caption)&&(a.caption=i.caption),r.hasAdvTab&&(A(i.style)&&(a.style=i.style),A(i.vspace)&&(a.vspace=i.vspace),A(i.border)&&(a.border=i.border),A(i.hspace)&&(a.hspace=i.hspace),A(i.borderstyle)&&(a.borderstyle=i.borderstyle)),t.setData(n))},ze=function(e,t,n,r){var a,i,o,l,s,u,c,m,d,g,f,p;Me(t,r),Re(t,r),a=e,i=t,o=n,s=(l=r).getData(),u=s.src.value,(c=s.src.meta||{}).width||c.height||!i.hasDimensions||a.imageSize(u).then(function(e){o.open&&l.setData({dimensions:e})}),m=t,d=n,f=(g=r).getData(),p=Te(m.imageList,f.src.value),d.prevImage=p,g.setData({images:p.map(function(e){return e.value}).getOr("")})},He=function(e,t,n){var r,a,i,o,l,s=H(e(n.style)),u=be({},n);return u.vspace=(r=s)["margin-top"]&&r["margin-bottom"]&&r["margin-top"]===r["margin-bottom"]?R(String(r["margin-top"])):"",u.hspace=(a=s)["margin-right"]&&a["margin-left"]&&a["margin-right"]===a["margin-left"]?R(String(a["margin-right"])):"",u.border=(i=s)["border-width"]?R(String(i["border-width"])):"",u.borderstyle=(o=s)["border-style"]?String(o["border-style"]):"",u.style=(l=t)(e(l(s))),u},ke=function(s,u,t,c){var e=c.getData();c.block("Uploading image"),T(e.fileinput).fold(function(){c.unblock()},function(n){var r,a=URL.createObjectURL(n),i=Ce({url:u.url,basePath:u.basePath,credentials:u.credentials,handler:u.handler}),o=function(){c.unblock(),URL.revokeObjectURL(a)},l=function(e){c.setData({src:{value:e,meta:{}}}),c.showTab("general"),ze(s,u,t,c)};r=n,new N(function(e,t){var n=new FileReader;n.onload=function(){e(n.result)},n.onerror=function(){t(n.error.message)},n.readAsDataURL(r)}).then(function(e){var t=s.createBlobCache(n,a,e);u.automaticUploads?i.upload(t).then(function(e){l(e),o()})["catch"](function(e){o(),s.alertErr(e)}):(s.addToBlobCache(t),l(t.blobUri()),c.unblock())})})},je=function(h,b,v){return function(e,t){var n,r,a,i,o,l,s,u,c,m,d,g,f,p;"src"===t.name?ze(h,b,v,e):"images"===t.name?(c=h,m=b,d=v,f=(g=e).getData(),(p=Te(m.imageList,f.images)).each(function(e){""===f.alt||d.prevImage.map(function(e){return e.text===f.alt}).getOr(!1)?""===e.value?g.setData({src:e,alt:d.prevAlt}):g.setData({src:e,alt:e.text}):g.setData({src:e})}),d.prevImage=p,ze(c,m,d,g)):"alt"===t.name?v.prevAlt=e.getData().alt:"style"===t.name?(o=h,s=(l=e).getData(),u=He(o.parseStyle,o.serializeStyle,s),l.setData(u)):"vspace"===t.name||"hspace"===t.name||"border"===t.name||"borderstyle"===t.name?(n=h,r=e,a=be(Le(b.image),r.getData()),i=ie(n.normalizeCss,Ee(a,!1)),r.setData({style:i})):"fileinput"===t.name?ke(h,b,v,e):"isDecorative"===t.name&&(e.getData().isDecorative?e.disable("alt"):e.enable("alt"))}},Be=function(i){return function(e){var t,n,r,a={prevImage:Te((t=e).imageList,t.image.src),prevAlt:t.image.alt,open:!0};return{title:"Insert/Edit Image",size:"normal",body:(r=e).hasAdvTab||r.hasUploadUrl||r.hasUploadHandler?{type:"tabpanel",tabs:x([[Ne(r)],r.hasAdvTab?[Ue(r)]:[],r.hasUploadTab&&(r.hasUploadUrl||r.hasUploadHandler)?[_e(r)]:[]])}:{type:"panel",items:Pe(r)},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:Le(e.image),onSubmit:i.onSubmit(e),onChange:je(i,e,a),onClose:(n=a,function(){n.open=!1})}}},Fe=function(t){return function(e){return a=t.documentBaseURI.toAbsolute(e),new N(function(t){var n=document.createElement("img"),r=function(e){n.parentNode&&n.parentNode.removeChild(n),t(e)};n.onload=function(){var e={width:M(n.width,n.clientWidth),height:M(n.height,n.clientHeight)};r(N.resolve(e))},n.onerror=function(){r(N.reject("Failed to get image dimensions for: "+a))};var e=n.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left="0px",e.width=e.height="auto",document.body.appendChild(n),n.src=a}).then(function(e){return{width:String(e.width),height:String(e.height)}});var a}},Ge=function(e){var n,t,r,a,i,o,l,s={onSubmit:function(n){return function(e){var t=be(Le(n.image),e.getData());l.execCommand("mceUpdateImage",!1,Ee(t,n.hasAccessibilityOptions)),l.editorUpload.uploadImagesAuto(),e.close()}},imageSize:Fe(l=e),addToBlobCache:function(e){o.editorUpload.blobCache.add(e)},createBlobCache:function(e,t,n){return i.editorUpload.blobCache.create({blob:e,blobUri:t,name:e.name?e.name.replace(/\.[^\.]+$/,""):null,filename:e.name,base64:n.split(",")[1]})},alertErr:function(e){a.windowManager.alert(e)},normalizeCss:function(e){return me(r,e)},parseStyle:function(e){return t.dom.parseStyle(e)},serializeStyle:(n=t=r=a=i=o=e,function(e,t){return n.dom.serializeStyle(e,t)})};return{open:function(){Oe(e).then(Be(s)).then(e.windowManager.open)}}},We=function(u){u.addCommand("mceImage",Ge(u).open),u.addCommand("mceUpdateImage",function(e,s){u.undoManager.transact(function(){return e=s,void((l=de(t=u))?(n=oe(function(e){return me(t,e)},l),(r=c(c({},n),e)).src?pe(t,r):(a=t,(i=l)&&(o=a.dom.is(i.parentNode,"figure.image")?i.parentNode:i,a.dom.remove(o),a.focus(),a.nodeChanged(),a.dom.isEmpty(a.getBody())&&(a.setContent(""),a.selection.setCursorLocation())))):e.src&&fe(t,c(c({},ae()),e)));var t,e,n,r,a,i,o,l})})},qe=function(i){return function(e){for(var t,n=e.length,r=function(e){e.attr("contenteditable",i?"true":null)};n--;){var a=e[n];(t=a.attr("class"))&&/\bimage\b/.test(t)&&(a.attr("contenteditable",i?"false":null),ve.each(a.getAll("figcaption"),r))}}};a.add("image",function(e){var t,n;(t=e).on("PreInit",function(){t.parser.addNodeFilter("figure",qe(!0)),t.serializer.addNodeFilter("figure",qe(!1))}),(n=e).ui.registry.addToggleButton("image",{icon:"image",tooltip:"Insert/edit image",onAction:Ge(n).open,onSetup:function(e){return n.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image",e.setActive).unbind}}),n.ui.registry.addMenuItem("image",{icon:"image",text:"Image...",onAction:Ge(n).open}),n.ui.registry.addContextMenu("image",{update:function(e){return ne(e)||"IMG"===e.nodeName&&!k(e)?["image"]:[]}}),We(e)})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var t,e,n,r,l=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(){},u=function(t){return function(){return t}},a=u(!1),c=u(!0),f=function(){return s},s=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:n,orThunk:e,map:f,each:i,bind:f,exists:a,forall:c,filter:f,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),m=function(n){var t=u(n),e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:c,isNone:a,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return m(t(n))},each:function(t){t(n)},bind:r,exists:r,forall:r,filter:function(t){return t(n)?o:s},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(a,function(t){return e(n,t)})}};return o},g={some:m,none:f,from:function(t){return null===t||t===undefined?s:m(t)}},h=function(t){return!(null===(e=t)||e===undefined);var e},v=(r="function",function(t){return typeof t===r});function p(t,e){return b(document.createElement("canvas"),t,e)}function y(t){var e=p(t.width,t.height);return w(e).drawImage(t,0,0),e}function w(t){return t.getContext("2d")}function b(t,e,n){return t.width=e,t.height=n,t}var I,T,_,R,U=window.Promise?window.Promise:(I=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=[],C(t,A(E,this),A(L,this))},T=window,_=I.immediateFn||"function"==typeof T.setImmediate&&T.setImmediate||function(t){setTimeout(t,1)},R=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},I.prototype["catch"]=function(t){return this.then(null,t)},I.prototype.then=function(n,r){var o=this;return new I(function(t,e){x.call(o,new k(n,r,t,e))})},I.all=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var c=Array.prototype.slice.call(1===t.length&&R(t[0])?t[0]:t);return new I(function(o,i){if(0===c.length)return o([]);for(var u=c.length,t=0;t<c.length;t++)!function a(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){a(e,t)},i)}c[e]=t,0==--u&&o(c)}catch(r){i(r)}}(t,c[t])})},I.resolve=function(e){return e&&"object"==typeof e&&e.constructor===I?e:new I(function(t){t(e)})},I.reject=function(n){return new I(function(t,e){e(n)})},I.race=function(o){return new I(function(t,e){for(var n=0,r=o;n<r.length;n++)r[n].then(t,e)})},I);function A(t,e){return function(){return t.apply(e,arguments)}}function x(r){var o=this;null!==this._state?_(function(){var t,e=o._state?r.onFulfilled:r.onRejected;if(null!==e){try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function E(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void C(A(e,t),A(E,this),A(L,this))}this._state=!0,this._value=t,j.call(this)}catch(n){L.call(this,n)}}function L(t){this._state=!1,this._value=t,j.call(this)}function j(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];x.call(this,n)}this._deferreds=[]}function k(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}function C(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(o){if(r)return;r=!0,n(o)}}function O(t){var r,e=t.src;return 0===e.indexOf("data:")?S(e):(r=e,new U(function(t,n){var e=new XMLHttpRequest;e.open("GET",r,!0),e.responseType="blob",e.onload=function(){200===this.status&&t(this.response)},e.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},e.send()}))}function P(a){return new U(function(t,e){var n=URL.createObjectURL(a),r=new Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",u)};function i(){o(),t(r)}function u(){o(),e("Unable to load data of type "+a.type+": "+n)}r.addEventListener("load",i),r.addEventListener("error",u),r.src=n,r.complete&&i()})}function S(n){return new U(function(t,e){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return g.none();for(var r=n[1],o=e[1],i=atob(o),u=i.length,a=Math.ceil(u/1024),c=new Array(a),f=0;f<a;++f){for(var s=1024*f,l=Math.min(1024+s,u),d=new Array(l-s),m=s,h=0;m<l;++h,++m)d[h]=i[m].charCodeAt(0);c[f]=new Uint8Array(d)}return g.some(new Blob(c,{type:r}))})(n).fold(function(){e("uri is not base64: "+n)},t)})}function M(t,r,o){return r=r||"image/png",v(HTMLCanvasElement.prototype.toBlob)?new U(function(e,n){t.toBlob(function(t){t?e(t):n()},r,o)}):S(t.toDataURL(r,o))}function B(t){return P(t).then(function(t){var e;e=t,URL.revokeObjectURL(e.src);var n,r,o=p((r=t).naturalWidth||r.width,(n=t).naturalHeight||n.height);return w(o).drawImage(t,0,0),o})}var N=P,D=O,F=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return g.some(i);if(n(i,r))break}return g.none()}(t,e,a)};function H(t,e,n){var r=e.type;function o(r,o){return t.then(function(t){return n=o,e=(e=r)||"image/png",t.toDataURL(e,n);var e,n})}return{getType:u(r),toBlob:function(){return U.resolve(e)},toDataURL:u(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then(function(t){return M(t,e,n)})},toAdjustedDataURL:o,toAdjustedBase64:function(t,e){return o(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(y)}}}function q(e){return n=e,new U(function(t){var e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(n)}).then(function(t){return H(B(e),e,t)});var n}function z(e,t){return M(e,t).then(function(t){return H(U.resolve(e),t,e.toDataURL())})}function $(e,n){return e.toCanvas().then(function(t){return function(t,e,n){var r=p(t.width,t.height),o=w(r),i=0,u=0;90!==(n=n<0?360+n:n)&&270!==n||b(r,r.height,r.width);90!==n&&180!==n||(i=r.width);270!==n&&180!==n||(u=r.height);return o.translate(i,u),o.rotate(n*Math.PI/180),o.drawImage(t,0,0),z(r,e)}(t,e.getType(),n)})}function G(e,n){return e.toCanvas().then(function(t){return function(t,e,n){var r=p(t.width,t.height),o=w(r);"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0));return z(r,e)}(t,e.getType(),n)})}var J=G,K=$,V=Object.keys,W=function(e,r,o){return void 0===o&&(o=!1),new U(function(t){var n=new XMLHttpRequest;n.onreadystatechange=function(){4===n.readyState&&t({status:n.status,blob:n.response})},n.open("GET",e,!0),n.withCredentials=o,function(t,e){for(var n=V(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(r,function(t,e){n.setRequestHeader(e,t)}),n.responseType="blob",n.send()})},X=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],Q=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],Y=function(t,e){var n,r,o=(n=function(t,e){return h(t)?t[e]:undefined},r=t,function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}(e,function(t){r=n(r,t)}),r);return g.from(o)},Z=function(t){var e,n=(e=t,"ImageProxy HTTP error: "+F(X,function(t){return e===t.code}).fold(u("Unknown ImageProxy error"),function(t){return t.message}));return U.reject(n)},tt=function(e){return F(Q,function(t){return t.type===e}).fold(u("Unknown service error"),function(t){return t.message})},et=function(t){return"ImageProxy Service error: "+function(t){try{return g.some(JSON.parse(t))}catch(e){return g.none()}}(t).bind(function(t){return Y(t,["error","type"]).map(tt)}).getOr("Invalid JSON in service error message")},nt=function(t){return r=t,new U(function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(t){e(t)},n.readAsText(r)}).then(function(t){var e=et(t);return U.reject(e)});var r},rt=function(t){return t<200||300<=t},ot=function(t,e){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return W((r=e,o=-1===(n=t).indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)?n:n+o+"apiKey="+encodeURIComponent(r)),i).then(function(t){return rt(t.status)?(e=t.status,n=t.blob,r=e,"application/json"!==(null==(o=n)?void 0:o.type)||400!==r&&403!==r&&404!==r&&500!==r?Z(e):nt(n)):U.resolve(t.blob);var e,n,r,o})},it=function(t,e,n){return void 0===n&&(n=!1),e?ot(t,e):W(t,{},n).then(function(t){return rt(t.status)?Z(t.status):U.resolve(t.blob)})},ut=q,at=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:t}},ct={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return at(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return at(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return at(n)},fromDom:at,fromPoint:function(t,e,n){return g.from(t.dom.elementFromPoint(e,n)).map(at)}},ft=("undefined"!=typeof window||Function("return this;")(),function(t,e){return n=function(t){return function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(r.matches!==undefined)return r.matches(e);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(e);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(e);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(t,e)},F(t.dom.childNodes,function(t){return n(ct.fromDom(t))}).map(ct.fromDom);var n}),st=tinymce.util.Tools.resolve("tinymce.util.Delay"),lt=tinymce.util.Tools.resolve("tinymce.util.Promise"),dt=tinymce.util.Tools.resolve("tinymce.util.URI"),mt=function(t){return t.getParam("imagetools_proxy")};function ht(t){var e,n;function r(t){return/^[0-9\.]+px$/.test(t)}return e=t.style.width,n=t.style.height,e||n?r(e)&&r(n)?{w:parseInt(e,10),h:parseInt(n,10)}:null:(e=t.width,n=t.height,e&&n?{w:parseInt(e,10),h:parseInt(n,10)}:null)}function gt(t){return{w:t.naturalWidth,h:t.naturalHeight}}var vt=0,pt=function(t){return ft(ct.fromDom(t),"img")},yt=function(t,e){return t.dom.is(e,"figure")},wt=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")},bt=function(e,t){var n=function(t){return wt(e,t)&&(Rt(e,t)||Ut(e,t)||h(mt(e)))};return yt(e,t)?pt(t).bind(function(t){return n(t.dom)?g.some(t.dom):g.none()}):n(t)?g.some(t):g.none()},It=function(t,e){t.notificationManager.open({text:e,type:"error"})},Tt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&yt(t,n)?pt(n):wt(t,e)?g.some(ct.fromDom(e)):g.none()},_t=function(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return h(r)?t.dom.encode(r[n]):null},Rt=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new dt(n).host===t.documentBaseURI.host},Ut=function(t,e){return-1!==d.inArray(t.getParam("imagetools_cors_hosts",[],"string[]"),new dt(e.src).host)},At=function(t,e){if(Ut(t,e))return it(e.src,null,(n=t,r=e,-1!==d.inArray(n.getParam("imagetools_credentials_hosts",[],"string[]"),new dt(r.src).host)));var n,r,o;if(Rt(t,e))return D(e);var i=mt(t),u=i+(-1===i.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),a=(o=t).getParam("api_key",o.getParam("imagetools_api_key","","string"),"string");return it(u,a,!1)},xt=function(t,e){return n=t,g.from(n.getParam("imagetools_fetch_image",null,"function")).fold(function(){return At(t,e)},function(t){return t(e)});var n},Et=function(t,e){var n=t.editorUpload.blobCache.getByUri(e.src);return n?lt.resolve(n.blob()):xt(t,e)},Lt=function(t){st.clearTimeout(t.get())},jt=function(a,c,f,s,l,d,m){return f.toBlob().then(function(t){var e,n,o,r=a.editorUpload.blobCache,i=d.src,u=c.type===t.type;return a.getParam("images_reuse_filename",!1,"boolean")&&(o=r.getByUri(i),n=h(o)?(i=o.uri(),e=o.name(),o.filename()):(e=_t(a,i,2),_t(a,i,1))),o=r.create({id:"imagetools"+vt++,blob:t,base64:f.toBase64(),uri:i,name:e,filename:u?n:undefined}),r.add(o),a.undoManager.transact(function(){a.$(d).on("load",function r(){var t,e,n;a.$(d).off("load",r),a.nodeChanged(),s?a.editorUpload.uploadImagesAuto():(Lt(l),t=a,e=l,n=st.setEditorTimeout(t,function(){t.editorUpload.uploadImagesAuto()},t.getParam("images_upload_timeout",3e4,"number")),e.set(n))}),m&&a.$(d).attr({width:m.w,height:m.h}),a.$(d).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})},kt=function(r,o,t,i){return function(){return Tt(r).fold(function(){It(r,"Could not find selected image")},function(n){return r._scanForImages().then(function(){return Et(r,n.dom)}).then(function(e){return ut(e).then(t).then(function(t){return jt(r,e,t,!1,o,n.dom,i)})})["catch"](function(t){It(r,t)})})}},Ct=function(e,n,r){return function(){var t=Tt(e).fold(function(){return null},function(t){var e=ht(t.dom);return e?{w:e.h,h:e.w}:null});return kt(e,n,function(t){return K(t,r)},t)()}},Ot=function(t,e,n){return function(){return kt(t,e,function(t){return J(t,n)})()}},Pt=function(e,n,u,a,c){return N(c).then(function(t){var e,n,r,o,i=gt(t);return a.w===i.w&&a.h===i.h||ht(u)&&(e=u,(n=i)&&(r=e.style.width,o=e.style.height,(r||o)&&(e.style.width=n.w+"px",e.style.height=n.h+"px",e.removeAttribute("data-mce-style")),r=e.width,o=e.height,(r||o)&&(e.setAttribute("width",String(n.w)),e.setAttribute("height",String(n.h))))),URL.revokeObjectURL(t.src),c}).then(ut).then(function(t){return jt(e,c,t,!0,n,u)})["catch"](function(){})},St=function(i,u){return function(){var r=Tt(i),o=r.map(function(t){return gt(t.dom)});r.each(function(e){bt(i,e.dom).each(function(t){Et(i,e.dom).then(function(t){var e,n={blob:e=t,url:URL.createObjectURL(e)};i.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:n}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(t){var n=t.getData().imagetools.blob;r.each(function(e){o.each(function(t){Pt(i,u,e.dom,t,n)})}),t.close()},onCancel:function(){},onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})})})})}};o.add("imagetools",function(t){var n,e,r,o,i,u,a,c,f=l(0),s=l(null);n=t,e=f,d.each({mceImageRotateLeft:Ct(n,e,-90),mceImageRotateRight:Ct(n,e,90),mceImageFlipVertical:Ot(n,e,"v"),mceImageFlipHorizontal:Ot(n,e,"h"),mceEditImage:St(n,e)},function(t,e){n.addCommand(e,t)}),o=function(t){return function(){return r.execCommand(t)}},(r=t).ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:o("mceImageRotateLeft")}),r.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:o("mceImageRotateRight")}),r.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:o("mceImageFlipVertical")}),r.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:o("mceImageFlipHorizontal")}),r.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:o("mceEditImage"),onSetup:function(e){var t=function(){var t=Tt(r).forall(function(t){return bt(r,t.dom).isNone()});e.setDisabled(t)};return r.on("NodeChange",t),function(){r.off("NodeChange",t)}}}),r.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:o("mceImage")}),r.ui.registry.addContextMenu("imagetools",{update:function(t){return bt(r,t).fold(function(){return[]},function(t){return[{text:"Edit image",icon:"edit-image",onAction:o("mceEditImage")}]})}}),(i=t).ui.registry.addContextToolbar("imagetools",{items:i.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions"),predicate:function(t){return bt(i,t).isSome()},position:"node",scope:"node"}),a=f,c=s,(u=t).on("NodeChange",function(t){var e=c.get(),n=bt(u,t.element);e&&!n.exists(function(t){return e.src===t.src})&&(Lt(a),u.editorUpload.uploadImagesAuto(),c.set(null)),n.each(c.set)})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var n,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),m=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(t){return t.getParam("importcss_selector_converter")},o=(n="array",function(t){return r=typeof(e=t),(null===e?"null":"object"==r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r)===n;var e,r}),i=Array.prototype.push,l=function(t,e){return function(t){for(var e=[],r=0,n=t.length;r<n;++r){if(!o(t[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+t);i.apply(e,t[r])}return e}(function(t,e){for(var r=t.length,n=new Array(r),o=0;o<r;o++){var i=t[o];n[o]=e(i,o)}return n}(t,e))},p=function(e){return"string"==typeof e?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e},_=function(s,t,a){var u=[],r={};function l(t,e){var r,n,o,i=t.href;if(n=i,o=m.cacheSuffix,"string"==typeof n&&(n=n.replace("?"+o,"").replace("&"+o,"")),(i=n)&&a(i,e)&&!function(t,e){var r,n=!1!==(r=t.getParam("skin"))&&(r||"oxide");if(n){var o=t.getParam("skin_url"),i=o?t.documentBaseURI.toAbsolute(o):f.baseURL+"/skins/ui/"+n,c=f.baseURL+"/skins/content/";return e===i+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(c)}return!1}(s,i)){h.each(t.imports,function(t){l(t,!0)});try{r=t.cssRules||t.rules}catch(c){}h.each(r,function(t){t.styleSheet?l(t.styleSheet,!0):t.selectorText&&h.each(t.selectorText.split(","),function(t){u.push(h.trim(t))})})}}h.each(s.contentCSS,function(t){r[t]=!0}),a=a||function(t,e){return e||r[t]};try{h.each(t.styleSheets,function(t){l(t)})}catch(e){}return u},x=function(t,e){var r,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var o=n[1],i=n[2].substr(1).split(".").join(" "),c=h.makeMap("a,img");return n[1]?(r={title:e},t.schema.getTextBlockElements()[o]?r.block=o:t.schema.getBlockElements()[o]||c[o.toLowerCase()]?r.selector=o:r.inline=o):n[2]&&(r={inline:"span",title:e.substr(1),classes:i}),!1!==t.getParam("importcss_merge_classes")?r.classes=i:r.attributes={"class":i},r}},P=function(t,e){return null===e||!1!==t.getParam("importcss_exclusive")},r=function(y){y.on("init",function(t){var e,r,n,o,i=(e=[],r=[],n={},{addItemToGroup:function(t,e){n[t]?n[t].push(e):(r.push(t),n[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return l(r,function(t){var e=n[t];return 0===e.length?[]:[{title:t,items:e}]}).concat(e)}}),g={},c=p(y.getParam("importcss_selector_filter")),s=(o=y.getParam("importcss_groups"),h.map(o,function(t){return h.extend({},t,{original:t,selectors:{},filter:p(t.filter),item:{text:t.title,menu:[]}})})),a=function(t,e){if(f=t,p=g,!(P(y,m=e)?f in p:f in m.selectors)){a=t,l=g,P(y,u=e)?l[a]=!0:u.selectors[a]=!0;var r=(i=(o=y).plugins.importcss,c=t,((s=e)&&s.selector_converter?s.selector_converter:d(o)?d(o):function(){return x(o,c)}).call(i,c,s));if(r){var n=r.name||v.DOM.uniqueId();return y.formatter.register(n,r),h.extend({},{title:r.title,format:n})}}var o,i,c,s,a,u,l,f,m,p;return null};h.each(_(y,y.getDoc(),p(y.getParam("importcss_file_filter"))),function(r){var t,e,n,o;-1===r.indexOf(".mce-")&&(c&&!c(r)||(n=s,o=r,0<(t=h.grep(n,function(t){return!t.filter||t.filter(o)})).length?h.each(t,function(t){var e=a(r,t);e&&i.addItemToGroup(t.title,e)}):(e=a(r,null))&&i.addItem(e)))});var u=i.toFormats();y.fire("addStyleModifications",{items:u,replace:!y.getParam("importcss_append")})})};t.add("importcss",function(t){return r(t),e=t,{convertSelectorToFormat:function(t){return x(e,t)}};var e})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},c=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),i="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),o="January February March April May June July August September October November December".split(" "),m=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},s=function(e,t,n){return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",m(n.getMonth()+1,2))).replace("%d",m(n.getDate(),2))).replace("%H",""+m(n.getHours(),2))).replace("%M",""+m(n.getMinutes(),2))).replace("%S",""+m(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(o[n.getMonth()]))).replace("%b",""+e.translate(i[n.getMonth()]))).replace("%A",""+e.translate(a[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},l=function(e,t){var n,r,a,i,o,u,c,m;e.getParam("insertdatetime_element",!1)?(n=s(e,t),r=void 0,r=/%[HMSIp]/.test(t)?s(e,"%Y-%m-%dT%H:%M"):s(e,"%Y-%m-%d"),(a=e.dom.getParent(e.selection.getStart(),"time"))?(o=a,u=r,c=n,m=(i=e).dom.create("time",{datetime:u},c),o.parentNode.insertBefore(m,o),i.dom.remove(o),i.selection.select(m,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")):e.insertContent(s(e,t))},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.length?a[0]:u(r),t=e,{get:function(){return t},set:function(e){t=e}});n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===o.get()},fetch:function(e){e(d.map(i,function(e){return{type:"choiceitem",text:s(n,e),value:e}}))},onAction:function(e){l(n,o.get())},onItemAction:function(e,t){o.set(t),l(n,t)}});n.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return d.map(i,function(e){return{type:"menuitem",text:s(n,e),onAction:(t=e,function(){o.set(t),l(n,t)})};var t})}})};e.add("insertdatetime",function(e){t(e),n(e)})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(s){var e,t,i,a;t=!1,(e=s).settings.inline_styles=t,e.getParam("fontsize_formats")||(i="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",e.settings.fontsize_formats=i),e.getParam("font_formats")||(a="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",e.settings.font_formats=a),s.on("PreInit",function(){return e=s,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=l.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),a=e.schema,e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all",preserve_attributes:["class","style"]},{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all",preserve_attributes:["class","style"]},{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(l.inArray(i,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),l.each("b,i,u,strike".split(","),function(e){a.addValidElements(e+"[*]")}),a.getElementRule("font")||a.addValidElements("font[face|size|color|style]"),void l.each(t.split(","),function(e){var t=a.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))});var e,t,i,a})};e.add("legacyoutput",function(e){t(e)})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var n,t,e,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.VK"),u=function(r){return function(t){return e=typeof(n=t),(null===n?"null":"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e)===r;var n,e}},a=function(n){return function(t){return typeof t===n}},l=u("string"),c=u("array"),f=function(t){return n===t},s=a("boolean"),m=a("function"),g=function(t){var n=t.getParam("link_assume_external_targets",!1);return s(n)&&n?1:!l(n)||"http"!==n&&"https"!==n?0:n},p=function(t){return t.getParam("default_link_target")},d=function(t){return t.getParam("target_list",!0)},h=function(t){return t.getParam("rel_list",[],"array")},v=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},y=function(){},k=function(t){return function(){return t}},x=k(!1),b=k(!(n=null)),O=function(){return w},w=(t=function(t){return t.isNone()},{fold:function(t,n){return t()},is:x,isSome:x,isNone:b,getOr:r=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:k(null),getOrUndefined:k(undefined),or:r,orThunk:e,map:O,each:y,bind:O,exists:x,forall:b,filter:O,equals:t,equals_:t,toArray:function(){return[]},toString:k("none()")}),C=function(e){var t=k(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:b,isNone:x,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return C(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:w},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(x,function(t){return n(e,t)})}};return o},N={some:C,none:O,from:function(t){return null===t||t===undefined?w:C(t)}},A=Array.prototype.indexOf,P=Array.prototype.push,T=function(t,n){return e=t,r=n,-1<A.call(e,r);var e,r},S=function(t){for(var n=[],e=0,r=t.length;e<r;++e){if(!c(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);P.apply(n,t[e])}return n},_=function(t,n){return S(function(t,n){for(var e=t.length,r=new Array(e),o=0;o<e;o++){var i=t[o];r[o]=n(i,o)}return r}(t,n))},R=function(t,n){for(var e=0;e<t.length;e++){var r=n(t[e],e);if(r.isSome())return r}return N.none()},D=function(t,n){return t?N.some(n):N.none()},L=tinymce.util.Tools.resolve("tinymce.util.Tools"),E=function(t){return l(t.value)?t.value:""},M=function(t,i){var u=[];return L.each(t,function(t){var n,e,r,o=l((n=t).text)?n.text:l(n.title)?n.title:"";t.menu!==undefined?(e=M(t.menu,i),u.push({text:o,items:e})):(r=i(t),u.push({text:o,value:r}))}),u},U=function(n){return void 0===n&&(n=E),function(t){return N.from(t).map(function(t){return M(t,n)})}},B={sanitize:function(t){return U(E)(t)},sanitizeWith:U,createUi:function(n,e){return function(t){return{name:n,type:"listbox",label:e,items:t}}},getValue:E},q=function(){return(q=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)},I=Object.keys,K=Object.hasOwnProperty,z=function(t,e,r,o){return function(t,n){for(var e=I(t),r=0,o=e.length;r<o;r++){var i=e[r];n(t[i],i)}}(t,function(t,n){(e(t,n)?r:o)(t,n)}),{}},j=function(t,n){var e,r={};return z(t,n,(e=r,function(t,n){e[n]=t}),y),r},V=function(t,n){return K.call(t,n)},F=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),W=function(t){return t&&"a"===t.nodeName.toLowerCase()},H=function(t){return W(t)&&!!X(t)},G=function(t,n){if(t.collapsed)return[];for(var e=t.cloneContents(),r=new F(e.firstChild,e),o=[],i=e.firstChild;n(i)&&o.push(i),i=r.next(););return o},J=function(t){return/^\w+:/i.test(t)},X=function(t){var n=t.getAttribute("data-mce-href");return n||t.getAttribute("href")},$=function(t,n){var e,r,o=["noopener"],i=t?t.split(/\s+/):[],u=function(t){return t.filter(function(t){return-1===L.inArray(o,t)})},a=n?0<(e=u(e=i)).length?e.concat(o):o:u(i);return 0<a.length?(r=a,L.trim(r.sort().join(" "))):""},Q=function(t,n){return n=n||t.selection.getNode(),nt(n)?t.dom.select("a[href]",n)[0]:t.dom.getParent(n,"a[href]")},Y=function(t,n){var e=n?n.innerText||n.textContent:t.getContent({format:"text"});return e.replace(/\uFEFF/g,"")},Z=function(t){return 0<L.grep(t,H).length},tt=function(t){var n=t.schema.getTextInlineElements();return 0===G(t.selection.getRng(),function(t){return 1===t.nodeType&&!W(t)&&!V(n,t.nodeName.toLowerCase())}).length},nt=function(t){return t&&"FIGURE"===t.nodeName&&/\bimage\b/i.test(t.className)},et=function(t){return n=["title","rel","class","target"],e=function(n,e){return t[e].each(function(t){n[e]=0<t.length?t:null}),n},r={href:t.href},function(t,n){for(var e=0,r=t.length;e<r;e++)n(t[e],e)}(n,function(t){r=e(r,t)}),r;var n,e,r},rt=function(t,n){var e,r,o,i=q({},n);return 0<h(t).length||!1!==v(t)||(e=$(i.rel,"_blank"===i.target),i.rel=e||null),N.from(i.target).isNone()&&!1===d(t)&&(i.target=p(t)),i.href=(r=i.href,"http"!==(o=g(t))&&"https"!==o||J(r)?r:o+"://"+r),i},ot=function(l,c,f){var s=l.selection.getNode(),m=Q(l,s),g=rt(l,et(f));l.undoManager.transact(function(){var n,t,e,r,o,i,u,a;f.href===c.href&&c.attach(),m?(l.focus(),o=l,i=m,u=f.text,a=g,u.each(function(t){i.hasOwnProperty("innerText")?i.innerText=t:i.textContent=t}),o.dom.setAttribs(i,a),o.selection.select(i)):(n=l,t=s,e=f.text,r=g,nt(t)?ct(n,t,r):e.fold(function(){n.execCommand("mceInsertLink",!1,r)},function(t){n.insertContent(n.dom.createHTML("a",r,n.dom.encode(t)))}))})},it=function(l){l.undoManager.transact(function(){var t,n,e,r,o,i,u,a=l.selection.getNode();nt(a)?lt(l,a):(n=(t=l).dom,e=t.selection,r=e.getBookmark(),o=e.getRng().cloneRange(),i=n.getParent(o.startContainer,"a[href]",t.getBody()),u=n.getParent(o.endContainer,"a[href]",t.getBody()),i&&o.setStartBefore(i),u&&o.setEndAfter(u),e.setRng(o),t.execCommand("unlink"),e.moveToBookmark(r)),l.focus()})},ut=function(t,n,e){var r,o,i,u,a,l,c;t.hasPlugin("rtc",!0)?t.execCommand("createlink",!1,(o=(r=e)["class"],i=r.href,u=r.rel,a=r.target,l=r.text,c=r.title,j({"class":o.getOrNull(),href:i,rel:u.getOrNull(),target:a.getOrNull(),text:l.getOrNull(),title:c.getOrNull()},function(t,n){return!1===f(t)}))):ot(t,n,e)},at=function(t){t.hasPlugin("rtc",!0)?t.execCommand("unlink"):it(t)},lt=function(t,n){var e,r=t.dom.select("img",n)[0];!r||(e=t.dom.getParents(r,"a[href]",n)[0])&&(e.parentNode.insertBefore(r,e),t.dom.remove(e))},ct=function(t,n,e){var r,o=t.dom.select("img",n)[0];o&&(r=t.dom.create("a",e),o.parentNode.insertBefore(r,o),r.appendChild(o))},ft=function(t){return V(n=t,e="items")&&n[e]!==undefined&&null!==n[e];var n,e},st=function(n,t){return R(t,function(t){return ft(t)?st(n,t.items):D(t.value===n,t)})},mt=function(n,t,e,r){var o=r[t],i=0<n.length;return o!==undefined?st(o,e).map(function(t){return{url:{value:t.value,meta:{text:i?n:t.text,attach:y}},text:i?n:t.text}}):N.none()},gt=function(t,i){var u={text:t.text,title:t.title},r=function(t){var n,e,r=(n=t.url,D(u.text.length<=0,N.from(n.meta.text).getOr(n.value))),o=(e=t.url,D(u.title.length<=0,N.from(e.meta.title).getOr("")));return r.isSome()||o.isSome()?N.some(q(q({},r.map(function(t){return{text:t}}).getOr({})),o.map(function(t){return{title:t}}).getOr({}))):N.none()},o=function(t,n){var e,r,o=(e=i,("link"===(r=n.name)?e.link:"anchor"===r?e.anchor:N.none()).getOr([]));return mt(u.text,n.name,o,t)};return{onChange:function(t,n){var e=n.name;return"url"===e?r(t()):T(["anchor","link"],e)?o(t(),n):(("text"===e||"title"===e)&&(u[e]=t()[e]),N.none())}}},dt=tinymce.util.Tools.resolve("tinymce.util.Delay"),ht=tinymce.util.Tools.resolve("tinymce.util.Promise"),pt=function(t){var n=t.href;return 0<n.indexOf("@")&&-1===n.indexOf("/")&&-1===n.indexOf("mailto:")?N.some({message:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",preprocess:function(t){return q(q({},t),{href:"mailto:"+n})}}):N.none()},vt=function(u,a){return R([pt,(e=g(u),r=u.getParam("link_default_protocol","http","string"),function(t){var n=t.href;return 1===e&&!J(n)||0===e&&/^\s*www(\.|\d\.)/i.test(n)?N.some({message:"The URL you entered seems to be an external link. Do you want to add the required "+r+":// prefix?",preprocess:function(t){return q(q({},t),{href:r+"://"+n})}}):N.none()})],function(t){return t(a)}).fold(function(){return ht.resolve(a)},function(i){return new ht(function(n){var e,t,r,o;e=u,t=i.message,r=function(t){n(t?i.preprocess(a):a)},o=e.selection.getRng(),dt.setEditorTimeout(e,function(){e.windowManager.confirm(t,function(t){e.selection.setRng(o),r(t)})})})});var e,r},yt=function(t){var n=t.dom.select("a:not([href])"),e=_(n,function(t){var n=t.name||t.id;return n?[{text:n,value:"#"+n}]:[]});return 0<e.length?N.some([{text:"None",value:""}].concat(e)):N.none()},kt=function(t){var n=t.getParam("link_class_list",[],"array");return 0<n.length?B.sanitize(n):N.none()},xt=tinymce.util.Tools.resolve("tinymce.util.XHR"),bt=function(n){var e=function(t){return n.convertURL(t.value||t.url,"href")},t=n.getParam("link_list");return new ht(function(n){l(t)?xt.send({url:t,success:function(t){return n(function(t){try{return N.some(JSON.parse(t))}catch(n){return N.none()}}(t))},error:function(t){return n(N.none())}}):m(t)?t(function(t){return n(N.some(t))}):n(N.from(t))}).then(function(t){return t.bind(B.sanitizeWith(e)).map(function(t){if(0<t.length){return[{text:"None",value:""}].concat(t)}return t})})},Ot=function(t,n){var e=h(t);if(0<e.length){var r=n.is("_blank");return(!1===v(t)?B.sanitizeWith(function(t){return $(B.getValue(t),r)}):B.sanitize)(e)}return N.none()},wt=[{text:"Current window",value:""},{text:"New window",value:"_blank"}],Ct=function(t){var n=d(t);return c(n)?B.sanitize(n).orThunk(function(){return N.some(wt)}):!1===n?N.none():N.some(wt)},Nt=function(t,n,e){var r=t.getAttrib(n,e);return null!==r&&0<r.length?N.some(r):N.none()},At=function(f,s){return bt(f).then(function(t){var n,e,r,o,i,u,a,l,c=(e=s,r=(n=f).dom,o=tt(n)?N.some(Y(n.selection,e)):N.none(),i=e?N.some(r.getAttrib(e,"href")):N.none(),u=e?N.from(r.getAttrib(e,"target")):N.none(),a=Nt(r,e,"rel"),l=Nt(r,e,"class"),{url:i,text:o,title:Nt(r,e,"title"),target:u,rel:a,linkClass:l});return{anchor:c,catalogs:{targets:Ct(f),rels:Ot(f,c.target),classes:kt(f),anchor:yt(f),link:t},optNode:N.from(s),flags:{titleEnabled:f.getParam("link_title",!0,"boolean")}}})},Pt=function(h){var t,n;(n=Q(t=h),At(t,n)).then(function(t){var i,u,n,e,r,o,a,l,c,f,s,m,g,d;return e=function(t){var e=t.getData();if(!e.url.value)return at(i),void t.close();var n=function(n){return N.from(e[n]).filter(function(t){return!u.anchor[n].is(t)})},r={href:e.url.value,text:n("text"),target:n("target"),rel:n("rel"),"class":n("linkClass"),title:n("title")},o={href:e.url.value,attach:e.url.meta!==undefined&&e.url.meta.attach?e.url.meta.attach:function(){}};vt(i,r).then(function(t){ut(i,o,t)}),t.close()},r=i=h,c=(n=u=t).anchor.text.map(function(){return{name:"text",type:"input",label:"Text to display"}}).toArray(),f=n.flags.titleEnabled?[{name:"title",type:"input",label:"Title"}]:[],s=N.from(p(r)),o=s,a=n.anchor,m={url:{value:l=a.url.getOr(""),meta:{original:{value:l}}},text:a.text.getOr(""),title:a.title.getOr(""),anchor:l,link:l,rel:a.rel.getOr(""),target:a.target.or(o).getOr(""),linkClass:a.linkClass.getOr("")},g=n.catalogs,d=gt(m,g),{title:"Insert/Edit Link",size:"normal",body:{type:"panel",items:S([[{name:"url",type:"urlinput",filetype:"file",label:"URL"}],c,f,function(t){for(var n=[],e=function(t){n.push(t)},r=0;r<t.length;r++)t[r].each(e);return n}([g.anchor.map(B.createUi("anchor","Anchors")),g.rels.map(B.createUi("rel","Rel")),g.targets.map(B.createUi("target","Open link in...")),g.link.map(B.createUi("link","Link list")),g.classes.map(B.createUi("linkClass","Class"))])])},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:m,onChange:function(n,t){var e=t.name;d.onChange(n.getData,{name:e}).each(function(t){n.setData(t)})},onSubmit:e}}).then(function(t){h.windowManager.open(t)})},Tt=function(t){var n=document.createElement("a");n.target="_blank",n.href=t,n.rel="noreferrer noopener";var e,r,o=document.createEvent("MouseEvents");o.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),e=n,r=o,document.body.appendChild(e),e.dispatchEvent(r),document.body.removeChild(e)},St=function(t,n){return t.dom.getParent(n,"a[href]")},_t=function(t){return St(t,t.selection.getStart())},Rt=function(t,n){var e,r;n&&(e=X(n),/^#/.test(e)?(r=t.$(e)).length&&t.selection.scrollIntoView(r[0],!0):Tt(n.href))},Dt=function(t){return function(){Pt(t)}},Lt=function(t){return function(){Rt(t,_t(t))}},Et=function(r){r.on("click",function(t){var n=St(r,t.target);n&&i.metaKeyPressed(t)&&(t.preventDefault(),Rt(r,n))}),r.on("keydown",function(t){var n,e=_t(r);e&&13===t.keyCode&&(!0===(n=t).altKey&&!1===n.shiftKey&&!1===n.ctrlKey&&!1===n.metaKey)&&(t.preventDefault(),Rt(r,e))})},Mt=function(t,n){return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}},Ut=function(n){return function(t){return Mt(n,function(){t.setActive(!n.mode.isReadOnly()&&null!==Q(n,n.selection.getNode()))})}},Bt=function(e){return function(t){var n=function(){return t.setDisabled(null===Q(e,e.selection.getNode()))};return n(),Mt(e,n)}},qt=function(r){return function(n){var e=function(t){return Z(t)||(n=r.selection.getRng(),0<G(n,H).length);var n},t=r.dom.getParents(r.selection.getStart());return n.setDisabled(!e(t)),Mt(r,function(t){return n.setDisabled(!e(t.parents))})}};o.add("link",function(t){var n,e,r,i,o,u,a;(n=t).ui.registry.addToggleButton("link",{icon:"link",tooltip:"Insert/edit link",onAction:Dt(n),onSetup:Ut(n)}),n.ui.registry.addButton("openlink",{icon:"new-tab",tooltip:"Open link",onAction:Lt(n),onSetup:Bt(n)}),n.ui.registry.addButton("unlink",{icon:"unlink",tooltip:"Remove link",onAction:function(){return at(n)},onSetup:qt(n)}),(e=t).ui.registry.addMenuItem("openlink",{text:"Open link",icon:"new-tab",onAction:Lt(e),onSetup:Bt(e)}),e.ui.registry.addMenuItem("link",{icon:"link",text:"Link...",shortcut:"Meta+K",onAction:Dt(e)}),e.ui.registry.addMenuItem("unlink",{icon:"unlink",text:"Remove link",onAction:function(){return at(e)},onSetup:qt(e)}),(r=t).ui.registry.addContextMenu("link",{update:function(t){return Z(r.dom.getParents(t,"a"))?"link unlink openlink":"link"}}),o=function(t){var n=i.selection.getNode();return t.setDisabled(!Q(i,n)),function(){}},(i=t).ui.registry.addContextForm("quicklink",{launch:{type:"contextformtogglebutton",icon:"link",tooltip:"Link",onSetup:Ut(i)},label:"Link",predicate:function(t){return!!Q(i,t)&&i.getParam("link_context_toolbar",!1,"boolean")},initValue:function(){var t=Q(i);return t?X(t):""},commands:[{type:"contextformtogglebutton",icon:"link",tooltip:"Link",primary:!0,onSetup:function(t){var n=i.selection.getNode();return t.setActive(!!Q(i,n)),Ut(i)(t)},onAction:function(t){var n,e,r=Q(i),o=t.getValue();r?i.undoManager.transact(function(){i.dom.setAttrib(r,"href",o),i.selection.collapse(!1),t.hide()}):(n={href:o,attach:function(){}},e=tt(i)?N.some(Y(i.selection,r)).filter(function(t){return 0<t.length}).or(N.from(o)):N.none(),ut(i,n,{href:o,text:e,title:N.none(),rel:N.none(),target:N.none(),"class":N.none()}),t.hide())}},{type:"contextformbutton",icon:"unlink",tooltip:"Remove link",onSetup:o,onAction:function(t){at(i),t.hide()}},{type:"contextformbutton",icon:"new-tab",tooltip:"Open link",onSetup:o,onAction:function(t){Lt(i)(),t.hide()}}]}),Et(t),(u=t).addCommand("mceLink",function(){u.getParam("link_quicklink",!1,"boolean")?u.fire("contexttoolbar-show",{toolbarKey:"quicklink"}):Dt(u)()}),(a=t).addShortcut("Meta+K","",function(){a.execCommand("mceLink")})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e,n,t,r,o,i,u,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=function(){},y=function(e){return function(){return e}},c=function(n){return function(e){return!n(e)}},f=y(!1),d=y(!0),l=function(){return m},m=(e=function(e){return e.isNone()},{fold:function(e,n){return e()},is:f,isSome:f,isNone:d,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:y(null),getOrUndefined:y(undefined),or:t,orThunk:n,map:l,each:s,bind:l,exists:f,forall:d,filter:l,equals:e,equals_:e,toArray:function(){return[]},toString:y("none()")}),p=function(t){var e=y(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:d,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return p(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:m},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(f,function(e){return n(t,e)})}};return o},g={some:p,none:l,from:function(e){return null===e||e===undefined?m:p(e)}},v=function(r){return function(e){return t=typeof(n=e),(null===n?"null":"object"==t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t)===r;var n,t}},h=function(n){return function(e){return typeof e===n}},S=v("string"),b=v("array"),C=h("boolean"),O=h("function"),N=h("number"),L=Array.prototype.slice,T=Array.prototype.push,D=function(e,n){for(var t=e.length,r=new Array(t),o=0;o<t;o++){var i=e[o];r[o]=n(i,o)}return r},k=function(e,n){for(var t=0,r=e.length;t<r;t++){n(e[t],t)}},w=function(e,n){for(var t=[],r=0,o=e.length;r<o;r++){var i=e[r];n(i,r)&&t.push(i)}return t},x=function(e,n,t){return k(e,function(e){t=n(t,e)}),t},A=function(e,n,t){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(n(i,r))return g.some(i);if(t(i,r))break}return g.none()},E=function(e,n){return A(e,n,f)},P=function(e,n){return function(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!b(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);T.apply(n,e[t])}return n}(D(e,n))},B=function(e){var n=L.call(e,0);return n.reverse(),n},I=function(e,n){return 0<=n&&n<e.length?g.some(e[n]):g.none()},R=function(e){return I(e,0)},M=function(e){return I(e,e.length-1)},U=function(){return(U=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},_=function(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};var r=function(e){return Number(n.replace(t,"$"+e))};return H(r(1),r(2))},F=function(){return H(0,0)},H=function(e,n){return{major:e,minor:n}},$={nu:H,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?F():_(e,t)},unknown:F},j=function(e,n){var t=String(n).toLowerCase();return E(e,function(e){return e.search(t)})},q=function(e,t){return j(e,t).map(function(e){var n=$.detect(e.versionRegexes,t);return{current:e.name,version:n}})},K=function(e,t){return j(e,t).map(function(e){var n=$.detect(e.versionRegexes,t);return{current:e.name,version:n}})},V=function(e,n){return-1!==e.indexOf(n)},W=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Q=function(n){return function(e){return V(e,n)}},X=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return V(e,"edge/")&&V(e,"chrome")&&V(e,"safari")&&V(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,W],search:function(e){return V(e,"chrome")&&!V(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return V(e,"msie")||V(e,"trident")}},{name:"Opera",versionRegexes:[W,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Q("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Q("firefox")},{name:"Safari",versionRegexes:[W,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(V(e,"safari")||V(e,"mobile/"))&&V(e,"applewebkit")}}],z=[{name:"Windows",search:Q("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return V(e,"iphone")||V(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Q("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Q("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Q("linux"),versionRegexes:[]},{name:"Solaris",search:Q("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Q("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Q("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Y={browsers:y(X),oses:y(z)},G="Edge",J="Firefox",Z=function(e){var n=e.current,t=e.version,r=function(e){return function(){return n===e}};return{current:n,version:t,isEdge:r(G),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r(J),isSafari:r("Safari")}},ee={unknown:function(){return Z({current:undefined,version:$.unknown()})},nu:Z,edge:y(G),chrome:y("Chrome"),ie:y("IE"),opera:y("Opera"),firefox:y(J),safari:y("Safari")},ne="Windows",te="Android",re="Solaris",oe="FreeBSD",ie="ChromeOS",ue=function(e){var n=e.current,t=e.version,r=function(e){return function(){return n===e}};return{current:n,version:t,isWindows:r(ne),isiOS:r("iOS"),isAndroid:r(te),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r(re),isFreeBSD:r(oe),isChromeOS:r(ie)}},ae={unknown:function(){return ue({current:undefined,version:$.unknown()})},nu:ue,windows:y(ne),ios:y("iOS"),android:y(te),linux:y("Linux"),osx:y("OSX"),solaris:y(re),freebsd:y(oe),chromeos:y(ie)},se=function(e,n){var t,r,o,i,u,a,s,c,f,d,l,m,p=Y.browsers(),g=Y.oses(),v=q(p,e).fold(ee.unknown,ee.nu),h=K(g,e).fold(ae.unknown,ae.nu);return{browser:v,os:h,deviceType:(r=v,o=e,i=n,u=(t=h).isiOS()&&!0===/ipad/i.test(o),a=t.isiOS()&&!u,s=t.isiOS()||t.isAndroid(),c=s||i("(pointer:coarse)"),f=u||!a&&s&&i("(min-device-width:768px)"),d=a||s&&!f,l=r.isSafari()&&t.isiOS()&&!1===/safari/i.test(o),m=!d&&!f&&!l,{isiPad:y(u),isiPhone:y(a),isTablet:y(f),isPhone:y(d),isTouch:y(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:y(l),isDesktop:y(m)})}},ce=function(e){return window.matchMedia(e).matches},fe=(i=!(r=function(){return se(navigator.userAgent,ce)}),function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return i||(i=!0,o=r.apply(null,e)),o}),de=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:e}},le={fromHtml:function(e,n){var t=(n||document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return de(t.childNodes[0])},fromTag:function(e,n){var t=(n||document).createElement(e);return de(t)},fromText:function(e,n){var t=(n||document).createTextNode(e);return de(t)},fromDom:de,fromPoint:function(e,n,t){return g.from(e.dom.elementFromPoint(n,t)).map(de)}},me=function(e,n){return e.dom===n.dom},pe=function(e,n){return t=e.dom,r=n.dom,o=t,i=r,u=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(o.compareDocumentPosition(i)&u);var t,r,o,i,u},ge=function(e,n){return fe().browser.isIE()?pe(e,n):(t=n,r=e.dom,o=t.dom,r!==o&&r.contains(o));var t,r,o},ve=function(e,n){var t=e.dom;if(1!==t.nodeType)return!1;var r=t;if(r.matches!==undefined)return r.matches(n);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(n);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(n);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},he=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),ye=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Se=tinymce.util.Tools.resolve("tinymce.util.VK"),be=Object.keys,Ce=function(e,n){for(var t=be(e),r=0,o=t.length;r<o;r++){var i=t[r];n(e[i],i)}},Oe=function(e,n){var t,r,o,i,u={};return t=n,i=u,r=function(e,n){i[n]=e},o=s,Ce(e,function(e,n){(t(e,n)?r:o)(e,n)}),u},Ne=("undefined"!=typeof window||Function("return this;")(),function(e){return e.dom.nodeName.toLowerCase()}),Le=(u=1,function(e){return e.dom.nodeType===u}),Te=function(e,n){var t=e.dom;Ce(n,function(e,n){!function(e,n,t){if(!(S(t)||C(t)||N(t)))throw console.error("Invalid call to Attribute.set. Key ",n,":: Value ",t,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,t+"")}(t,n,e)})},De=function(e){return x(e.dom.attributes,function(e,n){return e[n.name]=n.value,e},{})},ke=function(e){return g.from(e.dom.parentNode).map(le.fromDom)},we=function(e){return D(e.dom.childNodes,le.fromDom)},xe=function(e,n){var t=e.dom.childNodes;return g.from(t[n]).map(le.fromDom)},Ae=function(e){return xe(e,0)},Ee=function(e){return xe(e,e.dom.childNodes.length-1)},Pe=function(n,t){ke(n).each(function(e){e.dom.insertBefore(t.dom,n.dom)})},Be=function(e,n){e.dom.appendChild(n.dom)},Ie=function(n,e){k(e,function(e){Be(n,e)})},Re=function(e){var n=e.dom;null!==n.parentNode&&n.parentNode.removeChild(n)},Me=function(e){return n=e,t=!0,le.fromDom(n.dom.cloneNode(t));var n,t},Ue=function(e,n){var t,r,o,i,u=(t=e,r=n,o=le.fromTag(r),i=De(t),Te(o,i),o);Pe(e,u);var a=we(e);return Ie(u,a),Re(e),u},_e=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Fe=tinymce.util.Tools.resolve("tinymce.util.Tools"),He=function(n){return function(e){return e&&e.nodeName.toLowerCase()===n}},$e=function(n){return function(e){return e&&n.test(e.nodeName)}},je=function(e){return e&&3===e.nodeType},qe=$e(/^(OL|UL|DL)$/),Ke=$e(/^(OL|UL)$/),Ve=He("ol"),We=$e(/^(LI|DT|DD)$/),Qe=$e(/^(DT|DD)$/),Xe=$e(/^(TH|TD)$/),ze=He("br"),Ye=function(e,n){return n&&!!e.schema.getTextBlockElements()[n.nodeName]},Ge=function(e,n){return e&&e.nodeName in n},Je=function(e,n,t){var r=e.isEmpty(n);return!(t&&0<e.select("span[data-mce-type=bookmark]",n).length)&&r},Ze=function(e,n){return e.isChildOf(n,e.getRoot())},en=function(e,n){var t,r,o,i,u=e.dom,a=e.schema.getBlockElements(),s=u.createFragment(),c=!1===(t=e.getParam("forced_root_block","p"))?"":!0===t?"p":t;if(c&&((o=u.create(c)).tagName===c.toUpperCase()&&u.setAttribs(o,e.getParam("forced_root_block_attrs",{})),Ge(n.firstChild,a)||s.appendChild(o)),n)for(;r=n.firstChild;){var f=r.nodeName;i||"SPAN"===f&&"bookmark"===r.getAttribute("data-mce-type")||(i=!0),Ge(r,a)?(s.appendChild(r),o=null):c?(o||(o=u.create(c),s.appendChild(o)),o.appendChild(r)):s.appendChild(r)}return c?i||o.appendChild(u.create("br",{"data-mce-bogus":"1"})):s.appendChild(u.create("br")),s},nn=_e.DOM,tn=function(n,t){ve(t,"dd")?Ue(t,"dt"):ve(t,"dt")&&ke(t).each(function(e){return function(e,n,t){var r=nn.select('span[data-mce-type="bookmark"]',n),o=en(e,t),i=nn.createRng();i.setStartAfter(t),i.setEndAfter(n);for(var u,a=i.extractContents(),s=a.firstChild;s;s=s.firstChild)if("LI"===s.nodeName&&e.dom.isEmpty(s)){nn.remove(s);break}e.dom.isEmpty(a)||nn.insertAfter(a,n),nn.insertAfter(o,n),Je(e.dom,t.parentNode)&&(u=t.parentNode,Fe.each(r,function(e){u.parentNode.insertBefore(e,t.parentNode)}),nn.remove(u)),nn.remove(t),Je(e.dom,n)&&nn.remove(n)}(n,e.dom,t.dom)})},rn=function(e){ve(e,"dt")&&Ue(e,"dd")},on=function(e,n){if(je(e))return{container:e,offset:n};var t=he.getNode(e,n);return je(t)?{container:t,offset:n>=e.childNodes.length?t.data.length:0}:t.previousSibling&&je(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&je(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}},un=function(e){var n=e.cloneRange(),t=on(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=on(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},an=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),sn=function(e,n){var t=n||e.selection.getStart(!0);return e.dom.getParent(t,"OL,UL,DL",dn(e,t))},cn=function(e){var n,t,r,o=sn(e),i=e.selection.getSelectedBlocks();return r=i,(t=o)&&1===r.length&&r[0]===t?(n=o,Fe.grep(n.querySelectorAll("ol,ul,dl"),function(e){return qe(e)})):Fe.grep(i,function(e){return qe(e)&&o!==e})},fn=function(e){var t,n,r,o=e.selection.getSelectedBlocks();return Fe.grep((t=e,n=o,r=Fe.map(n,function(e){var n=t.dom.getParent(e,"li,dd,dt",dn(t,e));return n||e}),an.unique(r)),function(e){return We(e)})},dn=function(e,n){var t=e.dom.getParents(n,"TD,TH");return 0<t.length?t[0]:e.getBody()},ln=function(e,n){var t=e.dom.getParents(n,"ol,ul",dn(e,n));return M(t)},mn=function(e){var n,t,r,o=(t=ln(n=e,n.selection.getStart()),r=w(n.selection.getSelectedBlocks(),Ke),t.toArray().concat(r));return pn(e,o)},pn=function(n,e){var t=D(e,function(e){return ln(n,e).getOr(e)});return an.unique(t)},gn=function(e,n,t){return e.isSome()&&n.isSome()?g.some(t(e.getOrDie(),n.getOrDie())):g.none()},vn=function(e,n,t){return e.fire("ListMutation",{action:n,element:t})},hn=function(e,n,t){if(!S(t))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",t,":: Element ",e),new Error("CSS value must be a string: "+t);var r;(r=e).style!==undefined&&O(r.style.getPropertyValue)&&e.style.setProperty(n,t)},yn=function(e,n){Be(e.item,n.list)},Sn=function(e,n,t){for(var r,o,i,u=[],a=0;a<t;a++)u.push((r=e,o=n.listType,i={list:le.fromTag(o,r),item:le.fromTag("li",r)},Be(i.list,i.item),i));return u},bn=function(e,n){for(var t,r,o,i,u=0;u<e.length-1;u++)t=e[u].item,r="list-style-type",o="none",i=t.dom,hn(i,r,o);M(e).each(function(e){Te(e.list,n.listAttributes),Te(e.item,n.itemAttributes),Ie(e.item,n.content)})},Cn=function(f,e,d){var n=e.slice(0,d.depth);return M(n).each(function(e){var n,t,r,o,i,u,a,s,c=(n=f,t=d.itemAttributes,r=d.content,o=le.fromTag("li",n),Te(o,t),Ie(o,r),o);u=c,Be((i=e).list,u),i.item=u,s=d,Ne((a=e).list)!==s.listType&&(a.list=Ue(a.list,s.listType)),Te(a.list,s.listAttributes)}),n},On=function(e,n,t){var r,o=Sn(e,t,t.depth-n.length);return function(e){for(var n=1;n<e.length;n++)yn(e[n-1],e[n])}(o),bn(o,t),r=o,gn(M(n),R(r),yn),n.concat(o)},Nn=function(e){return ve(e,"OL,UL")},Ln=function(e){return Ae(e).map(Nn).getOr(!1)},Tn=function(e){return 0<e.depth},Dn=function(e){return e.isSelected},kn=function(e){var n=we(e),t=Ee(e).map(Nn).getOr(!1)?n.slice(0,-1):n;return D(t,Me)},wn=function(a){return k(a,function(r,e){var n,t,o,i,u;o=(n=a)[t=e].depth,i=function(e){return e.depth===o&&!e.dirty},u=function(e){return e.depth<o},A(B(n.slice(0,t)),i,u).orThunk(function(){return A(n.slice(t+1),i,u)}).fold(function(){var e;r.dirty&&((e=r).listAttributes=Oe(e.listAttributes,function(e,n){return"start"!==n}))},function(e){return t=e,(n=r).listType=t.listType,void(n.listAttributes=U({},t.listAttributes));var n,t})}),a},xn=function(i,u,a,s){return Ae(s).filter(Nn).fold(function(){u.each(function(e){me(e.start,s)&&a.set(!0)});var n,t,r,e=(n=s,t=i,r=a.get(),ke(n).filter(Le).map(function(e){return{depth:t,dirty:!1,isSelected:r,content:kn(n),itemAttributes:De(n),listAttributes:De(e),listType:Ne(e)}}));u.each(function(e){me(e.end,s)&&a.set(!1)});var o=Ee(s).filter(Nn).map(function(e){return An(i,u,a,e)}).getOr([]);return e.toArray().concat(o)},function(e){return An(i,u,a,e)})},An=function(n,t,r,e){return P(we(e),function(e){return(Nn(e)?An:xn)(n+1,t,r,e)})},En=function(e,n){var t,r=(t=!1,{get:function(){return t},set:function(e){t=e}});return D(e,function(e){return{sourceList:e,entries:An(0,n,r,e)}})},Pn=function(i,e){var n=wn(e);return D(n,function(e){var n,t,r,o=(n=e.content,r=(t||document).createDocumentFragment(),k(n,function(e){r.appendChild(e.dom)}),le.fromDom(r));return le.fromDom(en(i,o.dom))})},Bn=function(e,n){var t,r,o=wn(n);return t=e.contentDocument,r=x(o,function(e,n){return(n.depth>e.length?On:Cn)(t,e,n)},[]),R(r).map(function(e){return e.list}).toArray()},In=function(a,e,s){var n,t=En(e,(n=D(fn(a),le.fromDom),gn(E(n,c(Ln)),E(B(n),c(Ln)),function(e,n){return{start:e,end:n}})));k(t,function(e){var n,t;n=e.entries,t=s,k(w(n,Dn),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),0});var r,o,i,u=(r=a,o=e.entries,P(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i<u;i++){var a=e[i],s=n(a);s!==t&&(r.push(o),o=[]),t=s,o.push(a)}return 0!==o.length&&r.push(o),r}(o,Tn),function(e){return(R(e).map(Tn).getOr(!1)?Bn:Pn)(r,e)}));k(u,function(e){vn(a,"Indent"===s?"IndentList":"OutdentList",e.dom)}),i=e.sourceList,k(u,function(e){Pe(i,e)}),Re(e.sourceList)})},Rn=function(e,n){var t,r,o=D(mn(e),le.fromDom),i=D(w(fn(e),Qe),le.fromDom),u=!1;return(o.length||i.length)&&(t=e.selection.getBookmark(),In(e,o,n),r=e,k(i,"Indent"===n?rn:function(e){return tn(r,e),0}),e.selection.moveToBookmark(t),e.selection.setRng(un(e.selection.getRng())),e.nodeChanged(),u=!0),u},Mn=function(e){return Rn(e,"Indent")},Un=function(e){return Rn(e,"Outdent")},_n=function(e){return Rn(e,"Flatten")},Fn=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),Hn=_e.DOM,$n=function(o){var i={},e=function(e){var n,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},jn=function(o){function e(e){var n,t=n=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"];t&&(1===t.nodeType&&(r=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}(t),t=t.parentNode,Hn.remove(n),!t.hasChildNodes()&&Hn.isBlock(t)&&t.appendChild(Hn.create("br"))),o[e?"startContainer":"endContainer"]=t,o[e?"startOffset":"endOffset"]=r)}e(!0),e();var n=Hn.createRng();return n.setStart(o.startContainer,o.startOffset),o.endContainer&&n.setEnd(o.endContainer,o.endOffset),un(n)},qn=function(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}},Kn=function(e){return/\btox\-/.test(e.className)},Vn=function(e,t,r){var n=function(e){var n=A(e.parents,qe,Xe).filter(function(e){return e.nodeName===t&&!Kn(e)}).isSome();r(n)},o=e.dom.getParents(e.selection.getNode());return n({parents:o}),e.on("NodeChange",n),function(){return e.off("NodeChange",n)}},Wn=function(t,e){Fe.each(e,function(e,n){t.setAttribute(n,e)})},Qn=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,Wn(s=n,(c=t)["list-attributes"]),Fe.each(a.select("li",s),function(e){Wn(e,c["list-item-attributes"])})},Xn=function(e,n,t,r){var o=n[t?"startContainer":"endContainer"],i=n[t?"startOffset":"endOffset"];for(1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!t&&ze(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(Ye(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},zn=function(f,d,l){void 0===l&&(l={});var e,n=f.selection.getRng(),m="LI",t=dn(f,f.selection.getStart(!0)),p=f.dom;"false"!==p.getContentEditable(f.selection.getNode())&&("DL"===(d=d.toUpperCase())&&(m="DT"),e=$n(n),Fe.each(function(t,e,r){for(var o,i=[],u=t.dom,n=Xn(t,e,!0,r),a=Xn(t,e,!1,r),s=[],c=n;c&&(s.push(c),c!==a);c=c.nextSibling);return Fe.each(s,function(e){if(Ye(t,e))return i.push(e),void(o=null);if(u.isBlock(e)||ze(e))return ze(e)&&u.remove(e),void(o=null);var n=e.nextSibling;Fn.isBookmarkNode(e)&&(Ye(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=e.previousSibling;c&&qe(c)&&c.nodeName===d&&(t=c,r=l,o=p.getStyle(t,"list-style-type"),i=r?r["list-style-type"]:"",o===(i=null===i?"":i))?(n=c,e=p.rename(e,m),c.appendChild(e)):(n=p.create(d),e.parentNode.insertBefore(n,e),n.appendChild(e),e=p.rename(e,m)),u=p,a=e,s=["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],Fe.each(s,function(e){var n;return u.setStyle(a,((n={})[e]="",n))}),Qn(p,n,l),Gn(f.dom,n)}),f.selection.setRng(jn(e)))},Yn=function(e,n,t){return s=t,(a=n)&&s&&qe(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},Gn=function(e,n){var t,r=n.nextSibling;if(Yn(e,n,r)){for(;t=r.firstChild;)n.appendChild(t);e.remove(r)}if(r=n.previousSibling,Yn(e,n,r)){for(;t=r.lastChild;)n.insertBefore(t,n.firstChild);e.remove(r)}},Jn=function(u,e,n,a,s){var t;e.nodeName!==a||Zn(s)?(t=$n(u.selection.getRng(!0)),Fe.each([e].concat(n),function(e){var n,t,r,o,i;n=u,r=a,o=s,(t=e).nodeName!==r?(i=n.dom.rename(t,r),Qn(n.dom,i,o),vn(n,qn(r),i)):(Qn(n.dom,t,o),vn(n,qn(r),t))}),u.selection.setRng(jn(t))):_n(u)},Zn=function(e){return"list-style-type"in e},et=function(e,n,t){var r,o,i,u,a,s,c=sn(e),f=cn(e);t=t||{},c&&0<f.length?Jn(e,c,f,n,t):(i=n,u=t,(o=c)!==(r=e).getBody()&&(o?o.nodeName!==i||Zn(u)||Kn(o)?(a=$n(r.selection.getRng(!0)),Qn(r.dom,o,u),s=r.dom.rename(o,i),Gn(r.dom,s),r.selection.setRng(jn(a)),vn(r,qn(i),s)):_n(r):(zn(r,i,u),vn(r,qn(i),o))))},nt=_e.DOM,tt=function(i,e){Fe.each(Fe.grep(i.select("ol,ul",e)),function(e){var n,t,r,o;n=i,"LI"===(o=(t=e).parentNode).nodeName&&o.firstChild===t&&((r=o.previousSibling)&&"LI"===r.nodeName?(r.appendChild(t),Je(n,o)&&nt.remove(o)):nt.setStyle(o,"listStyleType","none")),qe(o)&&(r=o.previousSibling)&&"LI"===r.nodeName&&r.appendChild(t)})},rt=function(e,n,t,r){var o=n.startContainer,i=n.startOffset;if(je(o)&&(t?i<o.data.length:0<i))return o;var u=e.schema.getNonEmptyElements();1===o.nodeType&&(o=he.getNode(o,i));var a,s,c=new ye(o,r);for(t&&(a=e.dom,ze(s=o)&&a.isBlock(s.nextSibling)&&!ze(s.previousSibling)&&c.next());o=c[t?"next":"prev2"]();){if("LI"===o.nodeName&&!o.hasChildNodes())return o;if(u[o.nodeName])return o;if(je(o)&&0<o.data.length)return o}},ot=function(e,n){var t=n.childNodes;return 1===t.length&&!qe(t[0])&&e.isBlock(t[0])},it=function(e,n,t){var r,o,i,u=ot(e,t)?t.firstChild:t;if(ot(o=e,i=n)&&o.remove(i.firstChild,!0),!Je(e,n,!0))for(;r=n.firstChild;)u.appendChild(r)},ut=function(n,e,t){var r,o,i,u=e.parentNode;Ze(n,e)&&Ze(n,t)&&(qe(t.lastChild)&&(r=t.lastChild),u===t.lastChild&&ze(u.previousSibling)&&n.remove(u.previousSibling),(o=t.lastChild)&&ze(o)&&e.hasChildNodes()&&n.remove(o),Je(n,t,!0)&&n.$(t).empty(),it(n,e,t),r&&t.appendChild(r),i=ge(le.fromDom(t),le.fromDom(e))?n.getParents(e,qe,t):[],n.remove(e),k(i,function(e){Je(n,e)&&e!==n.getRoot()&&n.remove(e)}))},at=function(e,n,t,r){var o,i,u,a,s=e.dom;s.isEmpty(r)?(u=t,a=r,(i=e).dom.$(a).empty(),ut(i.dom,u,a),i.selection.setCursorLocation(a)):(o=$n(n),ut(s,t,r),e.selection.setRng(jn(o)))},st=function(n,t){var e=n.dom,r=n.selection,o=r.getStart(),i=dn(n,o),u=e.getParent(r.getStart(),"LI",i);if(u){var a=u.parentNode;if(a===n.getBody()&&Je(e,a))return!0;var s=un(r.getRng()),c=e.getParent(rt(n,s,t,i),"LI",i);if(c&&c!==u)return n.undoManager.transact(function(){var e;t?at(n,s,c,u):(e=u).parentNode.firstChild===e?Un(n):function(e,n,t,r){var o=$n(n);ut(e.dom,t,r);var i=jn(o);e.selection.setRng(i)}(n,s,u,c)}),!0;if(!c&&!t&&0===s.startOffset&&0===s.endOffset)return n.undoManager.transact(function(){_n(n)}),!0}return!1},ct=function(o,i){var u=o.dom,e=o.selection.getStart(),a=dn(o,e),s=u.getParent(e,u.isBlock,a);if(s&&u.isEmpty(s)){var n=un(o.selection.getRng()),c=u.getParent(rt(o,n,i,a),"LI",a);if(c)return o.undoManager.transact(function(){var e,n,t,r;n=s,t=a,r=(e=u).getParent(n.parentNode,e.isBlock,t),e.remove(n),r&&e.isEmpty(r)&&e.remove(r),Gn(u,c.parentNode),o.selection.select(c,!0),o.selection.collapse(i)}),!0}return!1},ft=function(e,n){return e.selection.isCollapsed()?st(i=e,u=n)||ct(i,u):(r=(t=e).selection.getStart(),o=dn(t,r),!!(t.dom.getParent(r,"LI,DT,DD",o)||0<fn(t).length)&&(t.undoManager.transact(function(){t.execCommand("Delete"),tt(t.dom,t.getBody())}),!0));var t,r,o,i,u},dt=function(t){var r=t.dom,e=sn(t);Ve(e)&&t.windowManager.open({title:"List Properties",body:{type:"panel",items:[{type:"input",name:"start",label:"Start list at number",inputMode:"numeric"}]},initialData:{start:r.getAttrib(e,"start")||"1"},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var n=e.getData();t.undoManager.transact(function(){r.setAttrib(sn(t),"start","1"===n.start?"":n.start)}),e.close()}})},lt=function(n,t){return function(){var e=n.dom.getParent(n.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===t}},mt=function(e){var n,t;e.getParam("lists_indent_on_tab",!0)&&(n=e).on("keydown",function(e){e.keyCode!==Se.TAB||Se.metaKeyPressed(e)||n.undoManager.transact(function(){(e.shiftKey?Un:Mn)(n)&&e.preventDefault()})}),(t=e).on("keydown",function(e){e.keyCode===Se.BACKSPACE?ft(t,!1)&&e.preventDefault():e.keyCode===Se.DELETE&&ft(t,!0)&&e.preventDefault()})};a.add("lists",function(e){var t,n,r,o,i,u;return!1===e.hasPlugin("rtc",!0)&&(mt(e),(t=e).on("BeforeExecCommand",function(e){var n=e.command.toLowerCase();"indent"===n?Mn(t):"outdent"===n&&Un(t)}),t.addCommand("InsertUnorderedList",function(e,n){et(t,"UL",n)}),t.addCommand("InsertOrderedList",function(e,n){et(t,"OL",n)}),t.addCommand("InsertDefinitionList",function(e,n){et(t,"DL",n)}),t.addCommand("RemoveList",function(){_n(t)}),t.addCommand("mceListProps",function(){dt(t)}),t.addQueryStateHandler("InsertUnorderedList",lt(t,"UL")),t.addQueryStateHandler("InsertOrderedList",lt(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",lt(t,"DL"))),r=function(e){return function(){return n.execCommand(e)}},(n=e).hasPlugin("advlist")||(n.ui.registry.addToggleButton("numlist",{icon:"ordered-list",active:!1,tooltip:"Numbered list",onAction:r("InsertOrderedList"),onSetup:function(e){return Vn(n,"OL",e.setActive)}}),n.ui.registry.addToggleButton("bullist",{icon:"unordered-list",active:!1,tooltip:"Bullet list",onAction:r("InsertUnorderedList"),onSetup:function(e){return Vn(n,"UL",e.setActive)}})),i={text:"List properties...",icon:"ordered-list",onAction:function(){return dt(o)},onSetup:function(n){return Vn(o,"OL",function(e){return n.setDisabled(!e)})}},(o=e).ui.registry.addMenuItem("listprops",i),o.ui.registry.addContextMenu("lists",{update:function(e){var n=sn(o,e);return Ve(n)?["listprops"]:[]}}),u=e,{backspaceDelete:function(e){ft(u,e)}}})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e,t,r,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},a=function(e){return function(){return e}},o=a(!1),c=a(!0),i=function(){return u},u=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:o,isSome:o,isNone:c,getOr:r=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:r,orThunk:t,map:i,each:function(){},bind:i,exists:o,forall:c,filter:i,equals:e,equals_:e,toArray:function(){return[]},toString:a("none()")}),s=function(r){var e=a(r),t=function(){return i},n=function(e){return e(r)},i={fold:function(e,t){return t(r)},is:function(e){return r===e},isSome:c,isNone:o,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return s(e(r))},each:function(e){e(r)},bind:n,exists:n,forall:n,filter:function(e){return e(r)?i:u},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,t){return e.fold(o,function(e){return t(r,e)})}};return i},l={some:s,none:i,from:function(e){return null===e||e===undefined?u:s(e)}},m=function(n){return function(e){return r=typeof(t=e),(null===t?"null":"object"==r&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":r)===n;var t,r}},d=m("string"),h=m("object"),g=m("array"),v=Array.prototype.push,f=function(e,t){for(var r=0,n=e.length;r<n;r++){t(e[r],r)}},w=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},b=Object.keys,y=Object.hasOwnProperty,x=function(e,t){return j(e,t)?l.from(e[t]):l.none()},j=function(e,t){return y.call(e,t)},O=function(e){return e.getParam("media_scripts")},S=tinymce.util.Tools.resolve("tinymce.util.Tools"),_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),k=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),A=function(e,t){if(e)for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r].filter))return e[r]},T=_.DOM,C=function(e){return e.replace(/px$/,"")},P=function(o,e){var c=w(!1),u={};return k({validate:!1,allow_conditional_comments:!0,start:function(e,t){if(!c.get())if(j(t.map,"data-ephox-embed-iri"))c.set(!0),i=(n=t).map.style,a=i?T.parseStyle(i):{},u={type:"ephox-embed-iri",source:n.map["data-ephox-embed-iri"],altsource:"",poster:"",width:x(a,"max-width").map(C).getOr(""),height:x(a,"max-height").map(C).getOr("")};else{if(u.source||"param"!==e||(u.source=t.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(u.type||(u.type=e),u=S.extend(t.map,u)),"script"===e){var r=A(o,t.map.src);if(!r)return;u={type:"script",source:t.map.src,width:String(r.width),height:String(r.height)}}"source"===e&&(u.source?u.altsource||(u.altsource=t.map.src):u.source=t.map.src),"img"!==e||u.poster||(u.poster=t.map.src)}var n,i,a}}).parse(e),u.source=u.source||u.src||u.data,u.altsource=u.altsource||"",u.poster=u.poster||"",u},D=function(e){var t={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()];return t||""},$=tinymce.util.Tools.resolve("tinymce.html.Schema"),F=tinymce.util.Tools.resolve("tinymce.html.Writer"),M=_.DOM,z=function(e){return/^[0-9.]+$/.test(e)?e+"px":e},N=function(a,e){!function(e,t){for(var r=b(e),n=0,i=r.length;n<i;n++){var a=r[n];t(e[a],a)}}(e,function(e,t){var r=""+e;if(a.map[t])for(var n=a.length;n--;){var i=a[n];i.name===t&&(r?(a.map[t]=r,i.value=r):(delete a.map[t],a.splice(n,1)))}else r&&(a.push({name:t,value:r}),a.map[t]=r)})},U=["source","altsource"],E=function(e,c,u){var s,l=F(),m=w(!1),d=0;return k({validate:!1,allow_conditional_comments:!0,comment:function(e){l.comment(e)},cdata:function(e){l.cdata(e)},text:function(e,t){l.text(e,t)},start:function(e,t,r){if(!m.get())if(j(t.map,"data-ephox-embed-iri"))m.set(!0),n=c,a=(i=t).map.style,(o=a?M.parseStyle(a):{})["max-width"]=z(n.width),o["max-height"]=z(n.height),N(i,{style:M.serializeStyle(o)});else{switch(e){case"video":case"object":case"embed":case"img":case"iframe":c.height!==undefined&&c.width!==undefined&&N(t,{width:c.width,height:c.height})}if(u)switch(e){case"video":N(t,{poster:c.poster,src:""}),c.altsource&&N(t,{src:""});break;case"iframe":N(t,{src:c.source});break;case"source":if(d<2&&(N(t,{src:c[U[d]],type:c[U[d]+"mime"]}),!c[U[d]]))return;d++;break;case"img":if(!c.poster)return;s=!0}}var n,i,a,o;l.start(e,t,r)},end:function(e){if(!m.get()){if("video"===e&&u)for(var t,r=0;r<2;r++){c[U[r]]&&((t=[]).map={},d<=r&&(N(t,{src:c[U[r]],type:c[U[r]+"mime"]}),l.start("source",t,!0)))}var n;c.poster&&"object"===e&&u&&!s&&((n=[]).map={},N(n,{src:c.poster,width:c.width,height:c.height}),l.start("img",n,!0))}l.end(e)}},$({})).parse(e),l.getContent()},R=[{regex:/youtu\.be\/([\w\-_\?&=.]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$2?$4",allowFullscreen:!0},{regex:/youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,type:"iframe",w:560,h:314,url:"www.youtube.com/embed/$1",allowFullscreen:!0},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc",allowFullscreen:!0},{regex:/vimeo\.com\/(.*)\/([0-9]+)/,type:"iframe",w:425,h:350,url:"player.vimeo.com/video/$2?title=0&byline=0",allowFullscreen:!0},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'maps.google.com/maps/ms?msid=$2&output=embed"',allowFullscreen:!1},{regex:/dailymotion\.com\/video\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0},{regex:/dai\.ly\/([^_]+)/,type:"iframe",w:480,h:270,url:"www.dailymotion.com/embed/video/$1",allowFullscreen:!0}],L=function(t){var e=R.filter(function(e){return e.regex.test(t)});return 0<e.length?S.extend({},e[0],{url:function(e,t){for(var r,n=(r=t.match(/^(https?:\/\/|www\.)(.+)$/i))&&1<r.length&&"www."!==r[1]?r[1]:"https://",i=e.regex.exec(t),a=n+e.url,o=0;o<i.length;o++)!function(e){a=a.replace("$"+e,function(){return i[e]?i[e]:""})}(o);return a.replace(/\?$/,"")}(e[0],t)}):null},I=function(r,e){var n=S.extend({},e);if(!n.source&&(S.extend(n,P(O(r),n.embed)),!n.source))return"";n.altsource||(n.altsource=""),n.poster||(n.poster=""),n.source=r.convertURL(n.source,"source"),n.altsource=r.convertURL(n.altsource,"source"),n.sourcemime=D(n.source),n.altsourcemime=D(n.altsource),n.poster=r.convertURL(n.poster,"poster");var t=L(n.source);if(t&&(n.source=t.url,n.type=t.type,n.allowFullscreen=t.allowFullscreen,n.width=n.width||String(t.w),n.height=n.height||String(t.h)),n.embed)return E(n.embed,n,!0);var i=A(O(r),n.source);i&&(n.type="script",n.width=String(i.width),n.height=String(i.height));var a,o,c,u,s,l,m,d,h=r.getParam("audio_template_callback"),f=r.getParam("video_template_callback");return n.width=n.width||"300",n.height=n.height||"150",S.each(n,function(e,t){n[t]=r.dom.encode(""+e)}),"iframe"===n.type?(d=(m=n).allowFullscreen?' allowFullscreen="1"':"",'<iframe src="'+m.source+'" width="'+m.width+'" height="'+m.height+'"'+d+"></iframe>"):"application/x-shockwave-flash"===n.sourcemime?(l='<object data="'+(s=n).source+'" width="'+s.width+'" height="'+s.height+'" type="application/x-shockwave-flash">',s.poster&&(l+='<img src="'+s.poster+'" width="'+s.width+'" height="'+s.height+'" />'),l+="</object>"):-1!==n.sourcemime.indexOf("audio")?(c=n,(u=h)?u(c):'<audio controls="controls" src="'+c.source+'">'+(c.altsource?'\n<source src="'+c.altsource+'"'+(c.altsourcemime?' type="'+c.altsourcemime+'"':"")+" />\n":"")+"</audio>"):"script"===n.type?'<script src="'+n.source+'"><\/script>':(a=n,(o=f)?o(a):'<video width="'+a.width+'" height="'+a.height+'"'+(a.poster?' poster="'+a.poster+'"':"")+' controls="controls">\n<source src="'+a.source+'"'+(a.sourcemime?' type="'+a.sourcemime+'"':"")+" />\n"+(a.altsource?'<source src="'+a.altsource+'"'+(a.altsourcemime?' type="'+a.altsourcemime+'"':"")+" />\n":"")+"</video>")},q=tinymce.util.Tools.resolve("tinymce.util.Promise"),B={},W=function(t){return function(e){return I(t,e)}},G=function(e,t){var r,n,i,a,o,c=e.getParam("media_url_resolver");return c?(i=t,a=W(e),o=c,new q(function(t,e){var r=function(e){return e.html&&(B[i.source]=e),t({url:i.source,html:e.html?e.html:a(i)})};B[i.source]?r(B[i.source]):o({url:i.source},r,e)})):(r=t,n=W(e),new q(function(e){e({html:n(r),url:r.source})}))},H=function(a,o,c){return function(e){var t=function(){return x(a,e)},r=function(){return x(o,e)},n=function(e){return x(e,"value").bind(function(e){return 0<e.length?l.some(e):l.none()})},i={};return i[e]=(e===c?t().bind(function(e){return h(e)?n(e).orThunk(r):r().orThunk(function(){return l.from(e)})}):r().orThunk(function(){return t().bind(function(e){return h(e)?n(e):l.from(e)})})).getOr(""),i}},J=function(e,t){var r,n,i=t?x(e,t).bind(function(e){return x(e,"meta")}).getOr({}):{},a=H(e,i,t);return p(p(p(p(p({},a("source")),a("altsource")),a("poster")),a("embed")),(r=i,n={},x(e,"dimensions").each(function(e){f(["width","height"],function(t){x(r,t).orThunk(function(){return x(e,t)}).each(function(e){return n[t]=e})})}),n))},K=function(e){var n=p(p({},e),{source:{value:x(e,"source").getOr("")},altsource:{value:x(e,"altsource").getOr("")},poster:{value:x(e,"poster").getOr("")}});return f(["width","height"],function(r){x(e,r).each(function(e){var t=n.dimensions||{};t[r]=e,n.dimensions=t})}),n},Q=function(r){return function(e){var t=e&&e.msg?"Media embed handler error: "+e.msg:"Media embed handler threw unknown error.";r.notificationManager.open({type:"error",text:t})}},V=function(e,t){return P(O(e),t)},X=function(i,a){return function(e){var t,r,n;d(e.url)&&0<e.url.trim().length&&(t=e.html,r=V(a,t),n=p(p({},r),{source:e.url,embed:t}),i.setData(K(n)))}},Y=function(e,t){var r=e.dom.select("img[data-mce-object]");e.insertContent(t),function(e,t){for(var r=e.dom.select("img[data-mce-object]"),n=0;n<t.length;n++)for(var i=r.length-1;0<=i;i--)t[n]===r[i]&&r.splice(i,1);e.selection.select(r[0])}(e,r),e.nodeChanged()},Z=function(e,t,r){var n;t.embed=E(t.embed,t),t.embed&&(e.source===t.source||(n=t.source,B.hasOwnProperty(n)))?Y(r,t.embed):G(r,t).then(function(e){Y(r,e.html)})["catch"](Q(r))},ee=function(m){var e,t,r,n,i=(r=(e=m).selection.getNode(),n=(t=r).getAttribute("data-mce-object")||t.getAttribute("data-ephox-embed-iri")?e.serializer.serialize(r,{selection:!0}):"",p({embed:n},P(O(e),n))),d=w(i),a=K(i),o={title:"General",name:"general",items:function(e){for(var t=[],r=0,n=e.length;r<n;++r){if(!g(e[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+e);v.apply(t,e[r])}return t}([[{name:"source",type:"urlinput",filetype:"media",label:"Source"}],m.getParam("media_dimensions",!0)?[{type:"sizeinput",name:"dimensions",label:"Constrain proportions",constrain:!0}]:[]])},c={title:"Embed",items:[{type:"textarea",name:"embed",label:"Paste your embed code below:"}]},u=[];m.getParam("media_alt_source",!0)&&u.push({name:"altsource",type:"urlinput",filetype:"media",label:"Alternative source URL"}),m.getParam("media_poster",!0)&&u.push({name:"poster",type:"urlinput",filetype:"image",label:"Media poster (Image URL)"});var s={title:"Advanced",name:"advanced",items:u},l=[o,c];0<u.length&&l.push(s);var h={type:"tabpanel",tabs:l},f=m.windowManager.open({title:"Insert/Edit Media",size:"normal",body:h,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(e){var t=J(e.getData());Z(d.get(),t,m),e.close()},onChange:function(e,t){switch(t.name){case"source":s=d.get(),l=J(e.getData(),"source"),s.source!==l.source&&(X(f,m)({url:l.source,html:""}),G(m,l).then(X(f,m))["catch"](Q(m)));break;case"embed":c=J((o=e).getData()),u=V(m,c.embed),o.setData(K(u));break;case"dimensions":case"altsource":case"poster":r=e,n=t.name,i=J(r.getData(),n),a=I(m,i),r.setData(K(p(p({},i),{embed:a})))}var r,n,i,a,o,c,u,s,l;d.set(J(e.getData()))},initialData:a})},te=tinymce.util.Tools.resolve("tinymce.html.Node"),re=tinymce.util.Tools.resolve("tinymce.Env"),ne=function(a,e){if(!1===a.getParam("media_filter_html",!0))return e;var o,c=F();return k({validate:!1,allow_conditional_comments:!1,comment:function(e){c.comment(e)},cdata:function(e){c.cdata(e)},text:function(e,t){c.text(e,t)},start:function(e,t,r){if(o=!0,"script"!==e&&"noscript"!==e&&"svg"!==e){for(var n=t.length-1;0<=n;n--){var i=t[n].name;0===i.indexOf("on")&&(delete t.map[i],t.splice(n,1)),"style"===i&&(t[n].value=a.dom.serializeStyle(a.dom.parseStyle(t[n].value),e))}c.start(e,t,r),o=!1}},end:function(e){o||c.end(e)}},$({})).parse(e),c.getContent()},ie=function(e,t,r){for(var n,i,a=t.attributes,o=a.length;o--;)n=a[o].name,i=a[o].value,"width"!==n&&"height"!==n&&"style"!==n&&("data"!==n&&"src"!==n||(i=e.convertURL(i,n)),r.attr("data-mce-p-"+n,i));var c=t.firstChild&&t.firstChild.value;c&&(r.attr("data-mce-html",escape(ne(e,c))),r.firstChild=null)},ae=function(e){for(;e=e.parent;)if(e.attr("data-ephox-embed-iri")||(t=e.attr("class"))&&/\btiny-pageembed\b/.test(t))return!0;var t;return!1},oe=function(u){return function(e){for(var t,r,n,i,a,o,c=e.length;c--;)(t=e[c]).parent&&(t.parent.attr("data-mce-object")||"script"===t.name&&!(r=A(O(u),t.attr("src")))||(r&&(r.width&&t.attr("width",r.width.toString()),r.height&&t.attr("height",r.height.toString())),"iframe"===t.name&&u.getParam("media_live_embeds",!0)&&re.ceFalse?ae(t)||t.replace(function(e,t){var r=t.name,n=new te("span",1);n.attr({contentEditable:"false",style:t.attr("style"),"data-mce-object":r,"class":"mce-preview-object mce-object-"+r}),ie(e,t,n);var i=new te(r,1);i.attr({src:t.attr("src"),allowfullscreen:t.attr("allowfullscreen"),style:t.attr("style"),"class":t.attr("class"),width:t.attr("width"),height:t.attr("height"),frameborder:"0"});var a=new te("span",1);return a.attr("class","mce-shim"),n.append(i),n.append(a),n}(u,t)):ae(t)||t.replace((n=u,o=void 0,a=(i=t).name,(o=new te("img",1)).shortEnded=!0,ie(n,i,o),o.attr({width:i.attr("width")||"300",height:i.attr("height")||("audio"===a?"30":"150"),style:i.attr("style"),src:re.transparentSrc,"data-mce-object":a,"class":"mce-object mce-object-"+a}),o))))}},ce=function(e){var t,r;e.ui.registry.addToggleButton("media",{tooltip:"Insert/edit media",icon:"embed",onAction:function(){e.execCommand("mceMedia")},onSetup:(t=e,r=["img[data-mce-object]","span[data-mce-object]","div[data-ephox-embed-iri]"],function(e){return t.selection.selectorChangedWithUnbind(r.join(","),e.setActive).unbind})}),e.ui.registry.addMenuItem("media",{icon:"embed",text:"Media...",onAction:function(){e.execCommand("mceMedia")}})};n.add("media",function(e){var t,d,r,n;return(t=e).addCommand("mceMedia",function(){ee(t)}),ce(e),e.on("ResolveName",function(e){var t;1===e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),(d=e).on("preInit",function(){var t=d.schema.getSpecialElements();S.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("</"+e+"[^>]*>","gi")});var r=d.schema.getBoolAttrs();S.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){r[e]={}}),d.parser.addNodeFilter("iframe,video,audio,object,embed,script",oe(d)),d.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var r,n,i,a,o,c,u,s,l=e.length;l--;)if((r=e[l]).parent){for(u=r.attr(t),n=new te(u,1),"audio"!==u&&"script"!==u&&((s=r.attr("class"))&&-1!==s.indexOf("mce-preview-object")?n.attr({width:r.firstChild.attr("width"),height:r.firstChild.attr("height")}):n.attr({width:r.attr("width"),height:r.attr("height")})),n.attr({style:r.attr("style")}),i=(a=r.attributes).length;i--;){var m=a[i].name;0===m.indexOf("data-mce-p-")&&n.attr(m.substr(11),a[i].value)}"script"===u&&n.attr("type","text/javascript"),(o=r.attr("data-mce-html"))&&((c=new te("#text",3)).raw=!0,c.value=ne(d,unescape(o)),n.append(c)),r.replace(n)}})}),d.on("SetContent",function(){d.$("span.mce-preview-object").each(function(e,t){var r=d.$(t);0===r.find("span.mce-shim").length&&r.append('<span class="mce-shim"></span>')})}),(r=e).on("click keyup touchend",function(){var e=r.selection.getNode();e&&r.dom.hasClass(e,"mce-preview-object")&&r.dom.getAttrib(e,"data-mce-selected")&&e.setAttribute("data-mce-selected","2")}),r.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");"audio"!==t&&"script"!==t||e.preventDefault()}),r.on("ObjectResized",function(e){var t,r=e.target;r.getAttribute("data-mce-object")&&(t=r.getAttribute("data-mce-html"))&&(t=unescape(t),r.setAttribute("data-mce-html",escape(E(t,{width:String(e.width),height:String(e.height)}))))}),n=e,{showDialog:function(){ee(n)}}})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n,e){for(var a="",o=0;o<e;o++)a+=n;return a},r=function(n,e){var a,o=n.getParam("nonbreaking_wrap",!0,"boolean")||n.plugins.visualchars?'<span class="'+((a=n).plugins.visualchars&&a.plugins.visualchars.isEnabled()?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap")+'" contenteditable="false">'+i(" ",e)+"</span>":i(" ",e);n.undoManager.transact(function(){return n.insertContent(o)})},c=tinymce.util.Tools.resolve("tinymce.util.VK");n.add("nonbreaking",function(n){var e,a,o,i,t;(e=n).addCommand("mceNonBreaking",function(){r(e,1)}),(a=n).ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:function(){return a.execCommand("mceNonBreaking")}}),a.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:function(){return a.execCommand("mceNonBreaking")}}),0<(t="boolean"==typeof(i=(o=n).getParam("nonbreaking_force_tab",0))?!0===i?3:0:i)&&o.on("keydown",function(n){if(n.keyCode===c.TAB&&!n.isDefaultPrevented()){if(n.shiftKey)return;n.preventDefault(),n.stopImmediatePropagation(),r(o,t)}})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},f=function(e){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(e)}},e=function(e){var t,r="contenteditable",n=" "+l.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",a=" "+l.trim(u(e))+" ",i=f(n),o=f(a),c=(t=e.getParam("noneditable_regexp",[]))&&t.constructor===RegExp?[t]:t;e.on("PreInit",function(){0<c.length&&e.on("BeforeSetContent",function(t){!function(t,e,n){var r=e.length,a=n.content;if("raw"!==n.format){for(;r--;)a=a.replace(e[r],function(i,o,c){return function(t){var e=arguments,n=e[e.length-2],r=0<n?o.charAt(n-1):"";if('"'===r)return t;if(">"===r){var a=o.lastIndexOf("<",n);if(-1!==a)if(-1!==o.substring(a,n).indexOf('contenteditable="false"'))return t}return'<span class="'+c+'" data-mce-content="'+i.dom.encode(e[0])+'">'+i.dom.encode("string"==typeof e[1]?e[1]:e[0])+"</span>"}}(t,a,u(t)));n.content=a}}(e,c,t)}),e.parser.addAttributeFilter("class",function(t){for(var e,n=t.length;n--;)e=t[n],i(e)?e.attr(r,"true"):o(e)&&e.attr(r,"false")}),e.serializer.addAttributeFilter(r,function(t){for(var e,n=t.length;n--;)e=t[n],(i(e)||o(e))&&(0<c.length&&e.attr("data-mce-content")?(e.name="#text",e.type=3,e.raw=!0,e.value=e.attr("data-mce-content")):e.attr(r,null))})})};t.add("noneditable",function(t){e(t)})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),i=function(e){return e.getParam("pagebreak_split_block",!1)},g=function(){return"mce-pagebreak"},m=function(){return'<img src="'+a.transparentSrc+'" class="'+g()+'" data-mce-resize="false" data-mce-placeholder />'};e.add("pagebreak",function(e){var a,n,o,c,t,r;(a=e).addCommand("mcePageBreak",function(){i(a)?a.insertContent("<p>"+m()+"</p>"):a.insertContent(m())}),(n=e).ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return n.execCommand("mcePageBreak")}}),n.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return n.execCommand("mcePageBreak")}}),c=(o=e).getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e"),t=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),o.on("BeforeSetContent",function(e){e.content=e.content.replace(t,m())}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var a,n,t=e.length;t--;)if((n=(a=e[t]).attr("class"))&&-1!==n.indexOf("mce-pagebreak")){var r=a.parent;if(o.schema.getBlockElements()[r.name]&&i(o)){r.type=3,r.value=c,r.raw=!0,a.remove();continue}a.type=3,a.value=c,a.raw=!0}})}),(r=e).on("ResolveName",function(e){"IMG"===e.target.nodeName&&r.dom.hasClass(e.target,g())&&(e.name="pagebreak")})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e,t,n,r,d=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},a=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(e){return function(){return e}},i=o(!1),s=o(!0),u=function(){return l},l=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:i,isSome:i,isNone:s,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:o(null),getOrUndefined:o(undefined),or:n,orThunk:t,map:u,each:function(){},bind:u,exists:i,forall:s,filter:u,equals:e,equals_:e,toArray:function(){return[]},toString:o("none()")}),c=function(n){var e=o(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:s,isNone:i,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return c(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?a:l},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(i,function(e){return t(n,e)})}};return a},f={some:c,none:u,from:function(e){return null===e||e===undefined?l:c(e)}},P=function(e){return!(null===(t=e)||t===undefined);var t},m=(r="function",function(e){return typeof e===r}),p=Array.prototype.slice,g=function(e,t){for(var n=0,r=e.length;n<r;n++){if(t(e[n],n))return!0}return!1},v=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var o=e[a];r[a]=t(o,a)}return r},h=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},y=m(Array.from)?Array.from:function(e){return p.call(e)},b=function(){var t=d(f.none());return{clear:function(){return t.set(f.none())},set:function(e){return t.set(f.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}}},x=function(e,t,n){return""===t||e.length>=t.length&&e.substr(n,n+t.length)===t},w=tinymce.util.Tools.resolve("tinymce.Env"),_=tinymce.util.Tools.resolve("tinymce.util.Delay"),T=tinymce.util.Tools.resolve("tinymce.util.Promise"),C=tinymce.util.Tools.resolve("tinymce.util.VK"),D=function(e,t){return e.fire("PastePlainTextToggle",{state:t})},k=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e){return e.getParam("paste_data_images",!1)},O=function(e){return e.getParam("paste_retain_style_properties")},j=function(e){return e.getParam("validate")},R=function(e){return e.getParam("paste_data_images",!1,"boolean")},A=function(e){return k.explode(e.getParam("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string"))},I="x-tinymce/html",F="\x3c!-- "+I+" --\x3e",E=function(e){return-1!==e.indexOf(F)},M=tinymce.util.Tools.resolve("tinymce.html.Entities"),N=function(e,t,n){var r=e.split(/\n\n/),a=function(e,t){var n,r=[],a="<"+e;if("object"==typeof t){for(n in t)t.hasOwnProperty(n)&&r.push(n+'="'+M.encodeAllRaw(t[n])+'"');r.length&&(a+=" "+r.join(" "))}return a+">"}(t,n),o="</"+t+">",i=k.map(r,function(e){return e.split(/\n/).join("<br />")});return 1===i.length?i[0]:k.map(i,function(e){return a+e+o}).join("")},B=tinymce.util.Tools.resolve("tinymce.html.DomParser"),H=tinymce.util.Tools.resolve("tinymce.html.Serializer"),L="\xa0",$=tinymce.util.Tools.resolve("tinymce.html.Node"),z=tinymce.util.Tools.resolve("tinymce.html.Schema");function U(t,e){return k.each(e,function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}function q(e){var t=z(),n=B({},t),r="",a=t.getShortEndedElements(),o=k.makeMap("script noscript style textarea video audio iframe object"," "),i=t.getBlockElements();return e=U(e,[/<!\[[^\]]+\]>/g]),function s(e){var t=e.name,n=e;if("br"!==t){if("wbr"!==t)if(a[t]&&(r+=" "),o[t])r+=" ";else{if(3===e.type&&(r+=e.value),!e.shortEnded&&(e=e.firstChild))for(;s(e),e=e.next;);i[t]&&n.next&&(r+="\n","p"===t&&(r+="\n"))}}else r+="\n"}(n.parse(e)),r}function V(e){return e=U(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?L:" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])}function K(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^']*\bmso-|w:WordDocument/i.test(e)||/class="OutlineElement/.test(e)||/id="?docs\-internal\-guid\-/.test(e)}function X(e){var o,i,s=1;function u(e,t){if(3!==e.type||!t.test(e.value)){if(e=e.firstChild)do{if(!u(e,t))return}while(e=e.next);return 1}e.value=e.value.replace(t,"")}function t(e,t,n){var r=e._listLevel||s;r!==s&&(o=r<s?o&&o.parent.parent:(i=o,null)),o&&o.name===t?o.append(e):(i=i||o,o=new $(t,1),1<n&&o.attr("start",""+n),e.wrap(o)),e.name="li",s<r&&i&&i.lastChild.append(o),s=r,function a(e){if(e._listIgnore)e.remove();else if(e=e.firstChild)for(;a(e),e=e.next;);}(e),u(e,/^\u00a0+/),u(e,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),u(e,/^\u00a0+/)}for(var n=[],r=e.firstChild;null!=r;)if(n.push(r),null!==(r=r.walk()))for(;void 0!==r&&r.parent!==e;)r=r.walk();for(var a=0;a<n.length;a++)if("p"===(e=n[a]).name&&e.firstChild){var l=function d(e){var t="";if(3===e.type)return e.value;if(e=e.firstChild)for(;t+=d(e),e=e.next;);return t}(e);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(l)){t(e,"ul");continue}if(function(t){var n;return t=t.replace(/^[\u00a0 ]+/,""),k.each([/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],function(e){if(e.test(t))return!(n=!0)}),n}(l)){var c=/([0-9]+)\./.exec(l),f=1;c&&(f=parseInt(c[1],10)),t(e,"ol",f);continue}if(e._listLevel){t(e,"ul",1);continue}o=null}else i=o,o=null}var W,Y,Z=function(r,e){var a,t=O(r);t&&(a=k.makeMap(t.split(/[, ]/))),e=U(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,L],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return 0<t.length?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join(L):""}]]);var n=r.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody"),o=z({valid_elements:n,valid_children:"-li[p]"});k.each(o.elements,function(e){e.attributes["class"]||(e.attributes["class"]={},e.attributesOrder.push("class")),e.attributes.style||(e.attributes.style={},e.attributesOrder.push("style"))});var i=B({},o);i.addAttributeFilter("style",function(e){for(var t,n=e.length;n--;)(t=e[n]).attr("style",function(n,r,a,o){var i,s={},e=n.dom.parseStyle(o);return k.each(e,function(e,t){switch(t){case"mso-list":(i=/\w+ \w+([0-9]+)/i.exec(o))&&(a._listLevel=parseInt(i[1],10)),/Ignore/i.test(e)&&a.firstChild&&(a._listIgnore=!0,a.firstChild._listIgnore=!0);break;case"horiz-align":t="text-align";break;case"vert-align":t="vertical-align";break;case"font-color":case"mso-foreground":t="color";break;case"mso-background":case"mso-highlight":t="background";break;case"font-weight":case"font-style":return void("normal"!==e&&(s[t]=e));case"mso-element":if(/^(comment|comment-list)$/i.test(e))return void a.remove()}0!==t.indexOf("mso-comment")?0!==t.indexOf("mso-")&&("all"===O(n)||r&&r[t])&&(s[t]=e):a.remove()}),/(bold)/i.test(s["font-weight"])&&(delete s["font-weight"],a.wrap(new $("b",1))),/(italic)/i.test(s["font-style"])&&(delete s["font-style"],a.wrap(new $("i",1))),(s=n.dom.serializeStyle(s,a.name))||null}(r,a,t,t.attr("style"))),"span"===t.name&&t.parent&&!t.attributes.length&&t.unwrap()}),i.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)n=(t=e[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&t.remove(),t.attr("class",null)}),i.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),i.addNodeFilter("a",function(e){for(var t,n,r,a=e.length;a--;)if(n=(t=e[a]).attr("href"),r=t.attr("name"),n&&-1!==n.indexOf("#_msocom_"))t.remove();else if(n&&0===n.indexOf("file://")&&(n=(n=n.split("#")[1])&&"#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.test(r)){t.unwrap();continue}t.attr({href:n,name:r})}else t.unwrap()});var s=i.parse(e);return r.getParam("paste_convert_word_fake_lists",!0)&&X(s),e=H({validate:j(r)},o).serialize(s)},G=function(e,t){return{content:e,cancelled:t}},J=function(e,t,n,r){var a,o,i,s,u,l,c,f,d,m,p,g,v=(a=t,o=n,i=r,e.fire("PastePreProcess",{content:a,internal:o,wordContent:i})),h=function(e,t){var n=B({},e.schema);n.addNodeFilter("meta",function(e){k.each(e,function(e){e.remove()})});var r=n.parse(t,{forced_root_block:!1,isRootContent:!0});return H({validate:j(e)},e.schema).serialize(r)}(e,v.content);return e.hasEventListeners("PastePostProcess")&&!v.isDefaultPrevented()?(u=h,l=n,c=r,p=(s=e).dom.create("div",{style:"display:none"},u),f=p,d=l,m=c,g=s.fire("PastePostProcess",{node:f,internal:d,wordContent:m}),G(g.node.innerHTML,g.isDefaultPrevented())):G(h,v.isDefaultPrevented())},Q=function(e,t,n){var r,a,o=K(t),i=o?(a=t,(r=e).getParam("paste_enable_default_filters",!0)?Z(r,a):a):t;return J(e,i,n,o)},ee=function(e,t){return e.insertContent(t,{merge:e.getParam("paste_merge_formats",!0),paste:!0}),!0},te=function(e){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(e)},ne=function(e,r){return te(r)&&g(A(e),function(e){return x(t=r,n="."+e,t.length-n.length);var t,n})},re=function(e,t,n){return!(!1!==e.selection.isCollapsed()||!te(t))&&(a=t,o=n,(r=e).undoManager.extra(function(){o(r,a)},function(){r.execCommand("mceInsertLink",!1,a)}),!0);var r,a,o},ae=function(e,t,n){return!!ne(e,t)&&(a=t,o=n,(r=e).undoManager.extra(function(){o(r,a)},function(){r.insertContent('<img src="'+a+'">')}),!0);var r,a,o},oe=function(e,t,n){var r,a;n||!1===e.getParam("smart_paste",!0)?ee(e,t):(r=e,a=t,k.each([re,ae,ee],function(e){return!0!==e(r,a,ee)}))},ie=function(e){return"\n"===e||"\r"===e},se=function(e,t){var n,r,a,o,i=(n=" ",(r=e.getParam("paste_tab_spaces",4,"number"))<=0?"":new Array(r+1).join(n)),s=t.replace(/\t/g,i);return(o={pcIsSpace:!(a=function(e,t){return-1!==" \f\t\x0B".indexOf(t)||t===L?e.pcIsSpace||""===e.str||e.str.length===s.length-1||(n=s,(r=e.str.length+1)<n.length&&0<=r&&ie(n[r]))?{pcIsSpace:!1,str:e.str+L}:{pcIsSpace:!0,str:e.str+" "}:{pcIsSpace:ie(t),str:e.str+t};var n,r}),str:""},h(s,function(e){o=a(o,e)}),o).str},ue=function(e,t,n,r){var a=Q(e,t,n);!1===a.cancelled&&oe(e,a.content,r)},le=function(e,t,n){var r=n||E(t);ue(e,t.replace(F,""),r,!1)},ce=function(e,t){var n,r,a,o=e.dom.encode(t).replace(/\r\n/g,"\n"),i=se(e,o),s=(n=i,r=e.getParam("forced_root_block"),a=e.getParam("forced_root_block_attrs"),r?N(n,!0===r?"p":r,a):n.replace(/\r?\n/g,"<br>"));ue(e,s,!1,!0)},fe=function(e){var t,n={};if(e&&(!e.getData||(t=e.getData("Text"))&&0<t.length&&-1===t.indexOf("data:text/mce-internal,")&&(n["text/plain"]=t),e.types))for(var r=0;r<e.types.length;r++){var a=e.types[r];try{n[a]=e.getData(a)}catch(o){n[a]=""}}return n},de=function(e,t){return t in e&&0<e[t].length},me=function(e){return de(e,"text/html")||de(e,"text/plain")},pe=(W="mceclip",Y=0,function(){return W+Y++}),ge=function(e,t){var n,r,a,o,i,s,u,l,c,f,d,m,p,g=(n=t.uri,(r=/data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(n))?{type:r[1],data:decodeURIComponent(r[2])}:{type:null,data:null}),v=g.data,h=g.type,y=pe(),b=t.blob,x=new Image;x.src=t.uri,m=x,!(p=e.getParam("images_dataimg_filter"))||p(m)?(l=void 0,(o=(a=e.editorUpload.blobCache).getByData(v,h))?l=o:(s=(i=e.getParam("images_reuse_filename")&&P(b.name))?(c=e,f=b.name,d=f.match(/([\s\S]+?)(?:\.[a-z0-9.]+)$/i),P(d)?c.dom.encode(d[1]):null):y,u=i?b.name:undefined,l=a.create(y,b,v,s,u),a.add(l)),le(e,'<img src="'+l.blobUri()+'">',!1)):le(e,'<img src="'+t.uri+'">',!1)},ve=function(e){return T.all(v(e,function(r){return new T(function(e){var t=P(r.getAsFile)?r.getAsFile():r,n=new window.FileReader;n.onload=function(){e({blob:t,uri:n.result})},n.readAsDataURL(t)})}))},he=function(e){var t=A(e);return function(r){return e=r.type,x(e,"image/",0)&&g(t,function(e){return t=e,n={jpg:"jpeg",jpe:"jpeg",jfi:"jpeg",jif:"jpeg",jfif:"jpeg",pjpeg:"jpeg",pjp:"jpeg",svg:"svg+xml"},(k.hasOwn(n,t)?"image/"+n[t]:"image/"+t)===r.type;var t,n});var e}},ye=function(t,e,n){var r,a,o,i,s="paste"===e.type?e.clipboardData:e.dataTransfer;if(R(t)&&s){var u=(r=t,o=(a=s).items?v(y(a.items),function(e){return e.getAsFile()}):[],i=a.files?y(a.files):[],function(e,t){for(var n=[],r=0,a=e.length;r<a;r++){var o=e[r];t(o,r)&&n.push(o)}return n}(0<o.length?o:i,he(r)));if(0<u.length)return e.preventDefault(),ve(u).then(function(e){n&&t.selection.setRng(n),h(e,function(e){ge(t,e)})}),!0}return!1},be=function(e){return C.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode},xe=function(s,u,l){var c,f=b(),d=b();function m(e,t,n,r,a){var o;de(t,"text/html")?o=t["text/html"]:(o=u.getHtml(),a=a||E(o),u.isDefaultContent(o)&&(r=!0)),o=V(o),u.remove();var i=!1===a&&!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(o),s=ne(e,o);o.length&&(!i||s)||(r=!0),(r||s)&&(o=de(t,"text/plain")&&i?t["text/plain"]:q(o)),u.isDefaultContent(o)?n||e.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):r?ce(e,o):le(e,o,a)}s.on("keyup",d.clear),s.on("keydown",function(e){var t,n=function(e){be(e)&&!e.isDefaultPrevented()&&u.remove()};if(be(e)&&!e.isDefaultPrevented()){if((c=e.shiftKey&&86===e.keyCode)&&w.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(e.stopImmediatePropagation(),f.set(e),d.set(!0),w.ie&&c)return e.preventDefault(),t=!0,void s.fire("paste",{ieFake:t});u.remove(),u.create(),s.once("keyup",n),s.once("paste",function(){s.off("keyup",n)})}});s.on("paste",function(e){var t=f.isSet()||d.isSet();t&&f.clear();var n,r,a=(n=s,fe(e.clipboardData||n.getDoc().dataTransfer)),o="text"===l.get()||c,i=de(a,I);c=!1,!(e.isDefaultPrevented()||(r=e.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length))&&(me(a)||!ye(s,e,u.getLastRng()||s.selection.getRng()))?(t||e.preventDefault(),!w.ie||t&&!e.ieFake||de(a,"text/html")||(u.create(),s.dom.bind(u.getEl(),"paste",function(e){e.stopPropagation()}),s.getDoc().execCommand("Paste",!1,null),a["text/html"]=u.getHtml()),de(a,"text/html")?(e.preventDefault(),i=i||E(a["text/html"]),m(s,a,t,o,i)):_.setEditorTimeout(s,function(){m(s,a,t,o,i)},0)):u.remove()})},Pe=function(i,e,t){var s;xe(i,e,t),i.parser.addNodeFilter("img",function(e,t,n){var r,a=function(e){e.attr("data-mce-object")||s===w.transparentSrc||e.remove()};if(!R(i)&&((r=n).data&&!0===r.data.paste))for(var o=e.length;o--;)(s=e[o].attr("src"))&&(0!==s.indexOf("webkit-fake-url")&&(i.getParam("allow_html_data_urls",!1,"boolean")||0!==s.indexOf("data:"))||a(e[o]))})},we=function(e){return w.ie&&e.inline?document.body:e.getBody()},_e=function(t,e,n){var r;we(r=t)!==r.getBody()&&t.dom.bind(e,"paste keyup",function(e){De(t,n)||t.fire("paste")})},Te=function(e){return e.dom.get("mcepastebin")},Ce=function(e,t){return t===e},De=function(e,t){var n,r=Te(e);return(n=r)&&"mcepastebin"===n.id&&Ce(t,r.innerHTML)},ke=function(e){var t=d(null),n="%MCEPASTEBIN%";return{create:function(){return function(e,t,n){var r=e.dom,a=e.getBody();t.set(e.selection.getRng());var o=e.dom.add(we(e),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n);(w.ie||w.gecko)&&r.setStyle(o,"left","rtl"===r.getStyle(a,"direction",!0)?65535:-65535),r.bind(o,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),_e(e,o,n),o.focus(),e.selection.select(o,!0)}(e,t,n)},remove:function(){return function(e,t){if(Te(e)){for(var n=void 0,r=t.get();n=e.dom.get("mcepastebin");)e.dom.remove(n),e.dom.unbind(n);r&&e.selection.setRng(r)}t.set(null)}(e,t)},getEl:function(){return Te(e)},getHtml:function(){return function(n){var t=function(e,t){e.appendChild(t),n.dom.remove(t,!0)},e=k.grep(we(n).childNodes,function(e){return"mcepastebin"===e.id}),r=e.shift();k.each(e,function(e){t(r,e)});for(var a=n.dom.select("div[id=mcepastebin]",r),o=a.length-1;0<=o;o--){var i=n.dom.create("div");r.insertBefore(i,a[o]),t(i,a[o])}return r?r.innerHTML:""}(e)},getLastRng:function(){return t.get()},isDefault:function(){return De(e,n)},isDefaultContent:function(e){return e===n}}},Se=function(n,r){n.addCommand("mceTogglePlainTextPaste",function(){var e,t;e=n,"text"===(t=r).pasteFormat.get()?(t.pasteFormat.set("html"),D(e,!1)):(t.pasteFormat.set("text"),D(e,!0)),e.focus()}),n.addCommand("mceInsertClipboardContent",function(e,t){t.content&&r.pasteHtml(t.content,t.internal),t.text&&r.pasteText(t.text)})},Oe=function(e,t,n){if(r=e,!1!==w.iOS||"function"!=typeof(null==r?void 0:r.setData))return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(I,t),!0}catch(a){return!1}var r},je=function(e,t,n,r){Oe(e.clipboardData,t.html,t.text)?(e.preventDefault(),r()):n(t.html,r)},Re=function(s){return function(e,t){var n=F+e,r=s.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),a=s.dom.create("div",{contenteditable:"true"},n);s.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(a),s.dom.add(s.getBody(),r);var o=s.selection.getRng();a.focus();var i=s.dom.createRng();i.selectNodeContents(a),s.selection.setRng(i),_.setTimeout(function(){s.selection.setRng(o),r.parentNode.removeChild(r),t()},0)}},Ae=function(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}},Ie=function(e){return!e.selection.isCollapsed()||!!(t=e).dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody());var t},Fe=function(e){var t,n;e.on("cut",(t=e,function(e){Ie(t)&&je(e,Ae(t),Re(t),function(){var e;w.browser.isChrome()||w.browser.isFirefox()?(e=t.selection.getRng(),_.setEditorTimeout(t,function(){t.selection.setRng(e),t.execCommand("Delete")},0)):t.execCommand("Delete")})})),e.on("copy",(n=e,function(e){Ie(n)&&je(e,Ae(n),Re(n),function(){})}))},Ee=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Me=function(e,t){return Ee.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())},Ne=function(e,t){e.focus(),e.selection.setRng(t)},Be=function(i,s,u){i.getParam("paste_block_drop",!1)&&i.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),S(i)||i.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&0<t.files.length&&e.preventDefault()}),i.on("drop",function(e){var t,n,r,a,o=Me(i,e);e.isDefaultPrevented()||u.get()||(t=s.getDataTransferItems(e.dataTransfer),n=s.hasContentType(t,I),(!s.hasHtmlOrText(t)||(r=t["text/plain"])&&0===r.indexOf("file://"))&&s.pasteImageData(e,o)||!o||!i.getParam("paste_filter_drop",!0)||(a=t["mce-internal"]||t["text/html"]||t["text/plain"])&&(e.preventDefault(),_.setEditorTimeout(i,function(){i.undoManager.transact(function(){t["mce-internal"]&&i.execCommand("Delete"),Ne(i,o),a=V(a),t["text/html"]?s.pasteHtml(a,n):s.pasteText(a)})})))}),i.on("dragstart",function(e){u.set(!0)}),i.on("dragover dragend",function(e){S(i)&&!1===u.get()&&(e.preventDefault(),Ne(i,Me(i,e))),"dragend"===e.type&&u.set(!1)})};function He(t,n){t.on("PastePreProcess",function(e){e.content=n(t,e.content,e.internal,e.wordContent)})}function Le(e,t){if(!K(t))return t;var n=[];return k.each(e.schema.getBlockElements(),function(e,t){n.push(t)}),t=U(t,[[new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g"),"$1"]]),t=U(t,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function $e(e,t,n,r){if(r||n)return t;var l,c,f,a=e.getParam("paste_webkit_styles");return!1===e.getParam("paste_remove_styles_if_webkit",!0)||"all"===a?t:(a&&(l=a.split(/[, ]/)),t=(t=l?(c=e.dom,f=e.selection.getNode(),t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,t,n,r){var a=c.parseStyle(c.decode(n)),o={};if("none"===l)return t+r;for(var i=0;i<l.length;i++){var s=a[l[i]],u=c.getStyle(f,l[i],!0);/color/.test(l[i])&&(s=c.toHex(s),u=c.toHex(u)),u!==s&&(o[l[i]]=s)}return(o=c.serializeStyle(o,"span"))?t+' style="'+o+'"'+r:t+r})):t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3")).replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r}))}function ze(n,e){n.$("a",e).find("font,u").each(function(e,t){n.dom.remove(t,!0)})}var Ue=function(n,r){return function(t){t.setActive("text"===r.pasteFormat.get());var e=function(e){return t.setActive(e.state)};return n.on("PastePlainTextToggle",e),function(){return n.off("PastePlainTextToggle",e)}}};a.add("paste",function(e){if(!1==(!!e.hasPlugin("powerpaste",!0)&&("undefined"!=typeof window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0))){var t=d(!1),n=d(e.getParam("paste_as_text",!1)?"text":"html"),r=(c=n,f=ke(l=e),l.on("PreInit",function(){return Pe(l,f,c)}),{pasteFormat:c,pasteHtml:function(e,t){return le(l,e,t)},pasteText:function(e){return ce(l,e)},pasteImageData:function(e,t){return ye(l,e,t)},getDataTransferItems:fe,hasHtmlOrText:me,hasContentType:de});i=e,w.webkit&&He(i,$e),w.ie&&(He(i,Le),u=ze,(s=i).on("PastePostProcess",function(e){u(s,e.node)}));return o=r,(a=e).ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return a.execCommand("mceTogglePlainTextPaste")},onSetup:Ue(a,o)}),a.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:function(){return a.execCommand("mceTogglePlainTextPaste")},onSetup:Ue(a,o)}),Se(e,r),function(e){var t=e.plugins.paste,n=e.getParam("paste_preprocess");n&&e.on("PastePreProcess",function(e){n.call(t,t,e)});var r=e.getParam("paste_postprocess");r&&e.on("PastePostProcess",function(e){r.call(t,t,e)})}(e),Fe(e),Be(e,r,t),{clipboard:r,quirks:void 0}}var a,o,i,s,u,l,c,f})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.Env"),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(e){var t=function(t){var n="",i=t.dom.encode,e=t.getParam("content_style","","string");n+='<base href="'+i(t.documentBaseURI.getURI())+'">',e&&(n+='<style type="text/css">'+e+"</style>");var o=t.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"";w.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'"'+o+">"});var r,a,c,s,d,m,l,y=-1===(s=(r=t).getParam("body_id","tinymce","string")).indexOf("=")?s:(c=(a=r).getParam("body_id","","hash"))[a.id]||c,u=-1===(l=(d=t).getParam("body_class","","string")).indexOf("=")?l:(m=d).getParam("body_class","","hash")[m.id]||"",v='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(f.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",g=t.getBody().dir,p=g?' dir="'+i(g)+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(y)+'" class="mce-content-body '+i(u)+'"'+p+">"+t.getContent()+v+"</body></html>"}(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")};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")}})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env");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")})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e,t,n,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=0,a=function(e,t,n){var r,o,i=e.editorUpload.blobCache,u=i.create((r="mceu",o=(new Date).getTime(),r+"_"+Math.floor(1e9*Math.random())+ ++c+String(o)),n,t);i.add(u),e.insertContent(e.dom.createHTML("img",{src:u.blobUri()}))},l=tinymce.util.Tools.resolve("tinymce.util.Promise"),s=tinymce.util.Tools.resolve("tinymce.Env"),f=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 l(function(n){var r=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",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?f.setEditorTimeout(i,t,0):t(),i.off("focusin remove",o)};i.on("focusin remove",o),r.click()}).then(function(e){var t,n;0<e.length&&(t=e[0],n=t,new l(function(e){var t=new FileReader;t.onloadend=function(){e(t.result.split(",")[1])},t.readAsDataURL(n)}).then(function(e){a(u,e,t)}))})}}),u.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:function(){var e,t,n,r,o,i;n=t=2,(e=u).plugins.table?e.plugins.table.insertTable(t,n):(o=t,i=n,(r=e).undoManager.transact(function(){r.insertContent(function(e,t){var n,r,o='<table data-mce-id="mce" style="width: 100%">';for(o+="<tbody>",r=0;r<t;r++){for(o+="<tr>",n=0;n<e;n++)o+="<td><br></td>";o+="</tr>"}return o+="</tbody>",o+="</table>"}(o,i));var e=r.dom.select("*[data-mce-id]")[0];e.removeAttribute("data-mce-id");var t=r.dom.select("td,th",e);r.selection.setCursorLocation(t[0],0)}))}})},u=function(e){return function(){return e}},d=u(!1),m=u(!0),g=function(){return h},h=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:d,isSome:d,isNone:m,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:g,each:function(){},bind:g,exists:d,forall:m,filter:g,equals:e,equals_:e,toArray:function(){return[]},toString:u("none()")}),p=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:m,isNone:d,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return p(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?o:h},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(d,function(e){return t(n,e)})}};return o},b={some:p,none:g,from:function(e){return null===e||e===undefined?h:p(e)}},y=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}},v=function(t){return function(e){return typeof e===t}},k=y("string"),w=y("object"),T=y("array"),N=v("boolean"),q=(r=undefined,function(e){return r===e}),E=v("function");function M(e,t,n,r,o){return e(n,r)?b.some(n):E(o)&&o(n)?b.none():t(n,r,o)}var S,C=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:e}},O={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return C(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return C(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return C(n)},fromDom:C,fromPoint:function(e,t,n){return b.from(e.dom.elementFromPoint(t,n)).map(C)}},x=function(e,t){var n=e.dom;if(1!==n.nodeType)return!1;var r=n;if(r.matches!==undefined)return r.matches(t);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(t);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(t);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},A=("undefined"!=typeof window||Function("return this;")(),function(e,t,n){for(var r=e.dom,o=E(n)?n:d;r.parentNode;){r=r.parentNode;var i=O.fromDom(r);if(t(i))return b.some(i);if(o(i))break}return b.none()}),D=function(e,t,n){return A(e,function(e){return x(e,t)},n)},_=(S=k,function(e,t,n){return function(e,t){if(!t(e))throw new Error("Default value doesn't match requested type.")}(n,S),function(e,t){if(T(e)||w(e))throw new Error("expected a string but found: "+e);return q(e)?t:N(e)?!1===e?"":t:e}(e.getParam(t,n),n)}),L=function(o){var e=_(o,"quickbars_insert_toolbar","quickimage quicktable");0<e.trim().length&&o.ui.registry.addContextToolbar("quickblock",{predicate:function(e){var t=O.fromDom(e),n=o.schema.getTextBlockElements(),r=function(e){return e.dom===o.getBody()};return M(x,D,t,"table",r).fold(function(){return M(function(e,t){return t(e)},A,t,function(e){return e.dom.nodeName.toLowerCase()in n&&o.dom.isEmpty(e.dom)},r).isSome()},function(){return!1})},items:e,position:"line",scope:"editor"})},P=function(n){var r=function(e){return"IMG"===e.nodeName||"FIGURE"===e.nodeName&&/image/i.test(e.className)},e=_(n,"quickbars_image_toolbar","alignleft aligncenter alignright");0<e.trim().length&&n.ui.registry.addContextToolbar("imageselection",{predicate:r,items:e,position:"node"});var t=_(n,"quickbars_selection_toolbar","bold italic | quicklink h2 h3 blockquote");0<t.trim().length&&n.ui.registry.addContextToolbar("textselection",{predicate:function(e){return!r(e)&&!n.selection.isCollapsed()&&(t=e,"false"!==n.dom.getContentEditableParent(t));var t},items:t,position:"selection",scope:"editor"})};o.add("quickbars",function(e){i(e),L(e),P(e)})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(e){return e.getParam("save_enablewhendirty",!0)},c=function(e,n){e.notificationManager.open({text:n,type:"error"})},t=function(t){t.addCommand("mceSave",function(){!function(e){var n=o.DOM.getParent(e.id,"form");if(!i(e)||e.isDirty()){if(e.save(),e.getParam("save_onsavecallback"))return e.execCallback("save_onsavecallback",e),e.nodeChanged();n?(e.setDirty(!1),n.onsubmit&&!n.onsubmit()||("function"==typeof n.submit?n.submit():c(e,"Error: Form submit field collision.")),e.nodeChanged()):c(e,"Error: No form element found.")}}(t)}),t.addCommand("mceCancel",function(){var e,n;e=t,n=a.trim(e.startContent),e.getParam("save_oncancelcallback")?e.execCallback("save_oncancelcallback",e):e.resetContent(n)})},r=function(t){return function(e){var n=function(){e.setDisabled(i(t)&&!t.isDirty())};return t.on("NodeChange dirty",n),function(){return t.off("NodeChange dirty",n)}}};e.add("save",function(e){var n;(n=e).ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return n.execCommand("mceSave")},onSetup:r(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:r(n)}),n.addShortcut("Meta+S","","mceSave"),t(e)})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e,t,n,r,d=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),h=function(){return(h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},i=function(e){return function(){return e}},a=i(!1),m=i(!0),u=i("[!-#%-*,-\\/:;?@\\[-\\]_{}\xa1\xab\xb7\xbb\xbf;\xb7\u055a-\u055f\u0589\u058a\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\u1368\u1400\u166d\u166e\u169b\u169c\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb\ufd3e\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a\uff1b\uff1f\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]"),c=function(){return l},l=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:a,isSome:a,isNone:m,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:i(null),getOrUndefined:i(undefined),or:n,orThunk:t,map:c,each:function(){},bind:c,exists:a,forall:m,filter:c,equals:e,equals_:e,toArray:function(){return[]},toString:i("none()")}),s=function(n){var e=i(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:m,isNone:a,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return s(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?o:l},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(a,function(e){return t(n,e)})}};return o},g={some:s,none:c,from:function(e){return null===e||e===undefined?l:s(e)}},p=u,v=tinymce.util.Tools.resolve("tinymce.util.Tools"),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}},y=function(t){return function(e){return typeof e===t}},x=f("string"),b=f("array"),w=y("boolean"),O=y("number"),C=Array.prototype.slice,T=Array.prototype.push,N=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o)}return r},E=function(e,t){for(var n=0,r=e.length;n<r;n++){t(e[n],n)}},k=function(e,t){for(var n=e.length-1;0<=n;n--){t(e[n],n)}},S=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!b(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);T.apply(t,e[n])}return t}(N(e,t))},A=Object.hasOwnProperty,D=function(e,t){return A.call(e,t)},M=("undefined"!=typeof window||Function("return this;")(),r=3,function(e){return e.dom.nodeType===r}),B=function(e,t,n){!function(e,t,n){if(!(x(n)||w(n)||O(n)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")}(e.dom,t,n)},F=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:e}},I={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return F(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return F(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return F(n)},fromDom:F,fromPoint:function(e,t,n){return g.from(e.dom.elementFromPoint(t,n)).map(F)}},P=function(e,t){return{element:e,offset:t}},R=function(e,t){var n=N(e.dom.childNodes,I.fromDom);return 0<n.length&&t<n.length?P(n[t],0):P(e,t)},W=function(t,n){var e;(e=t,g.from(e.dom.parentNode).map(I.fromDom)).each(function(e){e.dom.insertBefore(n.dom,t.dom)})},j=function(e,t){var n;W(e,t),n=e,t.dom.appendChild(n.dom)};var q,V,_,H=(q=M,V="text",{get:function(e){if(!q(e))throw new Error("Can only get "+V+" value of a "+V+" node");return _(e).getOr("")},getOption:_=function(e){return q(e)?g.from(e.dom.nodeValue):g.none()},set:function(e,t){if(!q(e))throw new Error("Can only set raw "+V+" value of a "+V+" node");e.dom.nodeValue=t}}),L=function(e){return H.get(e)},U=function(e,t){return n=t,i=(r=e)===undefined?document:r.dom,1!==(o=i).nodeType&&9!==o.nodeType&&11!==o.nodeType||0===o.childElementCount?[]:N(i.querySelectorAll(n),I.fromDom);var n,r,o,i},$=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),z=function(e,t){return e.isBlock(t)||D(e.schema.getShortEndedElements(),t.nodeName)},G=function(e,t){return"false"===e.getContentEditable(t)},K=function(e,t){return!e.isBlock(t)&&D(e.schema.getWhiteSpaceElements(),t.nodeName)},J=function(){return{sOffset:0,fOffset:0,elements:[]}},Q=function(e,t){return R(I.fromDom(e),t)},X=function(e,t,n,r,o,i){void 0===i&&(i=!0);for(var a=i?t(!1):n;a;){var u=G(e,a);if(u||K(e,a)){if(u?r.cef(a):r.boundary(a))break;a=t(!0)}else{if(z(e,a)){if(r.boundary(a))break}else 3===a.nodeType&&r.text(a);if(a===o)break;a=t(!1)}}},Y=function(e,t,n,r,o){var i,a,u,c,l,s,f;z(i=e,a=n)||G(i,a)||K(i,a)||(c=a,"true"===(u=i).getContentEditable(c)&&"false"===u.getContentEditableParent(c.parentNode))||(l=e.getParent(r,e.isBlock),s=new $(n,l),f=o?s.next:s.prev,X(e,f,n,{boundary:m,cef:m,text:function(e){o?t.fOffset+=e.length:t.sOffset+=e.length,t.elements.push(I.fromDom(e))}}))},Z=function(e,t,n,r,o,i){void 0===i&&(i=!0);var a=new $(n,t),u=[],c=J();Y(e,c,n,t,!1);var l=function(){return 0<c.elements.length&&(u.push(c),c=J()),!1};return X(e,a.next,n,{boundary:l,cef:function(e){return l(),o&&u.push.apply(u,o.cef(e)),!1},text:function(e){c.elements.push(I.fromDom(e)),o&&o.text(e,c)}},r,i),r&&Y(e,c,r,t,!0),l(),u},ee=function(i,e){var n=Q(e.startContainer,e.startOffset),r=n.element.dom,o=Q(e.endContainer,e.endOffset),a=o.element.dom;return Z(i,e.commonAncestorContainer,r,a,{text:function(e,t){e===a?t.fOffset+=e.length-o.offset:e===r&&(t.sOffset+=n.offset)},cef:function(e){var t,n,r,o=S(U(I.fromDom(e),"*[contenteditable=true]"),function(e){var t=e.dom;return Z(i,t,t)});return t=o,n=function(e,t){return n=e.elements[0].dom,r=t.elements[0].dom,o=n,i=r,a=Node.DOCUMENT_POSITION_PRECEDING,0!=(o.compareDocumentPosition(i)&a)?1:-1;var n,r,o,i,a},(r=C.call(t,0)).sort(n),r}},!1)},te=function(e,t){return t.collapsed?[]:ee(e,t)},ne=function(e,t){var n=e.createRng();return n.selectNode(t),te(e,n)},re=function(e,a){var t,n;return function(e,t){if(0===e.length)return[];for(var n=t(e[0]),r=[],o=[],i=0,a=e.length;i<a;i++){var u=e[i],c=t(u);c!==n&&(r.push(o),o=[]),n=c,o.push(u)}return 0!==o.length&&r.push(o),r}((t=function(e,n){var t=L(n),r=e.last,o=r+t.length,i=S(a,function(e,t){return e.start<o&&e.finish>r?[{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},E(e,function(e){n=t(n,e)}),n.results),function(e){return e.matchId})},oe=function(o,e){return S(e,function(e){var t=e.elements,n=N(t,L).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 u=i[t.matchIndex],c=i.index+i[0].indexOf(u),l=c+u.length;if(r<l)break;a.push({start:c,finish:l}),o.lastIndex=l}return a}(n,o,e.sOffset,n.length-e.fOffset);return re(t,r)})},ie=function(e,i){k(e,function(e,o){k(e,function(e){var t=I.fromDom(i.cloneNode(!1));B(t,"data-mce-index",o);var n,r=e.element.dom;r.length===e.finish&&0===e.start?j(e.element,t):(r.length!==e.finish&&r.splitText(e.finish),n=r.splitText(e.start),j(I.fromDom(n),t))})})},ae=function(e,t,n,r){var o,i=n.getBookmark(),a=e.select("td[data-mce-selected],th[data-mce-selected]"),u=0<a.length?(o=e,S(a,function(e){return ne(o,e)})):te(e,n.getRng()),c=oe(t,u);return ie(c,r),n.moveToBookmark(i),c.length},ue=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},ce=function(e,t,n,r){var o=e.dom.create("span",{"data-mce-bogus":1});o.className="mce-match-marker";var i,a,u,c,l,s=e.getBody();return ye(e,t,!1),r?ae(e.dom,n,e.selection,o):(i=e.dom,a=n,u=o,c=ne(i,s),l=oe(a,c),ie(l,u),l.length)},le=function(e){var t=e.parentNode;e.firstChild&&t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)},se=function(e,t){var n=[],r=v.toArray(e.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var i=ue(r[o]);null!==i&&i.length&&i===t.toString()&&n.push(r[o])}return n},fe=function(e,t,n){var r=t.get(),o=r.index,i=e.dom;(n=!1!==n)?o+1===r.count?o=0:o++:o-1==-1?o=r.count-1:o--,i.removeClass(se(e,r.index),"mce-match-marker-selected");var a=se(e,o);return a.length?(i.addClass(se(e,o),"mce-match-marker-selected"),e.selection.scrollIntoView(a[0]),o):-1},de=function(e,t){var n=t.parentNode;e.remove(t),e.isEmpty(n)&&e.remove(n)},me=function(e,t,n,r,o,i){var a,u,c,l=(a=o,u="("+n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&").replace(/\s/g,"[^\\S\\r\\n\\uFEFF]")+")",a?"(?:^|\\s|"+p()+")"+u+"(?=$|\\s|"+p()+")":u),s={regex:new RegExp(l,r?"g":"gi"),matchIndex:1},f=ce(e,t,s,i);return f&&(c=fe(e,t,!0),t.set({index:c,count:f,text:n,matchCase:r,wholeWord:o,inSelection:i})),f},he=function(e,t){var n=fe(e,t,!0);t.set(h(h({},t.get()),{index:n}))},ge=function(e,t){var n=fe(e,t,!1);t.set(h(h({},t.get()),{index:n}))},pe=function(e){var t=ue(e);return null!==t&&0<t.length},ve=function(e,t,n,r,o){var i,a=t.get(),u=a.index,c=u;r=!1!==r;for(var l=e.getBody(),s=v.grep(v.toArray(l.getElementsByTagName("span")),pe),f=0;f<s.length;f++){var d=ue(s[f]),m=i=parseInt(d,10);if(o||m===a.index){for(n.length?(s[f].firstChild.nodeValue=n,le(s[f])):de(e.dom,s[f]);s[++f];){if((m=parseInt(ue(s[f]),10))!==i){f--;break}de(e.dom,s[f])}r&&c--}else u<i&&s[f].setAttribute("data-mce-index",String(i-1))}return t.set(h(h({},a),{count:o?0:a.count-1,index:c})),(r?he:ge)(e,t),!o&&0<t.get().count},ye=function(e,t,n){for(var r,o,i=t.get(),a=v.toArray(e.getBody().getElementsByTagName("span")),u=0;u<a.length;u++){var c=ue(a[u]);null!==c&&c.length&&(c===i.index.toString()&&(r=r||a[u].firstChild,o=a[u].firstChild),le(a[u]))}if(t.set(h(h({},i),{index:-1,count:0,text:""})),r&&o){var l=e.dom.createRng();return l.setStart(r,0),l.setEnd(o,o.data.length),!1!==n&&e.selection.setRng(l),l}},xe=tinymce.util.Tools.resolve("tinymce.Env"),be=function(i,a){var t,e=(t=d(g.none()),{clear:function(){return t.set(g.none())},set:function(e){return t.set(g.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}});i.undoManager.add();var n=v.trim(i.selection.getContent({format:"text"}));function u(e){(1<a.get().count?e.enable:e.disable)("next"),(1<a.get().count?e.enable:e.disable)("prev")}var c=function(e,t){var n=t?e.disable:e.enable;E(["replace","replaceall","prev","next"],n)};var l=function(e,t){xe.browser.isSafari()&&xe.deviceType.isTouch()&&("find"===t||"replace"===t||"replaceall"===t)&&e.focus(t)},s=function(e){ye(i,a,!1),c(e,!0),u(e)},f=function(e){var t,n,r=e.getData(),o=a.get();r.findtext.length?(o.text===r.findtext&&o.matchCase===r.matchcase&&o.wholeWord===r.wholewords?he(i,a):((t=me(i,a,r.findtext,r.matchcase,r.wholewords,r.inselection))<=0&&(n=e,i.windowManager.alert("Could not find the specified string.",function(){n.focus("findtext")})),c(e,0===t)),u(e)):s(e)},r=a.get(),o={title:"Find and Replace",size:"normal",body:{type:"panel",items:[{type:"bar",items:[{type:"input",name:"findtext",placeholder:"Find",maximized:!0,inputMode:"search"},{type:"button",name:"prev",text:"Previous",icon:"action-prev",disabled:!0,borderless:!0},{type:"button",name:"next",text:"Next",icon:"action-next",disabled:!0,borderless:!0}]},{type:"input",name:"replacetext",placeholder:"Replace with",inputMode:"search"}]},buttons:[{type:"menu",name:"options",icon:"preferences",tooltip:"Preferences",align:"start",items:[{type:"togglemenuitem",name:"matchcase",text:"Match case"},{type:"togglemenuitem",name:"wholewords",text:"Find whole words only"},{type:"togglemenuitem",name:"inselection",text:"Find in selection"}]},{type:"custom",name:"find",text:"Find",primary:!0},{type:"custom",name:"replace",text:"Replace",disabled:!0},{type:"custom",name:"replaceall",text:"Replace All",disabled:!0}],initialData:{findtext:n,replacetext:"",wholewords:r.wholeWord,matchcase:r.matchCase,inselection:r.inSelection},onChange:function(e,t){"findtext"===t.name&&0<a.get().count&&s(e)},onAction:function(e,t){var n,r,o=e.getData();switch(t.name){case"find":f(e);break;case"replace":(ve(i,a,o.replacetext)?u:s)(e);break;case"replaceall":ve(i,a,o.replacetext,!0,!0),s(e);break;case"prev":ge(i,a),u(e);break;case"next":he(i,a),u(e);break;case"matchcase":case"wholewords":case"inselection":n=e.getData(),r=a.get(),a.set(h(h({},r),{matchCase:n.matchcase,wholeWord:n.wholewords,inSelection:n.inselection})),s(e)}l(e,t.name)},onSubmit:function(e){f(e),l(e,"find")},onClose:function(){i.focus(),ye(i,a),i.undoManager.add()}};e.set(i.windowManager.open(o,{inline:"toolbar"}))},we=function(e,t){return function(){be(e,t)}};o.add("searchreplace",function(e){var t,n,r,o,i,a,u=d({index:-1,count:0,text:"",matchCase:!1,wholeWord:!1,inSelection:!1});return n=u,(t=e).addCommand("SearchReplace",function(){be(t,n)}),o=u,(r=e).ui.registry.addMenuItem("searchreplace",{text:"Find and replace...",shortcut:"Meta+F",onAction:we(r,o),icon:"search"}),r.ui.registry.addButton("searchreplace",{tooltip:"Find and replace",onAction:we(r,o),icon:"search"}),r.shortcuts.add("Meta+F","",we(r,o)),i=e,a=u,{done:function(e){return ye(i,a,e)},find:function(e,t,n,r){return void 0===r&&(r=!1),me(i,a,e,t,n,r)},next:function(){return he(i,a)},prev:function(){return ge(i,a)},replace:function(e,t,n){return ve(i,a,e,t,n)}}})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var N=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=Object.hasOwnProperty,g=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.URI"),f=tinymce.util.Tools.resolve("tinymce.util.XHR"),h=function(e){return e.getParam("spellchecker_rpc_url")},k=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\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 p(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var r=function(i,r){var n,a=[],v=r.dom,f=r.schema.getBlockElements(),h=r.schema.getWhiteSpaceElements(),g=r.schema.getShortEndedElements();function o(e){var t=i.getElementsByTagName("*"),n=[];e="number"==typeof e?""+e:null;for(var r=0;r<t.length;r++){var o=t[r],a=o.getAttribute("data-mce-index");null!==a&&a.length&&-1!==o.className.indexOf("mce-spellchecker-word")&&(a!==e&&null!==e||n.push(o))}return n}function c(e){for(var t=a.length;t--;)if(a[t]===e)return t;return-1}function e(e){for(var t=0,n=a.length;t<n&&!1!==e(a[t],t);t++);return this}function t(e){for(var t=o(e?c(e):null),n=t.length;n--;)!function(e){for(var t=e.parentNode;0<e.childNodes.length;)t.insertBefore(e.childNodes[0],e);t.removeChild(e)}(t[n]);return this}function s(e){var t=o(c(e)),n=r.dom.createRng();return n.setStartBefore(t[0]),n.setEndAfter(t[t.length-1]),n}var l=function u(e){var t;if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!f[e.nodeName])return"";if(p(e))return"\n";if(t="",(f[e.nodeName]||g[e.nodeName])&&(t+="\n"),e=e.firstChild)for(;t+=u(e),e=e.nextSibling;);return t}(i);return{text:l,matches:a,each:e,filter:function(n){var r=[];return e(function(e,t){n(e,t)&&r.push(e)}),a=r,this},reset:function(){return a.splice(0,a.length),t(),this},matchFromElement:function(e){return a[e.getAttribute("data-mce-index")]},elementFromMatch:function(e){return o(c(e))[0]},find:function(e,t){if(l&&e.global)for(;n=e.exec(l);)a.push(function(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}}(n,t));return this},add:function(e,t,n){return a.push({start:e,end:e+t,text:l.substr(e,t),data:n}),this},wrap:function(e){function m(e,t){var n=a[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}var o;return a.length&&function(e,t,n){var r,o,a,i,c,s=[],l=0,u=e,d=0;(t=t.slice(0)).sort(function(e,t){return e.start-t.start}),c=t.shift();e:for(;;){if((f[u.nodeName]||g[u.nodeName]||p(u))&&l++,3===u.nodeType&&(!o&&u.length+l>=c.end?(o=u,i=c.end-l):r&&s.push(u),!r&&u.length+l>c.start&&(r=u,a=c.start-l),l+=u.length),r&&o){if(u=n({startNode:r,startNodeIndex:a,endNode:o,endNodeIndex:i,innerNodes:s,match:c.text,matchIndex:d}),l-=o.length-i,o=r=null,s=[],d++,!(c=t.shift()))break}else if(h[u.nodeName]&&!f[u.nodeName]||!u.firstChild){if(u.nextSibling){u=u.nextSibling;continue}}else if(!p(u)){u=u.firstChild;continue}for(;;){if(u.nextSibling){u=u.nextSibling;break}if(u.parentNode===e)break e;u=u.parentNode}}}(i,a,(o=e,function(e){var t,n,r=e.startNode,o=e.endNode,a=e.matchIndex,i=v.doc;if(r===o){var c=r,s=c.parentNode;0<e.startNodeIndex&&(t=i.createTextNode(c.data.substring(0,e.startNodeIndex)),s.insertBefore(t,c));var l=m(e.match,a);return s.insertBefore(l,c),e.endNodeIndex<c.length&&(n=i.createTextNode(c.data.substring(e.endNodeIndex)),s.insertBefore(n,c)),c.parentNode.removeChild(c),l}t=i.createTextNode(r.data.substring(0,e.startNodeIndex)),n=i.createTextNode(o.data.substring(e.endNodeIndex));for(var u=m(r.data.substring(e.startNodeIndex),a),d=0,f=e.innerNodes.length;d<f;++d){var h=e.innerNodes[d],g=m(h.data,a);h.parentNode.replaceChild(g,h)}var p=m(o.data.substring(0,e.endNodeIndex),a);return(s=r.parentNode).insertBefore(t,r),s.insertBefore(u,r),s.removeChild(r),(s=o.parentNode).insertBefore(p,o),s.insertBefore(n,o),s.removeChild(o),p})),this},unwrap:t,replace:function(e,t){var n=s(e);return n.deleteContents(),0<t.length&&n.insertNode(r.dom.doc.createTextNode(t)),n},rangeFromMatch:s,indexOf:c}},u=function(e,t){var n;return t.get()||(n=r(e.getBody(),e),t.set(n)),t.get()},m=function(e,t,n,r,o,a,i){var c,s,l,u=e.getParam("spellchecker_callback");(u||(c=e,s=t,l=n,function(e,t,r,o){var n={method:e,lang:l.get()},a="";n["addToDictionary"===e?"word":"text"]=t,g.each(n,function(e,t){a&&(a+="&"),a+=t+"="+encodeURIComponent(e)}),f.send({url:new d(s).toAbsolute(h(c)),type:"post",content_type:"application/x-www-form-urlencoded",data:a,success:function(e){var t,n=JSON.parse(e);n?n.error?o(n.error):r(n):(t=c.translate("Server response wasn't proper JSON."),o(t))},error:function(){var e=c.translate("The spelling service was not found: (")+h(c)+c.translate(")");o(e)}})})).call(e.plugins.spellchecker,r,o,a,i)},y=function(t,e,n,r,o,a){i(t,n,r)||(t.setProgressState(!0),m(t,e,a,"spellcheck",u(t,r).text,function(e){S(t,n,r,o,e)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1),i(t,n,r)}),t.focus())},v=function(e,t,n){e.dom.select("span.mce-spellchecker-word").length||i(e,t,n)},o=function(t,e,n,r,o,a){t.selection.collapse(),a?g.each(t.dom.select("span.mce-spellchecker-word"),function(e){e.getAttribute("data-mce-word")===r&&t.dom.remove(e,!0)}):t.dom.remove(o,!0),v(t,e,n)},i=function(e,t,n){var r=e.selection.getBookmark();if(u(e,n).reset(),e.selection.moveToBookmark(r),n.set(null),t.get())return t.set(!1),e.fire("SpellcheckEnd"),!0},x=function(e){var t=e.getAttribute("data-mce-index");return"number"==typeof t?""+t:t},S=function(t,e,n,r,o){var a=!!o.dictionary,i=o.words;if(t.setProgressState(!1),function(e){for(var t in e)if(l.call(e,t))return!1;return!0}(i)){var c=t.translate("No misspellings found.");return t.notificationManager.open({text:c,type:"info"}),void e.set(!1)}r.set({suggestions:i,hasDictionarySupport:a});var s=t.selection.getBookmark();u(t,n).find(k(t)).filter(function(e){return!!i[e.text]}).wrap(function(e){return t.dom.create("span",{"class":"mce-spellchecker-word","aria-invalid":"spelling","data-mce-bogus":1,"data-mce-word":e.text})}),t.selection.moveToBookmark(s),e.set(!0),t.fire("SpellcheckStart")},b=function(){return(b=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},w="SpellcheckStart SpellcheckEnd",T=function(n,e,r,t,o,a){var i,c,s,l=(s=n,i=g.map(s.getParam("spellchecker_languages","English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv").split(","),function(e){var t=e.split("=");return{name:t[0],value:t[1]}}),c=[],g.each(i,function(e){c.push({selectable:!0,text:e.name,data:e.value})}),c),u=function(){y(n,e,r,t,a,o)},d={tooltip:"Spellcheck",onAction:u,icon:"spell-check",onSetup:function(e){var t=function(){e.setActive(r.get())};return n.on(w,t),function(){n.off(w,t)}}},f=b(b({},d),{type:"splitbutton",select:function(e){return e===o.get()},fetch:function(e){e(g.map(l,function(e){return{type:"choiceitem",value:e.data,text:e.text}}))},onItemAction:function(e,t){o.set(t)}});1<l.length?n.ui.registry.addSplitButton("spellchecker",f):n.ui.registry.addToggleButton("spellchecker",d),n.ui.registry.addToggleMenuItem("spellchecker",{text:"Spellcheck",icon:"spell-check",onSetup:function(e){e.setActive(r.get());var t=function(){e.setActive(r.get())};return n.on(w,t),function(){n.off(w,t)}},onAction:u})},A=function(c,s,e,l,u,d,f,h){var t=[],n=e.get().suggestions[f];return g.each(n,function(e){t.push({text:e,onAction:function(){c.insertContent(c.dom.encode(e)),c.dom.remove(h),v(c,l,u)}})}),e.get().hasDictionarySupport&&(t.push({type:"separator"}),t.push({text:"Add to dictionary",onAction:function(){var t,e,n,r,o,a,i;e=s,n=l,r=u,o=d,a=f,i=h,(t=c).setProgressState(!0),m(t,e,o,"addToDictionary",a,function(){t.setProgressState(!1),t.dom.remove(i,!0),v(t,n,r)},function(e){t.notificationManager.open({text:e,type:"error"}),t.setProgressState(!1)})}})),t.push.apply(t,[{type:"separator"},{text:"Ignore",onAction:function(){o(c,l,u,f,h)}},{text:"Ignore all",onAction:function(){o(c,l,u,f,h,!0)}}]),t},B=function(o,a,i,c,s,l){o.ui.registry.addContextMenu("spellchecker",{update:function(e){var t=e;if("mce-spellchecker-word"!==t.className)return[];var n=function(e,t){var n=[],r=g.toArray(e.getBody().getElementsByTagName("span"));if(r.length)for(var o=0;o<r.length;o++){var a=x(r[o]);null!==a&&a.length&&a===t.toString()&&n.push(r[o])}return n}(o,x(t));if(0<n.length){var r=o.dom.createRng();return r.setStartBefore(n[0]),r.setEndAfter(n[n.length-1]),o.selection.setRng(r),A(o,a,i,c,s,l,t.getAttribute("data-mce-word"),n)}}})};e.add("spellchecker",function(e,t){if(!1==(!!e.hasPlugin("tinymcespellchecker",!0)&&("undefined"!=typeof window.console&&window.console.log&&window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),!0))){var n=N(!1),r=N((x=(v=e).getParam("language","en"),v.getParam("spellchecker_language",x))),o=N(null),a=N(null);return T(e,t,n,o,r,a),B(e,t,a,n,o,r),f=t,h=n,g=o,p=a,m=r,(d=e).addCommand("mceSpellCheck",function(){y(d,f,h,g,p,m)}),i=e,c=n,s=a,l=o,u=r,{getTextMatcher:function(){return l.get()},getWordCharPattern:function(){return k(i)},markErrors:function(e){S(i,c,l,s,e)},getLanguage:function(){return u.get()}}}var i,c,s,l,u,d,f,h,g,p,m,v,x})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),m=t.DOM,n=function(e){e.keyCode!==f.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(s){function e(i){var o,l,e,t,n,u;function r(e){var t=m.select(":input:enabled,*[tabindex]:not(iframe)");function n(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&c.get(i.id)&&-1!==e.tabIndex&&function t(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&t(e.parentNode)}(e)}if(d.each(t,function(e,t){if(e.id===s.id)return o=t,!1}),0<e){for(l=o+1;l<t.length;l++)if(n(t[l]))return t[l]}else for(l=o-1;0<=l;l--)if(n(t[l]))return t[l];return null}i.keyCode!==f.TAB||i.ctrlKey||i.altKey||i.metaKey||i.isDefaultPrevented()||(1===(e=d.explode((t=s).getParam("tab_focus",t.getParam("tabfocus_elements",":prev,:next")))).length&&(e[1]=e[0],e[0]=":prev"),(n=i.shiftKey?":prev"===e[0]?r(-1):m.get(e[0]):":next"===e[1]?r(1):m.get(e[1]))&&(u=c.get(n.id||n.name),n.id&&u?u.focus():y.setTimeout(function(){a.webkit||window.focus(),n.focus()},10),i.preventDefault()))}s.on("init",function(){s.inline&&m.setAttrib(s.getBody(),"tabIndex",null),s.on("keyup",n),a.gecko?s.on("keypress keydown",e):s.on("keydown",e)})};e.add("tabfocus",function(e){i(e)})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var y=function(){},b=function(n){return function(){return n}},d=function(n){return n};function w(r){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=o.concat(n);return r.apply(null,t)}}var n,e,t,r,g=function(e){return function(n){return!e(n)}},f=b(!1),C=b(!0),o=function(){return u},u=(n=function(n){return n.isNone()},{fold:function(n,e){return n()},is:f,isSome:f,isNone:C,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:b(null),getOrUndefined:b(undefined),or:t,orThunk:e,map:o,each:y,bind:o,exists:f,forall:C,filter:o,equals:n,equals_:n,toArray:function(){return[]},toString:b("none()")}),i=function(t){var n=b(t),e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:C,isNone:f,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return i(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){return n(t)?o:u},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(f,function(n){return e(t,n)})}};return o},x={some:i,none:o,from:function(n){return null===n||n===undefined?u:i(n)}},c=function(r){return function(n){return t=typeof(e=n),(null===e?"null":"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t)===r;var e,t}},a=function(e){return function(n){return typeof n===e}},p=c("string"),h=c("object"),l=c("array"),s=a("boolean"),m=(r=undefined,function(n){return r===n}),v=function(n){return!(null===(e=n)||e===undefined);var e},S=a("function"),T=a("number"),R=Array.prototype.slice,O=Array.prototype.indexOf,D=Array.prototype.push,A=function(n,e){return t=n,r=e,-1<O.call(t,r);var t,r},I=function(n,e){for(var t=0,r=n.length;t<r;t++){if(e(n[t],t))return!0}return!1},B=function(n,e){for(var t=[],r=0;r<n;r++)t.push(e(r));return t},E=function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var u=n[o];r[o]=e(u,o)}return r},P=function(n,e){for(var t=0,r=n.length;t<r;t++){e(n[t],t)}},k=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var u=n[r];e(u,r)&&t.push(u)}return t},M=function(n,e,t){return function(n,e){for(var t=n.length-1;0<=t;t--){e(n[t],t)}}(n,function(n){t=e(t,n)}),t},N=function(n,e,t){return P(n,function(n){t=e(t,n)}),t},j=function(n,e){return function(n,e,t){for(var r=0,o=n.length;r<o;r++){var u=n[r];if(e(u,r))return x.some(u);if(t(u,r))break}return x.none()}(n,e,f)},_=function(n,e){for(var t=0,r=n.length;t<r;t++){if(e(n[t],t))return x.some(t)}return x.none()},z=function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!l(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);D.apply(e,n[t])}return e},W=function(n,e){return z(E(n,e))},F=function(n,e){for(var t=0,r=n.length;t<r;++t){if(!0!==e(n[t],t))return!1}return!0},L=function(n){return[n]},H=function(n,e){return 0<=e&&e<n.length?x.some(n[e]):x.none()},q=function(n){return H(n,n.length-1)},V=function(n,e){for(var t=0;t<n.length;t++){var r=e(n[t],t);if(r.isSome())return r}return x.none()},U=function(){return(U=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function $(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),o=0,e=0;e<t;e++)for(var u=arguments[e],i=0,c=u.length;i<c;i++,o++)r[o]=u[i];return r}var G,K=function(t){var r,o=!1;return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return o||(o=!0,r=t.apply(null,n)),r}},X=function(n,e){var t=function(n,e){for(var t=0;t<n.length;t++){var r=n[t];if(r.test(e))return r}return undefined}(n,e);if(!t)return{major:0,minor:0};var r=function(n){return Number(e.replace(t,"$"+n))};return J(r(1),r(2))},Y=function(){return J(0,0)},J=function(n,e){return{major:n,minor:e}},Q={nu:J,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?Y():X(n,t)},unknown:Y},Z=function(n,e){var t=String(e).toLowerCase();return j(n,function(n){return n.search(t)})},nn=function(n,t){return Z(n,t).map(function(n){var e=Q.detect(n.versionRegexes,t);return{current:n.name,version:e}})},en=function(n,t){return Z(n,t).map(function(n){var e=Q.detect(n.versionRegexes,t);return{current:n.name,version:e}})},tn=function(n,e,t){return""===e||n.length>=e.length&&n.substr(t,t+e.length)===e},rn=function(n,e){return-1!==n.indexOf(e)},on=function(n,e){return tn(n,e,0)},un=function(n,e){return tn(n,e,n.length-e.length)},cn=(G=/^\s+|\s+$/g,function(n){return n.replace(G,"")}),an=function(n){return 0<n.length},ln=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,fn=function(e){return function(n){return rn(n,e)}},sn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return rn(n,"edge/")&&rn(n,"chrome")&&rn(n,"safari")&&rn(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,ln],search:function(n){return rn(n,"chrome")&&!rn(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return rn(n,"msie")||rn(n,"trident")}},{name:"Opera",versionRegexes:[ln,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:fn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:fn("firefox")},{name:"Safari",versionRegexes:[ln,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(rn(n,"safari")||rn(n,"mobile/"))&&rn(n,"applewebkit")}}],dn=[{name:"Windows",search:fn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return rn(n,"iphone")||rn(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:fn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:fn("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:fn("linux"),versionRegexes:[]},{name:"Solaris",search:fn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:fn("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:fn("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],mn={browsers:b(sn),oses:b(dn)},gn="Firefox",pn=function(n){var e=n.current,t=n.version,r=function(n){return function(){return e===n}};return{current:e,version:t,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r(gn),isSafari:r("Safari")}},hn={unknown:function(){return pn({current:undefined,version:Q.unknown()})},nu:pn,edge:b("Edge"),chrome:b("Chrome"),ie:b("IE"),opera:b("Opera"),firefox:b(gn),safari:b("Safari")},vn="Windows",bn="Android",wn="Solaris",yn="FreeBSD",Cn="ChromeOS",xn=function(n){var e=n.current,t=n.version,r=function(n){return function(){return e===n}};return{current:e,version:t,isWindows:r(vn),isiOS:r("iOS"),isAndroid:r(bn),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r(wn),isFreeBSD:r(yn),isChromeOS:r(Cn)}},Sn={unknown:function(){return xn({current:undefined,version:Q.unknown()})},nu:xn,windows:b(vn),ios:b("iOS"),android:b(bn),linux:b("Linux"),osx:b("OSX"),solaris:b(wn),freebsd:b(yn),chromeos:b(Cn)},Tn=function(n,e){var t,r,o,u,i,c,a,l,f,s,d,m,g=mn.browsers(),p=mn.oses(),h=nn(g,n).fold(hn.unknown,hn.nu),v=en(p,n).fold(Sn.unknown,Sn.nu);return{browser:h,os:v,deviceType:(r=h,o=n,u=e,i=(t=v).isiOS()&&!0===/ipad/i.test(o),c=t.isiOS()&&!i,a=t.isiOS()||t.isAndroid(),l=a||u("(pointer:coarse)"),f=i||!c&&a&&u("(min-device-width:768px)"),s=c||a&&!f,d=r.isSafari()&&t.isiOS()&&!1===/safari/i.test(o),m=!s&&!f&&!d,{isiPad:b(i),isiPhone:b(c),isTablet:b(f),isPhone:b(s),isTouch:b(l),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:b(d),isDesktop:b(m)})}},Rn=function(n){return window.matchMedia(n).matches},On=K(function(){return Tn(navigator.userAgent,Rn)}),Dn=function(){return On()},An=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:n}},In={fromHtml:function(n,e){var t=(e||document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return An(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return An(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return An(t)},fromDom:An,fromPoint:function(n,e,t){return x.from(n.dom.elementFromPoint(e,t)).map(An)}},Bn=function(n,e){var t=n.dom;if(1!==t.nodeType)return!1;var r=t;if(r.matches!==undefined)return r.matches(e);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(e);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(e);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},En=function(n){return 1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount},Pn=function(n,e){return n.dom===e.dom},kn=function(n,e){return t=n.dom,r=e.dom,o=t,u=r,i=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(o.compareDocumentPosition(u)&i);var t,r,o,u,i},Mn=function(n,e){return Dn().browser.isIE()?kn(n,e):(t=e,r=n.dom,o=t.dom,r!==o&&r.contains(o));var t,r,o},Nn=Bn,jn=Object.keys,_n=Object.hasOwnProperty,zn=function(n,e){for(var t=jn(n),r=0,o=t.length;r<o;r++){var u=t[r];e(n[u],u)}},Wn=function(n,t){return Fn(n,function(n,e){return{k:e,v:t(n,e)}})},Fn=function(n,r){var o={};return zn(n,function(n,e){var t=r(n,e);o[t.k]=t.v}),o},Ln=function(n,e){var t,r,o,u,i={};return t=e,u=i,r=function(n,e){u[e]=n},o=y,zn(n,function(n,e){(t(n,e)?r:o)(n,e)}),i},Hn=function(n){return t=function(n){return n},r=[],zn(n,function(n,e){r.push(t(n,e))}),r;var t,r},qn=function(n,e){return Vn(n,e)?x.from(n[e]):x.none()},Vn=function(n,e){return _n.call(n,e)},Un=["tfoot","thead","tbody","colgroup"],$n=function(n,e,t){return{element:n,rowspan:e,colspan:t}},Gn=function(n,e,t){return{element:n,cells:e,section:t}},Kn=function(n,e){return{element:n,isNew:e}},Xn=function(n,e){return{cells:n,section:e}},Yn=("undefined"!=typeof window||Function("return this;")(),function(n){return n.dom.nodeName.toLowerCase()}),Jn=function(n){return n.dom.nodeType},Qn=function(e){return function(n){return Jn(n)===e}},Zn=function(n){return 8===Jn(n)||"#comment"===Yn(n)},ne=Qn(1),ee=Qn(3),te=Qn(9),re=Qn(11),oe=function(n){return In.fromDom(n.dom.ownerDocument)},ue=function(n){return te(n)?n:oe(n)},ie=function(n){return x.from(n.dom.parentNode).map(In.fromDom)},ce=function(n,e){for(var t=S(e)?e:f,r=n.dom,o=[];null!==r.parentNode&&r.parentNode!==undefined;){var u=r.parentNode,i=In.fromDom(u);if(o.push(i),!0===t(i))break;r=u}return o},ae=function(n){return x.from(n.dom.previousSibling).map(In.fromDom)},le=function(n){return x.from(n.dom.nextSibling).map(In.fromDom)},fe=function(n){return E(n.dom.childNodes,In.fromDom)},se=function(n,e){var t=n.dom.childNodes;return x.from(t[e]).map(In.fromDom)},de=S(Element.prototype.attachShadow)&&S(Node.prototype.getRootNode),me=b(de),ge=de?function(n){return In.fromDom(n.dom.getRootNode())}:ue,pe=function(n){var e=ge(n);return re(e)?x.some(e):x.none()},he=function(n){return In.fromDom(n.dom.host)},ve=function(n){if(me()&&v(n.target)){var e=In.fromDom(n.target);if(ne(e)&&be(e)&&n.composed&&n.composedPath){var t=n.composedPath();if(t)return H(t,0)}}return x.from(n.target)},be=function(n){return v(n.dom.shadowRoot)},we=function(n){var e=ee(n)?n.dom.parentNode:n.dom;if(e===undefined||null===e||null===e.ownerDocument)return!1;var t,r,o=e.ownerDocument;return pe(In.fromDom(e)).fold(function(){return o.body.contains(e)},(t=we,r=he,function(n){return t(r(n))}))},ye=function(n){var e=n.dom.body;if(null===e||e===undefined)throw new Error("Body is not available yet");return In.fromDom(e)},Ce=function(n,e){var t=[];return P(fe(n),function(n){e(n)&&(t=t.concat([n])),t=t.concat(Ce(n,e))}),t},xe=function(n,e,t){return r=function(n){return Bn(n,e)},k(ce(n,t),r);var r},Se=function(n,e){return t=function(n){return Bn(n,e)},k(fe(n),t);var t},Te=function(n,e){return t=e,o=(r=n)===undefined?document:r.dom,En(o)?[]:E(o.querySelectorAll(t),In.fromDom);var t,r,o};function Re(n,e,t,r,o){return n(t,r)?x.some(t):S(o)&&o(t)?x.none():e(t,r,o)}var Oe=function(n,e,t){for(var r=n.dom,o=S(t)?t:f;r.parentNode;){r=r.parentNode;var u=In.fromDom(r);if(e(u))return x.some(u);if(o(u))break}return x.none()},De=function(n,e,t){return Oe(n,function(n){return Bn(n,e)},t)},Ae=function(n,e){return t=function(n){return Bn(n,e)},j(n.dom.childNodes,function(n){return t(In.fromDom(n))}).map(In.fromDom);var t},Ie=function(n,e){return t=e,o=(r=n)===undefined?document:r.dom,En(o)?x.none():x.from(o.querySelector(t)).map(In.fromDom);var t,r,o},Be=function(n,e,t){return Re(Bn,De,n,e,t)},Ee=function(n,e,t){if(!(p(t)||s(t)||T(t)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")},Pe=function(n,e,t){Ee(n.dom,e,t)},ke=function(n,e){var t=n.dom;zn(e,function(n,e){Ee(t,e,n)})},Me=function(n,e){var t=n.dom.getAttribute(e);return null===t?undefined:t},Ne=function(n,e){return x.from(Me(n,e))},je=function(n,e){n.dom.removeAttribute(e)},_e=function(n){return N(n.dom.attributes,function(n,e){return n[e.name]=e.value,n},{})},ze=function(n){return n.style!==undefined&&S(n.style.getPropertyValue)},We=function(n,e,t){if(!p(t))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);ze(n)&&n.style.setProperty(e,t)},Fe=function(n,e,t){var r=n.dom;We(r,e,t)},Le=function(n,e){var t=n.dom;zn(e,function(n,e){We(t,e,n)})},He=function(n,e){var t=n.dom,r=window.getComputedStyle(t).getPropertyValue(e);return""!==r||we(n)?r:qe(t,e)},qe=function(n,e){return ze(n)?n.style.getPropertyValue(e):""},Ve=function(n,e){var t=n.dom,r=qe(t,e);return x.from(r).filter(function(n){return 0<n.length})},Ue=function(n,e){var t,r,o=n.dom;r=e,ze(t=o)&&t.style.removeProperty(r),Ne(n,"style").map(cn).is("")&&je(n,"style")},$e=function(n,e,t){return void 0===t&&(t=0),Ne(n,e).map(function(n){return parseInt(n,10)}).getOr(t)},Ge=function(n,e){return $e(n,e,1)},Ke=function(n){return 1<Ge(n,"colspan")},Xe=function(n){return 1<Ge(n,"rowspan")},Ye=function(n,e){return parseInt(He(n,e),10)},Je=b(10),Qe=b(10),Ze=function(n,e){return nt(n,e,C)},nt=function(n,e,t){return W(fe(n),function(n){return Bn(n,e)?t(n)?[n]:[]:nt(n,e,t)})},et=function(n,e){return function(n,e,t){if(void 0===t&&(t=f),t(e))return x.none();if(A(n,Yn(e)))return x.some(e);return De(e,n.join(","),function(n){return Bn(n,"table")||t(n)})}(["td","th"],n,e)},tt=function(n){return Ze(n,"th,td")},rt=function(n){return Bn(n,"colgroup")?Se(n,"col"):W(it(n),function(n){return Se(n,"col")})},ot=function(n,e){return Be(n,"table",e)},ut=function(n){return Ze(n,"tr")},it=function(n){return ot(n).fold(b([]),function(n){return Se(n,"colgroup")})},ct=function(n,t){return E(n,function(n){if("colgroup"===Yn(n)){var e=E(rt(n),function(n){var e=$e(n,"span",1);return $n(n,1,e)});return Gn(n,e,"colgroup")}e=E(tt(n),function(n){var e=$e(n,"rowspan",1),t=$e(n,"colspan",1);return $n(n,e,t)});return Gn(n,e,t(n))})},at=function(n){return ie(n).map(function(n){var e=Yn(n);return A(Un,e)?e:"tbody"}).getOr("tbody")},lt=function(n){var e=ut(n),t=$(it(n),e);return ct(t,at)},ft=function(n,e){return n+","+e},st=function(n,e){var t=W(n.all,function(n){return n.cells});return k(t,e)},dt=function(n){var a={},e=[],t={},r=0,l=0,f=0;return P(n,function(n){var c,o,u;"colgroup"===n.section?(o={},u=0,P(n.cells,function(t){var r=t.colspan;B(r,function(n){var e=u+n;o[e]={element:t.element,colspan:r,column:e}}),u+=r}),t=o):(c=[],P(n.cells,function(n){for(var e=0;a[ft(f,e)]!==undefined;)e++;for(var t={element:n.element,rowspan:n.rowspan,colspan:n.colspan,row:f,column:e},r=0;r<n.colspan;r++)for(var o=0;o<n.rowspan;o++){var u=e+r,i=ft(f+o,u);a[i]=t,l=Math.max(l,u+1)}c.push(t)}),r++,e.push(Gn(n.element,c,n.section)),f++)}),{grid:{rows:r,columns:l},access:a,all:e,columns:t}},mt={fromTable:function(n){var e=lt(n);return dt(e)},generate:dt,getAt:function(n,e,t){var r=n.access[ft(e,t)];return r!==undefined?x.some(r):x.none()},findItem:function(n,e,t){var r=st(n,function(n){return t(e,n.element)});return 0<r.length?x.some(r[0]):x.none()},filterItems:st,justCells:function(n){return W(n.all,function(n){return n.cells})},justColumns:function(n){return Hn(n.columns)},hasColumns:function(n){return 0<jn(n.columns).length},getColumnAt:function(n,e){return x.from(n.columns[e])}},gt=function(n,e){var t=e.column,r=e.column+e.colspan-1,o=e.row,u=e.row+e.rowspan-1;return t<=n.finishCol&&r>=n.startCol&&o<=n.finishRow&&u>=n.startRow},pt=function(n,e){return e.column>=n.startCol&&e.column+e.colspan-1<=n.finishCol&&e.row>=n.startRow&&e.row+e.rowspan-1<=n.finishRow},ht=function(n,e,t){var r=mt.findItem(n,e,Pn),o=mt.findItem(n,t,Pn);return r.bind(function(r){return o.map(function(n){return e=r,t=n,{startRow:Math.min(e.row,t.row),startCol:Math.min(e.column,t.column),finishRow:Math.max(e.row+e.rowspan-1,t.row+t.rowspan-1),finishCol:Math.max(e.column+e.colspan-1,t.column+t.colspan-1)};var e,t})})},vt=function(e,n,t){return ht(e,n,t).bind(function(n){return function(n,e){for(var t=!0,r=w(pt,e),o=e.startRow;o<=e.finishRow;o++)for(var u=e.startCol;u<=e.finishCol;u++)t=t&&mt.getAt(n,o,u).exists(r);return t?x.some(e):x.none()}(e,n)})},bt=function(t,n,e){return ht(t,n,e).map(function(n){var e=mt.filterItems(t,w(gt,n));return E(e,function(n){return n.element})})},wt=function(n,e){return mt.findItem(n,e,function(n,e){return Mn(e,n)}).map(function(n){return n.element})},yt=function(i,c,a){return ot(i).bind(function(n){var r,e,o,u,t=xt(n);return r=t,e=i,o=c,u=a,mt.findItem(r,e,Pn).bind(function(n){var e=0<o?n.row+n.rowspan-1:n.row,t=0<u?n.column+n.colspan-1:n.column;return mt.getAt(r,e+o,t+u).map(function(n){return n.element})})})},Ct=function(n,e,t,r,o){var u=xt(n),i=Pn(n,t)?x.some(e):wt(u,e),c=Pn(n,o)?x.some(r):wt(u,r);return i.bind(function(e){return c.bind(function(n){return bt(u,e,n)})})},xt=mt.fromTable,St=function(e,t){ie(e).each(function(n){n.dom.insertBefore(t.dom,e.dom)})},Tt=function(n,e){le(n).fold(function(){ie(n).each(function(n){Ot(n,e)})},function(n){St(n,e)})},Rt=function(e,t){se(e,0).fold(function(){Ot(e,t)},function(n){e.dom.insertBefore(t.dom,n.dom)})},Ot=function(n,e){n.dom.appendChild(e.dom)},Dt=function(n,e){St(n,e),Ot(e,n)},At=function(r,o){P(o,function(n,e){var t=0===e?r:o[e-1];Tt(t,n)})},It=function(e,n){P(n,function(n){Ot(e,n)})},Bt=function(n){n.dom.textContent="",P(fe(n),function(n){Et(n)})},Et=function(n){var e=n.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Pt=function(n){var e,t=fe(n);0<t.length&&(e=n,P(t,function(n){St(e,n)})),Et(n)};var kt,Mt,Nt,jt=(kt=ee,Mt="text",{get:function(n){if(!kt(n))throw new Error("Can only get "+Mt+" value of a "+Mt+" node");return Nt(n).getOr("")},getOption:Nt=function(n){return kt(n)?x.from(n.dom.nodeValue):x.none()},set:function(n,e){if(!kt(n))throw new Error("Can only set raw "+Mt+" value of a "+Mt+" node");n.dom.nodeValue=e}}),_t=function(n){return jt.get(n)},zt=function(n){return jt.getOption(n)},Wt=function(n,e){return jt.set(n,e)},Ft=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","li","table","thead","tbody","tfoot","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"];function Lt(){return{up:b({selector:De,closest:Be,predicate:Oe,all:ce}),down:b({selector:Te,predicate:Ce}),styles:b({get:He,getRaw:Ve,set:Fe,remove:Ue}),attrs:b({get:Me,set:Pe,remove:je,copyTo:function(n,e){var t=_e(n);ke(e,t)}}),insert:b({before:St,after:Tt,afterAll:At,append:Ot,appendAll:It,prepend:Rt,wrap:Dt}),remove:b({unwrap:Pt,remove:Et}),create:b({nu:In.fromTag,clone:function(n){return In.fromDom(n.dom.cloneNode(!1))},text:In.fromText}),query:b({comparePosition:function(n,e){return n.dom.compareDocumentPosition(e.dom)},prevSibling:ae,nextSibling:le}),property:b({children:fe,name:Yn,parent:ie,document:function(n){return ue(n).dom},isText:ee,isComment:Zn,isElement:ne,getText:_t,setText:Wt,isBoundary:function(n){return!!ne(n)&&("body"===Yn(n)||A(Ft,Yn(n)))},isEmptyTag:function(n){return!!ne(n)&&A(["br","img","hr","input"],Yn(n))},isNonEditable:function(n){return ne(n)&&"false"===Me(n,"contenteditable")}}),eq:Pn,is:Nn}}var Ht=function(r,o,n,e){var t=o(r,n);return M(e,function(n,e){var t=o(r,e);return qt(r,n,t)},t)},qt=function(e,n,t){return n.bind(function(n){return t.filter(w(e.eq,n))})},Vt=function(n,e,t){return 0<t.length?Ht(n,e,(r=t)[0],r.slice(1)):x.none();var r},Ut=function(t,n,e,r){void 0===r&&(r=f);var o=[n].concat(t.up().all(n)),u=[e].concat(t.up().all(e)),i=function(e){return _(e,r).fold(function(){return e},function(n){return e.slice(0,n+1)})},c=i(o),a=i(u),l=j(c,function(n){return I(a,(e=n,w(t.eq,e)));var e});return{firstpath:c,secondpath:a,shared:l}},$t=Lt(),Gt=function(t,n){return Vt($t,function(n,e){return t(e)},n)},Kt=function(n){return De(n,"table")},Xt=function(l,f,s){var d=function(e){return function(n){return s!==undefined&&s(n)||Pn(n,e)}};return Pn(l,f)?x.some({boxes:x.some([l]),start:l,finish:f}):Kt(l).bind(function(a){return Kt(f).bind(function(u){if(Pn(a,u))return x.some({boxes:(o=l,i=f,c=xt(a),bt(c,o,i)),start:l,finish:f});if(Mn(a,u)){var n=0<(e=xe(f,"td,th",d(a))).length?e[e.length-1]:f;return x.some({boxes:Ct(a,l,a,f,u),start:l,finish:n})}if(Mn(u,a)){var e,t=0<(e=xe(l,"td,th",d(u))).length?e[e.length-1]:l;return x.some({boxes:Ct(u,l,a,f,u),start:l,finish:t})}return Ut($t,l,f,r).shared.bind(function(n){return Be(n,"table",s).bind(function(n){var e=xe(f,"td,th",d(n)),t=0<e.length?e[e.length-1]:f,r=xe(l,"td,th",d(n)),o=0<r.length?r[r.length-1]:l;return x.some({boxes:Ct(n,l,a,f,u),start:o,finish:t})})});var r,o,i,c})})},Yt=function(n,e){var t=Te(n,e);return 0<t.length?x.some(t):x.none()},Jt=function(n,e,r){return Ie(n,e).bind(function(t){return Ie(n,r).bind(function(e){return Gt(Kt,[t,e]).map(function(n){return{first:t,last:e,table:n}})})})},Qt=function(n,e,t,r,o){return u=o,j(n,function(n){return Bn(n,u)}).bind(function(n){return yt(n,e,t).bind(function(n){return t=r,De(e=n,"table").bind(function(n){return Ie(n,t).bind(function(n){return Xt(n,e).bind(function(e){return e.boxes.map(function(n){return{boxes:n,start:e.start,finish:e.finish}})})})});var e,t})});var u},Zt=Yt,nr=function(o,n,e){return Jt(o,n,e).bind(function(i){var n=function(n){return Pn(o,n)},e="thead,tfoot,tbody,table",t=De(i.first,e,n),r=De(i.last,e,n);return t.bind(function(u){return r.bind(function(n){return Pn(u,n)?(e=i.table,t=i.first,r=i.last,o=xt(e),vt(o,t,r)):x.none();var e,t,r,o})})})},er=function(i){if(!l(i))throw new Error("cases must be an array");if(0===i.length)throw new Error("there must be at least one case");var c=[],t={};return P(i,function(n,r){var e=jn(n);if(1!==e.length)throw new Error("one and only one name per case");var o=e[0],u=n[o];if(t[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!l(u))throw new Error("case arguments must be an array");c.push(o),t[o]=function(){var n=arguments.length;if(n!==u.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+u.length+" ("+u+"), got "+n);for(var t=new Array(n),e=0;e<t.length;e++)t[e]=arguments[e];return{fold:function(){if(arguments.length!==i.length)throw new Error("Wrong number of arguments to fold. Expected "+i.length+", got "+arguments.length);return arguments[r].apply(null,t)},match:function(n){var e=jn(n);if(c.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+e.join(","));if(!F(c,function(n){return A(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+c.join(", "));return n[o].apply(null,t)},log:function(n){console.log(n,{constructors:c,constructor:o,params:t})}}}}),t},tr=er([{none:[]},{multiple:["elements"]},{single:["element"]}]),rr=function(n,e,t,r){return n.fold(e,t,r)},or=tr.none,ur=tr.multiple,ir=tr.single,cr=function(n,e,t){return{get:function(){return Zt(n(),t).fold(function(){return e().map(ir).getOrThunk(or)},function(n){return ur(n)})}}},ar=tinymce.util.Tools.resolve("tinymce.PluginManager"),lr=function(n,e,t,r){for(var o,u,i,c=e.grid.columns,a=e.grid.rows,l=0;l<a;l++)for(var f=!1,s=0;s<c;s++){l<t.minRow||l>t.maxRow||s<t.minCol||s>t.maxCol||(mt.getAt(e,l,s).filter(r).isNone()?(o=f,0,u=n[l].element,i=In.fromTag("td"),Ot(i,In.fromTag("br")),(o?Ot:Rt)(u,i)):f=!0)}},fr=function(n,e){var t,u,r,i,c,a,l,o,f,s,d=function(n){return Bn(n.element,e)},m=lt(n),g=mt.generate(m),p=(u=d,r=(t=g).grid.columns,i=t.grid.rows,c=r,l=a=0,zn(t.access,function(n){var e,t,r,o;u(n)&&(t=(e=n.row)+n.rowspan-1,o=(r=n.column)+n.colspan-1,e<i?i=e:a<t&&(a=t),r<c?c=r:l<o&&(l=o))}),{minRow:i,minCol:c,maxRow:a,maxCol:l}),h="th:not("+e+"),td:not("+e+")",v=nt(n,"th,td",function(n){return Bn(n,h)});return P(v,Et),lr(m,g,p,d),f=p,s=k(Ze(o=n,"tr"),function(n){return 0===n.dom.childElementCount}),P(s,Et),f.minCol!==f.maxCol&&f.minRow!==f.maxRow||P(Ze(o,"th,td"),function(n){je(n,"rowspan"),je(n,"colspan")}),je(o,"width"),je(o,"height"),Ue(o,"width"),Ue(o,"height"),n},sr=function(n){return"img"===Yn(n)?1:zt(n).fold(function(){return fe(n).length},function(n){return n.length})},dr=["img","br"],mr=function(n){return zt(n).filter(function(n){return 0!==n.trim().length||-1<n.indexOf("\xa0")}).isSome()||A(dr,Yn(n))},gr=function(n){return o=mr,(u=function(n){for(var e=0;e<n.childNodes.length;e++){var t=In.fromDom(n.childNodes[e]);if(o(t))return x.some(t);var r=u(n.childNodes[e]);if(r.isSome())return r}return x.none()})(n.dom);var o,u},pr=function(n){return hr(n,mr)},hr=function(n,u){var i=function(n){for(var e=fe(n),t=e.length-1;0<=t;t--){var r=e[t];if(u(r))return x.some(r);var o=i(r);if(o.isSome())return o}return x.none()};return i(n)},vr=function(n,e){return In.fromDom(n.dom.cloneNode(e))},br=function(n){return vr(n,!1)},wr=function(n){return vr(n,!0)},yr=function(n,e){var t,r,o,u,i=(t=n,r=e,o=In.fromTag(r),u=_e(t),ke(o,u),o),c=fe(wr(n));return It(i,c),i},Cr={scope:["row","col"]},xr=function(){var n=In.fromTag("td");return Ot(n,In.fromTag("br")),n},Sr=function(){return In.fromTag("col")},Tr=function(){return In.fromTag("colgroup")},Rr=function(n,e,t){var r=yr(n,e);return zn(t,function(n,e){null===n?je(r,e):Pe(r,e,n)}),r},Or=function(n){return n},Dr=function(n){return function(){return In.fromTag("tr",n.dom)}},Ar=function(f,n,s){var d=function(n,e){var t,r,o,u;t=n.element,r=e,o=t.dom,u=r.dom,ze(o)&&ze(u)&&(u.style.cssText=o.style.cssText),Ue(e,"height"),1!==n.colspan&&Ue(n.element,"width")};return{col:function(n){var e=oe(n.element),t=In.fromTag(Yn(n.element),e.dom);return d(n,t),f(n.element,t),t},colgroup:Tr,row:Dr(n),cell:function(n){var r,o,u,i,c,e=oe(n.element),t=In.fromTag(Yn(n.element),e.dom),a=s.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),l=0<a.length?(r=n.element,o=t,u=a,gr(r).map(function(n){var e=u.join(","),t=xe(n,e,function(n){return Pn(n,r)});return M(t,function(n,e){var t=br(e);return je(t,"contenteditable"),Ot(n,t),t},o)}).getOr(o)):t;return Ot(l,In.fromTag("br")),d(n,t),i=n.element,c=t,zn(Cr,function(e,t){return Ne(i,t).filter(function(n){return A(e,n)}).each(function(n){return Pe(c,t,n)})}),f(n.element,t),t},replace:Rr,gap:xr}},Ir=function(n){return{col:Sr,colgroup:Tr,row:Dr(n),cell:xr,replace:Or,gap:xr}},Br=function(n){return E(n,In.fromDom)},Er=function(n){return rr(n.get(),b([]),d,L)},Pr="data-mce-selected",kr="data-mce-first-selected",Mr="data-mce-last-selected",Nr={selected:Pr,selectedSelector:"td[data-mce-selected],th[data-mce-selected]",firstSelected:kr,firstSelectedSelector:"td[data-mce-first-selected],th[data-mce-first-selected]",lastSelected:Mr,lastSelectedSelector:"td[data-mce-last-selected],th[data-mce-last-selected]"},jr=function(n){return{element:n,mergable:x.none(),unmergable:x.none(),selection:[n]}},_r=function(n,e,t){return{element:t,mergable:(u=e,i=Nr,rr(n.get(),x.none,function(e){return e.length<=1?x.none():nr(u,i.firstSelectedSelector,i.lastSelectedSelector).map(function(n){return{bounds:n,cells:e}})},x.none)),unmergable:(r=function(n,e){return Ne(n,e).exists(function(n){return 1<parseInt(n,10)})},0<(o=Er(n)).length&&F(o,function(n){return r(n,"rowspan")||r(n,"colspan")})?x.some(o):x.none()),selection:Er(n)};var r,o,u,i},zr=function(s,n,d,m){s.on("BeforeGetContent",function(t){!0===t.selection&&rr(n.get(),y,function(n){t.preventDefault(),ot(n[0]).map(wr).map(function(n){return[fr(n,"[data-mce-selected]")]}).each(function(n){var e;t.content="text"===t.format?E(n,function(n){return n.dom.innerText}).join(""):(e=s,E(n,function(n){return e.selection.serializer.serialize(n.dom,{})}).join(""))})},y)}),s.on("BeforeSetContent",function(f){!0===f.selection&&!0===f.paste&&x.from(s.dom.getParent(s.selection.getStart(),"th,td")).each(function(n){var l=In.fromDom(n);ot(l).each(function(e){var n,t,r,o,u,i,c,a=k((n=f.content,(r=(t||document).createElement("div")).innerHTML=n,fe(In.fromDom(r))),function(n){return"meta"!==Yn(n)});1===a.length&&(c=a[0],"table"===Yn(c))&&(f.preventDefault(),o=In.fromDom(s.getDoc()),u=Ir(o),i={element:l,clipboard:a[0],generators:u},d.pasteCells(e,i).each(function(n){s.selection.setRng(n),s.focus(),m.clear(e)}))})})})},Wr=er([{none:[]},{only:["index"]},{left:["index","next"]},{middle:["prev","index","next"]},{right:["prev","index"]}]),Fr=U({},Wr),Lr=function(n,e,r,o,u){var t,i,c=n.slice(0),a=(i=e,0===(t=n).length?Fr.none():1===t.length?Fr.only(0):0===i?Fr.left(0,1):i===t.length-1?Fr.right(i-1,i):0<i&&i<t.length-1?Fr.middle(i-1,i,i+1):Fr.none()),l=b(E(c,b(0)));return a.fold(l,function(n){return o.singleColumnWidth(c[n],r)},function(n,e){return u.calcLeftEdgeDeltas(c,n,e,r,o.minCellWidth(),o.isRelative)},function(n,e,t){return u.calcMiddleDeltas(c,n,e,t,r,o.minCellWidth(),o.isRelative)},function(n,e){return u.calcRightEdgeDeltas(c,n,e,r,o.minCellWidth(),o.isRelative)})},Hr=function(n){for(var e=[],t=function(n){e.push(n)},r=0;r<n.length;r++)n[r].each(t);return e};function qr(r,o){var n=function(n){var e=o(n);if(e<=0||null===e){var t=He(n,r);return parseFloat(t)||0}return e},u=function(o,n){return N(n,function(n,e){var t=He(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!T(e)&&!e.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+e);var t=n.dom;ze(t)&&(t.style[r]=e+"px")},get:n,getOuter:n,aggregate:u,max:function(n,e,t){var r=u(n,t);return r<e?e-r:0}}}var Vr,Ur,$r,Gr,Kr,Xr=qr("width",function(n){return n.dom.offsetWidth}),Yr=function(n){return Xr.get(n)},Jr=function(n){return Xr.getOuter(n)},Qr=function(t){var n=t.grid,e=B(n.columns,d),r=B(n.rows,d);return E(e,function(e){return Zr(function(){return W(r,function(n){return mt.getAt(t,n,e).filter(function(n){return n.column===e}).toArray()})},function(n){return 1===n.colspan},function(){return mt.getAt(t,0,e)})})},Zr=function(n,e,t){var r=n();return j(r,e).orThunk(function(){return x.from(r[0]).orThunk(t)}).map(function(n){return n.element})},no=function(t){var n=t.grid,e=B(n.rows,d),r=B(n.columns,d);return E(e,function(e){return Zr(function(){return W(r,function(n){return mt.getAt(t,e,n).filter(function(n){return n.row===e}).fold(b([]),function(n){return[n]})})},function(n){return 1===n.rowspan},function(){return mt.getAt(t,e,0)})})},eo=function(r,o){if(o<0||o>=r.length-1)return x.none();var n=r[o].fold(function(){var n,e,t=(n=r.slice(0,o),(e=R.call(n,0)).reverse(),e);return V(t,function(n,e){return n.map(function(n){return{value:n,delta:e+1}})})},function(n){return x.some({value:n,delta:0})}),e=r[o+1].fold(function(){var n=r.slice(o+1);return V(n,function(n,e){return n.map(function(n){return{value:n,delta:e+1}})})},function(n){return x.some({value:n,delta:1})});return n.bind(function(t){return e.map(function(n){var e=n.delta+t.delta;return Math.abs(n.value-t.value)/e})})},to=function(e,t){return function(n){return"rtl"===ro(n)?t:e}},ro=function(n){return"rtl"===He(n,"direction")?"rtl":"ltr"},oo=qr("height",function(n){var e=n.dom;return we(n)?e.getBoundingClientRect().height:e.offsetHeight}),uo=function(n){return oo.get(n)},io=function(n){return oo.getOuter(n)},co=function(t,r){return{left:t,top:r,translate:function(n,e){return co(t+n,r+e)}}},ao=co,lo=function(n,e){return n!==undefined?n:e!==undefined?e:0},fo=function(n){var e=n.dom.ownerDocument,t=e.body,r=e.defaultView,o=e.documentElement;if(t===n.dom)return ao(t.offsetLeft,t.offsetTop);var u=lo(null==r?void 0:r.pageYOffset,o.scrollTop),i=lo(null==r?void 0:r.pageXOffset,o.scrollLeft),c=lo(o.clientTop,t.clientTop),a=lo(o.clientLeft,t.clientLeft);return so(n).translate(i-a,u-c)},so=function(n){var e,t=n.dom,r=t.ownerDocument.body;return r===t?ao(r.offsetLeft,r.offsetTop):we(n)?(e=t.getBoundingClientRect(),ao(e.left,e.top)):ao(0,0)},mo=function(n,e){return{row:n,y:e}},go=function(n,e){return{col:n,x:e}},po=function(n){return fo(n).left+Jr(n)},ho=function(n){return fo(n).left},vo=function(n,e){return go(n,ho(e))},bo=function(n,e){return go(n,po(e))},wo=function(n){return fo(n).top},yo=function(n,e){return mo(n,wo(e))},Co=function(n,e){return mo(n,wo(e)+io(e))},xo=function(t,e,r){if(0===r.length)return[];var n=E(r.slice(1),function(n,e){return n.map(function(n){return t(e,n)})}),o=r[r.length-1].map(function(n){return e(r.length-1,n)});return n.concat([o])},So={delta:d,positions:function(n){return xo(yo,Co,n)},edge:wo},To=to({delta:d,edge:ho,positions:function(n){return xo(vo,bo,n)}},{delta:function(n){return-n},edge:po,positions:function(n){return xo(bo,vo,n)}}),Ro={delta:function(n,e){return To(e).delta(n,e)},positions:function(n,e){return To(e).positions(n,e)},edge:function(n){return To(n).edge(n)}},Oo={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},Do=(Ur="[eE][+-]?[0-9]+",Gr=["Infinity",(Vr="[0-9]+")+"\\."+($r=function(n){return"(?:"+n+")?"})(Vr)+$r(Ur),"\\."+Vr+$r(Ur),Vr+$r(Ur)].join("|"),new RegExp("^([+-]?(?:"+Gr+"))(.*)$")),Ao=function(n,o){return x.from(Do.exec(n)).bind(function(n){var e,t=Number(n[1]),r=n[2];return e=r,I(o,function(n){return I(Oo[n],function(n){return e===n})})?x.some({value:t,unit:r}):x.none()})},Io=function(){var n=Dn().browser;return n.isIE()||n.isEdge()},Bo=function(n,e,t){return r=He(n,e),o=t,u=parseFloat(r),isNaN(u)?o:u;var r,o,u},Eo=function(n){return Io()?(t=(e=n).dom.getBoundingClientRect().height,"border-box"===He(e,"box-sizing")?t:t-Bo(e,"padding-top",0)-Bo(e,"padding-bottom",0)-(Bo(e,"border-top-width",0)+Bo(e,"border-bottom-width",0))):Bo(n,"height",uo(n));var e,t},Po=function(n){return Io()?(t=(e=n).dom.getBoundingClientRect().width,"border-box"===He(e,"box-sizing")?t:t-Bo(e,"padding-left",0)-Bo(e,"padding-right",0)-(Bo(e,"border-left-width",0)+Bo(e,"border-right-width",0))):Bo(n,"width",Yr(n));var e,t},ko=/(\d+(\.\d+)?)%/,Mo=/(\d+(\.\d+)?)px|em/,No=function(n,e){var t,r=(t=n,x.from(t.dom.offsetParent).map(In.fromDom).getOr(ye(oe(n))));return e(n)/e(r)*100},jo=function(n,e){Fe(n,"width",e+"px")},_o=function(n,e){Fe(n,"width",e+"%")},zo=function(n,e){Fe(n,"height",e+"px")},Wo=function(n,e,t,r){var o,u,i,c,a,l=parseInt(n,10);return un(n,"%")&&"table"!==Yn(e)?(u=l,i=t,c=r,a=ot(o=e).map(function(n){var e=i(n);return Math.floor(u/100*e)}).getOr(u),c(o,a),a):l},Fo=function(n){var e,t=Ve(e=n,"height").getOrThunk(function(){return Eo(e)+"px"});return t?Wo(t,n,uo,zo):uo(n)},Lo=function(n){return Ve(n,"width").fold(function(){return x.from(Me(n,"width"))},function(n){return x.some(n)})},Ho=function(n,e){return n/e.pixelWidth()*100},qo=function(e,t){return Lo(e).fold(function(){var n=Yr(e);return Ho(n,t)},function(n){return function(n,e,t){var r=ko.exec(e);if(null!==r)return parseFloat(r[1]);var o=Po(n);return Ho(o,t)}(e,n,t)})},Vo=function(e,t){return Lo(e).fold(function(){return Po(e)},function(n){return function(n,e,t){var r=Mo.exec(e);if(null!==r)return parseInt(r[1],10);var o=ko.exec(e);if(null===o)return Po(n);var u=parseFloat(o[1]);return u/100*t.pixelWidth()}(e,n,t)})},Uo=function(n){return t="rowspan",Fo(e=n)/Ge(e,t);var e,t},$o=function(n,e,t){Fe(n,"width",e+t)},Go=function(n){return No(n,Yr)+"%"},Ko=b(ko),Xo=b(Mo),Yo=(Kr="col",function(n){return ne(n)&&Yn(n)===Kr}),Jo=function(n,e,t){return Ve(n,e).fold(function(){return t(n)+"px"},function(n){return n})},Qo=function(n,e){return Jo(n,"width",function(n){return Yo(n)?Yr(n):Vo(n,e)})},Zo=function(n){return Jo(n,"height",Uo)},nu=function(n,e,t,r,o,u){return n.filter(r).fold(function(){return u(eo(t,e))},function(n){return o(n)})},eu=function(n,e,i,c,a){var t,l=Qr(n),r=mt.hasColumns(n)?(t=n,E(mt.justColumns(t),function(n){return x.from(n.element)})):l,f=[x.some(Ro.edge(e))].concat(E(Ro.positions(l,e),function(n){return n.map(function(n){return n.x})})),s=g(Ke);return E(r,function(n,u){return nu(n,u,f,s,function(n){if(!Yo(r=n)||Ve(r,"width").isSome())return i(n,a);var e,t,r,o=(e=l[u],t=d,e!==undefined&&null!==e?t(e):x.none());return nu(o,u,f,s,function(n){return c(x.some(Yr(n)))},c)},c)})},tu=function(n){return n.map(function(n){return n+"px"}).getOr("")},ru=function(n,e,t){return eu(n,e,Vo,function(n){return n.getOrThunk(t.minCellWidth)},t)},ou=function(n,e,t,r,o){var u=no(n),i=[x.some(t.edge(e))].concat(E(t.positions(u,e),function(n){return n.map(function(n){return n.y})}));return E(u,function(n,e){return nu(n,e,i,g(Xe),r,o)})},uu=function(n,e,t){for(var r=0,o=n;o<e;o++)r+=t[o]!==undefined?t[o]:0;return r},iu=function(n,e){return mt.hasColumns(n)?(u=n,i=e,c=mt.justColumns(u),E(c,function(n,e){return{element:n.element,width:i[e],colspan:n.colspan}})):(t=n,r=e,o=mt.justCells(t),E(o,function(n){var e=uu(n.column,n.column+n.colspan,r);return{element:n.element,width:e,colspan:n.colspan}}));var t,r,o,u,i,c},cu=function(n,e,t){var r=iu(n,e);P(r,function(n){t.setElementWidth(n.element,n.width)})},au=function(n,e,t,r,o){var u=mt.fromTable(n),i=o.getCellDelta(e),c=o.getWidths(u,o),a=t===u.grid.columns-1,l=r.clampTableDelta(c,t,i,o.minCellWidth(),a),f=Lr(c,t,l,o,r),s=E(f,function(n,e){return n+c[e]});cu(u,s,o),r.resizeTable(o.adjustTableWidth,l,a)},lu=function(n,t,r,e){var o,u,i,c,a=mt.fromTable(n),l=ou(a,n,e,Uo,function(n){return n.getOrThunk(Qe)}),f=E(l,function(n,e){return r===e?Math.max(t+n,Qe()):n}),s=(o=a,u=f,i=mt.justCells(o),E(i,function(n){var e=uu(n.row,n.row+n.rowspan,u);return{element:n.element,height:e,rowspan:n.rowspan}})),d=(c=f,E(a.all,function(n,e){return{element:n.element,height:c[e]}}));P(d,function(n){zo(n.element,n.height)}),P(s,function(n){zo(n.element,n.height)});var m=M(f,function(n,e){return n+e},0);zo(n,m)},fu=function(n){return E(n,b(0))},su=function(n,e,t,r,o){return o(n.slice(0,e)).concat(r).concat(o(n.slice(t)))},du=function(i){return function(n,e,t,r){if(i(t)){var o=Math.max(r,n[e]-Math.abs(t)),u=Math.abs(o-n[e]);return 0<=t?u:-u}return t}},mu=du(function(n){return n<0}),gu=du(C),pu=function(){var f=function(n,t,e,r){var o=(100+e)/100,u=Math.max(r,(n[t]+e)/o);return E(n,function(n,e){return(e===t?u:n/o)-n})},c=function(n,e,t,r,o,u){return u?f(n,e,r,o):(a=t,l=mu(i=n,c=e,r,o),su(i,c,a+1,[l,0],fu));var i,c,a,l};return{resizeTable:function(n,e){return n(e)},clampTableDelta:mu,calcLeftEdgeDeltas:c,calcMiddleDeltas:function(n,e,t,r,o,u,i){return c(n,t,r,o,u,i)},calcRightEdgeDeltas:function(n,e,t,r,o,u){if(u)return f(n,t,r,o);var i=mu(n,t,r,o);return fu(n.slice(0,t)).concat([i])}}},hu=function(n,e){var t=x.from(n.dom.documentElement).map(In.fromDom).getOr(n);return{parent:b(t),view:b(n),origin:b(ao(0,0)),isResizable:e}},vu=function(n,e,t){return{parent:b(e),view:b(n),origin:b(ao(0,0)),isResizable:t}},bu=er([{invalid:["raw"]},{pixels:["value"]},{percent:["value"]}]),wu=function(n,e,t){var r=t.substring(0,t.length-n.length),o=parseFloat(r);return r===o.toString()?e(o):bu.invalid(t)},yu=U(U({},bu),{from:function(n){return un(n,"%")?wu("%",bu.percent,n):un(n,"px")?wu("px",bu.pixels,n):bu.invalid(n)}}),Cu=function(n,r,o){return n.fold(function(){return r},function(n){return t=(e=n)/o,E(r,function(n){return yu.from(n).fold(function(){return n},function(n){return n*t+"px"},function(n){return n/100*e+"px"})});var e,t},function(n){return e=o,E(r,function(n){return yu.from(n).fold(function(){return n},function(n){return n/e*100+"%"},function(n){return n+"%"})});var e})},xu=function(n,e,t){var r,o,u,i=yu.from(t),c=F(n,function(n){return"0px"===n})?(r=i,o=n.length,u=r.fold(function(){return b("")},function(n){return b(n/o+"px")},function(){return b(100/o+"%")}),B(o,u)):Cu(i,n,e);return Tu(c)},Su=function(n,e){return 0===n.length?e:M(n,function(n,e){return yu.from(e).fold(b(0),d,d)+n},0)},Tu=function(n){if(0===n.length)return n;var e,t,r=M(n,function(n,e){var t=yu.from(e).fold(function(){return{value:e,remainder:0}},function(n){return e=n,t="px",{value:(r=Math.floor(e))+t,remainder:e-r};var e,t,r},function(n){return{value:n+"%",remainder:0}});return{output:[t.value].concat(n.output),remainder:n.remainder+t.remainder}},{output:[],remainder:0}),o=r.output;return o.slice(0,o.length-1).concat([(e=o[o.length-1],t=Math.round(r.remainder),yu.from(e).fold(b(e),function(n){return n+t+"px"},function(n){return n+t+"%"}))])},Ru=yu.from,Ou=function(n){return Ru(n).fold(b("px"),b("px"),b("%"))},Du=function(l,n,e,f){var s=mt.fromTable(l),a=s.all,d=mt.justCells(s),m=mt.justColumns(s);n.each(function(n){var r,o,u,i,e=Ou(n),t=Yr(l),c=eu(s,l,Qo,tu,f),a=xu(c,t,n);mt.hasColumns(s)?(u=a,i=e,P(m,function(n,e){var t=Su([u[e]],Je());Fe(n.element,"width",t+i)})):(r=a,o=e,P(d,function(n){var e=r.slice(n.column,n.colspan+n.column),t=Su(e,Je());Fe(n.element,"width",t+o)})),Fe(l,"width",n)}),e.each(function(n){var r,e,o,t=Ou(n),u=uo(l),i=ou(s,l,So,Zo,tu),c=xu(i,u,n);r=c,e=a,o=t,P(d,function(n){var e=r.slice(n.row,n.rowspan+n.row),t=Su(e,Qe());Fe(n.element,"height",t+o)}),P(e,function(n,e){Fe(n.element,"height",r[e])}),Fe(l,"height",n)})},Au=function(n){return Lo(n).exists(function(n){return ko.test(n)})},Iu=function(n){return Lo(n).exists(function(n){return Mo.test(n)})},Bu=function(n){return Lo(n).isNone()},Eu=Go,Pu=function(n){return mt.fromTable(n).grid},ku=function(e){var o=[];return{bind:function(n){if(n===undefined)throw new Error("Event bind error: undefined handler");o.push(n)},unbind:function(e){o=k(o,function(n){return n!==e})},trigger:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r={};P(e,function(n,e){r[n]=t[e]}),P(o,function(n){n(r)})}}},Mu=function(n){return{registry:Wn(n,function(n){return{bind:n.bind,unbind:n.unbind}}),trigger:Wn(n,function(n){return n.trigger})}},Nu=function(n){return n.slice(0).sort()},ju=function(r,o,u){if(0===o.length)throw new Error("You must specify at least one required field.");var t;return function(e,n){if(!l(n))throw new Error("The "+e+" fields must be an array. Was: "+n+".");P(n,function(n){if(!p(n))throw new Error("The value "+n+" in the "+e+" fields was not a string.")})}("required",o),t=Nu(o),j(t,function(n,e){return e<t.length-1&&n===t[e+1]}).each(function(n){throw new Error("The field: "+n+" occurs more than once in the combined fields: ["+t.join(", ")+"].")}),function(e){var t=jn(e);F(o,function(n){return A(t,n)})||function(n,e){throw new Error("All required keys ("+Nu(n).join(", ")+") were not specified. Specified keys were: "+Nu(e).join(", ")+".")}(o,t),r(o,t);var n=k(o,function(n){return!u.validate(e[n],n)});return 0<n.length&&function(n,e){throw new Error("All values need to be of type: "+e+". Keys ("+Nu(n).join(", ")+") were not.")}(n,u.label),e}},_u=function(e,n){var t=k(n,function(n){return!A(e,n)});0<t.length&&function(n){throw new Error("Unsupported keys for object: "+Nu(n).join(", "))}(t)},zu=function(n){return ju(_u,n,{validate:S,label:"function"})},Wu=zu(["compare","extract","mutate","sink"]),Fu=zu(["element","start","stop","destroy"]),Lu=zu(["forceDrop","drop","move","delayDrop"]);function Hu(){var u=x.none(),i=Mu({move:ku(["info"])});return{onEvent:function(n,o){o.extract(n).each(function(n){var e,t,r;(e=o,t=n,r=u.map(function(n){return e.compare(n,t)}),u=x.some(t),r).each(function(n){i.trigger.move(n)})})},reset:function(){u=x.none()},events:i.registry}}function qu(){var n={onEvent:y,reset:y},e=Hu(),t=n;return{on:function(){t.reset(),t=e},off:function(){t.reset(),t=n},isOn:function(){return t===e},onEvent:function(n,e){t.onEvent(n,e)},events:e.events}}var Vu=function(e,t,n){var r,o,u,i=!1,c=Mu({start:ku([]),stop:ku([])}),a=qu(),l=function(){d.stop(),a.isOn()&&(a.off(),c.trigger.stop())},f=(r=l,o=200,u=null,{cancel:function(){null!==u&&(clearTimeout(u),u=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==u&&clearTimeout(u),u=setTimeout(function(){r.apply(null,n),u=null},o)}});a.events.move.bind(function(n){t.mutate(e,n.info)});var s=function(t){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];i&&t.apply(null,n)}},d=t.sink(Lu({forceDrop:l,drop:s(l),move:s(function(n){f.cancel(),a.onEvent(n,t)}),delayDrop:s(f.throttle)}),n);return{element:d.element,go:function(n){d.start(n),a.on(),c.trigger.start()},on:function(){i=!0},off:function(){i=!1},destroy:function(){d.destroy()},events:c.registry}},Uu=function(n){var t,r,e=In.fromDom(ve(n).getOr(n.target)),o=function(){return n.stopPropagation()},u=function(){return n.preventDefault()},i=(t=u,r=o,function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,n))});return{target:e,x:n.clientX,y:n.clientY,stop:o,prevent:u,kill:i,raw:n}},$u=function(n,e,t,r,o){var u,i,c=(u=t,i=r,function(n){u(n)&&i(Uu(n))});return n.dom.addEventListener(e,c,o),{unbind:w(Gu,n,e,c,o)}},Gu=function(n,e,t,r){n.dom.removeEventListener(e,t,r)},Ku=C,Xu=function(n,e,t){return $u(n,e,Ku,t,!1)},Yu=Uu,Ju=function(n,e){var t=Me(n,e);return t===undefined||""===t?[]:t.split(" ")},Qu=function(n){return n.dom.classList!==undefined},Zu=function(n,e){return o=e,u=Ju(t=n,r="class").concat([o]),Pe(t,r,u.join(" ")),!0;var t,r,o,u},ni=function(n,e){return o=e,0<(u=k(Ju(t=n,r="class"),function(n){return n!==o})).length?Pe(t,r,u.join(" ")):je(t,r),!1;var t,r,o,u},ei=function(n,e){Qu(n)?n.dom.classList.add(e):Zu(n,e)},ti=function(n){0===(Qu(n)?n.dom.classList:Ju(n,"class")).length&&je(n,"class")},ri=function(n,e){return Qu(n)&&n.dom.classList.contains(e)},oi=function(n){var e=n.replace(/\./g,"-");return{resolve:function(n){return e+"-"+n}}},ui=oi("ephox-dragster").resolve,ii=Wu({compare:function(n,e){return ao(e.left-n.left,e.top-n.top)},extract:function(n){return x.some(ao(n.x,n.y))},sink:function(n,e){var t=function(n){var e=U({layerClass:ui("blocker")},n),t=In.fromTag("div");Pe(t,"role","presentation"),Le(t,{position:"fixed",left:"0px",top:"0px",width:"100%",height:"100%"}),ei(t,ui("blocker")),ei(t,e.layerClass);return{element:function(){return t},destroy:function(){Et(t)}}}(e),r=Xu(t.element(),"mousedown",n.forceDrop),o=Xu(t.element(),"mouseup",n.drop),u=Xu(t.element(),"mousemove",n.move),i=Xu(t.element(),"mouseout",n.delayDrop);return Fu({element:t.element,start:function(n){Ot(n,t.element())},stop:function(){Et(t.element())},destroy:function(){t.destroy(),o.unbind(),u.unbind(),i.unbind(),r.unbind()}})},mutate:function(n,e){n.mutate(e.left,e.top)}}),ci=function(n){return"true"===Me(n,"contenteditable")},ai=oi("ephox-snooker").resolve,li=function(){var t,r=Mu({drag:ku(["xDelta","yDelta","target"])}),o=x.none(),n={mutate:function(n,e){t.trigger.drag(n,e)},events:(t=Mu({drag:ku(["xDelta","yDelta"])})).registry};n.events.drag.bind(function(e){o.each(function(n){r.trigger.drag(e.xDelta,e.yDelta,n)})});return{assign:function(n){o=x.some(n)},get:function(){return o},mutate:n.mutate,events:r.registry}},fi=ai("resizer-bar"),si=ai("resizer-rows"),di=ai("resizer-cols"),mi=function(n){var e=Te(n.parent(),"."+fi);P(e,Et)},gi=function(t,n,r){var o=t.origin();P(n,function(n){n.each(function(n){var e=r(o,n);ei(e,fi),Ot(t.parent(),e)})})},pi=function(n,e,l,f){gi(n,e,function(n,e){var t,r,o,u,i,c,a=(t=e.col,r=e.x-n.left,o=l.top-n.top,u=7,i=f,c=In.fromTag("div"),Le(c,{position:"absolute",left:r-u/2+"px",top:o+"px",height:i+"px",width:u+"px"}),ke(c,{"data-column":t,role:"presentation"}),c);return ei(a,di),a})},hi=function(n,e,l,f){gi(n,e,function(n,e){var t,r,o,u,i,c,a=(t=e.row,r=l.left-n.left,o=e.y-n.top,u=f,i=7,c=In.fromTag("div"),Le(c,{position:"absolute",left:r+"px",top:o-i/2+"px",height:i+"px",width:u+"px"}),ke(c,{"data-row":t,role:"presentation"}),c);return ei(a,si),a})},vi=function(n,e,t,r,o){var u,i=fo(t),c=e.isResizable,a=0<r.length?So.positions(r,t):[],l=0<a.length?(u=c,W(n.all,function(n,e){return u(n.element)?[e]:[]})):[],f=k(a,function(n,e){return I(l,function(n){return e===n})});hi(e,f,i,Jr(t));var s,d,m,g=0<o.length?Ro.positions(o,t):[],p=0<g.length?(d=c,m=[],B((s=n).grid.columns,function(n){mt.getColumnAt(s,n).map(function(n){return n.element}).forall(d)&&m.push(n)}),k(m,function(e){var n=mt.filterItems(s,function(n){return n.column===e});return F(n,function(n){return d(n.element)})})):[],h=k(g,function(n,e){return I(p,function(n){return e===n})});pi(e,h,i,io(t))},bi=function(n,e){var t,r,o;mi(n),n.isResizable(e)&&(t=mt.fromTable(e),r=no(t),o=Qr(t),vi(t,n,e,r,o))},wi=function(n,e){var t=Te(n.parent(),"."+fi);P(t,e)},yi=function(n){wi(n,function(n){Fe(n,"display","none")})},Ci=function(n){wi(n,function(n){Fe(n,"display","block")})},xi=ai("resizer-bar-dragging"),Si=function(o){var t=li(),r=function(n,e){void 0===e&&(e={});var t=e.mode!==undefined?e.mode:ii;return Vu(n,t,e)}(t,{}),e=x.none(),n=function(n,e){return x.from(Me(n,e))};t.events.drag.bind(function(t){n(t.target,"data-row").each(function(n){var e=Ye(t.target,"top");Fe(t.target,"top",e+t.yDelta+"px")}),n(t.target,"data-column").each(function(n){var e=Ye(t.target,"left");Fe(t.target,"left",e+t.xDelta+"px")})});var u=function(n,e){return Ye(n,e)-$e(n,"data-initial-"+e,0)};r.events.stop.bind(function(){t.get().each(function(r){e.each(function(t){n(r,"data-row").each(function(n){var e=u(r,"top");je(r,"data-initial-top"),s.trigger.adjustHeight(t,e,parseInt(n,10))}),n(r,"data-column").each(function(n){var e=u(r,"left");je(r,"data-initial-left"),s.trigger.adjustWidth(t,e,parseInt(n,10))}),bi(o,t)})})});var i=function(n,e){s.trigger.startAdjust(),t.assign(n),Pe(n,"data-initial-"+e,Ye(n,e)),ei(n,xi),Fe(n,"opacity","0.2"),r.go(o.parent())},c=Xu(o.parent(),"mousedown",function(n){var e,t;e=n.target,ri(e,si)&&i(n.target,"top"),t=n.target,ri(t,di)&&i(n.target,"left")}),a=function(n){return Pn(n,o.view())},l=function(n){return Be(n,"table",a).filter(function(n){return Be(n,"[contenteditable]",a).exists(ci)})},f=Xu(o.view(),"mouseover",function(n){l(n.target).fold(function(){we(n.target)&&mi(o)},function(n){e=x.some(n),bi(o,n)})}),s=Mu({adjustHeight:ku(["table","delta","row"]),adjustWidth:ku(["table","delta","column"]),startAdjust:ku([])});return{destroy:function(){c.unbind(),f.unbind(),r.destroy(),mi(o)},refresh:function(n){bi(o,n)},on:r.on,off:r.off,hideBars:w(yi,o),showBars:w(Ci,o),events:s.registry}},Ti=function(n,o,u){var r=So,i=Ro,e=Si(n),c=Mu({beforeResize:ku(["table","type"]),afterResize:ku(["table","type"]),startDrag:ku([])});return e.events.adjustHeight.bind(function(n){var e=n.table;c.trigger.beforeResize(e,"row");var t=r.delta(n.delta,e);lu(e,t,n.row,r),c.trigger.afterResize(e,"row")}),e.events.startAdjust.bind(function(n){c.trigger.startDrag()}),e.events.adjustWidth.bind(function(n){var e=n.table;c.trigger.beforeResize(e,"col");var t=i.delta(n.delta,e),r=u(e);au(e,t,n.column,o,r),c.trigger.afterResize(e,"col")}),{on:e.on,off:e.off,hideBars:e.hideBars,showBars:e.showBars,destroy:e.destroy,events:c.registry}},Ri=function(n,e){return n.fire("newrow",{node:e})},Oi=function(n,e){return n.fire("newcell",{node:e})},Di=function(n,e,t,r,o){n.fire("TableSelectionChange",{cells:e,start:t,finish:r,otherCells:o})},Ai=function(n){n.fire("TableSelectionClear")},Ii=function(n,e,t){n.fire("TableModified",U(U({},t),{table:e}))},Bi={"border-collapse":"collapse",width:"100%"},Ei={border:"1"},Pi="preservetable",ki=function(n){return n.getParam("table_sizing_mode","auto")},Mi=function(n){return n.getParam("table_responsive_width")},Ni=function(n){return n.getParam("table_default_attributes",Ei,"object")},ji=function(n){return n.getParam("table_default_styles",function(n){if(qi(n)){var e=n.getBody().offsetWidth;return U(U({},Bi),{width:e+"px"})}return Vi(n)?Ln(Bi,function(n,e){return"width"!==e}):Bi}(n),"object")},_i=function(n){return n.getParam("table_tab_navigation",!0,"boolean")},zi=function(n){return n.getParam("table_cell_advtab",!0,"boolean")},Wi=function(n){return n.getParam("table_row_advtab",!0,"boolean")},Fi=function(n){return n.getParam("table_advtab",!0,"boolean")},Li=function(n){return n.getParam("table_style_by_css",!1,"boolean")},Hi=function(n){return"relative"===ki(n)||!0===Mi(n)},qi=function(n){return"fixed"===ki(n)||!1===Mi(n)},Vi=function(n){return"responsive"===ki(n)},Ui=function(n){var e="section",t=n.getParam("table_header_type",e,"string");return A(["section","cells","sectionCells","auto"],t)?t:e},$i=function(n){var e=n.getParam("table_column_resizing",Pi,"string");return j(["preservetable","resizetable"],function(n){return n===e}).getOr(Pi)},Gi=function(n){return"preservetable"===$i(n)},Ki=function(n){var e=n.getParam("table_clone_elements");return p(e)?x.some(e.split(/[ ,]/)):Array.isArray(e)?x.some(e):x.none()},Xi=function(n){return n.nodeName.toLowerCase()},Yi=function(n){return In.fromDom(n.getBody())},Ji=function(n){return n.getBoundingClientRect().width},Qi=function(n){return n.getBoundingClientRect().height},Zi=function(e){return function(n){return Pn(n,Yi(e))}},nc=function(n){return/^\d+(\.\d+)?$/.test(n)?n+"px":n},ec=function(n){je(n,"data-mce-style");var e=function(n){return je(n,"data-mce-style")};P(tt(n),e),P(rt(n),e)},tc=function(n,e){var t=n.dom.getStyle(e,"width")||n.dom.getAttrib(e,"width");return x.from(t).filter(an)},rc=function(n){return/^(\d+(\.\d+)?)%$/.test(n)},oc=function(n){return In.fromDom(n.selection.getStart())},uc=function(n){var e=n;return{get:function(){return e},set:function(n){e=n}}},ic=function(t){var n=function(){return Yr(t)},e=b(0);return{width:n,pixelWidth:n,getWidths:function(n,e){return ru(n,t,e)},getCellDelta:e,singleColumnWidth:b([0]),minCellWidth:e,setElementWidth:y,adjustTableWidth:y,isRelative:!0,label:"none"}},cc=function(n,r){var o=uc(parseFloat(n)),u=uc(Yr(r));return{width:o.get,pixelWidth:u.get,getWidths:function(n,e){return eu(n,r,qo,function(n){return n.fold(function(){return t.minCellWidth()},function(n){return n/t.pixelWidth()*100})},t=e);var t},getCellDelta:function(n){return n/u.get()*100},singleColumnWidth:function(n,e){return[100-n]},minCellWidth:function(){return Je()/u.get()*100},setElementWidth:_o,adjustTableWidth:function(n){var e=o.get(),t=e+n/100*e;_o(r,t),o.set(t),u.set(Yr(r))},isRelative:!0,label:"percent"}},ac=function(n,t){var r=uc(n),o=r.get;return{width:o,pixelWidth:o,getWidths:function(n,e){return ru(n,t,e)},getCellDelta:d,singleColumnWidth:function(n,e){return[Math.max(Je(),n+e)-n]},minCellWidth:Je,setElementWidth:jo,adjustTableWidth:function(n){var e=o()+n;jo(t,e),r.set(e)},isRelative:!1,label:"pixel"}},lc=function(e){return Lo(e).fold(function(){return ic(e)},function(n){return function(n,e){var t=Ko().exec(e);if(null!==t)return cc(t[1],n);var r=Xo().exec(e);if(null!==r){var o=parseInt(r[1],10);return ac(o,n)}var u=Yr(n);return ac(u,n)}(e,n)})},fc=ac,sc=cc,dc=function(n,e){if(Hi(n)){var t=tc(n,e.dom).filter(rc).getOrThunk(function(){return Eu(e)});return sc(t,e)}return qi(n)?fc(Yr(e),e):lc(e)},mc=function(n){je(n,"width")},gc=function(n,e){var t=Yr(n)+"px";Du(n,x.some(t),x.none(),e),mc(n)},pc=function(n,e){var t,r,o,u=dc(n,e);r=u,o=Go(t=e),Du(t,x.some(o),x.none(),r),mc(t)},hc=function(n,e){var t=dc(n,e);gc(e,t)},vc=function(n){Ue(n,"width");var e=rt(n),t=0<e.length?e:tt(n);P(t,function(n){Ue(n,"width"),mc(n)}),mc(n)},bc=function(){var n=In.fromTag("div");return Le(n,{position:"static",height:"0",width:"0",padding:"0",margin:"0",border:"0"}),Ot(ye(In.fromDom(document)),n),n},wc="bar-",yc=function(n){return"false"!==Me(n,"data-mce-resize")},Cc=function(f){var s,d,a=x.none(),i=x.none(),c=x.none(),o=function(n){return"TABLE"===n.nodeName},n=function(){return i},m=function(n){return dc(f,n)},g=function(){return Gi(f)?{resizeTable:function(n,e,t){t&&n(e)},clampTableDelta:function(n,e,t,r,o){if(o){if(0<=t)return t;var u=N(n,function(n,e){return n+e-r},0);return Math.max(-u,t)}return mu(n,e,t,r)},calcLeftEdgeDeltas:i=function(n,e,t,r,o){var u=gu(n,0<=r?t:e,r,o);return su(n,e,t+1,[u,-u],fu)},calcMiddleDeltas:function(n,e,t,r,o,u){return i(n,t,r,o,u)},calcRightEdgeDeltas:function(n,e,t,r,o,u){if(u)return fu(n);var i=r/n.length;return E(n,b(i))}}:pu();var i},u=function(n,e,t){var r,o,u,i,c,a,l=un(e,"e");""===d&&pc(f,n),t!==s&&""!==d?(Fe(n,"width",d),r=g(),o=m(n),u=Gi(f)||l?Pu(n).columns-1:0,au(n,t-s,u,r,o)):rc(d)&&(i=parseFloat(d.replace("%","")),Fe(n,"width",t*i/s+"%")),/^(\d+(\.\d+)?)px$/.test(d)&&(c=n,a=mt.fromTable(c),mt.hasColumns(a)||P(tt(c),function(n){var e=He(n,"width");Fe(n,"width",e),je(n,"width")}))};return f.on("init",function(){var n,e,t,r,o,u=(e=yc,(n=f).inline?vu(Yi(n),bc(),e):hu(In.fromDom(n.getDoc()),e));c=x.some(u),o=f.getParam("object_resizing",!0),(p(o)?"table"===o:o)&&f.getParam("table_resize_bars",!0,"boolean")&&(t=g(),(r=Ti(u,t,m)).on(),r.events.startDrag.bind(function(n){a=x.some(f.selection.getRng())}),r.events.beforeResize.bind(function(n){var e,t,r,o,u,i=n.table.dom;e=f,r=Ji(t=i),o=Qi(i),u=wc+n.type,e.fire("ObjectResizeStart",{target:t,width:r,height:o,origin:u})}),r.events.afterResize.bind(function(n){var e,t,r,o,u,i=n.table,c=i.dom;ec(i),a.each(function(n){f.selection.setRng(n),f.focus()}),e=f,r=Ji(t=c),o=Qi(c),u=wc+n.type,e.fire("ObjectResized",{target:t,width:r,height:o,origin:u}),f.undoManager.add()}),i=x.some(r))}),f.on("ObjectResizeStart",function(n){var e,t=n.target;o(t)&&(e=In.fromDom(t),P(f.dom.select(".mce-clonedresizable"),function(n){f.dom.addClass(n,"mce-"+$i(f)+"-columns")}),!Iu(e)&&qi(f)?hc(f,e):!Au(e)&&Hi(f)&&pc(f,e),Bu(e)&&on(n.origin,wc)&&pc(f,e),s=n.width,d=Vi(f)?"":tc(f,t).getOr(""))}),f.on("ObjectResized",function(n){var e,t,r=n.target;o(r)&&(e=In.fromDom(r),t=n.origin,on(t,"corner-")&&u(e,t,n.width),ec(e),Ii(f,e.dom))}),f.on("SwitchMode",function(){i.each(function(n){f.mode.isReadOnly()?n.hideBars():n.showBars()})}),{lazyResize:n,lazyWire:function(){return c.getOr(hu(In.fromDom(f.getBody()),yc))},destroy:function(){i.each(function(n){n.destroy()}),c.each(function(n){var e;e=n,f.inline&&Et(e.parent())})}}},xc=function(n,e){return{element:n,offset:e}},Sc=function(e,n,t){return e.property().isText(n)&&0===e.property().getText(n).trim().length||e.property().isComment(n)?t(n).bind(function(n){return Sc(e,n,t).orThunk(function(){return x.some(n)})}):x.none()},Tc=function(n,e){return n.property().isText(e)?n.property().getText(e).length:n.property().children(e).length},Rc=function(n,e){var t=Sc(n,e,n.query().prevSibling).getOr(e);if(n.property().isText(t))return xc(t,Tc(n,t));var r=n.property().children(t);return 0<r.length?Rc(n,r[r.length-1]):xc(t,Tc(n,t))},Oc=Rc,Dc=Lt(),Ac=function(t,r){Lo(t).bind(function(n){return Ao(n,["fixed","relative","empty"])}).each(function(n){var e=n.value/2;$o(t,e,n.unit),$o(r,e,n.unit)})},Ic=function(n,e,t){n.cells[e]=t},Bc=function(n,e){return Xn(e,n.section)},Ec=function(n,e){var t=n.cells,r=E(t,e);return Xn(r,n.section)},Pc=function(n,e){return n.cells[e]},kc=function(n,e){return Pc(n,e).element},Mc=function(n){return n.cells.length},Nc=function(n){var e=function(n,e){for(var t=[],r=[],o=0,u=n.length;o<u;o++){var i=n[o];(e(i,o)?t:r).push(i)}return{pass:t,fail:r}}(n,function(n){return"colgroup"===n.section});return{rows:e.fail,cols:e.pass}},jc=function(n,e,t,r){t===r?je(n,e):Pe(n,e,t)},_c=function(n,e,t){q(Se(n,e)).fold(function(){return Rt(n,t)},function(n){return Tt(n,t)})},zc=function(c,n){var t=[],r=[],a=function(n){return E(n,function(n){n.isNew&&t.push(n.element);var e=n.element;return Bt(e),P(n.cells,function(n){n.isNew&&r.push(n.element),jc(n.element,"colspan",n.colspan,1),jc(n.element,"rowspan",n.rowspan,1),Ot(e,n.element)}),e})},l=function(n){return W(n,function(n){return E(n.cells,function(n){return jc(n.element,"span",n.colspan,1),n.element})})},o=function(n,e){var t,r,o,u=(o=Ae(t=c,r=e).getOrThunk(function(){var n=In.fromTag(r,oe(t).dom);return"thead"===r?_c(t,"caption,colgroup",n):"colgroup"===r?_c(t,"caption",n):Ot(t,n),n}),Bt(o),o),i=("colgroup"===e?l:a)(n);It(u,i)},e=function(n,e){0<n.length?o(n,e):Ae(c,e).each(Et)},u=[],i=[],f=[],s=[];return P(n,function(n){switch(n.section){case"thead":u.push(n);break;case"tbody":i.push(n);break;case"tfoot":f.push(n);break;case"colgroup":s.push(n)}}),e(s,"colgroup"),e(u,"thead"),e(i,"tbody"),e(f,"tfoot"),{newRows:t,newCells:r}},Wc=function(n,e){if(0===n.length)return 0;var t=n[0];return _(n,function(n){return!e(t.element,n.element)}).fold(function(){return n.length},function(n){return n})},Fc=function(n,e,t,r){var o,u=n[e].cells.slice(t),i=Wc(u,r),c=(o=t,E(n,function(n){return Pc(n,o)}).slice(e));return{colspan:i,rowspan:Wc(c,r)}},Lc=function(o,u){var i=E(o,function(n){return E(n.cells,f)});return E(o,function(n,r){return{details:W(n.cells,function(n,e){if(!1!==i[r][e])return[];var t=Fc(o,r,e,u);return function(n,e,t,r){for(var o=n;o<n+t;o++)for(var u=e;u<e+r;u++)i[o][u]=!0}(r,e,t.rowspan,t.colspan),[{element:n.element,rowspan:t.rowspan,colspan:t.colspan,isNew:n.isNew}]}),section:n.section}})},Hc=function(n,e,t){var r,o=[];mt.hasColumns(n)&&(r=E(mt.justColumns(n),function(n){return Kn(n.element,t)}),o.push(Xn(r,"colgroup")));for(var u=0;u<n.grid.rows;u++){for(var i=[],c=0;c<n.grid.columns;c++){var a=mt.getAt(n,u,c).map(function(n){return Kn(n.element,t)}).getOrThunk(function(){return Kn(e.gap(),!0)});i.push(a)}var l=Xn(i,n.all[u].section);o.push(l)}return o},qc=function(n,r){return E(n,function(n){var e,t=(e=n.details,V(e,function(n){return ie(n.element).map(function(n){var e=ie(n).isNone();return Kn(n,e)})}).getOrThunk(function(){return Kn(r.row(),!0)}));return{element:t.element,cells:n.details,section:n.section,isNew:t.isNew}})},Vc=function(n,e){var t=Lc(n,Pn);return qc(t,e)},Uc=function(n,e){return V(n.all,function(n){return j(n.cells,function(n){return Pn(e,n.element)})})},$c=function(a,e,l,f,s){return function(r,o,n,u,i){var c=mt.fromTable(o);return e(c,n).map(function(n){var e=Hc(c,u,!1),t=a(e,n,Pn,s(u));return{grid:Vc(t.grid,u),cursor:t.cursor}}).fold(function(){return x.none()},function(n){var e=zc(o,n.grid),t=x.from(i).getOrThunk(function(){return lc(o)});return l(o,n.grid,t),f(o),bi(r,o),x.some({cursor:n.cursor,newRows:e.newRows,newCells:e.newCells})})}},Gc=function(e,n){return et(n.element).bind(function(n){return Uc(e,n)})},Kc=function(e,n){var t=E(n.selection,function(n){return et(n).bind(function(n){return Uc(e,n)})}),r=Hr(t);return 0<r.length?x.some({cells:r,generators:n.generators,clipboard:n.clipboard}):x.none()},Xc=function(e,n){var t=E(n.selection,function(n){return et(n).bind(function(n){return Uc(e,n)})}),r=Hr(t);return 0<r.length?x.some(r):x.none()},Yc=function(n,e,t,r){for(var o=Nc(n).rows,u=!0,i=0;i<o.length;i++)for(var c=0;c<Mc(o[0]);c++){var a=t(kc(o[i],c),e);!0===a&&!1===u?Ic(o[i],c,Kn(r(),!0)):!0===a&&(u=!1)}return n},Jc=function(n,e,u,i){var t,r,o,c=Nc(n).rows;return 0<e&&e<c.length&&(t=c[e-1].cells,o=u,r=N(t,function(n,e){return I(n,function(n){return o(n.element,e.element)})?n:n.concat([e])},[]),P(r,function(r){for(var o=x.none(),n=e;n<c.length;n++)!function(t){for(var n=0;n<Mc(c[0]);n++)!function(e){var n=c[t].cells[e];u(n.element,r.element)&&(o.isNone()&&(o=x.some(i())),o.each(function(n){Ic(c[t],e,Kn(n,!0))}))}(n)}(n)})),n},Qc=function(t){return{is:function(n){return t===n},isValue:C,isError:f,getOr:b(t),getOrThunk:b(t),getOrDie:b(t),or:function(n){return Qc(t)},orThunk:function(n){return Qc(t)},fold:function(n,e){return e(t)},map:function(n){return Qc(n(t))},mapError:function(n){return Qc(t)},each:function(n){n(t)},bind:function(n){return n(t)},exists:function(n){return n(t)},forall:function(n){return n(t)},toOptional:function(){return x.some(t)}}},Zc=function(t){return{is:f,isValue:f,isError:C,getOr:d,getOrThunk:function(n){return n()},getOrDie:function(){return n=String(t),function(){throw new Error(n)}();var n},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return Zc(t)},mapError:function(n){return Zc(n(t))},each:y,bind:function(n){return Zc(t)},exists:f,forall:C,toOptional:x.none}},na={value:Qc,error:Zc,fromOption:function(n,e){return n.fold(function(){return Zc(e)},Qc)}},ea=function(n,e){return{rowDelta:0,colDelta:Mc(n[0])-Mc(e[0])}},ta=function(n,e){return{rowDelta:n.length-e.length,colDelta:0}},ra=function(n,e,t){var r="colgroup"===e.section?t.col:t.cell;return E(n,function(){return Kn(r(),!0)})},oa=function(e,n,t){return e.concat(B(n,function(){var n=e[e.length-1];return Bc(n,ra(n.cells,n,t))}))},ua=function(n,t,r){return E(n,function(n){var e=ra(B(t,d),n,r);return Bc(n,n.cells.concat(e))})},ia=function(n,e,t){var r=e.colDelta<0?ua:d;return(e.rowDelta<0?oa:d)(r(n,Math.abs(e.colDelta),t),Math.abs(e.rowDelta),t)},ca=function(n,e,t,r,o){for(var u,i,c,a,l,f=n.row,s=n.column,d=f+t.length,m=s+Mc(t[0]),g=f;g<d;g++)for(var p=s;p<m;p++){c=p,a=void 0,a=w(o,Pc((u=e)[i=g],c).element),l=u[i],1<u.length&&1<Mc(l)&&(0<c&&a(kc(l,c-1))||c<l.cells.length-1&&a(kc(l,c+1))||0<i&&a(kc(u[i-1],c))||i<u.length-1&&a(kc(u[i+1],c)))&&Yc(e,kc(e[g],p),o,r.cell);var h=kc(t[g-f],p-s),v=r.replace(h);Ic(e[g],p,Kn(v,!0))}return e},aa=function(t,r,o,u,i){return function(n,e,t){if(n.row>=e.length||n.column>Mc(e[0]))return na.error("invalid start address out of table bounds, row: "+n.row+", column: "+n.column);var r=e.slice(n.row),o=r[0].cells.slice(n.column),u=Mc(t[0]),i=t.length;return na.value({rowDelta:r.length-i,colDelta:o.length-u})}(t,r,o).map(function(n){var e=ia(r,n,u);return ca(t,e,o,u,i)})},la=function(r,n,e,t,o){var u,i,c,a;u=n,i=r,c=o,a=t.cell,0<i&&i<u[0].cells.length&&P(u,function(n){var e=n.cells[i-1],t=n.cells[i];c(t.element,e.element)&&Ic(n,i,Kn(a(),!0))});var l=ta(e,n),f=ia(e,l,t),s=ta(n,f),d=ia(n,s,t);return E(d,function(n,e){var t=n.cells.slice(0,r).concat(f[e].cells).concat(n.cells.slice(r,n.cells.length));return Bc(n,t)})},fa=function(n,e,t,r,o){Jc(e,n,o,r.cell);var u=ea(t,e),i=ia(t,u,r),c=ea(e,i),a=ia(e,c,r),l=Nc(a),f=l.cols,s=l.rows;return f.concat(s.slice(0,n)).concat(i).concat(s.slice(n,s.length))},sa=function(n,t,e,r,o){var u=Nc(n),i=u.rows,c=u.cols,a=i.slice(0,t),l=i.slice(t),f=Ec(i[e],function(n,e){return 0<t&&t<i.length&&r(kc(i[t-1],e),kc(i[t],e))?Pc(i[t],e):Kn(o(n.element,r),!0)});return c.concat(a).concat([f]).concat(l)},da=function(n,v,b,w,y){return E(n,function(n){var e,t,r,o,u,i,c,a,l,f,s,d,m,g,p=0<v&&v<Mc(n)&&w(kc(n,v-1),kc(n,v)),h=(t=v,r=(e=n).section,o=p,u=b,i=w,c=y,"colgroup"!==r&&o?Pc(e,t):Kn(c(kc(e,u),i),!0));return l=v,f=h,s=(a=n).cells,d=s.slice(0,l),m=s.slice(l),g=d.concat([f]).concat(m),Bc(a,g)})},ma=function(n,t,r,o){return E(n,function(n){return Ec(n,function(n){return e=n,I(t,function(n){return r(e.element,n.element)})?Kn(o(n.element,r),!0):n;var e})})},ga=function(n,e,t,r){return kc(n[e],t)!==undefined&&0<e&&r(kc(n[e-1],t),kc(n[e],t))},pa=function(n,e,t){return 0<e&&t(kc(n,e-1),kc(n,e))},ha=function(t,r,o,n){var e=W(t,function(n,e){return ga(t,e,r,o)||pa(n,r,o)?[]:[Pc(n,r)]});return ma(t,e,o,n)},va=function(n,t,r,e){var o=Nc(n).rows,u=o[t],i=W(u.cells,function(n,e){return ga(o,t,e,r)||pa(u,e,r)?[]:[n]});return ma(n,i,r,e)},ba=zu(["cell","row","replace","gap","col","colgroup"]),wa=function(n){return{element:n,colspan:$e(n,"colspan",1),rowspan:$e(n,"rowspan",1)}},ya=function(e,t){void 0===t&&(t=wa),ba(e);var r=uc(x.none()),o=function(n){return function(n){switch(Yn(n.element)){case"col":return e.col(n);default:return e.cell(n)}}(t(n))},u=function(n){var e=o(n);return r.get().isNone()&&r.set(x.some(e)),i=x.some({item:n,replacement:e}),e},i=x.none();return{getOrInit:function(e,t){return i.fold(function(){return u(e)},function(n){return t(e,n.item)?n.replacement:u(e)})},cursor:r.get}},Ca=function(c,a){return function(r){var o=uc(x.none());ba(r);var u=[],i=function(n){var e={scope:c},t=r.replace(n,a,e);return u.push({item:n,sub:t}),o.get().isNone()&&o.set(x.some(t)),t};return{replaceOrInit:function(e,t){return r=e,o=t,j(u,function(n){return o(n.item,r)}).fold(function(){return i(e)},function(n){return t(e,n.item)?n.sub:i(e)});var r,o},cursor:o.get}}},xa=function(t){ba(t);var n=uc(x.none());return{combine:function(e){return n.get().isNone()&&n.set(x.some(e)),function(){var n=t.cell({element:e,colspan:1,rowspan:1});return Ue(n,"width"),Ue(e,"width"),n}},cursor:n.get}},Sa=["body","p","div","article","aside","figcaption","figure","footer","header","nav","section","ol","ul","table","thead","tfoot","tbody","caption","tr","td","th","h1","h2","h3","h4","h5","h6","blockquote","pre","address"],Ta=Lt(),Ra=function(n){return e=n,t=Ta.property().name(e),A(Sa,t);var e,t},Oa=function(n){return e=n,t=Ta.property().name(e),A(["ol","ul"],t);var e,t},Da=function(n){return e=n,A(["br","img","hr","input"],Ta.property().name(e));var e},Aa=function(n){var e,u=function(n){return"br"===Yn(n)},t=function(o){return pr(o).bind(function(t){var r=le(t).map(function(n){return!!Ra(n)||!!Da(n)&&"img"!==Yn(n)}).getOr(!1);return ie(t).map(function(n){return!0===r||("li"===Yn(e=n)||Oe(e,Oa).isSome())||u(t)||Ra(n)&&!Pn(o,n)?[]:[In.fromTag("br")];var e})}).getOr([])},r=0===(e=W(n,function(n){var e=fe(n);return F(e,function(n){return u(n)||ee(n)&&0===_t(n).trim().length})?[]:e.concat(t(n))})).length?[In.fromTag("br")]:e;Bt(n[0]),It(n[0],r)},Ia=function(n){0===tt(n).length&&Et(n)},Ba=function(n,e){return{grid:n,cursor:e}},Ea=function(n,e,t){var r=Nc(n).rows;return Pa(r,e,t).orThunk(function(){return Pa(r,0,0)})},Pa=function(n,e,t){return x.from(n[e]).bind(function(n){return x.from(n.cells[t]).bind(function(n){return x.from(n.element)})})},ka=function(n,e,t){var r=Nc(n).rows;return Ba(n,Pa(r,e,t))},Ma=function(n){return N(n,function(n,e){return I(n,function(n){return n.row===e.row})?n:n.concat([e])},[]).sort(function(n,e){return n.row-e.row})},Na=function(n){return N(n,function(n,e){return I(n,function(n){return n.column===e.column})?n:n.concat([e])},[]).sort(function(n,e){return n.column-e.column})},ja=function(n,e,t){var r,o,u=(r=n,o=t.section,ct(r,function(){return o})),i=mt.generate(u);return Hc(i,e,!0)},_a=function(n,e){var t=k(n,e);return 0===t.length?x.some("td"):t.length===n.length?x.some("th"):x.none()},za=function(n,e,t){var r=mt.generate(e),o=t.getWidths(r,t);cu(r,o,t)},Wa=$c(function(n,e,t,r){var o=e[0].row,u=e[0].row,i=Ma(e),c=N(i,function(n,e){return sa(n,u,o,t,r.getOrInit)},n);return ka(c,u,e[0].column)},Xc,y,y,ya),Fa=$c(function(n,e,t,r){var o=Ma(e),u=o[o.length-1].row,i=o[o.length-1].row+o[o.length-1].rowspan,c=N(o,function(n,e){return sa(n,i,u,t,r.getOrInit)},n);return ka(c,i,e[0].column)},Xc,y,y,ya),La=$c(function(n,e,t,r){var o=Na(e),u=o[0].column,i=o[0].column,c=N(o,function(n,e){return da(n,i,u,t,r.getOrInit)},n);return ka(c,e[0].row,i)},Xc,za,y,ya),Ha=$c(function(n,e,t,r){var o=e[e.length-1].column,u=e[e.length-1].column+e[e.length-1].colspan,i=Na(e),c=N(i,function(n,e){return da(n,u,o,t,r.getOrInit)},n);return ka(c,e[0].row,u)},Xc,za,y,ya),qa=$c(function(n,e,t,r){var o,u,i,c,a=Na(e),l=(o=n,u=a[0].column,i=a[a.length-1].column,c=E(o,function(n){var e=n.cells.slice(0,u).concat(n.cells.slice(i+1));return Xn(e,n.section)}),k(c,function(n){return 0<n.cells.length})),f=Ea(l,e[0].row,e[0].column);return Ba(l,f)},Xc,za,Ia,ya),Va=$c(function(n,e,t,r){var o,u,i,c,a,l=Ma(e),f=(o=n,u=l[0].row,i=l[l.length-1].row,c=Nc(o),a=c.rows,c.cols.concat(a.slice(0,u)).concat(a.slice(i+1))),s=Ea(f,e[0].row,e[0].column);return Ba(f,s)},Xc,y,Ia,ya),Ua=($c(function(n,e,t,r){var o=ha(n,e.column,t,r.replaceOrInit);return ka(o,e.row,e.column)},Gc,y,y,Ca("row","th")),$c(function(n,e,t,r){var o=Na(e),u=N(o,function(n,e){return ha(n,e.column,t,r.replaceOrInit)},n);return ka(u,e[0].row,e[0].column)},Xc,y,y,Ca("row","th"))),$a=($c(function(n,e,t,r){var o=ha(n,e.column,t,r.replaceOrInit);return ka(o,e.row,e.column)},Gc,y,y,Ca(null,"td")),$c(function(n,e,t,r){var o=Na(e),u=N(o,function(n,e){return ha(n,e.column,t,r.replaceOrInit)},n);return ka(u,e[0].row,e[0].column)},Xc,y,y,Ca(null,"td"))),Ga=($c(function(n,e,t,r){var o=va(n,e.row,t,r.replaceOrInit);return ka(o,e.row,e.column)},Gc,y,y,Ca("col","th")),$c(function(n,e,t,r){var o=Ma(e),u=N(o,function(n,e){return va(n,e.row,t,r.replaceOrInit)},n);return ka(u,e[0].row,e[0].column)},Xc,y,y,Ca("col","th")),$c(function(n,e,t,r){var o=va(n,e.row,t,r.replaceOrInit);return ka(o,e.row,e.column)},Gc,y,y,Ca(null,"td")),$c(function(n,e,t,r){var o=Ma(e),u=N(o,function(n,e){return va(n,e.row,t,r.replaceOrInit)},n);return ka(u,e[0].row,e[0].column)},Xc,y,y,Ca(null,"td")),$c(function(n,e,t,r){var o=e.cells;Aa(o);var u=function(n,e,t){var r=Nc(n).rows;if(0===r.length)return n;for(var o=e.startRow;o<=e.finishRow;o++)for(var u=e.startCol;u<=e.finishCol;u++)Ic(r[o],u,Kn(t(),!1));return n}(n,e.bounds,b(o[0]));return Ba(u,x.from(o[0]))},function(n,e){return e.mergable},y,y,xa)),Ka=$c(function(n,e,t,r){var o=M(e,function(n,e){return Yc(n,e,t,r.combine(e))},n);return Ba(o,x.from(e[0]))},function(n,e){return e.unmergable},za,y,xa),Xa=$c(function(n,t,e,r){var o,u,i,c=(o=t.clipboard,u=t.generators,i=mt.fromTable(o),Hc(i,u,!0)),a={row:t.row,column:t.column};return aa(a,n,c,t.generators,e).fold(function(){return Ba(n,x.some(t.element))},function(n){var e=Ea(n,t.row,t.column);return Ba(n,e)})},function(e,t){return et(t.element).bind(function(n){return Uc(e,n).map(function(n){return U(U({},n),{generators:t.generators,clipboard:t.clipboard})})})},za,y,ya),Ya=$c(function(n,e,t,r){var o=Nc(n).rows,u=e.cells[0].column,i=o[e.cells[0].row],c=ja(e.clipboard,e.generators,i),a=la(u,n,c,e.generators,t),l=Ea(a,e.cells[0].row,e.cells[0].column);return Ba(a,l)},Kc,y,y,ya),Ja=$c(function(n,e,t,r){var o=Nc(n).rows,u=e.cells[e.cells.length-1].column+e.cells[e.cells.length-1].colspan,i=o[e.cells[0].row],c=ja(e.clipboard,e.generators,i),a=la(u,n,c,e.generators,t),l=Ea(a,e.cells[0].row,e.cells[0].column);return Ba(a,l)},Kc,y,y,ya),Qa=$c(function(n,e,t,r){var o=Nc(n).rows,u=e.cells[0].row,i=o[u],c=ja(e.clipboard,e.generators,i),a=fa(u,n,c,e.generators,t),l=Ea(a,e.cells[0].row,e.cells[0].column);return Ba(a,l)},Kc,y,y,ya),Za=$c(function(n,e,t,r){var o=Nc(n).rows,u=e.cells[e.cells.length-1].row+e.cells[e.cells.length-1].rowspan,i=o[e.cells[0].row],c=ja(e.clipboard,e.generators,i),a=fa(u,n,c,e.generators,t),l=Ea(a,e.cells[0].row,e.cells[0].column);return Ba(a,l)},Kc,y,y,ya),nl=function(n,e){var u=mt.fromTable(n);return Xc(u,e).bind(function(n){var e=n[n.length-1],t=n[0].column,r=e.column+e.colspan,o=z(E(u.all,function(n){return k(n.cells,function(n){return n.column>=t&&n.column<r})}));return _a(o,function(n){return"th"===Yn(n.element)})}).getOr("")},el=function(n){return Xi(n.parentNode)},tl=function(n,e){var t="thead"===el(e),r=!I(e.cells,function(n){return"th"!==Xi(n)});return t||r?x.some({thead:t,ths:r}):x.none()},rl=function(n,e){return"thead"===(t=tl(0,e).fold(function(){return el(e)},function(n){return"thead"}))?"header":"tfoot"===t?"footer":"body";var t},ol=function(e,n,t){var r,o,u=e.getParent(n,"table"),i=n.parentNode,c=Xi(i);t!==c&&((r=e.select(t,u)[0])||(r=e.create(t),o=u.firstChild,"thead"===t?q(Se(In.fromDom(u),"caption,colgroup")).fold(function(){return u.insertBefore(r,o)},function(n){return e.insertAfter(r,n.dom)}):u.appendChild(r)),"tbody"===t&&"thead"===c&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),i.hasChildNodes()||e.remove(i))},ul=function(n,e,t,r){var o=n.dom,u=function(n,e,t){if(v(t)&&Xi(e)!==t){var r=n.dom.rename(e,t);return Oi(n,r),r}return e}(n,e,t);return m(r)||o.setAttrib(u,"scope",r),u},il=function(e,n,t,r){return P(n,function(n){return ul(e,n,t,r)})},cl=function(n,e,t){var r,o,u,i=n.dom;"header"===t?(o="auto"===(r=Ui(n))?(u=ot(In.fromDom(e.cells[0])).map(ut).getOr([]),V(u,function(n){return tl(0,n.dom)}).map(function(n){return n.thead&&n.ths?"sectionCells":n.thead?"section":"cells"}).getOr("section")):r,il(n,e.cells,"section"===o?"td":"th","col"),ol(i,e,"cells"===o?"tbody":"thead")):(il(n,e.cells,"td",null),ol(i,e,"footer"===t?"tfoot":"tbody"))},al=function(o){return function(n){var e,t=Yn(n),r="col"===t||"colgroup"===t?ot(e=n).bind(function(n){return Zt(n,Nr.firstSelectedSelector)}).fold(function(){return e},function(n){return n[0]}):n;return Be(r,o)}},ll=al("th,td"),fl=al("th,td,caption"),sl=function(n,e){return ll(n).map(function(n){return Er(e)}).getOr([])},dl=function(n,t){var e,r,o,u=ll(n),i=u.bind(function(n){return ot(n)}).map(ut);return r=i,o=function(e,n){return k(n,function(n){return I(Br(n.dom.cells),function(n){return"1"===Me(n,t)||Pn(n,e)})})},((e=u).isSome()&&r.isSome()?x.some(o(e.getOrDie(),r.getOrDie())):x.none()).getOr([])},ml=function(f,n,r){var e=function(n){return"table"===Yn(Yi(n))},s=Ki(f),t=function(i,c,a,l){return function(n,e){ec(n);var t=l(),r=In.fromDom(f.getDoc()),o=Ar(a,r,s),u=dc(f,n);return c(n)?i(t,n,e,o,u).bind(function(n){return P(n.newRows,function(n){Ri(f,n.dom)}),P(n.newCells,function(n){Oi(f,n.dom)}),n.cursor.map(function(n){var e=Oc(Dc,n),t=f.dom.createRng();return t.setStart(e.element.dom,e.offset),t.setEnd(e.element.dom,e.offset),t})}):x.none()}},o=t(Va,function(n){return!1===e(f)||1<Pu(n).rows},y,n),u=t(qa,function(n){return!1===e(f)||1<Pu(n).columns},y,n),i=t(Wa,C,y,n),c=t(Fa,C,y,n),a=t(La,C,Ac,n),l=t(Ha,C,Ac,n),d=t(Ga,C,y,n),m=t(Ka,C,y,n),g=t(Ya,C,y,n),p=t(Ja,C,y,n),h=t(Qa,C,y,n),v=t(Za,C,y,n),b=t(Xa,C,y,n),w=function(n,e){return qn(n,"type").filter(function(n){return A(e,n)})};return{deleteRow:o,deleteColumn:u,insertRowsBefore:i,insertRowsAfter:c,insertColumnsBefore:a,insertColumnsAfter:l,mergeCells:d,unmergeCells:m,pasteColsBefore:g,pasteColsAfter:p,pasteRowsBefore:h,pasteRowsAfter:v,pasteCells:b,setTableCellType:function(t,n){return w(n,["td","th"]).each(function(n){var e=E(sl(oc(t),r),function(n){return n.dom});il(t,e,n,null)})},setTableRowType:function(t,n){return w(n,["header","body","footer"]).each(function(e){E(dl(oc(t),Nr.selected),function(n){return cl(t,n.dom,e)})})},makeColumnsHeader:t(Ua,C,y,n),unmakeColumnsHeader:t($a,C,y,n),getTableRowType:function(n){var e=dl(oc(n),Nr.selected);if(0<e.length){var t=E(e,function(n){return rl(0,n.dom)}),r=A(t,"header"),o=A(t,"footer");if(r||o){var u=A(t,"body");return!r||u||o?r||u||!o?"":"footer":"header"}return"body"}},getTableCellType:function(n){return _a(sl(oc(n),r),function(n){return"th"===Yn(n)}).getOr("")},getTableColType:nl}},gl={styles:{"border-collapse":"collapse",width:"100%"},attributes:{border:"1"},colGroups:!1},pl=function(n,e,t,r){for(var o=In.fromTag("tr"),u=0;u<n;u++){var i=r<e||u<t?In.fromTag("th"):In.fromTag("td");u<t&&Pe(i,"scope","row"),r<e&&Pe(i,"scope","col"),Ot(i,In.fromTag("br")),Ot(o,i)}return o},hl=function(n){var e=In.fromTag("colgroup");return B(n,function(){return Ot(e,In.fromTag("col"))}),e},vl=function(n,e,t,r){return B(n,function(n){return pl(e,t,r,n)})},bl=function(n,e){n.selection.select(e.dom,!0),n.selection.collapse(!0)},wl=function(u,i,c,a,l){var o=ji(u),f={styles:o,attributes:Ni(u),colGroups:u.getParam("table_use_colgroups",!1,"boolean")};return u.undoManager.ignore(function(){var n=function(n,e,t,r,o,u){void 0===u&&(u=gl);var i=In.fromTag("table"),c="cells"!==o;Le(i,u.styles),ke(i,u.attributes),u.colGroups&&Ot(i,hl(e));var a,l,f=Math.min(n,t);c&&0<t&&(a=In.fromTag("thead"),Ot(i,a),l=vl(t,e,"sectionCells"===o?f:0,r),It(a,l));var s=In.fromTag("tbody");Ot(i,s);var d=vl(c?n-f:n,e,c?0:t,r);return It(s,d),i}(c,i,l,a,Ui(u),f);Pe(n,"data-mce-id","__mce");var e,t,r,o=(e=n,t=In.fromTag("div"),r=In.fromDom(e.dom.cloneNode(!0)),Ot(t,r),t.dom.innerHTML);u.insertContent(o),u.addVisual()}),Ie(Yi(u),'table[data-mce-id="__mce"]').map(function(n){var e,t,r;return qi(u)?hc(u,n):Vi(u)?vc(n):(Hi(u)||(e=o.width,p(e)&&-1!==e.indexOf("%")))&&pc(u,n),ec(n),je(n,"data-mce-id"),t=u,P(Te(n,"tr"),function(n){Ri(t,n.dom),P(Te(n,"th,td"),function(n){Oi(t,n.dom)})}),r=u,Ie(n,"td,th").each(w(bl,r)),n.dom}).getOr(null)},yl=function(n,e,t,r,o){void 0===r&&(r={});var u=function(n){return T(n)&&0<n};if(u(e)&&u(t)){var i=r.headerRows||0,c=r.headerColumns||0;return wl(n,t,e,c,i)}return console.error(o),null},Cl=function(n){return function(){return n().fold(function(){return[]},function(n){return E(n,function(n){return n.dom})})}},xl=function(t){return function(n){var e=0<n.length?x.some(Br(n)):x.none();t(e)}},Sl=function(n,e,t,r){return{insertTable:(o=n,function(n,e,t){void 0===t&&(t={});var r=yl(o,e,n,t,"Invalid values for insertTable - rows and columns values are required to insert a table.");return o.undoManager.add(),r}),setClipboardRows:xl(e.setRows),getClipboardRows:Cl(e.getRows),setClipboardCols:xl(e.setColumns),getClipboardCols:Cl(e.getColumns),resizeHandler:t,selectionTargets:r};var o},Tl=function(n,e,t){var r=$e(n,e,1);1===t||r<=1?je(n,e):Pe(n,e,Math.min(t,r))},Rl=function(n,e){var i=mt.fromTable(n);return Xc(i,e).map(function(n){var o,u,e=n[n.length-1],t=n[0].column,r=e.column+e.colspan;return $(function(n,t,r){if(mt.hasColumns(n)){var e=k(mt.justColumns(n),function(n){return n.column>=t&&n.column<r}),o=E(e,function(n){var e=wr(n.element);return Tl(e,"span",r-t),e}),u=In.fromTag("colgroup");return It(u,o),[u]}return[]}(i,t,r),(o=t,u=r,E(i.all,function(n){var e=k(n.cells,function(n){return n.column>=o&&n.column<u}),t=E(e,function(n){var e=wr(n.element);return Tl(e,"colspan",u-o),e}),r=In.fromTag("tr");return It(r,t),r})))})},Ol=function(n,e,o){var u=mt.fromTable(n);return Xc(u,e).map(function(n){var e=Hc(u,o,!1),t=Nc(e).rows.slice(n[0].row,n[n.length-1].row+n[n.length-1].rowspan),r=Vc(t,o);return E(r,function(n){var t=br(n.element);return P(n.cells,function(n){var e=wr(n.element);jc(e,"colspan",n.colspan,1),jc(e,"rowspan",n.rowspan,1),Ot(t,e)}),t})})},Dl=tinymce.util.Tools.resolve("tinymce.util.Tools"),Al=function(o,n,u){return function(n,e){for(var t=0;t<e.length;t++){var r=o.getStyle(e[t],u);if(void 0===n&&(n=r),n!==r)return""}return n}(void 0,o.select("td,th",n))},Il=function(n,e,t){t&&n.formatter.apply("align"+t,{},e)},Bl=function(e,t){Dl.each("left center right".split(" "),function(n){e.formatter.remove("align"+n,{},t)})},El=function(n){return Vn(e=n,t="menu")&&e[t]!==undefined&&null!==e[t];var e,t},Pl=function(n,e){return(e||[]).concat(E(n,function(n){var e=n.text||n.title;return El(n)?{text:e,items:Pl(n.menu)}:{text:e,value:n.value}}))},kl=function(e){return function(n){return on(n,"rgb")?e.toHex(n):n}},Ml=function(n,e){var t=In.fromDom(e);return{borderwidth:Ve(t,"border-width").getOr(""),borderstyle:Ve(t,"border-style").getOr(""),bordercolor:Ve(t,"border-color").map(kl(n)).getOr(""),backgroundcolor:Ve(t,"background-color").map(kl(n)).getOr("")}},Nl=function(n){var o=n[0],e=n.slice(1);return P(e,function(n){P(jn(o),function(r){zn(n,function(n,e){var t=o[r];""!==t&&r===e&&t!==n&&(o[r]="")})})}),o},jl=function(n){var e=[{name:"borderstyle",type:"listbox",label:"Border style",items:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]},{name:"bordercolor",type:"colorinput",label:"Border color"},{name:"backgroundcolor",type:"colorinput",label:"Background color"}];return{title:"Advanced",name:"advanced",items:"cell"===n?[{name:"borderwidth",type:"input",label:"Border width"}].concat(e):e}},_l=function(n,e,t,r){return j(n,function(n){return t.formatter.matchNode(r,e+n)}).getOr("")},zl=w(_l,["left","center","right"],"align"),Wl=w(_l,["top","middle","bottom"],"valign"),Fl=function(n,e){var t,r,o,u,i=ji(n),c=Ni(n),a=e?(t=n.dom,{borderstyle:qn(i,"border-style").getOr(""),bordercolor:kl(t)(qn(i,"border-color").getOr("")),backgroundcolor:kl(t)(qn(i,"background-color").getOr(""))}):{};return U(U(U(U(U(U({},{height:"",width:"100%",cellspacing:"",cellpadding:"",caption:!1,"class":"",align:"",border:""}),i),c),a),(u=i["border-width"],Li(n)&&u?{border:u}:qn(c,"border").fold(function(){return{}},function(n){return{border:n}}))),(r=qn(i,"border-spacing").or(qn(c,"cellspacing")).fold(function(){return{}},function(n){return{cellspacing:n}}),o=qn(i,"border-padding").or(qn(c,"cellpadding")).fold(function(){return{}},function(n){return{cellpadding:n}}),U(U({},r),o)))},Ll=[{name:"width",type:"input",label:"Width"},{name:"height",type:"input",label:"Height"},{name:"celltype",type:"listbox",label:"Cell type",items:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{name:"scope",type:"listbox",label:"Scope",items:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{name:"halign",type:"listbox",label:"H Align",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{name:"valign",type:"listbox",label:"V Align",items:[{text:"None",value:""},{text:"Top",value:"top"},{text:"Middle",value:"middle"},{text:"Bottom",value:"bottom"}]}],Hl=function(n){return Ll.concat((0<(e=Pl(n.getParam("table_cell_class_list",[],"array"))).length?x.some({name:"class",type:"listbox",label:"Class",items:e}):x.none()).toArray());var e},ql=function(u){return function(t,r){var o=t.dom;return{setAttrib:function(n,e){u&&!e||o.setAttrib(r,n,e)},setStyle:function(n,e){u&&!e||o.setStyle(r,n,e)},setFormat:function(n,e){u&&!e||(""===e?t.formatter.remove(n,{value:null},r,!0):t.formatter.apply(n,{value:e},r))}}}},Vl={normal:ql(!1),ifTruthy:ql(!0)},Ul=function(o){return ot(o[0]).map(function(n){var e=mt.fromTable(n),t=mt.justCells(e),r=k(t,function(e){return I(o,function(n){return Pn(e.element,n)})});return E(r,function(n){return{element:n.element.dom,column:mt.getColumnAt(e,n.column).map(function(n){return n.element.dom})}})})},$l=function(g,n,p){var e,h=1===n.length;1<=n.length&&(e=ot(n[0]),Ul(n).each(function(n){P(n,function(n){var e,t,r,o,u,i,c,a,l,f,s=ul(g,n.element,p.celltype),d=h?Vl.normal(g,s):Vl.ifTruthy(g,s),m=n.column.map(function(n){return h?Vl.normal(g,n):Vl.ifTruthy(g,n)}).getOr(d);t=m,r=p,(e=d).setAttrib("scope",r.scope),e.setAttrib("class",r["class"]),e.setStyle("height",nc(r.height)),t.setStyle("width",nc(r.width)),zi(g)&&(u=p,(o=d).setFormat("tablecellbackgroundcolor",u.backgroundcolor),o.setFormat("tablecellbordercolor",u.bordercolor),o.setFormat("tablecellborderstyle",u.borderstyle),o.setFormat("tablecellborderwidth",nc(u.borderwidth))),h&&(Bl(g,s),i=g,c=s,Dl.each("top middle bottom".split(" "),function(n){i.formatter.remove("valign"+n,{},c)})),p.halign&&Il(g,s,p.halign),p.valign&&(a=g,l=s,(f=p.valign)&&a.formatter.apply("valign"+f,{},l))})}),e.each(function(n){return Ii(g,n.dom)}))},Gl=function(n,e,t){var r=t.getData();t.close(),n.undoManager.transact(function(){$l(n,e,r),n.focus()})},Kl=function(a,n){var e=Ul(n).map(function(n){return E(n,function(n){return e=a,t=n.element,r=zi(a),o=n.column,u=e.dom,i=o.getOr(t),U({width:(c=function(n,e){return u.getStyle(n,e)||u.getAttrib(n,e)})(i,"width"),height:c(t,"height"),scope:u.getAttrib(t,"scope"),celltype:Xi(t),"class":u.getAttrib(t,"class",""),halign:zl(e,t),valign:Wl(e,t)},r?Ml(u,t):{});var e,t,r,o,u,i,c})});return Nl(e.getOrDie())},Xl=function(n,e){var t,r,o,u=sl(oc(n),e);0!==u.length&&(t=Kl(n,u),r={type:"tabpanel",tabs:[{title:"General",name:"general",items:Hl(n)},jl("cell")]},o={type:"panel",items:[{type:"grid",columns:2,items:Hl(n)}]},n.windowManager.open({title:"Cell Properties",size:"normal",body:zi(n)?r:o,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:t,onSubmit:w(Gl,n,u)}))},Yl=[{type:"listbox",name:"type",label:"Row type",items:[{text:"Header",value:"header"},{text:"Body",value:"body"},{text:"Footer",value:"footer"}]},{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height",type:"input"}],Jl=function(n){return Yl.concat((0<(e=Pl(n.getParam("table_row_class_list",[],"array"))).length?x.some({name:"class",type:"listbox",label:"Class",items:e}):x.none()).toArray());var e},Ql=function(i,n,c,a){var l=1===n.length;P(n,function(n){a.type!==Xi(n.parentNode)&&cl(i,n,a.type);var e,t,r,o,u=l?Vl.normal(i,n):Vl.ifTruthy(i,n);t=a,(e=u).setAttrib("scope",t.scope),e.setAttrib("class",t["class"]),e.setStyle("height",nc(t.height)),Wi(i)&&(o=a,(r=u).setStyle("background-color",o.backgroundcolor),r.setStyle("border-color",o.bordercolor),r.setStyle("border-style",o.borderstyle)),a.align!==c.align&&(Bl(i,n),Il(i,n,a.align))}),ot(In.fromDom(n[0])).each(function(n){return Ii(i,n.dom)})},Zl=function(n,e,t,r){var o=r.getData();r.close(),n.undoManager.transact(function(){Ql(n,e,t,o),n.focus()})},nf=function(u){var n,e,t,r,o=dl(oc(u),Nr.selected);0!==o.length&&(n=E(o,function(n){return e=u,t=n.dom,r=Wi(u),o=e.dom,U({height:o.getStyle(t,"height")||o.getAttrib(t,"height"),scope:o.getAttrib(t,"scope"),"class":o.getAttrib(t,"class",""),type:rl(0,t),align:zl(e,t)},r?Ml(o,t):{});var e,t,r,o}),e=Nl(n),t={type:"tabpanel",tabs:[{title:"General",name:"general",items:Jl(u)},jl("row")]},r={type:"panel",items:[{type:"grid",columns:2,items:Jl(u)}]},u.windowManager.open({title:"Row Properties",size:"normal",body:Wi(u)?t:r,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:e,onSubmit:w(Zl,u,E(o,function(n){return n.dom}),e)}))},ef=tinymce.util.Tools.resolve("tinymce.Env"),tf=function(n,e,t,r){if("TD"===e.tagName||"TH"===e.tagName)p(t)?n.setStyle(e,t,r):n.setStyle(e,t);else if(e.children)for(var o=0;o<e.children.length;o++)tf(n,e.children[o],t,r)},rf=function(t,r,n){var o,u=t.dom,i=n.getData();n.close(),""===i["class"]&&delete i["class"],t.undoManager.transact(function(){var n,e;r||(n=parseInt(i.cols,10)||1,e=parseInt(i.rows,10)||1,r=wl(t,n,e,0,0)),function(n,e,t){var r,o=n.dom,u={},i={};if(u["class"]=t["class"],i.height=nc(t.height),o.getAttrib(e,"width")&&!Li(n)?u.width=(r=t.width)?r.replace(/px$/,""):"":i.width=nc(t.width),Li(n)?(i["border-width"]=nc(t.border),i["border-spacing"]=nc(t.cellspacing)):(u.border=t.border,u.cellpadding=t.cellpadding,u.cellspacing=t.cellspacing),Li(n)&&e.children)for(var c=0;c<e.children.length;c++)tf(o,e.children[c],{"border-width":nc(t.border),padding:nc(t.cellpadding)}),Fi(n)&&tf(o,e.children[c],{"border-color":t.bordercolor});Fi(n)&&(i["background-color"]=t.backgroundcolor,i["border-color"]=t.bordercolor,i["border-style"]=t.borderstyle),u.style=o.serializeStyle(U(U({},ji(n)),i)),o.setAttribs(e,U(U({},Ni(n)),u)),Ii(n,e)}(t,r,i),(o=u.select("caption",r)[0])&&!i.caption&&u.remove(o),!o&&i.caption&&((o=u.create("caption")).innerHTML=ef.ie?"\xa0":'<br data-mce-bogus="1"/>',r.insertBefore(o,r.firstChild)),""===i.align?Bl(t,r):Il(t,r,i.align),t.focus(),t.addVisual()})},of=function(n,e){var t,r,o,u,i,c,a,l,f=n.dom,s=Fl(n,Fi(n));!1===e?(t=f.getParent(n.selection.getStart(),"table"))?(o=t,u=Fi(r=n),l=r.dom,s=U({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")||Al(r.dom,o,"padding"),border:(i=l,c=o,a=Ve(In.fromDom(c),"border-width"),Li(r)&&a.isSome()?a.getOr(""):i.getAttrib(c,"border")||Al(r.dom,c,"border-width")||Al(r.dom,c,"border")),caption:!!l.select("caption",o)[0],"class":l.getAttrib(o,"class",""),align:zl(r,o)},u?Ml(l,o):{})):Fi(n)&&(s.borderstyle="",s.bordercolor="",s.backgroundcolor=""):(s.cols="1",s.rows="1",Fi(n)&&(s.borderstyle="",s.bordercolor="",s.backgroundcolor=""));var d=Pl(n.getParam("table_class_list",[],"array"));0<d.length&&s["class"]&&(s["class"]=s["class"].replace(/\s*mce\-item\-table\s*/g,""));var m,g,p,h,v={type:"grid",columns:2,items:(m=d,g=e?[{type:"input",name:"cols",label:"Cols",inputMode:"numeric"},{type:"input",name:"rows",label:"Rows",inputMode:"numeric"}]:[],p=n.getParam("table_appearance_options",!0,"boolean")?[{type:"input",name:"cellspacing",label:"Cell spacing",inputMode:"numeric"},{type:"input",name:"cellpadding",label:"Cell padding",inputMode:"numeric"},{type:"input",name:"border",label:"Border width"},{type:"label",label:"Caption",items:[{type:"checkbox",name:"caption",label:"Show caption"}]}]:[],h=0<m.length?[{type:"listbox",name:"class",label:"Class",items:m}]:[],g.concat([{type:"input",name:"width",label:"Width"},{type:"input",name:"height",label:"Height"}]).concat(p).concat([{type:"listbox",name:"align",label:"Alignment",items:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]).concat(h))},b=Fi(n)?{type:"tabpanel",tabs:[{title:"General",name:"general",items:[v]},jl("table")]}:{type:"panel",items:[v]};n.windowManager.open({title:"Table Properties",size:"normal",body:b,onSubmit:w(rf,n,t),buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:s})},uf=function(n){return fl(oc(n))},cf=function(n){return ll(oc(n))},af=function(c,r,t,a,e){var o=Zi(c),l=function(n){return ot(n,o)},f=function(e){return function(n){c.selection.setRng(n),c.focus(),t.clear(e),ec(e),Ii(c,e.dom)}},u=function(r){return cf(c).each(function(t){l(t).each(function(n){var e=_r(a,n,t);r(n,e).each(f(n))})})},i=function(){return cf(c).map(function(r){return l(r).bind(function(n){var e=_r(a,n,r),t=Ar(y,In.fromDom(c.getDoc()),x.none());return Ol(n,e,t)})})},s=function(){return cf(c).map(function(t){return l(t).bind(function(n){var e=_r(a,n,t);return Rl(n,e)})})},d=function(i,n){return n().each(function(n){var u=E(n,wr);cf(c).each(function(n){return l(n).each(function(n){var e,t,r=Ir(In.fromDom(c.getDoc())),o=(e=u,t=r,{selection:Er(a),clipboard:e,generators:t});i(n,o).each(f(n))})})})};zn({mceTableSplitCells:function(){return u(r.unmergeCells)},mceTableMergeCells:function(){return u(r.mergeCells)},mceTableInsertRowBefore:function(){return u(r.insertRowsBefore)},mceTableInsertRowAfter:function(){return u(r.insertRowsAfter)},mceTableInsertColBefore:function(){return u(r.insertColumnsBefore)},mceTableInsertColAfter:function(){return u(r.insertColumnsAfter)},mceTableDeleteCol:function(){return u(r.deleteColumn)},mceTableDeleteRow:function(){return u(r.deleteRow)},mceTableCutCol:function(n){return s().each(function(n){e.setColumns(n),u(r.deleteColumn)})},mceTableCutRow:function(n){return i().each(function(n){e.setRows(n),u(r.deleteRow)})},mceTableCopyCol:function(n){return s().each(function(n){return e.setColumns(n)})},mceTableCopyRow:function(n){return i().each(function(n){return e.setRows(n)})},mceTablePasteColBefore:function(n){return d(r.pasteColsBefore,e.getColumns)},mceTablePasteColAfter:function(n){return d(r.pasteColsAfter,e.getColumns)},mceTablePasteRowBefore:function(n){return d(r.pasteRowsBefore,e.getRows)},mceTablePasteRowAfter:function(n){return d(r.pasteRowsAfter,e.getRows)},mceTableDelete:function(){return uf(c).each(function(n){ot(n,o).filter(g(o)).each(function(n){var e,t=In.fromText("");Tt(n,t),Et(n),c.dom.isEmpty(c.getBody())?(c.setContent(""),c.selection.setCursorLocation()):((e=c.dom.createRng()).setStart(t.dom,0),e.setEnd(t.dom,0),c.selection.setRng(e),c.nodeChanged())})})},mceTableSizingMode:function(n,e){return t=e,uf(c).each(function(n){Vi(c)||qi(c)||Hi(c)||ot(n,o).each(function(n){"relative"!==t||Au(n)?"fixed"!==t||Iu(n)?"responsive"!==t||Bu(n)||vc(n):hc(c,n):pc(c,n),ec(n),Ii(c,n.dom)})});var t}},function(n,e){return c.addCommand(e,n)});var m=function(e,n){n.each(function(n){Ii(e,n.dom)})};zn({mceTableCellType:function(n,e){var t=ot(oc(c),o);r.setTableCellType(c,e),m(c,t)},mceTableRowType:function(n,e){var t=ot(oc(c),o);r.setTableRowType(c,e),m(c,t)}},function(n,e){return c.addCommand(e,n)}),c.addCommand("mceTableColType",function(n,e){return qn(e,"type").each(function(n){return u("th"===n?r.makeColumnsHeader:r.unmakeColumnsHeader)})}),zn({mceTableProps:w(of,c,!1),mceTableRowProps:w(nf,c),mceTableCellProps:w(Xl,c,a)},function(n,e){return c.addCommand(e,function(){return n()})}),c.addCommand("mceInsertTable",function(n,e){h(e)&&0<jn(e).length?yl(c,e.rows,e.columns,e.options,"Invalid values for mceInsertTable - rows and columns values are required to insert a table."):of(c,!0)}),c.addCommand("mceTableApplyCellStyle",function(n,e){var r,t,o=function(n){return"tablecell"+n.toLowerCase().replace("-","")};!h(e)||0!==(r=sl(oc(c),a)).length&&(function(n){for(var e in n)if(_n.call(n,e))return!1;return!0}(t=Ln(e,function(n,e){return c.formatter.has(o(e))&&p(n)}))||(zn(t,function(e,t){P(r,function(n){Vl.normal(c,n.dom).setFormat(o(t),e)})}),l(r[0]).each(function(n){return Ii(c,n.dom,{structure:!1,style:!0})})))})},lf=function(t,r,o){var n=Zi(t);zn({mceTableRowType:function(){return r.getTableRowType(t)},mceTableCellType:function(){return r.getTableCellType(t)},mceTableColType:function(){return ll(oc(t)).bind(function(t){return ot(t,n).map(function(n){var e=_r(o,n,t);return r.getTableColType(n,e)})}).getOr("")}},function(n,e){return t.addQueryValueHandler(e,n)})},ff=function(){var e=uc(x.none()),t=uc(x.none()),r=function(n){n.set(x.none())};return{getRows:e.get,setRows:function(n){e.set(n),r(t)},clearRows:function(){return r(e)},getColumns:t.get,setColumns:function(n){t.set(n),r(e)},clearColumns:function(){return r(t)}}},sf={tablecellbackgroundcolor:{selector:"td,th",styles:{backgroundColor:"%value"},remove_similar:!0},tablecellbordercolor:{selector:"td,th",styles:{borderColor:"%value"},remove_similar:!0},tablecellborderstyle:{selector:"td,th",styles:{borderStyle:"%value"},remove_similar:!0},tablecellborderwidth:{selector:"td,th",styles:{borderWidth:"%value"},remove_similar:!0}},df=function(n){n.formatter.register(sf)},mf=er([{none:["current"]},{first:["current"]},{middle:["current","target"]},{last:["current"]}]),gf=U(U({},mf),{none:function(n){return void 0===n&&(n=undefined),mf.none(n)}}),pf=function(t,n){return ot(t,n).bind(function(n){var e=tt(n);return _(e,function(n){return Pn(t,n)}).map(function(n){return{index:n,all:e}})})},hf=function(n,e,t,r){return{start:n,soffset:e,finish:t,foffset:r}},vf=er([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),bf={before:vf.before,on:vf.on,after:vf.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(d,d,d)}},wf=er([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),yf={domRange:wf.domRange,relative:wf.relative,exact:wf.exact,exactFromRange:function(n){return wf.exact(n.start,n.soffset,n.finish,n.foffset)},getWin:function(n){var e,t=n.match({domRange:function(n){return In.fromDom(n.startContainer)},relative:function(n,e){return bf.getStart(n)},exact:function(n,e,t,r){return n}});return e=t,In.fromDom(ue(e).dom.defaultView)},range:hf},Cf=function(n,e){return n.selectNodeContents(e.dom)},xf=function(n,e,t){var r,o,u=n.document.createRange();return r=u,e.fold(function(n){r.setStartBefore(n.dom)},function(n,e){r.setStart(n.dom,e)},function(n){r.setStartAfter(n.dom)}),o=u,t.fold(function(n){o.setEndBefore(n.dom)},function(n,e){o.setEnd(n.dom,e)},function(n){o.setEndAfter(n.dom)}),u},Sf=function(n,e,t,r,o){var u=n.document.createRange();return u.setStart(e.dom,t),u.setEnd(r.dom,o),u},Tf=function(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:n.width,height:n.height}},Rf=er([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Of=function(n,e,t){return e(In.fromDom(t.startContainer),t.startOffset,In.fromDom(t.endContainer),t.endOffset)},Df=function(n,e){var o,t,r,u=(o=n,e.match({domRange:function(n){return{ltr:b(n),rtl:x.none}},relative:function(n,e){return{ltr:K(function(){return xf(o,n,e)}),rtl:K(function(){return x.some(xf(o,e,n))})}},exact:function(n,e,t,r){return{ltr:K(function(){return Sf(o,n,e,t,r)}),rtl:K(function(){return x.some(Sf(o,t,r,n,e))})}}}));return(r=(t=u).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Rf.rtl(In.fromDom(n.endContainer),n.endOffset,In.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Of(0,Rf.ltr,r)}):Of(0,Rf.ltr,r)},Af=function(u,n){return Df(u,n).match({ltr:function(n,e,t,r){var o=u.document.createRange();return o.setStart(n.dom,e),o.setEnd(t.dom,r),o},rtl:function(n,e,t,r){var o=u.document.createRange();return o.setStart(t.dom,r),o.setEnd(n.dom,e),o}})},If=(Rf.ltr,Rf.rtl,function(n,e,t){return e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom}),Bf=function(t,r,n,e,o){var u=function(n){var e=t.dom.createRange();return e.setStart(r.dom,n),e.collapse(!0),e},i=_t(r).length,c=function(n,e,t,r,o){if(0===o)return 0;if(e===r)return o-1;for(var u=r,i=1;i<o;i++){var c=n(i),a=Math.abs(e-c.left);if(t<=c.bottom){if(t<c.top||u<a)return i-1;u=a}}return 0}(function(n){return u(n).getBoundingClientRect()},n,e,o.right,i);return u(c)},Ef=function(n,e,t,r){return ee(e)?function(e,t,r,o){var n=e.dom.createRange();n.selectNode(t.dom);var u=n.getClientRects();return V(u,function(n){return If(n,r,o)?x.some(n):x.none()}).map(function(n){return Bf(e,t,r,o,n)})}(n,e,t,r):(u=e,i=t,c=r,a=(o=n).dom.createRange(),l=fe(u),V(l,function(n){return a.selectNode(n.dom),If(a.getBoundingClientRect(),i,c)?Ef(o,n,i,c):x.none()}));var o,u,i,c,a,l},Pf=function(n,e){return e-n.left<n.right-e},kf=function(n,e,t){var r=n.dom.createRange();return r.selectNode(e.dom),r.collapse(t),r},Mf=function(e,n,t){var r=e.dom.createRange();r.selectNode(n.dom);var o=r.getBoundingClientRect(),u=Pf(o,t);return(!0===u?gr:pr)(n).map(function(n){return kf(e,n,u)})},Nf=function(n,e,t){var r=e.dom.getBoundingClientRect(),o=Pf(r,t);return x.some(kf(n,e,o))},jf=function(t,n,e){return x.from(t.dom.caretPositionFromPoint(n,e)).bind(function(n){if(null===n.offsetNode)return x.none();var e=t.dom.createRange();return e.setStart(n.offsetNode,n.offset),e.collapse(),x.some(e)})},_f=function(n,e,t){return x.from(n.dom.caretRangeFromPoint(e,t))},zf=function(n,e,t,r){var o=n.dom.createRange();o.selectNode(e.dom);var u=o.getBoundingClientRect();return function(n,e,t,r){var o=n.dom.createRange();o.selectNode(e.dom);var u=o.getBoundingClientRect(),i=Math.max(u.left,Math.min(u.right,t)),c=Math.max(u.top,Math.min(u.bottom,r));return Ef(n,e,i,c)}(n,e,Math.max(u.left,Math.min(u.right,t)),Math.max(u.top,Math.min(u.bottom,r)))},Wf=function(o,u,e){return In.fromPoint(o,u,e).bind(function(r){var n=function(){return n=o,t=u,(0===fe(e=r).length?Nf:Mf)(n,e,t);var n,e,t};return 0===fe(r).length?n():zf(o,r,u,e).orThunk(n)})},Ff=document.caretPositionFromPoint?jf:document.caretRangeFromPoint?_f:Wf,Lf=function(n,e){var t=Yn(n);return"input"===t?bf.after(n):A(["br","img"],t)?0===e?bf.before(n):bf.after(n):bf.on(n,e)},Hf=function(n,e){var t=n.fold(bf.before,Lf,bf.after),r=e.fold(bf.before,Lf,bf.after);return yf.relative(t,r)},qf=function(n,e,t,r){var o=Lf(n,e),u=Lf(t,r);return yf.relative(o,u)},Vf=function(n,e,t,r){var o,u,i,c,a,l=(u=e,i=t,c=r,(a=oe(o=n).dom.createRange()).setStart(o.dom,u),a.setEnd(i.dom,c),a),f=Pn(n,t)&&e===r;return l.collapsed&&!f},Uf=function(n){return x.from(n.getSelection())},$f=function(n,e){Uf(n).each(function(n){n.removeAllRanges(),n.addRange(e)})},Gf=function(n,e,t,r,o){var u=Sf(n,e,t,r,o);$f(n,u)},Kf=function(s,n){return Df(s,n).match({ltr:function(n,e,t,r){Gf(s,n,e,t,r)},rtl:function(c,a,l,f){Uf(s).each(function(n){if(n.setBaseAndExtent)n.setBaseAndExtent(c.dom,a,l.dom,f);else if(n.extend)try{t=c,r=a,o=l,u=f,(e=n).collapse(t.dom,r),e.extend(o.dom,u)}catch(i){Gf(s,l,f,c,a)}else Gf(s,l,f,c,a);var e,t,r,o,u})}})},Xf=function(n,e,t,r,o){var u=qf(e,t,r,o);Kf(n,u)},Yf=function(n,e,t){var r=Hf(e,t);Kf(n,r)},Jf=function(n){var o=yf.getWin(n).dom,e=function(n,e,t,r){return Sf(o,n,e,t,r)},t=n.match({domRange:function(n){var e=In.fromDom(n.startContainer),t=In.fromDom(n.endContainer);return qf(e,n.startOffset,t,n.endOffset)},relative:Hf,exact:qf});return Df(o,t).match({ltr:e,rtl:e})},Qf=function(n){if(0<n.rangeCount){var e=n.getRangeAt(0),t=n.getRangeAt(n.rangeCount-1);return x.some(hf(In.fromDom(e.startContainer),e.startOffset,In.fromDom(t.endContainer),t.endOffset))}return x.none()},Zf=function(n){if(null===n.anchorNode||null===n.focusNode)return Qf(n);var e=In.fromDom(n.anchorNode),t=In.fromDom(n.focusNode);return Vf(e,n.anchorOffset,t,n.focusOffset)?x.some(hf(e,n.anchorOffset,t,n.focusOffset)):Qf(n)},ns=function(n,e){var t,r,o=(t=e,r=n.document.createRange(),Cf(r,t),r);$f(n,o)},es=function(n){return Uf(n).filter(function(n){return 0<n.rangeCount}).bind(Zf).map(function(n){return yf.exact(n.start,n.soffset,n.finish,n.foffset)})},ts=function(n,e){var t,r,o,u=Af(n,e);return r=(t=u).getClientRects(),0<(o=0<r.length?r[0]:t.getBoundingClientRect()).width||0<o.height?x.some(o).map(Tf):x.none()},rs=function(n,e,t){return r=n,o=e,u=t,i=In.fromDom(r.document),Ff(i,o,u).map(function(n){return hf(In.fromDom(n.startContainer),n.startOffset,In.fromDom(n.endContainer),n.endOffset)});var r,o,u,i},os=tinymce.util.Tools.resolve("tinymce.util.VK"),us=function(n,e,t,r){return as(n,e,pf(o=t,u).fold(function(){return gf.none(o)},function(n){return n.index+1<n.all.length?gf.middle(o,n.all[n.index+1]):gf.last(o)}),r);var o,u},is=function(n,e,t,r){return as(n,e,pf(o=t,u).fold(function(){return gf.none()},function(n){return 0<=n.index-1?gf.middle(o,n.all[n.index-1]):gf.first(o)}),r);var o,u},cs=function(n,e){var t=yf.exact(e,0,e,0);return Jf(t)},as=function(o,n,e,u){return e.fold(x.none,x.none,function(n,e){return gr(e).map(function(n){return cs(0,n)})},function(r){return ot(r,n).bind(function(n){var e,t=jr(r);return o.undoManager.transact(function(){u.insertRowsAfter(n,t)}),e=Te(n,"tr"),q(e).bind(function(n){return Ie(n,"td,th").map(function(n){return cs(0,n)})})})})},ls=["table","li","dl"],fs=function(e,t,r){var o,u,n,i;e.keyCode===os.TAB&&(o=Yi(t),u=function(n){var e=Yn(n);return Pn(n,o)||A(ls,e)},(n=t.selection.getRng()).collapsed&&(i=In.fromDom(n.startContainer),et(i,u).each(function(n){e.preventDefault(),(e.shiftKey?is:us)(t,u,n,r).each(function(n){t.selection.setRng(n)})})))},ss=function(n,e){return{selection:n,kill:e}},ds=function(n,e,t,r){return{start:bf.on(n,e),finish:bf.on(t,r)}},ms=function(n,e){var t=Af(n,e);return hf(In.fromDom(t.startContainer),t.startOffset,In.fromDom(t.endContainer),t.endOffset)},gs=ds,ps=function(t,n,r,e,o){return Pn(r,e)?x.none():Xt(r,e,n).bind(function(n){var e=n.boxes.getOr([]);return 0<e.length?(o(t,e,n.start,n.finish),x.some(ss(x.some(gs(r,0,r,sr(r))),!0))):x.none()})},hs=function(n,e){return{item:n,mode:e}},vs=function(n,e,t,r){return void 0===r&&(r=bs),n.property().parent(e).map(function(n){return hs(n,r)})},bs=function(n,e,t,r){return void 0===r&&(r=ws),t.sibling(n,e).map(function(n){return hs(n,r)})},ws=function(n,e,t,r){void 0===r&&(r=ws);var o=n.property().children(e);return t.first(o).map(function(n){return hs(n,r)})},ys=[{current:vs,next:bs,fallback:x.none()},{current:bs,next:ws,fallback:x.some(vs)},{current:ws,next:ws,fallback:x.some(bs)}],Cs=function(e,t,r,o,n){return void 0===n&&(n=ys),j(n,function(n){return n.current===r}).bind(function(n){return n.current(e,t,o,n.next).orThunk(function(){return n.fallback.bind(function(n){return Cs(e,t,n,o)})})})},xs=function(){return{sibling:function(n,e){return n.query().prevSibling(e)},first:function(n){return 0<n.length?x.some(n[n.length-1]):x.none()}}},Ss=function(){return{sibling:function(n,e){return n.query().nextSibling(e)},first:function(n){return 0<n.length?x.some(n[0]):x.none()}}},Ts=function(e,n,t,r,o,u){return Cs(e,n,r,o).bind(function(n){return u(n.item)?x.none():t(n.item)?x.some(n.item):Ts(e,n.item,t,n.mode,o,u)})},Rs=function(e){return function(n){return 0===e.property().children(n).length}},Os=function(n,e,t,r){return Ts(n,e,t,bs,xs(),r)},Ds=function(n,e,t,r){return Ts(n,e,t,bs,Ss(),r)},As=Lt(),Is=function(n,e){return Os(t=As,n,Rs(t),e);var t},Bs=function(n,e){return Ds(t=As,n,Rs(t),e);var t},Es=er([{none:["message"]},{success:[]},{failedUp:["cell"]},{failedDown:["cell"]}]),Ps=function(n){return Be(n,"tr")},ks=U(U({},Es),{verify:function(c,n,e,t,r,a,o){return Be(t,"td,th",o).bind(function(i){return Be(n,"td,th",o).map(function(u){return Pn(i,u)?Pn(t,i)&&sr(i)===r?a(u):Es.none("in same cell"):Gt(Ps,[i,u]).fold(function(){return e=u,t=i,r=(n=c).getRect(e),(o=n.getRect(t)).right>r.left&&o.left<r.right?Es.success():a(u);var n,e,t,r,o},function(n){return a(u)})})}).getOr(Es.none("default"))},cata:function(n,e,t,r,o){return n.fold(e,t,r,o)}}),Ms=function(n,e){return _(n,w(Pn,e))},Ns=function(n){return"br"===Yn(n)},js=function(n,e,t){return e(n,t).bind(function(n){return ee(n)&&0===_t(n).trim().length?js(n,e,t):x.some(n)})},_s=function(e,n,t,r){return se(o=n,u=t).filter(Ns).orThunk(function(){return se(o,u-1).filter(Ns)}).bind(function(n){return r.traverse(n).fold(function(){return js(n,r.gather,e).map(r.relative)},function(n){return ie(r=n).bind(function(e){var t=fe(e);return Ms(t,r).map(function(n){return{parent:e,children:t,element:r,index:n}})}).map(function(n){return bf.on(n.parent,n.index)});var r})});var o,u},zs=function(n,e,t,r){var o,u,i;return(Ns(e)?(o=n,u=e,(i=r).traverse(u).orThunk(function(){return js(u,i.gather,o)}).map(i.relative)):_s(n,e,t,r)).map(function(n){return{start:n,finish:n}})},Ws=function(n,e){return{left:n.left,top:n.top+e,right:n.right,bottom:n.bottom+e}},Fs=function(n,e){return{left:n.left,top:n.top-e,right:n.right,bottom:n.bottom-e}},Ls=function(n,e,t){return{left:n.left+e,top:n.top+t,right:n.right+e,bottom:n.bottom+t}},Hs=function(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom}},qs=function(n,e){return x.some(n.getRect(e))},Vs=function(n,e,t){return ne(e)?qs(n,e).map(Hs):ee(e)?(r=n,o=e,(0<=(u=t)&&u<sr(o)?r.getRangedRect(o,u,o,u+1):0<u?r.getRangedRect(o,u-1,o,u):x.none()).map(Hs)):x.none();var r,o,u},Us=function(n,e){return ne(e)?qs(n,e).map(Hs):ee(e)?n.getRangedRect(e,0,e,sr(e)).map(Hs):x.none()},$s=er([{none:[]},{retry:["caret"]}]),Gs=function(e,n,r){return Re(function(n,e){return e(n)},Oe,n,Ra,t).fold(f,function(n){return Us(e,n).exists(function(n){return t=n,(e=r).left<t.left||Math.abs(t.right-e.left)<1||e.left>t.right;var e,t})});var t},Ks={point:function(n){return n.bottom},adjuster:function(n,e,t,r,o){var u=Ws(o,5);return Math.abs(t.bottom-r.bottom)<1||t.top>o.bottom?$s.retry(u):t.top===o.bottom?$s.retry(Ws(o,1)):Gs(n,e,o)?$s.retry(Ls(u,5,0)):$s.none()},move:Ws,gather:Bs},Xs=function(t,r,o,u,i){return 0===i?x.some(u):(a=t,l=u.left,f=r.point(u),a.elementFromPoint(l,f).filter(function(n){return"table"===Yn(n)}).isSome()?(e=u,c=i-1,Xs(t,n=r,o,n.move(e,5),c)):t.situsFromPoint(u.left,r.point(u)).bind(function(n){return n.start.fold(x.none,function(e){return Us(t,e).bind(function(n){return r.adjuster(t,e,n,o,u).fold(x.none,function(n){return Xs(t,r,o,n,i-1)})}).orThunk(function(){return x.some(u)})},x.none)}));var n,e,c,a,l,f},Ys=function(e,t,n){var r,o,u,i=e.move(n,5),c=Xs(t,e,n,i,100).getOr(i);return o=c,u=t,((r=e).point(o)>u.getInnerHeight()?x.some(r.point(o)-u.getInnerHeight()):r.point(o)<0?x.some(-r.point(o)):x.none()).fold(function(){return t.situsFromPoint(c.left,e.point(c))},function(n){return t.scrollBy(0,n),t.situsFromPoint(c.left,e.point(c)-n)})},Js={tryUp:w(Ys,{point:function(n){return n.top},adjuster:function(n,e,t,r,o){var u=Fs(o,5);return Math.abs(t.top-r.top)<1||t.bottom<o.top?$s.retry(u):t.bottom===o.top?$s.retry(Fs(o,1)):Gs(n,e,o)?$s.retry(Ls(u,5,0)):$s.none()},move:Fs,gather:Is}),tryDown:w(Ys,Ks),ieTryUp:function(n,e){return n.situsFromPoint(e.left,e.top-5)},ieTryDown:function(n,e){return n.situsFromPoint(e.left,e.bottom+5)},getJumpSize:b(5)},Qs=function(u,i,c){return u.getSelection().bind(function(o){return zs(i,o.finish,o.foffset,c).fold(function(){return x.some(xc(o.finish,o.foffset))},function(n){var e,t=u.fromSitus(n),r=ks.verify(u,o.finish,o.foffset,t.finish,t.foffset,c.failure,i);return e=r,ks.cata(e,function(n){return x.none()},function(){return x.none()},function(n){return x.some(xc(n,0))},function(n){return x.some(xc(n,sr(n)))})})})},Zs=function(r,o,u,i,c,a){return 0===a?x.none():td(r,o,u,i,c).bind(function(n){var e=r.fromSitus(n),t=ks.verify(r,u,i,e.finish,e.foffset,c.failure,o);return ks.cata(t,function(){return x.none()},function(){return x.some(n)},function(n){return Pn(u,n)&&0===i?nd(r,u,i,Fs,c):Zs(r,o,n,0,c,a-1)},function(n){return Pn(u,n)&&i===sr(n)?nd(r,u,i,Ws,c):Zs(r,o,n,sr(n),c,a-1)})})},nd=function(e,n,t,r,o){return Vs(e,n,t).bind(function(n){return ed(e,o,r(n,Js.getJumpSize()))})},ed=function(n,e,t){var r=Dn().browser;return r.isChrome()||r.isSafari()||r.isFirefox()||r.isEdge()?e.otherRetry(n,t):r.isIE()?e.ieRetry(n,t):x.none()},td=function(e,n,t,r,o){return Vs(e,t,r).bind(function(n){return ed(e,o,n)})},rd=function(n,e){return Oe(n,function(n){return ie(n).exists(function(n){return Pn(n,e)})},t).isSome();var t},od=function(u,i,c,n,a){return Be(n,"td,th",i).bind(function(o){return Be(o,"table",i).bind(function(n){return rd(a,n)?Qs(e=u,t=i,r=c).bind(function(n){return Zs(e,t,n.element,n.offset,r,20).map(e.fromSitus)}).bind(function(e){return Be(e.finish,"td,th",i).map(function(n){return{start:o,finish:n,range:e}})}):x.none();var e,t,r})})},ud=function(n,e,t,r,o,u){return Dn().browser.isIE()?x.none():u(r,e).orThunk(function(){return od(n,e,t,r,o).map(function(n){var e=n.range;return ss(x.some(gs(e.start,e.soffset,e.finish,e.foffset)),!0)})})},id=function(n,r){return Be(n,"tr",r).bind(function(t){return Be(t,"table",r).bind(function(n){var e=Te(n,"tr");return Pn(t,e[0])?Os(As,n,function(n){return pr(n).isSome()},r).map(function(n){var e=sr(n);return ss(x.some(gs(n,e,n,e)),!0)}):x.none()})})},cd=function(n,r){return Be(n,"tr",r).bind(function(t){return Be(t,"table",r).bind(function(n){var e=Te(n,"tr");return Pn(t,e[e.length-1])?Ds(As,n,function(n){return gr(n).isSome()},r).map(function(n){return ss(x.some(gs(n,0,n,0)),!0)}):x.none()})})},ad=function(n,e,t,r,o,u,i){return od(n,t,r,o,u).bind(function(n){return ps(e,t,n.start,n.finish,i)})},ld=function(n,e){return Be(n,"td,th",e)};function fd(o,u,e,i){var t,r=(t=uc(x.none()),{clear:function(){return t.set(x.none())},set:function(n){return t.set(x.some(n))},isSet:function(){return t.get().isSome()},on:function(n){return t.get().each(n)}}),c=r.clear;return{clearstate:c,mousedown:function(n){i.clear(u),ld(n.target,e).each(r.set)},mouseover:function(n){r.on(function(r){i.clearBeforeUpdate(u),ld(n.target,e).each(function(t){Xt(r,t,e).each(function(n){var e=n.boxes.getOr([]);(1<e.length||1===e.length&&!Pn(r,t))&&(i.selectRange(u,e,n.start,n.finish),o.selectContents(t))})})})},mouseup:function(n){c()}}}var sd={traverse:le,gather:Bs,relative:bf.before,otherRetry:Js.tryDown,ieRetry:Js.ieTryDown,failure:ks.failedDown},dd={traverse:ae,gather:Is,relative:bf.before,otherRetry:Js.tryUp,ieRetry:Js.ieTryUp,failure:ks.failedUp},md=function(e){return function(n){return n===e}},gd=md(38),pd=md(40),hd=function(n){return 37<=n&&n<=40},vd={isBackward:md(37),isForward:md(39)},bd={isBackward:md(39),isForward:md(37)},wd=function(c){return{elementFromPoint:function(n,e){return In.fromPoint(In.fromDom(c.document),n,e)},getRect:function(n){return n.dom.getBoundingClientRect()},getRangedRect:function(n,e,t,r){var o=yf.exact(n,e,t,r);return ts(c,o)},getSelection:function(){return es(c).map(function(n){return ms(c,n)})},fromSitus:function(n){var e=yf.relative(n.start,n.finish);return ms(c,e)},situsFromPoint:function(n,e){return rs(c,n,e).map(function(n){return ds(n.start,n.soffset,n.finish,n.foffset)})},clearSelection:function(){Uf(c).each(function(n){return n.removeAllRanges()})},collapseSelection:function(i){void 0===i&&(i=!1),es(c).each(function(n){return n.fold(function(n){return n.collapse(i)},function(n,e){var t=i?n:e;Yf(c,t,t)},function(n,e,t,r){var o=i?n:t,u=i?e:r;Xf(c,o,u,o,u)})})},setSelection:function(n){Xf(c,n.start,n.soffset,n.finish,n.foffset)},setRelativeSelection:function(n,e){Yf(c,n,e)},selectContents:function(n){ns(c,n)},getInnerHeight:function(){return c.innerHeight},getScrollY:function(){var n,e,t,r;return(n=In.fromDom(c.document),e=n!==undefined?n.dom:document,t=e.body.scrollLeft||e.documentElement.scrollLeft,r=e.body.scrollTop||e.documentElement.scrollTop,ao(t,r)).top},scrollBy:function(n,e){var t,r,o,u;t=n,r=e,o=In.fromDom(c.document),(u=(o!==undefined?o.dom:document).defaultView)&&u.scrollBy(t,r)}}},yd=function(n,e){return{rows:n,cols:e}},Cd=function(n,e,t,r){var o=fd(wd(n),e,t,r);return{clearstate:o.clearstate,mousedown:o.mousedown,mouseover:o.mouseover,mouseup:o.mouseup}},xd=function(n,g,p,h){var l=wd(n),f=function(){return h.clear(g),x.none()};return{keydown:function(n,e,t,r,o,i){var u=n.raw,c=u.which,a=!0===u.shiftKey;return Yt(g,h.selectedSelector).fold(function(){return pd(c)&&a?w(ad,l,g,p,sd,r,e,h.selectRange):gd(c)&&a?w(ad,l,g,p,dd,r,e,h.selectRange):pd(c)?w(ud,l,p,sd,r,e,cd):gd(c)?w(ud,l,p,dd,r,e,id):x.none},function(u){var n=function(n){return function(){return V(n,function(n){return e=n.rows,t=n.cols,r=g,Qt(u,e,t,(o=h).firstSelectedSelector,o.lastSelectedSelector).map(function(n){return o.clearBeforeUpdate(r),o.selectRange(r,n.boxes,n.start,n.finish),n.boxes});var e,t,r,o}).fold(function(){return Jt(g,h.firstSelectedSelector,h.lastSelectedSelector).map(function(n){var e=pd(c)||i.isForward(c)?bf.after:bf.before;return l.setRelativeSelection(bf.on(n.first,0),e(n.table)),h.clear(g),ss(x.none(),!0)})},function(n){return x.some(ss(x.none(),!0))})}};return pd(c)&&a?n([yd(1,0)]):gd(c)&&a?n([yd(-1,0)]):i.isBackward(c)&&a?n([yd(0,-1),yd(-1,0)]):i.isForward(c)&&a?n([yd(0,1),yd(1,0)]):hd(c)&&!1==a?f:x.none})()},keyup:function(l,f,s,d,m){return Yt(g,h.selectedSelector).fold(function(){var t,r,n,e,o,u,i,c=l.raw,a=c.which;return!1!=(!0===c.shiftKey)&&hd(a)?(t=g,r=p,n=f,e=s,o=d,u=m,i=h.selectRange,Pn(n,o)&&e===u?x.none():Be(n,"td,th",r).bind(function(e){return Be(o,"td,th",r).bind(function(n){return ps(t,r,e,n,i)})})):x.none()},x.none)}}},Sd=function(n,r,e,o){var u=wd(n);return function(n,t){o.clearBeforeUpdate(r),Xt(n,t,e).each(function(n){var e=n.boxes.getOr([]);o.selectRange(r,e,n.start,n.finish),u.selectContents(t),u.collapseSelection()})}},Td=function(r,n){P(n,function(n){var e,t;t=n,Qu(e=r)?e.dom.classList.remove(t):ni(e,t),ti(e)})},Rd={byClass:function(o){var e,t,u=(e=o.selected,function(n){ei(n,e)}),r=(t=[o.selected,o.lastSelected,o.firstSelected],function(n){Td(n,t)}),i=function(n){var e=Te(n,o.selectedSelector);P(e,r)};return{clearBeforeUpdate:i,clear:i,selectRange:function(n,e,t,r){i(n),P(e,u),ei(t,o.firstSelected),ei(r,o.lastSelected)},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}},byAttr:function(o,u,e){var t=function(n){je(n,o.selected),je(n,o.firstSelected),je(n,o.lastSelected)},i=function(n){Pe(n,o.selected,"1")},c=function(n){r(n),e()},r=function(n){var e=Te(n,o.selectedSelector);P(e,t)};return{clearBeforeUpdate:r,clear:c,selectRange:function(n,e,t,r){c(n),P(e,i),Pe(t,o.firstSelected,"1"),Pe(r,o.lastSelected,"1"),u(e,t,r)},selectedSelector:o.selectedSelector,firstSelectedSelector:o.firstSelectedSelector,lastSelectedSelector:o.lastSelectedSelector}}},Od=function(n,e,s){var d=mt.fromTable(n);return Xc(d,e).map(function(n){var t,e,r,o,u,i,c,a,l,f=Hc(d,s,!1);return{upOrLeftCells:(t=n,e=s,r=f.slice(0,t[t.length-1].row+1),o=Vc(r,e),W(o,function(n){var e=n.cells.slice(0,t[t.length-1].column+1);return E(e,function(n){return n.element})})),downOrRightCells:(i=n,c=s,a=(u=f).slice(i[0].row+i[0].rowspan-1,u.length),l=Vc(a,c),W(l,function(n){var e=n.cells.slice(i[0].column+i[0].colspan-1,n.cells.length);return E(e,function(n){return n.element})}))}})},Dd=function(n){return!1===ri(In.fromDom(n.target),"ephox-snooker-resizer-bar")};function Ad(d,m,n){var g=Rd.byAttr(Nr,function(u,i,c){n.targets().each(function(o){ot(i).each(function(n){var e=Ki(d),t=Ar(y,In.fromDom(d.getDoc()),e),r=Od(n,o,t);Di(d,u,i,c,r)})})},function(){return Ai(d)});return d.on("init",function(n){var r=d.getWin(),o=Yi(d),e=Zi(d),t=Cd(r,o,e,g),i=xd(r,o,e,g),u=Sd(r,o,e,g);d.on("TableSelectorChange",function(n){return u(n.start,n.finish)});var c,a,l=function(n,e){!0===n.raw.shiftKey&&(e.kill&&n.kill(),e.selection.each(function(n){var e=yf.relative(n.start,n.finish),t=Af(r,e);d.selection.setRng(t)}))},f=function(n){return 0===n.button},s=(c=uc(In.fromDom(o)),a=uc(0),{touchEnd:function(n){var e,t,r=In.fromDom(n.target);"td"!==Yn(r)&&"th"!==Yn(r)||(e=c.get(),t=a.get(),Pn(e,r)&&n.timeStamp-t<300&&(n.preventDefault(),u(r,r))),c.set(r),a.set(n.timeStamp)}});d.on("dragstart",function(n){t.clearstate()}),d.on("mousedown",function(n){f(n)&&Dd(n)&&t.mousedown(Yu(n))}),d.on("mouseover",function(n){var e;((e=n).buttons===undefined||ef.browser.isEdge()&&0===e.buttons||0!=(1&e.buttons))&&Dd(n)&&t.mouseover(Yu(n))}),d.on("mouseup",function(n){f(n)&&Dd(n)&&t.mouseup(Yu(n))}),d.on("touchend",s.touchEnd),d.on("keyup",function(n){var e,t,r,o=Yu(n);o.raw.shiftKey&&hd(o.raw.which)&&(e=d.selection.getRng(),t=In.fromDom(e.startContainer),r=In.fromDom(e.endContainer),i.keyup(o,t,e.startOffset,r,e.endOffset).each(function(n){l(o,n)}))}),d.on("keydown",function(n){var e=Yu(n);m().each(function(n){return n.hideBars()});var t=d.selection.getRng(),r=In.fromDom(t.startContainer),o=In.fromDom(t.endContainer),u=to(vd,bd)(In.fromDom(d.selection.getStart()));i.keydown(e,r,t.startOffset,o,t.endOffset,u).each(function(n){l(e,n)}),m().each(function(n){return n.showBars()})}),d.on("NodeChange",function(){var n=d.selection,e=In.fromDom(n.getStart()),t=In.fromDom(n.getEnd());Gt(ot,[e,t]).fold(function(){return g.clear(o)},y)})}),{clear:g.clear}}var Id=function(n,t){var o=uc(x.none()),u=uc([]),e=function(){return fl(oc(n)).bind(function(e){var n=ot(e);return n.map(function(n){return"caption"===Yn(e)?jr(e):_r(t,n,e)})})},r=function(){o.set(K(e)()),P(u.get(),function(n){return n()})},i=function(e,t){var r=function(){return o.get().fold(function(){e.setDisabled(!0)},function(n){e.setDisabled(t(n))})};return r(),u.set(u.get().concat([r])),function(){u.set(k(u.get(),function(n){return n!==r}))}};return n.on("NodeChange ExecCommand TableSelectorChange",r),{onSetupTable:function(n){return i(n,function(n){return!1})},onSetupCellOrRow:function(n){return i(n,function(n){return"caption"===Yn(n.element)})},onSetupPasteable:function(e){return function(n){return i(n,function(n){return"caption"===Yn(n.element)||e().isNone()})}},onSetupMergeable:function(n){return i(n,function(n){return n.mergable.isNone()})},onSetupUnmergeable:function(n){return i(n,function(n){return n.unmergable.isNone()})},resetTargets:r,targets:function(){return o.get()}}},Bd=function(e,n,t){e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(n){return n("inserttable | cell row column | advtablesort | tableprops deletetable")}});var r=function(n){return function(){return e.execCommand(n)}};e.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:r("mceTableProps"),icon:"table",onSetup:n.onSetupTable}),e.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:r("mceTableDelete"),icon:"table-delete-table",onSetup:n.onSetupTable}),e.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:r("mceTableCellProps"),icon:"table-cell-properties",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:r("mceTableMergeCells"),icon:"table-merge-cells",onSetup:n.onSetupMergeable}),e.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:r("mceTableSplitCells"),icon:"table-split-cells",onSetup:n.onSetupUnmergeable}),e.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:r("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:r("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:r("mceTableDeleteRow"),icon:"table-delete-row",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:r("mceTableRowProps"),icon:"table-row-properties",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:r("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:r("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:r("mceTableDeleteCol"),icon:"table-delete-column",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(t.getRows)}),e.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(t.getRows)}),e.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:n.onSetupPasteable(t.getColumns)}),e.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:n.onSetupPasteable(t.getColumns)}),e.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:r("mceInsertTable"),icon:"table"})},Ed=function(e){var n=e.getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol");0<n.length&&e.ui.registry.addContextToolbar("table",{predicate:function(n){return e.dom.is(n,"table")&&e.getBody().contains(n)},items:n,scope:"node",position:"node"})},Pd=function(e,n,t){var r=function(n){return function(){return e.execCommand(n)}},o=function(n){e.execCommand("mceInsertTable",!1,{rows:n.numRows,columns:n.numColumns})},u={text:"Table properties",onSetup:n.onSetupTable,onAction:r("mceTableProps")},i={text:"Delete table",icon:"table-delete-table",onSetup:n.onSetupTable,onAction:r("mceTableDelete")};e.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:r("mceTableInsertRowBefore"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:r("mceTableInsertRowAfter"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:r("mceTableDeleteRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:r("mceTableRowProps"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(t.getRows)}),e.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(t.getRows)});e.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:r("mceTableInsertColBefore"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:r("mceTableInsertColAfter"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:r("mceTableDeleteCol"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:n.onSetupPasteable(t.getColumns)}),e.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:n.onSetupPasteable(t.getColumns)});e.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:r("mceTableCellProps"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:r("mceTableMergeCells"),onSetup:n.onSetupMergeable}),e.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:r("mceTableSplitCells"),onSetup:n.onSetupUnmergeable});!1===e.getParam("table_grid",!0,"boolean")?e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:r("mceInsertTable")}):e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:o}]}}),e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:r("mceInsertTable")}),e.ui.registry.addMenuItem("tableprops",u),e.ui.registry.addMenuItem("deletetable",i),e.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:function(){return"tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter"}}),e.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:function(){return"tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter"}}),e.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:function(){return"tablecellprops tablemergecells tablesplitcells"}}),e.ui.registry.addContextMenu("table",{update:function(){return n.resetTargets(),n.targets().fold(function(){return""},function(n){return"caption"===Yn(n.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"})}})};function kd(e){var n=cr(function(){return Yi(e)},function(){return fl(oc(e))},Nr.selectedSelector),t=Id(e,n),r=Cc(e),o=Ad(e,r.lazyResize,t),u=ml(e,r.lazyWire,n),i=ff();return af(e,u,o,n,i),lf(e,u,n),zr(e,n,u,o),Pd(e,t,i),Bd(e,t,i),Ed(e),e.on("PreInit",function(){e.serializer.addTempAttr(Nr.firstSelected),e.serializer.addTempAttr(Nr.lastSelected),df(e)}),_i(e)&&e.on("keydown",function(n){fs(n,e,u)}),e.on("remove",function(){r.destroy()}),Sl(e,i,r,t)}ar.add("table",kd)}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(){},o=function(e){return function(){return e}};var n,r,a,c=o(!1),u=o(!0),_=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=tinymce.util.Tools.resolve("tinymce.util.XHR"),i=function(e){return e.getParam("template_mdate_classes","mdate")},l=function(e){return e.getParam("template_replace_values")},f=function(e){return e.getParam("template_mdate_format",e.translate("%Y-%m-%d"))},m=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},p=function(e,t,n){var r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),c="January February March April May June July August September October November December".split(" ");return n=n||new Date,t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",m(n.getMonth()+1,2))).replace("%d",m(n.getDate(),2))).replace("%H",""+m(n.getHours(),2))).replace("%M",""+m(n.getMinutes(),2))).replace("%S",""+m(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(c[n.getMonth()]))).replace("%b",""+e.translate(o[n.getMonth()]))).replace("%A",""+e.translate(a[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},d=function(t,n){return function(){var e=t.getParam("templates");"function"!=typeof e?"string"==typeof e?s.send({url:e,success:function(e){n(JSON.parse(e))}}):n(e):e(n)}},x=function(n,e){return _.each(e,function(e,t){"function"==typeof e&&(e=e(t)),n=n.replace(new RegExp("\\{\\$"+t+"\\}","g"),e)}),n},g=function(e,t){var r=e.dom,a=l(e);_.each(r.select("*",t),function(n){_.each(a,function(e,t){r.hasClass(n,t)&&"function"==typeof a[t]&&a[t](n)})})},v=function(e,t){return new RegExp("\\b"+t+"\\b","g").test(e.className)},y=function(n,e,t){var r,a=n.dom,o=n.selection.getContent();t=x(t,l(n)),r=a.create("div",null,t);var c=a.select(".mceTmpl",r);c&&0<c.length&&(r=a.create("div",null)).appendChild(c[0].cloneNode(!0)),_.each(a.select("*",r),function(e){var t;v(e,n.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(e.innerHTML=p(n,(t=n).getParam("template_cdate_format",t.translate("%Y-%m-%d")))),v(e,i(n).replace(/\s+/g,"|"))&&(e.innerHTML=p(n,f(n))),v(e,n.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(e.innerHTML=o)}),g(n,r),n.execCommand("mceInsertContent",!1,r.innerHTML),n.addVisual()},h=function(e){e.addCommand("mceInsertTemplate",function(r){for(var a=[],e=1;e<arguments.length;e++)a[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.concat(e);return r.apply(null,n)}}(y,e))},b=function(){return T},T=(n=function(e){return e.isNone()},{fold:function(e,t){return e()},is:c,isSome:c,isNone:u,getOr:a=function(e){return e},getOrThunk:r=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:a,orThunk:r,map:b,each:t,bind:b,exists:c,forall:u,filter:b,equals:n,equals_:n,toArray:function(){return[]},toString:o("none()")}),M=function(n){var e=o(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:c,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return M(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?a:T},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(c,function(e){return t(n,e)})}};return a},O={some:M,none:b,from:function(e){return null===e||e===undefined?T:M(e)}},P=function(e,t){return function(e,t,n){for(var r=0,a=e.length;r<a;r++){var o=e[r];if(t(o,r))return O.some(o);if(n(o,r))break}return O.none()}(e,t,c)},S=tinymce.util.Tools.resolve("tinymce.Env"),w=tinymce.util.Tools.resolve("tinymce.util.Promise"),D=Object.hasOwnProperty,A=function(e,t){return D.call(e,t)},C={'"':""","<":"<",">":">","&":"&","'":"'"},N=function(e){return e.replace(/["'<>&]/g,function(e){return(A(t=C,n=e)?O.from(t[n]):O.none()).getOr(e);var t,n})},I=function(M,t){var e=function(e){return function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var o=e[a];r[a]=t(o,a)}return r}(e,function(e){return{text:e.text,value:e.text}})},u=function(e,t){return P(e,function(e){return e.text===t})},i=function(e){M.windowManager.alert("Could not load the specified template.",function(){return e.focus("template")})},l=function(e){return new w(function(t,n){e.value.url.fold(function(){return t(e.value.content.getOr(""))},function(e){return s.send({url:e,success:function(e){t(e)},error:function(e){n(e)}})})})};(function(){if(t&&0!==t.length)return O.from(_.map(t,function(e,t){var n=function(e){return e.url!==undefined};return{selected:0===t,text:e.title,value:{url:n(e)?O.from(e.url):O.none(),content:n(e)?O.none():O.from(e.content),description:e.description}}}));var e=M.translate("No templates defined.");return M.notificationManager.open({text:e,type:"info"}),O.none()})().each(function(o){var b=e(o),T=function(e,t){return{title:"Insert Template",size:"large",body:{type:"panel",items:e},initialData:t,buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(t){var e=t.getData();u(n,e.template).each(function(e){l(e).then(function(e){y(M,0,e),t.close()})["catch"](function(){t.disable("save"),i(t)})})},onChange:(r=n=o,a=c,function(n,e){var t;"template"===e.name&&(t=n.getData().template,u(r,t).each(function(t){n.block("Loading..."),l(t).then(function(e){a(n,t,e)})["catch"](function(){a(n,t,""),n.disable("save"),i(n)})}))})};var r,a,n},c=function(e,t,n){var r,a,o,c,u,i,l,s,f,m,p,d,g,v=(r=M,-1===(a=n).indexOf("<html>")&&(o="",(c=r.getParam("content_style","","string"))&&(o+='<style type="text/css">'+c+"</style>"),u=r.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"",_.each(r.contentCSS,function(e){o+='<link type="text/css" rel="stylesheet" href="'+r.documentBaseURI.toAbsolute(e)+'"'+u+">"}),i=-1===(g=(p=r).getParam("body_class","","string")).indexOf("=")?g:(d=p).getParam("body_class","","hash")[d.id]||"",l=r.dom.encode,s='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(S.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",m=(f=r.getBody().dir)?' dir="'+l(f)+'"':"",a='<!DOCTYPE html><html><head><base href="'+l(r.documentBaseURI.getURI())+'">'+o+s+'</head><body class="'+l(i)+'"'+m+">"+a+"</body></html>"),x(a,r.getParam("template_preview_replace_values"))),y=[{type:"selectbox",name:"template",label:"Templates",items:b},{type:"htmlpanel",html:'<p aria-live="polite">'+N(t.value.description)+"</p>"},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],h={template:t.text,preview:v};e.unblock(),e.redial(T(y,h)),e.focus("template")},t=M.windowManager.open(T([],{template:"",preview:""}));t.block("Loading..."),l(o[0]).then(function(e){c(t,o[0],e)})["catch"](function(){c(t,o[0],""),t.disable("save"),i(t)})})},k=function(t){return function(e){I(t,e)}};e.add("template",function(e){var t,r;(t=e).ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:d(t,k(t))}),t.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:d(t,k(t))}),h(e),(r=e).on("PreProcess",function(e){var t=r.dom,n=f(r);_.each(t.select("div",e.node),function(e){t.hasClass(e,"mceTmpl")&&(_.each(t.select("*",e),function(e){t.hasClass(e,i(r).replace(/\s+/g,"|"))&&(e.innerHTML=p(r,n))}),g(r,e))})})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("textcolor",function(){console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"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;r<e;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};var n,r,e,o=function(){},a=function(t){return function(){return t}},i=function(t){return t},f=a(!1),c=a(!0),s=function(){return l},l=(n=function(t){return t.isNone()},{fold:function(t,n){return t()},is:f,isSome:f,isNone:c,getOr:e=function(t){return t},getOrThunk:r=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:e,orThunk:r,map:s,each:o,bind:s,exists:f,forall:c,filter:s,equals:n,equals_:n,toArray:function(){return[]},toString:a("none()")}),d=function(r){var t=a(r),n=function(){return o},e=function(t){return t(r)},o={fold:function(t,n){return n(r)},is:function(t){return r===t},isSome:c,isNone:f,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return d(t(r))},each:function(t){t(r)},bind:e,exists:e,forall:e,filter:function(t){return t(r)?o:l},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(t){return t.is(r)},equals_:function(t,n){return t.fold(f,function(t){return n(r,t)})}};return o},y={some:d,none:s,from:function(t){return null===t||t===undefined?l:d(t)}},m=function(e){return function(t){return r=typeof(n=t),(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)===e;var n,r}},g=m("string"),p=m("object"),h=m("array"),v=Array.prototype.slice,b=Array.prototype.indexOf,k=function(t,n){return r=t,e=n,-1<b.call(r,e);var r,e},O=function(t,n){for(var r=t.length,e=new Array(r),o=0;o<r;o++){var a=t[o];e[o]=n(a,o)}return e},w=function(t,n){for(var r=0,e=t.length;r<e;r++){n(t[r],r)}},C=function(t,n){for(var r=[],e=0,o=t.length;e<o;e++){var a=t[e];n(a,e)&&r.push(a)}return r},E=function(t,n,r){return function(t,n){for(var r=t.length-1;0<=r;r--){n(t[r],r)}}(t,function(t){r=n(r,t)}),r},x=function(t,n){return function(t,n,r){for(var e=0,o=t.length;e<o;e++){var a=t[e];if(n(a,e))return y.some(a);if(r(a,e))break}return y.none()}(t,n,f)},R=function(t,n){for(var r=0,e=t.length;r<e;++r){if(!0!==n(t[r],r))return!1}return!0},T=function(t){return n=t,(r=0)<=r&&r<n.length?y.some(n[r]):y.none();var n,r},N=Object.keys,P=Object.hasOwnProperty,S=(function(i){if(!h(i))throw new Error("cases must be an array");if(0===i.length)throw new Error("there must be at least one case");var u=[],r={};w(i,function(t,e){var n=N(t);if(1!==n.length)throw new Error("one and only one name per case");var o=n[0],a=t[o];if(r[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!h(a))throw new Error("case arguments must be an array");u.push(o),r[o]=function(){var t=arguments.length;if(t!==a.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+a.length+" ("+a+"), got "+t);for(var r=new Array(t),n=0;n<r.length;n++)r[n]=arguments[n];return{fold:function(){if(arguments.length!==i.length)throw new Error("Wrong number of arguments to fold. Expected "+i.length+", got "+arguments.length);return arguments[e].apply(null,r)},match:function(t){var n=N(t);if(u.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+n.join(","));if(!R(u,function(t){return k(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+u.join(", "));return t[o].apply(null,r)},log:function(t){console.log(t,{constructors:u,constructor:o,params:r})}}}})}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t){var n=[],r=[];return w(t,function(t){t.fold(function(t){n.push(t)},function(t){r.push(t)})}),{errors:n,values:r}}),M=function(r){return{is:function(t){return r===t},isValue:c,isError:f,getOr:a(r),getOrThunk:a(r),getOrDie:a(r),or:function(t){return M(r)},orThunk:function(t){return M(r)},fold:function(t,n){return n(r)},map:function(t){return M(t(r))},mapError:function(t){return M(r)},each:function(t){t(r)},bind:function(t){return t(r)},exists:function(t){return t(r)},forall:function(t){return t(r)},toOptional:function(){return y.some(r)}}},A=function(r){return{is:f,isValue:f,isError:c,getOr:i,getOrThunk:function(t){return t()},getOrDie:function(){return t=String(r),function(){throw new Error(t)}();var t},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(r)},map:function(t){return A(r)},mapError:function(t){return A(t(r))},each:o,bind:function(t){return A(r)},exists:f,forall:c,toOptional:y.none}},B={value:M,error:A,fromOption:function(t,n){return t.fold(function(){return A(n)},M)}},D=function(t){return"inline-command"===t.type||"inline-format"===t.type},I=function(t){return"block-command"===t.type||"block-format"===t.type},j=function(t){return n=t,r=function(t,n){return t.start.length===n.start.length?0:t.start.length>n.start.length?-1:1},(e=v.call(n,0)).sort(r),e;var n,r,e},_=function(o){var a=function(t){return B.error({message:t,pattern:o})},t=function(t,n,r){if(o.format===undefined)return o.cmd!==undefined?g(o.cmd)?B.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(h(o.format)){if(!R(o.format,g))return a(t+" pattern has non-string items in the `format` array");e=o.format}else{if(!g(o.format))return a(t+" pattern has non-string `format` parameter");e=[o.format]}return B.value(n(e))};if(!p(o))return a("Raw pattern is not an object");if(!g(o.start))return a("Raw pattern is missing `start` parameter");if(o.end===undefined)return o.replacement!==undefined?g(o.replacement)?0===o.start.length?a("Replacement pattern has empty `start` parameter"):B.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(!g(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}})},U=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},q=function(t){return{inlinePatterns:C(t,D),blockPatterns:j(C(t,I))}},L=function(e){return{setPatterns:function(t){var n=S(O(t,_));if(0<n.errors.length){var r=n.errors[0];throw new Error(r.message+":\n"+JSON.stringify(r.pattern,null,2))}e.set(q(n.values))},getPatterns:function(){return function(){for(var t=0,n=0,r=arguments.length;n<r;n++)t+=arguments[n].length;for(var e=Array(t),o=0,n=0;n<r;n++)for(var a=arguments[n],i=0,u=a.length;i<u;i++,o++)e[o]=a[i];return e}(O(e.get().inlinePatterns,U),O(e.get().blockPatterns,U))}}},V="undefined"!=typeof window?window:Function("return this;")(),W=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=V.console;r&&(r.error?r.error.apply(r,t):r.log.apply(r,t))},F=[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}],G=function(t){var n=t.getParam("forced_root_block","p");return!1===n?"":!0===n?"p":n},H=tinymce.util.Tools.resolve("tinymce.util.Delay"),J=tinymce.util.Tools.resolve("tinymce.util.VK"),K=tinymce.util.Tools.resolve("tinymce.util.Tools"),X=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),z=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Q=function(t,n){return{container:t,offset:n}},Y=function(t){return t.nodeType===Node.TEXT_NODE},Z=function(t,n,r){var e;n&&t.isEmpty(n)&&!r(n)&&(e=n.parentNode,t.remove(n),Z(t,e,r))},$=function(t,n,r,e){void 0===e&&(e=!0);var o=n.startContainer.parentNode,a=n.endContainer.parentNode;n.deleteContents(),e&&!r(n.startContainer)&&(Y(n.startContainer)&&0===n.startContainer.data.length&&t.remove(n.startContainer),Y(n.endContainer)&&0===n.endContainer.data.length&&t.remove(n.endContainer),Z(t,o,r),o!==a&&Z(t,a,r))},tt=function(t,n){var r=n.get(t);return h(r)&&T(r).exists(function(t){return n=t,r="block",P.call(n,r);var n,r})},nt=function(t){return 0===t.start.length},rt=function(t,n){var r=y.from(t.dom.getParent(n.startContainer,t.dom.isBlock));return""===G(t)?r.orThunk(function(){return y.some(t.getBody())}):r},et=X.DOM,ot=function(n){return function(t){return n===t?-1:0}},at=function(t,n,r){if(Y(t)&&0<=n)return y.some(Q(t,n));var e=z(et);return y.from(e.backwards(t,n,ot(t),r)).map(function(t){return Q(t.container,t.container.data.length)})},it=function(t,r,e){if(!Y(t))return y.none();var n=t.textContent;if(0<=r&&r<=n.length)return y.some(Q(t,r));var o=z(et);return y.from(o.backwards(t,r,ot(t),e)).bind(function(t){var n=t.container.data;return it(t.container,r+n.length,e)})},ut=function(t,n,r){if(!Y(t))return y.none();var e=t.textContent;if(n<=e.length)return y.some(Q(t,n));var o=z(et);return y.from(o.forwards(t,n,ot(t),r)).bind(function(t){return ut(t.container,n-e.length,r)})},ft=function(t,n,r,e,o){var a,i=z(t,(a=t,function(t){return a.isBlock(t)||k(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===a.getContentEditable(t)}));return y.from(i.backwards(n,r,e,o))},ct=function(t,n,r){if(Y(n)&&(r<0||r>n.data.length))return[];for(var e=[r],o=n;o!==t&&o.parentNode;){for(var a=o.parentNode,i=0;i<a.childNodes.length;i++)if(a.childNodes[i]===o){e.push(i);break}o=a}return o===t?e.reverse():[]},st=function(t,n,r,e,o){return{start:ct(t,n,r),end:ct(t,e,o)}},lt=function(t,n){var r,e,o,a=n.slice(),i=a.pop();return(r=a,e=function(t,n){return t.bind(function(t){return y.from(t.childNodes[n])})},o=y.some(t),w(r,function(t){o=e(o,t)}),o).bind(function(t){return Y(t)&&(i<0||i>t.data.length)?y.none():y.some({node:t,offset:i})})},dt=function(n,r){return lt(n,r.start).bind(function(t){var o=t.node,a=t.offset;return lt(n,r.end).map(function(t){var n=t.node,r=t.offset,e=document.createRange();return e.setStart(o,a),e.setEnd(n,r),e})})},mt=function(e,o,n){(function(t,n,r){if(Y(t)&&n>=t.length)return y.some(Q(t,n));var e=z(et);return y.from(e.forwards(t,n,ot(t),r)).map(function(t){return Q(t.container,0)})})(o,0,o).each(function(t){var r=t.container;ut(r,n.start.length,o).each(function(t){var n=e.createRng();n.setStart(r,0),n.setEnd(t.container,t.offset),$(e,n,function(t){return t===o})})})},gt=function(e,a){var i=e.dom,t=e.selection.getRng();return rt(e,t).filter(function(t){var n=G(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"," "),x(t,function(t){return 0===r.indexOf(t.start)||0===e.indexOf(t.start)})).map(function(t){return K.trim(o).length===t.start.length?[]:[{pattern:t,range:st(i.getRoot(),n,0,n,0)}]})}).getOr([])},pt=function(i,t){var n;0!==t.length&&(n=i.selection.getBookmark(),w(t,function(t){return r=t,e=(n=i).dom,o=r.pattern,a=dt(e.getRoot(),r.range).getOrDie("Unable to resolve path range"),rt(n,a).each(function(t){"block-format"===o.type?tt(o.format,n.formatter)&&n.undoManager.transact(function(){mt(n.dom,t,o),n.formatter.apply(o.format)}):"block-command"===o.type&&n.undoManager.transact(function(){mt(n.dom,t,o),n.execCommand(o.cmd,!1,o.value)})}),1;var n,r,e,o,a}),i.selection.moveToBookmark(n))},ht=0,vt=function(t,n){return t.create("span",{"data-mce-type":"bookmark",id:n})},yt=function(t,n){var r=t.createRng();return r.setStartAfter(n.start),r.setEndBefore(n.end),r},bt=function(t,n,r){var e=dt(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(vt(t,n+"-end"),i),start:u.parentNode.insertBefore(vt(t,n+"-start"),u)}},kt=function(t,n,r){Z(t,t.get(n.prefix+"-end"),r),Z(t,t.get(n.prefix+"-start"),r)},Ot=function(e,o,a,t){var i,u=o.start;return ft(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 it(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 Ot(e,o,a,Q(r.container,0))})})},wt=function(a,i,u){var f=a.dom,c=f.getRoot(),s=u.pattern,l=u.position.container,d=u.position.offset;return it(l,d-u.pattern.end.length,i).bind(function(t){var e=st(c,t.container,t.offset,l,d);if(nt(s))return y.some({matches:[{pattern:s,startRng:e,endRng:e}],position:t});var n=Ct(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 at(n,e,o).bind(function(n){return Ot(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=st(c,(n=t).startContainer,n.startOffset,n.endContainer,n.endOffset);return{matches:o.matches.concat([{pattern:s,startRng:r,endRng:e}]),position:Q(t.startContainer,t.startOffset)}})})},Ct=function(d,m,g,p,h){var v=d.dom;return at(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<m.length;f++){var c=m[f];if(r=u,e=c.end,i=a=o=void 0,a=e,i=(o=r).length-e.length,""===a||o.length>=a.length&&o.substr(i,i+a.length)===a){var s=m.slice();s.splice(f,1);var l=wt(d,h,{pattern:c,remainingPatterns:s,position:t});if(l.isSome())return l}}return y.none()})},Et=function(n,t,r){n.selection.setRng(r),"inline-format"===t.type?w(t.format,function(t){n.formatter.apply(t)}):n.execCommand(t.cmd,!1,t.value)},xt=function(o,t){var n,r,a=(n="mce_textpattern",r=(new Date).getTime(),n+"_"+Math.floor(1e9*Math.random())+ ++ht+String(r)),i=E(t,function(t,n){var r=bt(o,a+"_end"+t.length,n.endRng);return t.concat([u(u({},n),{endMarker:r})])},[]);return E(i,function(t,n){var r=i.length-t.length-1,e=nt(n.pattern)?n.endMarker:bt(o,a+"_start"+r,n.startRng);return t.concat([u(u({},n),{startMarker:e})])},[])},Rt=function(r,e,o){var a=r.selection.getRng();return!1===a.collapsed?[]:rt(r,a).bind(function(t){var n=a.startOffset-(o?1:0);return Ct(r,e,a.startContainer,n,t)}).fold(function(){return[]},function(t){return t.matches})},Tt=function(f,t){var c,n,r;0!==t.length&&(c=f.dom,n=f.selection.getBookmark(),r=xt(c,t),w(r,function(t){var n,r,e,o,a,i=c.getParent(t.startMarker.start,c.isBlock),u=function(t){return t===i};nt(t.pattern)?(n=f,r=t.pattern,e=t.endMarker,o=u,a=yt(n.dom,e),$(n.dom,a,o),Et(n,r,a)):function(t,n,r,e,o){var a=t.dom,i=yt(a,e),u=yt(a,r);$(a,u,o),$(a,i,o);var f={prefix:r.prefix,start:r.end,end:e.start},c=yt(a,f);Et(t,n,c)}(f,t.pattern,t.startMarker,t.endMarker,u),kt(c,t.endMarker,u),kt(c,t.startMarker,u)}),f.selection.moveToBookmark(n))},Nt=function(t,n){var r=Rt(t,n.inlinePatterns,!0);0<r.length&&t.undoManager.transact(function(){Tt(t,r)})},Pt=function(t,n,r){for(var e=0;e<t.length;e++)if(r(t[e],n))return!0},St=function(n,r){var e=[",",".",";",":","!","?"],o=[32];n.on("keydown",function(t){13!==t.keyCode||J.modifierPressed(t)||!function(r,t){if(!r.selection.isCollapsed())return!1;var e=Rt(r,t.inlinePatterns,!1),o=gt(r,t.blockPatterns);return(0<o.length||0<e.length)&&(r.undoManager.add(),r.undoManager.extra(function(){r.execCommand("mceInsertNewLine")},function(){r.insertContent("\ufeff"),Tt(r,e),pt(r,o);var t=r.selection.getRng(),n=at(t.startContainer,t.startOffset,r.dom.getRoot());r.execCommand("mceInsertNewLine"),n.each(function(t){var n=t.container;"\ufeff"===n.data.charAt(t.offset-1)&&(n.deleteData(t.offset-1,1),Z(r.dom,n.parentNode,function(t){return t===r.dom.getRoot()}))})}),!0)}(n,r.get())||t.preventDefault()},!0),n.on("keyup",function(t){Pt(o,t,function(t,n){return t===n.keyCode&&!1===J.modifierPressed(n)})&&Nt(n,r.get())}),n.on("keypress",function(t){Pt(e,t,function(t,n){return t.charCodeAt(0)===n.charCode})&&H.setEditorTimeout(n,function(){Nt(n,r.get())})})};t.add("textpattern",function(t){var n,r,e=(n=function(t){var n=t.getParam("textpattern_patterns",F,"array");if(!h(n))return W("The setting textpattern_patterns should be an array"),{inlinePatterns:[],blockPatterns:[]};var r=S(O(n,_));return w(r.errors,function(t){return W(t.message,t.pattern),0}),q(r.values)}(t),r=n,{get:function(){return r},set:function(t){r=t}});return St(t,e),L(e)})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var e,n,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.util.I18n"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(t){return t.getParam("toc_class","mce-toc")},m=function(t){var e=t.getParam("toc_header","h2");return/^h[1-6]$/.test(e)?e:"h2"},a=(e="mcetoc_",n=0,function(){var t=(new Date).getTime().toString(32);return e+t+(n++).toString(32)}),v=function(n){var t,o=l(n),e=m(n),r=function(t){for(var e=[],n=1;n<=t;n++)e.push("h"+n);return e.join(",")}(1<=(t=parseInt(n.getParam("toc_depth","3"),10))&&t<=9?t:3),i=n.$(r);return i.length&&/^h[1-9]$/i.test(e)&&(i=i.filter(function(t,e){return!n.dom.hasClass(e.parentNode,o)})),c.map(i,function(t){var e=t.id;return{id:e||a(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:n.$.text(t),element:t}})},u=function(t){var e,n,o,r,i,c,l,a="",u=v(t),d=function(t){for(var e=9,n=0;n<t.length;n++)if(t[n].level<e&&(e=t[n].level),1===e)return e;return e}(u)-1;if(!u.length)return"";for(a+=(i=m(t),c=f.translate("Table of Contents"),l="</"+i+">","<"+i+' contenteditable="true">'+s.DOM.encode(c)+l),e=0;e<u.length;e++){if((o=u[e]).element.id=o.id,r=u[e+1]&&u[e+1].level,d===o.level)a+="<li>";else for(n=d;n<o.level;n++)a+="<ul><li>";if(a+='<a href="#'+o.id+'">'+o.title+"</a>",r!==o.level&&r)for(n=o.level;r<n;n--)a+="</li></ul><li>";else a+="</li>",r||(a+="</ul>");d=o.level}return a},i=function(t){var e,n,o,r,i=l(t),c=t.$("."+i);o=t,!(r=c).length||0<o.dom.getParents(r[0],".mce-offscreen-selection").length?t.insertContent((n=u(e=t),'<div class="'+e.dom.encode(l(e))+'" contenteditable="false">'+n+"</div>")):d(t)},d=function(t){var e=l(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(u(t))})},o=function(n){return function(t){var e=function(){return t.setDisabled(n.mode.isReadOnly()||!(0<v(n).length))};return e(),n.on("LoadContent SetContent change",e),function(){return n.on("LoadContent SetContent change",e)}}},g=function(t){var e;t.ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:o(t)}),t.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return t.execCommand("mceUpdateToc")}}),t.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:o(t)}),t.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:(e=t,function(t){return t&&e.dom.is(t,"."+l(e))&&e.getBody().contains(t)}),scope:"node",position:"node"})};t.add("toc",function(t){var e,n,o,r;(e=t).addCommand("mceInsertToc",function(){i(e)}),e.addCommand("mceUpdateToc",function(){d(e)}),g(t),o=(n=t).$,r=l(n),n.on("PreProcess",function(t){var e=o("."+r,t.node);e.length&&(e.removeAttr("contentEditable"),e.find("[contenteditable]").removeAttr("contentEditable"))}),n.on("SetContent",function(){var t=o("."+r);t.length&&(t.attr("contentEditable",!1),t.children(":first-child").attr("contentEditable",!0))})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t,o,e){var n,i;t.dom.toggleClass(t.getBody(),"mce-visualblocks"),e.set(!e.get()),n=t,i=e.get(),n.fire("VisualBlocks",{state:i})},f=function(e,n){return function(o){o.setActive(n.get());var t=function(t){return o.setActive(t.state)};return e.on("VisualBlocks",t),function(){return e.off("VisualBlocks",t)}}};t.add("visualblocks",function(t,o){var e,n,i,s,c,u,l,a=(e=!1,{get:function(){return e},set:function(t){e=t}});i=a,(n=t).addCommand("mceVisualBlocks",function(){r(n,0,i)}),c=a,(s=t).ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:function(){return s.execCommand("mceVisualBlocks")},onSetup:f(s,c)}),s.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:function(){return s.execCommand("mceVisualBlocks")},onSetup:f(s,c)}),l=a,(u=t).on("PreviewFormats AfterPreviewFormats",function(t){l.get()&&u.dom.toggleClass(u.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),u.on("init",function(){u.getParam("visualblocks_default_state",!1,"boolean")&&r(u,0,l)})})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var n,t,e,r,o,u,i=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(n){return function(){return n}},a=c(!1),s=c(!0),f=function(){return l},l=(n=function(n){return n.isNone()},{fold:function(n,t){return n()},is:a,isSome:a,isNone:s,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:c(null),getOrUndefined:c(undefined),or:e,orThunk:t,map:f,each:function(){},bind:f,exists:a,forall:s,filter:f,equals:n,equals_:n,toArray:function(){return[]},toString:c("none()")}),d=function(e){var n=c(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:s,isNone:a,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return d(n(e))},each:function(n){n(e)},bind:r,exists:r,forall:r,filter:function(n){return n(e)?o:l},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(a,function(n){return t(e,n)})}};return o},m=function(n){return null===n||n===undefined?l:d(n)},v=function(t){return function(n){return typeof n===t}},g=(r="string",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}),h=v("boolean"),p=v("number"),y=function(n,t){for(var e=0,r=n.length;e<r;e++){t(n[e],e)}},b=Object.keys,w=function(n,t){for(var e=b(n),r=0,o=e.length;r<o;r++){var u=e[r];t(n[u],u)}},N=("undefined"!=typeof window||Function("return this;")(),function(n){return n.dom.nodeValue}),T=(o=3,function(n){return n.dom.nodeType===o}),k=function(n,t,e){!function(n,t,e){if(!(g(e)||h(e)||p(e)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",e,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(t,e+"")}(n.dom,t,e)},A=function(n,t){n.dom.removeAttribute(t)},O=function(n,t){var e,r,o=(e=t,null===(r=n.dom.getAttribute(e))?undefined:r);return o===undefined||""===o?[]:o.split(" ")},C=function(n){return n.dom.classList!==undefined},S=function(n,t){return o=t,u=O(e=n,r="class").concat([o]),k(e,r,u.join(" ")),!0;var e,r,o,u},D=function(n,t){return o=t,0<(u=function(n,t){for(var e=[],r=0,o=n.length;r<o;r++){var u=n[r];t(u,r)&&e.push(u)}return e}(O(e=n,r="class"),function(n){return n!==o})).length?k(e,r,u.join(" ")):A(e,r),!1;var e,r,o,u},E=function(n){0===(C(n)?n.dom.classList:O(n,"class")).length&&A(n,"class")},L=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:n}},x={fromHtml:function(n,t){var e=(t||document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return L(e.childNodes[0])},fromTag:function(n,t){var e=(t||document).createElement(n);return L(e)},fromText:function(n,t){var e=(t||document).createTextNode(n);return L(e)},fromDom:L,fromPoint:function(n,t,e){return m(n.dom.elementFromPoint(t,e)).map(L)}},V={"\xa0":"nbsp","\xad":"shy"},B=function(n,t){var e="";return w(n,function(n,t){e+=t}),new RegExp("["+e+"]",t?"g":"")},P=B(V),_=B(V,!0),j=(u="",w(V,function(n){u&&(u+=","),u+="span.mce-"+n}),u),M="mce-nbsp",q=function(n){return'<span data-mce-bogus="1" class="mce-'+V[n]+'">'+n+"</span>"},H=function(n){var t=N(n);return T(n)&&t!==undefined&&P.test(t)},F=function(n,t){var e=[],r=function(n,t){for(var e=n.length,r=new Array(e),o=0;o<e;o++){var u=n[o];r[o]=t(u,o)}return r}(n.dom.childNodes,x.fromDom);return y(r,function(n){t(n)&&(e=e.concat([n])),e=e.concat(F(n,t))}),e},I=function(n){return"span"===n.nodeName.toLowerCase()&&n.classList.contains("mce-nbsp-wrap")},U=function(c,n){var t=F(x.fromDom(n),H);y(t,function(n){var t,e,r=n.dom.parentNode;if(I(r))t=x.fromDom(r),e=M,C(t)?t.dom.classList.add(e):S(t,e);else{for(var o=c.dom.encode(N(n)).replace(_,q),u=c.dom.create("div",null,o),i=void 0;i=u.lastChild;)c.dom.insertAfter(i,n.dom);c.dom.remove(n.dom)}})},K=function(r,n){var t=r.dom.select(j,n);y(t,function(n){var t,e;I(n)?(t=x.fromDom(n),e=M,C(t)?t.dom.classList.remove(e):D(t,e),E(t)):r.dom.remove(n,!0)})},R=function(n){var t=n.getBody(),e=n.selection.getBookmark(),r=(r=function(n,t){for(;n.parentNode;){if(n.parentNode===t)return n;n=n.parentNode}}(n.selection.getNode(),t))!==undefined?r:t;K(n,r),U(n,r),n.selection.moveToBookmark(e)},z=function(n,t){var e,r;e=n,r=t.get(),e.fire("VisualChars",{state:r});var o=n.getBody();(!0===t.get()?U:K)(n,o)},G=function(n,t){n.addCommand("mceVisualChars",function(){!function(n,t){t.set(!t.get());var e=n.selection.getBookmark();z(n,t),n.selection.moveToBookmark(e)}(n,t)})},J=tinymce.util.Tools.resolve("tinymce.util.Delay"),Q=function(e,r){return function(t){t.setActive(r.get());var n=function(n){return t.setActive(n.state)};return e.on("VisualChars",n),function(){return e.off("VisualChars",n)}}};i.add("visualchars",function(n){var t,e,r,o,u,i,c,a,s,f,l=(t=n.getParam("visualchars_default_state",!1),e=t,{get:function(){return e},set:function(n){e=n}});return G(n,l),o=l,(r=n).ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:function(){return r.execCommand("mceVisualChars")},onSetup:Q(r,o)}),r.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",icon:"visualchars",onAction:function(){return r.execCommand("mceVisualChars")},onSetup:Q(r,o)}),u=n,i=l,c=J.debounce(function(){R(u)},300),!1!==u.getParam("forced_root_block")&&u.on("keydown",function(n){!0===i.get()&&(13===n.keyCode?R(u):c())}),u.on("remove",c.stop),s=l,(a=n).on("init",function(){z(a,s)}),f=l,{isEnabled:function(){return f.get()}}})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var s,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(t){return t},a=function(){return(a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},e="[-'\\.\u2018\u2019\u2024\ufe52\uff07\uff0e]",n="[:\xb7\xb7\u05f4\u2027\ufe13\ufe55\uff1a]",o="[\xb1+*/,;;\u0589\u060c\u060d\u066c\u07f8\u2044\ufe10\ufe14\ufe50\ufe54\uff0c\uff1b]",u="[0-9\u0660-\u0669\u066b\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]",c="\\r",i="\\n",g="[\x0B\f\x85\u2028\u2029]",l="[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]",p="[\xad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200e\u200f\u202a-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb]",f="[\u3031-\u3035\u309b\u309c\u30a0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32d0-\u32fe\u3300-\u3357\uff66-\uff9d]",d="[=_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f\u2200-\u22ff<>]",h="[!-#%-*,-\\/:;?@\\[-\\]_{}\xa1\xab\xb7\xbb\xbf;\xb7\u055a-\u055f\u0589\u058a\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\u1368\u1400\u166d\u166e\u169b\u169c\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb\ufd3e\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a\uff1b\uff1f\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]",C=0,y=1,v=2,w=3,m=4,E=5,W=6,x=7,R=8,b=9,S=10,F=11,j=12,A=13,D=[new RegExp("[A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24b6-\u24e9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]"),new RegExp(e),new RegExp(n),new RegExp(o),new RegExp(u),new RegExp(c),new RegExp(i),new RegExp(g),new RegExp(l),new RegExp(p),new RegExp(f),new RegExp(d),new RegExp("@")],T=new RegExp("^"+h+"$"),B=D,k=A,P=function(t){for(var e=k,n=B.length,r=0;r<n;++r){var o=B[r];if(o&&o.test(t)){e=r;break}}return e},M=function(t){var n,r;return function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var u=t[o];r[o]=e(u,o)}return r}(t,(n=P,r={},function(t){if(r[t])return r[t];var e=n(t);return r[t]=e}))},O=/^\s+$/,U=T,_=function(t,e){var n=function(t,e){for(var n=e;n<t.length&&!O.test(t[n]);n++);return n}(t,e+1);return"://"===t.slice(e+1,n).join("").substr(0,3)?n:e},N=function(t,e,n,r){for(var o,u,c,i,a,s,g,l=[],p=[],f=0;f<n.length;++f){p.push(t[f]),function(t,e){var n=t[e],r=t[e+1];if(e<0||e>t.length-1&&0!==e)return!1;if(n===C&&r===C)return!1;var o=t[e+2];if(n===C&&(r===v||r===y||r===j)&&o===C)return!1;var u=t[e-1];return(n!==v&&n!==y&&r!==j||r!==C||u!==C)&&((n!==m&&n!==C||r!==m&&r!==C)&&((n!==w&&n!==y||r!==m||u!==m)&&((n!==m||r!==w&&r!==y||o!==m)&&(n!==R&&n!==b&&u!==R&&u!==b&&r!==R&&r!==b&&((n!==E||r!==W)&&(n===x||n===E||n===W||(r===x||r===E||r===W||(n!==S||r!==S)&&((r!==F||n!==C&&n!==m&&n!==S&&n!==F)&&((n!==F||r!==C&&r!==m&&r!==S)&&n!==j)))))))))}(n,f)&&(o=e[f],!r.includeWhitespace&&O.test(o)||!r.includePunctuation&&U.test(o)||(u=f-p.length+1,c=f+1,i=e.slice(u,c).join(""),"http"!==(g=i)&&"https"!==g||(a=_(e,f),s=t.slice(c,a),Array.prototype.push.apply(p,s),f=a),l.push(p)),p=[])}return l},$=function(t,e,n){n=a(a({},{includeWhitespace:!1,includePunctuation:!1}),n);for(var r=[],o=[],u=0;u<t.length;u++){var c=e(t[u]);"\ufeff"!==c&&(r.push(t[u]),o.push(c))}var i=M(o);return N(r,o,i,n)},z=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),I=function(t,e){for(var n,r=e.getBlockElements(),o=e.getShortEndedElements(),u=[],c="",i=new z(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},q=function(t,e){var n=I(t,e).join("\n");return $(n.split(""),r).length},G=function(t,e){var n=I(t,e).join("");return Z(n)},H=function(t,e){var n=I(t,e).join("").replace(/\s/g,"");return Z(n)},J=function(t,e){return function(){return e(t.getBody(),t.schema)}},K=function(t,e){return function(){return e(t.selection.getRng().cloneContents(),t.schema)}},L=function(t){return J(t,q)},Q=tinymce.util.Tools.resolve("tinymce.util.Delay"),V=function(t,e){var n;n=e,t.fire("wordCountUpdate",{wordCount:{words:n.body.getWordCount(),characters:n.body.getCharacterCount(),charactersWithoutSpaces:n.body.getCharacterCountWithoutSpaces()}})},X=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}]})};void 0===s&&(s=300),t.add("wordcount",function(t){var e,n,r,o,u,c,i,a={body:{getWordCount:L(e=t),getCharacterCount:J(e,G),getCharacterCountWithoutSpaces:J(e,H)},selection:{getWordCount:K(e,q),getCharacterCount:K(e,G),getCharacterCountWithoutSpaces:K(e,H)},getCount:L(e)};return r=a,(n=t).ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return X(n,r)}}),n.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return X(n,r)}}),o=t,u=a,c=s,i=Q.debounce(function(){return V(o,u)},c),o.on("init",function(){V(o,u),Q.setEditorTimeout(o,function(){o.on("SetContent BeforeAddUndo Undo Redo keyup",i)},0)}),a})}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
9
|
!function(){"use strict";var x=function(){return(x=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n}).apply(this,arguments)};function c(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(n);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(n,r[o])&&(t[r[o]]=n[r[o]]);return t}function u(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),o=0,e=0;e<t;e++)for(var i=arguments[e],u=0,c=i.length;u<c;u++,o++)r[o]=i[u];return r}var O=function(){},i=function(t,r){return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t(r.apply(null,n))}},y=function(n){return function(){return n}},v=function(n){return n};function b(r){for(var o=[],n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=o.concat(n);return r.apply(null,t)}}var n,e,t,r,o,a,m=function(e){return function(n){return!e(n)}},f=function(n){return function(){throw new Error(n)}},s=function(n){return n()},l=y(!1),w=y(!0),d=function(t){var r,o=!1;return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return o||(o=!0,r=t.apply(null,n)),r}},g=function(){return p},p=(n=function(n){return n.isNone()},{fold:function(n,e){return n()},is:l,isSome:l,isNone:w,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:y(null),getOrUndefined:y(undefined),or:t,orThunk:e,map:g,each:O,bind:g,exists:l,forall:w,filter:g,equals:n,equals_:n,toArray:function(){return[]},toString:y("none()")}),h=function(t){var n=y(t),e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:w,isNone:l,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return h(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){return n(t)?o:p},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(l,function(n){return e(t,n)})}};return o},T={some:h,none:g,from:function(n){return null===n||n===undefined?p:h(n)}},S=function(r){return function(n){return t=typeof(e=n),(null===e?"null":"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t)===r;var e,t}},k=function(e){return function(n){return typeof n===e}},E=S("string"),C=S("object"),M=S("array"),D=k("boolean"),_=function(n){return!(null===(e=n)||e===undefined);var e},I=k("function"),F=k("number"),R=Array.prototype.slice,V=Array.prototype.indexOf,B=Array.prototype.push,A=function(n,e){return t=n,r=e,-1<V.call(t,r);var t,r},j=function(n,e){for(var t=0,r=n.length;t<r;t++){if(e(n[t],t))return!0}return!1},N=function(n,e){for(var t=n.length,r=new Array(t),o=0;o<t;o++){var i=n[o];r[o]=e(i,o)}return r},P=function(n,e){for(var t=0,r=n.length;t<r;t++){e(n[t],t)}},H=function(n,e){for(var t=[],r=0,o=n.length;r<o;r++){var i=n[r];e(i,r)&&t.push(i)}return t},z=function(n,e,t){return function(n,e){for(var t=n.length-1;0<=t;t--){e(n[t],t)}}(n,function(n){t=e(t,n)}),t},L=function(n,e,t){return P(n,function(n){t=e(t,n)}),t},G=function(n,e){return function(n,e,t){for(var r=0,o=n.length;r<o;r++){var i=n[r];if(e(i,r))return T.some(i);if(t(i,r))break}return T.none()}(n,e,l)},$=function(n,e){for(var t=0,r=n.length;t<r;t++){if(e(n[t],t))return T.some(t)}return T.none()},U=function(n){for(var e=[],t=0,r=n.length;t<r;++t){if(!M(n[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+n);B.apply(e,n[t])}return e},W=function(n,e){return U(N(n,e))},X=function(n,e){for(var t=0,r=n.length;t<r;++t){if(!0!==e(n[t],t))return!1}return!0},q=function(n){var e=R.call(n,0);return e.reverse(),e},Y=function(n,e){return H(n,function(n){return!A(e,n)})},K=function(n){return[n]},J=function(n){return e=n,(t=0)<=t&&t<e.length?T.some(e[t]):T.none();var e,t},Q=function(n,e){for(var t=0;t<n.length;t++){var r=e(n[t],t);if(r.isSome())return r}return T.none()},Z=function(n,e){var t=function(n,e){for(var t=0;t<n.length;t++){var r=n[t];if(r.test(e))return r}return undefined}(n,e);if(!t)return{major:0,minor:0};var r=function(n){return Number(e.replace(t,"$"+n))};return en(r(1),r(2))},nn=function(){return en(0,0)},en=function(n,e){return{major:n,minor:e}},tn={nu:en,detect:function(n,e){var t=String(e).toLowerCase();return 0===n.length?nn():Z(n,t)},unknown:nn},rn=function(n,e){var t=String(e).toLowerCase();return G(n,function(n){return n.search(t)})},on=function(n,t){return rn(n,t).map(function(n){var e=tn.detect(n.versionRegexes,t);return{current:n.name,version:e}})},un=function(n,t){return rn(n,t).map(function(n){var e=tn.detect(n.versionRegexes,t);return{current:n.name,version:e}})},cn=function(n,o){return n.replace(/\$\{([^{}]*)\}/g,function(n,e){var t,r=o[e];return"string"==(t=typeof r)||"number"==t?r.toString():n})},an=function(n,e){return-1!==n.indexOf(e)},fn=(r=/^\s+|\s+$/g,function(n){return n.replace(r,"")}),sn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ln=function(e){return function(n){return an(n,e)}},dn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return an(n,"edge/")&&an(n,"chrome")&&an(n,"safari")&&an(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,sn],search:function(n){return an(n,"chrome")&&!an(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return an(n,"msie")||an(n,"trident")}},{name:"Opera",versionRegexes:[sn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:ln("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:ln("firefox")},{name:"Safari",versionRegexes:[sn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(an(n,"safari")||an(n,"mobile/"))&&an(n,"applewebkit")}}],mn=[{name:"Windows",search:ln("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return an(n,"iphone")||an(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:ln("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:ln("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:ln("linux"),versionRegexes:[]},{name:"Solaris",search:ln("sunos"),versionRegexes:[]},{name:"FreeBSD",search:ln("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:ln("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],gn={browsers:y(dn),oses:y(mn)},pn="Firefox",hn=function(n){var e=n.current,t=n.version,r=function(n){return function(){return e===n}};return{current:e,version:t,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r(pn),isSafari:r("Safari")}},vn={unknown:function(){return hn({current:undefined,version:tn.unknown()})},nu:hn,edge:y("Edge"),chrome:y("Chrome"),ie:y("IE"),opera:y("Opera"),firefox:y(pn),safari:y("Safari")},yn="Windows",bn="Android",xn="Solaris",wn="FreeBSD",Sn="ChromeOS",On=function(n){var e=n.current,t=n.version,r=function(n){return function(){return e===n}};return{current:e,version:t,isWindows:r(yn),isiOS:r("iOS"),isAndroid:r(bn),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r(xn),isFreeBSD:r(wn),isChromeOS:r(Sn)}},Tn={unknown:function(){return On({current:undefined,version:tn.unknown()})},nu:On,windows:y(yn),ios:y("iOS"),android:y(bn),linux:y("Linux"),osx:y("OSX"),solaris:y(xn),freebsd:y(wn),chromeos:y(Sn)},kn=function(n,e){var t,r,o,i,u,c,a,f,s,l,d,m,g=gn.browsers(),p=gn.oses(),h=on(g,n).fold(vn.unknown,vn.nu),v=un(p,n).fold(Tn.unknown,Tn.nu);return{browser:h,os:v,deviceType:(r=h,o=n,i=e,u=(t=v).isiOS()&&!0===/ipad/i.test(o),c=t.isiOS()&&!u,a=t.isiOS()||t.isAndroid(),f=a||i("(pointer:coarse)"),s=u||!c&&a&&i("(min-device-width:768px)"),l=c||a&&!s,d=r.isSafari()&&t.isiOS()&&!1===/safari/i.test(o),m=!l&&!s&&!d,{isiPad:y(u),isiPhone:y(c),isTablet:y(s),isPhone:y(l),isTouch:y(f),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:y(d),isDesktop:y(m)})}},En=function(n){return window.matchMedia(n).matches},Cn=d(function(){return kn(navigator.userAgent,En)}),Mn=function(){return Cn()},Dn=y,_n=Dn("touchstart"),In=Dn("touchmove"),Fn=Dn("touchend"),Rn=Dn("mousedown"),Vn=Dn("mousemove"),Bn=Dn("mouseup"),An=Dn("mouseover"),jn=Dn("keydown"),Nn=Dn("keyup"),Pn=Dn("input"),Hn=Dn("change"),zn=Dn("click"),Ln=Dn("transitionend"),Gn=Dn("selectstart"),$n=function(n){return y("alloy."+n)},Un={tap:$n("tap")},Wn=$n("focus"),Xn=$n("blur.post"),qn=$n("paste.post"),Yn=$n("receive"),Kn=$n("execute"),Jn=$n("focus.item"),Qn=Un.tap,Zn=$n("longpress"),ne=$n("system.init"),ee=$n("system.attached"),te=$n("system.detached"),re=$n("focusmanager.shifted"),oe=$n("highlight"),ie=$n("dehighlight"),ue=function(n,e){se(n,n.element,e,{})},ce=function(n,e,t){se(n,n.element,e,t)},ae=function(n){ue(n,Kn())},fe=function(n,e,t){se(n,e,t,{})},se=function(n,e,t,r){var o=x({target:e},r);n.getSystem().triggerEvent(t,e,o)},le=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:n}},de={fromHtml:function(n,e){var t=(e||document).createElement("div");if(t.innerHTML=n,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return le(t.childNodes[0])},fromTag:function(n,e){var t=(e||document).createElement(n);return le(t)},fromText:function(n,e){var t=(e||document).createTextNode(n);return le(t)},fromDom:le,fromPoint:function(n,e,t){return T.from(n.dom.elementFromPoint(e,t)).map(le)}},me=function(n,e){var t=n.dom;if(1!==t.nodeType)return!1;var r=t;if(r.matches!==undefined)return r.matches(e);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(e);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(e);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},ge=function(n){return 1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType||0===n.childElementCount},pe=function(n,e){var t=e===undefined?document:e.dom;return ge(t)?[]:N(t.querySelectorAll(n),de.fromDom)},he=function(n,e){var t=e===undefined?document:e.dom;return ge(t)?T.none():T.from(t.querySelector(n)).map(de.fromDom)},ve=function(n,e){return n.dom===e.dom},ye=("undefined"!=typeof window||Function("return this;")(),function(n){return n.dom.nodeName.toLowerCase()}),be=function(e){return function(n){return n.dom.nodeType===e}},xe=be(1),we=be(3),Se=be(9),Oe=be(11),Te=function(n){return de.fromDom(n.dom.ownerDocument)},ke=function(n){return Se(n)?n:Te(n)},Ee=function(n){return T.from(n.dom.parentNode).map(de.fromDom)},Ce=function(n){return N(n.dom.childNodes,de.fromDom)},Me=function(n,e){var t=n.dom.childNodes;return T.from(t[e]).map(de.fromDom)},De=function(e,t){Ee(e).each(function(n){n.dom.insertBefore(t.dom,e.dom)})},_e=function(n,e){var t;(t=n,T.from(t.dom.nextSibling).map(de.fromDom)).fold(function(){Ee(n).each(function(n){Fe(n,e)})},function(n){De(n,e)})},Ie=function(e,t){Me(e,0).fold(function(){Fe(e,t)},function(n){e.dom.insertBefore(t.dom,n.dom)})},Fe=function(n,e){n.dom.appendChild(e.dom)},Re=function(e,n){P(n,function(n){Fe(e,n)})},Ve=function(n){n.dom.textContent="",P(Ce(n),function(n){Be(n)})},Be=function(n){var e=n.dom;null!==e.parentNode&&e.parentNode.removeChild(e)},Ae=I(Element.prototype.attachShadow)&&I(Node.prototype.getRootNode),je=y(Ae),Ne=Ae?function(n){return de.fromDom(n.dom.getRootNode())}:ke,Pe=function(n){var e=Ne(n);return Oe(e)?T.some(e):T.none()},He=function(n){return de.fromDom(n.dom.host)},ze=function(n){return _(n.dom.shadowRoot)},Le=function(n){var e=we(n)?n.dom.parentNode:n.dom;if(e===undefined||null===e||null===e.ownerDocument)return!1;var t,r,o=e.ownerDocument;return Pe(de.fromDom(e)).fold(function(){return o.body.contains(e)},(t=Le,r=He,function(n){return t(r(n))}))},Ge=function(){return $e(de.fromDom(document))},$e=function(n){var e=n.dom.body;if(null===e||e===undefined)throw new Error("Body is not available yet");return de.fromDom(e)},Ue=function(n){ue(n,te());var e=n.components();P(e,Ue)},We=function(n){var e=n.components();P(e,We),ue(n,ee())},Xe=function(n,e){Fe(n.element,e.element)},qe=function(e,n){var t,r=e.components();P((t=e).components(),function(n){return Be(n.element)}),Ve(t.element),t.syncComponents();var o=Y(r,n);P(o,function(n){Ue(n),e.getSystem().removeFromWorld(n)}),P(n,function(n){n.getSystem().isConnected()?Xe(e,n):(e.getSystem().addToWorld(n),Xe(e,n),Le(e.element)&&We(n)),e.syncComponents()})},Ye=function(n,e,t){n.getSystem().addToWorld(e),t(n.element,e.element),Le(n.element)&&We(e),n.syncComponents()},Ke=function(e){var n,t=Ee(e.element).bind(function(n){return e.getSystem().getByDom(n).toOptional()});Ue(n=e),Be(n.element),n.getSystem().removeFromWorld(n),t.each(function(n){n.syncComponents()})},Je=function(n,e,t){t(n,e.element);var r=Ce(e.element);P(r,function(n){e.getByDom(n).each(We)})},Qe=Object.keys,Ze=Object.hasOwnProperty,nt=function(n,e){for(var t=Qe(n),r=0,o=t.length;r<o;r++){var i=t[r];e(n[i],i)}},et=function(n,t){return tt(n,function(n,e){return{k:e,v:t(n,e)}})},tt=function(n,r){var o={};return nt(n,function(n,e){var t=r(n,e);o[t.k]=t.v}),o},rt=function(n,e){var t,r,o,i,u={};return t=e,i=u,r=function(n,e){i[e]=n},o=O,nt(n,function(n,e){(t(n,e)?r:o)(n,e)}),u},ot=function(n,t){var r=[];return nt(n,function(n,e){r.push(t(n,e))}),r},it=function(n,e){return ut(n,e)?T.from(n[e]):T.none()},ut=function(n,e){return Ze.call(n,e)},ct=function(n,e){return ut(n,e)&&n[e]!==undefined&&null!==n[e]},at=function(n,e,t){if(!(E(t)||D(t)||F(t)))throw console.error("Invalid call to Attribute.set. Key ",e,":: Value ",t,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(e,t+"")},ft=function(n,e,t){at(n.dom,e,t)},st=function(n,e){var t=n.dom;nt(e,function(n,e){at(t,e,n)})},lt=function(n,e){var t=n.dom.getAttribute(e);return null===t?undefined:t},dt=function(n,e){return T.from(lt(n,e))},mt=function(n,e){var t=n.dom;return!(!t||!t.hasAttribute)&&t.hasAttribute(e)},gt=function(n,e){n.dom.removeAttribute(e)},pt=function(n,e){var t=lt(n,e);return t===undefined||""===t?[]:t.split(" ")},ht=function(n){return n.dom.classList!==undefined},vt=function(n,e){return o=e,i=pt(t=n,r="class").concat([o]),ft(t,r,i.join(" ")),!0;var t,r,o,i},yt=function(n,e){return o=e,0<(i=H(pt(t=n,r="class"),function(n){return n!==o})).length?ft(t,r,i.join(" ")):gt(t,r),!1;var t,r,o,i},bt=function(n,e){ht(n)?n.dom.classList.add(e):vt(n,e)},xt=function(n){0===(ht(n)?n.dom.classList:pt(n,"class")).length&>(n,"class")},wt=function(n,e){ht(n)?n.dom.classList.remove(e):yt(n,e),xt(n)},St=function(n,e){return ht(n)&&n.dom.classList.contains(e)},Ot=function(n,e,t){wt(n,t),bt(n,e)},Tt=/* */Object.freeze({__proto__:null,toAlpha:function(n,e,t){Ot(n.element,e.alpha,e.omega)},toOmega:function(n,e,t){Ot(n.element,e.omega,e.alpha)},isAlpha:function(n,e,t){return St(n.element,e.alpha)},isOmega:function(n,e,t){return St(n.element,e.omega)},clear:function(n,e,t){wt(n.element,e.alpha),wt(n.element,e.omega)}}),kt=function(t){return{is:function(n){return t===n},isValue:w,isError:l,getOr:y(t),getOrThunk:y(t),getOrDie:y(t),or:function(n){return kt(t)},orThunk:function(n){return kt(t)},fold:function(n,e){return e(t)},map:function(n){return kt(n(t))},mapError:function(n){return kt(t)},each:function(n){n(t)},bind:function(n){return n(t)},exists:function(n){return n(t)},forall:function(n){return n(t)},toOptional:function(){return T.some(t)}}},Et=function(t){return{is:l,isValue:l,isError:w,getOr:v,getOrThunk:function(n){return n()},getOrDie:function(){return f(String(t))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,e){return n(t)},map:function(n){return Et(t)},mapError:function(n){return Et(n(t))},each:O,bind:function(n){return Et(t)},exists:l,forall:w,toOptional:T.none}},Ct={value:kt,error:Et,fromOption:function(n,e){return n.fold(function(){return Et(e)},kt)}};(a=o=o||{})[a.Error=0]="Error",a[a.Value=1]="Value";var Mt,Dt,_t,It,Ft,Rt=function(n,e,t){return n.stype===o.Error?e(n.serror):t(n.svalue)},Vt=function(n){return{stype:o.Value,svalue:n}},Bt=function(n){return{stype:o.Error,serror:n}},At=function(n){return n.fold(Bt,Vt)},jt=function(n){return Rt(n,Ct.error,Ct.value)},Nt=Vt,Pt=function(n){var e=[],t=[];return P(n,function(n){Rt(n,function(n){return t.push(n)},function(n){return e.push(n)})}),{values:e,errors:t}},Ht=Bt,zt=function(n,e){return n.stype===o.Value?e(n.svalue):n},Lt=function(n,e){return n.stype===o.Error?e(n.serror):n},Gt=function(n,e){return n.stype===o.Value?{stype:o.Value,svalue:e(n.svalue)}:n},$t=function(n,e){return n.stype===o.Error?{stype:o.Error,serror:e(n.serror)}:n},Ut=function(u){if(!M(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var c=[],t={};return P(u,function(n,r){var e=Qe(n);if(1!==e.length)throw new Error("one and only one name per case");var o=e[0],i=n[o];if(t[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!M(i))throw new Error("case arguments must be an array");c.push(o),t[o]=function(){var n=arguments.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+n);for(var t=new Array(n),e=0;e<t.length;e++)t[e]=arguments[e];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[r].apply(null,t)},match:function(n){var e=Qe(n);if(c.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+c.join(",")+"\nActual: "+e.join(","));if(!X(c,function(n){return A(e,n)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+c.join(", "));return n[o].apply(null,t)},log:function(n){console.log(n,{constructors:c,constructor:o,params:t})}}}}),t},Wt=Object.prototype.hasOwnProperty,Xt=function(u){return function(){for(var n=new Array(arguments.length),e=0;e<n.length;e++)n[e]=arguments[e];if(0===n.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<n.length;r++){var o=n[r];for(var i in o)Wt.call(o,i)&&(t[i]=u(t[i],o[i]))}return t}},qt=Xt(function(n,e){return C(n)&&C(e)?qt(n,e):e}),Yt=Xt(function(n,e){return e}),Kt=Ut([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Jt=function(n){return Kt.defaultedThunk(y(n))},Qt=Kt.strict,Zt=Kt.asOption,nr=Kt.defaultedThunk,er=(Kt.asDefaultedOptionThunk,Kt.mergeWithThunk),tr=(Ut([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n,e){var t={};return t[n]=e,t}),rr=function(n,e){return t=e,r={},nt(n,function(n,e){A(t,e)||(r[e]=n)}),r;var t,r},or=tr,ir=function(n){return e={},P(n,function(n){e[n.key]=n.value}),e;var e},ur=function(n,e){var t,r,o,i,u,c=(t=[],r=[],P(n,function(n){n.fold(function(n){t.push(n)},function(n){r.push(n)})}),{errors:t,values:r});return 0<c.errors.length?(u=c.errors,Ct.error(U(u))):(i=e,0===(o=c.values).length?Ct.value(i):Ct.value(qt(i,Yt.apply(undefined,o))))},cr=function(n){return i(Ht,U)(n)},ar=function(n,e){var t,r,o=Pt(n);return 0<o.errors.length?cr(o.errors):(t=o.values,r=e,0<t.length?Nt(qt(r,Yt.apply(undefined,t))):Nt(r))},fr=function(n){var e=Pt(n);return 0<e.errors.length?cr(e.errors):Nt(e.values)},sr=function(n){return C(n)&&100<Qe(n).length?" removed due to size":JSON.stringify(n,null,2)},lr=function(n,e){return Ht([{path:n,getErrorInfo:e}])},dr=Ut([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),mr=function(t,r,o){return it(r,o).fold(function(){return n=o,e=r,lr(t,function(){return'Could not find valid *strict* value for "'+n+'" in '+sr(e)});var n,e},Nt)},gr=function(n,e,t){var r=it(n,e).fold(function(){return t(n)},v);return Nt(r)},pr=function(c,a,n,f){return n.fold(function(o,t,n,r){var i=function(n){var e=r.extract(c.concat([o]),f,n);return Gt(e,function(n){return tr(t,f(n))})},u=function(n){return n.fold(function(){var n=tr(t,f(T.none()));return Nt(n)},function(n){var e=r.extract(c.concat([o]),f,n);return Gt(e,function(n){return tr(t,f(T.some(n)))})})};return n.fold(function(){return zt(mr(c,a,o),i)},function(n){return zt(gr(a,o,n),i)},function(){return zt(Nt(it(a,o)),u)},function(n){return zt((t=n,r=it(e=a,o).map(function(n){return!0===n?t(e):n}),Nt(r)),u);var e,t,r},function(n){var e=n(a),t=Gt(gr(a,o,y({})),function(n){return qt(e,n)});return zt(t,i)})},function(n,e){var t=e(a);return Nt(tr(n,f(t)))})},hr=function(r){return{extract:function(t,n,e){return Lt(r(e,n),function(n){return e=n,lr(t,function(){return e});var e})},toString:function(){return"val"}}},vr=function(n){var u=yr(n),c=z(n,function(e,n){return n.fold(function(n){return qt(e,or(n,!0))},y(e))},{});return{extract:function(n,e,t){var r,o=D(t)?[]:Qe(rt(t,function(n){return n!==undefined&&null!==n})),i=H(o,function(n){return!ct(c,n)});return 0===i.length?u.extract(n,e,t):(r=i,lr(n,function(){return"There are unsupported fields: ["+r.join(", ")+"] specified"}))},toString:u.toString}},yr=function(c){return{extract:function(n,e,t){return r=n,o=t,i=e,u=N(c,function(n){return pr(r,o,n,i)}),ar(u,{});var r,o,i,u},toString:function(){return"obj{\n"+N(c,function(n){return n.fold(function(n,e,t,r){return n+" -> "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"}}},br=function(t,i){var u=function(n,e){return o=hr(t),function(t,r,n){var e=N(n,function(n,e){return o.extract(t.concat(["["+e+"]"]),r,n)});return fr(e)}(n,v,e);var o};return{extract:function(t,r,o){var n=Qe(o),e=u(t,n);return zt(e,function(n){var e=N(n,function(n){return dr.field(n,n,Qt(),i)});return yr(e).extract(t,r,o)})},toString:function(){return"setOf("+i.toString()+")"}}},xr=y(hr(Nt)),wr=dr.state,Sr=dr.field,Or=function(t,e,r,o,i){return it(o,i).fold(function(){return n=o,e=i,lr(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+sr(n)});var n,e},function(n){return n.extract(t.concat(["branch: "+i]),e,r)})},Tr=function(o,i){return{extract:function(e,t,r){return it(r,o).fold(function(){return n=o,lr(e,function(){return'Choice schema did not contain choice key: "'+n+'"'});var n},function(n){return Or(e,t,r,i,n)})},toString:function(){return"chooseOn("+o+"). Possible values: "+Qe(i)}}},kr=hr(Nt),Er=function(e){return hr(function(n){return e(n).fold(Ht,Nt)})},Cr=function(e,n){return br(function(n){return At(e(n))},n)},Mr=function(n,e,t){return jt((r=n,o=v,i=t,u=e.extract([r],o,i),$t(u,function(n){return{input:i,errors:n}})));var r,o,i,u},Dr=function(n){return n.fold(function(n){throw new Error(Ir(n))},v)},_r=function(n,e,t){return Dr(Mr(n,e,t))},Ir=function(n){return"Errors: \n"+(e=n.errors,t=10<e.length?e.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):e,N(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()}).join("\n"))+"\n\nInput object: "+sr(n.input);var e,t},Fr=function(n,e){return Tr(n,et(e,yr))},Rr=y(kr),Vr=(Mt=I,Dt="function",hr(function(n){var e=typeof n;return Mt(n)?Nt(n):Ht("Expected type: "+Dt+" but got: "+e)})),Br=function(n){return Sr(n,n,Qt(),xr())},Ar=function(n,e){return Sr(n,n,Qt(),e)},jr=function(n,e){return Sr(n,n,Qt(),yr(e))},Nr=function(n){return Sr(n,n,Zt(),xr())},Pr=function(n,e){return Sr(n,n,Zt(),e)},Hr=function(n,e){return Pr(n,yr(e))},zr=function(n,e){return Pr(n,vr(e))},Lr=function(n,e){return Sr(n,n,Jt(e),xr())},Gr=function(n,e,t){return Sr(n,n,Jt(e),t)},$r=function(n,e){return wr(n,e)},Ur=[Br("alpha"),Br("omega")],Wr=function(n){return I(n)?n:l},Xr=function(n,e,t){var r=e(n),o=Wr(t);return r.orThunk(function(){return o(n)?T.none():function(n,e,t){for(var r=n.dom,o=Wr(t);r.parentNode;){r=r.parentNode;var i=de.fromDom(r),u=e(i);if(u.isSome())return u;if(o(i))break}return T.none()}(n,e,o)})},qr=function(n,e){return ve(n.element,e.event.target)},Yr=function(n){if(!ct(n,"can")&&!ct(n,"abort")&&!ct(n,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(n,null,2)+" does not have can, abort, or run!");return _r("Extracting event.handler",vr([Lr("can",w),Lr("abort",l),Lr("run",O)]),n)},Kr=function(t){var e,r,o,i,n=(r=function(n){return n.can},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return L(e,function(n,e){return n&&r(e).apply(undefined,t)},!0)}),u=(o=e=t,i=function(n){return n.abort},function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return L(o,function(n,e){return n||i(e).apply(undefined,t)},!1)});return Yr({can:n,abort:u,run:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];P(t,function(n){n.run.apply(undefined,e)})}})},Jr=ir,Qr=function(n,e){return{key:n,value:Yr({abort:e})}},Zr=function(n,e){return{key:n,value:Yr({run:e})}},no=function(n,t,r){return{key:n,value:Yr({run:function(n,e){t.apply(undefined,[n,e].concat(r))}})}},eo=function(n){return function(t){return{key:n,value:Yr({run:function(n,e){qr(n,e)&&t(n,e)}})}}},to=function(u,e){return Zr(u,function(n,i){n.getSystem().getByUid(e).each(function(n){var e,t,r,o;t=(e=n).element,r=u,o=i,e.getSystem().triggerEvent(r,t,o.event)})})},ro=function(n,e,t){var r=e.partUids[t];return to(n,r)},oo=function(n){return Zr(n,function(n,e){e.cut()})},io=eo(ee()),uo=eo(te()),co=eo(ne()),ao=(_t=Kn(),function(n){return Zr(_t,n)}),fo=function(n){return N(n,function(n){return r=e="/*",o=(t=n).length-e.length,""===r||t.length>=r.length&&t.substr(o,o+r.length)===r?n.substring(0,n.length-"/*".length):n;var e,t,r,o})},so=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:fo(i)}},n},lo=function(n){return{classes:n.classes!==undefined?n.classes:[],attributes:n.attributes!==undefined?n.attributes:{},styles:n.styles!==undefined?n.styles:{}}},mo=function(t,r,o){return co(function(n,e){o(n,t,r)})},go=function(o,i,u){var n,e,t,r,c,a;return n=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var r=[t].concat(n);return t.config({name:y(o)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+o+". Using API: "+u)},function(n){var e=Array.prototype.slice.call(r,1);return i.apply(undefined,[t,n.config,n.state].concat(e))})},e=u,t=i.toString(),r=t.indexOf(")")+1,c=t.indexOf("("),a=t.substring(c+1,r-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:e,parameters:fo(a.slice(0,1).concat(a.slice(3)))}},n},po=function(n){return{key:n,value:undefined}},ho=function(t,n,r,o,e,i,u){var c=function(n){return ct(n,r)?n[r]():T.none()},a=et(e,function(n,e){return go(r,n,e)}),f=et(i,so),s=x(x(x({},f),a),{revoke:b(po,r),config:function(n){var e=_r(r+"-config",t,n);return{key:r,value:{config:e,me:s,configAsRaw:d(function(){return _r(r+"-config",t,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,t){return c(n).bind(function(e){return it(o,"exhibit").map(function(n){return n(t,e.config,e.state)})}).getOr(lo({}))},name:function(){return r},handlers:function(n){return c(n).map(function(n){return it(o,"events").getOr(function(){return{}})(n.config,n.state)}).getOr({})}});return s},vo={init:function(){return yo({readState:function(){return"No State required"}})}},yo=function(n){return n},bo=ir,xo=vr([Br("fields"),Br("name"),Lr("active",{}),Lr("apis",{}),Lr("state",vo),Lr("extra",{})]),wo=function(n){var e,t,r,o,i,u,c,a,f=_r("Creating behaviour: "+n.name,xo,n);return e=f.fields,t=f.name,r=f.active,o=f.apis,i=f.extra,u=f.state,c=vr(e),a=Hr(t,[zr("config",e)]),ho(c,a,t,r,o,i,u)},So=vr([Br("branchKey"),Br("branches"),Br("name"),Lr("active",{}),Lr("apis",{}),Lr("state",vo),Lr("extra",{})]),Oo=y(undefined),To=wo({fields:Ur,name:"swapping",apis:Tt}),ko=function(n){var e=n;return{get:function(){return e},set:function(n){e=n}}},Eo=function(n){return n.dom.focus()},Co=function(n){return n.dom.blur()},Mo=function(n){return void 0===n&&(n=de.fromDom(document)),T.from(n.dom.activeElement).map(de.fromDom)},Do=function(e){return Mo(Ne(e)).filter(function(n){return e.dom.contains(n.dom)})},_o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Io=tinymce.util.Tools.resolve("tinymce.ThemeManager"),Fo=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],Ro=["undo","bold","italic","link","image","bullist","styleselect"],Vo="formatChanged",Bo="orientationChanged",Ao="dropupDismissed",jo=function(n){return n.dom.innerHTML},No=function(n,e){var t,r,o=Te(n).dom,i=de.fromDom(o.createDocumentFragment()),u=(t=e,(r=(o||document).createElement("div")).innerHTML=t,Ce(de.fromDom(r)));Re(i,u),Ve(n),Fe(n,i)},Po=function(n){return e=n,t=!1,de.fromDom(e.dom.cloneNode(t));var e,t},Ho=function(n){var e,t,r,o=Po(n);return e=o,t=de.fromTag("div"),r=de.fromDom(e.dom.cloneNode(!0)),Fe(t,r),jo(t)},zo=/* */Object.freeze({__proto__:null,events:function(a){return Jr([Zr(Yn(),function(o,n){var e,t,i=a.channels,r=Qe(i),u=n,c=(e=r,(t=u).universal?e:H(e,function(n){return A(t.channels,n)}));P(c,function(n){var e=i[n],t=e.schema,r=_r("channel["+n+"] data\nReceiver: "+Ho(o.element),t,u.data);e.onReceive(o,r)})})])}}),Lo="unknown";(Ft=It=It||{})[Ft.STOP=0]="STOP",Ft[Ft.NORMAL=1]="NORMAL",Ft[Ft.LOGGING=2]="LOGGING";var Go,$o=ko({}),Uo=["alloy/data/Fields","alloy/debugging/Debugging"],Wo=function(e,n,t){var r,o,i,u;switch(it($o.get(),e).orThunk(function(){var n=Qe($o.get());return Q(n,function(n){return-1<e.indexOf(n)?T.some($o.get()[n]):T.none()})}).getOr(It.NORMAL)){case It.NORMAL:return t(Xo());case It.LOGGING:var c=(r=e,o=n,i=[],u=(new Date).getTime(),{logEventCut:function(n,e,t){i.push({outcome:"cut",target:e,purpose:t})},logEventStopped:function(n,e,t){i.push({outcome:"stopped",target:e,purpose:t})},logNoParent:function(n,e,t){i.push({outcome:"no-parent",target:e,purpose:t})},logEventNoHandlers:function(n,e){i.push({outcome:"no-handlers-left",target:e})},logEventResponse:function(n,e,t){i.push({outcome:"response",purpose:t,target:e})},write:function(){var n=(new Date).getTime();A(["mousemove","mouseover","mouseout",ne()],r)||console.log(r,{event:r,time:n-u,target:o.dom,sequence:N(i,function(n){return A(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+Ho(n.target)+")":n.outcome})})}}),a=t(c);return c.write(),a;case It.STOP:return!0}},Xo=y({logEventCut:O,logEventStopped:O,logNoParent:O,logEventNoHandlers:O,logEventResponse:O,write:O}),qo=y([Br("menu"),Br("selectedMenu")]),Yo=y([Br("item"),Br("selectedItem")]),Ko=(y(yr(Yo().concat(qo()))),y(yr(Yo()))),Jo=jr("initSize",[Br("numColumns"),Br("numRows")]),Qo=function(n,e,t){!function(){var n=new Error;if(n.stack===undefined)return;var e=n.stack.split("\n");G(e,function(e){return 0<e.indexOf("alloy")&&!j(Uo,function(n){return-1<e.indexOf(n)})}).getOr(Lo)}();return Sr(e,e,t,Er(function(t){return Ct.value(function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return t.apply(undefined,n)})}))},Zo=function(n){return Qo(0,n,Jt(O))},ni=function(n){return Qo(0,n,Jt(T.none))},ei=function(n){return Qo(0,n,Qt())},ti=function(n){return Qo(0,n,Qt())},ri=function(n,e){return $r(n,y(e))},oi=function(n){return $r(n,v)},ii=y(Jo),ui=[Ar("channels",Cr(Ct.value,vr([ei("onReceive"),Lr("schema",Rr())])))],ci=wo({fields:ui,name:"receiving",active:zo}),ai=function(n,e,t){var r=e.aria;r.update(n,r,t.get())},fi=function(e,n,t){n.toggleClass.each(function(n){(t.get()?bt:wt)(e.element,n)})},si=function(n,e,t){mi(n,e,t,!t.get())},li=function(n,e,t){t.set(!0),fi(n,e,t),ai(n,e,t)},di=function(n,e,t){t.set(!1),fi(n,e,t),ai(n,e,t)},mi=function(n,e,t,r){(r?li:di)(n,e,t)},gi=function(n,e,t){mi(n,e,t,e.selected)},pi=/* */Object.freeze({__proto__:null,onLoad:gi,toggle:si,isOn:function(n,e,t){return t.get()},on:li,off:di,set:mi}),hi=/* */Object.freeze({__proto__:null,exhibit:function(){return lo({})},events:function(n,e){var t,r,o,i=(t=n,r=e,o=si,ao(function(n){o(n,t,r)})),u=mo(n,e,gi);return Jr(U([n.toggleOnExecute?[i]:[],[u]]))}}),vi=function(n,e,t){ft(n.element,"aria-expanded",t)},yi=[Lr("selected",!1),Nr("toggleClass"),Lr("toggleOnExecute",!0),Gr("aria",{mode:"none"},Fr("mode",{pressed:[Lr("syncWithExpanded",!1),ri("update",function(n,e,t){ft(n.element,"aria-pressed",t),e.syncWithExpanded&&vi(n,e,t)})],checked:[ri("update",function(n,e,t){ft(n.element,"aria-checked",t)})],expanded:[ri("update",vi)],selected:[ri("update",function(n,e,t){ft(n.element,"aria-selected",t)})],none:[ri("update",O)]}))],bi=wo({fields:yi,name:"toggling",active:hi,apis:pi,state:(Go=!1,{init:function(){var e=ko(Go);return{get:function(){return e.get()},set:function(n){return e.set(n)},clear:function(){return e.set(Go)},readState:function(){return e.get()}}}})}),xi=function(t,r){return ci.config({channels:or(Vo,{onReceive:function(n,e){e.command===t&&r(n,e.state)}})})},wi=function(n){return ci.config({channels:or(Bo,{onReceive:n})})},Si=function(n,e){return{key:n,value:{onReceive:e}}},Oi="tinymce-mobile",Ti=function(n){return Oi+"-"+n},ki=function(){var n=function(n,e){e.stop(),ae(n)};return[Zr(zn(),n),Zr(Qn(),n),oo(_n()),oo(Rn())]},Ei=function(n,e){e.ignore||(Eo(n.element),e.onFocus(n))},Ci=/* */Object.freeze({__proto__:null,focus:Ei,blur:function(n,e){e.ignore||Co(n.element)},isFocused:function(n){return e=n.element,t=Ne(e).dom,e.dom===t.activeElement;var e,t}}),Mi=/* */Object.freeze({__proto__:null,exhibit:function(n,e){var t=e.ignore?{}:{attributes:{tabindex:"-1"}};return lo(t)},events:function(t){return Jr([Zr(Wn(),function(n,e){Ei(n,t),e.stop()})].concat(t.stopMousedown?[Zr(Rn(),function(n,e){e.event.prevent()})]:[]))}}),Di=[Zo("onFocus"),Lr("stopMousedown",!1),Lr("ignore",!1)],_i=wo({fields:Di,name:"focusing",active:Mi,apis:Ci}),Ii=function(n){return n.style!==undefined&&I(n.style.getPropertyValue)},Fi=function(n,e,t){if(!E(t))throw console.error("Invalid call to CSS.set. Property ",e,":: Value ",t,":: Element ",n),new Error("CSS value must be a string: "+t);Ii(n)&&n.style.setProperty(e,t)},Ri=function(n,e,t){var r=n.dom;Fi(r,e,t)},Vi=function(n,e){var t=n.dom;nt(e,function(n,e){Fi(t,e,n)})},Bi=function(n,e){var t=n.dom,r=window.getComputedStyle(t).getPropertyValue(e);return""!==r||Le(n)?r:Ai(t,e)},Ai=function(n,e){return Ii(n)?n.style.getPropertyValue(e):""},ji=function(n,e){var t=n.dom,r=Ai(t,e);return T.from(r).filter(function(n){return 0<n.length})},Ni=function(n,e){var t,r,o=n.dom;r=e,Ii(t=o)&&t.style.removeProperty(r),dt(n,"style").map(fn).is("")&>(n,"style")},Pi=function(n){return n.dom.offsetWidth};function Hi(r,o){var n=function(n){var e=o(n);if(e<=0||null===e){var t=Bi(n,r);return parseFloat(t)||0}return e},i=function(o,n){return L(n,function(n,e){var t=Bi(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!F(e)&&!e.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+e);var t=n.dom;Ii(t)&&(t.style[r]=e+"px")},get:n,getOuter:n,aggregate:i,max:function(n,e,t){var r=i(n,t);return r<e?e-r:0}}}var zi=Hi("height",function(n){var e=n.dom;return Le(n)?e.getBoundingClientRect().height:e.offsetHeight}),Li=function(n){return zi.get(n)},Gi=function(n,e,t){return H(function(n,e){for(var t=I(e)?e:l,r=n.dom,o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,u=de.fromDom(i);if(o.push(u),!0===t(u))break;r=i}return o}(n,t),e)},$i=function(n,e){return H(Ee(t=n).map(Ce).map(function(n){return H(n,function(n){return!ve(t,n)})}).getOr([]),e);var t},Ui=function(n,e){return pe(e,n)};function Wi(n,e,t,r,o){return n(t,r)?T.some(t):I(o)&&o(t)?T.none():e(t,r,o)}var Xi,qi,Yi=function(n,e,t){for(var r=n.dom,o=I(t)?t:l;r.parentNode;){r=r.parentNode;var i=de.fromDom(r);if(e(i))return T.some(i);if(o(i))break}return T.none()},Ki=function(n){return he(n)},Ji=function(n,e,t){return Yi(n,function(n){return me(n,e)},t)},Qi=function(n,e){return he(e,n)},Zi=function(n,e,t){return Wi(me,Ji,n,e,t)},nu=[8],eu=[9],tu=[13],ru=[27],ou=[32],iu=[37],uu=[38],cu=[39],au=[40],fu=function(n,e,t){var r=q(n.slice(0,e)),o=q(n.slice(e+1));return G(r.concat(o),t)},su=function(n,e,t){var r=q(n.slice(0,e));return G(r,t)},lu=function(n,e,t){var r=n.slice(0,e),o=n.slice(e+1);return G(o.concat(r),t)},du=function(n,e,t){var r=n.slice(e+1);return G(r,t)},mu=function(t){return function(n){var e=n.raw;return A(t,e.which)}},gu=function(n){return function(e){return X(n,function(n){return n(e)})}},pu=function(n){return!0===n.raw.shiftKey},hu=function(n){return!0===n.raw.ctrlKey},vu=m(pu),yu=function(n,e){return{matches:n,classification:e}},bu=function(n,e,t,r){var o=n+e;return r<o?t:o<t?r:o},xu=function(n,e,t){return Math.min(Math.max(n,e),t)},wu=function(n){for(var e=[],t=function(n){e.push(n)},r=0;r<n.length;r++)n[r].each(t);return e},Su=function(t,r,n,o){var e=Ui(t.element,"."+r.highlightClass);P(e,function(e){j(o,function(n){return n.element===e})||(wt(e,r.highlightClass),t.getSystem().getByDom(e).each(function(n){r.onDehighlight(t,n),ue(n,ie())}))})},Ou=function(n,e,t,r){Su(n,e,0,[r]),Tu(n,e,t,r)||(bt(r.element,e.highlightClass),e.onHighlight(n,r),ue(r,oe()))},Tu=function(n,e,t,r){return St(r.element,e.highlightClass)},ku=function(n,e,t,r){var o=Ui(n.element,"."+e.itemClass);return T.from(o[r]).fold(function(){return Ct.error("No element found with index "+r)},n.getSystem().getByDom)},Eu=function(e,n,t){return Qi(e.element,"."+n.itemClass).bind(function(n){return e.getSystem().getByDom(n).toOptional()})},Cu=function(e,n,t){var r=Ui(e.element,"."+n.itemClass);return(0<r.length?T.some(r[r.length-1]):T.none()).bind(function(n){return e.getSystem().getByDom(n).toOptional()})},Mu=function(t,e,n,r){var o=Ui(t.element,"."+e.itemClass);return $(o,function(n){return St(n,e.highlightClass)}).bind(function(n){var e=bu(n,r,0,o.length-1);return t.getSystem().getByDom(o[e]).toOptional()})},Du=function(e,n,t){var r=Ui(e.element,"."+n.itemClass);return wu(N(r,function(n){return e.getSystem().getByDom(n).toOptional()}))},_u=/* */Object.freeze({__proto__:null,dehighlightAll:function(n,e,t){return Su(n,e,0,[])},dehighlight:function(n,e,t,r){Tu(n,e,t,r)&&(wt(r.element,e.highlightClass),e.onDehighlight(n,r),ue(r,ie()))},highlight:Ou,highlightFirst:function(e,t,r){Eu(e,t).each(function(n){Ou(e,t,r,n)})},highlightLast:function(e,t,r){Cu(e,t).each(function(n){Ou(e,t,r,n)})},highlightAt:function(e,t,r,n){ku(e,t,r,n).fold(function(n){throw new Error(n)},function(n){Ou(e,t,r,n)})},highlightBy:function(e,t,r,n){var o=Du(e,t);G(o,n).each(function(n){Ou(e,t,r,n)})},isHighlighted:Tu,getHighlighted:function(e,n,t){return Qi(e.element,"."+n.highlightClass).bind(function(n){return e.getSystem().getByDom(n).toOptional()})},getFirst:Eu,getLast:Cu,getPrevious:function(n,e,t){return Mu(n,e,0,-1)},getNext:function(n,e,t){return Mu(n,e,0,1)},getCandidates:Du}),Iu=[Br("highlightClass"),Br("itemClass"),Zo("onHighlight"),Zo("onDehighlight")],Fu=wo({fields:Iu,name:"highlighting",apis:_u}),Ru=function(n,e,t){e.exists(function(e){return t.exists(function(n){return ve(n,e)})})||ce(n,re(),{prevFocus:e,newFocus:t})},Vu=function(){var o=function(n){return Do(n.element)};return{get:o,set:function(n,e){var t=o(n);n.getSystem().triggerFocus(e,n.element);var r=o(n);Ru(n,t,r)}}};(qi=Xi=Xi||{}).OnFocusMode="onFocus",qi.OnEnterOrSpaceMode="onEnterOrSpace",qi.OnApiMode="onApi";var Bu,Au,ju,Nu,Pu,Hu,zu,Lu,Gu,$u,Uu=function(n,e,t,r,c){var a=function(e,t,n,r,o){var i,u,c=n(e,t,r,o);return i=c,u=t.event,G(i,function(n){return n.matches(u)}).map(function(n){return n.classification}).bind(function(n){return n(e,t,r,o)})},o={schema:function(){return n.concat([Lr("focusManager",Vu()),Gr("focusInside","onFocus",Er(function(n){return A(["onFocus","onEnterOrSpace","onApi"],n)?Ct.value(n):Ct.error("Invalid value for focusInside")})),ri("handler",o),ri("state",e),ri("sendFocusIn",c)])},processKey:a,toEvents:function(i,u){var n=i.focusInside!==Xi.OnFocusMode?T.none():c(i).map(function(t){return Zr(Wn(),function(n,e){t(n,i,u),e.stop()})}),e=[Zr(jn(),function(r,o){a(r,o,t,i,u).fold(function(){var e,t,n;e=r,t=o,n=mu(ou.concat(tu))(t.event),i.focusInside===Xi.OnEnterOrSpaceMode&&n&&qr(e,t)&&c(i).each(function(n){n(e,i,u),t.stop()})},function(n){o.stop()})}),Zr(Nn(),function(n,e){a(n,e,r,i,u).each(function(n){e.stop()})})];return Jr(n.toArray().concat(e))}};return o},Wu=function(n){var e=[Nr("onEscape"),Nr("onEnter"),Lr("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Lr("firstTabstop",0),Lr("useTabstopAt",w),Nr("visibilitySelector")].concat([n]),u=function(n,e){var t=n.visibilitySelector.bind(function(n){return Zi(e,n)}).getOr(e);return 0<Li(t)},t=function(e,t,n){var r,o,i;r=t,o=Ui(e.element,r.selector),i=H(o,function(n){return u(r,n)}),T.from(i[r.firstTabstop]).each(function(n){t.focusManager.set(e,n)})},c=function(e,n,t,r,o){return o(n,t,function(n){return u(e=r,t=n)&&e.useTabstopAt(t);var e,t}).fold(function(){return r.cyclic?T.some(!0):T.none()},function(n){return r.focusManager.set(e,n),T.some(!0)})},o=function(e,n,t,r){var o,i,u=Ui(e.element,t.selector);return o=e,(i=t).focusManager.get(o).bind(function(n){return Zi(n,i.selector)}).bind(function(n){return $(u,b(ve,n)).bind(function(n){return c(e,u,n,t,r)})})},r=y([yu(gu([pu,mu(eu)]),function(n,e,t){var r=t.cyclic?fu:su;return o(n,0,t,r)}),yu(mu(eu),function(n,e,t){var r=t.cyclic?lu:du;return o(n,0,t,r)}),yu(mu(ru),function(e,t,n){return n.onEscape.bind(function(n){return n(e,t)})}),yu(gu([vu,mu(tu)]),function(e,t,n){return n.onEnter.bind(function(n){return n(e,t)})})]),i=y([]);return Uu(e,vo.init,r,i,function(){return T.some(t)})},Xu=Wu($r("cyclic",l)),qu=Wu($r("cyclic",w)),Yu=function(n){return"input"===ye(n)&&"radio"!==lt(n,"type")||"textarea"===ye(n)},Ku=function(n,e,t){return Yu(t)&&mu(ou)(e.event)?T.none():(fe(n,t,Kn()),T.some(!0))},Ju=function(n,e){return T.some(!0)},Qu=[Lr("execute",Ku),Lr("useSpace",!1),Lr("useEnter",!0),Lr("useControlEnter",!1),Lr("useDown",!1)],Zu=function(n,e,t){return t.execute(n,e,n.element)},nc=Uu(Qu,vo.init,function(n,e,t,r){var o=t.useSpace&&!Yu(n.element)?ou:[],i=t.useEnter?tu:[],u=t.useDown?au:[],c=o.concat(i).concat(u);return[yu(mu(c),Zu)].concat(t.useControlEnter?[yu(gu([hu,mu(tu)]),Zu)]:[])},function(n,e,t,r){return t.useSpace&&!Yu(n.element)?[yu(mu(ou),Ju)]:[]},function(){return T.none()}),ec=function(){var t=ko(T.none());return yo({readState:function(){return t.get().map(function(n){return{numRows:String(n.numRows),numColumns:String(n.numColumns)}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(n,e){t.set(T.some({numRows:n,numColumns:e}))},getNumRows:function(){return t.get().map(function(n){return n.numRows})},getNumColumns:function(){return t.get().map(function(n){return n.numColumns})}})},tc=/* */Object.freeze({__proto__:null,flatgrid:ec,init:function(n){return n.state(n)}}),rc=function(e,t){return function(n){return"rtl"===oc(n)?t:e}},oc=function(n){return"rtl"===Bi(n,"direction")?"rtl":"ltr"},ic=function(i){return function(n,e,t,r){var o=i(n.element);return fc(o,n,e,t,r)}},uc=function(n,e){var t=rc(n,e);return ic(t)},cc=function(n,e){var t=rc(e,n);return ic(t)},ac=function(o){return function(n,e,t,r){return fc(o,n,e,t,r)}},fc=function(e,t,n,r,o){return r.focusManager.get(t).bind(function(n){return e(t.element,n,r,o)}).map(function(n){return r.focusManager.set(t,n),!0})},sc=ac,lc=ac,dc=ac,mc=function(n){return!((e=n.dom).offsetWidth<=0&&e.offsetHeight<=0);var e},gc=function(n,e,t){var r,o=Ui(n,t),i=H(o,mc);return $(r=i,function(n){return ve(n,e)}).map(function(n){return{index:n,candidates:r}})},pc=function(n,e){return $(n,function(n){return ve(e,n)})},hc=function(t,n,r,e){return e(Math.floor(n/r),n%r).bind(function(n){var e=n.row*r+n.column;return 0<=e&&e<t.length?T.some(t[e]):T.none()})},vc=function(o,n,i,u,c){return hc(o,n,u,function(n,e){var t=n===i-1?o.length-n*u:u,r=bu(e,c,0,t-1);return T.some({row:n,column:r})})},yc=function(i,n,u,c,a){return hc(i,n,c,function(n,e){var t=bu(n,a,0,u-1),r=t===u-1?i.length-t*c:c,o=xu(e,0,r-1);return T.some({row:t,column:o})})},bc=[Br("selector"),Lr("execute",Ku),ni("onEscape"),Lr("captureTab",!1),ii()],xc=function(e,t,n){Qi(e.element,t.selector).each(function(n){t.focusManager.set(e,n)})},wc=function(o){return function(n,e,t,r){return gc(n,e,t.selector).bind(function(n){return o(n.candidates,n.index,r.getNumRows().getOr(t.initSize.numRows),r.getNumColumns().getOr(t.initSize.numColumns))})}},Sc=function(n,e,t){return t.captureTab?T.some(!0):T.none()},Oc=wc(function(n,e,t,r){return vc(n,e,t,r,-1)}),Tc=wc(function(n,e,t,r){return vc(n,e,t,r,1)}),kc=wc(function(n,e,t,r){return yc(n,e,t,r,-1)}),Ec=wc(function(n,e,t,r){return yc(n,e,t,r,1)}),Cc=y([yu(mu(iu),uc(Oc,Tc)),yu(mu(cu),cc(Oc,Tc)),yu(mu(uu),sc(kc)),yu(mu(au),lc(Ec)),yu(gu([pu,mu(eu)]),Sc),yu(gu([vu,mu(eu)]),Sc),yu(mu(ru),function(n,e,t){return t.onEscape(n,e)}),yu(mu(ou.concat(tu)),function(e,t,r,n){return o=e,(i=r).focusManager.get(o).bind(function(n){return Zi(n,i.selector)}).bind(function(n){return r.execute(e,t,n)});var o,i})]),Mc=y([yu(mu(ou),Ju)]),Dc=Uu(bc,ec,Cc,Mc,function(){return T.some(xc)}),_c=function(n,e,t,i){var u=function(n,e,t){var r,o=bu(e,i,0,t.length-1);return o===n?T.none():(r=t[o],"button"===ye(r)&&"disabled"===lt(r,"disabled")?u(n,o,t):T.from(t[o]))};return gc(n,t,e).bind(function(n){var e=n.index,t=n.candidates;return u(e,e,t)})},Ic=[Br("selector"),Lr("getInitial",T.none),Lr("execute",Ku),ni("onEscape"),Lr("executeOnMove",!1),Lr("allowVertical",!0)],Fc=function(e,t,r){return n=e,(o=r).focusManager.get(n).bind(function(n){return Zi(n,o.selector)}).bind(function(n){return r.execute(e,t,n)});var n,o},Rc=function(e,t,n){t.getInitial(e).orThunk(function(){return Qi(e.element,t.selector)}).each(function(n){t.focusManager.set(e,n)})},Vc=function(n,e,t){return _c(n,t.selector,e,-1)},Bc=function(n,e,t){return _c(n,t.selector,e,1)},Ac=function(o){return function(n,e,t,r){return o(n,e,t,r).bind(function(){return t.executeOnMove?Fc(n,e,t):T.some(!0)})}},jc=function(n,e,t){return t.onEscape(n,e)},Nc=y([yu(mu(ou),Ju)]),Pc=Uu(Ic,vo.init,function(n,e,t,r){var o=iu.concat(t.allowVertical?uu:[]),i=cu.concat(t.allowVertical?au:[]);return[yu(mu(o),Ac(uc(Vc,Bc))),yu(mu(i),Ac(cc(Vc,Bc))),yu(mu(tu),Fc),yu(mu(ou),Fc),yu(mu(ru),jc)]},Nc,function(){return T.some(Rc)}),Hc=function(n,e,t){return T.from(n[e]).bind(function(n){return T.from(n[t]).map(function(n){return{rowIndex:e,columnIndex:t,cell:n}})})},zc=function(n,e,t,r){var o=n[e].length,i=bu(t,r,0,o-1);return Hc(n,e,i)},Lc=function(n,e,t,r){var o=bu(t,r,0,n.length-1),i=n[o].length,u=xu(e,0,i-1);return Hc(n,o,u)},Gc=function(n,e,t,r){var o=n[e].length,i=xu(t+r,0,o-1);return Hc(n,e,i)},$c=function(n,e,t,r){var o=xu(t+r,0,n.length-1),i=n[o].length,u=xu(e,0,i-1);return Hc(n,o,u)},Uc=[jr("selectors",[Br("row"),Br("cell")]),Lr("cycles",!0),Lr("previousSelector",T.none),Lr("execute",Ku)],Wc=function(e,t,n){t.previousSelector(e).orThunk(function(){var n=t.selectors;return Qi(e.element,n.cell)}).each(function(n){t.focusManager.set(e,n)})},Xc=function(n,e){return function(t,r,i){var u=i.cycles?n:e;return Zi(r,i.selectors.row).bind(function(n){var e=Ui(n,i.selectors.cell);return pc(e,r).bind(function(r){var o=Ui(t,i.selectors.row);return pc(o,n).bind(function(n){var e,t=(e=i,N(o,function(n){return Ui(n,e.selectors.cell)}));return u(t,n,r).map(function(n){return n.cell})})})})}},qc=Xc(function(n,e,t){return zc(n,e,t,-1)},function(n,e,t){return Gc(n,e,t,-1)}),Yc=Xc(function(n,e,t){return zc(n,e,t,1)},function(n,e,t){return Gc(n,e,t,1)}),Kc=Xc(function(n,e,t){return Lc(n,t,e,-1)},function(n,e,t){return $c(n,t,e,-1)}),Jc=Xc(function(n,e,t){return Lc(n,t,e,1)},function(n,e,t){return $c(n,t,e,1)}),Qc=y([yu(mu(iu),uc(qc,Yc)),yu(mu(cu),cc(qc,Yc)),yu(mu(uu),sc(Kc)),yu(mu(au),lc(Jc)),yu(mu(ou.concat(tu)),function(e,t,r){return Do(e.element).bind(function(n){return r.execute(e,t,n)})})]),Zc=y([yu(mu(ou),Ju)]),na=Uu(Uc,vo.init,Qc,Zc,function(){return T.some(Wc)}),ea=[Br("selector"),Lr("execute",Ku),Lr("moveOnTab",!1)],ta=function(e,t,r){return r.focusManager.get(e).bind(function(n){return r.execute(e,t,n)})},ra=function(e,t,n){Qi(e.element,t.selector).each(function(n){t.focusManager.set(e,n)})},oa=function(n,e,t){return _c(n,t.selector,e,-1)},ia=function(n,e,t){return _c(n,t.selector,e,1)},ua=y([yu(mu(uu),dc(oa)),yu(mu(au),dc(ia)),yu(gu([pu,mu(eu)]),function(n,e,t,r){return t.moveOnTab?dc(oa)(n,e,t,r):T.none()}),yu(gu([vu,mu(eu)]),function(n,e,t,r){return t.moveOnTab?dc(ia)(n,e,t,r):T.none()}),yu(mu(tu),ta),yu(mu(ou),ta)]),ca=y([yu(mu(ou),Ju)]),aa=Uu(ea,vo.init,ua,ca,function(){return T.some(ra)}),fa=[ni("onSpace"),ni("onEnter"),ni("onShiftEnter"),ni("onLeft"),ni("onRight"),ni("onTab"),ni("onShiftTab"),ni("onUp"),ni("onDown"),ni("onEscape"),Lr("stopSpaceKeyup",!1),Nr("focusIn")],sa=Uu(fa,vo.init,function(n,e,t){return[yu(mu(ou),t.onSpace),yu(gu([vu,mu(tu)]),t.onEnter),yu(gu([pu,mu(tu)]),t.onShiftEnter),yu(gu([pu,mu(eu)]),t.onShiftTab),yu(gu([vu,mu(eu)]),t.onTab),yu(mu(uu),t.onUp),yu(mu(au),t.onDown),yu(mu(iu),t.onLeft),yu(mu(cu),t.onRight),yu(mu(ou),t.onSpace),yu(mu(ru),t.onEscape)]},function(n,e,t){return t.stopSpaceKeyup?[yu(mu(ou),Ju)]:[]},function(n){return n.focusIn}),la=Xu.schema(),da=qu.schema(),ma=Pc.schema(),ga=Dc.schema(),pa=na.schema(),ha=nc.schema(),va=aa.schema(),ya=sa.schema(),ba=($u=_r("Creating behaviour: "+(Bu={branchKey:"mode",branches:/* */Object.freeze({__proto__:null,acyclic:la,cyclic:da,flow:ma,flatgrid:ga,matrix:pa,execution:ha,menu:va,special:ya}),name:"keying",active:{events:function(n,e){return n.handler.toEvents(n,e)}},apis:{focusIn:function(e,t,r){t.sendFocusIn(t).fold(function(){e.getSystem().triggerFocus(e.element,e.element)},function(n){n(e,t,r)})},setGridSize:function(n,e,t,r,o){ct(t,"setGridSize")?t.setGridSize(r,o):console.error("Layout does not support setGridSize")}},state:tc}).name,So,Bu),Au=Fr($u.branchKey,$u.branches),ju=$u.name,Nu=$u.active,Pu=$u.apis,Hu=$u.extra,zu=$u.state,Gu=Hr(ju,[Pr("config",Lu=Au)]),ho(Lu,Gu,ju,Nu,Pu,Hu,zu)),xa=function(r,n){return e=r,t={},o=N(n,function(n){return e=n.name(),t="Cannot configure "+n.name()+" for "+r,Sr(e,e,Zt(),hr(function(n){return Ht("The field: "+e+" is forbidden. "+t)}));var e,t}).concat([$r("dump",v)]),Gr(e,t,yr(o));var e,t,o},wa=function(n){return n.dump},Sa=function(n,e){return x(x({},n.dump),bo(e))},Oa=xa,Ta=Sa,ka="placeholder",Ea=Ut([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Ca=function(n){return ut(n,"uiType")},Ma=function(n,e,t,r){return Ca(t)&&t.uiType===ka?(i=t,u=r,(o=n).exists(function(n){return n!==i.owner})?Ea.single(!0,y(i)):it(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+Qe(u)+"]\nNamespace: "+o.getOr("none")+"\nSpec: "+JSON.stringify(i,null,2))},function(n){return n.replace()})):Ea.single(!1,y(t));var o,i,u},Da=function(i,u,c,a){return Ma(i,0,c,a).fold(function(n,e){var t=Ca(c)?e(u,c.config,c.validated):e(u),r=it(t,"components").getOr([]),o=W(r,function(n){return Da(i,u,n,a)});return[x(x({},t),{components:o})]},function(n,e){if(Ca(c)){var t=e(u,c.config,c.validated);return c.validated.preprocess.getOr(v)(t)}return e(u)})},_a=function(e,t,n,r){var o,i,u,c=et(r,function(n,e){return r=n,o=!1,{name:y(t=e),required:function(){return r.fold(function(n,e){return n},function(n,e){return n})},used:function(){return o},replace:function(){if(o)throw new Error("Trying to use the same placeholder more than once: "+t);return o=!0,r}};var t,r,o}),a=(o=e,i=t,u=c,W(n,function(n){return Da(o,i,n,u)}));return nt(c,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+e.getOr("none")+"\nComponents: "+JSON.stringify(t.components,null,2))}),a},Ia=Ea.single,Fa=Ea.multiple,Ra=y(ka),Va=0,Ba=function(n){var e=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++Va+String(e)},Aa=Ut([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),ja=Lr("factory",{sketch:v}),Na=Lr("schema",[]),Pa=Br("name"),Ha=Sr("pname","pname",nr(function(n){return"<alloy."+Ba(n.name)+">"}),Rr()),za=$r("schema",function(){return[Nr("preprocess")]}),La=Lr("defaults",y({})),Ga=Lr("overrides",y({})),$a=yr([ja,Na,Pa,Ha,La,Ga]),Ua=yr([ja,Na,Pa,La,Ga]),Wa=yr([ja,Na,Pa,Ha,La,Ga]),Xa=yr([ja,za,Pa,Br("unit"),Ha,La,Ga]),qa=function(n){var e=function(n){return n.name};return n.fold(e,e,e,e)},Ya=function(t,r){return function(n){var e=_r("Converting part type",r,n);return t(e)}},Ka=Ya(Aa.required,$a),Ja=(Ya(Aa.external,Ua),Ya(Aa.optional,Wa)),Qa=Ya(Aa.group,Xa),Za=y("entirety"),nf=function(n,e,t,r){return qt(e.defaults(n,t,r),t,{uid:n.partUids[e.name]},e.overrides(n,t,r))},ef=function(o,n){var e={};return P(n,function(n){n.fold(T.some,T.none,T.some,T.some).each(function(t){var r=tf(o,t.pname);e[t.name]=function(n){var e=_r("Part: "+t.name+" in "+o,yr(t.schema),n);return x(x({},r),{config:n,validated:e})}})}),e},tf=function(n,e){return{uiType:Ra(),owner:n,name:e}},rf=function(n,e,t){return r=e,i={},o={},P(t,function(n){n.fold(function(r){i[r.pname]=Ia(!0,function(n,e,t){return r.factory.sketch(nf(n,r,e,t))})},function(n){var e=r.parts[n.name];o[n.name]=y(n.factory.sketch(nf(r,n,e[Za()]),e))},function(r){i[r.pname]=Ia(!1,function(n,e,t){return r.factory.sketch(nf(n,r,e,t))})},function(o){i[o.pname]=Fa(!0,function(e,n,t){var r=e[o.name];return N(r,function(n){return o.factory.sketch(qt(o.defaults(e,n,t),n,o.overrides(e,n)))})})})}),{internals:y(i),externals:y(o)};var r,i,o},of=function(n,e,t){return _a(T.some(n),e,e.components,t)},uf=function(n,e,t){var r=e.partUids[t];return n.getSystem().getByUid(r).toOptional()},cf=function(n,e,t){return uf(n,e,t).getOrDie("Could not find part: "+t)},af=function(e,n){var t=N(n,qa);return ir(N(t,function(n){return{key:n,value:e+"-"+n}}))},ff=function(e){return Sr("partUids","partUids",er(function(n){return af(n.uid,e)}),Rr())},sf=Ba("alloy-premade"),lf=function(n){return or(sf,n)},df=function(r){return n=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return r.apply(void 0,u([n.getApis(),n],e))},e=r.toString(),t=e.indexOf(")")+1,o=e.indexOf("("),i=e.substring(o+1,t-1).split(/,\s*/),n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:fo(i.slice(1))}},n;var n,e,t,o,i},mf=y("alloy-id-"),gf=y("data-alloy-id"),pf=mf(),hf=gf(),vf=function(n,e){Object.defineProperty(n.dom,hf,{value:e,writable:!0})},yf=function(n){var e=xe(n)?n.dom[hf]:null;return T.from(e)},bf=Ba,xf=function(n,e,t,r,o){var i,u,c=(u=o,(0<(i=r).length?[jr("parts",i)]:[]).concat([Br("uid"),Lr("dom",{}),Lr("components",[]),oi("originalSpec"),Lr("debug.sketcher",{})]).concat(u));return _r(n+" [SpecSchema]",vr(c.concat(e)),t)},wf=function(n,e,t,r,o){var i=Sf(o),u=W(t,function(n){return n.fold(T.none,T.some,T.none,T.none).map(function(n){return jr(n.name,n.schema.concat([oi(Za())]))}).toArray()}),c=ff(t),a=xf(n,e,i,u,[c]),f=rf(0,a,t);return r(a,of(n,a,f.internals()),i,f.externals())},Sf=function(n){return ut(n,"uid")?n:x(x({},n),{uid:bf("uid")})};var Of,Tf,kf,Ef,Cf=vr([Br("name"),Br("factory"),Br("configFields"),Lr("apis",{}),Lr("extraApis",{})]),Mf=vr([Br("name"),Br("factory"),Br("configFields"),Br("partFields"),Lr("apis",{}),Lr("extraApis",{})]),Df=function(n){var i=_r("Sketcher for "+n.name,Cf,n),e=et(i.apis,df),t=et(i.extraApis,so);return x(x({name:i.name,configFields:i.configFields,sketch:function(n){return e=i.name,t=i.configFields,r=i.factory,o=Sf(n),r(xf(e,t,o,[],[]),o);var e,t,r,o}},e),t)},_f=function(n){var e=_r("Sketcher for "+n.name,Mf,n),t=ef(e.name,e.partFields),r=et(e.apis,df),o=et(e.extraApis,so);return x(x({name:e.name,partFields:e.partFields,configFields:e.configFields,sketch:function(n){return wf(e.name,e.configFields,e.partFields,e.factory,n)},parts:t},r),o)},If=Df({name:"Button",factory:function(n){var e,t=(e=n.action,Jr(U([e.map(function(t){return ao(function(n,e){t(n),e.stop()})}).toArray(),ki()]))),r=n.dom.tag,o=function(e){return it(n.dom,"attributes").bind(function(n){return it(n,e)})};return{uid:n.uid,dom:n.dom,components:n.components,events:t,behaviours:Ta(n.buttonBehaviours,[_i.config({}),ba.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==r)return{role:o("role").getOr("button")};var n=o("type").getOr("button"),e=o("role").map(function(n){return{role:n}}).getOr({});return x({type:n},e)}()},eventOrder:n.eventOrder}},configFields:[Lr("uid",undefined),Br("dom"),Lr("components",[]),Oa("buttonBehaviours",[_i,ba]),Nr("action"),Nr("role"),Lr("eventOrder",{})]}),Ff=wo({fields:[],name:"unselecting",active:/* */Object.freeze({__proto__:null,events:function(){return Jr([Qr(Gn(),w)])},exhibit:function(){return lo({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Rf=function(n){var e,t,r,o=de.fromHtml(n),i=Ce(o),u=(t=(e=o).dom.attributes!==undefined?e.dom.attributes:[],L(t,function(n,e){var t;return"class"===e.name?n:x(x({},n),((t={})[e.name]=e.value,t))},{})),c=(r=o,Array.prototype.slice.call(r.dom.classList,0)),a=0===i.length?{}:{innerHtml:jo(o)};return x({tag:ye(o),classes:c,attributes:u},a)},Vf=function(n){var e=cn(n,{prefix:Oi});return Rf(e)},Bf=function(n){return{dom:Vf(n)}},Af=function(n){return bo([bi.config({toggleClass:Ti("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),xi(n,function(n,e){(e?bi.on:bi.off)(n)})])},jf=function(n,e,t,r){var o=Af(t);return Pf(e,r,o,n)},Nf=function(n,e){var t=e.ui.registry.getAll().icons;return T.from(t[n]).fold(function(){return Vf('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item ${prefix}-icon-'+n+' ${prefix}-icon"></span>')},function(n){return Vf('<span class="${prefix}-toolbar-button ${prefix}-toolbar-group-item">'+n+"</span>")})},Pf=function(n,e,t,r){return If.sketch({dom:Nf(n,r),action:e,buttonBehaviours:qt(bo([Ff.config({})]),t)})},Hf=Ja({schema:[Br("dom")],name:"label"}),zf=function(e){return Ja({name:e+"-edge",overrides:function(n){return n.model.manager.edgeActions[e].fold(function(){return{}},function(r){return{events:Jr([no(_n(),function(n,e,t){return r(n,t)},[n]),no(Rn(),function(n,e,t){return r(n,t)},[n]),no(Vn(),function(n,e,t){t.mouseIsDown.get()&&r(n,t)},[n])])}})}})},Lf=zf("top-left"),Gf=zf("top"),$f=zf("top-right"),Uf=zf("right"),Wf=zf("bottom-right"),Xf=zf("bottom"),qf=zf("bottom-left"),Yf=[Hf,zf("left"),Uf,Gf,Xf,Lf,$f,qf,Wf,Ka({name:"thumb",defaults:y({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:Jr([ro(_n(),n,"spectrum"),ro(In(),n,"spectrum"),ro(Fn(),n,"spectrum"),ro(Rn(),n,"spectrum"),ro(Vn(),n,"spectrum"),ro(Bn(),n,"spectrum")])}}}),Ka({schema:[$r("mouseIsDown",function(){return ko(!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:bo([ba.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)}}),_i.config({})]),events:Jr([Zr(_n(),o),Zr(In(),o),Zr(Rn(),o),Zr(Vn(),function(n,e){t.mouseIsDown.get()&&o(n,e)})])}}})],Kf=function(n,e,t){e.store.manager.onLoad(n,e,t)},Jf=function(n,e,t){e.store.manager.onUnload(n,e,t)},Qf=/* */Object.freeze({__proto__:null,onLoad:Kf,onUnload:Jf,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}}),Zf=/* */Object.freeze({__proto__:null,events:function(t,r){var n=t.resetOnDom?[io(function(n,e){Kf(n,t,r)}),uo(function(n,e){Jf(n,t,r)})]:[mo(t,r,Kf)];return Jr(n)}}),ns=function(){var n=ko(null);return yo({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()}}})},es=function(){var i=ko({}),u=ko({});return yo({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return it(i.get(),n).orThunk(function(){return it(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),r={},o={};P(n,function(e){r[e.value]=e,it(e,"meta").each(function(n){it(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({})}})},ts=/* */Object.freeze({__proto__:null,memory:ns,dataset:es,manual:function(){return yo({readState:function(){}})},init:function(n){return n.store.manager.state(n)}}),rs=function(n,e,t,r){var o=e.store;t.update([r]),o.setValue(n,r),e.onSetValue(n,r)},os=[Nr("initialValue"),Br("getFallbackEntry"),Br("getDataKey"),Br("setValue"),ri("manager",{setValue:rs,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){rs(e,t,r,n)})},onUnload:function(n,e,t){t.clear()},state:es})],is=[Br("getValue"),Lr("setValue",O),Nr("initialValue"),ri("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:O,state:vo.init})],us=[Nr("initialValue"),ri("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:ns})],cs=[Gr("store",{mode:"memory"},Fr("mode",{memory:us,manual:is,dataset:os})),Zo("onSetValue"),Lr("resetOnDom",!1)],as=wo({fields:cs,name:"representing",active:Zf,apis:Qf,extra:{setValueFrom:function(n,e){var t=as.getValue(e);as.setValue(n,t)}},state:ts}),fs=Hi("width",function(n){return n.dom.offsetWidth}),ss=function(n,e){return fs.set(n,e)},ls=function(n){return fs.get(n)},ds=function(t,r){return{left:t,top:r,translate:function(n,e){return ds(t+n,r+e)}}},ms=ds,gs=y("slider.change.value"),ps=function(n){var e=n.event.raw;return-1===e.type.indexOf("touch")?e.clientX!==undefined?T.some(e).map(function(n){return ms(n.clientX,n.clientY)}):T.none():e.touches!==undefined&&1===e.touches.length?T.some(e.touches[0]).map(function(n){return ms(n.clientX,n.clientY)}):T.none()},hs=function(n){return n.model.minX},vs=function(n){return n.model.minY},ys=function(n){return n.model.minX-1},bs=function(n){return n.model.minY-1},xs=function(n){return n.model.maxX},ws=function(n){return n.model.maxY},Ss=function(n){return n.model.maxX+1},Os=function(n){return n.model.maxY+1},Ts=function(n,e,t){return e(n)-t(n)},ks=function(n){return Ts(n,xs,hs)},Es=function(n){return Ts(n,ws,vs)},Cs=function(n){return ks(n)/2},Ms=function(n){return Es(n)/2},Ds=function(n){return n.stepSize},_s=function(n){return n.snapToGrid},Is=function(n){return n.snapStart},Fs=function(n){return n.rounded},Rs=function(n,e){return n[e+"-edge"]!==undefined},Vs=function(n){return Rs(n,"left")},Bs=function(n){return Rs(n,"right")},As=function(n){return Rs(n,"top")},js=function(n){return Rs(n,"bottom")},Ns=function(n){return n.model.value.get()},Ps=function(n){return{x:n}},Hs=function(n){return{y:n}},zs=function(n,e){return{x:n,y:e}},Ls=function(n,e){ce(n,gs(),{value:e})},Gs=function(n,e,t,r){return n<e?n:t<n?t:n===e?e-1:Math.max(e,n-r)},$s=function(n,e,t,r){return t<n?n:n<e?e:n===t?t+1:Math.min(t,n+r)},Us=function(n,e,t){return Math.max(e,Math.min(t,n))},Ws=function(n){var e=n.min,t=n.max,r=n.range,o=n.value,i=n.step,u=n.snap,c=n.snapStart,a=n.rounded,f=n.hasMinEdge,s=n.hasMaxEdge,l=n.minBound,d=n.maxBound,m=n.screenRange,g=f?e-1:e,p=s?t+1:t;if(o<l)return g;if(d<o)return p;var h,v,y,b,x,w,S,O=(x=o,w=l,S=d,Math.min(S,Math.max(x,w))-w),T=Us(O/m*r+e,g,p);return u&&e<=T&&T<=t?(h=T,v=e,y=t,b=i,c.fold(function(){var n=h-v,e=Math.round(n/b)*b;return Us(v+e,v-1,y+1)},function(n){var e=(h-n)%b,t=Math.round(e/b),r=Math.floor((h-n)/b),o=Math.floor((y-n)/b),i=n+Math.min(o,r+t)*b;return Math.max(n,i)})):a?Math.round(T):T},Xs=function(n){var e=n.min,t=n.max,r=n.range,o=n.value,i=n.hasMinEdge,u=n.hasMaxEdge,c=n.maxBound,a=n.maxOffset,f=n.centerMinEdge,s=n.centerMaxEdge;return o<e?i?0:f:t<o?u?c:s:(o-e)/r*a},qs="left",Ys=function(n){return n.element.dom.getBoundingClientRect()},Ks=function(n,e){return n[e]},Js=function(n){var e=Ys(n);return Ks(e,qs)},Qs=function(n){var e=Ys(n);return Ks(e,"right")},Zs=function(n){var e=Ys(n);return Ks(e,"top")},nl=function(n){var e=Ys(n);return Ks(e,"bottom")},el=function(n){var e=Ys(n);return Ks(e,"width")},tl=function(n){var e=Ys(n);return Ks(e,"height")},rl=function(n,e,t){return(n+e)/2-t},ol=function(n,e){var t=Ys(n),r=Ys(e),o=Ks(t,qs),i=Ks(t,"right"),u=Ks(r,qs);return rl(o,i,u)},il=function(n,e){var t=Ys(n),r=Ys(e),o=Ks(t,"top"),i=Ks(t,"bottom"),u=Ks(r,"top");return rl(o,i,u)},ul=function(n,e){ce(n,gs(),{value:e})},cl=function(n){return{x:n}},al=function(n,e,t){var r={min:hs(e),max:xs(e),range:ks(e),value:t,step:Ds(e),snap:_s(e),snapStart:Is(e),rounded:Fs(e),hasMinEdge:Vs(e),hasMaxEdge:Bs(e),minBound:Js(n),maxBound:Qs(n),screenRange:el(n)};return Ws(r)},fl=function(i){return function(n,e){return t=n,o=(0<i?$s:Gs)(Ns(r=e).x,hs(r),xs(r),Ds(r)),ul(t,cl(o)),T.some(o).map(function(){return!0});var t,r,o}},sl=function(n,e,t,r,o,i){var u,c,a,f,s,l,d,m,g,p=(c=i,a=t,f=r,s=o,l=el(u=e),d=f.bind(function(n){return T.some(ol(n,u))}).getOr(0),m=s.bind(function(n){return T.some(ol(n,u))}).getOr(l),g={min:hs(c),max:xs(c),range:ks(c),value:a,hasMinEdge:Vs(c),hasMaxEdge:Bs(c),minBound:Js(u),minOffset:0,maxBound:Qs(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m},Xs(g));return Js(e)-Js(n)+p},ll=fl(-1),dl=fl(1),ml=T.none,gl=T.none,pl={"top-left":T.none(),top:T.none(),"top-right":T.none(),right:T.some(function(n,e){Ls(n,Ps(Ss(e)))}),"bottom-right":T.none(),bottom:T.none(),"bottom-left":T.none(),left:T.some(function(n,e){Ls(n,Ps(ys(e)))})},hl=/* */Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var r=al(n,e,t),o=cl(r);return ul(n,o),r},setToMin:function(n,e){var t=hs(e);ul(n,cl(t))},setToMax:function(n,e){var t=xs(e);ul(n,cl(t))},findValueOfOffset:al,getValueFromEvent:function(n){return ps(n).map(function(n){return n.left})},findPositionOfValue:sl,setPositionFromValue:function(n,e,t,r){var o=Ns(t),i=sl(n,r.getSpectrum(n),o.x,r.getLeftEdge(n),r.getRightEdge(n),t),u=ls(e.element)/2;Ri(e.element,"left",i-u+"px")},onLeft:ll,onRight:dl,onUp:ml,onDown:gl,edgeActions:pl}),vl=function(n,e){ce(n,gs(),{value:e})},yl=function(n){return{y:n}},bl=function(n,e,t){var r={min:vs(e),max:ws(e),range:Es(e),value:t,step:Ds(e),snap:_s(e),snapStart:Is(e),rounded:Fs(e),hasMinEdge:As(e),hasMaxEdge:js(e),minBound:Zs(n),maxBound:nl(n),screenRange:tl(n)};return Ws(r)},xl=function(i){return function(n,e){return t=n,o=(0<i?$s:Gs)(Ns(r=e).y,vs(r),ws(r),Ds(r)),vl(t,yl(o)),T.some(o).map(function(){return!0});var t,r,o}},wl=function(n,e,t,r,o,i){var u,c,a,f,s,l,d,m,g,p=(c=i,a=t,f=r,s=o,l=tl(u=e),d=f.bind(function(n){return T.some(il(n,u))}).getOr(0),m=s.bind(function(n){return T.some(il(n,u))}).getOr(l),g={min:vs(c),max:ws(c),range:Es(c),value:a,hasMinEdge:As(c),hasMaxEdge:js(c),minBound:Zs(u),minOffset:0,maxBound:nl(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m},Xs(g));return Zs(e)-Zs(n)+p},Sl=T.none,Ol=T.none,Tl=xl(-1),kl=xl(1),El={"top-left":T.none(),top:T.some(function(n,e){Ls(n,Hs(bs(e)))}),"top-right":T.none(),right:T.none(),"bottom-right":T.none(),bottom:T.some(function(n,e){Ls(n,Hs(Os(e)))}),"bottom-left":T.none(),left:T.none()},Cl=/* */Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var r=bl(n,e,t),o=yl(r);return vl(n,o),r},setToMin:function(n,e){var t=vs(e);vl(n,yl(t))},setToMax:function(n,e){var t=ws(e);vl(n,yl(t))},findValueOfOffset:bl,getValueFromEvent:function(n){return ps(n).map(function(n){return n.top})},findPositionOfValue:wl,setPositionFromValue:function(n,e,t,r){var o=Ns(t),i=wl(n,r.getSpectrum(n),o.y,r.getTopEdge(n),r.getBottomEdge(n),t),u=Li(e.element)/2;Ri(e.element,"top",i-u+"px")},onLeft:Sl,onRight:Ol,onUp:Tl,onDown:kl,edgeActions:El}),Ml=function(n,e){ce(n,gs(),{value:e})},Dl=function(n,e){return{x:n,y:e}},_l=function(a,f){return function(n,e){return r=n,o=e,i=0<a?$s:Gs,u=(t=f)?Ns(o).x:i(Ns(o).x,hs(o),xs(o),Ds(o)),c=t?i(Ns(o).y,vs(o),ws(o),Ds(o)):Ns(o).y,Ml(r,Dl(u,c)),T.some(u).map(function(){return!0});var t,r,o,i,u,c}},Il=ps,Fl=_l(-1,!1),Rl=_l(1,!1),Vl=_l(-1,!0),Bl=_l(1,!0),Al={"top-left":T.some(function(n,e){Ls(n,zs(ys(e),bs(e)))}),top:T.some(function(n,e){Ls(n,zs(Cs(e),bs(e)))}),"top-right":T.some(function(n,e){Ls(n,zs(Ss(e),bs(e)))}),right:T.some(function(n,e){Ls(n,zs(Ss(e),Ms(e)))}),"bottom-right":T.some(function(n,e){Ls(n,zs(Ss(e),Os(e)))}),bottom:T.some(function(n,e){Ls(n,zs(Cs(e),Os(e)))}),"bottom-left":T.some(function(n,e){Ls(n,zs(ys(e),Os(e)))}),left:T.some(function(n,e){Ls(n,zs(ys(e),Ms(e)))})},jl=/* */Object.freeze({__proto__:null,setValueFrom:function(n,e,t){var r=al(n,e,t.left),o=bl(n,e,t.top),i=Dl(r,o);return Ml(n,i),i},setToMin:function(n,e){var t=hs(e),r=vs(e);Ml(n,Dl(t,r))},setToMax:function(n,e){var t=xs(e),r=ws(e);Ml(n,Dl(t,r))},getValueFromEvent:Il,setPositionFromValue:function(n,e,t,r){var o=Ns(t),i=sl(n,r.getSpectrum(n),o.x,r.getLeftEdge(n),r.getRightEdge(n),t),u=wl(n,r.getSpectrum(n),o.y,r.getTopEdge(n),r.getBottomEdge(n),t),c=ls(e.element)/2,a=Li(e.element)/2;Ri(e.element,"left",i-c+"px"),Ri(e.element,"top",u-a+"px")},onLeft:Fl,onRight:Rl,onUp:Vl,onDown:Bl,edgeActions:Al}),Nl=[Lr("stepSize",1),Lr("onChange",O),Lr("onChoose",O),Lr("onInit",O),Lr("onDragStart",O),Lr("onDragEnd",O),Lr("snapToGrid",!1),Lr("rounded",!0),Nr("snapStart"),Ar("model",Fr("mode",{x:[Lr("minX",0),Lr("maxX",100),$r("value",function(n){return ko(n.mode.minX)}),Br("getInitialValue"),ri("manager",hl)],y:[Lr("minY",0),Lr("maxY",100),$r("value",function(n){return ko(n.mode.minY)}),Br("getInitialValue"),ri("manager",Cl)],xy:[Lr("minX",0),Lr("maxX",100),Lr("minY",0),Lr("maxY",100),$r("value",function(n){return ko({x:n.mode.minX,y:n.mode.minY})}),Br("getInitialValue"),ri("manager",jl)]})),xa("sliderBehaviours",[ba,as]),$r("mouseIsDown",function(){return ko(!1)})],Pl=y("mouse.released"),Hl=_f({name:"Slider",configFields:Nl,partFields:Yf,factory:function(i,n,e,t){var r,u=function(n){return cf(n,i,"thumb")},c=function(n){return cf(n,i,"spectrum")},o=function(n){return uf(n,i,"left-edge")},a=function(n){return uf(n,i,"right-edge")},f=function(n){return uf(n,i,"top-edge")},s=function(n){return uf(n,i,"bottom-edge")},l=i.model,d=l.manager,m=function(n,e){d.setPositionFromValue(n,e,i,{getLeftEdge:o,getRightEdge:a,getTopEdge:f,getBottomEdge:s,getSpectrum:c})},g=function(n,e){l.value.set(e);var t=u(n);return m(n,t),i.onChange(n,t,e),T.some(!0)},p=function(t){var n=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&uf(t,i,"thumb").each(function(n){var e=l.value.get();i.onChoose(t,n,e)})},h=function(n,e){e.stop(),i.mouseIsDown.set(!0),i.onDragStart(n,u(n))},v=function(n,e){e.stop(),i.onDragEnd(n,u(n)),p(n)};return{uid:i.uid,dom:i.dom,components:n,behaviours:Sa(i.sliderBehaviours,[ba.config({mode:"special",focusIn:function(n){return uf(n,i,"spectrum").map(ba.focusIn).map(w)}}),as.config({store:{mode:"manual",getValue:function(n){return l.value.get()}}}),ci.config({channels:((r={})[Pl()]={onReceive:p},r)})]),events:Jr([Zr(gs(),function(n,e){g(n,e.event.value)}),io(function(n,e){var t=l.getInitialValue();l.value.set(t);var r=u(n);m(n,r);var o=c(n);i.onInit(n,r,o,l.value.get())}),Zr(_n(),h),Zr(Fn(),v),Zr(Rn(),h),Zr(Bn(),v)]),apis:{resetToMin:function(n){d.setToMin(n,i)},resetToMax:function(n){d.setToMax(n,i)},changeValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),zl=function(e,t,r,n){return Pf(t,function(){var n=r();e.setContextToolbar([{label:t+" group",items:n}])},{},n)},Ll=function(n){return[(o=n,i=function(n){return n<0?"black":360<n?"white":"hsl("+n+", 100%, 50%)"},Hl.sketch({dom:Vf('<div class="${prefix}-slider ${prefix}-hue-slider-container"></div>'),components:[Hl.parts["left-edge"](Bf('<div class="${prefix}-hue-slider-black"></div>')),Hl.parts.spectrum({dom:Vf('<div class="${prefix}-slider-gradient-container"></div>'),components:[Bf('<div class="${prefix}-slider-gradient"></div>')],behaviours:bo([bi.config({toggleClass:Ti("thumb-active")})])}),Hl.parts["right-edge"](Bf('<div class="${prefix}-hue-slider-white"></div>')),Hl.parts.thumb({dom:Vf('<div class="${prefix}-slider-thumb"></div>'),behaviours:bo([bi.config({toggleClass:Ti("thumb-active")})])})],onChange:function(n,e,t){var r=i(t.x());Ri(e.element,"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){bi.on(e)},onDragEnd:function(n,e){bi.off(e)},onInit:function(n,e,t,r){var o=i(r.x());Ri(e.element,"background-color",o)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:o.getInitialValue()}}},sliderBehaviours:bo([wi(Hl.refresh)])}))];var o,i},Gl=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],$l=function(e,n){return(xe(n)?T.some(n):Ee(n).filter(xe)).map(function(n){return Wi(function(n,e){return e(n)},Yi,n,function(n){return ji(n,"font-size").isSome()},e).bind(function(n){return ji(n,"font-size")}).getOrThunk(function(){return Bi(n,"font-size")})}).getOr("")},Ul=function(n){var e=n.selection.getStart(),t=de.fromDom(e),r=de.fromDom(n.getBody()),o=$l(function(n){return ve(r,n)},t);return G(Gl,function(n){return o===n}).getOr("medium")},Wl=function(n){var e,t=Ul(n);return e=t,$(Gl,function(n){return n===e}).getOr(2)},Xl=function(r,n){var e;e=n,T.from(Gl[e]).each(function(n){var e,t;t=n,Ul(e=r)!==t&&e.execCommand("fontSize",!1,t)})},ql=y(Gl),Yl=vr([Br("getInitialValue"),Br("onChange"),Br("category"),Br("sizes")]),Kl=function(n){var i=_r("SizeSlider",Yl,n);return Hl.sketch({dom:{tag:"div",classes:[Ti("slider-"+i.category+"-size-container"),Ti("slider"),Ti("slider-size-container")]},onChange:function(n,e,t){var r,o=t.x();0<=(r=o)&&r<i.sizes.length&&i.onChange(o)},onDragStart:function(n,e){bi.on(e)},onDragEnd:function(n,e){bi.off(e)},model:{mode:"x",minX:0,maxX:i.sizes.length-1,getInitialValue:function(){return{x:i.getInitialValue()}}},stepSize:1,snapToGrid:!0,sliderBehaviours:bo([wi(Hl.refresh)]),components:[Hl.parts.spectrum({dom:Vf('<div class="${prefix}-slider-size-container"></div>'),components:[Bf('<div class="${prefix}-slider-size-line"></div>')]}),Hl.parts.thumb({dom:Vf('<div class="${prefix}-slider-thumb"></div>'),behaviours:bo([bi.config({toggleClass:Ti("thumb-active")})])})]})},Jl=ql(),Ql=function(n){return[Bf('<span class="${prefix}-toolbar-button ${prefix}-icon-small-font ${prefix}-icon"></span>'),Kl({onChange:(e=n).onChange,sizes:Jl,category:"font",getInitialValue:e.getInitialValue}),Bf('<span class="${prefix}-toolbar-button ${prefix}-icon-large-font ${prefix}-icon"></span>')];var e},Zl=function(n){var e=n.uid!==undefined&&ct(n,"uid")?n.uid:bf("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).toOptional()},asSpec:function(){return x(x({},n),{uid:e})}}},nd=window.Promise?window.Promise:(Of=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=[],cd(n,ed(rd,this),ed(od,this))},Tf=window,kf=Of.immediateFn||"function"==typeof Tf.setImmediate&&Tf.setImmediate||function(n){setTimeout(n,1)},Ef=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},Of.prototype["catch"]=function(n){return this.then(null,n)},Of.prototype.then=function(t,r){var o=this;return new Of(function(n,e){td.call(o,new ud(t,r,n,e))})},Of.all=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var a=Array.prototype.slice.call(1===n.length&&Ef(n[0])?n[0]:n);return new Of(function(o,i){if(0===a.length)return o([]);for(var u=a.length,n=0;n<a.length;n++)!function c(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){c(e,n)},i)}a[e]=n,0==--u&&o(a)}catch(r){i(r)}}(n,a[n])})},Of.resolve=function(e){return e&&"object"==typeof e&&e.constructor===Of?e:new Of(function(n){n(e)})},Of.reject=function(t){return new Of(function(n,e){e(t)})},Of.race=function(o){return new Of(function(n,e){for(var t=0,r=o;t<r.length;t++)r[t].then(n,e)})},Of);function ed(n,e){return function(){return n.apply(e,arguments)}}function td(r){var o=this;null!==this._state?kf(function(){var n,e=o._state?r.onFulfilled:r.onRejected;if(null!==e){try{n=e(o._value)}catch(t){return void r.reject(t)}r.resolve(n)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function rd(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void cd(ed(e,n),ed(rd,this),ed(od,this))}this._state=!0,this._value=n,id.call(this)}catch(t){od.call(this,t)}}function od(n){this._state=!1,this._value=n,id.call(this)}function id(){for(var n=0,e=this._deferreds;n<e.length;n++){var t=e[n];td.call(this,t)}this._deferreds=[]}function ud(n,e,t,r){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.resolve=t,this.reject=r}function cd(n,e,t){var r=!1;try{n(function(n){r||(r=!0,e(n))},function(n){r||(r=!0,t(n))})}catch(o){if(r)return;r=!0,t(o)}}function ad(n){return t=n,new nd(function(n){var e=new FileReader;e.onloadend=function(){n(e.result)},e.readAsDataURL(t)}).then(function(n){return n.split(",")[1]});var t}var fd=ad,sd=function(u){var e=Zl({dom:{tag:"input",attributes:{accept:"image/*",type:"file",title:""},styles:{visibility:"hidden",position:"absolute"}},events:Jr([oo(zn()),Zr(Hn(),function(n,e){var t,r;t=e.event.raw,r=t.target.files||t.dataTransfer.files,T.from(r[0]).each(function(n){var o,i;o=u,fd(i=n).then(function(r){o.undoManager.transact(function(){var n=o.editorUpload.blobCache,e=n.create(Ba("mceu"),i,r);n.add(e);var t=o.dom.createHTML("img",{src:e.blobUri()});o.insertContent(t)})})})})])});return If.sketch({dom:Nf("image",u),components:[e.asSpec()],action:function(n){e.get(n).element.dom.click()}})},ld=function(n){return n.dom.textContent},dd=function(n){return 0<n.length},md=function(n){return n===undefined||null===n?"":n},gd=function(n){return vd(n).fold(function(){return{url:"",text:n.selection.getContent({format:"text"}),title:"",target:"",link:T.none()}},function(n){return t=ld(e=n),r=lt(e,"href"),o=lt(e,"title"),i=lt(e,"target"),{url:md(r),text:t!==r?md(t):"",title:md(o),target:md(i),link:T.some(e)};var e,t,r,o,i})},pd=function(e,t,n){return n.text.toOptional().filter(dd).fold(function(){return lt(n=e,"href")===ld(n)?T.some(t):T.none();var n},T.some)},hd=function(o,i){i.url.toOptional().filter(dd).fold(function(){var e;e=o,i.link.bind(v).each(function(n){e.execCommand("unlink")})},function(e){var n,t,r=(n=i,(t={}).href=e,n.title.toOptional().filter(dd).each(function(n){t.title=n}),n.target.toOptional().filter(dd).each(function(n){t.target=n}),t);i.link.bind(v).fold(function(){var n=i.text.toOptional().filter(dd).getOr(e);o.insertContent(o.dom.createHTML("a",r,o.dom.encode(n)))},function(t){var n=pd(t,e,i);st(t,r),n.each(function(n){var e;e=n,t.dom.textContent=e})})})},vd=function(n){var e=de.fromDom(n.selection.getStart());return Zi(e,"a")},yd=Mn(),bd=function(n,e){var t=e.selection.getRng();n(),e.selection.setRng(t)},xd=function(n,e){var t,r;return{key:n,value:{config:{},me:(t=n,r=Jr(e),wo({fields:[Br("enabled")],name:t,active:{events:y(r)}})),configAsRaw:y({}),initialConfig:{},state:vo}}},wd=/* */Object.freeze({__proto__:null,getCurrent:function(n,e,t){return e.find(n)}}),Sd=[Br("find")],Od=wo({fields:Sd,name:"composing",apis:wd}),Td=Df({name:"Container",factory:function(n){var e=n.dom,t=e.attributes,r=c(e,["attributes"]);return{uid:n.uid,dom:x({tag:"div",attributes:x({role:"presentation"},t)},r),components:n.components,behaviours:wa(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[Lr("components",[]),xa("containerBehaviours",[]),Lr("events",{}),Lr("domModification",{}),Lr("eventOrder",{})]}),kd=Df({name:"DataField",factory:function(t){return{uid:t.uid,dom:t.dom,behaviours:Ta(t.dataBehaviours,[as.config({store:{mode:"memory",initialValue:t.getInitialValue()}}),Od.config({find:T.some})]),events:Jr([io(function(n,e){as.setValue(n,t.getInitialValue())})])}},configFields:[Br("uid"),Br("dom"),Br("getInitialValue"),Oa("dataBehaviours",[as,Od])]}),Ed=function(n){return n.dom.value},Cd=function(n,e){if(e===undefined)throw new Error("Value.set was undefined");n.dom.value=e},Md=y([Nr("data"),Lr("inputAttributes",{}),Lr("inputStyles",{}),Lr("tag","input"),Lr("inputClasses",[]),Zo("onSetValue"),Lr("styles",{}),Lr("eventOrder",{}),xa("inputBehaviours",[as,_i]),Lr("selectOnFocus",!0)]),Dd=function(n){return x(x({},(e=n,bo([_i.config({onFocus:e.selectOnFocus?function(n){var e=n.element,t=Ed(e);e.dom.setSelectionRange(0,t.length)}:O})]))),Sa(n.inputBehaviours,[as.config({store:x(x({mode:"manual"},n.data.map(function(n){return{initialValue:n}}).getOr({})),{getValue:function(n){return Ed(n.element)},setValue:function(n,e){Ed(n.element)!==e&&Cd(n.element,e)}}),onSetValue:n.onSetValue})]));var e},_d=Df({name:"Input",configFields:Md(),factory:function(n,e){return{uid:n.uid,dom:{tag:(t=n).tag,attributes:x({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses},components:[],behaviours:Dd(n),eventOrder:n.eventOrder};var t}}),Id=/* */Object.freeze({__proto__:null,exhibit:function(n,e){return lo({attributes:ir([{key:e.tabAttr,value:"true"}])})}}),Fd=[Lr("tabAttr","data-alloy-tabstop")],Rd=wo({fields:Fd,name:"tabstopping",active:Id}),Vd=tinymce.util.Tools.resolve("tinymce.util.I18n"),Bd=function(n,e){var t=Zl(_d.sketch({inputAttributes:{placeholder:Vd.translate(e)},onSetValue:function(n,e){ue(n,Pn())},inputBehaviours:bo([Od.config({find:T.some}),Rd.config({}),ba.config({mode:"execution"})]),selectOnFocus:!1})),r=Zl(If.sketch({dom:Vf('<button class="${prefix}-input-container-x ${prefix}-icon-cancel-circle ${prefix}-icon"></button>'),action:function(n){var e=t.get(n);as.setValue(e,"")}}));return{name:n,spec:Td.sketch({dom:Vf('<div class="${prefix}-input-container"></div>'),components:[t.asSpec(),r.asSpec()],containerBehaviours:bo([bi.config({toggleClass:Ti("input-container-empty")}),Od.config({find:function(n){return T.some(t.get(n))}}),xd("input-clearing",[Zr(Pn(),function(n){var e=t.get(n);(0<as.getValue(e).length?bi.off:bi.on)(n)})])])})}},Ad=["input","button","textarea","select"],jd=function(n,e,t){(e.disabled()?Gd:$d)(n,e)},Nd=function(n,e){return!0===e.useNative&&A(Ad,ye(n.element))},Pd=function(n){ft(n.element,"disabled","disabled")},Hd=function(n){gt(n.element,"disabled")},zd=function(n){ft(n.element,"aria-disabled","true")},Ld=function(n){ft(n.element,"aria-disabled","false")},Gd=function(e,n,t){n.disableClass.each(function(n){bt(e.element,n)}),(Nd(e,n)?Pd:zd)(e),n.onDisabled(e)},$d=function(e,n,t){n.disableClass.each(function(n){wt(e.element,n)}),(Nd(e,n)?Hd:Ld)(e),n.onEnabled(e)},Ud=function(n,e){return Nd(n,e)?mt(n.element,"disabled"):"true"===lt(n.element,"aria-disabled")},Wd=/* */Object.freeze({__proto__:null,enable:$d,disable:Gd,isDisabled:Ud,onLoad:jd,set:function(n,e,t,r){(r?Gd:$d)(n,e)}}),Xd=/* */Object.freeze({__proto__:null,exhibit:function(n,e){return lo({classes:e.disabled()?e.disableClass.toArray():[]})},events:function(t,n){return Jr([Qr(Kn(),function(n,e){return Ud(n,t)}),mo(t,n,jd)])}}),qd=[Gr("disabled",l,Vr),Lr("useNative",!0),Nr("disableClass"),Zo("onDisabled"),Zo("onEnabled")],Yd=wo({fields:qd,name:"disabling",active:Xd,apis:Wd}),Kd=[xa("formBehaviours",[as])],Jd=function(n){return"<alloy.field."+n+">"},Qd=function(o,n){return{uid:o.uid,dom:o.dom,components:n,behaviours:Sa(o.formBehaviours,[as.config({store:{mode:"manual",getValue:function(n){var e,t,r=(e=o,t=n.getSystem(),et(e.partUids,function(n,e){return y(t.getByUid(n))}));return et(r,function(n,o){return n().bind(function(n){var e,t,r=Od.getCurrent(n);return e=r,t=new Error("Cannot find a current component to extract the value from for form part '"+o+"': "+Ho(n.element)),e.fold(function(){return Ct.error(t)},Ct.value)}).map(as.getValue)})},setValue:function(t,n){nt(n,function(e,n){uf(t,o,n).each(function(n){Od.getCurrent(n).each(function(n){as.setValue(n,e)})})})}}})]),apis:{getField:function(n,e){return uf(n,o,e).bind(Od.getCurrent)}}}},Zd=(df(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=Jd(n),o=e,{uiType:Ra(),owner:t,name:r,config:o,validated:{}};var t,r,o},record:function(){return i}}),t=n(e),r=e.record(),o=N(r,function(n){return Ka({name:n,pname:Jd(n)})});return wf("form",Kd,o,Qd,t)}),nm=function(){var e=ko(T.none()),t=function(){return e.get().each(function(n){return n.destroy()})};return{clear:function(){t(),e.set(T.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(T.some(n))},run:function(n){return e.get().each(n)}}},em=function(){var e=ko(T.none());return{clear:function(){return e.set(T.none())},set:function(n){return e.set(T.some(n))},isSet:function(){return e.get().isSome()},on:function(n){return e.get().each(n)}}},tm=function(n){var r="navigateEvent",e=yr([Br("fields"),Lr("maxFieldIndex",n.fields.length-1),Br("onExecute"),Br("getInitialValue"),$r("state",function(){return{dialogSwipeState:em(),currentScreen:ko(0)}})]),u=_r("SerialisedDialog",e,n),o=function(e,n,t){return If.sketch({dom:Vf('<span class="${prefix}-icon-'+n+' ${prefix}-icon"></span>'),action:function(n){ce(n,r,{direction:e})},buttonBehaviours:bo([Yd.config({disableClass:Ti("toolbar-navigation-disabled"),disabled:function(){return!t}})])})},i=function(n,o){var i=Ui(n.element,"."+Ti("serialised-dialog-screen"));Qi(n.element,"."+Ti("serialised-dialog-chain")).each(function(r){0<=u.state.currentScreen.get()+o&&u.state.currentScreen.get()+o<i.length&&(ji(r,"left").each(function(n){var e=parseInt(n,10),t=ls(i[0]);Ri(r,"left",e-o*t+"px")}),u.state.currentScreen.set(u.state.currentScreen.get()+o))})},c=function(r){var n=Ui(r.element,"input");T.from(n[u.state.currentScreen.get()]).each(function(n){r.getSystem().getByDom(n).each(function(n){var e,t;e=r,t=n.element,e.getSystem().triggerFocus(t,e.element)})});var e=f.get(r);Fu.highlightAt(e,u.state.currentScreen.get())},a=Zl(Zd(function(t){return{dom:Vf('<div class="${prefix}-serialised-dialog"></div>'),components:[Td.sketch({dom:Vf('<div class="${prefix}-serialised-dialog-chain" style="left: 0px; position: absolute;"></div>'),components:N(u.fields,function(n,e){return e<=u.maxFieldIndex?Td.sketch({dom:Vf('<div class="${prefix}-serialised-dialog-screen"></div>'),components:[o(-1,"previous",0<e),t.field(n.name,n.spec),o(1,"next",e<u.maxFieldIndex)]}):t.field(n.name,n.spec)})})],formBehaviours:bo([wi(function(n,e){var t;t=e,Qi(n.element,"."+Ti("serialised-dialog-chain")).each(function(n){Ri(n,"left",-u.state.currentScreen.get()*t.width+"px")})}),ba.config({mode:"special",focusIn:function(n,e){c(n)},onTab:function(n,e){return i(n,1),T.some(!0)},onShiftTab:function(n,e){return i(n,-1),T.some(!0)}}),xd("form-events",[io(function(e,n){u.state.currentScreen.set(0),u.state.dialogSwipeState.clear();var t=f.get(e);Fu.highlightFirst(t),u.getInitialValue(e).each(function(n){as.setValue(e,n)})}),ao(u.onExecute),Zr(Ln(),function(n,e){"left"===e.event.raw.propertyName&&c(n)}),Zr(r,function(n,e){var t=e.event.direction;i(n,t)})])])}})),f=Zl({dom:Vf('<div class="${prefix}-dot-container"></div>'),behaviours:bo([Fu.config({highlightClass:Ti("dot-active"),itemClass:Ti("dot-item")})]),components:W(u.fields,function(n,e){return e<=u.maxFieldIndex?[Bf('<div class="${prefix}-dot-item ${prefix}-icon-full-dot ${prefix}-icon"></div>')]:[]})});return{dom:Vf('<div class="${prefix}-serializer-wrapper"></div>'),components:[a.asSpec(),f.asSpec()],behaviours:bo([ba.config({mode:"special",focusIn:function(n){var e=a.get(n);ba.focusIn(e)}}),xd("serializer-wrapper-events",[Zr(_n(),function(n,e){var t=e.event;u.state.dialogSwipeState.set({xValue:t.raw.touches[0].clientX,points:[]})}),Zr(In(),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<e-n.xValue?1:-1,r={direction:t,xValue:e};return{xValue:e,points:(0===n.points.length?[]:n.points[n.points.length-1].direction===t?n.points.slice(0,n.points.length-1):n.points).concat([r])}}(n,t.raw.touches[0].clientX))})}),Zr(Fn(),function(r,n){u.state.dialogSwipeState.on(function(n){var e=a.get(r),t=-1*function(n){if(0===n.points.length)return 0;var e=n.points[0].direction,t=n.points[n.points.length-1].direction;return-1===e&&-1===t?-1:1===e&&1===t?1:0}(n);i(e,t)})})])])}},rm=d(function(r,o){return[{label:"the link group",items:[tm({fields:[Bd("url","Type or paste URL"),Bd("text","Link text"),Bd("title","Link title"),Bd("target","Link target"),{name:"link",spec:kd.sketch({dom:{tag:"span",styles:{display:"none"}},getInitialValue:function(){return T.none()}})}],maxFieldIndex:["url","text","title","target"].length-1,getInitialValue:function(){return T.some(gd(o))},onExecute:function(n,e){var t=as.getValue(n);hd(o,t),r.restoreToolbar(),o.focus()}})]}]}),om=function(r,o){return jf(o,"link","link",function(){var n,e,t=rm(r,o);r.setContextToolbar(t),n=o,e=function(){r.focusToolbar()},(yd.os.isAndroid()?bd:s)(e,n),vd(o).each(function(n){o.selection.select(n.dom)})})},im=Jr([{key:Wn(),value:Yr({can:function(n,e){var t,r,o=e.event,i=o.originator,u=o.target;return r=u,!(ve(t=i,n.element)&&!ve(t,r))||(console.warn(Wn()+" did not get interpreted by the desired target. \nOriginator: "+Ho(i)+"\nTarget: "+Ho(u)+"\nCheck the "+Wn()+" event handlers"),!1)}})}]),um=/* */Object.freeze({__proto__:null,events:im}),cm=v,am=function(e){var n=function(n){return function(){throw new Error("The component must be in a context to send: "+n+(e?"\n"+Ho(e().element)+" is not in context.":""))}};return{debugInfo:y("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),isConnected:l}},fm=am(),sm=function(n,o){var i={};return nt(n,function(n,r){nt(n,function(n,e){var t=it(i,e).getOr([]);i[e]=t.concat([o(r,n)])})}),i},lm=function(u,c,n,a){try{var e=(t=n,r=function(n,e){var t=n[c],r=e[c],o=a.indexOf(t),i=a.indexOf(r);if(-1===o)throw new Error("The ordering for "+u+" does not have an entry for "+t+".\nOrder specified: "+JSON.stringify(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+r+".\nOrder specified: "+JSON.stringify(a,null,2));return o<i?-1:i<o?1:0},(o=R.call(t,0)).sort(r),o);return Ct.value(e)}catch(i){return Ct.error([i])}var t,r,o},dm=function(n,e){return{cHandler:b.apply(undefined,[n.handler].concat(e)),purpose:n.purpose}},mm=function(n){return n.cHandler},gm=function(n,e){return{name:n,handler:e}},pm=function(n,e,t){var r,o,i=x(x({},t),(r=n,o={},P(e,function(n){o[n.name()]=n.handlers(r)}),o));return sm(i,gm)},hm=function(n){var e,i=I(e=n)?{can:y(!0),abort:y(!1),run:e}:e;return function(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var o=[n,e].concat(t);i.abort.apply(undefined,o)?e.stop():i.can.apply(undefined,o)&&i.run.apply(undefined,o)}},vm=function(n,e,t){var r,o,i=e[t];return i?lm("Event: "+t,"name",n,i).map(function(n){var e=N(n,function(n){return n.handler});return Kr(e)}):(r=t,o=n,Ct.error(["The event ("+r+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(N(o,function(n){return n.name}),null,2)]))},ym=function(n,i){var e=ot(n,function(r,o){return(1===r.length?Ct.value(r[0].handler):vm(r,i,o)).map(function(n){var e=hm(n),t=1<r.length?H(i[o],function(e){return j(r,function(n){return n.name===e})}).join(" > "):r[0].name;return or(o,{handler:e,purpose:t})})});return ur(e,{})},bm="alloy.base.behaviour",xm=function(n){var e,t;return Mr("custom.definition",yr([Sr("dom","dom",Qt(),yr([Br("tag"),Lr("styles",{}),Lr("classes",[]),Lr("attributes",{}),Nr("value"),Nr("innerHtml")])),Br("components"),Br("uid"),Lr("events",{}),Lr("apis",{}),Sr("eventOrder","eventOrder",((e={})[Kn()]=["disabling",bm,"toggling","typeaheadevents"],e[Wn()]=[bm,"focusing","keying"],e[ne()]=[bm,"disabling","toggling","representing"],e[Pn()]=[bm,"representing","streaming","invalidating"],e[te()]=[bm,"representing","item-events","tooltipping"],e[Rn()]=["focusing",bm,"item-type-events"],e[_n()]=["focusing",bm,"item-type-events"],e[An()]=["item-type-events","tooltipping"],e[Yn()]=["receiving","reflecting","tooltipping"],t=e,Kt.mergeWithThunk(y(t))),Rr()),Nr("domModification")]),n)},wm=function(e,n){P(n,function(n){bt(e,n)})},Sm=function(e,n){P(n,function(n){wt(e,n)})},Om=function(n,e){return t=n,o=N(r=e,function(n){return Hr(n.name(),[Br("config"),Lr("state",vo)])}),i=Mr("component.behaviours",yr(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:et(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},Tm=function(n){var e,t,r=(e=it(n,"behaviours").getOr({}),t=H(Qe(e),function(n){return e[n]!==undefined}),N(t,function(n){return e[n].me}));return Om(n,r)},km=function(n,e,t){var r,o,i,u=x(x({},(r=n).dom),{uid:r.uid,domChildren:N(r.components,function(n){return n.element})}),c=n.domModification.fold(function(){return lo({})},lo),a={"alloy.base.modification":c},f=0<e.length?function(e,n,t,r){var o=x({},n);P(t,function(n){o[n.name()]=n.exhibit(e,r)});var i=sm(o,function(n,e){return{name:n,modification:e}}),u=function(n){return z(n,function(n,e){return x(x({},e.modification),n)},{})},c=z(i.classes,function(n,e){return e.modification.concat(n)},[]),a=u(i.attributes),f=u(i.styles);return lo({classes:c,attributes:a,styles:f})}(t,a,e,u):c;return i=f,x(x({},o=u),{attributes:x(x({},o.attributes),i.attributes),styles:x(x({},o.styles),i.styles),classes:o.classes.concat(i.classes)})},Em=function(n,e,t){var r,o,i,u={"alloy.base.behaviour":n.events};return r=t,o=n.eventOrder,i=pm(r,e,u),ym(i,o).getOrDie()},Cm=function(t){var n=function(){return s},r=ko(fm),e=Dr(xm(t)),o=Tm(t),i=o.list,u=o.data,c=function(n){var e=de.fromTag(n.tag);st(e,n.attributes),wm(e,n.classes),Vi(e,n.styles),n.innerHtml.each(function(n){return No(e,n)});var t=n.domChildren;return Re(e,t),n.value.each(function(n){Cd(e,n)}),n.uid,vf(e,n.uid),e}(km(e,i,u)),a=Em(e,i,u),f=ko(e.components),s={getSystem:r.get,config:function(n){var e=u;return(I(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(n){return I(u[n.name()])},spec:t,readState:function(n){return u[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},getApis:function(){return e.apis},connect:function(n){r.set(n)},disconnect:function(){r.set(am(n))},element:c,syncComponents:function(){var n=Ce(c),e=W(n,function(n){return r.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});f.set(e)},components:f.get,events:a};return s},Mm=function(n){var e,t=cm(n),r=t.events,o=c(t,["events"]),i=(e=it(o,"components").getOr([]),N(e,Fm)),u=x(x({},o),{events:x(x({},um),r),components:i});return Ct.value(Cm(u))},Dm=function(n){var e=de.fromText(n);return _m({element:e})},_m=function(n){var e=_r("external.component",vr([Br("element"),Nr("uid")]),n),t=ko(am());e.uid.each(function(n){vf(e.element,n)});var r={getSystem:t.get,config:T.none,hasConfigured:l,connect:function(n){t.set(n)},disconnect:function(){t.set(am(function(){return r}))},getApis:function(){return{}},element:e.element,spec:n,readState:y("No state"),syncComponents:O,components:y([]),events:{}};return lf(r)},Im=bf,Fm=function(e){return it(e,sf).fold(function(){var n=e.hasOwnProperty("uid")?e:x({uid:Im("")},e);return Mm(n).getOrDie()},function(n){return n})},Rm=lf,Vm="alloy.item-hover",Bm="alloy.item-focus",Am=function(n){(Do(n.element).isNone()||_i.isFocused(n))&&(_i.isFocused(n)||_i.focus(n),ce(n,Vm,{item:n}))},jm=function(n){ce(n,Bm,{item:n})},Nm=y(Vm),Pm=y(Bm),Hm=[Br("data"),Br("components"),Br("dom"),Lr("hasSubmenu",!1),Nr("toggling"),Oa("itemBehaviours",[bi,_i,ba,as]),Lr("ignoreFocus",!1),Lr("domModification",{}),ri("builder",function(n){return{dom:n.dom,domModification:x(x({},n.domModification),{attributes:x(x(x({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes),{"aria-haspopup":n.hasSubmenu}),n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Ta(n.itemBehaviours,[n.toggling.fold(bi.revoke,function(n){return bi.config(x({aria:{mode:"checked"}},n))}),_i.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){jm(n)}}),ba.config({mode:"execution"}),as.config({store:{mode:"memory",initialValue:n.data}}),xd("item-type-events",u(ki(),[Zr(An(),Am),Zr(Jn(),_i.focus)]))]),components:n.components,eventOrder:n.eventOrder}}),Lr("eventOrder",{})],zm=[Br("dom"),Br("components"),ri("builder",function(n){return{dom:n.dom,components:n.components,events:Jr([(e=Jn(),Zr(e,function(n,e){e.stop()}))])};var e})],Lm=function(){return"item-widget"},Gm=y([Ka({name:"widget",overrides:function(e){return{behaviours:bo([as.config({store:{mode:"manual",getValue:function(n){return e.data},setValue:function(){}}})])}}})]),$m=[Br("uid"),Br("data"),Br("components"),Br("dom"),Lr("autofocus",!1),Lr("ignoreFocus",!1),Oa("widgetBehaviours",[as,_i,ba]),Lr("domModification",{}),ff(Gm()),ri("builder",function(t){var n=rf(Lm(),t,Gm()),e=of(Lm(),t,n.internals()),r=function(n){return uf(n,t,"widget").map(function(n){return ba.focusIn(n),n})},o=function(n,e){return Yu(e.event.target)||t.autofocus&&e.setSource(n.element),T.none()};return{dom:t.dom,components:e,domModification:t.domModification,events:Jr([ao(function(n,e){r(n).each(function(n){e.stop()})}),Zr(An(),Am),Zr(Jn(),function(n,e){t.autofocus?r(n):_i.focus(n)})]),behaviours:Ta(t.widgetBehaviours,[as.config({store:{mode:"memory",initialValue:t.data}}),_i.config({ignore:t.ignoreFocus,onFocus:function(n){jm(n)}}),ba.config({mode:"special",focusIn:t.autofocus?function(n){r(n)}:Oo(),onLeft:o,onRight:o,onEscape:function(n,e){return _i.isFocused(n)||t.autofocus?(t.autofocus&&e.setSource(n.element),T.none()):(_i.focus(n),T.some(!0))}})])}})],Um=Fr("type",{widget:$m,item:Hm,separator:zm}),Wm=y([Qa({factory:{sketch:function(n){var e=_r("menu.spec item",Um,n);return e.builder(e)}},name:"items",unit:"item",defaults:function(n,e){return e.hasOwnProperty("uid")?e:x(x({},e),{uid:bf("item")})},overrides:function(n,e){return{type:e.type,ignoreFocus:n.fakeFocus,domModification:{classes:[n.markers.item]}}}})]),Xm=y([Br("value"),Br("items"),Br("dom"),Br("components"),Lr("eventOrder",{}),xa("menuBehaviours",[Fu,as,Od,ba]),Gr("movement",{mode:"menu",moveOnTab:!0},Fr("mode",{grid:[ii(),ri("config",function(n,e){return{mode:"flatgrid",selector:"."+n.markers.item,initSize:{numColumns:e.initSize.numColumns,numRows:e.initSize.numRows},focusManager:n.focusManager}})],matrix:[ri("config",function(n,e){return{mode:"matrix",selectors:{row:e.rowSelector,cell:"."+n.markers.item},focusManager:n.focusManager}}),Br("rowSelector")],menu:[Lr("moveOnTab",!0),ri("config",function(n,e){return{mode:"menu",selector:"."+n.markers.item,moveOnTab:e.moveOnTab,focusManager:n.focusManager}})]})),Ar("markers",Ko()),Lr("fakeFocus",!1),Lr("focusManager",Vu()),Zo("onHighlight")]),qm=y("alloy.menu-focus"),Ym=_f({name:"Menu",configFields:Xm(),partFields:Wm(),factory:function(n,e,t,r){return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:Sa(n.menuBehaviours,[Fu.config({highlightClass:n.markers.selectedItem,itemClass:n.markers.item,onHighlight:n.onHighlight}),as.config({store:{mode:"memory",initialValue:n.value}}),Od.config({find:T.some}),ba.config(n.movement.config(n,n.movement))]),events:Jr([Zr(Pm(),function(e,t){var n=t.event;e.getSystem().getByDom(n.target).each(function(n){Fu.highlight(e,n),t.stop(),ce(e,qm(),{menu:e,item:n})})}),Zr(Nm(),function(n,e){var t=e.event.item;Fu.highlight(n,t)})]),components:e,eventOrder:n.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Km=function(n,t){var r=Ne(t),e=Mo(r).bind(function(e){var o,i,n=function(n){return ve(e,n)};return n(t)?T.some(t):(o=n,(i=function(n){for(var e=0;e<n.childNodes.length;e++){var t=de.fromDom(n.childNodes[e]);if(o(t))return T.some(t);var r=i(n.childNodes[e]);if(r.isSome())return r}return T.none()})(t.dom))}),o=n(t);return e.each(function(e){Mo(r).filter(function(n){return ve(n,e)}).fold(function(){Eo(e)},O)}),o},Jm=function(n,e,t,r){var o=n.getSystem().build(r);Ye(n,o,t)},Qm=function(n,e,t,r){var o=Zm(n);G(o,function(n){return ve(r.element,n.element)}).each(Ke)},Zm=function(n,e){return n.components()},ng=function(e,n,t,o,r){var i=Zm(e);return T.from(i[o]).map(function(n){return Qm(e,0,0,n),r.each(function(n){Jm(e,0,function(n,e){var t,r;r=e,Me(t=n,o).fold(function(){Fe(t,r)},function(n){De(n,r)})},n)}),n})},eg=wo({fields:[],name:"replacing",apis:/* */Object.freeze({__proto__:null,append:function(n,e,t,r){Jm(n,0,Fe,r)},prepend:function(n,e,t,r){Jm(n,0,Ie,r)},remove:Qm,replaceAt:ng,replaceBy:function(e,n,t,r,o){var i=Zm(e);return $(i,r).bind(function(n){return ng(e,0,0,n,o)})},set:function(e,n,t,r){Km(function(){var n=N(r,e.getSystem().build);qe(e,n)},e.element)},contents:Zm})}),tg=function(t,r,o,n){return it(o,n).bind(function(n){return it(t,n).bind(function(n){var e=tg(t,r,o,n);return T.some([n].concat(e))})}).getOr([])},rg=function(n,e){var t={};nt(n,function(n,e){P(n,function(n){t[n]=e})});var r=e,o=tt(e,function(n,e){return{k:n,v:e}}),i=et(o,function(n,e){return[e].concat(tg(t,r,o,e))});return et(t,function(n){return it(i,n).getOr([n])})},og=function(n){return"prepared"===n.type?T.some(n.menu):T.none()},ig={init:function(){var i=ko({}),u=ko({}),c=ko({}),a=ko(T.none()),f=ko({}),s=function(t){return function(n,e){for(var t=Qe(n),r=0,o=t.length;r<o;r++){var i=t[r],u=n[i];if(e(u,i,n))return T.some(u)}return T.none()}(i.get(),function(n,e){return n===t})},l=function(n){return e(n).bind(og)},e=function(n){return it(u.get(),n)},t=function(n){return it(i.get(),n)};return{setMenuBuilt:function(n,e){var t;u.set(x(x({},u.get()),((t={})[n]={type:"prepared",menu:e},t)))},setContents:function(n,e,t,r){a.set(T.some(n)),i.set(t),u.set(e),f.set(r);var o=rg(r,t);c.set(o)},expand:function(t){return it(i.get(),t).map(function(n){var e=it(c.get(),t).getOr([]);return[n].concat(e)})},refresh:function(n){return it(c.get(),n)},collapse:function(n){return it(c.get(),n).bind(function(n){return 1<n.length?T.some(n.slice(1)):T.none()})},lookupMenu:e,lookupItem:t,otherMenus:function(n){var e=f.get();return Y(Qe(e),n)},getPrimary:function(){return a.get().bind(l)},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),c.set({}),a.set(T.none())},isClear:function(){return a.get().isNone()},getTriggeringPath:function(n,u){var e=H(t(n).toArray(),function(n){return l(n).isSome()});return it(c.get(),n).bind(function(n){var i=q(e.concat(n));return function(n){for(var e=[],t=0;t<n.length;t++){var r=n[t];if(!r.isSome())return T.none();e.push(r.getOrDie())}return T.some(e)}(W(i,function(n,e){return t=n,r=u,o=i.slice(0,e+1),l(t).bind(function(e){return s(t).bind(function(n){return r(n).map(function(n){return{triggeredMenu:e,triggeringItem:n,triggeringPath:o}})})}).fold(function(){return a.get().is(n)?[]:[T.none()]},function(n){return[T.some(n)]});var t,r,o}))})}}},extractPreparedMenu:og},ug=y("collapse-item"),cg=Df({name:"TieredMenu",configFields:[ti("onExecute"),ti("onEscape"),ei("onOpenMenu"),ei("onOpenSubmenu"),Zo("onRepositionMenu"),Zo("onCollapseMenu"),Lr("highlightImmediately",!0),jr("data",[Br("primary"),Br("menus"),Br("expansions")]),Lr("fakeFocus",!1),Zo("onHighlight"),Zo("onHover"),jr("markers",[Br("backgroundMenu")].concat(qo()).concat(Yo())),Br("dom"),Lr("navigateOnHover",!0),Lr("stayInDom",!1),xa("tmenuBehaviours",[ba,Fu,Od,eg]),Lr("eventOrder",{})],apis:{collapseMenu:function(n,e){n.collapseMenu(e)},highlightPrimary:function(n,e){n.highlightPrimary(e)},repositionMenus:function(n,e){n.repositionMenus(e)}},factory:function(c,n){var a,e,i=ko(T.none()),o=function(r,o,n){return et(n,function(n,e){var t=function(){return Ym.sketch(x(x({},n),{value:e,markers:c.markers,fakeFocus:c.fakeFocus,onHighlight:c.onHighlight,focusManager:c.fakeFocus?{get:o=function(n){return Fu.getHighlighted(n).map(function(n){return n.element})},set:function(e,n){var t=o(e);e.getSystem().getByDom(n).fold(O,function(n){Fu.highlight(e,n)});var r=o(e);Ru(e,t,r)}}:Vu()}));var o};return e===o?{type:"prepared",menu:r.getSystem().build(t())}:{type:"notbuilt",nbMenu:t}})},f=ig.init(),s=function(n){return as.getValue(n).value},u=function(n){return et(c.data.menus,function(n,e){return W(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})},l=function(e,n){Fu.highlight(e,n),Fu.getHighlighted(n).orThunk(function(){return Fu.getFirst(n)}).each(function(n){fe(e,n.element,Jn())})},d=function(e,n){return wu(N(n,function(n){return e.lookupMenu(n).bind(function(n){return"prepared"===n.type?T.some(n.menu):T.none()})}))},m=function(e,n,t){var r=d(n,n.otherMenus(t));P(r,function(n){Sm(n.element,[c.markers.backgroundMenu]),c.stayInDom||eg.remove(e,n)})},g=function(n,r){var o,e=(o=n,i.get().getOrThunk(function(){var t={},n=Ui(o.element,"."+c.markers.item),e=H(n,function(n){return"true"===lt(n,"aria-haspopup")});return P(e,function(n){o.getSystem().getByDom(n).each(function(n){var e=s(n);t[e]=n})}),i.set(T.some(t)),t}));nt(e,function(n,e){var t=A(r,e);ft(n.element,"aria-expanded",t)})},p=function(r,o,i){return T.from(i[0]).bind(function(n){return o.lookupMenu(n).bind(function(n){if("notbuilt"===n.type)return T.none();var e=n.menu,t=d(o,i.slice(1));return P(t,function(n){bt(n.element,c.markers.backgroundMenu)}),Le(e.element)||eg.append(r,Rm(e)),Sm(e.element,[c.markers.backgroundMenu]),l(r,e),m(r,o,i),T.some(e)})})};(e=a=a||{})[e.HighlightSubmenu=0]="HighlightSubmenu",e[e.HighlightParent=1]="HighlightParent";var h=function(o,i,u){void 0===u&&(u=a.HighlightSubmenu);var n=s(i);return f.expand(n).bind(function(r){return g(o,r),T.from(r[0]).bind(function(t){return f.lookupMenu(t).bind(function(n){var e=function(n,e,t){if("notbuilt"!==t.type)return t.menu;var r=n.getSystem().build(t.nbMenu());return f.setMenuBuilt(e,r),r}(o,t,n);return Le(e.element)||eg.append(o,Rm(e)),c.onOpenSubmenu(o,i,e,q(r)),u===a.HighlightSubmenu?(Fu.highlightFirst(e),p(o,f,r)):(Fu.dehighlightAll(e),T.some(i))})})})},r=function(e,t){var n=s(t);return f.collapse(n).bind(function(n){return g(e,n),p(e,f,n).map(function(n){return c.onCollapseMenu(e,t,n),n})})},t=function(t){return function(e,n){return Zi(n.getSource(),"."+c.markers.item).bind(function(n){return e.getSystem().getByDom(n).toOptional().bind(function(n){return t(e,n).map(function(){return!0})})})}},v=Jr([Zr(qm(),function(t,r){var n=r.event.item;f.lookupItem(s(n)).each(function(){var n=r.event.menu;Fu.highlight(t,n);var e=s(r.event.item);f.refresh(e).each(function(n){return m(t,f,n)})})}),ao(function(e,n){var t=n.event.target;e.getSystem().getByDom(t).each(function(n){0===s(n).indexOf("collapse-item")&&r(e,n),h(e,n,a.HighlightSubmenu).fold(function(){c.onExecute(e,n)},function(){})})}),io(function(e,n){var t,r;t=o(e,c.data.primary,c.data.menus),r=u(),f.setContents(c.data.primary,t,c.data.expansions,r),f.getPrimary().each(function(n){eg.append(e,Rm(n)),c.onOpenMenu(e,n),c.highlightImmediately&&l(e,n)})})].concat(c.navigateOnHover?[Zr(Nm(),function(n,e){var t,r,o=e.event.item;t=n,r=s(o),f.refresh(r).bind(function(n){return g(t,n),p(t,f,n)}),h(n,o,a.HighlightParent),c.onHover(n,o)})]:[])),y=function(n){return Fu.getHighlighted(n).bind(Fu.getHighlighted)},b={collapseMenu:function(e){y(e).each(function(n){r(e,n)})},highlightPrimary:function(e){f.getPrimary().each(function(n){l(e,n)})},repositionMenus:function(r){f.getPrimary().bind(function(e){return y(r).bind(function(n){var e,t=s(n),r=(e=f.getMenus(),ot(e,function(n){return n})),o=wu(N(r,ig.extractPreparedMenu));return f.getTriggeringPath(t,function(n){return t=n,Q(o,function(n){if(!n.getSystem().isConnected())return T.none();var e=Fu.getCandidates(n);return G(e,function(n){return s(n)===t})});var t})}).map(function(n){return{primary:e,triggeringPath:n}})}).fold(function(){var n;n=r,T.from(n.components()[0]).filter(function(n){return"menu"===lt(n.element,"role")}).each(function(n){c.onRepositionMenu(r,n,[])})},function(n){var e=n.primary,t=n.triggeringPath;c.onRepositionMenu(r,e,t)})}};return{uid:c.uid,dom:c.dom,markers:c.markers,behaviours:Sa(c.tmenuBehaviours,[ba.config({mode:"special",onRight:t(function(n,e){return Yu(e.element)?T.none():h(n,e,a.HighlightSubmenu)}),onLeft:t(function(n,e){return Yu(e.element)?T.none():r(n,e)}),onEscape:t(function(n,e){return r(n,e).orThunk(function(){return c.onEscape(n,e).map(function(){return n})})}),focusIn:function(e,n){f.getPrimary().each(function(n){fe(e,n.element,Jn())})}}),Fu.config({highlightClass:c.markers.selectedMenu,itemClass:c.markers.menu}),Od.config({find:function(n){return Fu.getHighlighted(n)}}),eg.config({})]),eventOrder:c.eventOrder,apis:b,events:v}},extraApis:{tieredData:function(n,e,t){return{primary:n,menus:e,expansions:t}},singleData:function(n,e){return{primary:n,menus:or(n,e),expansions:{}}},collapseItem:function(n){return{value:Ba(ug()),meta:{text:n}}}}}),ag=function(n,e,t,r){return it(e.routes,r.start).bind(function(n){return it(n,r.destination)})},fg=function(n,e,t,r){return ag(0,e,0,r).bind(function(e){return e.transition.map(function(n){return{transition:n,route:e}})})},sg=function(t,r,n){var e,o,i;i=n,lg(e=t,o=r).bind(function(n){return fg(e,o,i,n)}).each(function(n){var e=n.transition;wt(t.element,e.transitionClass),gt(t.element,r.destinationAttr)})},lg=function(e,t,n){var r=e.element;return dt(r,t.destinationAttr).map(function(n){return{start:lt(e.element,t.stateAttr),destination:n}})},dg=function(n,e,t,r){sg(n,e,t),mt(n.element,e.stateAttr)&<(n.element,e.stateAttr)!==r&&e.onFinish(n,r),ft(n.element,e.stateAttr,r)},mg=/* */Object.freeze({__proto__:null,findRoute:ag,disableTransition:sg,getCurrentRoute:lg,jumpTo:dg,progressTo:function(t,r,o,i){var e,u;u=r,mt((e=t).element,u.destinationAttr)&&(dt(e.element,u.destinationAttr).each(function(n){ft(e.element,u.stateAttr,n)}),gt(e.element,u.destinationAttr));var n,c,a=(n=r,c=i,{start:lt(t.element,n.stateAttr),destination:c});fg(t,r,o,a).fold(function(){dg(t,r,o,i)},function(n){sg(t,r,o);var e=n.transition;bt(t.element,e.transitionClass),ft(t.element,r.destinationAttr,i)})},getState:function(n,e,t){return dt(n.element,e.stateAttr)}}),gg=/* */Object.freeze({__proto__:null,events:function(o,i){return Jr([Zr(Ln(),function(t,n){var r=n.event.raw;lg(t,o).each(function(e){ag(0,o,0,e).each(function(n){n.transition.each(function(n){r.propertyName===n.property&&(dg(t,o,i,e.destination),o.onTransition(t,e))})})})}),io(function(n,e){dg(n,o,i,o.initialState)})])}}),pg=[Lr("destinationAttr","data-transitioning-destination"),Lr("stateAttr","data-transitioning-state"),Br("initialState"),Zo("onTransition"),Zo("onFinish"),Ar("routes",Cr(Ct.value,Cr(Ct.value,vr([zr("transition",[Br("property"),Br("transitionClass")])]))))],hg=wo({fields:pg,name:"transitioning",active:gg,apis:mg,extra:{createRoutes:function(n){var r={};return nt(n,function(n,e){var t=e.split("<->");r[t[0]]=or(t[1],n),r[t[1]]=or(t[0],n)}),r},createBistate:function(n,e,t){return ir([{key:n,value:or(e,t)},{key:e,value:or(n,t)}])},createTristate:function(n,e,t,r){return ir([{key:n,value:ir([{key:e,value:r},{key:t,value:r}])},{key:e,value:ir([{key:n,value:r},{key:t,value:r}])},{key:t,value:ir([{key:n,value:r},{key:e,value:r}])}])}}}),vg=Ti("scrollable"),yg=function(n){bt(n,vg)},bg=function(n){wt(n,vg)},xg=vg,wg=function(n){return it(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?[Ti("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:Ti("format-matches"),selected:t},itemBehaviours:bo(o?[]:[xi(n,function(n,e){(e?bi.on:bi.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},Og=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[If.sketch({dom:{tag:"div",classes:[Ti("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[Ti("styles-collapse-icon")]}},Dm(n)]:[Dm(n)],action:function(n){var e;r&&(e=t().get(n),cg.collapseMenu(e))}}),{dom:{tag:"div",classes:[Ti("styles-menu-items-container")]},components:[Ym.parts.items({})],behaviours:bo([xd("adhoc-scrollable-menu",[io(function(n,e){Ri(n.element,"overflow-y","auto"),Ri(n.element,"-webkit-overflow-scrolling","touch"),yg(n.element)}),uo(function(n){Ni(n.element,"overflow-y"),Ni(n.element,"-webkit-overflow-scrolling"),bg(n.element)})])])}],items:e,menuBehaviours:bo([hg.config({initialState:"after",routes:hg.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},Tg=function(r){var o,i,n,e,t,u=(o=r.formats,i=function(){return c},n=Og("Styles",[].concat(N(o.items,function(n){return Sg(wg(n),n.title,n.isSelected(),n.getPreview(),ct(o.expansions,wg(n)))})),i,!1),e=et(o.menus,function(n,e){var t=N(n,function(n){return Sg(wg(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",ct(o.expansions,wg(n)))});return Og(e,t,i,!0)}),t=qt(e,or("styles",n)),{tmenu:cg.tieredData("styles",t,o.expansions)}),c=Zl(cg.sketch({dom:{tag:"div",classes:[Ti("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=as.getValue(e);return r.handle(e,t.value),T.none()},onEscape:function(){return T.none()},onOpenMenu:function(n,e){var t=ls(n.element);ss(e.element,t),hg.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=ls(n.element),o=Ji(e.element,'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();ss(t.element,r),hg.progressTo(i,"before"),hg.jumpTo(t,"after"),hg.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=Ji(e.element,'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();hg.progressTo(o,"after"),hg.progressTo(t,"current")},navigateOnHover:!1,highlightImmediately:!0,data:u.tmenu,markers:{backgroundMenu:Ti("styles-background-menu"),menu:Ti("styles-menu"),selectedMenu:Ti("styles-selected-menu"),item:Ti("styles-item"),selectedItem:Ti("styles-selected-item")}}));return c.asSpec()},kg=function(n){return ct(n,"items")?(t=qt(rr(e=n,["items"]),{menu:!0}),r=Eg(e.items),{item:t,menus:qt(r.menus,or(e.title,r.items)),expansions:qt(r.expansions,or(e.title,e.title))}):{item:n,menus:{},expansions:{}};var e,t,r},Eg=function(n){return z(n,function(n,e){var t=kg(e);return{menus:qt(n.menus,t.menus),items:[t.item].concat(n.items),expansions:qt(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},Cg=function(u){var c=function(n){return function(){return u.formatter.match(n)}},a=function(n){return function(){return u.formatter.getCssText(n)}},f=function(n){return N(n,function(n){if(ct(n,"items")){var e=f(n.items);return qt(qt(n,{isSelected:l,getPreview:y("")}),{items:e})}return ct(n,"format")?qt(i=n,{isSelected:c(i.format),getPreview:a(i.format)}):(r=Ba((t=n).title),o=qt(t,{format:r,isSelected:c(r),getPreview:a(r)}),u.formatter.register(r,o),o);var t,r,o,i})};return f(u.getParam("style_formats",Fo,"array"))},Mg=function(t,n,r){var e,o,i,u=(e=t,i=(o=function(n){return W(n,function(n){return n.items===undefined?!ct(n,"format")||e.formatter.canApply(n.format)?[n]:[]:0<o(n.items).length?[n]:[]})})(n),Eg(i));return Tg({formats:u,handle:function(n,e){t.undoManager.transact(function(){bi.isOn(n)?t.formatter.remove(e):t.formatter.apply(e)}),r()}})},Dg=function(n){var e=n.replace(/\|/g," ").trim();return 0<e.length?e.split(/\s+/):[]},_g=function(n){return W(n,function(n){return(M(n)?_g:Dg)(n)})},Ig=function(n){var e=n.getParam("toolbar",Ro,"array");return(M(e)?_g:Dg)(e)},Fg=function(t,o){var n=function(t){return function(){return Pf(e=t,function(){n.execCommand(e)},{},n=o);var n,e}},e=function(r){return function(){return n=o,t=Af(e=r),Pf(e,function(){n.execCommand(e)},t,n);var n,e,t}},r=function(n,e,t){return function(){return jf(o,n,e,t)}},i=n("undo"),u=n("redo"),c=e("bold"),a=e("italic"),f=e("underline"),s=n("removeformat"),l=r("unlink","link",function(){o.execCommand("unlink",null,!1)}),d=r("unordered-list","ul",function(){o.execCommand("InsertUnorderedList",null,!1)}),m=r("ordered-list","ol",function(){o.execCommand("InsertOrderedList",null,!1)}),g=Cg(o),p=function(){return Mg(o,g,function(){o.fire("scrollIntoView")})},h=function(n,e){return{isSupported:function(){var e=o.ui.registry.getAll().buttons;return n.forall(function(n){return ct(e,n)})},sketch:e}};return{undo:h(T.none(),i),redo:h(T.none(),u),bold:h(T.none(),c),italic:h(T.none(),a),underline:h(T.none(),f),removeformat:h(T.none(),s),link:h(T.none(),function(){return om(t,o)}),unlink:h(T.none(),l),image:h(T.none(),function(){return sd(o)}),bullist:h(T.some("bullist"),d),numlist:h(T.some("numlist"),m),fontsizeselect:h(T.none(),function(){return n={onChange:function(n){Xl(e,n)},getInitialValue:function(){return Wl(e)}},zl(t,"font-size",function(){return Ql(n)},e=o);var e,n}),forecolor:h(T.none(),function(){return n={onChange:function(n,e,t){r.undoManager.transact(function(){r.formatter.apply("forecolor",{value:t}),r.nodeChanged()})},getInitialValue:function(){return-1}},zl(t,"color-levels",function(){return Ll(n)},r=o);var r,n}),styleselect:h(T.none(),function(){return Pf("style-formats",function(n){o.fire("toReading"),t.dropup.appear(p,bi.on,n)},bo([bi.config({toggleClass:Ti("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),ci.config({channels:ir([Si(Bo,bi.off),Si(Ao,bi.off)])})]),o)})}},Rg=function(n){var e=de.fromDom(function(n){if(je()&&_(n.target)){var e=de.fromDom(n.target);if(xe(e)&&ze(e)&&n.composed&&n.composedPath){var t=n.composedPath();if(t)return J(t)}}return T.from(n.target)}(n).getOr(n.target)),t=function(){return n.stopPropagation()},r=function(){return n.preventDefault()},o=i(r,t);return{target:e,x:n.clientX,y:n.clientY,stop:t,prevent:r,kill:o,raw:n}},Vg=function(n,e,t,r,o){var i,u,c=(i=t,u=r,function(n){i(n)&&u(Rg(n))});return n.dom.addEventListener(e,c,o),{unbind:b(Bg,n,e,c,o)}},Bg=function(n,e,t,r){n.dom.removeEventListener(e,t,r)},Ag=w,jg=function(n,e,t){return Vg(n,e,Ag,t,!1)},Ng=function(n,e,t){return Vg(n,e,Ag,t,!0)},Pg=tinymce.util.Tools.resolve("tinymce.util.Delay"),Hg=function(n){var e=n.matchMedia("(orientation: portrait)").matches;return{isPortrait:y(e)}},zg=function(r,e){var n=de.fromDom(r),o=null,t=jg(n,"orientationchange",function(){Pg.clearInterval(o);var n=Hg(r);e.onChange(n),i(function(){e.onReady(n)})}),i=function(n){Pg.clearInterval(o);var e=r.innerHeight,t=0;o=Pg.setInterval(function(){e!==r.innerHeight?(Pg.clearInterval(o),n(T.some(r.innerHeight))):20<t&&(Pg.clearInterval(o),n(T.none())),t++},50)};return{onAdjustment:i,destroy:function(){t.unbind()}}},Lg=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},Gg=function(n,e,t,r,o){var i=n.document.createRange();return i.setStart(e.dom,t),i.setEnd(r.dom,o),i},$g=function(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:n.width,height:n.height}},Ug=Ut([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Wg=function(n,e,t){return e(de.fromDom(t.startContainer),t.startOffset,de.fromDom(t.endContainer),t.endOffset)},Xg=function(n,e){var o,t,r,i=(o=n,e.match({domRange:function(n){return{ltr:y(n),rtl:T.none}},relative:function(n,e){return{ltr:d(function(){return Lg(o,n,e)}),rtl:d(function(){return T.some(Lg(o,e,n))})}},exact:function(n,e,t,r){return{ltr:d(function(){return Gg(o,n,e,t,r)}),rtl:d(function(){return T.some(Gg(o,t,r,n,e))})}}}));return(r=(t=i).ltr()).collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Ug.rtl(de.fromDom(n.endContainer),n.endOffset,de.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Wg(0,Ug.ltr,r)}):Wg(0,Ug.ltr,r)},qg=(Ug.ltr,Ug.rtl,function(n,e,t,r){return{start:n,soffset:e,finish:t,foffset:r}});var Yg,Kg,Jg,Qg,Zg,np=(Yg=we,Kg="text",{get:function(n){if(!Yg(n))throw new Error("Can only get "+Kg+" value of a "+Kg+" node");return Jg(n).getOr("")},getOption:Jg=function(n){return Yg(n)?T.from(n.dom.nodeValue):T.none()},set:function(n,e){if(!Yg(n))throw new Error("Can only set raw "+Kg+" value of a "+Kg+" node");n.dom.nodeValue=e}}),ep=function(n){return"img"===ye(n)?1:(e=n,np.getOption(e).fold(function(){return Ce(n).length},function(n){return n.length}));var e},tp=Ut([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),rp={before:tp.before,on:tp.on,after:tp.after,cata:function(n,e,t,r){return n.fold(e,t,r)},getStart:function(n){return n.fold(v,v,v)}},op=Ut([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ip={domRange:op.domRange,relative:op.relative,exact:op.exact,exactFromRange:function(n){return op.exact(n.start,n.soffset,n.finish,n.foffset)},getWin:function(n){var e,t=n.match({domRange:function(n){return de.fromDom(n.startContainer)},relative:function(n,e){return rp.getStart(n)},exact:function(n,e,t,r){return n}});return e=t,de.fromDom(ke(e).dom.defaultView)},range:qg},up=function(n,e){var t=ye(n);return"input"===t?rp.after(n):A(["br","img"],t)?0===e?rp.before(n):rp.after(n):rp.on(n,e)},cp=function(n,e,t,r){var o,i,u,c,a,f=(i=e,u=t,c=r,(a=Te(o=n).dom.createRange()).setStart(o.dom,i),a.setEnd(u.dom,c),a),s=ve(n,t)&&e===r;return f.collapsed&&!s},ap=function(n){return T.from(n.getSelection())},fp=function(n,e,t,r,o){var i,u=Gg(n,e,t,r,o);i=u,ap(n).each(function(n){n.removeAllRanges(),n.addRange(i)})},sp=function(l,n){return Xg(l,n).match({ltr:function(n,e,t,r){fp(l,n,e,t,r)},rtl:function(c,a,f,s){ap(l).each(function(n){if(n.setBaseAndExtent)n.setBaseAndExtent(c.dom,a,f.dom,s);else if(n.extend)try{t=c,r=a,o=f,i=s,(e=n).collapse(t.dom,r),e.extend(o.dom,i)}catch(u){fp(l,f,s,c,a)}else fp(l,f,s,c,a);var e,t,r,o,i})}})},lp=function(n,e,t,r,o){var i,u,c,a,f=(i=r,u=o,c=up(e,t),a=up(i,u),ip.relative(c,a));sp(n,f)},dp=function(n){if(0<n.rangeCount){var e=n.getRangeAt(0),t=n.getRangeAt(n.rangeCount-1);return T.some(qg(de.fromDom(e.startContainer),e.startOffset,de.fromDom(t.endContainer),t.endOffset))}return T.none()},mp=function(n){if(null===n.anchorNode||null===n.focusNode)return dp(n);var e=de.fromDom(n.anchorNode),t=de.fromDom(n.focusNode);return cp(e,n.anchorOffset,t,n.focusOffset)?T.some(qg(e,n.anchorOffset,t,n.focusOffset)):dp(n)},gp=function(n){return ap(n).filter(function(n){return 0<n.rangeCount}).bind(mp)},pp=function(n,e){var i,t,r,o,u=Xg(i=n,e).match({ltr:function(n,e,t,r){var o=i.document.createRange();return o.setStart(n.dom,e),o.setEnd(t.dom,r),o},rtl:function(n,e,t,r){var o=i.document.createRange();return o.setStart(t.dom,r),o.setEnd(n.dom,e),o}});return r=(t=u).getClientRects(),0<(o=0<r.length?r[0]:t.getBoundingClientRect()).width||0<o.height?T.some(o).map($g):T.none()},hp=function(n){return T.from(n.dom.contentWindow)},vp=function(n){return hp(n).bind(gp)},yp=function(n){return n.getFrame()},bp=function(n,e,t,r){return n[t].getOrThunk(function(){return function(n){return jg(e,r,n)}})},xp=function(c){var n,a=yp(c);return n=a,T.some(de.fromDom(n.dom.contentWindow.document.body)).bind(function(u){return n=a,T.some(de.fromDom(n.dom.contentWindow.document)).bind(function(i){return hp(a).map(function(o){var n=de.fromDom(i.dom.documentElement),e=c.getCursorBox.getOrThunk(function(){return function(){return gp(o).map(function(n){return ip.exact(n.start,n.soffset,n.finish,n.foffset)}).bind(function(n){return pp(o,n).orThunk(function(){return gp(o).filter(function(n){return ve(n.start,n.finish)&&n.soffset===n.foffset}).bind(function(n){var e=n.start.dom.getBoundingClientRect();return 0<e.width||0<e.height?T.some(e):T.none()})})})}}),t=c.setSelection.getOrThunk(function(){return function(n,e,t,r){lp(o,n,e,t,r)}}),r=c.clearSelection.getOrThunk(function(){return function(){ap(o).each(function(n){return n.removeAllRanges()})}});return{body:u,doc:i,win:o,html:n,getSelection:b(vp,a),setSelection:t,clearSelection:r,frame:a,onKeyup:bp(c,i,"onKeyup","keyup"),onNodeChanged:bp(c,i,"onNodeChanged","SelectionChange"),onDomChanged:c.onDomChanged,onScrollToCursor:c.onScrollToCursor,onScrollToElement:c.onScrollToElement,onToReading:c.onToReading,onToEditing:c.onToEditing,onToolbarScrollStart:c.onToolbarScrollStart,onTouchContent:c.onTouchContent,onTapContent:c.onTapContent,onTouchToolstrip:c.onTouchToolstrip,getCursorBox:e}})});var n})},wp=(Qg="getWin",Zg=hp,function(e){return e[Qg].getOrThunk(function(){var n=yp(e);return function(){return Zg(n)}})()}),Sp=function(){var e=Ki("head").getOrDie(),n=Ki('meta[name="viewport"]').getOrThunk(function(){var n=de.fromTag("meta");return ft(n,"name","viewport"),Fe(e,n),n}),t=lt(n,"content");return{maximize:function(){ft(n,"content","width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0")},restore:function(){t!==undefined&&null!==t&&0<t.length?ft(n,"content",t):ft(n,"content","user-scalable=yes")}}},Op="data-ephox-mobile-fullscreen-style",Tp="position:absolute!important;",kp="top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;",Ep=Mn().os.isAndroid(),Cp=function(n,e){var t,r,o,i=function(r){return function(n){var e=lt(n,"style"),t=e===undefined?"no-styles":e.trim();t!==r&&(ft(n,Op,t),ft(n,"style",r))}},u=(t="*",Gi(n,function(n){return me(n,t)},r)),c=W(u,function(n){return e="*",$i(n,function(n){return me(n,e)});var e}),a=(o=Bi(e,"background-color"))!==undefined&&""!==o?"background-color:"+o+"!important":"background-color:rgb(255,255,255)!important;";P(c,i("display:none!important;")),P(u,i(Tp+kp+a)),i((!0===Ep?"":Tp)+kp+a)(n)},Mp=function(){var n=pe("["+Op+"]");P(n,function(n){var e=lt(n,Op);"no-styles"!==e?ft(n,"style",e):gt(n,"style"),gt(n,Op)})};var Dp=function(n){var e=n.raw;return e.touches===undefined||1!==e.touches.length?T.none():T.some(e.touches[0])},_p=function(t){var r,o,i,u=ko(T.none()),c=ko(!1),a=(r=function(n){t.triggerEvent(Zn(),n),c.set(!0)},o=400,i=null,{cancel:function(){null!==i&&(clearTimeout(i),i=null)},schedule:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];i=setTimeout(function(){r.apply(null,n),i=null},o)}}),f=ir([{key:_n(),value:function(t){return Dp(t).each(function(n){a.cancel();var e={x:n.clientX,y:n.clientY,target:t.target};a.schedule(t),c.set(!1),u.set(T.some(e))}),T.none()}},{key:In(),value:function(n){return a.cancel(),Dp(n).each(function(i){u.get().each(function(n){var e,t,r,o;e=i,t=n,r=Math.abs(e.clientX-t.x),o=Math.abs(e.clientY-t.y),(5<r||5<o)&&u.set(T.none())})}),T.none()}},{key:Fn(),value:function(e){a.cancel();return u.get().filter(function(n){return ve(n.target,e.target)}).map(function(n){return c.get()?(e.prevent(),!1):t.triggerEvent(Qn(),e)})}}]);return{fireIfReady:function(e,n){return it(f,n).bind(function(n){return n(e)})}}},Ip=function(t){var e=_p({triggerEvent:function(n,e){t.onTapContent(e)}});return{fireTouchstart:function(n){e.fireIfReady(n,"touchstart")},onTouchend:function(){return jg(t.body,"touchend",function(n){e.fireIfReady(n,"touchend")})},onTouchmove:function(){return jg(t.body,"touchmove",function(n){e.fireIfReady(n,"touchmove")})}}},Fp=6<=Mn().os.version.major,Rp=function(r,e,t){var o=Ip(r),i=Te(e),u=function(n){return!ve(n.start,n.finish)||n.soffset!==n.foffset},n=function(){var n=r.doc.dom.hasFocus()&&r.getSelection().exists(u);t.getByDom(e).each(!0===(n||Mo(i).filter(function(n){return"input"===ye(n)}).exists(function(n){return n.dom.selectionStart!==n.dom.selectionEnd}))?bi.on:bi.off)},c=[jg(r.body,"touchstart",function(n){r.onTouchContent(),o.fireTouchstart(n)}),o.onTouchmove(),o.onTouchend(),jg(e,"touchstart",function(n){r.onTouchToolstrip()}),r.onToReading(function(){Co(r.body)}),r.onToEditing(O),r.onScrollToCursor(function(n){n.preventDefault(),r.getCursorBox().each(function(n){var e=r.win,t=n.top>e.innerHeight||n.bottom>e.innerHeight?n.bottom-e.innerHeight+50:0;0!=t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0==Fp?[]:[jg(de.fromDom(r.win),"blur",function(){t.getByDom(e).each(bi.off)}),jg(i,"select",n),jg(r.doc,"selectionchange",n)]);return{destroy:function(){P(c,function(n){n.unbind()})}}},Vp=function(n,e){var t=parseInt(lt(n,e),10);return isNaN(t)?0:t},Bp=function(n){return x(x({},n),{width:2})},Ap=function(n){return{left:n.left,top:n.top,right:n.right,bottom:n.bottom,width:n.width,height:n.height}},jp=function(n){var e=n.getSelection();return e!==undefined&&0<e.rangeCount?function(t){if(t.collapsed){var r=de.fromDom(t.startContainer);return Ee(r).bind(function(n){var e=ip.exact(r,t.startOffset,n,ep(n));return pp(t.startContainer.ownerDocument.defaultView,e).map(Bp).map(K)}).getOr([])}return N(t.getClientRects(),Ap)}(e.getRangeAt(0)):[]},Np=function(n){n.focus();var e=de.fromDom(n.document.body);(Mo().exists(function(n){return A(["input","textarea"],ye(n))})?function(n){Pg.setTimeout(function(){n()},0)}:s)(function(){Mo().each(Co),Eo(e)})},Pp="data-"+Ti("last-outer-height"),Hp=function(n,e){ft(n,Pp,e)},zp=function(n){return{top:n.top,bottom:n.top+n.height}},Lp=function(n,e){var t=Vp(e,Pp),r=n.innerHeight;return r<t?T.some(t-r):T.none()},Gp=function(n,u){var e=de.fromDom(u.document.body),t=jg(de.fromDom(n),"resize",function(){Lp(n,e).each(function(i){var n;(0<(n=jp(u)).length?T.some(n[0]).map(zp):T.none()).each(function(n){var e,t,r,o=(e=u,r=i,(t=n).top>e.innerHeight||t.bottom>e.innerHeight?Math.min(r,t.bottom-e.innerHeight+50):0);0!==o&&u.scrollTo(u.pageXOffset,u.pageYOffset+o)})}),Hp(e,n.innerHeight)});Hp(e,n.innerHeight);return{toEditing:function(){Np(u)},destroy:function(){t.unbind()}}},$p=function(t,r){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null!==o&&clearTimeout(o),o=setTimeout(function(){t.apply(null,n),o=null},r)}}},Up=function(n,e){var t,r,o,i=Zl(Td.sketch({dom:Vf('<div aria-hidden="true" class="${prefix}-mask-tap-icon"></div>'),containerBehaviours:bo([bi.config({toggleClass:Ti("mask-tap-icon-selected"),toggleOnExecute:!1})])})),u=(t=n,r=200,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];null===o&&(o=setTimeout(function(){t.apply(null,n),o=null},r))}});return Td.sketch({dom:Vf('<div class="${prefix}-disabled-mask"></div>'),components:[Td.sketch({dom:Vf('<div class="${prefix}-content-container"></div>'),components:[If.sketch({dom:Vf('<div class="${prefix}-content-tap-section"></div>'),components:[i.asSpec()],action:function(n){u.throttle()},buttonBehaviours:bo([bi.config({toggleClass:Ti("mask-tap-icon-selected")})])})]})]})},Wp=y({unbind:O}),Xp=yr([jr("editor",[Br("getFrame"),Nr("getBody"),Nr("getDoc"),Nr("getWin"),Nr("getSelection"),Nr("setSelection"),Nr("clearSelection"),Nr("cursorSaver"),Nr("onKeyup"),Nr("onNodeChanged"),Nr("getCursorBox"),Br("onDomChanged"),Lr("onTouchContent",O),Lr("onTapContent",O),Lr("onTouchToolstrip",O),Lr("onScrollToCursor",Wp),Lr("onScrollToElement",Wp),Lr("onToEditing",Wp),Lr("onToReading",Wp),Lr("onToolbarScrollStart",v)]),Br("socket"),Br("toolstrip"),Br("dropup"),Br("toolbar"),Br("container"),Br("alloy"),$r("win",function(n){return Te(n.socket).dom.defaultView}),$r("body",function(n){return de.fromDom(n.socket.dom.ownerDocument.body)}),Lr("translate",v),Lr("setReadOnly",O),Lr("readOnlyOnInit",w)]),qp=function(n){var e=_r("Getting AndroidWebapp schema",Xp,n);Ri(e.toolstrip,"width","100%");var t=Fm(Up(function(){e.setReadOnly(e.readOnlyOnInit()),f.enter()},e.translate));e.alloy.add(t);var r={show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}};Fe(e.container,t.element);var o,i,u,c,a,f=(o=e,i=r,u=Sp(),c=nm(),a=nm(),{enter:function(){i.hide(),bt(o.container,Ti("fullscreen-maximized")),bt(o.container,Ti("android-maximized")),u.maximize(),bt(o.body,Ti("android-scroll-reload")),c.set(Gp(o.win,wp(o.editor).getOrDie("no"))),xp(o.editor).each(function(n){Cp(o.container,n.body),a.set(Rp(n,o.toolstrip,o.alloy))})},exit:function(){u.restore(),i.show(),wt(o.container,Ti("fullscreen-maximized")),wt(o.container,Ti("android-maximized")),Mp(),wt(o.body,Ti("android-scroll-reload")),a.clear(),c.clear()}});return{setReadOnly:e.setReadOnly,refreshStructure:O,enter:f.enter,exit:f.exit,destroy:O}},Yp=y([Br("dom"),Lr("shell",!0),xa("toolbarBehaviours",[eg])]),Kp=y([Ja({name:"groups",overrides:function(){return{behaviours:bo([eg.config({})])}}})]),Jp=_f({name:"Toolbar",configFields:Yp(),partFields:Kp(),factory:function(e,n,t,r){var o=function(n){return e.shell?T.some(n):uf(n,e,"groups")},i=e.shell?{behaviours:[eg.config({})],components:[]}:{behaviours:[],components:n};return{uid:e.uid,dom:e.dom,components:i.components,behaviours:Sa(e.toolbarBehaviours,i.behaviours),apis:{setGroups:function(n,e){o(n).fold(function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(n){eg.set(n,e)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,e,t){n.setGroups(e,t)}}}),Qp=y([Br("items"),jr("markers",N(["itemSelector"],Br)),xa("tgroupBehaviours",[ba])]),Zp=y([Qa({name:"items",unit:"item"})]),nh=_f({name:"ToolbarGroup",configFields:Qp(),partFields:Zp(),factory:function(n,e,t,r){return{uid:n.uid,dom:n.dom,components:e,behaviours:Sa(n.tgroupBehaviours,[ba.config({mode:"flow",selector:n.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),eh="data-"+Ti("horizontal-scroll"),th=function(n){return"true"===lt(n,eh)?0<(t=n).dom.scrollLeft||function(n){n.dom.scrollLeft=1;var e=0!==n.dom.scrollLeft;return n.dom.scrollLeft=0,e}(t):0<(e=n).dom.scrollTop||function(n){n.dom.scrollTop=1;var e=0!==n.dom.scrollTop;return n.dom.scrollTop=0,e}(e);var e,t},rh=function(){var e=function(n){var e=!0===n.scrollable?"${prefix}-toolbar-scrollable-group":"";return{dom:Vf('<div aria-label="'+n.label+'" class="${prefix}-toolbar-group '+e+'"></div>'),tgroupBehaviours:bo([xd("adhoc-scrollable-toolbar",!0===n.scrollable?[co(function(n,e){var t;Ri(n.element,"overflow-x","auto"),t=n.element,ft(t,eh,"true"),yg(n.element)})]:[])]),components:[Td.sketch({components:[nh.parts.items({})]})],markers:{itemSelector:"."+Ti("toolbar-group-item")},items:n.items}},t=Fm(Jp.sketch({dom:Vf('<div class="${prefix}-toolbar"></div>'),components:[Jp.parts.groups({})],toolbarBehaviours:bo([bi.config({toggleClass:Ti("context-toolbar"),toggleOnExecute:!1,aria:{mode:"none"}}),ba.config({mode:"cyclic"})]),shell:!0})),n=Fm(Td.sketch({dom:{classes:[Ti("toolstrip")]},components:[Rm(t)],containerBehaviours:bo([bi.config({toggleClass:Ti("android-selection-context-toolbar"),toggleOnExecute:!1})])})),r=function(){Jp.setGroups(t,o.get()),bi.off(t)},o=ko([]);return{wrapper:n,toolbar:t,createGroups:function(n){return N(n,i(nh.sketch,e))},setGroups:function(n){o.set(n),r()},setContextToolbar:function(n){bi.on(t),Jp.setGroups(t,n)},restoreToolbar:function(){bi.isOn(t)&&r()},refresh:function(){},focus:function(){ba.focusIn(t)}}},oh=function(n){return Fm(If.sketch({dom:Vf('<div class="${prefix}-mask-edit-icon ${prefix}-icon"></div>'),action:function(){n.run(function(n){n.setReadOnly(!1)})}}))},ih=function(){return Fm(Td.sketch({dom:Vf('<div class="${prefix}-editor-socket"></div>'),components:[],containerBehaviours:bo([eg.config({})])}))},uh=function(n,e){eg.append(n,Rm(e))},ch=function(n,e){eg.remove(n,e)},ah=function(n,e,t,r){(!0===t?To.toAlpha:To.toOmega)(r),(t?uh:ch)(n,e)},fh=function(e,n){return n.getAnimationRoot.fold(function(){return e.element},function(n){return n(e)})},sh=function(n){return n.dimension.property},lh=function(n,e){return n.dimension.getDimension(e)},dh=function(n,e){var t=fh(n,e);Sm(t,[e.shrinkingClass,e.growingClass])},mh=function(n,e){wt(n.element,e.openClass),bt(n.element,e.closedClass),Ri(n.element,sh(e),"0px"),Pi(n.element)},gh=function(n,e){wt(n.element,e.closedClass),bt(n.element,e.openClass),Ni(n.element,sh(e))},ph=function(n,e,t,r){t.setCollapsed(),Ri(n.element,sh(e),lh(e,n.element)),Pi(n.element),dh(n,e),mh(n,e),e.onStartShrink(n),e.onShrunk(n)},hh=function(n,e,t,r){var o=r.getOrThunk(function(){return lh(e,n.element)});t.setCollapsed(),Ri(n.element,sh(e),o),Pi(n.element);var i=fh(n,e);wt(i,e.growingClass),bt(i,e.shrinkingClass),mh(n,e),e.onStartShrink(n)},vh=function(n,e,t){var r=lh(e,n.element);("0px"===r?ph:hh)(n,e,t,T.some(r))},yh=function(n,e,t){var r=fh(n,e),o=St(r,e.shrinkingClass),i=lh(e,n.element);gh(n,e);var u=lh(e,n.element);(o?function(){Ri(n.element,sh(e),i),Pi(n.element)}:function(){mh(n,e)})(),wt(r,e.shrinkingClass),bt(r,e.growingClass),gh(n,e),Ri(n.element,sh(e),u),t.setExpanded(),e.onStartGrow(n)},bh=function(n,e,t){var r=fh(n,e);return!0===St(r,e.growingClass)},xh=function(n,e,t){var r=fh(n,e);return!0===St(r,e.shrinkingClass)},wh=/* */Object.freeze({__proto__:null,refresh:function(n,e,t){var r;t.isExpanded()&&(Ni(n.element,sh(e)),r=lh(e,n.element),Ri(n.element,sh(e),r))},grow:function(n,e,t){t.isExpanded()||yh(n,e,t)},shrink:function(n,e,t){t.isExpanded()&&vh(n,e,t)},immediateShrink:function(n,e,t){t.isExpanded()&&ph(n,e,t,T.none())},hasGrown:function(n,e,t){return t.isExpanded()},hasShrunk:function(n,e,t){return t.isCollapsed()},isGrowing:bh,isShrinking:xh,isTransitioning:function(n,e,t){return!0===bh(n,e)||!0===xh(n,e)},toggleGrow:function(n,e,t){(t.isExpanded()?vh:yh)(n,e,t)},disableTransitions:dh}),Sh=/* */Object.freeze({__proto__:null,exhibit:function(n,e,t){var r=e.expanded;return lo(r?{classes:[e.openClass],styles:{}}:{classes:[e.closedClass],styles:or(e.dimension.property,"0px")})},events:function(t,r){return Jr([(n=Ln(),eo(n)(function(n,e){e.event.raw.propertyName===t.dimension.property&&(dh(n,t),r.isExpanded()&&Ni(n.element,t.dimension.property),(r.isExpanded()?t.onGrown:t.onShrunk)(n))}))]);var n}}),Oh=[Br("closedClass"),Br("openClass"),Br("shrinkingClass"),Br("growingClass"),Nr("getAnimationRoot"),Zo("onShrunk"),Zo("onStartShrink"),Zo("onGrown"),Zo("onStartGrow"),Lr("expanded",!1),Ar("dimension",Fr("property",{width:[ri("property","width"),ri("getDimension",function(n){return ls(n)+"px"})],height:[ri("property","height"),ri("getDimension",function(n){return Li(n)+"px"})]}))],Th=wo({fields:Oh,name:"sliding",active:Sh,apis:wh,state:/* */Object.freeze({__proto__:null,init:function(n){var e=ko(n.expanded);return yo({isExpanded:function(){return!0===e.get()},isCollapsed:function(){return!1===e.get()},setCollapsed:b(e.set,!1),setExpanded:b(e.set,!0),readState:function(){return"expanded: "+e.get()}})}})}),kh=function(e,t){var r=Fm(Td.sketch({dom:{tag:"div",classes:[Ti("dropup")]},components:[],containerBehaviours:bo([eg.config({}),Th.config({closedClass:Ti("dropup-closed"),openClass:Ti("dropup-open"),shrinkingClass:Ti("dropup-shrinking"),growingClass:Ti("dropup-growing"),dimension:{property:"height"},onShrunk:function(n){e(),t(),eg.set(n,[])},onGrown:function(n){e(),t()}}),wi(function(n,e){o(O)})])})),o=function(n){window.requestAnimationFrame(function(){n(),Th.shrink(r)})};return{appear:function(n,e,t){!0===Th.hasShrunk(r)&&!1===Th.isTransitioning(r)&&window.requestAnimationFrame(function(){e(t),eg.set(r,[n()]),Th.grow(r)})},disappear:o,component:r,element:r.element}},Eh=function(n){var e,t;return n.raw.which===nu[0]&&!A(["input","textarea"],ye(n.target))&&(e=n.target,!Zi(e,'[contenteditable="true"]',t).isSome())},Ch=function(){return Mn().browser.isFirefox()},Mh=vr([Ar("triggerEvent",Vr),Lr("stopBackspace",!0)]),Dh=function(e,n){var t,r,o,i,u=_r("Getting GUI events settings",Mh,n),c=_p(u),a=N(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(n){return jg(e,n,function(e){c.fireIfReady(e,n).each(function(n){n&&e.kill()}),u.triggerEvent(n,e)&&e.kill()})}),f=ko(T.none()),s=jg(e,"paste",function(e){c.fireIfReady(e,"paste").each(function(n){n&&e.kill()}),u.triggerEvent("paste",e)&&e.kill(),f.set(T.some(setTimeout(function(){u.triggerEvent(qn(),e)},0)))}),l=jg(e,"keydown",function(n){u.triggerEvent("keydown",n)?n.kill():!0===u.stopBackspace&&Eh(n)&&n.prevent()}),d=(t=e,r=function(n){u.triggerEvent("focusin",n)&&n.kill()},Ch()?Ng(t,"focus",r):jg(t,"focusin",r)),m=ko(T.none()),g=(o=e,i=function(n){u.triggerEvent("focusout",n)&&n.kill(),m.set(T.some(setTimeout(function(){u.triggerEvent(Xn(),n)},0)))},Ch()?Ng(o,"blur",i):jg(o,"focusout",i));return{unbind:function(){P(a,function(n){n.unbind()}),l.unbind(),d.unbind(),g.unbind(),s.unbind(),f.get().each(clearTimeout),m.get().each(clearTimeout)}}},_h=function(n,e){var t=it(n,"target").getOr(e);return ko(t)},Ih=Ut([{stopped:[]},{resume:["element"]},{complete:[]}]),Fh=function(n,r,e,t,o,i){var u,c,a,f,s=n(r,t),l=(u=e,c=o,a=ko(!1),f=ko(!1),{stop:function(){a.set(!0)},cut:function(){f.set(!0)},isStopped:a.get,isCut:f.get,event:u,setSource:c.set,getSource:c.get});return s.fold(function(){return i.logEventNoHandlers(r,t),Ih.complete()},function(e){var t=e.descHandler;return mm(t)(l),l.isStopped()?(i.logEventStopped(r,e.element,t.purpose),Ih.stopped()):l.isCut()?(i.logEventCut(r,e.element,t.purpose),Ih.complete()):Ee(e.element).fold(function(){return i.logNoParent(r,e.element,t.purpose),Ih.complete()},function(n){return i.logEventResponse(r,e.element,t.purpose),Ih.resume(n)})})},Rh=function(e,t,r,n,o,i){return Fh(e,t,r,n,o,i).fold(function(){return!0},function(n){return Rh(e,t,r,n,o,i)},function(){return!1})},Vh=function(n,e,t){var r,o,i=(r=e,o=ko(!1),{stop:function(){o.set(!0)},cut:O,isStopped:o.get,isCut:l,event:r,setSource:f("Cannot set source of a broadcasted event"),getSource:f("Cannot get source of a broadcasted event")});return P(n,function(n){var e=n.descHandler;mm(e)(i)}),i.isStopped()},Bh=function(n,e,t,r,o){var i=_h(t,r);return Rh(n,e,t,r,i,o)},Ah=function(n,e){return{element:n,descHandler:e}},jh=function(n,e){return{id:n,descHandler:e}};function Nh(){var i={};return{registerId:function(r,o,n){nt(n,function(n,e){var t=i[e]!==undefined?i[e]:{};t[o]=dm(n,r),i[e]=t})},unregisterId:function(t){nt(i,function(n,e){n.hasOwnProperty(t)&&delete n[t]})},filterByType:function(n){return it(i,n).map(function(n){return ot(n,function(n,e){return jh(e,n)})}).getOr([])},find:function(n,e,t){var o=it(i,e);return Xr(t,function(n){return t=o,yf(r=n).fold(function(){return T.none()},function(e){return t.bind(function(n){return it(n,e)}).map(function(n){return Ah(r,n)})});var t,r},n)}}}function Ph(){var r=Nh(),o={},i=function(r){var n=r.element;return yf(n).fold(function(){return n="uid-",e=r.element,t=Ba(pf+n),vf(e,t),t;var n,e,t},function(n){return n})},u=function(n){yf(n.element).each(function(n){delete o[n],r.unregisterId(n)})};return{find:function(n,e,t){return r.find(n,e,t)},filter:function(n){return r.filterByType(n)},register:function(n){var e=i(n);ct(o,e)&&function(n,e){var t=o[e];if(t!==n)throw new Error('The tagId "'+e+'" is already used by: '+Ho(t.element)+"\nCannot use it for: "+Ho(n.element)+"\nThe conflicting element is"+(Le(t.element)?" ":" not ")+"already in the DOM");u(n)}(n,e);var t=[n];r.registerId(t,e,n.events),o[e]=n},unregister:u,getById:function(n){return it(o,n)}}}var Hh=function(t){var r=function(e){return Ee(t.element).fold(function(){return!0},function(n){return ve(e,n)})},o=Ph(),f=function(n,e){return o.find(r,n,e)},n=Dh(t.element,{triggerEvent:function(r,o){return Wo(r,o.target,function(n){return t=n,Bh(f,r,e=o,e.target,t);var e,t})}}),i={debugInfo:y("real"),triggerEvent:function(e,t,r){Wo(e,t,function(n){return Bh(f,e,r,t,n)})},triggerFocus:function(c,a){yf(c).fold(function(){Eo(c)},function(n){Wo(Wn(),c,function(n){var e,t,r,o,i,u;return e=f,t=Wn(),i=n,u=_h(r={originator:a,kill:O,prevent:O,target:c},o=c),Fh(e,t,r,o,u,i),!1})})},triggerEscape:function(n,e){i.triggerEvent("keydown",n.element,e.event)},getByUid:function(n){return g(n)},getByDom:function(n){return p(n)},build:Fm,addToGui:function(n){c(n)},removeFromGui:function(n){a(n)},addToWorld:function(n){e(n)},removeFromWorld:function(n){u(n)},broadcast:function(n){l(n)},broadcastOn:function(n,e){d(n,e)},broadcastEvent:function(n,e){m(n,e)},isConnected:w},e=function(n){n.connect(i),we(n.element)||(o.register(n),P(n.components(),e),i.triggerEvent(ne(),n.element,{target:n.element}))},u=function(n){we(n.element)||(P(n.components(),u),o.unregister(n)),n.disconnect()},c=function(n){Ye(t,n,Fe)},a=function(n){Ke(n)},s=function(t){var n=o.filter(Yn());P(n,function(n){var e=n.descHandler;mm(e)(t)})},l=function(n){s({universal:!0,data:n})},d=function(n,e){s({universal:!1,channels:n,data:e})},m=function(n,e){var t=o.filter(n);return Vh(t,e)},g=function(n){return o.getById(n).fold(function(){return Ct.error(new Error('Could not find component with uid: "'+n+'" in system.'))},Ct.value)},p=function(n){var e=yf(n).getOr("not found");return g(e)};return e(t),{root:t,element:t.element,destroy:function(){n.unbind(),Be(t.element)},add:c,remove:a,getByUid:g,getByDom:p,addToWorld:e,removeFromWorld:u,broadcast:l,broadcastOn:d,broadcastEvent:m}},zh=Ti("readonly-mode"),Lh=Ti("edit-mode");function Gh(n){var e=Fm(Td.sketch({dom:{classes:[Ti("outer-container")].concat(n.classes)},containerBehaviours:bo([To.config({alpha:zh,omega:Lh})])}));return Hh(e)}var $h=function(n,e){var t=de.fromTag("input");Vi(t,{opacity:"0",position:"absolute",top:"-1000px",left:"-1000px"}),Fe(n,t),Eo(t),e(t),Be(t)},Uh=function(n){var e,t,r=n.getSelection();0<r.rangeCount&&(e=r.getRangeAt(0),(t=n.document.createRange()).setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),r.removeAllRanges(),r.addRange(t))},Wh=function(n,e){Mo().each(function(n){ve(n,e)||Co(n)}),n.focus(),Eo(de.fromDom(n.document.body)),Uh(n)},Xh=function(n,e,t,r){var o=function(){Wh(e,r)},i=jg(t,"keydown",function(n){A(["input","textarea"],ye(n.target))||o()});return{toReading:function(){$h(n,Co)},toEditing:o,onToolbarTouch:function(){},destroy:function(){i.unbind()}}},qh=function(t,r,o,i,n){var u=function(){r.run(function(n){n.refreshSelection()})},e=function(n,e){var t=n-i.dom.scrollTop;r.run(function(n){n.scrollIntoView(t,t+e)})},c=function(){r.run(function(n){n.clearSelection()})},a=function(){t.getCursorBox().each(function(n){e(n.top,n.height)}),r.run(function(n){n.syncHeight()})},f=Ip(t),s=$p(a,300),l=[t.onKeyup(function(){c(),s.throttle()}),t.onNodeChanged(u),t.onDomChanged(s.throttle),t.onDomChanged(u),t.onScrollToCursor(function(n){n.preventDefault(),s.throttle()}),t.onScrollToElement(function(n){n.element,e(r,i)}),t.onToEditing(function(){r.run(function(n){n.toEditing()})}),t.onToReading(function(){r.run(function(n){n.toReading()})}),jg(t.doc,"touchend",function(n){ve(t.html,n.target)||ve(t.body,n.target)}),jg(o,"transitionend",function(n){var e;"height"===n.raw.propertyName&&(e=Li(o),r.run(function(n){n.setViewportOffset(e)}),u(),a())}),Ng(o,"touchstart",function(n){var e;r.run(function(n){n.highlightSelection()}),e=n,r.run(function(n){n.onToolbarTouch(e)}),t.onTouchToolstrip()}),jg(t.body,"touchstart",function(n){c(),t.onTouchContent(),f.fireTouchstart(n)}),f.onTouchmove(),f.onTouchend(),jg(t.body,"click",function(n){n.kill()}),jg(o,"touchmove",function(){t.onToolbarScrollStart()})];return{destroy:function(){P(l,function(n){n.unbind()})}}};var Yh,Kh,Jh,Qh,Zh={},nv={exports:Zh};Yh=undefined,Kh=Zh,Jh=nv,Qh=undefined,function(n){"object"==typeof Kh&&void 0!==Jh?Jh.exports=n():"function"==typeof Yh&&Yh.amd?Yh([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function s(i,u,c){function a(e,n){if(!u[e]){if(!i[e]){var t="function"==typeof Qh&&Qh;if(!n&&t)return t(e,!0);if(f)return f(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[e]={exports:{}};i[e][0].call(o.exports,function(n){return a(i[e][1][n]||n)},o,o.exports,s,i,u,c)}return u[e].exports}for(var f="function"==typeof Qh&&Qh,n=0;n<c.length;n++)a(c[n]);return a}({1:[function(n,e,t){var r,o,i=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function a(n){if(r===setTimeout)return setTimeout(n,0);if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(n,0);try{return r(n,0)}catch(e){try{return r.call(null,n,0)}catch(e){return r.call(this,n,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(n){r=u}try{o="function"==typeof clearTimeout?clearTimeout:c}catch(n){o=c}}();var f,s=[],l=!1,d=-1;function m(){l&&f&&(l=!1,f.length?s=f.concat(s):d=-1,s.length&&g())}function g(){if(!l){var n=a(m);l=!0;for(var e=s.length;e;){for(f=s,s=[];++d<e;)f&&f[d].run();d=-1,e=s.length}f=null,l=!1,function(n){if(o===clearTimeout)return clearTimeout(n);if((o===c||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(n);try{o(n)}catch(e){try{return o.call(null,n)}catch(e){return o.call(this,n)}}}(n)}}function p(n,e){this.fun=n,this.array=e}function h(){}i.nextTick=function(n){var e=new Array(arguments.length-1);if(1<arguments.length)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];s.push(new p(n,e)),1!==s.length||l||a(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(n){return[]},i.binding=function(n){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(n){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(n,l,e){(function(e){function r(){}function u(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=0,this._handled=!1,this._value=undefined,this._deferreds=[],s(n,this)}function o(r,o){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,u._immediateFn(function(){var n,e=1===r._state?o.onFulfilled:o.onRejected;if(null!==e){try{n=e(r._value)}catch(t){return void c(o.promise,t)}i(o.promise,n)}else(1===r._state?i:c)(o.promise,r._value)})):r._deferreds.push(o)}function i(n,e){try{if(e===n)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if(e instanceof u)return n._state=3,n._value=e,void a(n);if("function"==typeof t)return void s((r=t,o=e,function(){r.apply(o,arguments)}),n)}n._state=1,n._value=e,a(n)}catch(i){c(n,i)}var r,o}function c(n,e){n._state=2,n._value=e,a(n)}function a(n){2===n._state&&0===n._deferreds.length&&u._immediateFn(function(){n._handled||u._unhandledRejectionFn(n._value)});for(var e=0,t=n._deferreds.length;e<t;e++)o(n,n._deferreds[e]);n._deferreds=null}function f(n,e,t){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof e?e:null,this.promise=t}function s(n,e){var t=!1;try{n(function(n){t||(t=!0,i(e,n))},function(n){t||(t=!0,c(e,n))})}catch(r){if(t)return;t=!0,c(e,r)}}var n,t;n=this,t=setTimeout,u.prototype["catch"]=function(n){return this.then(null,n)},u.prototype.then=function(n,e){var t=new this.constructor(r);return o(this,new f(n,e,t)),t},u.all=function(n){var a=Array.prototype.slice.call(n);return new u(function(o,i){if(0===a.length)return o([]);var u=a.length;for(var n=0;n<a.length;n++)!function c(e,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void t.call(n,function(n){c(e,n)},i)}a[e]=n,0==--u&&o(a)}catch(r){i(r)}}(n,a[n])})},u.resolve=function(e){return e&&"object"==typeof e&&e.constructor===u?e:new u(function(n){n(e)})},u.reject=function(t){return new u(function(n,e){e(t)})},u.race=function(o){return new u(function(n,e){for(var t=0,r=o.length;t<r;t++)o[t].then(n,e)})},u._immediateFn="function"==typeof e?function(n){e(n)}:function(n){t(n,0)},u._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},u._setImmediateFn=function(n){u._immediateFn=n},u._setUnhandledRejectionFn=function(n){u._unhandledRejectionFn=n},void 0!==l&&l.exports?l.exports=u:n.Promise||(n.Promise=u)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(a,n,f){(function(n,e){var r=a("process/browser.js").nextTick,t=Function.prototype.apply,o=Array.prototype.slice,i={},u=0;function c(n,e){this._id=n,this._clearFn=e}f.setTimeout=function(){return new c(t.call(setTimeout,window,arguments),clearTimeout)},f.setInterval=function(){return new c(t.call(setInterval,window,arguments),clearInterval)},f.clearTimeout=f.clearInterval=function(n){n.close()},c.prototype.unref=c.prototype.ref=function(){},c.prototype.close=function(){this._clearFn.call(window,this._id)},f.enroll=function(n,e){clearTimeout(n._idleTimeoutId),n._idleTimeout=e},f.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},f._unrefActive=f.active=function(n){clearTimeout(n._idleTimeoutId);var e=n._idleTimeout;0<=e&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},e))},f.setImmediate="function"==typeof n?n:function(n){var e=u++,t=!(arguments.length<2)&&o.call(arguments,1);return i[e]=!0,r(function(){i[e]&&(t?n.apply(null,t):n.call(null),f.clearImmediate(e))}),e},f.clearImmediate="function"==typeof e?e:function(n){delete i[n]}}).call(this,a("timers").setImmediate,a("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(n,e,t){var r=n("promise-polyfill"),o="undefined"!=typeof window?window:Function("return this;")();e.exports={boltExport:o.Promise||r}},{"promise-polyfill":2}]},{},[4])(4)});var ev,tv=nv.exports.boltExport,rv=function(n){var t=T.none(),e=[],r=function(n){o()?u(n):e.push(n)},o=function(){return t.isSome()},i=function(n){P(n,u)},u=function(e){t.each(function(n){setTimeout(function(){e(n)},0)})};return n(function(n){o()||(t=T.some(n),i(e),e=[])}),{get:r,map:function(t){return rv(function(e){r(function(n){e(t(n))})})},isReady:o}},ov={nu:rv,pure:function(e){return rv(function(n){n(e)})}},iv=function(n){setTimeout(function(){throw n},0)},uv=function(t){var n=function(n){t().then(n,iv)};return{map:function(n){return uv(function(){return t().then(n)})},bind:function(e){return uv(function(){return t().then(function(n){return e(n).toPromise()})})},anonBind:function(n){return uv(function(){return t().then(function(){return n.toPromise()})})},toLazy:function(){return ov.nu(n)},toCached:function(){var n=null;return uv(function(){return null===n&&(n=t()),n})},toPromise:t,get:n}},cv=function(n){return uv(function(){return new tv(n)})},av=function(n){return uv(function(){return tv.resolve(n)})},fv=function(r,o){return Q([{width:320,height:480,keyboard:{portrait:300,landscape:240}},{width:320,height:568,keyboard:{portrait:300,landscape:240}},{width:375,height:667,keyboard:{portrait:305,landscape:240}},{width:414,height:736,keyboard:{portrait:320,landscape:240}},{width:768,height:1024,keyboard:{portrait:320,landscape:400}},{width:1024,height:1366,keyboard:{portrait:380,landscape:460}}],function(n){return e=r<=n.width&&o<=n.height,t=n.keyboard,e?T.some(t):T.none();var e,t}).getOr({portrait:o/5,landscape:r/4})},sv=function(n){var e,t=Hg(n).isPortrait(),r=fv((e=n).screen.width,e.screen.height),o=t?r.portrait:r.landscape;return(t?n.screen.height:n.screen.width)-n.innerHeight>o?0:o},lv=function(n,e){var t=Te(n).dom.defaultView;return Li(n)+Li(e)-sv(t)},dv=function(n,e,t){var r=lv(e,t),o=Li(e)+Li(t)-r;Ri(n,"padding-bottom",o+"px")},mv=Ut([{fixed:["element","property","offsetY"]},{scroller:["element","offsetY"]}]),gv="data-"+Ti("position-y-fixed"),pv="data-"+Ti("y-property"),hv="data-"+Ti("scrolling"),vv="data-"+Ti("last-window-height"),yv=function(n){return Vp(n,gv)},bv=function(n,e){var t=lt(n,pv);return mv.fixed(n,t,e)},xv=function(n,e){return mv.scroller(n,e)},wv=function(n){var e=yv(n);return("true"===lt(n,hv)?xv:bv)(n,e)},Sv=function(n,e,t){var r=Te(n).dom.defaultView.innerHeight;return ft(n,vv,r+"px"),r-e-t},Ov=function(r,o,i,u){var e=Te(r).dom.defaultView,n=function(n){var e=lt(n,"style");Vi(n,{position:"absolute",top:"0px"}),ft(n,gv,"0px"),ft(n,pv,"top");return{restore:function(){ft(n,"style",e||""),gt(n,gv),gt(n,pv)}}}(i),t=Li(i),c=Li(u),a=function(n,e,t){var r=lt(t,"style");yg(t),Vi(t,{position:"absolute",height:e+"px",width:"100%",top:n+"px"}),ft(t,gv,n+"px"),ft(t,hv,"true"),ft(t,pv,"top");return{restore:function(){bg(t),ft(t,"style",r||""),gt(t,gv),gt(t,hv),gt(t,pv)}}}(t,Sv(r,t,c),r),f=function(n){var e=lt(n,"style");Vi(n,{position:"absolute",bottom:"0px"}),ft(n,gv,"0px"),ft(n,pv,"bottom");return{restore:function(){ft(n,"style",e||""),gt(n,gv),gt(n,pv)}}}(u),s=!0,l=function(){var n=e.innerHeight;return Vp(r,vv)<n},d=function(){var n,e,t;s&&(n=Li(i),e=Li(u),t=Sv(r,n,e),ft(r,gv,n+"px"),Ri(r,"height",t+"px"),dv(o,r,u))};return dv(o,r,u),{setViewportOffset:function(n){ft(r,gv,n+"px"),d()},isExpanding:l,isShrinking:m(l),refresh:d,restore:function(){s=!1,n.restore(),a.restore(),f.restore()}}},Tv=(ev=null,{animate:function(o,i,u,c,e,n){var a=!1,f=function(n){a=!0,e(n)};Pg.clearInterval(ev);var s=function(n){Pg.clearInterval(ev),f(n)};ev=Pg.setInterval(function(){var n,e,t,r=o();n=r,e=i,t=u,(Math.abs(n-e)<=t?T.none():n<e?T.some(n+t):T.some(n-t)).fold(function(){Pg.clearInterval(ev),f(i)},function(n){var e;c(n,s),a||((e=o())!==n||Math.abs(e-i)>Math.abs(r-i))&&(Pg.clearInterval(ev),f(i))})},n)}}),kv="data-"+Ti("last-scroll-top"),Ev=function(n){var e=ji(n,"top").getOr("0");return parseInt(e,10)},Cv=function(n){return parseInt(n.dom.scrollTop,10)},Mv=function(o,i){return cv(function(n){var e=b(Cv,o);ft(o,kv,e());var t=Math.abs(i-e()),r=Math.ceil(t/10);Tv.animate(e,i,r,function(n,e){Vp(o,kv)!==o.dom.scrollTop?e(o.dom.scrollTop):(o.dom.scrollTop=n,ft(o,kv,n))},function(){o.dom.scrollTop=i,ft(o,kv,i),n(i)},10)})},Dv=function(n,e){var t=e+yv(n)+"px";Ri(n,"top",t)};var _v=function(u,n){return n(function(r){var o=[],i=0;0===u.length?r([]):P(u,function(n,e){var t;n.get((t=e,function(n){o[t]=n,++i>=u.length&&r(o)}))})})},Iv=function(n,e,t){var r,o,i,u=e+t,c=ji(n,"top").getOr(t),a=u-parseInt(c,10),f=n.dom.scrollTop+a;return r=n,o=f,i=u,cv(function(n){var e=b(Cv,r);Tv.animate(e,o,15,function(n){r.dom.scrollTop=n,Ri(r,"top",Ev(r)+15+"px")},function(){r.dom.scrollTop=o,Ri(r,"top",i+"px"),n(o)},10)})},Fv=function(n,o){return n.fold(function(n,e,t){return Ri(n,e,o+(r=t)+"px"),av(r);var r},function(n,e){return Iv(n,o,e)})},Rv=function(n,e){var t,r=(t=Ui(n,"["+gv+"]"),N(t,wv)),o=N(r,function(n){return Fv(n,e)});return _v(o,cv)},Vv=function(i,u,n,t,e,r){var o,c,a=(o=function(n){return t=u,r=n,o=Te(e=i).dom.defaultView,cv(function(n){Dv(e,r),Dv(t,r),o.scrollTo(0,r),n(r)});var e,t,r,o},c=ko(ov.pure({})),{start:function(e){var n=ov.nu(function(n){return o(e).get(n)});c.set(n)},idle:function(n){c.get().get(function(){n()})}}),f=$p(function(){a.idle(function(){Rv(n,t.pageYOffset).get(function(){var n;(n=jp(r),T.from(n[0]).bind(function(n){var e=n.top-u.dom.scrollTop;return e>t.innerHeight+5||e<-5?T.some({top:e,bottom:e+n.height}):T.none()})).each(function(n){u.dom.scrollTop=u.dom.scrollTop+n.top}),a.start(0),e.refresh()})})},1e3),s=jg(de.fromDom(t),"scroll",function(){t.pageYOffset<0||f.throttle()});return Rv(n,t.pageYOffset).get(v),{unbind:s.unbind}},Bv=function(n){var a=n.cWin,e=n.ceBody,f=n.socket,t=n.toolstrip,r=n.contentElement,o=n.keyboardType,i=n.outerWindow,s=n.dropup,u=n.outerBody,c=Ov(f,e,t,s),l=o(u,a,Ge(),r),d=zg(i,{onChange:O,onReady:c.refresh});d.onAdjustment(function(){c.refresh()});var m=jg(de.fromDom(i),"resize",function(){c.isExpanding()&&c.refresh()}),g=Vv(t,f,u,i,c,a),p=function(t,e){var n=t.document,r=de.fromTag("div");bt(r,Ti("unfocused-selections")),Fe(de.fromDom(n.documentElement),r);var o=jg(r,"touchstart",function(n){n.prevent(),Wh(t,e),u()}),i=function(n){var e=de.fromTag("span");return wm(e,[Ti("layer-editor"),Ti("unfocused-selection")]),Vi(e,{left:n.left+"px",top:n.top+"px",width:n.width+"px",height:n.height+"px"}),e},u=function(){Ve(r)};return{update:function(){u();var n=jp(t),e=N(n,i);Re(r,e)},isActive:function(){return 0<Ce(r).length},destroy:function(){o.unbind(),Be(r)},clear:u}}(a,r),h=function(){p.clear()};return{toEditing:function(){l.toEditing(),h()},toReading:function(){l.toReading()},onToolbarTouch:function(n){l.onToolbarTouch()},refreshSelection:function(){p.isActive()&&p.update()},clearSelection:h,highlightSelection:function(){p.update()},scrollIntoView:function(n,e){var t,r,o,i,u,c;t=a,o=n,i=e,u=lv(r=f,s),c=b(Uh,t),u<o||u<i?Mv(r,r.dom.scrollTop-u+i).get(c):o<0&&Mv(r,r.dom.scrollTop+o).get(c)},updateToolbarPadding:O,setViewportOffset:function(n){var i,u;c.setViewportOffset(n),i=f,u=n,cv(function(n){var e=b(Ev,i),t=function(n){Ri(i,"top",n+"px")},r=Math.abs(u-e()),o=Math.ceil(r/10);Tv.animate(e,u,o,t,function(){t(u),n(u)},10)}).get(v)},syncHeight:function(){Ri(r,"height",r.dom.contentWindow.document.body.scrollHeight+"px")},refreshStructure:c.refresh,destroy:function(){c.restore(),d.destroy(),g.unbind(),m.unbind(),l.destroy(),p.destroy(),$h(Ge(),Co)}}},Av=function(r,n){var o=Sp(),i=em(),u=em(),c=nm(),a=nm();return{enter:function(){n.hide();var t=de.fromDom(document);xp(r.editor).each(function(n){var e;i.set({socketHeight:ji(r.socket,"height"),iframeHeight:ji(n.frame,"height"),outerScroll:document.body.scrollTop}),u.set({exclusives:(e="."+xg,jg(t,"touchmove",function(n){Zi(n.target,e).filter(th).fold(function(){n.prevent()},O)}))}),bt(r.container,Ti("fullscreen-maximized")),Cp(r.container,n.body),o.maximize(),Ri(r.socket,"overflow","scroll"),Ri(r.socket,"-webkit-overflow-scrolling","touch"),Eo(n.body),c.set(Bv({cWin:n.win,ceBody:n.body,socket:r.socket,toolstrip:r.toolstrip,dropup:r.dropup.element,contentElement:n.frame,outerBody:r.body,outerWindow:r.win,keyboardType:Xh})),c.run(function(n){n.syncHeight()}),a.set(qh(n,c,r.toolstrip,r.socket,r.dropup))})},refreshStructure:function(){c.run(function(n){n.refreshStructure()})},exit:function(){o.restore(),a.clear(),c.clear(),n.show(),i.on(function(n){n.socketHeight.each(function(n){Ri(r.socket,"height",n)}),n.iframeHeight.each(function(n){Ri(r.editor.getFrame(),"height",n)}),document.body.scrollTop=n.scrollTop}),i.clear(),u.on(function(n){n.exclusives.unbind()}),u.clear(),wt(r.container,Ti("fullscreen-maximized")),Mp(),bg(r.toolbar),Ni(r.socket,"overflow"),Ni(r.socket,"-webkit-overflow-scrolling"),Co(r.editor.getFrame()),xp(r.editor).each(function(n){n.clearSelection()})}}};function jv(n){var e=Gh({classes:[Ti("ios-container")]}),t=rh(),r=nm(),o=oh(r),i=ih(),u=kh(function(){r.run(function(n){n.refreshStructure()})},n);e.add(t.wrapper),e.add(i),e.add(u.component);return{system:e,element:e.element,init:function(n){r.set(function(n){var e=_r("Getting IosWebapp schema",Xp,n);Ri(e.toolstrip,"width","100%"),Ri(e.container,"position","relative");var t=Fm(Up(function(){e.setReadOnly(e.readOnlyOnInit()),o.enter()},e.translate));e.alloy.add(t);var r={show:function(){e.alloy.add(t)},hide:function(){e.alloy.remove(t)}},o=Av(e,r);return{setReadOnly:e.setReadOnly,refreshStructure:o.refreshStructure,enter:o.enter,exit:o.exit,destroy:O}}(n))},exit:function(){r.run(function(n){eg.remove(i,o),n.exit()})},setToolbarGroups:function(n){var e=t.createGroups(n);t.setGroups(e)},setContextToolbar:function(n){var e=t.createGroups(n);t.setContextToolbar(e)},focusToolbar:function(){t.focus()},restoreToolbar:function(){t.restoreToolbar()},updateMode:function(n){ah(i,o,n,e.root)},socket:i,dropup:u}}var Nv=tinymce.util.Tools.resolve("tinymce.EditorManager"),Pv=function(n,e,t){n.system.broadcastOn([Vo],{command:e,state:t})},Hv=function(e){return function(){var n=function(){e._skinLoaded=!0,e.fire("SkinLoaded")};e.initialized?n():e.on("init",n)}},zv="toReading",Lv="toEditing",Gv=function(S){return{getNotificationManagerImpl:function(){return{open:y({progressBar:{value:O},close:O,text:O,getEl:y(null),moveTo:O,moveRel:O,settings:{}}),close:O,reposition:O,getArgs:y({})}},renderUI:function(){var n,e,t,r=S.getElement(),o=(n=S,{content:(e=T.from(n.getParam("skin_url")).fold(function(){return Nv.baseURL+"/skins/ui/oxide"},function(n){return n}))+"/content.mobile.min.css",ui:e+"/skin.mobile.min.css"});!1==(!1===S.getParam("skin"))?(t=_o.DOM.styleSheetLoader,S.contentCSS.push(o.content),t.load(o.ui,Hv(S)),S.on("remove",function(){return t.unload(o.ui)})):Hv(S)();var i,u,c,a,f,s,l,d,m,g=function(){S.fire("ScrollIntoView")},p=Mn().os.isAndroid()?(i=g,u=Gh({classes:[Ti("android-container")]}),c=rh(),a=nm(),f=oh(a),s=ih(),l=kh(O,i),u.add(c.wrapper),u.add(s),u.add(l.component),{system:u,element:u.element,init:function(n){a.set(qp(n))},exit:function(){a.run(function(n){n.exit(),eg.remove(s,f)})},setToolbarGroups:function(n){var e=c.createGroups(n);c.setGroups(e)},setContextToolbar:function(n){var e=c.createGroups(n);c.setContextToolbar(e)},focusToolbar:function(){c.focus()},restoreToolbar:function(){c.restoreToolbar()},updateMode:function(n){ah(s,f,n,u.root)},socket:s,dropup:l}):jv(g),h=de.fromDom(r);d=h,m=p.system,Je(d,m,_e);var v=r.ownerDocument.defaultView,y=zg(v,{onChange:function(){var n,e,t;p.system.broadcastOn([Bo],{width:(n=v,e=Mn().os.isiOS(),t=Hg(n).isPortrait(),e&&!t?n.screen.height:n.screen.width)})},onReady:O}),b=function(n,e,t,r){!1===r&&S.selection.collapse();var o=x(n,e,t);p.setToolbarGroups(!0===r?o.readOnly:o.main),S.setMode(!0===r?"readonly":"design"),S.fire(!0===r?zv:Lv),p.updateMode(r)},x=function(n,e,t){var r=n.get();return{readOnly:r.backToMask.concat(e.get()),main:r.backToMask.concat(t.get())}},w=function(n,e){return S.on(n,e),{unbind:function(){S.off(n)}}};return S.on("init",function(){p.init({editor:{getFrame:function(){return de.fromDom(S.contentAreaContainer.querySelector("iframe"))},onDomChanged:function(){return{unbind:O}},onToReading:function(n){return w(zv,n)},onToEditing:function(n){return w(Lv,n)},onScrollToCursor:function(e){S.on("ScrollIntoView",function(n){e(n)});return{unbind:function(){S.off("ScrollIntoView"),y.destroy()}}},onTouchToolstrip:function(){u()},onTouchContent:function(){var n=de.fromDom(S.editorContainer.querySelector("."+Ti("toolbar")));Do(n).bind(function(n){return p.system.getByDom(n).toOptional()}).each(ae),p.restoreToolbar(),u()},onTapContent:function(n){var e=n.target;"img"===ye(e)?(S.selection.select(e.dom),n.kill()):"a"===ye(e)&&p.system.getByDom(de.fromDom(S.editorContainer)).each(function(n){To.isAlpha(n)&&function(n){var e=document.createElement("a");e.target="_blank",e.href=n.href,e.rel="noreferrer noopener";var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),document.body.appendChild(e),e.dispatchEvent(t),document.body.removeChild(e)}(e.dom)})}},container:de.fromDom(S.editorContainer),socket:de.fromDom(S.contentAreaContainer),toolstrip:de.fromDom(S.editorContainer.querySelector("."+Ti("toolstrip"))),toolbar:de.fromDom(S.editorContainer.querySelector("."+Ti("toolbar"))),dropup:p.dropup,alloy:p.system,translate:O,setReadOnly:function(n){b(g,m,d,n)},readOnlyOnInit:function(){return!1}});var t,n,r,o,i,e,u=function(){p.dropup.disappear(function(){p.system.broadcastOn([Ao],{})})},c={label:"The first group",scrollable:!1,items:[Pf("back",function(){S.selection.collapse(),p.exit()},{},S)]},a={label:"Back to read only",scrollable:!1,items:[Pf("readonly-back",function(){b(g,m,d,!0)},{},S)]},f=Fg(p,S),s=(t=f,n=Ig(S),r={},W(n,function(n){var e=!ct(r,n)&&ct(t,n)&&t[n].isSupported()?[t[n].sketch()]:[];return r[n]=!0,e})),l={label:"The extra group",scrollable:!1,items:[]},d=ko([{label:"the action group",scrollable:!0,items:s},l]),m=ko([{label:"The read only mode group",scrollable:!0,items:[]},l]),g=ko({backToMask:[c],backToReadOnly:[a]});o=p,e=Qe((i=S).formatter.get()),P(e,function(e){i.formatter.formatChanged(e,function(n){Pv(o,e,n)})}),P(["ul","ol"],function(t){i.selection.selectorChanged(t,function(n,e){Pv(o,t,n)})})}),S.on("remove",function(){p.exit()}),S.on("detach",function(){var e,n;e=p.system,n=Ce(e.element),P(n,function(n){e.getByDom(n).each(Ue)}),Be(e.element),p.system.destroy()}),{iframeContainer:p.socket.element.dom,editorContainer:p.element.dom}}}};Io.add("mobile",Gv)}();
|
@@ -4,6 +4,6 @@
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
6
6
|
*
|
7
|
-
* Version: 5.6.
|
7
|
+
* Version: 5.6.2 (2020-12-08)
|
8
8
|
*/
|
9
|
-
!function(){"use strict";var $=function(){},i=function(e,o){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(o.apply(null,t))}},at=function(t){return function(){return t}},ct=function(t){return t};function y(o){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=r.concat(t);return o.apply(null,e)}}var x=function(n){return function(t){return!n(t)}},u=function(t){return function(){throw new Error(t)}},c=at(!1),b=at(!0),t=tinymce.util.Tools.resolve("tinymce.ThemeManager"),it=function(){return(it=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};function w(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]]);return e}function S(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;for(var o=Array(t),r=0,n=0;n<e;n++)for(var i=arguments[n],u=0,a=i.length;u<a;u++,r++)o[r]=i[u];return o}var n,e,o,r,s,a,l=function(){return f},f=(n=function(t){return t.isNone()},{fold:function(t,n){return t()},is:c,isSome:c,isNone:b,getOr:o=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:at(null),getOrUndefined:at(undefined),or:o,orThunk:e,map:l,each:$,bind:l,exists:c,forall:b,filter:l,equals:n,equals_:n,toArray:function(){return[]},toString:at("none()")}),d=function(e){var t=at(e),n=function(){return r},o=function(t){return t(e)},r={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:b,isNone:c,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return d(t(e))},each:function(t){t(e)},bind:o,exists:o,forall:o,filter:function(t){return t(e)?r:f},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(c,function(t){return n(e,t)})}};return r},st={some:d,none:l,from:function(t){return null===t||t===undefined?f:d(t)}},m=function(o){return function(t){return e=typeof(n=t),(null===n?"null":"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e)===o;var n,e}},g=function(n){return function(t){return typeof t===n}},k=m("string"),C=m("object"),p=m("array"),O=g("boolean"),h=(r=undefined,function(t){return r===t}),v=function(t){return!(null===(n=t)||n===undefined);var n},_=g("function"),ut=g("number"),T=function(t,n){if(p(t)){for(var e=0,o=t.length;e<o;++e)if(!n(t[e]))return!1;return!0}return!1},E=Array.prototype.slice,D=Array.prototype.indexOf,B=Array.prototype.push,A=function(t,n){return D.call(t,n)},M=function(t,n){return-1<A(t,n)},F=function(t,n){for(var e=0,o=t.length;e<o;e++){if(n(t[e],e))return!0}return!1},I=function(t,n){for(var e=[],o=0;o<t;o++)e.push(n(o));return e},R=function(t,n){for(var e=[],o=0;o<t.length;o+=n){var r=E.call(t,o,o+n);e.push(r)}return e},V=function(t,n){for(var e=t.length,o=new Array(e),r=0;r<e;r++){var i=t[r];o[r]=n(i,r)}return o},lt=function(t,n){for(var e=0,o=t.length;e<o;e++){n(t[e],e)}},P=function(t,n){for(var e=[],o=[],r=0,i=t.length;r<i;r++){var u=t[r];(n(u,r)?e:o).push(u)}return{pass:e,fail:o}},H=function(t,n){for(var e=[],o=0,r=t.length;o<r;o++){var i=t[o];n(i,o)&&e.push(i)}return e},z=function(t,n,e){return function(t,n){for(var e=t.length-1;0<=e;e--){n(t[e],e)}}(t,function(t){e=n(e,t)}),e},N=function(t,n,e){return lt(t,function(t){e=n(e,t)}),e},L=function(t,n){return function(t,n,e){for(var o=0,r=t.length;o<r;o++){var i=t[o];if(n(i,o))return st.some(i);if(e(i,o))break}return st.none()}(t,n,c)},j=function(t,n){for(var e=0,o=t.length;e<o;e++){if(n(t[e],e))return st.some(e)}return st.none()},ft=function(t){for(var n=[],e=0,o=t.length;e<o;++e){if(!p(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);B.apply(n,t[e])}return n},U=function(t,n){return ft(V(t,n))},W=function(t,n){for(var e=0,o=t.length;e<o;++e){if(!0!==n(t[e],e))return!1}return!0},G=function(t){var n=E.call(t,0);return n.reverse(),n},X=function(t,n){return H(t,function(t){return!M(n,t)})},Y=function(t,n){var e=E.call(t,0);return e.sort(n),e},q=function(t,n){return 0<=n&&n<t.length?st.some(t[n]):st.none()},K=function(t){return q(t,0)},J=function(t){return q(t,t.length-1)},Q=_(Array.from)?Array.from:function(t){return E.call(t)},Z=function(t,n){for(var e=0;e<t.length;e++){var o=n(t[e],e);if(o.isSome())return o}return st.none()},tt=function(e){return{is:function(t){return e===t},isValue:b,isError:c,getOr:at(e),getOrThunk:at(e),getOrDie:at(e),or:function(t){return tt(e)},orThunk:function(t){return tt(e)},fold:function(t,n){return n(e)},map:function(t){return tt(t(e))},mapError:function(t){return tt(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return st.some(e)}}},nt=function(e){return{is:c,isValue:c,isError:b,getOr:ct,getOrThunk:function(t){return t()},getOrDie:function(){return u(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return nt(e)},mapError:function(t){return nt(t(e))},each:$,bind:function(t){return nt(e)},exists:c,forall:b,toOptional:st.none}},dt={value:tt,error:nt,fromOption:function(t,n){return t.fold(function(){return nt(n)},tt)}};(a=s=s||{})[a.Error=0]="Error",a[a.Value=1]="Value";var et,ot,rt=function(t,n,e){return t.stype===s.Error?n(t.serror):e(t.svalue)},mt=function(t){return{stype:s.Value,svalue:t}},gt=function(t){return{stype:s.Error,serror:t}},pt=function(t){return t.fold(gt,mt)},ht=function(t){return rt(t,dt.error,dt.value)},vt=mt,bt=function(t){var n=[],e=[];return lt(t,function(t){rt(t,function(t){return e.push(t)},function(t){return n.push(t)})}),{values:n,errors:e}},yt=gt,xt=function(t,n){return t.stype===s.Value?n(t.svalue):t},wt=function(t,n){return t.stype===s.Error?n(t.serror):t},St=function(t,n){return t.stype===s.Value?{stype:s.Value,svalue:n(t.svalue)}:t},kt=function(t,n){return t.stype===s.Error?{stype:s.Error,serror:n(t.serror)}:t},Ct=Object.keys,Ot=Object.hasOwnProperty,_t=function(t,n){for(var e=Ct(t),o=0,r=e.length;o<r;o++){var i=e[o];n(t[i],i)}},Tt=function(t,e){return Et(t,function(t,n){return{k:n,v:e(t,n)}})},Et=function(t,o){var r={};return _t(t,function(t,n){var e=o(t,n);r[e.k]=e.v}),r},Dt=function(t,n){var e,o,r,i,u={};return e=n,i=u,o=function(t,n){i[n]=t},r=$,_t(t,function(t,n){(e(t,n)?o:r)(t,n)}),u},Bt=function(t,e){var o=[];return _t(t,function(t,n){o.push(e(t,n))}),o},At=function(t,n){for(var e=Ct(t),o=0,r=e.length;o<r;o++){var i=e[o],u=t[i];if(n(u,i,t))return st.some(u)}return st.none()},Mt=function(t){return Bt(t,function(t){return t})},Ft=function(t,n){return It(t,n)?st.from(t[n]):st.none()},It=function(t,n){return Ot.call(t,n)},Rt=function(t,n){return It(t,n)&&t[n]!==undefined&&null!==t[n]},Vt=function(u){if(!p(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],e={};return lt(u,function(t,o){var n=Ct(t);if(1!==n.length)throw new Error("one and only one name per case");var r=n[0],i=t[r];if(e[r]!==undefined)throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!p(i))throw new Error("case arguments must be an array");a.push(r),e[r]=function(){var t=arguments.length;if(t!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+t);for(var e=new Array(t),n=0;n<e.length;n++)e[n]=arguments[n];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[o].apply(null,e)},match:function(t){var n=Ct(t);if(a.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+n.join(","));if(!W(a,function(t){return M(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+a.join(", "));return t[r].apply(null,e)},log:function(t){console.log(t,{constructors:a,constructor:r,params:e})}}}}),e},Pt=Object.prototype.hasOwnProperty,Ht=function(u){return function(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var e={},o=0;o<t.length;o++){var r=t[o];for(var i in r)Pt.call(r,i)&&(e[i]=u(e[i],r[i]))}return e}},zt=Ht(function(t,n){return C(t)&&C(n)?zt(t,n):n}),Nt=Ht(function(t,n){return n}),Lt=function(e){var o,r=!1;return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r||(r=!0,o=e.apply(null,t)),o}},jt=Vt([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Ut=function(t){return jt.defaultedThunk(at(t))},Wt=jt.strict,Gt=jt.asOption,Xt=jt.defaultedThunk,Yt=(jt.asDefaultedOptionThunk,jt.mergeWithThunk),qt=(Vt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t,n){var e={};return e[t]=n,e}),Kt=function(t,n){return e=n,o={},_t(t,function(t,n){M(e,n)||(o[n]=t)}),o;var e,o},Jt=qt,$t=function(t){return n={},lt(t,function(t){n[t.key]=t.value}),n;var n},Qt=function(t,n){var e,o,r,i,u,a=(e=[],o=[],lt(t,function(t){t.fold(function(t){e.push(t)},function(t){o.push(t)})}),{errors:e,values:o});return 0<a.errors.length?(u=a.errors,dt.error(ft(u))):(i=n,0===(r=a.values).length?dt.value(i):dt.value(zt(i,Nt.apply(undefined,r))))},Zt=function(t){return i(yt,ft)(t)},tn=function(t,n){var e,o,r=bt(t);return 0<r.errors.length?Zt(r.errors):(e=r.values,o=n,0<e.length?vt(zt(o,Nt.apply(undefined,e))):vt(o))},nn=function(t){var n=bt(t);return 0<n.errors.length?Zt(n.errors):vt(n.values)},en=function(t){return C(t)&&100<Ct(t).length?" removed due to size":JSON.stringify(t,null,2)},on=function(t,n){return yt([{path:t,getErrorInfo:n}])},rn=Vt([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),un=function(e,o,r){return Ft(o,r).fold(function(){return t=r,n=o,on(e,function(){return'Could not find valid *strict* value for "'+t+'" in '+en(n)});var t,n},vt)},an=function(t,n,e){var o=Ft(t,n).fold(function(){return e(t)},ct);return vt(o)},cn=function(a,c,t,s){return t.fold(function(r,e,t,o){var i=function(t){var n=o.extract(a.concat([r]),s,t);return St(n,function(t){return qt(e,s(t))})},u=function(t){return t.fold(function(){var t=qt(e,s(st.none()));return vt(t)},function(t){var n=o.extract(a.concat([r]),s,t);return St(n,function(t){return qt(e,s(st.some(t)))})})};return t.fold(function(){return xt(un(a,c,r),i)},function(t){return xt(an(c,r,t),i)},function(){return xt(vt(Ft(c,r)),u)},function(t){return xt((e=t,o=Ft(n=c,r).map(function(t){return!0===t?e(n):t}),vt(o)),u);var n,e,o},function(t){var n=t(c),e=St(an(c,r,at({})),function(t){return zt(n,t)});return xt(e,i)})},function(t,n){var e=n(c);return vt(qt(t,s(e)))})},sn=function(o){return{extract:function(e,t,n){return wt(o(n,t),function(t){return n=t,on(e,function(){return n});var n})},toString:function(){return"val"}}},ln=function(t){var u=fn(t),a=z(t,function(n,t){return t.fold(function(t){return zt(n,Jt(t,!0))},at(n))},{});return{extract:function(t,n,e){var o,r=O(e)?[]:Ct(Dt(e,function(t){return t!==undefined&&null!==t})),i=H(r,function(t){return!Rt(a,t)});return 0===i.length?u.extract(t,n,e):(o=i,on(t,function(){return"There are unsupported fields: ["+o.join(", ")+"] specified"}))},toString:u.toString}},fn=function(a){return{extract:function(t,n,e){return o=t,r=e,i=n,u=V(a,function(t){return cn(o,r,t,i)}),tn(u,{});var o,r,i,u},toString:function(){return"obj{\n"+V(a,function(t){return t.fold(function(t,n,e,o){return t+" -> "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"}}},dn=function(r){return{extract:function(e,o,t){var n=V(t,function(t,n){return r.extract(e.concat(["["+n+"]"]),o,t)});return nn(n)},toString:function(){return"array("+r.toString()+")"}}},mn=function(a){return{extract:function(t,n,e){for(var o=[],r=0,i=a;r<i.length;r++){var u=i[r].extract(t,n,e);if(u.stype===s.Value)return u;o.push(u)}return nn(o)},toString:function(){return"oneOf("+V(a,function(t){return t.toString()}).join(", ")+")"}}},gn=function(a,c){return{extract:function(e,o,r){var t,n,i=Ct(r),u=(t=e,n=i,dn(sn(a)).extract(t,ct,n));return xt(u,function(t){var n=V(t,function(t){return rn.field(t,t,Wt(),c)});return fn(n).extract(e,o,r)})},toString:function(){return"setOf("+c.toString()+")"}}},pn=at(sn(vt)),hn=i(dn,fn),vn=rn.state,bn=rn.field,yn=function(e,n,o,r,i){return Ft(r,i).fold(function(){return t=r,n=i,on(e,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+en(t)});var t,n},function(t){return t.extract(e.concat(["branch: "+i]),n,o)})},xn=function(r,i){return{extract:function(n,e,o){return Ft(o,r).fold(function(){return t=r,on(n,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return yn(n,e,o,i,t)})},toString:function(){return"chooseOn("+r+"). Possible values: "+Ct(i)}}},wn=sn(vt),Sn=function(t){return hn(t)},kn=function(o){return{extract:function(t,n,e){return o().extract(t,n,e)},toString:function(){return o().toString()}}},Cn=function(n){return sn(function(t){return n(t).fold(yt,vt)})},On=function(n,t){return gn(function(t){return pt(n(t))},t)},_n=function(t,n,e){return ht((o=t,r=ct,i=e,u=n.extract([o],r,i),kt(u,function(t){return{input:i,errors:t}})));var o,r,i,u},Tn=function(t){return t.fold(function(t){throw new Error(Dn(t))},ct)},En=function(t,n,e){return Tn(_n(t,n,e))},Dn=function(t){return"Errors: \n"+(n=t.errors,e=10<n.length?n.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):n,V(e,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}).join("\n"))+"\n\nInput object: "+en(t.input);var n,e},Bn=xn,An=function(t,n){return xn(t,Tt(n,fn))},Mn=at(wn),Fn=function(e,o){return sn(function(t){var n=typeof t;return e(t)?vt(t):yt("Expected type: "+o+" but got: "+n)})},In=Fn(ut,"number"),Rn=Fn(k,"string"),Vn=Fn(O,"boolean"),Pn=Fn(_,"function"),Hn=function(n){var t=function(t,n){for(var e=t.next();!e.done;){if(!n(e.value))return!1;e=t.next()}return!0};if(Object(n)!==n)return!0;switch({}.toString.call(n).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(n).every(function(t){return Hn(n[t])});case"Map":return t(n.keys(),Hn)&&t(n.values(),Hn);case"Set":return t(n.keys(),Hn);default:return!1}},zn=sn(function(t){return Hn(t)?vt(t):yt("Expected value to be acceptable for sending via postMessage")}),Nn=function(n){return Cn(function(t){return M(n,t)?dt.value(t):dt.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},Ln=function(t){return bn(t,t,Wt(),pn())},jn=function(t,n){return bn(t,t,Wt(),n)},Un=function(t){return jn(t,Rn)},Wn=function(t,n){return bn(t,t,Wt(),Nn(n))},Gn=function(t){return jn(t,Pn)},Xn=function(t,n){return bn(t,t,Wt(),fn(n))},Yn=function(t,n){return bn(t,t,Wt(),hn(n))},qn=function(t,n){return bn(t,t,Wt(),dn(n))},Kn=function(t){return bn(t,t,Gt(),pn())},Jn=function(t,n){return bn(t,t,Gt(),n)},$n=function(t){return Jn(t,In)},Qn=function(t){return Jn(t,Rn)},Zn=function(t){return Jn(t,Pn)},te=function(t,n){return Jn(t,fn(n))},ne=function(t,n){return bn(t,t,Ut(n),pn())},ee=function(t,n,e){return bn(t,t,Ut(n),e)},oe=function(t,n){return ee(t,n,In)},re=function(t,n){return ee(t,n,Rn)},ie=function(t,n,e){return ee(t,n,Nn(e))},ue=function(t,n){return ee(t,n,Vn)},ae=function(t,n){return ee(t,n,Pn)},ce=function(t,n,e){return ee(t,n,dn(e))},se=function(t,n,e){return ee(t,n,fn(e))},le=function(t,n){return vn(t,n)},fe=function(t){var n=t;return{get:function(){return n},set:function(t){n=t}}},de=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:t}},me={fromHtml:function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1<e.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return de(e.childNodes[0])},fromTag:function(t,n){var e=(n||document).createElement(t);return de(e)},fromText:function(t,n){var e=(n||document).createTextNode(t);return de(e)},fromDom:de,fromPoint:function(t,n,e){return st.from(t.dom.elementFromPoint(n,e)).map(de)}},ge=function(t,n){var e=function(t,n){for(var e=0;e<t.length;e++){var o=t[e];if(o.test(n))return o}return undefined}(t,n);if(!e)return{major:0,minor:0};var o=function(t){return Number(n.replace(e,"$"+t))};return he(o(1),o(2))},pe=function(){return he(0,0)},he=function(t,n){return{major:t,minor:n}},ve={nu:he,detect:function(t,n){var e=String(n).toLowerCase();return 0===t.length?pe():ge(t,e)},unknown:pe},be=function(t,n){var e=String(n).toLowerCase();return L(t,function(t){return t.search(e)})},ye=function(t,e){return be(t,e).map(function(t){var n=ve.detect(t.versionRegexes,e);return{current:t.name,version:n}})},xe=function(t,e){return be(t,e).map(function(t){var n=ve.detect(t.versionRegexes,e);return{current:t.name,version:n}})},we=function(t,n){return-1!==t.indexOf(n)},Se=function(t,n){return o=n,r=(e=t).length-n.length,""===o||e.length>=o.length&&e.substr(r,r+o.length)===o;var e,o,r},ke=(et=/^\s+|\s+$/g,function(t){return t.replace(et,"")}),Ce=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Oe=function(n){return function(t){return we(t,n)}},_e=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return we(t,"edge/")&&we(t,"chrome")&&we(t,"safari")&&we(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ce],search:function(t){return we(t,"chrome")&&!we(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return we(t,"msie")||we(t,"trident")}},{name:"Opera",versionRegexes:[Ce,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Oe("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Oe("firefox")},{name:"Safari",versionRegexes:[Ce,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(we(t,"safari")||we(t,"mobile/"))&&we(t,"applewebkit")}}],Te=[{name:"Windows",search:Oe("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return we(t,"iphone")||we(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Oe("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Oe("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Oe("linux"),versionRegexes:[]},{name:"Solaris",search:Oe("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Oe("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Oe("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ee={browsers:at(_e),oses:at(Te)},De="Firefox",Be=function(t){var n=t.current,e=t.version,o=function(t){return function(){return n===t}};return{current:n,version:e,isEdge:o("Edge"),isChrome:o("Chrome"),isIE:o("IE"),isOpera:o("Opera"),isFirefox:o(De),isSafari:o("Safari")}},Ae={unknown:function(){return Be({current:undefined,version:ve.unknown()})},nu:Be,edge:at("Edge"),chrome:at("Chrome"),ie:at("IE"),opera:at("Opera"),firefox:at(De),safari:at("Safari")},Me="Windows",Fe="Android",Ie="Solaris",Re="FreeBSD",Ve="ChromeOS",Pe=function(t){var n=t.current,e=t.version,o=function(t){return function(){return n===t}};return{current:n,version:e,isWindows:o(Me),isiOS:o("iOS"),isAndroid:o(Fe),isOSX:o("OSX"),isLinux:o("Linux"),isSolaris:o(Ie),isFreeBSD:o(Re),isChromeOS:o(Ve)}},He={unknown:function(){return Pe({current:undefined,version:ve.unknown()})},nu:Pe,windows:at(Me),ios:at("iOS"),android:at(Fe),linux:at("Linux"),osx:at("OSX"),solaris:at(Ie),freebsd:at(Re),chromeos:at(Ve)},ze=function(t,n){var e,o,r,i,u,a,c,s,l,f,d,m,g=Ee.browsers(),p=Ee.oses(),h=ye(g,t).fold(Ae.unknown,Ae.nu),v=xe(p,t).fold(He.unknown,He.nu);return{browser:h,os:v,deviceType:(o=h,r=t,i=n,u=(e=v).isiOS()&&!0===/ipad/i.test(r),a=e.isiOS()&&!u,c=e.isiOS()||e.isAndroid(),s=c||i("(pointer:coarse)"),l=u||!a&&c&&i("(min-device-width:768px)"),f=a||c&&!l,d=o.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),m=!f&&!l&&!d,{isiPad:at(u),isiPhone:at(a),isTablet:at(l),isPhone:at(f),isTouch:at(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:at(d),isDesktop:at(m)})}},Ne=function(t){return window.matchMedia(t).matches},Le=Lt(function(){return ze(navigator.userAgent,Ne)}),je=function(){return Le()},Ue=function(t,n){var e=t.dom;if(1!==e.nodeType)return!1;var o=e;if(o.matches!==undefined)return o.matches(n);if(o.msMatchesSelector!==undefined)return o.msMatchesSelector(n);if(o.webkitMatchesSelector!==undefined)return o.webkitMatchesSelector(n);if(o.mozMatchesSelector!==undefined)return o.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},We=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Ge=function(t,n){return t.dom===n.dom},Xe=function(t,n){return e=t.dom,o=n.dom,r=e,i=o,u=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(r.compareDocumentPosition(i)&u);var e,o,r,i,u},Ye=function(t,n){return je().browser.isIE()?Xe(t,n):(e=n,o=t.dom,r=e.dom,o!==r&&o.contains(r));var e,o,r},qe=function(t){return _(t)?t:c},Ke=function(t,n,e){for(var o=t.dom,r=qe(e);o.parentNode;){o=o.parentNode;var i=me.fromDom(o),u=n(i);if(u.isSome())return u;if(r(i))break}return st.none()},Je=function(t,n,e){var o=n(t),r=qe(e);return o.orThunk(function(){return r(t)?st.none():Ke(t,n,r)})},$e=function(t,n){return Ge(t.element,n.event.target)},Qe=function(t){if(!Rt(t,"can")&&!Rt(t,"abort")&&!Rt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return En("Extracting event.handler",ln([ne("can",b),ne("abort",c),ne("run",$)]),t)},Ze=function(e){var n,o,r,i,t=(o=function(t){return t.can},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return N(n,function(t,n){return t&&o(n).apply(undefined,e)},!0)}),u=(r=n=e,i=function(t){return t.abort},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return N(r,function(t,n){return t||i(n).apply(undefined,e)},!1)});return Qe({can:t,abort:u,run:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];lt(e,function(t){t.run.apply(undefined,n)})}})},to=at,no=to("touchstart"),eo=to("touchmove"),oo=to("touchend"),ro=to("touchcancel"),io=to("mousedown"),uo=to("mousemove"),ao=to("mouseout"),co=to("mouseup"),so=to("mouseover"),lo=to("focusin"),fo=to("focusout"),mo=to("keydown"),go=to("keyup"),po=to("input"),ho=to("change"),vo=to("click"),bo=to("transitionend"),yo=to("selectstart"),xo=function(t){return at("alloy."+t)},wo={tap:xo("tap")},So=xo("focus"),ko=xo("blur.post"),Co=xo("paste.post"),Oo=xo("receive"),_o=xo("execute"),To=xo("focus.item"),Eo=wo.tap,Do=xo("longpress"),Bo=xo("sandbox.close"),Ao=xo("typeahead.cancel"),Mo=xo("system.init"),Fo=xo("system.touchmove"),Io=xo("system.touchend"),Ro=xo("system.scroll"),Vo=xo("system.resize"),Po=xo("system.attached"),Ho=xo("system.detached"),zo=xo("system.dismissRequested"),No=xo("system.repositionRequested"),Lo=xo("focusmanager.shifted"),jo=xo("slotcontainer.visibility"),Uo=xo("change.tab"),Wo=xo("dismiss.tab"),Go=xo("highlight"),Xo=xo("dehighlight"),Yo=function(t,n){$o(t,t.element,n,{})},qo=function(t,n,e){$o(t,t.element,n,e)},Ko=function(t){Yo(t,_o())},Jo=function(t,n,e){$o(t,n,e,{})},$o=function(t,n,e,o){var r=it({target:n},o);t.getSystem().triggerEvent(e,n,r)},Qo=function(t,n,e,o){t.getSystem().triggerEvent(e,n,o.event)},Zo=$t,tr=function(t,n){return{key:t,value:Qe({abort:n})}},nr=function(t){return{key:t,value:Qe({run:function(t,n){n.event.prevent()}})}},er=function(t,n){return{key:t,value:Qe({run:n})}},or=function(t,e,o){return{key:t,value:Qe({run:function(t,n){e.apply(undefined,[t,n].concat(o))}})}},rr=function(t){return function(e){return{key:t,value:Qe({run:function(t,n){$e(t,n)&&e(t,n)}})}}},ir=function(t,n,e){var o,r,i=n.partUids[e];return r=i,er(o=t,function(t,n){t.getSystem().getByUid(r).each(function(t){Qo(t,t.element,o,n)})})},ur=function(t,r){return er(t,function(n,t){var e=t.event,o=n.getSystem().getByDom(e.target).fold(function(){return Je(e.target,function(t){return n.getSystem().getByDom(t).toOptional()},c).getOr(n)},function(t){return t});r(n,o,t)})},ar=function(t){return er(t,function(t,n){n.cut()})},cr=function(t,n){return rr(t)(n)},sr=rr(Po()),lr=rr(Ho()),fr=rr(Mo()),dr=(ot=_o(),function(t){return er(ot,t)}),mr=("undefined"!=typeof window||Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),gr=function(n){return function(t){return t.dom.nodeType===n}},pr=gr(1),hr=gr(3),vr=gr(9),br=gr(11),yr=function(t){return me.fromDom(t.dom.ownerDocument)},xr=function(t){return vr(t)?t:yr(t)},wr=function(t){return me.fromDom(xr(t).dom.documentElement)},Sr=function(t){return me.fromDom(xr(t).dom.defaultView)},kr=function(t){return st.from(t.dom.parentNode).map(me.fromDom)},Cr=kr,Or=function(t){return st.from(t.dom.offsetParent).map(me.fromDom)},_r=function(t){return V(t.dom.childNodes,me.fromDom)},Tr=function(t,n){var e=t.dom.childNodes;return st.from(e[n]).map(me.fromDom)},Er=function(n,e){kr(n).each(function(t){t.dom.insertBefore(e.dom,n.dom)})},Dr=function(t,n){var e;(e=t,st.from(e.dom.nextSibling).map(me.fromDom)).fold(function(){kr(t).each(function(t){Ar(t,n)})},function(t){Er(t,n)})},Br=function(n,e){Tr(n,0).fold(function(){Ar(n,e)},function(t){n.dom.insertBefore(e.dom,t.dom)})},Ar=function(t,n){t.dom.appendChild(n.dom)},Mr=function(n,t){lt(t,function(t){Ar(n,t)})},Fr=function(t){t.dom.textContent="",lt(_r(t),function(t){Ir(t)})},Ir=function(t){var n=t.dom;null!==n.parentNode&&n.parentNode.removeChild(n)},Rr=function(t){var n,e=_r(t);0<e.length&&(n=t,lt(e,function(t){Er(n,t)})),Ir(t)},Vr=function(t){return t.dom.innerHTML},Pr=function(t,n){var e,o,r=yr(t).dom,i=me.fromDom(r.createDocumentFragment()),u=(e=n,(o=(r||document).createElement("div")).innerHTML=e,_r(me.fromDom(o)));Mr(i,u),Fr(t),Ar(t,i)},Hr=function(t,n,e){if(!(k(e)||O(e)||ut(e)))throw console.error("Invalid call to Attribute.set. Key ",n,":: Value ",e,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,e+"")},zr=function(t,n,e){Hr(t.dom,n,e)},Nr=function(t,n){var e=t.dom.getAttribute(n);return null===e?undefined:e},Lr=function(t,n){return st.from(Nr(t,n))},jr=function(t,n){var e=t.dom;return!(!e||!e.hasAttribute)&&e.hasAttribute(n)},Ur=function(t,n){t.dom.removeAttribute(n)},Wr=function(t){return n=t,e=!1,me.fromDom(n.dom.cloneNode(e));var n,e},Gr=function(t){var n,e,o,r=Wr(t);return n=r,e=me.fromTag("div"),o=me.fromDom(n.dom.cloneNode(!0)),Ar(e,o),Vr(e)},Xr=Zo([{key:So(),value:Qe({can:function(t,n){var e,o,r=n.event,i=r.originator,u=r.target;return o=u,!(Ge(e=i,t.element)&&!Ge(e,o))||(console.warn(So()+" did not get interpreted by the desired target. \nOriginator: "+Gr(i)+"\nTarget: "+Gr(u)+"\nCheck the "+So()+" event handlers"),!1)}})}]),Yr=/* */Object.freeze({__proto__:null,events:Xr}),qr=0,Kr=function(t){var n=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++qr+String(n)},Jr=at("alloy-id-"),$r=at("data-alloy-id"),Qr=Jr(),Zr=$r(),ti=function(t,n){Object.defineProperty(t.dom,Zr,{value:n,writable:!0})},ni=function(t){var n=pr(t)?t.dom[Zr]:null;return st.from(n)},ei=Kr,oi=ct,ri=function(n){var t=function(t){return function(){throw new Error("The component must be in a context to send: "+t+(n?"\n"+Gr(n().element)+" is not in context.":""))}};return{debugInfo:at("fake"),triggerEvent:t("triggerEvent"),triggerFocus:t("triggerFocus"),triggerEscape:t("triggerEscape"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),broadcast:t("broadcast"),broadcastOn:t("broadcastOn"),broadcastEvent:t("broadcastEvent"),isConnected:c}},ii=ri(),ui=function(t){return V(t,function(t){return Se(t,"/*")?t.substring(0,t.length-"/*".length):t})},ai=function(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:ui(i)}},t},ci=Kr("alloy-premade"),si=function(t){return Jt(ci,t)},li=function(o){return t=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return o.apply(void 0,S([t.getApis(),t],n))},n=o.toString(),e=n.indexOf(")")+1,r=n.indexOf("("),i=n.substring(r+1,e-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ui(i.slice(1))}},t;var t,n,e,r,i},fi={init:function(){return di({readState:function(){return"No State required"}})}},di=function(t){return t},mi=function(t,r){var i={};return _t(t,function(t,o){_t(t,function(t,n){var e=Ft(i,n).getOr([]);i[n]=e.concat([r(o,t)])})}),i},gi=function(t){return{classes:t.classes!==undefined?t.classes:[],attributes:t.attributes!==undefined?t.attributes:{},styles:t.styles!==undefined?t.styles:{}}},pi=function(t,n){return{cHandler:y.apply(undefined,[t.handler].concat(n)),purpose:t.purpose}},hi=function(t){return t.cHandler},vi=function(t,n){return{name:t,handler:n}},bi=function(t,n,e){var o,r,i=it(it({},e),(o=t,r={},lt(n,function(t){r[t.name()]=t.handlers(o)}),r));return mi(i,vi)},yi=function(t){var n,i=_(n=t)?{can:at(!0),abort:at(!1),run:n}:n;return function(t,n){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var r=[t,n].concat(e);i.abort.apply(undefined,r)?n.stop():i.can.apply(undefined,r)&&i.run.apply(undefined,r)}},xi=function(t,n,e){var o,r,i=n[e];return i?function(u,a,t,c){try{var n=Y(t,function(t,n){var e=t[a],o=n[a],r=c.indexOf(e),i=c.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+e+".\nOrder specified: "+JSON.stringify(c,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(c,null,2));return r<i?-1:i<r?1:0});return dt.value(n)}catch(e){return dt.error([e])}}("Event: "+e,"name",t,i).map(function(t){var n=V(t,function(t){return t.handler});return Ze(n)}):(o=e,r=t,dt.error(["The event ("+o+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(V(r,function(t){return t.name}),null,2)]))},wi=function(t,i){var n=Bt(t,function(o,r){return(1===o.length?dt.value(o[0].handler):xi(o,i,r)).map(function(t){var n=yi(t),e=1<o.length?H(i[r],function(n){return F(o,function(t){return t.name===n})}).join(" > "):o[0].name;return Jt(r,{handler:n,purpose:e})})});return Qt(n,{})},Si="alloy.base.behaviour",ki=function(t){var n,e;return _n("custom.definition",fn([bn("dom","dom",Wt(),fn([Ln("tag"),ne("styles",{}),ne("classes",[]),ne("attributes",{}),Kn("value"),Kn("innerHtml")])),Ln("components"),Ln("uid"),ne("events",{}),ne("apis",{}),bn("eventOrder","eventOrder",((n={})[_o()]=["disabling",Si,"toggling","typeaheadevents"],n[So()]=[Si,"focusing","keying"],n[Mo()]=[Si,"disabling","toggling","representing"],n[po()]=[Si,"representing","streaming","invalidating"],n[Ho()]=[Si,"representing","item-events","tooltipping"],n[io()]=["focusing",Si,"item-type-events"],n[no()]=["focusing",Si,"item-type-events"],n[so()]=["item-type-events","tooltipping"],n[Oo()]=["receiving","reflecting","tooltipping"],e=n,jt.mergeWithThunk(at(e))),Mn()),Kn("domModification")]),t)},Ci=function(t,n){var e=Nr(t,n);return e===undefined||""===e?[]:e.split(" ")},Oi=function(t){return t.dom.classList!==undefined},_i=function(t,n){return r=n,i=Ci(e=t,o="class").concat([r]),zr(e,o,i.join(" ")),!0;var e,o,r,i},Ti=function(t,n){return r=n,0<(i=H(Ci(e=t,o="class"),function(t){return t!==r})).length?zr(e,o,i.join(" ")):Ur(e,o),!1;var e,o,r,i},Ei=function(t,n){Oi(t)?t.dom.classList.add(n):_i(t,n)},Di=function(t){0===(Oi(t)?t.dom.classList:Ci(t,"class")).length&&Ur(t,"class")},Bi=function(t,n){Oi(t)?t.dom.classList.remove(n):Ti(t,n),Di(t)},Ai=function(t,n){return Oi(t)&&t.dom.classList.contains(n)},Mi=function(n,t){lt(t,function(t){Ei(n,t)})},Fi=function(n,t){lt(t,function(t){Bi(n,t)})},Ii=function(t){return t.style!==undefined&&_(t.style.getPropertyValue)},Ri=function(t){return br(t)},Vi=_(Element.prototype.attachShadow)&&_(Node.prototype.getRootNode),Pi=at(Vi),Hi=Vi?function(t){return me.fromDom(t.dom.getRootNode())}:xr,zi=function(t){return Ri(t)?t:me.fromDom(xr(t).dom.body)},Ni=function(t){var n=Hi(t);return Ri(n)?st.some(n):st.none()},Li=function(t){return me.fromDom(t.dom.host)},ji=function(t){return v(t.dom.shadowRoot)},Ui=function(t){var n=hr(t)?t.dom.parentNode:t.dom;if(n===undefined||null===n||null===n.ownerDocument)return!1;var e,o,r=n.ownerDocument;return Ni(me.fromDom(n)).fold(function(){return r.body.contains(n)},(e=Ui,o=Li,function(t){return e(o(t))}))},Wi=function(){return Gi(me.fromDom(document))},Gi=function(t){var n=t.dom.body;if(null===n||n===undefined)throw new Error("Body is not available yet");return me.fromDom(n)},Xi=function(t,n,e){if(!k(e))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);Ii(t)&&t.style.setProperty(n,e)},Yi=function(t,n){Ii(t)&&t.style.removeProperty(n)},qi=function(t,n,e){var o=t.dom;Xi(o,n,e)},Ki=function(t,n){var e=t.dom;_t(n,function(t,n){Xi(e,n,t)})},Ji=function(t,n){var e=t.dom;_t(n,function(t,n){t.fold(function(){Yi(e,n)},function(t){Xi(e,n,t)})})},$i=function(t,n){var e=t.dom,o=window.getComputedStyle(e).getPropertyValue(n);return""!==o||Ui(t)?o:Qi(e,n)},Qi=function(t,n){return Ii(t)?t.style.getPropertyValue(n):""},Zi=function(t,n){var e=t.dom,o=Qi(e,n);return st.from(o).filter(function(t){return 0<t.length})},tu=function(t,n,e){var o=me.fromTag(t);return qi(o,n,e),Zi(o,n).isSome()},nu=function(t,n){var e=t.dom;Yi(e,n),Lr(t,"style").map(ke).is("")&&Ur(t,"style")},eu=function(t){return t.dom.offsetWidth},ou=function(t){return t.dom.value},ru=function(t,n){if(n===undefined)throw new Error("Value.set was undefined");t.dom.value=n},iu=function(t){var n,e,o,r=me.fromTag(t.tag);n=r,e=t.attributes,o=n.dom,_t(e,function(t,n){Hr(o,n,t)}),Mi(r,t.classes),Ki(r,t.styles),t.innerHtml.each(function(t){return Pr(r,t)});var i=t.domChildren;return Mr(r,i),t.value.each(function(t){ru(r,t)}),t.uid,ti(r,t.uid),r},uu=function(t,n){return e=t,r=V(o=n,function(t){return te(t.name(),[Ln("config"),ne("state",fi)])}),i=_n("component.behaviours",fn(r),e.behaviours).fold(function(t){throw new Error(Dn(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))},function(t){return t}),{list:o,data:Tt(i,function(t){var n=t.map(function(t){return{config:t.config,state:t.state.init(t.config)}});return function(){return n}})};var e,o,r,i},au=function(t){var n,e,o=(n=Ft(t,"behaviours").getOr({}),e=H(Ct(n),function(t){return n[t]!==undefined}),V(e,function(t){return n[t].me}));return uu(t,o)},cu=function(t,n,e){var o,r,i,u=it(it({},(o=t).dom),{uid:o.uid,domChildren:V(o.components,function(t){return t.element})}),a=t.domModification.fold(function(){return gi({})},gi),c={"alloy.base.modification":a},s=0<n.length?function(n,t,e,o){var r=it({},t);lt(e,function(t){r[t.name()]=t.exhibit(n,o)});var i=mi(r,function(t,n){return{name:t,modification:n}}),u=function(t){return z(t,function(t,n){return it(it({},n.modification),t)},{})},a=z(i.classes,function(t,n){return n.modification.concat(t)},[]),c=u(i.attributes),s=u(i.styles);return gi({classes:a,attributes:c,styles:s})}(e,c,n,u):a;return i=s,it(it({},r=u),{attributes:it(it({},r.attributes),i.attributes),styles:it(it({},r.styles),i.styles),classes:r.classes.concat(i.classes)})},su=function(t,n,e){var o,r,i,u={"alloy.base.behaviour":t.events};return o=e,r=t.eventOrder,i=bi(o,n,u),wi(i,r).getOrDie()},lu=function(t){var n,e,o,r,i,u,a,c,s,l,f,d,m,g=oi(t),p=g.events,h=w(g,["events"]),v=(n=Ft(h,"components").getOr([]),V(n,gu)),b=it(it({},h),{events:it(it({},Yr),p),components:v});return dt.value((o=function(){return m},r=fe(ii),i=Tn(ki(e=b)),u=au(e),a=u.list,c=u.data,s=cu(i,a,c),l=iu(s),f=su(i,a,c),d=fe(i.components),m={getSystem:r.get,config:function(t){var n=c;return(_(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:function(t){return _(c[t.name()])},spec:e,readState:function(t){return c[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return i.apis},connect:function(t){r.set(t)},disconnect:function(){r.set(ri(o))},element:l,syncComponents:function(){var t=_r(l),n=U(t,function(t){return r.get().getByDom(t).fold(function(){return[]},function(t){return[t]})});d.set(n)},components:d.get,events:f}))},fu=function(t){var n=me.fromText(t);return du({element:n})},du=function(t){var n=En("external.component",ln([Ln("element"),Kn("uid")]),t),e=fe(ri());n.uid.each(function(t){ti(n.element,t)});var o={getSystem:e.get,config:st.none,hasConfigured:c,connect:function(t){e.set(t)},disconnect:function(){e.set(ri(function(){return o}))},getApis:function(){return{}},element:n.element,spec:t,readState:at("No state"),syncComponents:$,components:at([]),events:{}};return si(o)},mu=ei,gu=function(n){return Ft(n,ci).fold(function(){var t=n.hasOwnProperty("uid")?n:it({uid:mu("")},n);return lu(t).getOrDie()},function(t){return t})},pu=si;function hu(o,r){var t=function(t){var n=r(t);if(n<=0||null===n){var e=$i(t,o);return parseFloat(e)||0}return n},i=function(r,t){return N(t,function(t,n){var e=$i(r,n),o=e===undefined?0:parseInt(e,10);return isNaN(o)?t:t+o},0)};return{set:function(t,n){if(!ut(n)&&!n.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+n);var e=t.dom;Ii(e)&&(e.style[o]=n+"px")},get:t,getOuter:t,aggregate:i,max:function(t,n,e){var o=i(t,e);return o<n?n-o:0}}}var vu=hu("height",function(t){var n=t.dom;return Ui(t)?n.getBoundingClientRect().height:n.offsetHeight}),bu=function(t){return vu.get(t)},yu=function(t){return vu.getOuter(t)},xu=function(e,o){return{left:e,top:o,translate:function(t,n){return xu(e+t,o+n)}}},wu=xu,Su=function(t,n){return t!==undefined?t:n!==undefined?n:0},ku=function(t){var n=t.dom.ownerDocument,e=n.body,o=n.defaultView,r=n.documentElement;if(e===t.dom)return wu(e.offsetLeft,e.offsetTop);var i=Su(null==o?void 0:o.pageYOffset,r.scrollTop),u=Su(null==o?void 0:o.pageXOffset,r.scrollLeft),a=Su(r.clientTop,e.clientTop),c=Su(r.clientLeft,e.clientLeft);return Cu(t).translate(u-c,i-a)},Cu=function(t){var n,e=t.dom,o=e.ownerDocument.body;return o===e?wu(o.offsetLeft,o.offsetTop):Ui(t)?(n=e.getBoundingClientRect(),wu(n.left,n.top)):wu(0,0)},Ou=hu("width",function(t){return t.dom.offsetWidth}),_u=function(t){return Ou.get(t)},Tu=function(t){return Ou.getOuter(t)},Eu=function(t){var n=me.fromDom(function(t){if(Pi()&&v(t.target)){var n=me.fromDom(t.target);if(pr(n)&&ji(n)&&t.composed&&t.composedPath){var e=t.composedPath();if(e)return K(e)}}return st.from(t.target)}(t).getOr(t.target)),e=function(){return t.stopPropagation()},o=function(){return t.preventDefault()},r=i(o,e);return{target:n,x:t.clientX,y:t.clientY,stop:e,prevent:o,kill:r,raw:t}},Du=function(t,n,e,o,r){var i,u,a=(i=e,u=o,function(t){i(t)&&u(Eu(t))});return t.dom.addEventListener(n,a,r),{unbind:y(Bu,t,n,a,r)}},Bu=function(t,n,e,o){t.dom.removeEventListener(n,e,o)},Au=function(t){var n=t!==undefined?t.dom:document,e=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return wu(e,o)},Mu=function(t,n,e){var o=(e!==undefined?e.dom:document).defaultView;o&&o.scrollTo(t,n)},Fu=function(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}},Iu=function(t){var n,e,o=t===undefined?window:t,r=o.document,i=Au(me.fromDom(r));return e=(n=o)===undefined?window:n,st.from(e.visualViewport).fold(function(){var t=o.document.documentElement,n=t.clientWidth,e=t.clientHeight;return Fu(i.left,i.top,n,e)},function(t){return Fu(Math.max(t.pageLeft,i.left),Math.max(t.pageTop,i.top),t.width,t.height)})},Ru=function(o,t){return o.view(t).fold(at([]),function(t){var n=o.owner(t),e=Ru(o,n);return[t].concat(e)})},Vu=/* */Object.freeze({__proto__:null,view:function(t){var n;return(t.dom===document?st.none():st.from(null===(n=t.dom.defaultView)||void 0===n?void 0:n.frameElement)).map(me.fromDom)},owner:yr}),Pu=function(o){var t,n,e,r,i=me.fromDom(document),u=Au(i);return(t=o,e=(n=Vu).owner(t),r=Ru(n,e),st.some(r)).fold(y(ku,o),function(t){var n=Cu(o),e=z(t,function(t,n){var e=Cu(n);return{left:t.left+e.left,top:t.top+e.top}},{left:0,top:0});return wu(e.left+n.left+u.left,e.top+n.top+u.top)})},Hu=function(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}},zu=function(t){var n=ku(t),e=Tu(t),o=yu(t);return Hu(n.left,n.top,e,o)},Nu=function(t){var n=Pu(t),e=Tu(t),o=yu(t);return Hu(n.left,n.top,e,o)},Lu=function(){return Iu(window)};function ju(t,n,e,o,r){return t(e,o)?st.some(e):_(r)&&r(e)?st.none():n(e,o,r)}var Uu,Wu,Gu=function(t,n,e){for(var o=t.dom,r=_(e)?e:c;o.parentNode;){o=o.parentNode;var i=me.fromDom(o);if(n(i))return st.some(i);if(r(i))break}return st.none()},Xu=function(t,n,e){return ju(function(t,n){return n(t)},Gu,t,n,e)},Yu=function(t,n,e){return Xu(t,n,e).isSome()},qu=function(t,n,e){return Gu(t,function(t){return Ue(t,n)},e)},Ku=function(t,n){return e=n,r=(o=t)===undefined?document:o.dom,We(r)?st.none():st.from(r.querySelector(e)).map(me.fromDom);var e,o,r},Ju=function(t,n,e){return ju(Ue,qu,t,n,e)},$u=function(){var n=Kr("aria-owns");return{id:n,link:function(t){zr(t,"aria-owns",n)},unlink:function(t){Ur(t,"aria-owns")}}},Qu=function(n,t){return Xu(t,function(t){if(!pr(t))return!1;var n=Nr(t,"id");return n!==undefined&&-1<n.indexOf("aria-owns")}).bind(function(t){var n=Nr(t,"id"),e=Hi(t);return Ku(e,'[aria-owns="'+n+'"]')}).exists(function(t){return Zu(n,t)})},Zu=function(n,t){return Yu(t,function(t){return Ge(t,n.element)},c)||Qu(n,t)},ta="unknown";(Wu=Uu=Uu||{})[Wu.STOP=0]="STOP",Wu[Wu.NORMAL=1]="NORMAL",Wu[Wu.LOGGING=2]="LOGGING";var na,ea,oa=fe({}),ra=["alloy/data/Fields","alloy/debugging/Debugging"],ia=function(n,t,e){var o,r,i,u;switch(Ft(oa.get(),n).orThunk(function(){var t=Ct(oa.get());return Z(t,function(t){return-1<n.indexOf(t)?st.some(oa.get()[t]):st.none()})}).getOr(Uu.NORMAL)){case Uu.NORMAL:return e(ua());case Uu.LOGGING:var a=(o=n,r=t,i=[],u=(new Date).getTime(),{logEventCut:function(t,n,e){i.push({outcome:"cut",target:n,purpose:e})},logEventStopped:function(t,n,e){i.push({outcome:"stopped",target:n,purpose:e})},logNoParent:function(t,n,e){i.push({outcome:"no-parent",target:n,purpose:e})},logEventNoHandlers:function(t,n){i.push({outcome:"no-handlers-left",target:n})},logEventResponse:function(t,n,e){i.push({outcome:"response",purpose:e,target:n})},write:function(){var t=(new Date).getTime();M(["mousemove","mouseover","mouseout",Mo()],o)||console.log(o,{event:o,time:t-u,target:r.dom,sequence:V(i,function(t){return M(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Gr(t.target)+")":t.outcome})})}}),c=e(a);return a.write(),c;case Uu.STOP:return!0}},ua=at({logEventCut:$,logEventStopped:$,logNoParent:$,logEventNoHandlers:$,logEventResponse:$,write:$}),aa=at([Ln("menu"),Ln("selectedMenu")]),ca=at([Ln("item"),Ln("selectedItem")]),sa=(at(fn(ca().concat(aa()))),at(fn(ca()))),la=Xn("initSize",[Ln("numColumns"),Ln("numRows")]),fa=function(){return Xn("markers",[Ln("backgroundMenu")].concat(aa()).concat(ca()))},da=function(t){return Xn("markers",V(t,Ln))},ma=function(t,n,e){!function(){var t=new Error;if(t.stack===undefined)return;var n=t.stack.split("\n");L(n,function(n){return 0<n.indexOf("alloy")&&!F(ra,function(t){return-1<n.indexOf(t)})}).getOr(ta)}();return bn(n,n,e,Cn(function(e){return dt.value(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(undefined,t)})}))},ga=function(t){return ma(0,t,Ut($))},pa=function(t){return ma(0,t,Ut(st.none))},ha=function(t){return ma(0,t,Wt())},va=function(t){return ma(0,t,Wt())},ba=function(t,n){return le(t,at(n))},ya=function(t){return le(t,ct)},xa=at(la),wa=function(t,n,e,o,r,i){return{x:t,y:n,bubble:e,direction:o,boundsRestriction:r,label:i}},Sa=Vt([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),ka=Sa.southeast,Ca=Sa.southwest,Oa=Sa.northeast,_a=Sa.northwest,Ta=Sa.south,Ea=Sa.north,Da=Sa.east,Ba=Sa.west,Aa=function(n,e){return function(t,n){for(var e={},o=0,r=t.length;o<r;o++){var i=t[o];e[String(i)]=n(i,o)}return e}(["left","right","top","bottom"],function(t){return Ft(e,t).map(function(t){return function(t,n){switch(n){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(n,t)})})},Ma=function(t){return t.x},Fa=function(t,n){return t.x+t.width/2-n.width/2},Ia=function(t,n){return t.x+t.width-n.width},Ra=function(t,n){return t.y-n.height},Va=function(t){return t.y+t.height},Pa=function(t,n){return t.y+t.height/2-n.height/2},Ha=function(t,n,e){return wa(Ma(t),Va(t),e.southeast(),ka(),Aa(t,{left:1,top:3}),"layout-se")},za=function(t,n,e){return wa(Ia(t,n),Va(t),e.southwest(),Ca(),Aa(t,{right:0,top:3}),"layout-sw")},Na=function(t,n,e){return wa(Ma(t),Ra(t,n),e.northeast(),Oa(),Aa(t,{left:1,bottom:2}),"layout-ne")},La=function(t,n,e){return wa(Ia(t,n),Ra(t,n),e.northwest(),_a(),Aa(t,{right:0,bottom:2}),"layout-nw")},ja=function(t,n,e){return wa(Fa(t,n),Ra(t,n),e.north(),Ea(),Aa(t,{bottom:2}),"layout-n")},Ua=function(t,n,e){return wa(Fa(t,n),Va(t),e.south(),Ta(),Aa(t,{top:3}),"layout-s")},Wa=function(t,n,e){return wa((o=t).x+o.width,Pa(t,n),e.east(),Da(),Aa(t,{left:0}),"layout-e");var o},Ga=function(t,n,e){return wa((o=n,t.x-o.width),Pa(t,n),e.west(),Ba(),Aa(t,{right:1}),"layout-w");var o},Xa=function(){return[Ha,za,Na,La,Ua,ja,Wa,Ga]},Ya=function(){return[za,Ha,La,Na,Ua,ja,Wa,Ga]},qa=function(){return[Na,La,Ha,za,ja,Ua]},Ka=function(){return[La,Na,za,Ha,ja,Ua]},Ja=function(){return[Ha,za,Na,La,Ua,ja]},$a=function(){return[za,Ha,La,Na,Ua,ja]},Qa=/* */Object.freeze({__proto__:null,events:function(c){return Zo([er(Oo(),function(r,t){var n,e,i=c.channels,o=Ct(i),u=t,a=(n=o,(e=u).universal?n:H(n,function(t){return M(e.channels,t)}));lt(a,function(t){var n=i[t],e=n.schema,o=En("channel["+t+"] data\nReceiver: "+Gr(r.element),e,u.data);n.onReceive(r,o)})})])}}),Za=[jn("channels",On(dt.value,ln([ha("onReceive"),ne("schema",Mn())])))],tc=function(e,o,r){return fr(function(t,n){r(t,e,o)})},nc=function(t,n,e,o,r,i){var u=ln(t),a=te(n,[Jn("config",ln(t))]);return rc(u,a,n,e,o,r,i)},ec=function(r,i,u){var t,n,e,o,a,c;return t=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=[e].concat(t);return e.config({name:at(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(t){var n=Array.prototype.slice.call(o,1);return i.apply(undefined,[e,t.config,t.state].concat(n))})},n=u,e=i.toString(),o=e.indexOf(")")+1,a=e.indexOf("("),c=e.substring(a+1,o-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:n,parameters:ui(c.slice(0,1).concat(c.slice(3)))}},t},oc=function(t){return{key:t,value:undefined}},rc=function(e,t,o,r,n,i,u){var a=function(t){return Rt(t,o)?t[o]():st.none()},c=Tt(n,function(t,n){return ec(o,t,n)}),s=Tt(i,ai),l=it(it(it({},s),c),{revoke:y(oc,o),config:function(t){var n=En(o+"-config",e,t);return{key:o,value:{config:n,me:l,configAsRaw:Lt(function(){return En(o+"-config",e,t)}),initialConfig:t,state:u}}},schema:function(){return t},exhibit:function(t,e){return a(t).bind(function(n){return Ft(r,"exhibit").map(function(t){return t(e,n.config,n.state)})}).getOr(gi({}))},name:function(){return o},handlers:function(t){return a(t).map(function(t){return Ft(r,"events").getOr(function(){return{}})(t.config,t.state)}).getOr({})}});return l},ic=$t,uc=ln([Ln("fields"),Ln("name"),ne("active",{}),ne("apis",{}),ne("state",fi),ne("extra",{})]),ac=function(t){var n=En("Creating behaviour: "+t.name,uc,t);return nc(n.fields,n.name,n.active,n.apis,n.extra,n.state)},cc=ln([Ln("branchKey"),Ln("branches"),Ln("name"),ne("active",{}),ne("apis",{}),ne("state",fi),ne("extra",{})]),sc=function(t){var n,e,o,r,i,u,a,c,s=En("Creating behaviour: "+t.name,cc,t);return n=An(s.branchKey,s.branches),e=s.name,o=s.active,r=s.apis,i=s.extra,u=s.state,c=te(e,[Jn("config",a=n)]),rc(a,c,e,o,r,i,u)},lc=at(undefined),fc=ac({fields:Za,name:"receiving",active:Qa}),dc=/* */Object.freeze({__proto__:null,exhibit:function(t,n){return gi({classes:[],styles:n.useFixed()?{}:{position:"relative"}})}}),mc=function(t){return t.dom.focus()},gc=function(t){return void 0===t&&(t=me.fromDom(document)),st.from(t.dom.activeElement).map(me.fromDom)},pc=function(n){return gc(Hi(n)).filter(function(t){return n.dom.contains(t.dom)})},hc=function(t,e){var o=Hi(e),n=gc(o).bind(function(n){var r,i,t=function(t){return Ge(n,t)};return t(e)?st.some(e):(r=t,(i=function(t){for(var n=0;n<t.childNodes.length;n++){var e=me.fromDom(t.childNodes[n]);if(r(e))return st.some(e);var o=i(t.childNodes[n]);if(o.isSome())return o}return st.none()})(e.dom))}),r=t(e);return n.each(function(n){gc(o).filter(function(t){return Ge(t,n)}).fold(function(){mc(n)},$)}),r},vc=function(t,n,e,o,r){return{position:t,left:n,top:e,right:o,bottom:r}},bc=function(t,n){var e=function(t){return t+"px"};Ji(t,{position:st.some(n.position),left:n.left.map(e),top:n.top.map(e),right:n.right.map(e),bottom:n.bottom.map(e)})},yc=Vt([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),xc=function(t,n,e,o,r,i){var u,a,c,s,l,f,d,m,g,p=n.x-e,h=n.y-o,v=r-(p+n.width),b=i-(h+n.height),y=st.some(p),x=st.some(h),w=st.some(v),S=st.some(b),k=st.none();return u=n.direction,a=function(){return vc(t,y,x,k,k)},c=function(){return vc(t,k,x,w,k)},s=function(){return vc(t,y,k,k,S)},l=function(){return vc(t,k,k,w,S)},f=function(){return vc(t,y,x,k,k)},d=function(){return vc(t,y,k,k,S)},m=function(){return vc(t,y,x,k,k)},g=function(){return vc(t,k,x,w,k)},u.fold(a,c,s,l,f,d,m,g)},wc=function(t,n){var e=y(Pu,n),o=t.fold(e,e,function(){var t=Au();return Pu(n).translate(-t.left,-t.top)}),r=Tu(n),i=yu(n);return Hu(o.left,o.top,r,i)},Sc=function(t,n,e){var o=wu(n,e);return t.fold(at(o),at(o),function(){var t=Au();return o.translate(-t.left,-t.top)})},kc=(yc.none,yc.relative),Cc=yc.fixed,Oc=function(t,n,e,o){var r=t+n;return o<r?e:r<e?o:r},_c=function(t,n,e){return Math.min(Math.max(t,n),e)},Tc=Vt([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),Ec=function(t,n,e,o){var r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_,T,E,D,B,A,M,F,I,R,V,P=t.x,H=t.y,z=t.bubble.offset,N=z.left,L=z.top,j=(r=o,i=t.boundsRestriction,u=z,c=(a=function(n,e){var o="top"===n||"bottom"===n?u.top:u.left;return Ft(i,n).bind(ct).bind(function(t){return"left"===n||"top"===n?e<=t?st.some(t):st.none():t<=e?st.some(t):st.none()}).map(function(t){return t+o}).getOr(e)})("left",r.x),s=a("top",r.y),l=a("right",r.right),f=a("bottom",r.bottom),Hu(c,s,l-c,f-s)),U=j.y,W=j.bottom,G=j.x,X=j.right,Y=H+L,q=(d=P+N,m=Y,g=n,p=e,v=(h=j).x,b=h.y,y=h.width,x=h.height,S=b<=m,k=(w=v<=d)&&S,C=d+g<=v+y&&m+p<=b+x,O=Math.abs(Math.min(g,w?v+y-d:v-(d+g))),_=Math.abs(Math.min(p,S?b+x-m:b-(m+p))),T=Math.max(h.x,h.right-g),E=Math.max(h.y,h.bottom-p),{originInBounds:k,sizeInBounds:C,limitX:_c(d,h.x,T),limitY:_c(m,h.y,E),deltaW:O,deltaH:_}),K=q.originInBounds,J=q.sizeInBounds,$=q.limitX,Q=q.limitY,Z=q.deltaW,tt=q.deltaH,nt=at(Q+tt-U),et=at(W-Q),ot=(D=t.direction,A=B=et,M=nt,D.fold(B,B,M,M,B,M,A,A)),rt=at($+Z-G),it=at(X-$),ut={x:$,y:Q,width:Z,height:tt,maxHeight:ot,maxWidth:(F=t.direction,R=I=it,V=rt,F.fold(I,V,I,V,R,R,I,V)),direction:t.direction,classes:{on:t.bubble.classesOn,off:t.bubble.classesOff},label:t.label,candidateYforTest:Y};return K&&J?Tc.fit(ut):Tc.nofit(ut,Z,tt)},Dc=function(t,n,e,o){nu(n,"max-height"),nu(n,"max-width");var r,i,u,a,c,s,l,f,d,m={width:Tu(r=n),height:yu(r)};return i=o.preference,u=t,a=m,c=e,s=o.bounds,l=a.width,f=a.height,d=function(t,o,r,i){var n=t(u,a,c);return Ec(n,l,f,s).fold(Tc.fit,function(t,n,e){return i<e||r<n?Tc.nofit(t,n,e):Tc.nofit(o,r,i)})},N(i,function(t,n){var e=y(d,n);return t.fold(Tc.fit,e)},Tc.nofit({x:u.x,y:u.y,width:a.width,height:a.height,maxHeight:a.height,maxWidth:a.width,direction:ka(),classes:{on:[],off:[]},label:"none",candidateYforTest:u.y},-1,-1)).fold(ct,ct)},Bc=function(t,n,e){var o,r;bc(t,(o=e.origin,r=n,o.fold(function(){return vc("absolute",st.some(r.x),st.some(r.y),st.none(),st.none())},function(t,n,e,o){return xc("absolute",r,t,n,e,o)},function(t,n,e,o){return xc("fixed",r,t,n,e,o)})))},Ac=function(t,n){var e,o,r;e=t,o=Math.floor(n),r=vu.max(e,o,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]),qi(e,"max-height",r+"px")},Mc=at(function(t,n){Ac(t,n),Ki(t,{"overflow-x":"hidden","overflow-y":"auto"})}),Fc=at(function(t,n){Ac(t,n)}),Ic=function(t,n,e){return t[n]===undefined?e:t[n]},Rc=function(t,n,e,o,r,i){var u,a=Ic(i,"maxHeightFunction",Mc()),c=Ic(i,"maxWidthFunction",$),s=t.anchorBox,l=t.origin,f={bounds:(u=l,r.fold(function(){return u.fold(Lu,Lu,Hu)},function(e){return u.fold(e,e,function(){var t=e(),n=Sc(u,t.x,t.y);return Hu(n.left,n.top,t.width,t.height)})})),origin:l,preference:o,maxHeightFunction:a,maxWidthFunction:c};Vc(s,n,e,f)},Vc=function(t,n,e,o){var r,i,u,a,c,s,l=Dc(t,n,e,o);Bc(n,l,o),r=n,i=l.classes,Fi(r,i.off),Mi(r,i.on),u=n,a=l,(0,o.maxHeightFunction)(u,a.maxHeight),c=n,s=l,(0,o.maxWidthFunction)(c,s.maxWidth)},Pc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],Hc=function(t,n,e){var r=function(t){return Ft(e,t).getOr([])},o=function(t,n,e){var o=X(Pc,e);return{offset:wu(t,n),classesOn:U(e,r),classesOff:U(o,r)}};return{southeast:function(){return o(-t,n,["top","alignLeft"])},southwest:function(){return o(t,n,["top","alignRight"])},south:function(){return o(-t/2,n,["top","alignCentre"])},northeast:function(){return o(-t,-n,["bottom","alignLeft"])},northwest:function(){return o(t,-n,["bottom","alignRight"])},north:function(){return o(-t/2,-n,["bottom","alignCentre"])},east:function(){return o(t,-n/2,["valignCentre","left"])},west:function(){return o(-t,-n/2,["valignCentre","right"])},innerNorthwest:function(){return o(-t,n,["top","alignRight"])},innerNortheast:function(){return o(t,n,["top","alignLeft"])},innerNorth:function(){return o(-t/2,n,["top","alignCentre"])},innerSouthwest:function(){return o(-t,-n,["bottom","alignRight"])},innerSoutheast:function(){return o(t,-n,["bottom","alignLeft"])},innerSouth:function(){return o(-t/2,-n,["bottom","alignCentre"])},innerWest:function(){return o(t,-n/2,["valignCentre","right"])},innerEast:function(){return o(-t,-n/2,["valignCentre","left"])}}},zc=function(){return Hc(0,0,{})},Nc=function(n,e){return function(t){return"rtl"===Lc(t)?e:n}},Lc=function(t){return"rtl"===$i(t,"direction")?"rtl":"ltr"};(ea=na=na||{}).TopToBottom="toptobottom",ea.BottomToTop="bottomtotop";var jc="data-alloy-vertical-dir",Uc=function(t){return Yu(t,function(t){return pr(t)&&Nr(t,"data-alloy-vertical-dir")===na.BottomToTop})},Wc=function(){return te("layouts",[Ln("onLtr"),Ln("onRtl"),Kn("onBottomLtr"),Kn("onBottomRtl")])},Gc=function(n,t,e,o,r,i,u){var a=u.map(Uc).getOr(!1),c=t.layouts.map(function(t){return t.onLtr(n)}),s=t.layouts.map(function(t){return t.onRtl(n)}),l=a?t.layouts.bind(function(t){return t.onBottomLtr.map(function(t){return t(n)})}).or(c).getOr(r):c.getOr(e),f=a?t.layouts.bind(function(t){return t.onBottomRtl.map(function(t){return t(n)})}).or(s).getOr(i):s.getOr(o);return Nc(l,f)(n)},Xc=[Ln("hotspot"),Kn("bubble"),ne("overrides",{}),Wc(),ba("placement",function(t,n,e){var o=n.hotspot,r=wc(e,o.element),i=Gc(t.element,n,Ja(),$a(),qa(),Ka(),st.some(n.hotspot.element));return st.some({anchorBox:r,bubble:n.bubble.getOr(zc()),overrides:n.overrides,layouts:i,placer:st.none()})})],Yc=[Ln("x"),Ln("y"),ne("height",0),ne("width",0),ne("bubble",zc()),ne("overrides",{}),Wc(),ba("placement",function(t,n,e){var o=Sc(e,n.x,n.y),r=Hu(o.left,o.top,n.width,n.height),i=Gc(t.element,n,Xa(),Ya(),Xa(),Ya(),st.none());return st.some({anchorBox:r,bubble:n.bubble,overrides:n.overrides,layouts:i,placer:st.none()})})],qc=function(t,n,e,o){return{start:t,soffset:n,finish:e,foffset:o}},Kc=Vt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Jc=(Kc.before,Kc.on,Kc.after,function(t){return t.fold(ct,ct,ct)}),$c=Vt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Qc={domRange:$c.domRange,relative:$c.relative,exact:$c.exact,exactFromRange:function(t){return $c.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var n=t.match({domRange:function(t){return me.fromDom(t.startContainer)},relative:function(t,n){return Jc(t)},exact:function(t,n,e,o){return t}});return Sr(n)},range:qc},Zc=function(t,n,e){var o,r,i=t.document.createRange();return o=i,n.fold(function(t){o.setStartBefore(t.dom)},function(t,n){o.setStart(t.dom,n)},function(t){o.setStartAfter(t.dom)}),r=i,e.fold(function(t){r.setEndBefore(t.dom)},function(t,n){r.setEnd(t.dom,n)},function(t){r.setEndAfter(t.dom)}),i},ts=function(t,n,e,o,r){var i=t.document.createRange();return i.setStart(n.dom,e),i.setEnd(o.dom,r),i},ns=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},es=Vt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),os=function(t,n,e){return n(me.fromDom(e.startContainer),e.startOffset,me.fromDom(e.endContainer),e.endOffset)},rs=function(t,n){var r,e,o,i=(r=t,n.match({domRange:function(t){return{ltr:at(t),rtl:st.none}},relative:function(t,n){return{ltr:Lt(function(){return Zc(r,t,n)}),rtl:Lt(function(){return st.some(Zc(r,n,t))})}},exact:function(t,n,e,o){return{ltr:Lt(function(){return ts(r,t,n,e,o)}),rtl:Lt(function(){return st.some(ts(r,e,o,t,n))})}}}));return(o=(e=i).ltr()).collapsed?e.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return es.rtl(me.fromDom(t.endContainer),t.endOffset,me.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return os(0,es.ltr,o)}):os(0,es.ltr,o)};es.ltr,es.rtl;var is,us,as,cs=(is=hr,us="text",{get:function(t){if(!is(t))throw new Error("Can only get "+us+" value of a "+us+" node");return as(t).getOr("")},getOption:as=function(t){return is(t)?st.from(t.dom.nodeValue):st.none()},set:function(t,n){if(!is(t))throw new Error("Can only set raw "+us+" value of a "+us+" node");t.dom.nodeValue=n}}),ss=function(t){return cs.getOption(t)},ls=["img","br"],fs=function(t){return ss(t).filter(function(t){return 0!==t.trim().length||-1<t.indexOf("\xa0")}).isSome()||M(ls,mr(t))},ds=function(t,i){var u=function(t){for(var n=_r(t),e=n.length-1;0<=e;e--){var o=n[e];if(i(o))return st.some(o);var r=u(o);if(r.isSome())return r}return st.none()};return u(t)},ms=function(t,n){return e=n,r=(o=t)===undefined?document:o.dom,We(r)?[]:V(r.querySelectorAll(e),me.fromDom);var e,o,r},gs=function(t,n,e,o){var r,i,u,a,c,s=(i=n,u=e,a=o,(c=yr(r=t).dom.createRange()).setStart(r.dom,i),c.setEnd(u.dom,a),c),l=Ge(t,e)&&n===o;return s.collapsed&&!l},ps=function(t){if(0<t.rangeCount){var n=t.getRangeAt(0),e=t.getRangeAt(t.rangeCount-1);return st.some(qc(me.fromDom(n.startContainer),n.startOffset,me.fromDom(e.endContainer),e.endOffset))}return st.none()},hs=function(t){if(null===t.anchorNode||null===t.focusNode)return ps(t);var n=me.fromDom(t.anchorNode),e=me.fromDom(t.focusNode);return gs(n,t.anchorOffset,e,t.focusOffset)?st.some(qc(n,t.anchorOffset,e,t.focusOffset)):ps(t)},vs=function(t){return n=t,st.from(n.getSelection()).filter(function(t){return 0<t.rangeCount}).bind(hs);var n},bs=function(t,n){var i,e,o,r,u=rs(i=t,n).match({ltr:function(t,n,e,o){var r=i.document.createRange();return r.setStart(t.dom,n),r.setEnd(e.dom,o),r},rtl:function(t,n,e,o){var r=i.document.createRange();return r.setStart(e.dom,o),r.setEnd(t.dom,n),r}});return o=(e=u).getClientRects(),0<(r=0<o.length?o[0]:e.getBoundingClientRect()).width||0<r.height?st.some(r).map(ns):st.none()},ys=function(t,n){return{element:t,offset:n}},xs=function(t,n){var e=_r(t);if(0===e.length)return ys(t,n);if(n<e.length)return ys(e[n],0);var o,r=e[e.length-1],i=hr(r)?(o=r,cs.get(o).length):_r(r).length;return ys(r,i)},ws=Vt([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Ss=function(t){return t.fold(ct,function(t,n,e){return t.translate(-n,-e)})},ks=function(t){return t.fold(ct,ct)},Cs=function(t){return N(t,function(t,n){return t.translate(n.left,n.top)},wu(0,0))},Os=function(t){var n=V(t,ks);return Cs(n)},_s=ws.screen,Ts=ws.absolute,Es=function(t,n,e){var o,r,i=yr(t.element),u=Au(i),a=(o=t,r=Sr(e.root).dom,st.from(r.frameElement).map(me.fromDom).filter(function(t){var n=yr(t),e=yr(o.element);return Ge(n,e)}).map(ku).getOr(u));return Ts(a,u.left,u.top)},Ds=function(t,n,e,o){var r=t,i=n,u=e,a=o;t<0&&(r=0,u=e+t),n<0&&(i=0,a=o+n);var c=_s(wu(r,i));return st.some({point:c,width:u,height:a})},Bs=function(t,l,f,d,m){return t.map(function(t){var n,e,o,r=[l,t.point],i=(n=function(){return Os(r)},e=function(){return Os(r)},o=function(){return t=V(r,Ss),Cs(t);var t},d.fold(n,e,o)),u={x:i.left,y:i.top,width:t.width,height:t.height},a=(f.showAbove?qa:Ja)(),c=(f.showAbove?Ka:$a)(),s=Gc(m,f,a,c,a,c,st.none());return{anchorBox:u,bubble:f.bubble.getOr(zc()),overrides:f.overrides,layouts:s,placer:st.none()}})},As=function(t,n){return(hr(t)?ys:xs)(t,n)},Ms=function(t,n){return n.getSelection.getOrThunk(function(){return function(){return vs(t)}})().map(function(t){var n=As(t.start,t.soffset),e=As(t.finish,t.foffset);return Qc.range(n.element,n.offset,e.element,e.offset)})},Fs=[Kn("getSelection"),Ln("root"),Kn("bubble"),Wc(),ne("overrides",{}),ne("showAbove",!1),ba("placement",function(t,n,e){var o=Sr(n.root).dom,r=Es(t,0,n),i=Ms(o,n).bind(function(t){return bs(o,Qc.exactFromRange(t)).orThunk(function(){var n=me.fromText("\ufeff");return Er(t.start,n),bs(o,Qc.exact(n,0,n,1)).map(function(t){return Ir(n),t})}).bind(function(t){return Ds(t.left,t.top,t.width,t.height)})}),u=Ms(o,n).bind(function(t){return pr(t.start)?st.some(t.start):Cr(t.start)}).getOr(t.element);return Bs(i,r,n,e,u)})],Is=[Ln("node"),Ln("root"),Kn("bubble"),Wc(),ne("overrides",{}),ne("showAbove",!1),ba("placement",function(r,i,u){var a=Es(r,0,i);return i.node.bind(function(t){var n=t.dom.getBoundingClientRect(),e=Ds(n.left,n.top,n.width,n.height),o=i.node.getOr(r.element);return Bs(e,a,i,u,o)})})],Rs=function(t){return t.x+t.width},Vs=function(t,n){return t.x-n.width},Ps=function(t,n){return t.y-n.height+t.height},Hs=function(t){return t.y},zs=function(t,n,e){return wa(Rs(t),Hs(t),e.southeast(),ka(),Aa(t,{left:0,top:2}),"link-layout-se")},Ns=function(t,n,e){return wa(Vs(t,n),Hs(t),e.southwest(),Ca(),Aa(t,{right:1,top:2}),"link-layout-sw")},Ls=function(t,n,e){return wa(Rs(t),Ps(t,n),e.northeast(),Oa(),Aa(t,{left:0,bottom:3}),"link-layout-ne")},js=function(t,n,e){return wa(Vs(t,n),Ps(t,n),e.northwest(),_a(),Aa(t,{right:1,bottom:3}),"link-layout-nw")},Us=function(){return[zs,Ns,Ls,js]},Ws=function(){return[Ns,zs,js,Ls]},Gs=[Ln("item"),Wc(),ne("overrides",{}),ba("placement",function(t,n,e){var o=wc(e,n.item.element),r=Gc(t.element,n,Us(),Ws(),Us(),Ws(),st.none());return st.some({anchorBox:o,bubble:zc(),overrides:n.overrides,layouts:r,placer:st.none()})})],Xs=An("anchor",{selection:Fs,node:Is,hotspot:Xc,submenu:Gs,makeshift:Yc}),Ys=function(t,n,e,o,r){var i={anchorBox:e.anchorBox,origin:n};Rc(i,r.element,e.bubble,e.layouts,o,e.overrides)},qs=function(t,n,e,o,r,i){var u=i.map(zu);return Ks(t,n,e,o,r,u)},Ks=function(c,s,t,n,l,f){var d=En("positioning anchor.info",Xs,n);hc(function(){qi(l.element,"position","fixed");var t=Zi(l.element,"visibility");qi(l.element,"visibility","hidden");var n,e,o,r,i=s.useFixed()?(r=document.documentElement,Cc(0,0,r.clientWidth,r.clientHeight)):(e=ku((n=c).element),o=n.element.dom.getBoundingClientRect(),kc(e.left,e.top,o.width,o.height)),u=d.placement,a=f.map(at).or(s.getBounds);u(c,d,i).each(function(t){t.placer.getOr(Ys)(c,i,t,a,l)}),t.fold(function(){nu(l.element,"visibility")},function(t){qi(l.element,"visibility",t)}),Zi(l.element,"left").isNone()&&Zi(l.element,"top").isNone()&&Zi(l.element,"right").isNone()&&Zi(l.element,"bottom").isNone()&&Zi(l.element,"position").is("fixed")&&nu(l.element,"position")},l.element)},Js=/* */Object.freeze({__proto__:null,position:function(t,n,e,o,r){qs(t,n,e,o,r,st.none())},positionWithin:qs,positionWithinBounds:Ks,getMode:function(t,n,e){return n.useFixed()?"fixed":"absolute"}}),$s=[ne("useFixed",c),Kn("getBounds")],Qs=ac({fields:$s,name:"positioning",active:dc,apis:Js}),Zs=function(t){Yo(t,Ho());var n=t.components();lt(n,Zs)},tl=function(t){var n=t.components();lt(n,tl),Yo(t,Po())},nl=function(t,n){Ar(t.element,n.element)},el=function(n,t){var e,o=n.components();lt((e=n).components(),function(t){return Ir(t.element)}),Fr(e.element),e.syncComponents();var r=X(o,t);lt(r,function(t){Zs(t),n.getSystem().removeFromWorld(t)}),lt(t,function(t){t.getSystem().isConnected()?nl(n,t):(n.getSystem().addToWorld(t),nl(n,t),Ui(n.element)&&tl(t)),n.syncComponents()})},ol=function(t,n){rl(t,n,Ar)},rl=function(t,n,e){t.getSystem().addToWorld(n),e(t.element,n.element),Ui(t.element)&&tl(n),t.syncComponents()},il=function(t){Zs(t),Ir(t.element),t.getSystem().removeFromWorld(t)},ul=function(n){var t=kr(n.element).bind(function(t){return n.getSystem().getByDom(t).toOptional()});il(n),t.each(function(t){t.syncComponents()})},al=function(t){var n=t.components();lt(n,il),Fr(t.element),t.syncComponents()},cl=function(t,n){sl(t,n,Ar)},sl=function(t,n,e){e(t,n.element);var o=_r(n.element);lt(o,function(t){n.getByDom(t).each(tl)})},ll=function(n){var t=_r(n.element);lt(t,function(t){n.getByDom(t).each(Zs)}),Ir(n.element)},fl=function(n,t,e,o){e.get().each(function(t){al(n)});var r=t.getAttachPoint(n);ol(r,n);var i=n.getSystem().build(o);return ol(n,i),e.set(i),i},dl=function(t,n,e,o){var r=fl(t,n,e,o);return n.onOpen(t,r),r},ml=function(n,e,o){o.get().each(function(t){al(n),ul(n),e.onClose(n,t),o.clear()})},gl=function(t,n,e){return e.isOpen()},pl=function(t,n,e){var o,r,i,u,a=n.getAttachPoint(t);qi(t.element,"position",Qs.getMode(a)),o=t,r="visibility",i=n.cloakVisibilityAttr,u="hidden",Zi(o.element,r).fold(function(){Ur(o.element,i)},function(t){zr(o.element,i,t)}),qi(o.element,r,u)},hl=function(t,n,e){var o,r,i,u;o=t.element,F(["top","left","right","bottom"],function(t){return Zi(o,t).isSome()})||nu(t.element,"position"),r=t,i="visibility",u=n.cloakVisibilityAttr,Lr(r.element,u).fold(function(){return nu(r.element,i)},function(t){return qi(r.element,i,t)})},vl=/* */Object.freeze({__proto__:null,cloak:pl,decloak:hl,open:dl,openWhileCloaked:function(t,n,e,o,r){pl(t,n),dl(t,n,e,o),r(),hl(t,n)},close:ml,isOpen:gl,isPartOf:function(n,e,t,o){return gl(0,0,t)&&t.get().exists(function(t){return e.isPartOf(n,t,o)})},getState:function(t,n,e){return e.get()},setContent:function(t,n,e,o){return e.get().map(function(){return fl(t,n,e,o)})}}),bl=/* */Object.freeze({__proto__:null,events:function(e,o){return Zo([er(Bo(),function(t,n){ml(t,e,o)})])}}),yl=[ga("onOpen"),ga("onClose"),Ln("isPartOf"),Ln("getAttachPoint"),ne("cloakVisibilityAttr","data-precloak-visibility")],xl=ac({fields:yl,name:"sandboxing",active:bl,apis:vl,state:/* */Object.freeze({__proto__:null,init:function(){var n=fe(st.none()),t=at("not-implemented");return di({readState:t,isOpen:function(){return n.get().isSome()},clear:function(){n.set(st.none())},set:function(t){n.set(st.some(t))},get:function(){return n.get()}})}})}),wl=at("dismiss.popups"),Sl=at("reposition.popups"),kl=at("mouse.released"),Cl=ln([ne("isExtraPart",c),te("fireEventInstead",[ne("event",zo())])]),Ol=function(t){var e=En("Dismissal",Cl,t),n={};return n[wl()]={schema:ln([Ln("target")]),onReceive:function(n,t){xl.isOpen(n)&&(xl.isPartOf(n,t.target)||e.isExtraPart(n,t.target)||e.fireEventInstead.fold(function(){return xl.close(n)},function(t){return Yo(n,t.event)}))}},n},_l=ln([te("fireEventInstead",[ne("event",No())]),Gn("doReposition")]),Tl=function(t){var e=En("Reposition",_l,t),n={};return n[Sl()]={onReceive:function(n){xl.isOpen(n)&&e.fireEventInstead.fold(function(){return e.doReposition(n)},function(t){return Yo(n,t.event)})}},n},El=function(t,n,e){n.store.manager.onLoad(t,n,e)},Dl=function(t,n,e){n.store.manager.onUnload(t,n,e)},Bl=/* */Object.freeze({__proto__:null,onLoad:El,onUnload:Dl,setValue:function(t,n,e,o){n.store.manager.setValue(t,n,e,o)},getValue:function(t,n,e){return n.store.manager.getValue(t,n,e)},getState:function(t,n,e){return e}}),Al=/* */Object.freeze({__proto__:null,events:function(e,o){var t=e.resetOnDom?[sr(function(t,n){El(t,e,o)}),lr(function(t,n){Dl(t,e,o)})]:[tc(e,o,El)];return Zo(t)}}),Ml=function(){var t=fe(null);return di({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},Fl=function(){var i=fe({}),u=fe({});return di({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(t){return Ft(i.get(),t).orThunk(function(){return Ft(u.get(),t)})},update:function(t){var n=i.get(),e=u.get(),o={},r={};lt(t,function(n){o[n.value]=n,Ft(n,"meta").each(function(t){Ft(t,"text").each(function(t){r[t]=n})})}),i.set(it(it({},n),o)),u.set(it(it({},e),r))},clear:function(){i.set({}),u.set({})}})},Il=/* */Object.freeze({__proto__:null,memory:Ml,dataset:Fl,manual:function(){return di({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),Rl=function(t,n,e,o){var r=n.store;e.update([o]),r.setValue(t,o),n.onSetValue(t,o)},Vl=[Kn("initialValue"),Ln("getFallbackEntry"),Ln("getDataKey"),Ln("setValue"),ba("manager",{setValue:Rl,getValue:function(t,n,e){var o=n.store,r=o.getDataKey(t);return e.lookup(r).fold(function(){return o.getFallbackEntry(r)},function(t){return t})},onLoad:function(n,e,o){e.store.initialValue.each(function(t){Rl(n,e,o,t)})},onUnload:function(t,n,e){e.clear()},state:Fl})],Pl=[Ln("getValue"),ne("setValue",$),Kn("initialValue"),ba("manager",{setValue:function(t,n,e,o){n.store.setValue(t,o),n.onSetValue(t,o)},getValue:function(t,n,e){return n.store.getValue(t)},onLoad:function(n,e,t){e.store.initialValue.each(function(t){e.store.setValue(n,t)})},onUnload:$,state:fi.init})],Hl=[Kn("initialValue"),ba("manager",{setValue:function(t,n,e,o){e.set(o),n.onSetValue(t,o)},getValue:function(t,n,e){return e.get()},onLoad:function(t,n,e){n.store.initialValue.each(function(t){e.isNotSet()&&e.set(t)})},onUnload:function(t,n,e){e.clear()},state:Ml})],zl=[ee("store",{mode:"memory"},An("mode",{memory:Hl,manual:Pl,dataset:Vl})),ga("onSetValue"),ne("resetOnDom",!1)],Nl=ac({fields:zl,name:"representing",active:Al,apis:Bl,extra:{setValueFrom:function(t,n){var e=Nl.getValue(n);Nl.setValue(t,e)}},state:Il}),Ll=function(o,t){return se(o,{},V(t,function(t){return n=t.name(),e="Cannot configure "+t.name()+" for "+o,bn(n,n,Gt(),sn(function(t){return yt("The field: "+n+" is forbidden. "+e)}));var n,e}).concat([le("dump",ct)]))},jl=function(t){return t.dump},Ul=function(t,n){return it(it({},t.dump),ic(n))},Wl=Ll,Gl=Ul,Xl="placeholder",Yl=Vt([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),ql=function(t){return It(t,"uiType")},Kl=function(t,n,e,o){return ql(e)&&e.uiType===Xl?(i=e,u=o,(r=t).exists(function(t){return t!==i.owner})?Yl.single(!0,at(i)):Ft(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+Ct(u)+"]\nNamespace: "+r.getOr("none")+"\nSpec: "+JSON.stringify(i,null,2))},function(t){return t.replace()})):Yl.single(!1,at(e));var r,i,u},Jl=function(i,u,a,c){return Kl(i,0,a,c).fold(function(t,n){var e=ql(a)?n(u,a.config,a.validated):n(u),o=Ft(e,"components").getOr([]),r=U(o,function(t){return Jl(i,u,t,c)});return[it(it({},e),{components:r})]},function(t,n){if(ql(a)){var e=n(u,a.config,a.validated);return a.validated.preprocess.getOr(ct)(e)}return n(u)})},$l=function(n,e,t,o){var r,i,u,a=Tt(o,function(t,n){return o=t,r=!1,{name:at(e=n),required:function(){return o.fold(function(t,n){return t},function(t,n){return t})},used:function(){return r},replace:function(){if(r)throw new Error("Trying to use the same placeholder more than once: "+e);return r=!0,o}};var e,o,r}),c=(r=n,i=e,u=a,U(t,function(t){return Jl(r,i,t,u)}));return _t(a,function(t){if(!1===t.used()&&t.required())throw new Error("Placeholder: "+t.name()+" was not found in components list\nNamespace: "+n.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))}),c},Ql=Yl.single,Zl=Yl.multiple,tf=at(Xl),nf=Vt([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),ef=ne("factory",{sketch:ct}),of=ne("schema",[]),rf=Ln("name"),uf=bn("pname","pname",Xt(function(t){return"<alloy."+Kr(t.name)+">"}),Mn()),af=le("schema",function(){return[Kn("preprocess")]}),cf=ne("defaults",at({})),sf=ne("overrides",at({})),lf=fn([ef,of,rf,uf,cf,sf]),ff=fn([ef,of,rf,cf,sf]),df=fn([ef,of,rf,uf,cf,sf]),mf=fn([ef,af,rf,Ln("unit"),uf,cf,sf]),gf=function(t){return t.fold(st.some,st.none,st.some,st.some)},pf=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},hf=function(e,o){return function(t){var n=En("Converting part type",o,t);return e(n)}},vf=hf(nf.required,lf),bf=hf(nf.external,ff),yf=hf(nf.optional,df),xf=hf(nf.group,mf),wf=at("entirety"),Sf=/* */Object.freeze({__proto__:null,required:vf,external:bf,optional:yf,group:xf,asNamedPart:gf,name:pf,asCommon:function(t){return t.fold(ct,ct,ct,ct)},original:wf}),kf=function(t,n,e,o){return zt(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},Cf=function(r,t){var n={};return lt(t,function(t){gf(t).each(function(e){var o=Of(r,e.pname);n[e.name]=function(t){var n=En("Part: "+e.name+" in "+r,fn(e.schema),t);return it(it({},o),{config:t,validated:n})}})}),n},Of=function(t,n){return{uiType:tf(),owner:t,name:n}},_f=function(t,n,e){return{uiType:tf(),owner:t,name:n,config:e,validated:{}}},Tf=function(t){return U(t,function(t){return t.fold(st.none,st.some,st.none,st.none).map(function(t){return Xn(t.name,t.schema.concat([ya(wf())]))}).toArray()})},Ef=function(t){return V(t,pf)},Df=function(t,n,e){return o=n,i={},r={},lt(e,function(t){t.fold(function(o){i[o.pname]=Ql(!0,function(t,n,e){return o.factory.sketch(kf(t,o,n,e))})},function(t){var n=o.parts[t.name];r[t.name]=at(t.factory.sketch(kf(o,t,n[wf()]),n))},function(o){i[o.pname]=Ql(!1,function(t,n,e){return o.factory.sketch(kf(t,o,n,e))})},function(r){i[r.pname]=Zl(!0,function(n,t,e){var o=n[r.name];return V(o,function(t){return r.factory.sketch(zt(r.defaults(n,t,e),t,r.overrides(n,t)))})})})}),{internals:at(i),externals:at(r)};var o,i,r},Bf=function(t,n,e){return $l(st.some(t),n,n.components,e)},Af=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOptional()},Mf=function(t,n,e){return Af(t,n,e).getOrDie("Could not find part: "+e)},Ff=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return lt(e,function(t){o[t]=at(i.getByUid(r[t]))}),o},If=function(t,n){var e=t.getSystem();return Tt(n.partUids,function(t,n){return at(e.getByUid(t))})},Rf=function(t){return Ct(t.partUids)},Vf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return lt(e,function(t){o[t]=at(i.getByUid(r[t]).getOrDie())}),o},Pf=function(n,t){var e=Ef(t);return $t(V(e,function(t){return{key:t,value:n+"-"+t}}))},Hf=function(n){return bn("partUids","partUids",Yt(function(t){return Pf(t.uid,n)}),Mn())},zf=/* */Object.freeze({__proto__:null,generate:Cf,generateOne:_f,schemas:Tf,names:Ef,substitutes:Df,components:Bf,defaultUids:Pf,defaultUidsSchema:Hf,getAllParts:If,getAllPartNames:Rf,getPart:Af,getPartOrDie:Mf,getParts:Ff,getPartsOrDie:Vf}),Nf=function(t,n,e,o,r){var i,u,a=(u=r,(0<(i=o).length?[Xn("parts",i)]:[]).concat([Ln("uid"),ne("dom",{}),ne("components",[]),ya("originalSpec"),ne("debug.sketcher",{})]).concat(u));return En(t+" [SpecSchema]",ln(a.concat(n)),e)},Lf=function(t,n,e,o,r){var i=jf(r),u=Tf(e),a=Hf(e),c=Nf(t,n,i,u,[a]),s=Df(0,c,e);return o(c,Bf(t,c,s.internals()),i,s.externals())},jf=function(t){return It(t,"uid")?t:it(it({},t),{uid:ei("uid")})};var Uf,Wf,Gf=ln([Ln("name"),Ln("factory"),Ln("configFields"),ne("apis",{}),ne("extraApis",{})]),Xf=ln([Ln("name"),Ln("factory"),Ln("configFields"),Ln("partFields"),ne("apis",{}),ne("extraApis",{})]),Yf=function(t){var i=En("Sketcher for "+t.name,Gf,t),n=Tt(i.apis,li),e=Tt(i.extraApis,ai);return it(it({name:i.name,configFields:i.configFields,sketch:function(t){return n=i.name,e=i.configFields,o=i.factory,r=jf(t),o(Nf(n,e,r,[],[]),r);var n,e,o,r}},n),e)},qf=function(t){var n=En("Sketcher for "+t.name,Xf,t),e=Cf(n.name,n.partFields),o=Tt(n.apis,li),r=Tt(n.extraApis,ai);return it(it({name:n.name,partFields:n.partFields,configFields:n.configFields,sketch:function(t){return Lf(n.name,n.configFields,n.partFields,n.factory,t)},parts:e},o),r)},Kf=function(t){for(var n=[],e=function(t){n.push(t)},o=0;o<t.length;o++)t[o].each(e);return n},Jf=function(t,n){return t?st.some(n):st.none()},$f=function(t){return"input"===mr(t)&&"radio"!==Nr(t,"type")||"textarea"===mr(t)},Qf=/* */Object.freeze({__proto__:null,getCurrent:function(t,n,e){return n.find(t)}}),Zf=[Ln("find")],td=ac({fields:Zf,name:"composing",apis:Qf}),nd=function(e,o,t,r){var n=ms(e.element,"."+o.highlightClass);lt(n,function(n){F(r,function(t){return t.element===n})||(Bi(n,o.highlightClass),e.getSystem().getByDom(n).each(function(t){o.onDehighlight(e,t),Yo(t,Xo())}))})},ed=function(t,n,e,o){nd(t,n,0,[o]),od(t,n,e,o)||(Ei(o.element,n.highlightClass),n.onHighlight(t,o),Yo(o,Go()))},od=function(t,n,e,o){return Ai(o.element,n.highlightClass)},rd=function(t,n,e,o){var r=ms(t.element,"."+n.itemClass);return st.from(r[o]).fold(function(){return dt.error("No element found with index "+o)},t.getSystem().getByDom)},id=function(n,t,e){return Ku(n.element,"."+t.itemClass).bind(function(t){return n.getSystem().getByDom(t).toOptional()})},ud=function(n,t,e){var o=ms(n.element,"."+t.itemClass);return(0<o.length?st.some(o[o.length-1]):st.none()).bind(function(t){return n.getSystem().getByDom(t).toOptional()})},ad=function(e,n,t,o){var r=ms(e.element,"."+n.itemClass);return j(r,function(t){return Ai(t,n.highlightClass)}).bind(function(t){var n=Oc(t,o,0,r.length-1);return e.getSystem().getByDom(r[n]).toOptional()})},cd=function(n,t,e){var o=ms(n.element,"."+t.itemClass);return Kf(V(o,function(t){return n.getSystem().getByDom(t).toOptional()}))},sd=/* */Object.freeze({__proto__:null,dehighlightAll:function(t,n,e){return nd(t,n,0,[])},dehighlight:function(t,n,e,o){od(t,n,e,o)&&(Bi(o.element,n.highlightClass),n.onDehighlight(t,o),Yo(o,Xo()))},highlight:ed,highlightFirst:function(n,e,o){id(n,e).each(function(t){ed(n,e,o,t)})},highlightLast:function(n,e,o){ud(n,e).each(function(t){ed(n,e,o,t)})},highlightAt:function(n,e,o,t){rd(n,e,o,t).fold(function(t){throw new Error(t)},function(t){ed(n,e,o,t)})},highlightBy:function(n,e,o,t){var r=cd(n,e);L(r,t).each(function(t){ed(n,e,o,t)})},isHighlighted:od,getHighlighted:function(n,t,e){return Ku(n.element,"."+t.highlightClass).bind(function(t){return n.getSystem().getByDom(t).toOptional()})},getFirst:id,getLast:ud,getPrevious:function(t,n,e){return ad(t,n,0,-1)},getNext:function(t,n,e){return ad(t,n,0,1)},getCandidates:cd}),ld=[Ln("highlightClass"),Ln("itemClass"),ga("onHighlight"),ga("onDehighlight")],fd=ac({fields:ld,name:"highlighting",apis:sd}),dd=[8],md=[9],gd=[13],pd=[27],hd=[32],vd=[37],bd=[38],yd=[39],xd=[40],wd=function(t,n,e){var o=G(t.slice(0,n)),r=G(t.slice(n+1));return L(o.concat(r),e)},Sd=function(t,n,e){var o=G(t.slice(0,n));return L(o,e)},kd=function(t,n,e){var o=t.slice(0,n),r=t.slice(n+1);return L(r.concat(o),e)},Cd=function(t,n,e){var o=t.slice(n+1);return L(o,e)},Od=function(e){return function(t){var n=t.raw;return M(e,n.which)}},_d=function(t){return function(n){return W(t,function(t){return t(n)})}},Td=function(t){return!0===t.raw.shiftKey},Ed=function(t){return!0===t.raw.ctrlKey},Dd=x(Td),Bd=function(t,n){return{matches:t,classification:n}},Ad=function(t,n,e){n.exists(function(n){return e.exists(function(t){return Ge(t,n)})})||qo(t,Lo(),{prevFocus:n,newFocus:e})},Md=function(){var r=function(t){return pc(t.element)};return{get:r,set:function(t,n){var e=r(t);t.getSystem().triggerFocus(n,t.element);var o=r(t);Ad(t,e,o)}}},Fd=function(){var r=function(t){return fd.getHighlighted(t).map(function(t){return t.element})};return{get:r,set:function(n,t){var e=r(n);n.getSystem().getByDom(t).fold($,function(t){fd.highlight(n,t)});var o=r(n);Ad(n,e,o)}}};(Wf=Uf=Uf||{}).OnFocusMode="onFocus",Wf.OnEnterOrSpaceMode="onEnterOrSpace",Wf.OnApiMode="onApi";var Id,Rd=function(t,n,e,o,a){var c=function(n,e,t,o,r){var i,u,a=t(n,e,o,r);return i=a,u=e.event,L(i,function(t){return t.matches(u)}).map(function(t){return t.classification}).bind(function(t){return t(n,e,o,r)})},r={schema:function(){return t.concat([ne("focusManager",Md()),ee("focusInside","onFocus",Cn(function(t){return M(["onFocus","onEnterOrSpace","onApi"],t)?dt.value(t):dt.error("Invalid value for focusInside")})),ba("handler",r),ba("state",n),ba("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var t=i.focusInside!==Uf.OnFocusMode?st.none():a(i).map(function(e){return er(So(),function(t,n){e(t,i,u),n.stop()})}),n=[er(mo(),function(o,r){c(o,r,e,i,u).fold(function(){var n,e,t;n=o,e=r,t=Od(hd.concat(gd))(e.event),i.focusInside===Uf.OnEnterOrSpaceMode&&t&&$e(n,e)&&a(i).each(function(t){t(n,i,u),e.stop()})},function(t){r.stop()})}),er(go(),function(t,n){c(t,n,o,i,u).each(function(t){n.stop()})})];return Zo(t.toArray().concat(n))}};return r},Vd=function(t){var n=[Kn("onEscape"),Kn("onEnter"),ne("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),ne("firstTabstop",0),ne("useTabstopAt",b),Kn("visibilitySelector")].concat([t]),u=function(t,n){var e=t.visibilitySelector.bind(function(t){return Ju(n,t)}).getOr(n);return 0<bu(e)},e=function(n,e,t){var o,r,i;o=e,r=ms(n.element,o.selector),i=H(r,function(t){return u(o,t)}),st.from(i[o.firstTabstop]).each(function(t){e.focusManager.set(n,t)})},a=function(n,t,e,o,r){return r(t,e,function(t){return u(n=o,e=t)&&n.useTabstopAt(e);var n,e}).fold(function(){return o.cyclic?st.some(!0):st.none()},function(t){return o.focusManager.set(n,t),st.some(!0)})},r=function(n,t,e,o){var r,i,u=ms(n.element,e.selector);return r=n,(i=e).focusManager.get(r).bind(function(t){return Ju(t,i.selector)}).bind(function(t){return j(u,y(Ge,t)).bind(function(t){return a(n,u,t,e,o)})})},o=at([Bd(_d([Td,Od(md)]),function(t,n,e){var o=e.cyclic?wd:Sd;return r(t,0,e,o)}),Bd(Od(md),function(t,n,e){var o=e.cyclic?kd:Cd;return r(t,0,e,o)}),Bd(Od(pd),function(n,e,t){return t.onEscape.bind(function(t){return t(n,e)})}),Bd(_d([Dd,Od(gd)]),function(n,e,t){return t.onEnter.bind(function(t){return t(n,e)})})]),i=at([]);return Rd(n,fi.init,o,i,function(){return st.some(e)})},Pd=Vd(le("cyclic",c)),Hd=Vd(le("cyclic",b)),zd=function(t,n,e){return $f(e)&&Od(hd)(n.event)?st.none():(Jo(t,e,_o()),st.some(!0))},Nd=function(t,n){return st.some(!0)},Ld=[ne("execute",zd),ne("useSpace",!1),ne("useEnter",!0),ne("useControlEnter",!1),ne("useDown",!1)],jd=function(t,n,e){return e.execute(t,n,t.element)},Ud=Rd(Ld,fi.init,function(t,n,e,o){var r=e.useSpace&&!$f(t.element)?hd:[],i=e.useEnter?gd:[],u=e.useDown?xd:[],a=r.concat(i).concat(u);return[Bd(Od(a),jd)].concat(e.useControlEnter?[Bd(_d([Ed,Od(gd)]),jd)]:[])},function(t,n,e,o){return e.useSpace&&!$f(t.element)?[Bd(Od(hd),Nd)]:[]},function(){return st.none()}),Wd=function(){var e=fe(st.none());return di({readState:function(){return e.get().map(function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,n){e.set(st.some({numRows:t,numColumns:n}))},getNumRows:function(){return e.get().map(function(t){return t.numRows})},getNumColumns:function(){return e.get().map(function(t){return t.numColumns})}})},Gd=/* */Object.freeze({__proto__:null,flatgrid:Wd,init:function(t){return t.state(t)}}),Xd=function(i){return function(t,n,e,o){var r=i(t.element);return Jd(r,t,n,e,o)}},Yd=function(t,n){var e=Nc(t,n);return Xd(e)},qd=function(t,n){var e=Nc(n,t);return Xd(e)},Kd=function(r){return function(t,n,e,o){return Jd(r,t,n,e,o)}},Jd=function(n,e,t,o,r){return o.focusManager.get(e).bind(function(t){return n(e.element,t,o,r)}).map(function(t){return o.focusManager.set(e,t),!0})},$d=Kd,Qd=Kd,Zd=Kd,tm=function(t){return!((n=t.dom).offsetWidth<=0&&n.offsetHeight<=0);var n},nm=function(t,n,e){var o,r=ms(t,e),i=H(r,tm);return j(o=i,function(t){return Ge(t,n)}).map(function(t){return{index:t,candidates:o}})},em=function(t,n){return j(t,function(t){return Ge(n,t)})},om=function(e,t,o,n){return n(Math.floor(t/o),t%o).bind(function(t){var n=t.row*o+t.column;return 0<=n&&n<e.length?st.some(e[n]):st.none()})},rm=function(r,t,i,u,a){return om(r,t,u,function(t,n){var e=t===i-1?r.length-t*u:u,o=Oc(n,a,0,e-1);return st.some({row:t,column:o})})},im=function(i,t,u,a,c){return om(i,t,a,function(t,n){var e=Oc(t,c,0,u-1),o=e===u-1?i.length-e*a:a,r=_c(n,0,o-1);return st.some({row:e,column:r})})},um=[Ln("selector"),ne("execute",zd),pa("onEscape"),ne("captureTab",!1),xa()],am=function(n,e,t){Ku(n.element,e.selector).each(function(t){e.focusManager.set(n,t)})},cm=function(r){return function(t,n,e,o){return nm(t,n,e.selector).bind(function(t){return r(t.candidates,t.index,o.getNumRows().getOr(e.initSize.numRows),o.getNumColumns().getOr(e.initSize.numColumns))})}},sm=function(t,n,e){return e.captureTab?st.some(!0):st.none()},lm=cm(function(t,n,e,o){return rm(t,n,e,o,-1)}),fm=cm(function(t,n,e,o){return rm(t,n,e,o,1)}),dm=cm(function(t,n,e,o){return im(t,n,e,o,-1)}),mm=cm(function(t,n,e,o){return im(t,n,e,o,1)}),gm=at([Bd(Od(vd),Yd(lm,fm)),Bd(Od(yd),qd(lm,fm)),Bd(Od(bd),$d(dm)),Bd(Od(xd),Qd(mm)),Bd(_d([Td,Od(md)]),sm),Bd(_d([Dd,Od(md)]),sm),Bd(Od(pd),function(t,n,e){return e.onEscape(t,n)}),Bd(Od(hd.concat(gd)),function(n,e,o,t){return r=n,(i=o).focusManager.get(r).bind(function(t){return Ju(t,i.selector)}).bind(function(t){return o.execute(n,e,t)});var r,i})]),pm=at([Bd(Od(hd),Nd)]),hm=Rd(um,Wd,gm,pm,function(){return st.some(am)}),vm=function(t,n,e,i){var u=function(t,n,e){var o,r=Oc(n,i,0,e.length-1);return r===t?st.none():(o=e[r],"button"===mr(o)&&"disabled"===Nr(o,"disabled")?u(t,r,e):st.from(e[r]))};return nm(t,e,n).bind(function(t){var n=t.index,e=t.candidates;return u(n,n,e)})},bm=[Ln("selector"),ne("getInitial",st.none),ne("execute",zd),pa("onEscape"),ne("executeOnMove",!1),ne("allowVertical",!0)],ym=function(n,e,o){return t=n,(r=o).focusManager.get(t).bind(function(t){return Ju(t,r.selector)}).bind(function(t){return o.execute(n,e,t)});var t,r},xm=function(n,e,t){e.getInitial(n).orThunk(function(){return Ku(n.element,e.selector)}).each(function(t){e.focusManager.set(n,t)})},wm=function(t,n,e){return vm(t,e.selector,n,-1)},Sm=function(t,n,e){return vm(t,e.selector,n,1)},km=function(r){return function(t,n,e,o){return r(t,n,e,o).bind(function(){return e.executeOnMove?ym(t,n,e):st.some(!0)})}},Cm=function(t,n,e){return e.onEscape(t,n)},Om=at([Bd(Od(hd),Nd)]),_m=Rd(bm,fi.init,function(t,n,e,o){var r=vd.concat(e.allowVertical?bd:[]),i=yd.concat(e.allowVertical?xd:[]);return[Bd(Od(r),km(Yd(wm,Sm))),Bd(Od(i),km(qd(wm,Sm))),Bd(Od(gd),ym),Bd(Od(hd),ym),Bd(Od(pd),Cm)]},Om,function(){return st.some(xm)}),Tm=function(t,n,e){return st.from(t[n]).bind(function(t){return st.from(t[e]).map(function(t){return{rowIndex:n,columnIndex:e,cell:t}})})},Em=function(t,n,e,o){var r=t[n].length,i=Oc(e,o,0,r-1);return Tm(t,n,i)},Dm=function(t,n,e,o){var r=Oc(e,o,0,t.length-1),i=t[r].length,u=_c(n,0,i-1);return Tm(t,r,u)},Bm=function(t,n,e,o){var r=t[n].length,i=_c(e+o,0,r-1);return Tm(t,n,i)},Am=function(t,n,e,o){var r=_c(e+o,0,t.length-1),i=t[r].length,u=_c(n,0,i-1);return Tm(t,r,u)},Mm=[Xn("selectors",[Ln("row"),Ln("cell")]),ne("cycles",!0),ne("previousSelector",st.none),ne("execute",zd)],Fm=function(n,e,t){e.previousSelector(n).orThunk(function(){var t=e.selectors;return Ku(n.element,t.cell)}).each(function(t){e.focusManager.set(n,t)})},Im=function(t,n){return function(e,o,i){var u=i.cycles?t:n;return Ju(o,i.selectors.row).bind(function(t){var n=ms(t,i.selectors.cell);return em(n,o).bind(function(o){var r=ms(e,i.selectors.row);return em(r,t).bind(function(t){var n,e=(n=i,V(r,function(t){return ms(t,n.selectors.cell)}));return u(e,t,o).map(function(t){return t.cell})})})})}},Rm=Im(function(t,n,e){return Em(t,n,e,-1)},function(t,n,e){return Bm(t,n,e,-1)}),Vm=Im(function(t,n,e){return Em(t,n,e,1)},function(t,n,e){return Bm(t,n,e,1)}),Pm=Im(function(t,n,e){return Dm(t,e,n,-1)},function(t,n,e){return Am(t,e,n,-1)}),Hm=Im(function(t,n,e){return Dm(t,e,n,1)},function(t,n,e){return Am(t,e,n,1)}),zm=at([Bd(Od(vd),Yd(Rm,Vm)),Bd(Od(yd),qd(Rm,Vm)),Bd(Od(bd),$d(Pm)),Bd(Od(xd),Qd(Hm)),Bd(Od(hd.concat(gd)),function(n,e,o){return pc(n.element).bind(function(t){return o.execute(n,e,t)})})]),Nm=at([Bd(Od(hd),Nd)]),Lm=Rd(Mm,fi.init,zm,Nm,function(){return st.some(Fm)}),jm=[Ln("selector"),ne("execute",zd),ne("moveOnTab",!1)],Um=function(n,e,o){return o.focusManager.get(n).bind(function(t){return o.execute(n,e,t)})},Wm=function(n,e,t){Ku(n.element,e.selector).each(function(t){e.focusManager.set(n,t)})},Gm=function(t,n,e){return vm(t,e.selector,n,-1)},Xm=function(t,n,e){return vm(t,e.selector,n,1)},Ym=at([Bd(Od(bd),Zd(Gm)),Bd(Od(xd),Zd(Xm)),Bd(_d([Td,Od(md)]),function(t,n,e,o){return e.moveOnTab?Zd(Gm)(t,n,e,o):st.none()}),Bd(_d([Dd,Od(md)]),function(t,n,e,o){return e.moveOnTab?Zd(Xm)(t,n,e,o):st.none()}),Bd(Od(gd),Um),Bd(Od(hd),Um)]),qm=at([Bd(Od(hd),Nd)]),Km=Rd(jm,fi.init,Ym,qm,function(){return st.some(Wm)}),Jm=[pa("onSpace"),pa("onEnter"),pa("onShiftEnter"),pa("onLeft"),pa("onRight"),pa("onTab"),pa("onShiftTab"),pa("onUp"),pa("onDown"),pa("onEscape"),ne("stopSpaceKeyup",!1),Kn("focusIn")],$m=Rd(Jm,fi.init,function(t,n,e){return[Bd(Od(hd),e.onSpace),Bd(_d([Dd,Od(gd)]),e.onEnter),Bd(_d([Td,Od(gd)]),e.onShiftEnter),Bd(_d([Td,Od(md)]),e.onShiftTab),Bd(_d([Dd,Od(md)]),e.onTab),Bd(Od(bd),e.onUp),Bd(Od(xd),e.onDown),Bd(Od(vd),e.onLeft),Bd(Od(yd),e.onRight),Bd(Od(hd),e.onSpace),Bd(Od(pd),e.onEscape)]},function(t,n,e){return e.stopSpaceKeyup?[Bd(Od(hd),Nd)]:[]},function(t){return t.focusIn}),Qm=Pd.schema(),Zm=Hd.schema(),tg=_m.schema(),ng=hm.schema(),eg=Lm.schema(),og=Ud.schema(),rg=Km.schema(),ig=$m.schema(),ug=sc({branchKey:"mode",branches:/* */Object.freeze({__proto__:null,acyclic:Qm,cyclic:Zm,flow:tg,flatgrid:ng,matrix:eg,execution:og,menu:rg,special:ig}),name:"keying",active:{events:function(t,n){return t.handler.toEvents(t,n)}},apis:{focusIn:function(n,e,o){e.sendFocusIn(e).fold(function(){n.getSystem().triggerFocus(n.element,n.element)},function(t){t(n,e,o)})},setGridSize:function(t,n,e,o,r){Rt(e,"setGridSize")?e.setGridSize(o,r):console.error("Layout does not support setGridSize")}},state:Gd}),ag=function(t,n,e,o){var r=t.getSystem().build(o);rl(t,r,e)},cg=function(t,n,e,o){var r=sg(t);L(r,function(t){return Ge(o.element,t.element)}).each(ul)},sg=function(t,n){return t.components()},lg=function(n,t,e,r,o){var i=sg(n);return st.from(i[r]).map(function(t){return cg(n,0,0,t),o.each(function(t){ag(n,0,function(t,n){var e,o;o=n,Tr(e=t,r).fold(function(){Ar(e,o)},function(t){Er(t,o)})},t)}),t})},fg=ac({fields:[],name:"replacing",apis:/* */Object.freeze({__proto__:null,append:function(t,n,e,o){ag(t,0,Ar,o)},prepend:function(t,n,e,o){ag(t,0,Br,o)},remove:cg,replaceAt:lg,replaceBy:function(n,t,e,o,r){var i=sg(n);return j(i,o).bind(function(t){return lg(n,0,0,t,r)})},set:function(n,t,e,o){hc(function(){var t=V(o,n.getSystem().build);el(n,t)},n.element)},contents:sg})}),dg=function(t,n){var e,o;return{key:t,value:{config:{},me:(e=t,o=Zo(n),ac({fields:[Ln("enabled")],name:e,active:{events:at(o)}})),configAsRaw:at({}),initialConfig:{},state:fi}}},mg=function(t,n){n.ignore||(mc(t.element),n.onFocus(t))},gg=/* */Object.freeze({__proto__:null,focus:mg,blur:function(t,n){n.ignore||t.element.dom.blur()},isFocused:function(t){return n=t.element,e=Hi(n).dom,n.dom===e.activeElement;var n,e}}),pg=/* */Object.freeze({__proto__:null,exhibit:function(t,n){var e=n.ignore?{}:{attributes:{tabindex:"-1"}};return gi(e)},events:function(e){return Zo([er(So(),function(t,n){mg(t,e),n.stop()})].concat(e.stopMousedown?[er(io(),function(t,n){n.event.prevent()})]:[]))}}),hg=[ga("onFocus"),ne("stopMousedown",!1),ne("ignore",!1)],vg=ac({fields:hg,name:"focusing",active:pg,apis:gg}),bg=function(t,n,e){var o=n.aria;o.update(t,o,e.get())},yg=function(n,t,e){t.toggleClass.each(function(t){(e.get()?Ei:Bi)(n.element,t)})},xg=function(t,n,e){kg(t,n,e,!e.get())},wg=function(t,n,e){e.set(!0),yg(t,n,e),bg(t,n,e)},Sg=function(t,n,e){e.set(!1),yg(t,n,e),bg(t,n,e)},kg=function(t,n,e,o){(o?wg:Sg)(t,n,e)},Cg=function(t,n,e){kg(t,n,e,n.selected)},Og=/* */Object.freeze({__proto__:null,onLoad:Cg,toggle:xg,isOn:function(t,n,e){return e.get()},on:wg,off:Sg,set:kg}),_g=/* */Object.freeze({__proto__:null,exhibit:function(){return gi({})},events:function(t,n){var e,o,r,i=(e=t,o=n,r=xg,dr(function(t){r(t,e,o)})),u=tc(t,n,Cg);return Zo(ft([t.toggleOnExecute?[i]:[],[u]]))}}),Tg=function(t,n,e){zr(t.element,"aria-expanded",e)},Eg=[ne("selected",!1),Kn("toggleClass"),ne("toggleOnExecute",!0),ee("aria",{mode:"none"},An("mode",{pressed:[ne("syncWithExpanded",!1),ba("update",function(t,n,e){zr(t.element,"aria-pressed",e),n.syncWithExpanded&&Tg(t,n,e)})],checked:[ba("update",function(t,n,e){zr(t.element,"aria-checked",e)})],expanded:[ba("update",Tg)],selected:[ba("update",function(t,n,e){zr(t.element,"aria-selected",e)})],none:[ba("update",$)]}))],Dg=ac({fields:Eg,name:"toggling",active:_g,apis:Og,state:(Id=!1,{init:function(){var n=fe(Id);return{get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(Id)},readState:function(){return n.get()}}}})}),Bg=function(){var t=function(t,n){n.stop(),Ko(t)};return[er(vo(),t),er(Eo(),t),ar(no()),ar(io())]},Ag=function(t){return Zo(ft([t.map(function(e){return dr(function(t,n){e(t),n.stop()})}).toArray(),Bg()]))},Mg="alloy.item-hover",Fg="alloy.item-focus",Ig=function(t){(pc(t.element).isNone()||vg.isFocused(t))&&(vg.isFocused(t)||vg.focus(t),qo(t,Mg,{item:t}))},Rg=function(t){qo(t,Fg,{item:t})},Vg=at(Mg),Pg=at(Fg),Hg=[Ln("data"),Ln("components"),Ln("dom"),ne("hasSubmenu",!1),Kn("toggling"),Wl("itemBehaviours",[Dg,vg,ug,Nl]),ne("ignoreFocus",!1),ne("domModification",{}),ba("builder",function(t){return{dom:t.dom,domModification:it(it({},t.domModification),{attributes:it(it(it({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Gl(t.itemBehaviours,[t.toggling.fold(Dg.revoke,function(t){return Dg.config(it({aria:{mode:"checked"}},t))}),vg.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Rg(t)}}),ug.config({mode:"execution"}),Nl.config({store:{mode:"memory",initialValue:t.data}}),dg("item-type-events",S(Bg(),[er(so(),Ig),er(To(),vg.focus)]))]),components:t.components,eventOrder:t.eventOrder}}),ne("eventOrder",{})],zg=[Ln("dom"),Ln("components"),ba("builder",function(t){return{dom:t.dom,components:t.components,events:Zo([(n=To(),er(n,function(t,n){n.stop()}))])};var n})],Ng=function(){return"item-widget"},Lg=at([vf({name:"widget",overrides:function(n){return{behaviours:ic([Nl.config({store:{mode:"manual",getValue:function(t){return n.data},setValue:function(){}}})])}}})]),jg=[Ln("uid"),Ln("data"),Ln("components"),Ln("dom"),ne("autofocus",!1),ne("ignoreFocus",!1),Wl("widgetBehaviours",[Nl,vg,ug]),ne("domModification",{}),Hf(Lg()),ba("builder",function(e){var t=Df(Ng(),e,Lg()),n=Bf(Ng(),e,t.internals()),o=function(t){return Af(t,e,"widget").map(function(t){return ug.focusIn(t),t})},r=function(t,n){return $f(n.event.target)||e.autofocus&&n.setSource(t.element),st.none()};return{dom:e.dom,components:n,domModification:e.domModification,events:Zo([dr(function(t,n){o(t).each(function(t){n.stop()})}),er(so(),Ig),er(To(),function(t,n){e.autofocus?o(t):vg.focus(t)})]),behaviours:Gl(e.widgetBehaviours,[Nl.config({store:{mode:"memory",initialValue:e.data}}),vg.config({ignore:e.ignoreFocus,onFocus:function(t){Rg(t)}}),ug.config({mode:"special",focusIn:e.autofocus?function(t){o(t)}:lc(),onLeft:r,onRight:r,onEscape:function(t,n){return vg.isFocused(t)||e.autofocus?(e.autofocus&&n.setSource(t.element),st.none()):(vg.focus(t),st.some(!0))}})])}})],Ug=An("type",{widget:jg,item:Hg,separator:zg}),Wg=at([xf({factory:{sketch:function(t){var n=En("menu.spec item",Ug,t);return n.builder(n)}},name:"items",unit:"item",defaults:function(t,n){return n.hasOwnProperty("uid")?n:it(it({},n),{uid:ei("item")})},overrides:function(t,n){return{type:n.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Gg=at([Ln("value"),Ln("items"),Ln("dom"),Ln("components"),ne("eventOrder",{}),Ll("menuBehaviours",[fd,Nl,td,ug]),ee("movement",{mode:"menu",moveOnTab:!0},An("mode",{grid:[xa(),ba("config",function(t,n){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:n.initSize.numColumns,numRows:n.initSize.numRows},focusManager:t.focusManager}})],matrix:[ba("config",function(t,n){return{mode:"matrix",selectors:{row:n.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}}),Ln("rowSelector")],menu:[ne("moveOnTab",!0),ba("config",function(t,n){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:n.moveOnTab,focusManager:t.focusManager}})]})),jn("markers",sa()),ne("fakeFocus",!1),ne("focusManager",Md()),ga("onHighlight")]),Xg=at("alloy.menu-focus"),Yg=qf({name:"Menu",configFields:Gg(),partFields:Wg(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Ul(t.menuBehaviours,[fd.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Nl.config({store:{mode:"memory",initialValue:t.value}}),td.config({find:st.some}),ug.config(t.movement.config(t,t.movement))]),events:Zo([er(Pg(),function(n,e){var t=e.event;n.getSystem().getByDom(t.target).each(function(t){fd.highlight(n,t),e.stop(),qo(n,Xg(),{menu:n,item:t})})}),er(Vg(),function(t,n){var e=n.event.item;fd.highlight(t,e)})]),components:n,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),qg=function(e,o,r,t){return Ft(r,t).bind(function(t){return Ft(e,t).bind(function(t){var n=qg(e,o,r,t);return st.some([t].concat(n))})}).getOr([])},Kg=function(t,n){var e={};_t(t,function(t,n){lt(t,function(t){e[t]=n})});var o=n,r=Et(n,function(t,n){return{k:t,v:n}}),i=Tt(r,function(t,n){return[n].concat(qg(e,o,r,n))});return Tt(e,function(t){return Ft(i,t).getOr([t])})},Jg=function(t){return"prepared"===t.type?st.some(t.menu):st.none()},$g={init:function(){var i=fe({}),u=fe({}),a=fe({}),c=fe(st.none()),s=fe({}),r=function(t,o,r){return e(t).bind(function(n){return e=t,At(i.get(),function(t,n){return t===e}).bind(function(t){return o(t).map(function(t){return{triggeredMenu:n,triggeringItem:t,triggeringPath:r}})});var e})},e=function(t){return n(t).bind(Jg)},n=function(t){return Ft(u.get(),t)},l=function(t){return Ft(i.get(),t)};return{setMenuBuilt:function(t,n){var e;u.set(it(it({},u.get()),((e={})[t]={type:"prepared",menu:n},e)))},setContents:function(t,n,e,o){c.set(st.some(t)),i.set(e),u.set(n),s.set(o);var r=Kg(o,e);a.set(r)},expand:function(e){return Ft(i.get(),e).map(function(t){var n=Ft(a.get(),e).getOr([]);return[t].concat(n)})},refresh:function(t){return Ft(a.get(),t)},collapse:function(t){return Ft(a.get(),t).bind(function(t){return 1<t.length?st.some(t.slice(1)):st.none()})},lookupMenu:n,lookupItem:l,otherMenus:function(t){var n=s.get();return X(Ct(n),t)},getPrimary:function(){return c.get().bind(e)},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),a.set({}),c.set(st.none())},isClear:function(){return c.get().isNone()},getTriggeringPath:function(t,o){var n=H(l(t).toArray(),function(t){return e(t).isSome()});return Ft(a.get(),t).bind(function(t){var e=G(n.concat(t));return function(t){for(var n=[],e=0;e<t.length;e++){var o=t[e];if(!o.isSome())return st.none();n.push(o.getOrDie())}return st.some(n)}(U(e,function(t,n){return r(t,o,e.slice(0,n+1)).fold(function(){return c.get().is(t)?[]:[st.none()]},function(t){return[st.some(t)]})}))})}}},extractPreparedMenu:Jg},Qg=at("collapse-item"),Zg=Yf({name:"TieredMenu",configFields:[va("onExecute"),va("onEscape"),ha("onOpenMenu"),ha("onOpenSubmenu"),ga("onRepositionMenu"),ga("onCollapseMenu"),ne("highlightImmediately",!0),Xn("data",[Ln("primary"),Ln("menus"),Ln("expansions")]),ne("fakeFocus",!1),ga("onHighlight"),ga("onHover"),fa(),Ln("dom"),ne("navigateOnHover",!0),ne("stayInDom",!1),Ll("tmenuBehaviours",[ug,fd,td,fg]),ne("eventOrder",{})],apis:{collapseMenu:function(t,n){t.collapseMenu(n)},highlightPrimary:function(t,n){t.highlightPrimary(n)},repositionMenus:function(t,n){t.repositionMenus(n)}},factory:function(a,t){var c,n,i=fe(st.none()),s=$g.init(),e=function(t){var o,r,n,e=(o=t,r=a.data.primary,n=a.data.menus,Tt(n,function(t,n){var e=function(){return Yg.sketch(it(it({},t),{value:n,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:(a.fakeFocus?Fd:Md)()}))};return n===r?{type:"prepared",menu:o.getSystem().build(e())}:{type:"notbuilt",nbMenu:e}})),i=u();return s.setContents(a.data.primary,e,a.data.expansions,i),s.getPrimary()},l=function(t){return Nl.getValue(t).value},u=function(t){return Tt(a.data.menus,function(t,n){return U(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})})},f=function(n,t){fd.highlight(n,t),fd.getHighlighted(t).orThunk(function(){return fd.getFirst(t)}).each(function(t){Jo(n,t.element,To())})},d=function(n,t){return Kf(V(t,function(t){return n.lookupMenu(t).bind(function(t){return"prepared"===t.type?st.some(t.menu):st.none()})}))},m=function(n,t,e){var o=d(t,t.otherMenus(e));lt(o,function(t){Fi(t.element,[a.markers.backgroundMenu]),a.stayInDom||fg.remove(n,t)})},g=function(t,o){var r,n=(r=t,i.get().getOrThunk(function(){var e={},t=ms(r.element,"."+a.markers.item),n=H(t,function(t){return"true"===Nr(t,"aria-haspopup")});return lt(n,function(t){r.getSystem().getByDom(t).each(function(t){var n=l(t);e[n]=t})}),i.set(st.some(e)),e}));_t(n,function(t,n){var e=M(o,n);zr(t.element,"aria-expanded",e)})},p=function(o,r,i){return st.from(i[0]).bind(function(t){return r.lookupMenu(t).bind(function(t){if("notbuilt"===t.type)return st.none();var n=t.menu,e=d(r,i.slice(1));return lt(e,function(t){Ei(t.element,a.markers.backgroundMenu)}),Ui(n.element)||fg.append(o,pu(n)),Fi(n.element,[a.markers.backgroundMenu]),f(o,n),m(o,r,i),st.some(n)})})};(n=c=c||{})[n.HighlightSubmenu=0]="HighlightSubmenu",n[n.HighlightParent=1]="HighlightParent";var h=function(r,i,u){void 0===u&&(u=c.HighlightSubmenu);var t=l(i);return s.expand(t).bind(function(o){return g(r,o),st.from(o[0]).bind(function(e){return s.lookupMenu(e).bind(function(t){var n=function(t,n,e){if("notbuilt"!==e.type)return e.menu;var o=t.getSystem().build(e.nbMenu());return s.setMenuBuilt(n,o),o}(r,e,t);return Ui(n.element)||fg.append(r,pu(n)),a.onOpenSubmenu(r,i,n,G(o)),u===c.HighlightSubmenu?(fd.highlightFirst(n),p(r,s,o)):(fd.dehighlightAll(n),st.some(i))})})})},o=function(n,e){var t=l(e);return s.collapse(t).bind(function(t){return g(n,t),p(n,s,t).map(function(t){return a.onCollapseMenu(n,e,t),t})})},r=function(e){return function(n,t){return Ju(t.getSource(),"."+a.markers.item).bind(function(t){return n.getSystem().getByDom(t).toOptional().bind(function(t){return e(n,t).map(function(){return!0})})})}},v=Zo([er(Xg(),function(e,o){var t=o.event.item;s.lookupItem(l(t)).each(function(){var t=o.event.menu;fd.highlight(e,t);var n=l(o.event.item);s.refresh(n).each(function(t){return m(e,s,t)})})}),dr(function(n,t){var e=t.event.target;n.getSystem().getByDom(e).each(function(t){0===l(t).indexOf("collapse-item")&&o(n,t),h(n,t,c.HighlightSubmenu).fold(function(){a.onExecute(n,t)},function(){})})}),sr(function(n,t){e(n).each(function(t){fg.append(n,pu(t)),a.onOpenMenu(n,t),a.highlightImmediately&&f(n,t)})})].concat(a.navigateOnHover?[er(Vg(),function(t,n){var e,o,r=n.event.item;e=t,o=l(r),s.refresh(o).bind(function(t){return g(e,t),p(e,s,t)}),h(t,r,c.HighlightParent),a.onHover(t,r)})]:[])),b=function(t){return fd.getHighlighted(t).bind(fd.getHighlighted)},y={collapseMenu:function(n){b(n).each(function(t){o(n,t)})},highlightPrimary:function(n){s.getPrimary().each(function(t){f(n,t)})},repositionMenus:function(o){s.getPrimary().bind(function(n){return b(o).bind(function(t){var n=l(t),e=Mt(s.getMenus()),o=Kf(V(e,$g.extractPreparedMenu));return s.getTriggeringPath(n,function(t){return e=t,Z(o,function(t){if(!t.getSystem().isConnected())return st.none();var n=fd.getCandidates(t);return L(n,function(t){return l(t)===e})});var e})}).map(function(t){return{primary:n,triggeringPath:t}})}).fold(function(){var t;t=o,st.from(t.components()[0]).filter(function(t){return"menu"===Nr(t.element,"role")}).each(function(t){a.onRepositionMenu(o,t,[])})},function(t){var n=t.primary,e=t.triggeringPath;a.onRepositionMenu(o,n,e)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:Ul(a.tmenuBehaviours,[ug.config({mode:"special",onRight:r(function(t,n){return $f(n.element)?st.none():h(t,n,c.HighlightSubmenu)}),onLeft:r(function(t,n){return $f(n.element)?st.none():o(t,n)}),onEscape:r(function(t,n){return o(t,n).orThunk(function(){return a.onEscape(t,n).map(function(){return t})})}),focusIn:function(n,t){s.getPrimary().each(function(t){Jo(n,t.element,To())})}}),fd.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),td.config({find:function(t){return fd.getHighlighted(t)}}),fg.config({})]),eventOrder:a.eventOrder,apis:y,events:v}},extraApis:{tieredData:function(t,n,e){return{primary:t,menus:n,expansions:e}},singleData:function(t,n){return{primary:t,menus:Jt(t,n),expansions:{}}},collapseItem:function(t){return{value:Kr(Qg()),meta:{text:t}}}}}),tp=Yf({name:"InlineView",configFields:[Ln("lazySink"),ga("onShow"),ga("onHide"),Zn("onEscape"),Ll("inlineBehaviours",[xl,Nl,fc]),te("fireDismissalEventInstead",[ne("event",zo())]),te("fireRepositionEventInstead",[ne("event",No())]),ne("getRelated",st.none),ne("isExtraPart",c),ne("eventOrder",st.none)],factory:function(m,t){var o=function(t,n,e,o){r(t,n,e,function(){return o.map(zu)})},r=function(t,n,e,o){var r=m.lazySink(t).getOrDie();xl.openWhileCloaked(t,e,function(){return Qs.positionWithinBounds(r,n,t,o())}),Nl.setValue(t,st.some({mode:"position",anchor:n,getBounds:o}))},i=function(t,n,e,o){var r,i,u,a,c,s,l,f,d=(r=m,i=t,u=n,c=o,s=function(){return r.lazySink(i)},l="horizontal"===(a=e).type?{layouts:{onLtr:Ja,onRtl:$a}}:{},f=function(t){return 2===t.length?l:{}},Zg.sketch({dom:{tag:"div"},data:a.data,markers:a.menu.markers,highlightImmediately:a.menu.highlightImmediately,onEscape:function(){return xl.close(i),r.onEscape.map(function(t){return t(i)}),st.some(!0)},onExecute:function(){return st.some(!0)},onOpenMenu:function(t,n){Qs.positionWithinBounds(s().getOrDie(),u,n,c())},onOpenSubmenu:function(t,n,e,o){var r=s().getOrDie();Qs.position(r,it({anchor:"submenu",item:n},f(o)),e)},onRepositionMenu:function(t,n,e){var o=s().getOrDie();Qs.positionWithinBounds(o,u,n,c()),lt(e,function(t){var n=f(t.triggeringPath);Qs.position(o,it({anchor:"submenu",item:t.triggeringItem},n),t.triggeredMenu)})}}));xl.open(t,d),Nl.setValue(t,st.some({mode:"menu",menu:d}))},n=function(e){xl.isOpen(e)&&Nl.getValue(e).each(function(t){switch(t.mode){case"menu":xl.getState(e).each(function(t){Zg.repositionMenus(t)});break;case"position":var n=m.lazySink(e).getOrDie();Qs.positionWithinBounds(n,t.anchor,e,t.getBounds())}})},e={setContent:function(t,n){xl.setContent(t,n)},showAt:function(t,n,e){o(t,n,e,st.none())},showWithin:o,showWithinBounds:r,showMenuAt:function(t,n,e){i(t,n,e,function(){return st.none()})},showMenuWithinBounds:i,hide:function(t){xl.isOpen(t)&&(Nl.setValue(t,st.none()),xl.close(t))},getContent:function(t){return xl.getState(t)},reposition:n,isOpen:xl.isOpen};return{uid:m.uid,dom:m.dom,behaviours:Ul(m.inlineBehaviours,[xl.config({isPartOf:function(t,n,e){return Zu(n,e)||(o=t,r=e,m.getRelated(o).exists(function(t){return Zu(t,r)}));var o,r},getAttachPoint:function(t){return m.lazySink(t).getOrDie()},onOpen:function(t){m.onShow(t)},onClose:function(t){m.onHide(t)}}),Nl.config({store:{mode:"memory",initialValue:st.none()}}),fc.config({channels:it(it({},Ol(it({isExtraPart:t.isExtraPart},m.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Tl(it(it({},m.fireRepositionEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})),{doReposition:n})))})]),eventOrder:m.eventOrder,apis:e}},apis:{showAt:function(t,n,e,o){t.showAt(n,e,o)},showWithin:function(t,n,e,o,r){t.showWithin(n,e,o,r)},showWithinBounds:function(t,n,e,o,r){t.showWithinBounds(n,e,o,r)},showMenuAt:function(t,n,e,o){t.showMenuAt(n,e,o)},showMenuWithinBounds:function(t,n,e,o,r){t.showMenuWithinBounds(n,e,o,r)},hide:function(t,n){t.hide(n)},isOpen:function(t,n){return t.isOpen(n)},getContent:function(t,n){return t.getContent(n)},setContent:function(t,n,e){t.setContent(n,e)},reposition:function(t,n){t.reposition(n)}}}),np=function(t){return t.x},ep=function(t,n){return t.x+t.width/2-n.width/2},op=function(t,n){return t.x+t.width-n.width},rp=function(t){return t.y},ip=function(t,n){return t.y+t.height-n.height},up=function(t,n,e){return wa(op(t,n),ip(t,n),e.innerSoutheast(),_a(),Aa(t,{right:0,bottom:3}),"layout-inner-se")},ap=function(t,n,e){return wa(np(t),ip(t,n),e.innerSouthwest(),Oa(),Aa(t,{left:1,bottom:3}),"layout-inner-sw")},cp=function(t,n,e){return wa(op(t,n),rp(t),e.innerNortheast(),Ca(),Aa(t,{right:0,top:2}),"layout-inner-ne")},sp=function(t,n,e){return wa(np(t),rp(t),e.innerNorthwest(),ka(),Aa(t,{left:1,top:2}),"layout-inner-nw")},lp=function(t,n,e){return wa(ep(t,n),rp(t),e.innerNorth(),Ta(),Aa(t,{top:2}),"layout-inner-n")},fp=function(t,n,e){return wa(ep(t,n),ip(t,n),e.innerSouth(),Ea(),Aa(t,{bottom:3}),"layout-inner-s")},dp=tinymce.util.Tools.resolve("tinymce.util.Delay"),mp=Yf({name:"Button",factory:function(t){var n=Ag(t.action),e=t.dom.tag,o=function(n){return Ft(t.dom,"attributes").bind(function(t){return Ft(t,n)})};return{uid:t.uid,dom:t.dom,components:t.components,events:n,behaviours:Gl(t.buttonBehaviours,[vg.config({}),ug.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==e)return{role:o("role").getOr("button")};var t=o("type").getOr("button"),n=o("role").map(function(t){return{role:t}}).getOr({});return it({type:t},n)}()},eventOrder:t.eventOrder}},configFields:[ne("uid",undefined),Ln("dom"),ne("components",[]),Wl("buttonBehaviours",[vg,ug]),Kn("action"),Kn("role"),ne("eventOrder",{})]}),gp=function(t){var n=t.uid!==undefined&&Rt(t,"uid")?t.uid:ei("memento");return{get:function(t){return t.getSystem().getByUid(n).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(n).toOptional()},asSpec:function(){return it(it({},t),{uid:n})}}},pp=function(t){return st.from(t()["temporary-placeholder"]).getOr("!not found!")},hp=function(t,n){return st.from(n()[t.toLowerCase()]).getOrThunk(function(){return pp(n)})},vp={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},bp=Yf({name:"Notification",factory:function(n){var t,e,o=gp({dom:{tag:"p",innerHtml:n.translationProvider(n.text)},behaviours:ic([fg.config({})])}),r=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},i=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},u=gp({dom:{tag:"div",classes:n.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[r(0)]},i(0)],behaviours:ic([fg.config({})])}),a={updateProgress:function(t,n){t.getSystem().isConnected()&&u.getOpt(t).each(function(t){fg.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[r(n)]},i(n)])})},updateText:function(t,n){var e;t.getSystem().isConnected()&&(e=o.get(t),fg.set(e,[fu(n)]))}},c=ft([n.icon.toArray(),n.level.toArray(),n.level.bind(function(t){return st.from(vp[t])}).toArray()]),s=gp(mp.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:hp("close",n.iconProvider),attributes:{"aria-label":n.translationProvider("Close")}}}],action:function(t){n.onAction(t)}})),l=[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:(t=c,e=n.iconProvider,Z(t,function(t){return st.from(e()[t.toLowerCase()])}).getOrThunk(function(){return pp(e)}))}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:ic([fg.config({})])}];return{uid:n.uid,dom:{tag:"div",attributes:{role:"alert"},classes:n.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]}).getOr(["tox-notification","tox-notification--in"])},behaviours:ic([vg.config({}),dg("notification-events",[er(lo(),function(t){s.getOpt(t).each(vg.focus)})])]),components:l.concat(n.progress?[u.asSpec()]:[]).concat(n.closeButton?[s.asSpec()]:[]),apis:a}},configFields:[Kn("level"),Ln("progress"),Ln("icon"),Ln("onAction"),Ln("text"),Ln("iconProvider"),Ln("translationProvider"),ue("closeButton",!0)],apis:{updateProgress:function(t,n,e){t.updateProgress(n,e)},updateText:function(t,n,e){t.updateText(n,e)}}});function yp(t,u,a){var c=u.backstage;return{open:function(t,n){var e=!t.closeButton&&t.timeout&&(0<t.timeout||t.timeout<0),o=function(){n(),tp.hide(i)},r=gu(bp.sketch({text:t.text,level:M(["success","error","warning","warn","info"],t.type)?t.type:undefined,progress:!0===t.progressBar,icon:st.from(t.icon),closeButton:!e,onAction:o,iconProvider:c.shared.providers.icons,translationProvider:c.shared.providers.translate})),i=gu(tp.sketch(it({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:u.backstage.shared.getSink,fireDismissalEventInstead:{}},c.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return a.add(i),0<t.timeout&&dp.setTimeout(function(){o()},t.timeout),{close:o,moveTo:function(t,n){tp.showAt(i,{anchor:"makeshift",x:t,y:n},pu(r))},moveRel:function(t,n){var e,o;"banner"!==n?(e=function(t){switch(t){case"bc-bc":return fp;case"tc-tc":return lp;case"tc-bc":return ja;case"bc-tc":default:return Ua}}(n),o={anchor:"node",root:Wi(),node:st.some(me.fromDom(t)),layouts:{onRtl:function(){return[e]},onLtr:function(){return[e]}}},tp.showAt(i,o,pu(r))):tp.showAt(i,u.backstage.shared.anchors.banner(),pu(r))},text:function(t){bp.updateText(r,t)},settings:t,getEl:function(){return r.element.dom},progressBar:{value:function(t){bp.updateProgress(r,t)}}}},close:function(t){t.close()},reposition:function(t){var e;lt(t,function(t){return t.moveTo(0,0)}),0<(e=t).length&&(K(e).each(function(t){return t.moveRel(null,"banner")}),lt(e,function(t,n){0<n&&t.moveRel(e[n-1].getEl(),"bc-tc")}))},getArgs:function(t){return t.settings}}}var xp,wp,Sp=function(e,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null!==r&&clearTimeout(r),r=setTimeout(function(){e.apply(null,t),r=null},o)}}},kp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Cp=function(o,t,n,e,r){var i=kp(o,function(t){return e=t,(n=o).isBlock(e)||M(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===n.getContentEditable(e);var n,e});return st.from(i.backwards(t,n,e,r))},Op=function(e,n){return _p(me.fromDom(e.selection.getNode())).getOrThunk(function(){var t=me.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',e.getDoc());return Ar(t,me.fromDom(n.extractContents())),n.insertNode(t.dom),kr(t).each(function(t){return t.dom.normalize()}),ds(t,fs).map(function(t){var n;e.selection.setCursorLocation(t.dom,"img"===mr(n=t)?1:ss(n).fold(function(){return _r(n).length},function(t){return t.length}))}),t})},_p=function(t){return Ju(t,"[data-mce-autocompleter]")},Tp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Ep=function(t){return""!==t&&-1!==" \xa0\f\n\r\t\x0B".indexOf(t)},Dp=function(t,n){return t.substring(n.length)},Bp=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 Cp(t,o.startContainer,o.startOffset,function(t,n,e){return function(t,n,e){for(var o=n-1;0<=o;o--){var r=t.charAt(o);if(Ep(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=Tp(n);return 0!==e.lastIndexOf(r)||Dp(e,r).length<i?st.none():st.some({text:Dp(e,r),range:n,triggerChar:r})})},Ap=function(o,t,r,n){return void 0===n&&(n=0),_p(me.fromDom(t.startContainer)).fold(function(){return Bp(o,t,r,n)},function(t){var n=o.createRng();n.selectNode(t.dom);var e=Tp(n);return st.some({range:n,text:Dp(e,r),triggerChar:r})})},Mp=function(e,t){t.on("keypress compositionend",e.onKeypress.throttle),t.on("remove",e.onKeypress.cancel);var o=function(t,n){qo(t,mo(),{raw:n})};t.on("keydown",function(n){var t=function(){return e.getView().bind(fd.getHighlighted)};8===n.which&&e.onKeypress.throttle(n),e.isActive()&&(27===n.which&&e.cancelIfNecessary(),e.isMenuOpen()?13===n.which?(t().each(Ko),n.preventDefault()):40===n.which?(t().fold(function(){e.getView().each(fd.highlightFirst)},function(t){o(t,n)}),n.preventDefault(),n.stopImmediatePropagation()):37!==n.which&&38!==n.which&&39!==n.which||t().each(function(t){o(t,n),n.preventDefault(),n.stopImmediatePropagation()}):13!==n.which&&38!==n.which&&40!==n.which||e.cancelIfNecessary())}),t.on("NodeChange",function(t){e.isActive()&&!e.isProcessingAction()&&_p(me.fromDom(t.element)).isNone()&&e.cancelIfNecessary()})},Fp=tinymce.util.Tools.resolve("tinymce.util.Promise"),Ip=function(t,n){return{container:t,offset:n}},Rp=function(t){if(3===t.nodeType)return Ip(t,t.data.length);var n=t.childNodes;return 0<n.length?Rp(n[n.length-1]):Ip(t,n.length)},Vp=function(t,n){var e=t.childNodes;return 0<e.length&&n<e.length?Vp(e[n],0):0<e.length&&1===t.nodeType&&e.length===n?Rp(e[e.length-1]):Ip(t,n)},Pp=function(r){return function(t){var n,e,o=Vp(t.startContainer,t.startOffset);return!Cp(n=r,(e=o).container,e.offset,function(t,n){return 0===n?-1:n},n.getRoot()).filter(function(t){var n=t.container.data.charAt(t.offset-1);return!Ep(n)}).isSome()}},Hp=function(n,e){var o,r,t=e(),i=n.selection.getRng();return o=n.dom,r=i,Z(t.triggerChars,function(t){return Ap(o,r,t)}).bind(function(t){return zp(n,e,t)})},zp=function(n,t,e,o){void 0===o&&(o={});var r=t(),i=n.selection.getRng().startContainer.nodeValue,u=H(r.lookupByChar(e.triggerChar),function(t){return e.text.length>=t.minChars&&t.matches.getOrThunk(function(){return Pp(n.dom)})(e.range,i,e.text)});if(0===u.length)return st.none();var a=Fp.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,highlightOn:n.highlightOn}})}));return st.some({lookupData:a,context:e})},Np=fn([Un("type"),Qn("text")]),Lp=fn([ne("type","autocompleteitem"),ne("active",!1),ne("disabled",!1),ne("meta",{}),Un("value"),Qn("text"),Qn("icon")]),jp=fn([Un("type"),Un("ch"),oe("minChars",1),ne("columns",1),oe("maxResults",10),Zn("matches"),Gn("fetch"),Gn("onAction"),ce("highlightOn",[],Rn)]),Up=[ue("disabled",!1),Qn("tooltip"),Qn("icon"),Qn("text"),ae("onSetup",function(){return $})],Wp=fn([Un("type"),Gn("onAction")].concat(Up)),Gp=function(t){return _n("toolbarbutton",Wp,t)},Xp=[ue("active",!1)].concat(Up),Yp=fn(Xp.concat([Un("type"),Gn("onAction")])),qp=function(t){return _n("ToggleButton",Yp,t)},Kp=[ae("predicate",function(){return!1}),ie("scope","node",["node","editor"]),ie("position","selection",["node","selection","line"])],Jp=Up.concat([ne("type","contextformbutton"),ne("primary",!1),Gn("onAction"),le("original",ct)]),$p=Xp.concat([ne("type","contextformbutton"),ne("primary",!1),Gn("onAction"),le("original",ct)]),Qp=Up.concat([ne("type","contextformbutton")]),Zp=Xp.concat([ne("type","contextformtogglebutton")]),th=An("type",{contextformbutton:Jp,contextformtogglebutton:$p}),nh=fn([ne("type","contextform"),ae("initValue",function(){return""}),Qn("label"),qn("commands",th),Jn("launch",An("type",{contextformbutton:Qp,contextformtogglebutton:Zp}))].concat(Kp)),eh=fn([ne("type","contexttoolbar"),Un("items")].concat(Kp)),oh=function(t){var n,e,o=t.ui.registry.getAll().popups,r=Tt(o,function(t){return _n("Autocompleter",jp,t).fold(function(t){throw new Error(Dn(t))},function(t){return t})}),i=(n=Bt(r,function(t){return t.ch}),e={},lt(n,function(t){e[t]={}}),Ct(e)),u=Mt(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return H(u,function(t){return t.ch===n})}}};(wp=xp=xp||{})[wp.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",wp[wp.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var rh,ih,uh=xp,ah="tox-menu-nav__js",ch="tox-collection__item",sh="tox-swatch",lh={normal:ah,color:sh},fh="tox-collection__item--enabled",dh="tox-collection__item-label",mh="tox-collection__item-caret",gh="tox-collection__item--active",ph="tox-collection__item-container",hh="tox-collection__item-container--row",vh=function(t){return Ft(lh,t).getOr(ah)},bh=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:"color"===t?"tox-swatches":"tox-menu",tieredMenu:"tox-tiered-menu"}},yh=function(t){var n=bh(t);return{backgroundMenu:n.backgroundMenu,selectedMenu:n.selectedMenu,menu:n.menu,selectedItem:n.selectedItem,item:vh(t)}},xh=[Yg.parts.items({})],wh=function(t,n,e){var o=bh(e);return{dom:{tag:"div",classes:ft([[o.tieredMenu]])},markers:yh(e)}},Sh=function(e,o){return function(t){var n=R(t,o);return V(n,function(t){return{dom:e,components:t}})}},kh=function(t,e){var o=[],r=[];return lt(t,function(t,n){e(t,n)?(0<r.length&&o.push(r),r=[],It(t.dom,"innerHtml")&&r.push(t)):r.push(t)}),0<r.length&&o.push(r),V(o,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}})},Ch=function(n,e,t){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===n?["tox-collection--list"]:["tox-collection--grid"])},components:[Yg.parts.items({preprocess:function(t){return"auto"!==n&&1<n?Sh({tag:"div",classes:["tox-collection__group"]},n)(t):kh(t,function(t,n){return"separator"===e[n].type})}})]}},Oh=function(t){return F(t,function(t){return"icon"in t&&t.icon!==undefined})},_h=function(t){return console.error(Dn(t)),console.log(t),st.none()},Th=function(t,n,e,o,r){var i,u=(i=e,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Yg.parts.items({preprocess:function(t){return kh(t,function(t,n){return"separator"===i[n].type})}})]});return{value:t,dom:u.dom,components:u.components,items:e}},Eh=function(t,n,e,o,r){var i,u,a,c,s,l;return"color"===r?{value:t,dom:(a=(i=o,{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Yg.parts.items({preprocess:"auto"!==i?Sh({tag:"div",classes:["tox-swatches__row"]},i):ct})]}]})).dom,components:a.components,items:e}:"normal"===r&&"auto"===o?{value:t,dom:(a=Ch(o,e)).dom,components:a.components,items:e}:"normal"===r&&1===o?{value:t,dom:(a=Ch(1,e)).dom,components:a.components,items:e}:"normal"===r?{value:t,dom:(a=Ch(o,e)).dom,components:a.components,items:e}:"listpreview"!==r||"auto"===o?{value:t,dom:(c=n,s=o,l=bh(r),{tag:"div",classes:ft([[l.menu,"tox-menu-"+s+"-column"],c?[l.hasIcons]:[]])}),components:xh,items:e}:{value:t,dom:(a=(u=o,{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Yg.parts.items({preprocess:Sh({tag:"div",classes:["tox-collection__group"]},u)})]})).dom,components:a.components,items:e}},Dh=[Un("type"),Un("src"),Qn("alt"),ce("classes",[],Rn)],Bh=fn(Dh),Ah=[Un("type"),Un("text"),Qn("name"),ce("classes",["tox-collection__item-label"],Rn)],Mh=fn(Ah),Fh=kn(function(){return Bn("type",{cardimage:Bh,cardtext:Mh,cardcontainer:Ih})}),Ih=fn([Un("type"),re("direction","horizontal"),re("align","left"),re("valign","middle"),qn("items",Fh)]),Rh=[ue("disabled",!1),Qn("text"),Qn("shortcut"),bn("value","value",Xt(function(){return Kr("menuitem-value")}),Mn()),ne("meta",{})],Vh=fn([Un("type"),Qn("label"),qn("items",Fh),ae("onSetup",function(){return $}),ae("onAction",$)].concat(Rh)),Ph=fn([Un("type"),ue("active",!1),Qn("icon")].concat(Rh)),Hh=fn([Un("type"),Wn("fancytype",["inserttable","colorswatch"]),ae("onAction",$)]),zh=fn([Un("type"),ae("onSetup",function(){return $}),ae("onAction",$),Qn("icon")].concat(Rh)),Nh=fn([Un("type"),Gn("getSubmenuItems"),ae("onSetup",function(){return $}),Qn("icon")].concat(Rh)),Lh=fn([Un("type"),Qn("icon"),ue("active",!1),ae("onSetup",function(){return $}),Gn("onAction")].concat(Rh)),jh=function(t,o,n){var r=ms(t.element,"."+n);if(0<r.length){var e=j(r,function(t){var n=t.dom.getBoundingClientRect().top,e=r[0].dom.getBoundingClientRect().top;return Math.abs(n-e)>o}).getOr(r.length);return st.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return st.none()},Uh=function(t,n){return ic([dg(t,n)])},Wh=function(t){return Uh(Kr("unnamed-events"),t)},Gh=[Ln("lazySink"),Ln("tooltipDom"),ne("exclusive",!0),ne("tooltipComponents",[]),ne("delay",300),ie("mode","normal",["normal","follow-highlight"]),ne("anchor",function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:at([Ua,ja,Ha,Na,za,La]),onRtl:at([Ua,ja,Ha,Na,za,La])}}}),ga("onHide"),ga("onShow")],Xh=/* */Object.freeze({__proto__:null,init:function(){var e=fe(st.none()),n=fe(st.none()),o=function(){e.get().each(function(t){clearTimeout(t)})},t=at("not-implemented");return di({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(setTimeout(function(){t()},n)))},readState:t})}}),Yh=Kr("tooltip.exclusive"),qh=Kr("tooltip.show"),Kh=Kr("tooltip.hide"),Jh=function(t,n,e){t.getSystem().broadcastOn([Yh],{})},$h=/* */Object.freeze({__proto__:null,hideAllExclusive:Jh,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&fg.set(t,o)})}}),Qh=ac({fields:Gh,name:"tooltipping",active:/* */Object.freeze({__proto__:null,events:function(r,i){var e=function(n){i.getTooltip().each(function(t){ul(t),r.onHide(n,t),i.clearTooltip()}),i.clearTimer()};return Zo(ft([[er(qh,function(o){i.resetTimer(function(){var n,t,e;n=o,i.isShowing()||(Jh(n),t=r.lazySink(n).getOrDie(),e=n.getSystem().build({dom:r.tooltipDom,components:r.tooltipComponents,events:Zo("normal"===r.mode?[er(so(),function(t){Yo(n,qh)}),er(ao(),function(t){Yo(n,Kh)})]:[]),behaviours:ic([fg.config({})])}),i.setTooltip(e),ol(t,e),r.onShow(n,e),Qs.position(t,r.anchor(n),e))},r.delay)}),er(Kh,function(t){i.resetTimer(function(){e(t)},r.delay)}),er(Oo(),function(t,n){n.universal||M(n.channels,Yh)&&e(t)}),lr(function(t){e(t)})],"normal"===r.mode?[er(lo(),function(t){Yo(t,qh)}),er(ko(),function(t){Yo(t,Kh)}),er(so(),function(t){Yo(t,qh)}),er(ao(),function(t){Yo(t,Kh)})]:[er(Go(),function(t,n){Yo(t,qh)}),er(Xo(),function(t){Yo(t,Kh)})]]))}}),state:Xh,apis:$h}),Zh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),tv=tinymce.util.Tools.resolve("tinymce.util.I18n"),nv=["input","button","textarea","select"],ev=function(t,n,e){(n.disabled()?cv:sv)(t,n)},ov=function(t,n){return!0===n.useNative&&M(nv,mr(t.element))},rv=function(t){zr(t.element,"disabled","disabled")},iv=function(t){Ur(t.element,"disabled")},uv=function(t){zr(t.element,"aria-disabled","true")},av=function(t){zr(t.element,"aria-disabled","false")},cv=function(n,t,e){t.disableClass.each(function(t){Ei(n.element,t)}),(ov(n,t)?rv:uv)(n),t.onDisabled(n)},sv=function(n,t,e){t.disableClass.each(function(t){Bi(n.element,t)}),(ov(n,t)?iv:av)(n),t.onEnabled(n)},lv=function(t,n){return ov(t,n)?jr(t.element,"disabled"):"true"===Nr(t.element,"aria-disabled")},fv=/* */Object.freeze({__proto__:null,enable:sv,disable:cv,isDisabled:lv,onLoad:ev,set:function(t,n,e,o){(o?cv:sv)(t,n)}}),dv=/* */Object.freeze({__proto__:null,exhibit:function(t,n){return gi({classes:n.disabled()?n.disableClass.toArray():[]})},events:function(e,t){return Zo([tr(_o(),function(t,n){return lv(t,e)}),tc(e,t,ev)])}}),mv=[ae("disabled",c),ne("useNative",!0),Kn("disableClass"),ga("onDisabled"),ga("onEnabled")],gv=ac({fields:mv,name:"disabling",active:dv,apis:fv}),pv=tinymce.util.Tools.resolve("tinymce.EditorManager"),hv=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},vv=function(t){return t.getParam("width",Zh.DOM.getStyle(t.getElement(),"width"))},bv=function(t){return st.from(t.getParam("min_width")).filter(ut)},yv=function(t){return st.from(t.getParam("min_height")).filter(ut)},xv=function(t){return st.from(t.getParam("max_width")).filter(ut)},wv=function(t){return st.from(t.getParam("max_height")).filter(ut)},Sv=function(t){return!1!==t.getParam("menubar",!0,"boolean")},kv=function(t){var n=t.getParam("toolbar",!0),e=!0===n,o=k(n),r=p(n)&&0<n.length;return!Ov(t)&&(r||o||e)},Cv=function(n){var t=I(9,function(t){return n.getParam("toolbar"+(t+1),!1,"string")}),e=H(t,function(t){return"string"==typeof t});return 0<e.length?st.some(e):st.none()},Ov=function(t){return Cv(t).fold(function(){return 0<t.getParam("toolbar",[],"string[]").length},function(){return!0})};(ih=rh=rh||{})["default"]="wrap",ih.floating="floating",ih.sliding="sliding",ih.scrolling="scrolling";var _v,Tv,Ev=function(t){return t.getParam("toolbar_mode","","string")};(Tv=_v=_v||{}).auto="auto",Tv.top="top",Tv.bottom="bottom";var Dv,Bv=function(t){return t.getParam("toolbar_location",_v.auto,"string")},Av=function(t){return Bv(t)===_v.bottom},Mv=function(t){var n=t.getParam("fixed_toolbar_container","","string");return 0<n.length&&t.inline?Ku(Wi(),n):st.none()},Fv=function(t){return t.inline&&Mv(t).isSome()},Iv=function(t){return Mv(t).getOrThunk(function(){return zi(Hi(me.fromDom(t.getElement())))})},Rv=function(t){return t.inline&&!Sv(t)&&!kv(t)&&!Ov(t)},Vv=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Fv(t)&&!Rv(t)},Pv="silver.readonly",Hv=fn([jn("readonly",Vn)]),zv=function(t,n){var e=t.outerContainer.element;n&&(t.mothership.broadcastOn([wl()],{target:e}),t.uiMothership.broadcastOn([wl()],{target:e})),t.mothership.broadcastOn([Pv],{readonly:n}),t.uiMothership.broadcastOn([Pv],{readonly:n})},Nv=function(t,n){t.on("init",function(){t.mode.isReadOnly()&&zv(n,!0)}),t.on("SwitchMode",function(){return zv(n,t.mode.isReadOnly())}),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly")},Lv=function(){var t;return fc.config({channels:((t={})[Pv]={schema:Hv,onReceive:function(t,n){gv.set(t,n.readonly)}},t)})},jv=function(t){return gv.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},Uv=function(t){return gv.config({disabled:t})},Wv=function(t){return gv.config({disabled:t,disableClass:"tox-tbtn--disabled"})},Gv=function(t){return gv.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Xv=function(t,n){var e=t.getApi(n);return function(t){t(e)}},Yv=function(e,o){return sr(function(t){Xv(e,t)(function(t){var n=e.onSetup(t);null!==n&&n!==undefined&&o.set(n)})})},qv=function(n,e){return lr(function(t){return Xv(n,t)(e.get())})},Kv=((Dv={})[_o()]=["disabling","alloy.base.behaviour","toggling","item-events"],Dv),Jv=function(t){return U(t,function(t){return t.toArray()})},$v=function(t,n,e,o){var r,i,u=fe($);return{type:"item",dom:n.dom,components:Jv(n.optComponents),data:t.data,eventOrder:Kv,hasSubmenu:t.triggersSubmenu,itemBehaviours:ic([dg("item-events",[(r=t,i=e,dr(function(t,n){Xv(r,t)(r.onAction),r.triggersSubmenu||i!==uh.CLOSE_ON_EXECUTE||(Yo(t,Bo()),n.stop())})),Yv(t,u),qv(t,u)]),jv(function(){return t.disabled||o.isDisabled()}),Lv(),fg.config({})].concat(t.itemBehaviours))}},Qv=function(t){return{value:t.value,meta:it({text:t.text.getOr("")},t.meta)}},Zv=tinymce.util.Tools.resolve("tinymce.Env"),tb=function(t){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:t}}},nb=function(t){return{dom:{tag:"div",classes:[dh]},components:[fu(tv.translate(t))]}},eb=function(t,n){return{dom:{tag:"div",classes:n,innerHtml:t}}},ob=function(t,n){return{dom:{tag:"div",classes:[dh]},components:[{dom:{tag:t.tag,styles:t.styles},components:[fu(tv.translate(n))]}]}},rb=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:(n=t,e=Zv.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 It(e,n)?e[n]:t}),Zv.mac?r.join(""):r.join("+"))}};var n,e,o,r},ib=function(t){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:hp("checkmark",t)}}},ub=function(t,n){var e=n.map(function(t){return{attributes:{title:tv.translate(t)}}}).getOr({});return it({tag:"div",classes:[ah,ch].concat(t?["tox-collection__item-icon-rtl"]:[])},e)},ab=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],cb=["list-bull-circle","list-bull-default","list-bull-square"],sb=function(t,r,n,i){void 0===i&&(i=st.none());var e,o,u,a,c,s,l,f,d,m,g,p,h=tv.isRtl()&&t.iconContent.exists(function(t){return M(cb,t)}),v=t.iconContent.map(function(t){return tv.isRtl()&&M(ab,t)?t+"-rtl":t}).map(function(t){return n=t,e=r.icons,o=i,st.from(e()[n.toLowerCase()]).or(o).getOrThunk(function(){return pp(e)});var n,e,o}),b=st.from(t.meta).fold(function(){return nb},function(t){return It(t,"style")?y(ob,t.style):nb});return"color"===t.presets?(f=t.ariaLabel,d=t.value,m=r,{dom:(g=v.getOr(""),p={tag:"div",attributes:f.map(function(t){return{title:m.translate(t)}}).getOr({}),classes:["tox-swatch"]},it(it({},p),"custom"===d?{tag:"button",classes:S(p.classes,["tox-swatches__picker-btn"]),innerHtml:g}:"remove"===d?{classes:S(p.classes,["tox-swatch--remove"]),innerHtml:g}:{attributes:it(it({},p.attributes),{"data-mce-color":d}),styles:{"background-color":d}})),optComponents:[]}):(e=t,o=v,u=b,a=h,c=n?o.or(st.some("")).map(tb):st.none(),s=e.checkMark,l=e.htmlContent.fold(function(){return e.textContent.map(u)},function(t){return st.some(eb(t,[dh]))}),{dom:ub(a,e.ariaLabel),optComponents:[c,l,e.shortcutContent.map(rb),s,e.caret]})},lb=function(t,n){return Ft(t,"tooltipWorker").map(function(e){return[Qh.config({lazySink:n.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:Fc}}},mode:"follow-highlight",onShow:function(n,t){e(function(t){Qh.setComponents(n,[du({element:me.fromDom(t)})])})}})]}).getOr([])},fb=function(t,n){var e,o=tv.translate(t),r=(e=o,Zh.DOM.encode(e));if(0<n.length){var i=new RegExp(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");return r.replace(i,function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"})}return r},db=Cf(Ng(),Lg()),mb=function(t){return{value:t}},gb=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,pb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,hb=function(t){return gb.test(t)||pb.test(t)},vb=function(t){var n={value:t.value.replace(gb,function(t,n,e,o){return n+n+e+e+o+o})},e=pb.exec(n.value);return null===e?["FFFFFF","FF","FF","FF"]:e},bb=function(t){var n=t.toString(16);return 1===n.length?"0"+n:n},yb=function(t){var n=bb(t.red)+bb(t.green)+bb(t.blue);return mb(n)},xb=Math.min,wb=Math.max,Sb=Math.round,kb=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Cb=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Ob=function(t,n,e,o){return{red:t,green:n,blue:e,alpha:o}},_b=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},Tb=function(t){var n,e,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100,i=wb(0,xb(i,1)),u=wb(0,xb(u,1));if(0===i)return n=e=o=Sb(255*u),Ob(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=Sb(255*(n+l)),e=Sb(255*(e+l)),o=Sb(255*(o+l)),Ob(n,e,o,1)},Eb=function(t){var n=vb(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return Ob(e,o,r,1)},Db=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return Ob(r,i,u,a)},Bb=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},Ab=Ob(255,0,0,1),Mb=function(t,n){return t.fire("ResizeContent",n)},Fb=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Ib="tinymce-custom-colors";var Rb="choiceitem",Vb=[{type:Rb,text:"Light Green",value:"#BFEDD2"},{type:Rb,text:"Light Yellow",value:"#FBEEB8"},{type:Rb,text:"Light Red",value:"#F8CAC6"},{type:Rb,text:"Light Purple",value:"#ECCAFA"},{type:Rb,text:"Light Blue",value:"#C2E0F4"},{type:Rb,text:"Green",value:"#2DC26B"},{type:Rb,text:"Yellow",value:"#F1C40F"},{type:Rb,text:"Red",value:"#E03E2D"},{type:Rb,text:"Purple",value:"#B96AD9"},{type:Rb,text:"Blue",value:"#3598DB"},{type:Rb,text:"Dark Turquoise",value:"#169179"},{type:Rb,text:"Orange",value:"#E67E23"},{type:Rb,text:"Dark Red",value:"#BA372A"},{type:Rb,text:"Dark Purple",value:"#843FA1"},{type:Rb,text:"Dark Blue",value:"#236FA1"},{type:Rb,text:"Light Gray",value:"#ECF0F1"},{type:Rb,text:"Medium Gray",value:"#CED4D9"},{type:Rb,text:"Gray",value:"#95A5A6"},{type:Rb,text:"Dark Gray",value:"#7E8C8D"},{type:Rb,text:"Navy Blue",value:"#34495E"},{type:Rb,text:"Black",value:"#000000"},{type:Rb,text:"White",value:"#ffffff"}],Pb=function(e){void 0===e&&(e=10);var t,n=Fb.getItem(Ib),o=k(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(),Fb.setItem(Ib,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),Hb=function(t){return!1!==t.getParam("custom_colors")},zb=function(t){var n=t.getParam("color_map");return n!==undefined?function(t){var n=[],u=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=0;e<t.length;e+=2)n.push({text:t[e+1],value: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)}(t[e]),type:"choiceitem"});return n}(n):Vb},Nb=function(t){Pb.add(t)},Lb=function(i){i.addCommand("mceApplyTextcolor",function(t,n){var e,o,r;o=t,r=n,(e=i).undoManager.transact(function(){e.focus(),e.formatter.apply(o,{value:r}),e.nodeChanged()})}),i.addCommand("mceRemoveTextcolor",function(t){var n,e;e=t,(n=i).undoManager.transact(function(){n.focus(),n.formatter.remove(e,{value:null},null,!0),n.nodeChanged()})})},jb=function(t){var n,e,o=zb(t),r=(n=o.length,Math.max(5,Math.ceil(Math.sqrt(n))));return e=r,t.getParam("color_cols",e,"number")},Ub=function(n,e,t,o){"custom"===t?Kb(n)(function(t){t.each(function(t){Nb(t),n.execCommand("mceApplyTextcolor",e,t),o(t)})},"#000000"):"remove"===t?(o(""),n.execCommand("mceRemoveTextcolor",e)):(o(t),n.execCommand("mceApplyTextcolor",e,t))},Wb=function(t,n){return t.concat(V(Pb.state(),function(t){return{type:Rb,text:t,value:t}}).concat((o={type:e="choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"},n?[o,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[o])));var e,o},Gb=function(n,e){return function(t){t(Wb(n,e))}},Xb=function(t,n,e){var o,r;o="forecolor"===n?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",r=e,t.setIconFill(o,r),t.setIconStroke(o,r)},Yb=function(i,e,u,t,o){i.ui.registry.addSplitButton(e,{tooltip:t,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){var t,o,r;return st.from((o=u,(t=i).dom.getParents(t.selection.getStart(),function(t){var n;(n=t.style["forecolor"===o?"color":"background-color"])&&(r=r||n)}),r)).bind(function(t){return function(t){if("transparent"===t)return st.some(Ob(0,0,0,0));var n=kb.exec(t);if(null!==n)return st.some(Db(n[1],n[2],n[3],"1"));var e=Cb.exec(t);return null!==e?st.some(Db(e[1],e[2],e[3],e[4])):st.none()}(t).map(function(t){var n=yb(t).value;return we(e.toLowerCase(),n)})}).getOr(!1)},columns:jb(i),fetch:Gb(zb(i),Hb(i)),onAction:function(t){null!==o.get()&&Ub(i,u,o.get(),function(){})},onItemAction:function(t,n){Ub(i,u,n,function(t){var n;o.set(t),n={name:e,color:t},i.fire("TextColorChange",n)})},onSetup:function(n){null!==o.get()&&Xb(n,e,o.get());var t=function(t){t.name===e&&Xb(n,t.name,t.color)};return i.on("TextColorChange",t),function(){i.off("TextColorChange",t)}}})},qb=function(n,t,e,o){n.ui.registry.addNestedMenuItem(t,{text:o,icon:"forecolor"===t?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(t){Ub(n,e,t.value,$)}}]}})},Kb=function(i){return function(t,n){var e,o={colorpicker:n},r=(e=t,function(t){var n=t.getData();e(st.from(n.colorpicker)),t.close()});i.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(t,n){"hex-valid"===n.name&&(n.value?t.enable("ok"):t.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){t(st.none())}})}},Jb=function(t,n,e,o,r,i,u,a){var c=Oh(n),s=$b(n,e,o,"color"!==r?"normal":"color",i,u,a);return Eh(t,c,s,o,r)},$b=function(e,o,r,i,u,a,c){return Kf(V(e,function(n){return"choiceitem"===n.type?_n("choicemenuitem",Ph,n).fold(_h,function(t){return st.some(function(n,t,e,o,r,i,u,a){void 0===a&&(a=!0);var c=sb({presets:e,textContent:t?n.text:st.none(),htmlContent:st.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:t?n.shortcut:st.none(),checkMark:t?st.some(ib(u.icons)):st.none(),caret:st.none(),value:n.value},u,a);return zt($v({data:Qv(n),disabled:n.disabled,getApi:function(n){return{setActive:function(t){Dg.set(n,t)},isActive:function(){return Dg.isOn(n)},isDisabled:function(){return gv.isDisabled(n)},setDisabled:function(t){return gv.set(n,t)}}},onAction:function(t){return o(n.value)},onSetup:function(t){return t.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:fh,toggleOnExecute:!1,selected:n.active}})}(t,1===r,i,o,a(n.value),u,c,Oh(e)))}):st.none()}))},Qb=function(t,n){var e=yh(n);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+e.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===n?"tox-swatches__row":"tox-collection__group")}};var Zb,ty,ny=Kr("cell-over"),ey=Kr("cell-execute"),oy=function(t,n,e){for(var o=[],r=0;r<n;r++){for(var i=[],u=0;u<e;u++)i.push(function(n,e,t){var o,r=function(t){return qo(t,ey,{row:n,col:e})},i=function(t,n){n.stop(),r(t)};return gu({dom:{tag:"div",attributes:((o={role:"button"})["aria-labelledby"]=t,o)},behaviours:ic([dg("insert-table-picker-cell",[er(so(),vg.focus),er(_o(),r),er(vo(),i),er(Eo(),i)]),Dg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),vg.config({onFocus:function(t){return qo(t,ny,{row:n,col:e})}})])})}(r,u,t));o.push(i)}return o},ry={inserttable:function(o){var t=Kr("size-label"),i=oy(t,10,10),u=gp({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:t}},components:[fu("0x0")],behaviours:ic([fg.config({})])});return{type:"widget",data:{value:Kr("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[db.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:U(i,function(t){return V(t,pu)}).concat(u.asSpec()),behaviours:ic([dg("insert-table-picker",[ur(ny,function(t,n,e){var o=e.event.row,r=e.event.col;!function(t,n,e,o,r){for(var i=0;i<o;i++)for(var u=0;u<r;u++)Dg.set(t[i][u],i<=n&&u<=e)}(i,o,r,10,10),fg.set(u.get(t),[fu(r+1+"x"+(o+1))])}),ur(ey,function(t,n,e){o.onAction({numRows:e.event.row+1,numColumns:e.event.col+1}),Yo(t,Bo())})]),ug.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(n,t){var e=Wb(t.colorinput.getColors(),t.colorinput.hasCustomColors()),o=t.colorinput.getColorCols(),r=Jb(Kr("menu-value"),e,function(t){n.onAction({value:t})},o,"color",uh.CLOSE_ON_EXECUTE,function(){return!1},t.shared.providers),i=it(it({},r),{markers:yh("color"),movement:Qb(o,"color")});return{type:"widget",data:{value:Kr("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[db.widget(Yg.sketch(i))]}}},iy=function(t,s){return V(t,function(t){switch(t.type){case"cardcontainer":return u=iy((i=t).items,s),a="vertical"===i.direction?"tox-collection__item-container--column":hh,c="left"===i.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right",{dom:{tag:"div",classes:[ph,a,c,function(){switch(i.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:u};case"cardimage":return e=t.src,o=t.classes,r=t.alt,{dom:{tag:"img",classes:o,attributes:{src:e,alt:r.getOr("")}}};case"cardtext":var n=t.name.exists(function(t){return M(s.cardText.highlightOn,t)})?st.from(s.cardText.matchText).getOr(""):"";return eb(fb(t.text,n),t.classes)}var e,o,r,i,u,a,c})},uy=function(n,e,t,o,r,i,u,a){void 0===a&&(a=!0);var c=sb({presets:o,textContent:st.none(),htmlContent:t?n.text.map(function(t){return fb(t,e)}):st.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:st.none(),checkMark:st.none(),caret:st.none(),value:n.value},u.providers,a,n.icon);return $v({data:Qv(n),disabled:n.disabled,getApi:function(){return{}},onAction:function(t){return r(n.value,n.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:lb(n.meta,u)},c,i,u.providers)},ay=function(t){var n=t.text.fold(function(){return{}},function(t){return{innerHtml:t}});return{type:"separator",dom:it({tag:"div",classes:[ch,"tox-collection__group-heading"]},n),components:[]}},cy=function(t,n,e,o){void 0===o&&(o=!0);var r=sb({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:st.none(),ariaLabel:t.text,caret:st.none(),checkMark:st.none(),shortcutContent:t.shortcut},e,o);return $v({data:Qv(t),getApi:function(n){return{isDisabled:function(){return gv.isDisabled(n)},setDisabled:function(t){return gv.set(n,t)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e)},sy=function(t,n,e,o,r){void 0===o&&(o=!0),void 0===r&&(r=!1);var i,u,a=r?(u=e.icons,{dom:{tag:"div",classes:[mh],innerHtml:hp("chevron-down",u)}}):(i=e.icons,{dom:{tag:"div",classes:[mh],innerHtml:hp("chevron-right",i)}}),c=sb({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:st.none(),ariaLabel:t.text,caret:st.some(a),checkMark:st.none(),shortcutContent:t.shortcut},e,o);return $v({data:Qv(t),getApi:function(n){return{isDisabled:function(){return gv.isDisabled(n)},setDisabled:function(t){return gv.set(n,t)}}},disabled:t.disabled,onAction:$,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},c,n,e)},ly=function(t,n,e,o){void 0===o&&(o=!0);var r=sb({iconContent:t.icon,textContent:t.text,htmlContent:st.none(),ariaLabel:t.text,checkMark:st.some(ib(e.icons)),caret:st.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},e,o);return zt($v({data:Qv(t),disabled:t.disabled,getApi:function(n){return{setActive:function(t){Dg.set(n,t)},isActive:function(){return Dg.isOn(n)},isDisabled:function(){return gv.isDisabled(n)},setDisabled:function(t){return gv.set(n,t)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e),{toggling:{toggleClass:fh,toggleOnExecute:!1,selected:t.active}})},fy=function(n,e){return t=ry,o=n.fancytype,(Object.prototype.hasOwnProperty.call(t,o)?st.some(t[o]):st.none()).map(function(t){return t(n,e)});var t,o},dy=function(t,n,e,o){var r={dom:ub(!1,t.label),optComponents:[st.some({dom:{tag:"div",classes:[ph,hh]},components:iy(t.items,o)})]};return $v({data:Qv(it({text:st.none()},t)),disabled:t.disabled,getApi:function(e){return{isDisabled:function(){return gv.isDisabled(e)},setDisabled:function(n){gv.set(e,n),lt(ms(e.element,"*"),function(t){e.getSystem().getByDom(t).each(function(t){t.hasConfigured(gv)&&gv.set(t,n)})})}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:st.from(o.itemBehaviours).getOr([])},r,n,e.providers)};(ty=Zb=Zb||{})[ty.ContentFocus=0]="ContentFocus",ty[ty.UiFocus=1]="UiFocus";var my=function(t,n,e,o,r){var i=e.shared.providers,u=function(t){return r?it(it({},t),{shortcut:st.none(),icon:t.text.isSome()?st.none():t.icon}):t};switch(t.type){case"menuitem":return _n("menuitem",zh,t).fold(_h,function(t){return st.some(cy(u(t),n,i,o))});case"nestedmenuitem":return _n("nestedmenuitem",Nh,t).fold(_h,function(t){return st.some(sy(u(t),n,i,o,r))});case"togglemenuitem":return _n("togglemenuitem",Lh,t).fold(_h,function(t){return st.some(ly(u(t),n,i,o))});case"separator":return _n("separatormenuitem",Np,t).fold(_h,function(t){return st.some(ay(t))});case"fancymenuitem":return _n("fancymenuitem",Hh,t).fold(_h,function(t){return fy(u(t),e)});default:return console.error("Unknown item in general menu",t),st.none()}},gy=function(t,e,o,n,r,i,u){var a=1===n,c=!a||Oh(t);return Kf(V(t,function(t){switch(t.type){case"separator":return _n("Autocompleter.Separator",Np,t).fold(_h,function(t){return st.some(ay(t))});case"cardmenuitem":return _n("cardmenuitem",Vh,t).fold(_h,function(n){return st.some(dy(it(it({},n),{onAction:function(t){n.onAction(t),o(n.value,n.meta)}}),r,i,{itemBehaviours:lb(n.meta,i),cardText:{matchText:e,highlightOn:u}}))});case"autocompleteitem":default:return _n("Autocompleter.Item",Lp,t).fold(_h,function(t){return st.some(uy(t,e,a,"normal",o,r,i,c))})}}))},py=function(t,n,e,o,r){var i=Oh(n),u=Kf(V(n,function(t){var n=function(t){return my(t,e,o,(n=t,r?!n.hasOwnProperty("text"):i),r);var n};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?n(it(it({},t),{disabled:!0})):n(t)}));return(r?Th:Eh)(t,i,u,1,"normal")},hy=function(t){return Zg.singleData(t.value,t)},vy=function(d,c){var e=fe(st.none()),s=fe(!1),m=gu(tp.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:ic([dg("dismissAutocompleter",[er(zo(),function(){return f()})])]),lazySink:c.getSink})),o=function(){return e.get().isSome()},l=function(){o()&&tp.hide(m)},f=function(){var t;o()&&(t=e.get().map(function(t){return t.element}),_p(t.getOr(me.fromDom(d.selection.getNode()))).each(Rr),l(),e.set(st.none()),s.set(!1))},r=Lt(function(){return oh(d)}),g=function(t,n,e,o){t.matchLength=n.text.length;var r,i,u,a,c,s,l,f=Z(e,function(t){return st.from(t.columns)}).getOr(1);tp.showAt(m,{anchor:"node",root:me.fromDom(d.getBody()),node:st.from(t.element)},Yg.sketch((r=Eh("autocompleter-value",!0,o,f,"normal"),i=f,u=Zb.ContentFocus,a="normal",c=(u===Zb.ContentFocus?Fd:Md)(),s=Qb(i,a),l=yh(a),{dom:r.dom,components:r.components,items:r.items,value:r.value,markers:{selectedItem:l.selectedItem,item:l.item},movement:s,fakeFocus:u===Zb.ContentFocus,focusManager:c,menuBehaviours:Wh("auto"!==i?[]:[sr(function(o,t){jh(o,4,l.item).each(function(t){var n=t.numColumns,e=t.numRows;ug.setGridSize(o,e,n)})})])}))),tp.getContent(m).each(fd.highlightFirst)},p=function(t){var n;n=t,e.get().map(function(t){return Ap(d.dom,d.selection.getRng(),t.triggerChar).bind(function(t){return zp(d,r,t,n)})}).getOrThunk(function(){return Hp(d,r)}).fold(f,function(a){var t,n;t=a.context,o()||(n=Op(d,t.range),e.set(st.some({triggerChar:t.triggerChar,element:n,matchLength:t.text.length})),s.set(!1)),a.lookupData.then(function(u){e.get().map(function(t){var n,e,o,r,i=a.context;t.triggerChar===i.triggerChar&&(e=i.triggerChar,r=Z(o=u,function(t){return st.from(t.columns)}).getOr(1),0<(n=U(o,function(i){var t=i.items;return gy(t,i.matchText,function(o,r){var t=d.selection.getRng();Ap(d.dom,t,e).fold(function(){return console.error("Lost context. Cursor probably moved")},function(t){var n=t.range,e={hide:function(){f()},reload:function(t){l(),p(t)}};s.set(!0),i.onAction(e,n,o,r),s.set(!1)})},r,uh.BUBBLE_TO_SANDBOX,c,i.highlightOn)})).length?g(t,i,u,n):(10<=i.text.length-t.matchLength?f:l)())})})})},t={onKeypress:Sp(function(t){27!==t.which&&p()},50),cancelIfNecessary:f,isMenuOpen:function(){return tp.isOpen(m)},isActive:o,isProcessingAction:s.get,getView:function(){return tp.getContent(m)}};!1===d.hasPlugin("rtc")&&Mp(t,d)},by=b,yy=function(t,n,e){return Du(t,n,by,e,!1)},xy=function(t,n,e){return Du(t,n,by,e,!0)},wy=Eu,Sy=function(t,n,e){return Ju(t,n,e).isSome()};function ky(e,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r=setTimeout(function(){e.apply(null,t),r=null},o)}}}var Cy=function(t){var n=t.raw;return n.touches===undefined||1!==n.touches.length?st.none():st.some(n.touches[0])},Oy=function(e){var u=fe(st.none()),o=fe(!1),r=ky(function(t){e.triggerEvent(Do(),t),o.set(!0)},400),i=$t([{key:no(),value:function(e){return Cy(e).each(function(t){r.cancel();var n={x:t.clientX,y:t.clientY,target:e.target};r.schedule(e),o.set(!1),u.set(st.some(n))}),st.none()}},{key:eo(),value:function(t){return r.cancel(),Cy(t).each(function(i){u.get().each(function(t){var n,e,o,r;n=i,e=t,o=Math.abs(n.clientX-e.x),r=Math.abs(n.clientY-e.y),(5<o||5<r)&&u.set(st.none())})}),st.none()}},{key:oo(),value:function(n){r.cancel();return u.get().filter(function(t){return Ge(t.target,n.target)}).map(function(t){return o.get()?(n.prevent(),!1):e.triggerEvent(Eo(),n)})}}]);return{fireIfReady:function(n,t){return Ft(i,t).bind(function(t){return t(n)})}}},_y=function(){return je().browser.isFirefox()},Ty=ln([Gn("triggerEvent"),ne("stopBackspace",!0)]),Ey=function(n,t){var e,o,r,i,u=En("Getting GUI events settings",Ty,t),a=Oy(u),c=V(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(t){return yy(n,t,function(n){a.fireIfReady(n,t).each(function(t){t&&n.kill()}),u.triggerEvent(t,n)&&n.kill()})}),s=fe(st.none()),l=yy(n,"paste",function(n){a.fireIfReady(n,"paste").each(function(t){t&&n.kill()}),u.triggerEvent("paste",n)&&n.kill(),s.set(st.some(setTimeout(function(){u.triggerEvent(Co(),n)},0)))}),f=yy(n,"keydown",function(t){var n;u.triggerEvent("keydown",t)?t.kill():!0!==u.stopBackspace||((n=t).raw.which!==dd[0]||M(["input","textarea"],mr(n.target))||Sy(n.target,'[contenteditable="true"]'))||t.prevent()}),d=(e=n,o=function(t){u.triggerEvent("focusin",t)&&t.kill()},_y()?xy(e,"focus",o):yy(e,"focusin",o)),m=fe(st.none()),g=(r=n,i=function(t){u.triggerEvent("focusout",t)&&t.kill(),m.set(st.some(setTimeout(function(){u.triggerEvent(ko(),t)},0)))},_y()?xy(r,"blur",i):yy(r,"focusout",i));return{unbind:function(){lt(c,function(t){t.unbind()}),f.unbind(),d.unbind(),g.unbind(),l.unbind(),s.get().each(clearTimeout),m.get().each(clearTimeout)}}},Dy=function(t,n){var e=Ft(t,"target").getOr(n);return fe(e)},By=Vt([{stopped:[]},{resume:["element"]},{complete:[]}]),Ay=function(t,o,n,e,r,i){var u,a,c,s,l=t(o,e),f=(u=n,a=r,c=fe(!1),s=fe(!1),{stop:function(){c.set(!0)},cut:function(){s.set(!0)},isStopped:c.get,isCut:s.get,event:u,setSource:a.set,getSource:a.get});return l.fold(function(){return i.logEventNoHandlers(o,e),By.complete()},function(n){var e=n.descHandler;return hi(e)(f),f.isStopped()?(i.logEventStopped(o,n.element,e.purpose),By.stopped()):f.isCut()?(i.logEventCut(o,n.element,e.purpose),By.complete()):kr(n.element).fold(function(){return i.logNoParent(o,n.element,e.purpose),By.complete()},function(t){return i.logEventResponse(o,n.element,e.purpose),By.resume(t)})})},My=function(n,e,o,t,r,i){return Ay(n,e,o,t,r,i).fold(function(){return!0},function(t){return My(n,e,o,t,r,i)},function(){return!1})},Fy=function(t,n,e){var o,r,i=(o=n,r=fe(!1),{stop:function(){r.set(!0)},cut:$,isStopped:r.get,isCut:c,event:o,setSource:u("Cannot set source of a broadcasted event"),getSource:u("Cannot get source of a broadcasted event")});return lt(t,function(t){var n=t.descHandler;hi(n)(i)}),i.isStopped()},Iy=function(t,n,e,o,r){var i=Dy(e,o);return My(t,n,e,o,i,r)},Ry=function(t,n){return{element:t,descHandler:n}},Vy=function(t,n){return{id:t,descHandler:n}};function Py(){var i={};return{registerId:function(o,r,t){_t(t,function(t,n){var e=i[n]!==undefined?i[n]:{};e[r]=pi(t,o),i[n]=e})},unregisterId:function(e){_t(i,function(t,n){t.hasOwnProperty(e)&&delete t[e]})},filterByType:function(t){return Ft(i,t).map(function(t){return Bt(t,function(t,n){return Vy(n,t)})}).getOr([])},find:function(t,n,e){var r=Ft(i,n);return Je(e,function(t){return e=r,ni(o=t).fold(function(){return st.none()},function(n){return e.bind(function(t){return Ft(t,n)}).map(function(t){return Ry(o,t)})});var e,o},t)}}}function Hy(){var o=Py(),r={},i=function(o){var t=o.element;return ni(t).fold(function(){return t="uid-",n=o.element,e=Kr(Qr+t),ti(n,e),e;var t,n,e},function(t){return t})},u=function(t){ni(t.element).each(function(t){delete r[t],o.unregisterId(t)})};return{find:function(t,n,e){return o.find(t,n,e)},filter:function(t){return o.filterByType(t)},register:function(t){var n=i(t);Rt(r,n)&&function(t,n){var e=r[n];if(e!==t)throw new Error('The tagId "'+n+'" is already used by: '+Gr(e.element)+"\nCannot use it for: "+Gr(t.element)+"\nThe conflicting element is"+(Ui(e.element)?" ":" not ")+"already in the DOM");u(t)}(t,n);var e=[t];o.registerId(e,n,t.events),r[n]=t},unregister:u,getById:function(t){return Ft(r,t)}}}var zy,Ny,Ly,jy,Uy=Yf({name:"Container",factory:function(t){var n=t.dom,e=n.attributes,o=w(n,["attributes"]);return{uid:t.uid,dom:it({tag:"div",attributes:it({role:"presentation"},e)},o),components:t.components,behaviours:jl(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[ne("components",[]),Ll("containerBehaviours",[]),ne("events",{}),ne("domModification",{}),ne("eventOrder",{})]}),Wy=function(e){var o=function(n){return kr(e.element).fold(function(){return!0},function(t){return Ge(n,t)})},r=Hy(),s=function(t,n){return r.find(o,t,n)},t=Ey(e.element,{triggerEvent:function(o,r){return ia(o,r.target,function(t){return e=t,Iy(s,o,n=r,n.target,e);var n,e})}}),i={debugInfo:at("real"),triggerEvent:function(n,e,o){ia(n,e,function(t){return Iy(s,n,o,e,t)})},triggerFocus:function(a,c){ni(a).fold(function(){mc(a)},function(t){ia(So(),a,function(t){var n,e,o,r,i,u;return n=s,e=So(),i=t,u=Dy(o={originator:c,kill:$,prevent:$,target:a},r=a),Ay(n,e,o,r,u,i),!1})})},triggerEscape:function(t,n){i.triggerEvent("keydown",t.element,n.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:gu,addToGui:function(t){a(t)},removeFromGui:function(t){c(t)},addToWorld:function(t){n(t)},removeFromWorld:function(t){u(t)},broadcast:function(t){f(t)},broadcastOn:function(t,n){d(t,n)},broadcastEvent:function(t,n){m(t,n)},isConnected:b},n=function(t){t.connect(i),hr(t.element)||(r.register(t),lt(t.components(),n),i.triggerEvent(Mo(),t.element,{target:t.element}))},u=function(t){hr(t.element)||(lt(t.components(),u),r.unregister(t)),t.disconnect()},a=function(t){ol(e,t)},c=function(t){ul(t)},l=function(e){var t=r.filter(Oo());lt(t,function(t){var n=t.descHandler;hi(n)(e)})},f=function(t){l({universal:!0,data:t})},d=function(t,n){l({universal:!1,channels:t,data:n})},m=function(t,n){var e=r.filter(t);return Fy(e,n)},g=function(t){return r.getById(t).fold(function(){return dt.error(new Error('Could not find component with uid: "'+t+'" in system.'))},dt.value)},p=function(t){var n=ni(t).getOr("not found");return g(n)};return n(e),{root:e,element:e.element,destroy:function(){t.unbind(),Ir(e.element)},add:a,remove:c,getByUid:g,getByDom:p,addToWorld:n,removeFromWorld:u,broadcast:f,broadcastOn:d,broadcastEvent:m}},Gy=at([ne("prefix","form-field"),Ll("fieldBehaviours",[td,Nl])]),Xy=at([yf({schema:[Ln("dom")],name:"label"}),yf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ln("text")],name:"aria-descriptor"}),vf({factory:{sketch:function(t){var n=Kt(t,["factory"]);return t.factory.sketch(n)}},schema:[Ln("factory")],name:"field"})]),Yy=qf({name:"FormField",configFields:Gy(),partFields:Xy(),factory:function(r,t,n,e){var o=Ul(r.fieldBehaviours,[td.config({find:function(t){return Af(t,r,"field")}}),Nl.config({store:{mode:"manual",getValue:function(t){return td.getCurrent(t).bind(Nl.getValue)},setValue:function(t,n){td.getCurrent(t).each(function(t){Nl.setValue(t,n)})}}})]),i=Zo([sr(function(t,n){var o=Ff(t,r,["label","field","aria-descriptor"]);o.field().each(function(e){var n=Kr(r.prefix);o.label().each(function(t){zr(t.element,"for",n),zr(e.element,"id",n)}),o["aria-descriptor"]().each(function(t){var n=Kr(r.prefix);zr(t.element,"id",n),zr(e.element,"aria-describedby",n)})})})]),u={getField:function(t){return Af(t,r,"field")},getLabel:function(t){return Af(t,r,"label")}};return{uid:r.uid,dom:r.dom,components:t,behaviours:o,events:i,apis:u}},apis:{getField:function(t,n){return t.getField(n)},getLabel:function(t,n){return t.getLabel(n)}}}),qy=/* */Object.freeze({__proto__:null,exhibit:function(t,n){return gi({attributes:$t([{key:n.tabAttr,value:"true"}])})}}),Ky=[ne("tabAttr","data-alloy-tabstop")],Jy=ac({fields:Ky,name:"tabstopping",active:qy}),$y=tinymce.util.Tools.resolve("tinymce.html.Entities"),Qy=function(t,n,e,o){var r=Zy(t,n,e,o);return Yy.sketch(r)},Zy=function(t,n,e,o){return{dom:tx(e),components:t.toArray().concat([n]),fieldBehaviours:ic(o)}},tx=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},nx=function(t,n){return Yy.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}})},ex=Kr("form-component-change"),ox=Kr("form-close"),rx=Kr("form-cancel"),ix=Kr("form-action"),ux=Kr("form-submit"),ax=Kr("form-block"),cx=Kr("form-unblock"),sx=Kr("form-tabchange"),lx=Kr("form-resize"),fx=function(u,a){var t,n,e,o=u.label.map(function(t){return nx(t,a)}),r=function(o){return function(n,e){Ju(e.event.target,"[data-collection-item-value]").each(function(t){o(n,e,t,Nr(t,"data-collection-item-value"))})}},i=r(function(t,n,e,o){n.stop(),a.isDisabled()||qo(t,ix,{name:u.name,value:o})}),c=[er(so(),r(function(t,n,e){mc(e)})),er(vo(),i),er(Eo(),i),er(lo(),r(function(t,n,e){Ku(t.element,"."+gh).each(function(t){Bi(t,gh)}),Ei(e,gh)})),er(fo(),r(function(t){Ku(t.element,"."+gh).each(function(t){Bi(t,gh)})})),dr(r(function(t,n,e,o){qo(t,ix,{name:u.name,value:o})}))],s=function(t,n){return V(ms(t.element,".tox-collection__item"),n)},l=Yy.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==u.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:ct},behaviours:ic([gv.config({disabled:a.isDisabled,onDisabled:function(t){s(t,function(t){Ei(t,"tox-collection__item--state-disabled"),zr(t,"aria-disabled",!0)})},onEnabled:function(t){s(t,function(t){Bi(t,"tox-collection__item--state-disabled"),Ur(t,"aria-disabled")})}}),Lv(),fg.config({}),Nl.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){var n,e,r,i;n=o,e=V(t,function(t){var n=tv.translate(t.text),e=1===u.columns?'<div class="tox-collection__item-label">'+n+"</div>":"",o='<div class="tox-collection__item-icon">'+t.icon+"</div>",r={_:" "," - ":" ","-":" "},i=n.replace(/\_| \- |\-/g,function(t){return r[t]});return'<div class="tox-collection__item'+(a.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+$y.encodeAllRaw(t.value)+'" title="'+i+'" aria-label="'+i+'">'+o+e+"</div>"}),r="auto"!==u.columns&&1<u.columns?R(e,u.columns):[e],i=V(r,function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}),Pr(n.element,i.join("")),"auto"===u.columns&&jh(o,5,"tox-collection__item").each(function(t){var n=t.numRows,e=t.numColumns;ug.setGridSize(o,n,e)}),Yo(o,lx)}}),Jy.config({}),ug.config((n=u.columns,e="normal",1===n?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===n?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===e?".tox-swatches__row":".tox-collection__group",cell:"color"===e?"."+sh:"."+ch}})),dg("collection-events",c)]),eventOrder:((t={})[_o()]=["disabling","alloy.base.behaviour","collection-events"],t)});return Qy(o,l,["tox-form__group--collection"],[])},dx=at([Kn("data"),ne("inputAttributes",{}),ne("inputStyles",{}),ne("tag","input"),ne("inputClasses",[]),ga("onSetValue"),ne("styles",{}),ne("eventOrder",{}),Ll("inputBehaviours",[Nl,vg]),ne("selectOnFocus",!0)]),mx=function(t){return ic([vg.config({onFocus:t.selectOnFocus?function(t){var n=t.element,e=ou(n);n.dom.setSelectionRange(0,e.length)}:$})])},gx=function(t){return{tag:t.tag,attributes:it({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},px=Yf({name:"Input",configFields:dx(),factory:function(t,n){return{uid:t.uid,dom:gx(t),components:[],behaviours:it(it({},mx(e=t)),Ul(e.inputBehaviours,[Nl.config({store:it(it({mode:"manual"},e.data.map(function(t){return{initialValue:t}}).getOr({})),{getValue:function(t){return ou(t.element)},setValue:function(t,n){ou(t.element)!==n&&ru(t.element,n)}}),onSetValue:e.onSetValue})])),eventOrder:t.eventOrder};var e}}),hx={},vx={exports:hx};zy=undefined,Ny=hx,Ly=vx,jy=undefined,function(t){"object"==typeof Ny&&void 0!==Ly?Ly.exports=t():"function"==typeof zy&&zy.amd?zy([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function l(i,u,a){function c(n,t){if(!u[n]){if(!i[n]){var e="function"==typeof jy&&jy;if(!t&&e)return e(n,!0);if(s)return s(n,!0);var o=new Error("Cannot find module '"+n+"'");throw o.code="MODULE_NOT_FOUND",o}var r=u[n]={exports:{}};i[n][0].call(r.exports,function(t){return c(i[n][1][t]||t)},r,r.exports,l,i,u,a)}return u[n].exports}for(var s="function"==typeof jy&&jy,t=0;t<a.length;t++)c(a[t]);return c}({1:[function(t,n,e){var o,r,i=n.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(o===setTimeout)return setTimeout(t,0);if((o===u||!o)&&setTimeout)return o=setTimeout,setTimeout(t,0);try{return o(t,0)}catch(n){try{return o.call(null,t,0)}catch(n){return o.call(this,t,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:u}catch(t){o=u}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var n=l.length;n;){for(s=l,l=[];++d<n;)s&&s[d].run();d=-1,n=l.length}s=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(n){try{return r.call(null,t)}catch(n){return r.call(this,t)}}}(t)}}function p(t,n){this.fun=t,this.array=n}function h(){}i.nextTick=function(t){var n=new Array(arguments.length-1);if(1<arguments.length)for(var e=1;e<arguments.length;e++)n[e-1]=arguments[e];l.push(new p(t,n)),1!==l.length||f||c(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,f,n){(function(n){function o(){}function u(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=0,this._handled=!1,this._value=undefined,this._deferreds=[],l(t,this)}function r(o,r){for(;3===o._state;)o=o._value;0!==o._state?(o._handled=!0,u._immediateFn(function(){var t,n=1===o._state?r.onFulfilled:r.onRejected;if(null!==n){try{t=n(o._value)}catch(e){return void a(r.promise,e)}i(r.promise,t)}else(1===o._state?i:a)(r.promise,o._value)})):o._deferreds.push(r)}function i(t,n){try{if(n===t)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if(n instanceof u)return t._state=3,t._value=n,void c(t);if("function"==typeof e)return void l((o=e,r=n,function(){o.apply(r,arguments)}),t)}t._state=1,t._value=n,c(t)}catch(i){a(t,i)}var o,r}function a(t,n){t._state=2,t._value=n,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&u._immediateFn(function(){t._handled||u._unhandledRejectionFn(t._value)});for(var n=0,e=t._deferreds.length;n<e;n++)r(t,t._deferreds[n]);t._deferreds=null}function s(t,n,e){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof n?n:null,this.promise=e}function l(t,n){var e=!1;try{t(function(t){e||(e=!0,i(n,t))},function(t){e||(e=!0,a(n,t))})}catch(o){if(e)return;e=!0,a(n,o)}}var t,e;t=this,e=setTimeout,u.prototype["catch"]=function(t){return this.then(null,t)},u.prototype.then=function(t,n){var e=new this.constructor(o);return r(this,new s(t,n,e)),e},u.all=function(t){var c=Array.prototype.slice.call(t);return new u(function(r,i){if(0===c.length)return r([]);var u=c.length;for(var t=0;t<c.length;t++)!function a(n,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void e.call(t,function(t){a(n,t)},i)}c[n]=t,0==--u&&r(c)}catch(o){i(o)}}(t,c[t])})},u.resolve=function(n){return n&&"object"==typeof n&&n.constructor===u?n:new u(function(t){t(n)})},u.reject=function(e){return new u(function(t,n){n(e)})},u.race=function(r){return new u(function(t,n){for(var e=0,o=r.length;e<o;e++)r[e].then(t,n)})},u._immediateFn="function"==typeof n?function(t){n(t)}:function(t){e(t,0)},u._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},u._setImmediateFn=function(t){u._immediateFn=t},u._setUnhandledRejectionFn=function(t){u._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=u:t.Promise||(t.Promise=u)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(c,t,s){(function(t,n){var o=c("process/browser.js").nextTick,e=Function.prototype.apply,r=Array.prototype.slice,i={},u=0;function a(t,n){this._id=t,this._clearFn=n}s.setTimeout=function(){return new a(e.call(setTimeout,window,arguments),clearTimeout)},s.setInterval=function(){return new a(e.call(setInterval,window,arguments),clearInterval)},s.clearTimeout=s.clearInterval=function(t){t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},s.enroll=function(t,n){clearTimeout(t._idleTimeoutId),t._idleTimeout=n},s.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},s._unrefActive=s.active=function(t){clearTimeout(t._idleTimeoutId);var n=t._idleTimeout;0<=n&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},n))},s.setImmediate="function"==typeof t?t:function(t){var n=u++,e=!(arguments.length<2)&&r.call(arguments,1);return i[n]=!0,o(function(){i[n]&&(e?t.apply(null,e):t.call(null),s.clearImmediate(n))}),n},s.clearImmediate="function"==typeof n?n:function(t){delete i[t]}}).call(this,c("timers").setImmediate,c("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,n,e){var o=t("promise-polyfill"),r="undefined"!=typeof window?window:Function("return this;")();n.exports={boltExport:r.Promise||o}},{"promise-polyfill":2}]},{},[4])(4)});var bx,yx,xx=vx.exports.boltExport,wx=function(t){var e=st.none(),n=[],o=function(t){r()?u(t):n.push(t)},r=function(){return e.isSome()},i=function(t){lt(t,u)},u=function(n){e.each(function(t){setTimeout(function(){n(t)},0)})};return t(function(t){r()||(e=st.some(t),i(n),n=[])}),{get:o,map:function(e){return wx(function(n){o(function(t){n(e(t))})})},isReady:r}},Sx={nu:wx,pure:function(n){return wx(function(t){t(n)})}},kx=function(t){setTimeout(function(){throw t},0)},Cx=function(e){var t=function(t){e().then(t,kx)};return{map:function(t){return Cx(function(){return e().then(t)})},bind:function(n){return Cx(function(){return e().then(function(t){return n(t).toPromise()})})},anonBind:function(t){return Cx(function(){return e().then(function(){return t.toPromise()})})},toLazy:function(){return Sx.nu(t)},toCached:function(){var t=null;return Cx(function(){return null===t&&(t=e()),t})},toPromise:e,get:t}},Ox=function(t){return Cx(function(){return new xx(t)})},_x=function(t){return Cx(function(){return xx.resolve(t)})},Tx=["input","textarea"],Ex=function(t){var n=mr(t);return M(Tx,n)},Dx=function(t,n){var e=n.getRoot(t).getOr(t.element);Bi(e,n.invalidClass),n.notify.each(function(n){Ex(t.element)&&zr(t.element,"aria-invalid",!1),n.getContainer(t).each(function(t){Pr(t,n.validHtml)}),n.onValid(t)})},Bx=function(n,t,e,o){var r=t.getRoot(n).getOr(n.element);Ei(r,t.invalidClass),t.notify.each(function(t){Ex(n.element)&&zr(n.element,"aria-invalid",!0),t.getContainer(n).each(function(t){Pr(t,o)}),t.onInvalid(n,o)})},Ax=function(n,t,e){return t.validator.fold(function(){return _x(dt.value(!0))},function(t){return t.validate(n)})},Mx=function(n,e,t){return e.notify.each(function(t){t.onValidate(n)}),Ax(n,e).map(function(t){return n.getSystem().isConnected()?t.fold(function(t){return Bx(n,e,0,t),dt.error(t)},function(t){return Dx(n,e),dt.value(t)}):dt.error("No longer in system")})},Fx=/* */Object.freeze({__proto__:null,markValid:Dx,markInvalid:Bx,query:Ax,run:Mx,isInvalid:function(t,n){var e=n.getRoot(t).getOr(t.element);return Ai(e,n.invalidClass)}}),Ix=/* */Object.freeze({__proto__:null,events:function(n,t){return n.validator.map(function(t){return Zo([er(t.onEvent,function(t){Mx(t,n).get(ct)})].concat(t.validateOnLoad?[sr(function(t){Mx(t,n).get($)})]:[]))}).getOr({})}}),Rx=[Ln("invalidClass"),ne("getRoot",st.none),te("notify",[ne("aria","alert"),ne("getContainer",st.none),ne("validHtml",""),ga("onValid"),ga("onInvalid"),ga("onValidate")]),te("validator",[Ln("validate"),ne("onEvent","input"),ne("validateOnLoad",!0)])],Vx=ac({fields:Rx,name:"invalidating",active:Ix,apis:Fx,extra:{validation:function(e){return function(t){var n=Nl.getValue(t);return _x(e(n))}}}}),Px=/* */Object.freeze({__proto__:null,getCoupled:function(t,n,e,o){return e.getOrCreate(t,n,o)}}),Hx=[jn("others",On(dt.value,Mn()))],zx=ac({fields:Hx,name:"coupling",apis:Px,state:/* */Object.freeze({__proto__:null,init:function(){var i={},t=at({});return di({readState:t,getOrCreate:function(e,o,r){var t=Ct(o.others);if(t)return Ft(i,r).getOrThunk(function(){var t=Ft(o.others,r).getOrDie("No information found for coupled component: "+r)(e),n=e.getSystem().build(t);return i[r]=n});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(t,null,2))}})}})}),Nx=at("sink"),Lx=at(yf({name:Nx(),overrides:at({dom:{tag:"div"},behaviours:ic([Qs.config({useFixed:b})]),events:Zo([ar(mo()),ar(io()),ar(vo())])})}));(yx=bx=bx||{})[yx.HighlightFirst=0]="HighlightFirst",yx[yx.HighlightNone=1]="HighlightNone";var jx=function(t,n){var e=t.getHotspot(n).getOr(n),o=t.getAnchorOverrides();return t.layouts.fold(function(){return{anchor:"hotspot",hotspot:e,overrides:o}},function(t){return{anchor:"hotspot",hotspot:e,overrides:o,layouts:t}})},Ux=function(t,n,e,o,r,i,u){var a,c,s,l,f,d,m,g,p,h,v=jx(t,e);return(c=v,l=o,f=r,d=u,m=n,g=s=e,p=(0,(a=t).fetch)(g).map(m),h=Yx(s,a),p.map(function(t){return t.bind(function(t){return st.from(Zg.sketch(it(it({},f.menu()),{uid:ei(""),data:t,highlightImmediately:d===bx.HighlightFirst,onOpenMenu:function(t,n){var e=h().getOrDie();Qs.position(e,c,n),xl.decloak(l)},onOpenSubmenu:function(t,n,e){var o=h().getOrDie();Qs.position(o,{anchor:"submenu",item:n},e),xl.decloak(l)},onRepositionMenu:function(t,n,e){var o=h().getOrDie();Qs.position(o,c,n),lt(e,function(t){Qs.position(o,{anchor:"submenu",item:t.triggeringItem},t.triggeredMenu)})},onEscape:function(){return vg.focus(s),xl.close(l),st.some(!0)}})))})})).map(function(t){return t.fold(function(){xl.isOpen(o)&&xl.close(o)},function(t){xl.cloak(o),xl.open(o,t),i(o)}),o})},Wx=function(t,n,e,o,r,i,u){return xl.close(o),_x(o)},Gx=function(t,n,e,o,r,i){var u=zx.getCoupled(e,"sandbox");return(xl.isOpen(u)?Wx:Ux)(t,n,e,u,o,r,i)},Xx=function(t,n,e){var o,r,i=td.getCurrent(n).getOr(n),u=_u(t.element);e?qi(i.element,"min-width",u+"px"):(o=i.element,r=u,Ou.set(o,r))},Yx=function(n,t){return n.getSystem().getByUid(t.uid+"-"+Nx()).map(function(t){return function(){return dt.value(t)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return dt.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(n)}})})},qx=function(t){xl.getState(t).each(function(t){Zg.repositionMenus(t)})},Kx=function(o,r,i){var u=$u(),t=Yx(r,o);return{dom:{tag:"div",classes:o.sandboxClasses,attributes:{id:u.id,role:"listbox"}},behaviours:Gl(o.sandboxBehaviours,[Nl.config({store:{mode:"memory",initialValue:r}}),xl.config({onOpen:function(t,n){var e=jx(o,r);u.link(r.element),o.matchWidth&&Xx(e.hotspot,n,o.useMinWidth),o.onOpen(e,t,n),i!==undefined&&i.onOpen!==undefined&&i.onOpen(t,n)},onClose:function(t,n){u.unlink(r.element),i!==undefined&&i.onClose!==undefined&&i.onClose(t,n)},isPartOf:function(t,n,e){return Zu(n,e)||Zu(r,e)},getAttachPoint:function(){return t().getOrDie()}}),td.config({find:function(t){return xl.getState(t).bind(function(t){return td.getCurrent(t)})}}),fc.config({channels:it(it({},Ol({isExtraPart:c})),Tl({doReposition:qx}))})])}},Jx=function(t){var n=zx.getCoupled(t,"sandbox");qx(n)},$x=function(){return[ne("sandboxClasses",[]),Wl("sandboxBehaviours",[td,fc,xl,Nl])]},Qx=at([Ln("dom"),Ln("fetch"),ga("onOpen"),pa("onExecute"),ne("getHotspot",st.some),ne("getAnchorOverrides",at({})),Wc(),Ll("dropdownBehaviours",[Dg,zx,ug,vg]),Ln("toggleClass"),ne("eventOrder",{}),Kn("lazySink"),ne("matchWidth",!1),ne("useMinWidth",!1),Kn("role")].concat($x())),Zx=at([bf({schema:[fa()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Lx()]),tw=qf({name:"Dropdown",configFields:Qx(),partFields:Zx(),factory:function(n,t,e,o){var r,i,u=function(t){xl.getState(t).each(function(t){Zg.highlightPrimary(t)})},a={expand:function(t){Dg.isOn(t)||Gx(n,function(t){return t},t,o,$,bx.HighlightNone).get($)},open:function(t){Dg.isOn(t)||Gx(n,function(t){return t},t,o,$,bx.HighlightFirst).get($)},isOpen:Dg.isOn,close:function(t){Dg.isOn(t)&&Gx(n,function(t){return t},t,o,$,bx.HighlightFirst).get($)},repositionMenus:function(t){Dg.isOn(t)&&Jx(t)}},c=function(t,n){return Ko(t),st.some(!0)};return{uid:n.uid,dom:n.dom,components:t,behaviours:Ul(n.dropdownBehaviours,[Dg.config({toggleClass:n.toggleClass,aria:{mode:"expanded"}}),zx.config({others:{sandbox:function(t){return Kx(n,t,{onOpen:function(){Dg.on(t)},onClose:function(){Dg.off(t)}})}}}),ug.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,n){var e;return tw.isOpen(t)?(e=zx.getCoupled(t,"sandbox"),u(e)):tw.open(t),st.some(!0)},onEscape:function(t,n){return tw.isOpen(t)?(tw.close(t),st.some(!0)):st.none()}}),vg.config({})]),events:Ag(st.some(function(t){Gx(n,function(t){return t},t,o,u,bx.HighlightFirst).get($)})),eventOrder:it(it({},n.eventOrder),((r={})[_o()]=["disabling","toggling","alloy.base.behaviour"],r)),apis:a,domModification:{attributes:it(it({"aria-haspopup":"true"},n.role.fold(function(){return{}},function(t){return{role:t}})),"button"===n.dom.tag?{type:(i="type",Ft(n.dom,"attributes").bind(function(t){return Ft(t,i)}).getOr("button"))}:{})}}},apis:{open:function(t,n){return t.open(n)},expand:function(t,n){return t.expand(n)},close:function(t,n){return t.close(n)},isOpen:function(t,n){return t.isOpen(n)},repositionMenus:function(t,n){return t.repositionMenus(n)}}}),nw=ac({fields:[],name:"unselecting",active:/* */Object.freeze({__proto__:null,events:function(){return Zo([tr(yo(),b)])},exhibit:function(){return gi({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),ew=Kr("color-input-change"),ow=Kr("color-swatch-change"),rw=Kr("color-picker-cancel"),iw=function(e,n,o){var r,i,t=Yy.parts.field({factory:px,inputClasses:["tox-textfield"],onSetValue:function(t){return Vx.run(t).get(function(){})},inputBehaviours:ic([gv.config({disabled:n.providers.isDisabled}),Lv(),Jy.config({}),Vx.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return kr(t.element)},notify:{onValid:function(t){var n=Nl.getValue(t);qo(t,ew,{color:n})}},validator:{validateOnLoad:!1,validate:function(t){var n=Nl.getValue(t);if(0===n.length)return _x(dt.value(!0));var e=me.fromTag("span");qi(e,"background-color",n);var o=Zi(e,"background-color").fold(function(){return dt.error("blah")},function(t){return dt.value(n)});return _x(o)}}})]),selectOnFocus:!1}),u=e.label.map(function(t){return nx(t,n.providers)}),a=function(t,n){qo(t,ow,{value:n})},c=gp((r={dom:{tag:"span",attributes:{"aria-label":n.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[za,Ha,Ua]},onLtr:function(){return[Ha,za,Ua]}},components:[],fetch:Gb(o.getColors(),o.hasCustomColors()),columns:o.getColorCols(),presets:"color",onItemAction:function(t,e){c.getOpt(t).each(function(n){"custom"===e?o.colorPicker(function(t){t.fold(function(){return Yo(n,rw)},function(t){a(n,t),Nb(t)})},"#ffffff"):a(n,"remove"===e?"":e)})}},i=n,tw.sketch({dom:r.dom,components:r.components,toggleClass:"mce-active",dropdownBehaviours:ic([Uv(i.providers.isDisabled),Lv(),nw.config({}),Jy.config({})]),layouts:r.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:i.getSink,fetch:function(n){return Ox(function(t){return r.fetch(t)}).map(function(t){return st.from(hy(zt(Jb(Kr("menu-value"),t,function(t){r.onItemAction(n,t)},r.columns,r.presets,uh.CLOSE_ON_EXECUTE,function(){return!1},i.providers),{movement:Qb(r.columns,r.presets)})))})},parts:{menu:wh(0,0,r.presets)}})));return Yy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:u.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[t,c.asSpec()]}]),fieldBehaviours:ic([dg("form-field-events",[er(ew,function(t,n){c.getOpt(t).each(function(t){qi(t.element,"background-color",n.event.color)}),qo(t,ex,{name:e.name})}),er(ow,function(n,e){Yy.getField(n).each(function(t){Nl.setValue(t,e.event.value),td.getCurrent(n).each(vg.focus)})}),er(rw,function(n,t){Yy.getField(n).each(function(t){td.getCurrent(n).each(vg.focus)})})])])})},uw=function(t,n,e){return{hue:t,saturation:n,value:e}},aw=Kr("rgb-hex-update"),cw=Kr("slider-update"),sw=Kr("palette-update"),lw=yf({schema:[Ln("dom")],name:"label"}),fw=function(n){return yf({name:n+"-edge",overrides:function(t){return t.model.manager.edgeActions[n].fold(function(){return{}},function(o){return{events:Zo([or(no(),function(t,n,e){return o(t,e)},[t]),or(io(),function(t,n,e){return o(t,e)},[t]),or(uo(),function(t,n,e){e.mouseIsDown.get()&&o(t,e)},[t])])}})}})},dw=fw("top-left"),mw=fw("top"),gw=fw("top-right"),pw=fw("right"),hw=fw("bottom-right"),vw=fw("bottom"),bw=fw("bottom-left"),yw=[lw,fw("left"),pw,mw,vw,dw,gw,bw,hw,vf({name:"thumb",defaults:at({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Zo([ir(no(),t,"spectrum"),ir(eo(),t,"spectrum"),ir(oo(),t,"spectrum"),ir(io(),t,"spectrum"),ir(uo(),t,"spectrum"),ir(co(),t,"spectrum")])}}}),vf({schema:[le("mouseIsDown",function(){return fe(!1)})],name:"spectrum",overrides:function(e){var o=e.model.manager,r=function(n,t){return o.getValueFromEvent(t).map(function(t){return o.setValueFrom(n,e,t)})};return{behaviours:ic([ug.config({mode:"special",onLeft:function(t){return o.onLeft(t,e)},onRight:function(t){return o.onRight(t,e)},onUp:function(t){return o.onUp(t,e)},onDown:function(t){return o.onDown(t,e)}}),vg.config({})]),events:Zo([er(no(),r),er(eo(),r),er(io(),r),er(uo(),function(t,n){e.mouseIsDown.get()&&r(t,n)})])}}})],xw=at("slider.change.value"),ww=function(t){var n=t.event.raw;return-1===n.type.indexOf("touch")?n.clientX!==undefined?st.some(n).map(function(t){return wu(t.clientX,t.clientY)}):st.none():n.touches!==undefined&&1===n.touches.length?st.some(n.touches[0]).map(function(t){return wu(t.clientX,t.clientY)}):st.none()},Sw=function(t){return t.model.minX},kw=function(t){return t.model.minY},Cw=function(t){return t.model.minX-1},Ow=function(t){return t.model.minY-1},_w=function(t){return t.model.maxX},Tw=function(t){return t.model.maxY},Ew=function(t){return t.model.maxX+1},Dw=function(t){return t.model.maxY+1},Bw=function(t,n,e){return n(t)-e(t)},Aw=function(t){return Bw(t,_w,Sw)},Mw=function(t){return Bw(t,Tw,kw)},Fw=function(t){return Aw(t)/2},Iw=function(t){return Mw(t)/2},Rw=function(t){return t.stepSize},Vw=function(t){return t.snapToGrid},Pw=function(t){return t.snapStart},Hw=function(t){return t.rounded},zw=function(t,n){return t[n+"-edge"]!==undefined},Nw=function(t){return zw(t,"left")},Lw=function(t){return zw(t,"right")},jw=function(t){return zw(t,"top")},Uw=function(t){return zw(t,"bottom")},Ww=function(t){return t.model.value.get()},Gw=function(t){return{x:t}},Xw=function(t){return{y:t}},Yw=function(t,n){return{x:t,y:n}},qw=function(t,n){qo(t,xw(),{value:n})},Kw=function(t,n,e,o){return t<n?t:e<t?e:t===n?n-1:Math.max(n,t-o)},Jw=function(t,n,e,o){return e<t?t:t<n?n:t===e?e+1:Math.min(e,t+o)},$w=function(t,n,e){return Math.max(n,Math.min(e,t))},Qw=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?n-1:n,p=l?e+1:e;if(r<f)return g;if(d<r)return p;var h,v,b,y,x,w,S,k=(x=r,w=f,S=d,Math.min(S,Math.max(x,w))-w),C=$w(k/m*o+n,g,p);return u&&n<=C&&C<=e?(h=C,v=n,b=e,y=i,a.fold(function(){var t=h-v,n=Math.round(t/y)*y;return $w(v+n,v-1,b+1)},function(t){var n=(h-t)%y,e=Math.round(n/y),o=Math.floor((h-t)/y),r=Math.floor((b-t)/y),i=t+Math.min(r,o+e)*y;return Math.max(t,i)})):c?Math.round(C):C},Zw=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return r<n?i?0:s:e<r?u?a:l:(r-n)/o*c},tS="left",nS=function(t){return t.element.dom.getBoundingClientRect()},eS=function(t,n){return t[n]},oS=function(t){var n=nS(t);return eS(n,tS)},rS=function(t){var n=nS(t);return eS(n,"right")},iS=function(t){var n=nS(t);return eS(n,"top")},uS=function(t){var n=nS(t);return eS(n,"bottom")},aS=function(t){var n=nS(t);return eS(n,"width")},cS=function(t){var n=nS(t);return eS(n,"height")},sS=function(t,n,e){return(t+n)/2-e},lS=function(t,n){var e=nS(t),o=nS(n),r=eS(e,tS),i=eS(e,"right"),u=eS(o,tS);return sS(r,i,u)},fS=function(t,n){var e=nS(t),o=nS(n),r=eS(e,"top"),i=eS(e,"bottom"),u=eS(o,"top");return sS(r,i,u)},dS=function(t,n){qo(t,xw(),{value:n})},mS=function(t){return{x:t}},gS=function(t,n,e){var o={min:Sw(n),max:_w(n),range:Aw(n),value:e,step:Rw(n),snap:Vw(n),snapStart:Pw(n),rounded:Hw(n),hasMinEdge:Nw(n),hasMaxEdge:Lw(n),minBound:oS(t),maxBound:rS(t),screenRange:aS(t)};return Qw(o)},pS=function(i){return function(t,n){return e=t,r=(0<i?Jw:Kw)(Ww(o=n).x,Sw(o),_w(o),Rw(o)),dS(e,mS(r)),st.some(r).map(function(){return!0});var e,o,r}},hS=function(t,n,e,o,r,i){var u,a,c,s,l,f,d,m,g,p=(a=i,c=e,s=o,l=r,f=aS(u=n),d=s.bind(function(t){return st.some(lS(t,u))}).getOr(0),m=l.bind(function(t){return st.some(lS(t,u))}).getOr(f),g={min:Sw(a),max:_w(a),range:Aw(a),value:c,hasMinEdge:Nw(a),hasMaxEdge:Lw(a),minBound:oS(u),minOffset:0,maxBound:rS(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:m},Zw(g));return oS(n)-oS(t)+p},vS=pS(-1),bS=pS(1),yS=st.none,xS=st.none,wS={"top-left":st.none(),top:st.none(),"top-right":st.none(),right:st.some(function(t,n){qw(t,Gw(Ew(n)))}),"bottom-right":st.none(),bottom:st.none(),"bottom-left":st.none(),left:st.some(function(t,n){qw(t,Gw(Cw(n)))})},SS=/* */Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=gS(t,n,e),r=mS(o);return dS(t,r),o},setToMin:function(t,n){var e=Sw(n);dS(t,mS(e))},setToMax:function(t,n){var e=_w(n);dS(t,mS(e))},findValueOfOffset:gS,getValueFromEvent:function(t){return ww(t).map(function(t){return t.left})},findPositionOfValue:hS,setPositionFromValue:function(t,n,e,o){var r=Ww(e),i=hS(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),e),u=_u(n.element)/2;qi(n.element,"left",i-u+"px")},onLeft:vS,onRight:bS,onUp:yS,onDown:xS,edgeActions:wS}),kS=function(t,n){qo(t,xw(),{value:n})},CS=function(t){return{y:t}},OS=function(t,n,e){var o={min:kw(n),max:Tw(n),range:Mw(n),value:e,step:Rw(n),snap:Vw(n),snapStart:Pw(n),rounded:Hw(n),hasMinEdge:jw(n),hasMaxEdge:Uw(n),minBound:iS(t),maxBound:uS(t),screenRange:cS(t)};return Qw(o)},_S=function(i){return function(t,n){return e=t,r=(0<i?Jw:Kw)(Ww(o=n).y,kw(o),Tw(o),Rw(o)),kS(e,CS(r)),st.some(r).map(function(){return!0});var e,o,r}},TS=function(t,n,e,o,r,i){var u,a,c,s,l,f,d,m,g,p=(a=i,c=e,s=o,l=r,f=cS(u=n),d=s.bind(function(t){return st.some(fS(t,u))}).getOr(0),m=l.bind(function(t){return st.some(fS(t,u))}).getOr(f),g={min:kw(a),max:Tw(a),range:Mw(a),value:c,hasMinEdge:jw(a),hasMaxEdge:Uw(a),minBound:iS(u),minOffset:0,maxBound:uS(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:m},Zw(g));return iS(n)-iS(t)+p},ES=st.none,DS=st.none,BS=_S(-1),AS=_S(1),MS={"top-left":st.none(),top:st.some(function(t,n){qw(t,Xw(Ow(n)))}),"top-right":st.none(),right:st.none(),"bottom-right":st.none(),bottom:st.some(function(t,n){qw(t,Xw(Dw(n)))}),"bottom-left":st.none(),left:st.none()},FS=/* */Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=OS(t,n,e),r=CS(o);return kS(t,r),o},setToMin:function(t,n){var e=kw(n);kS(t,CS(e))},setToMax:function(t,n){var e=Tw(n);kS(t,CS(e))},findValueOfOffset:OS,getValueFromEvent:function(t){return ww(t).map(function(t){return t.top})},findPositionOfValue:TS,setPositionFromValue:function(t,n,e,o){var r=Ww(e),i=TS(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),e),u=bu(n.element)/2;qi(n.element,"top",i-u+"px")},onLeft:ES,onRight:DS,onUp:BS,onDown:AS,edgeActions:MS}),IS=function(t,n){qo(t,xw(),{value:n})},RS=function(t,n){return{x:t,y:n}},VS=function(c,s){return function(t,n){return o=t,r=n,i=0<c?Jw:Kw,u=(e=s)?Ww(r).x:i(Ww(r).x,Sw(r),_w(r),Rw(r)),a=e?i(Ww(r).y,kw(r),Tw(r),Rw(r)):Ww(r).y,IS(o,RS(u,a)),st.some(u).map(function(){return!0});var e,o,r,i,u,a}},PS=ww,HS=VS(-1,!1),zS=VS(1,!1),NS=VS(-1,!0),LS=VS(1,!0),jS={"top-left":st.some(function(t,n){qw(t,Yw(Cw(n),Ow(n)))}),top:st.some(function(t,n){qw(t,Yw(Fw(n),Ow(n)))}),"top-right":st.some(function(t,n){qw(t,Yw(Ew(n),Ow(n)))}),right:st.some(function(t,n){qw(t,Yw(Ew(n),Iw(n)))}),"bottom-right":st.some(function(t,n){qw(t,Yw(Ew(n),Dw(n)))}),bottom:st.some(function(t,n){qw(t,Yw(Fw(n),Dw(n)))}),"bottom-left":st.some(function(t,n){qw(t,Yw(Cw(n),Dw(n)))}),left:st.some(function(t,n){qw(t,Yw(Cw(n),Iw(n)))})},US=/* */Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=gS(t,n,e.left),r=OS(t,n,e.top),i=RS(o,r);return IS(t,i),i},setToMin:function(t,n){var e=Sw(n),o=kw(n);IS(t,RS(e,o))},setToMax:function(t,n){var e=_w(n),o=Tw(n);IS(t,RS(e,o))},getValueFromEvent:PS,setPositionFromValue:function(t,n,e,o){var r=Ww(e),i=hS(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),e),u=TS(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),e),a=_u(n.element)/2,c=bu(n.element)/2;qi(n.element,"left",i-a+"px"),qi(n.element,"top",u-c+"px")},onLeft:HS,onRight:zS,onUp:NS,onDown:LS,edgeActions:jS}),WS=qf({name:"Slider",configFields:[ne("stepSize",1),ne("onChange",$),ne("onChoose",$),ne("onInit",$),ne("onDragStart",$),ne("onDragEnd",$),ne("snapToGrid",!1),ne("rounded",!0),Kn("snapStart"),jn("model",An("mode",{x:[ne("minX",0),ne("maxX",100),le("value",function(t){return fe(t.mode.minX)}),Ln("getInitialValue"),ba("manager",SS)],y:[ne("minY",0),ne("maxY",100),le("value",function(t){return fe(t.mode.minY)}),Ln("getInitialValue"),ba("manager",FS)],xy:[ne("minX",0),ne("maxX",100),ne("minY",0),ne("maxY",100),le("value",function(t){return fe({x:t.mode.minX,y:t.mode.minY})}),Ln("getInitialValue"),ba("manager",US)]})),Ll("sliderBehaviours",[ug,Nl]),le("mouseIsDown",function(){return fe(!1)})],partFields:yw,factory:function(i,t,n,e){var o,u=function(t){return Mf(t,i,"thumb")},a=function(t){return Mf(t,i,"spectrum")},r=function(t){return Af(t,i,"left-edge")},c=function(t){return Af(t,i,"right-edge")},s=function(t){return Af(t,i,"top-edge")},l=function(t){return Af(t,i,"bottom-edge")},f=i.model,d=f.manager,m=function(t,n){d.setPositionFromValue(t,n,i,{getLeftEdge:r,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:a})},g=function(t,n){f.value.set(n);var e=u(t);return m(t,e),i.onChange(t,e,n),st.some(!0)},p=function(e){var t=i.mouseIsDown.get();i.mouseIsDown.set(!1),t&&Af(e,i,"thumb").each(function(t){var n=f.value.get();i.onChoose(e,t,n)})},h=function(t,n){n.stop(),i.mouseIsDown.set(!0),i.onDragStart(t,u(t))},v=function(t,n){n.stop(),i.onDragEnd(t,u(t)),p(t)};return{uid:i.uid,dom:i.dom,components:t,behaviours:Ul(i.sliderBehaviours,[ug.config({mode:"special",focusIn:function(t){return Af(t,i,"spectrum").map(ug.focusIn).map(b)}}),Nl.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),fc.config({channels:((o={})[kl()]={onReceive:p},o)})]),events:Zo([er(xw(),function(t,n){g(t,n.event.value)}),sr(function(t,n){var e=f.getInitialValue();f.value.set(e);var o=u(t);m(t,o);var r=a(t);i.onInit(t,o,r,f.value.get())}),er(no(),h),er(oo(),v),er(io(),h),er(co(),v)]),apis:{resetToMin:function(t){d.setToMin(t,i)},resetToMax:function(t){d.setToMax(t,i)},changeValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,n){t.resetToMin(n)},resetToMax:function(t,n){t.resetToMax(n)},refresh:function(t,n){t.refresh(n)}}}),GS=[Ll("formBehaviours",[Nl])],XS=function(t){return"<alloy.field."+t+">"},YS=function(o,t){return{uid:o.uid,dom:o.dom,components:t,behaviours:Ul(o.formBehaviours,[Nl.config({store:{mode:"manual",getValue:function(t){var n=If(t,o);return Tt(n,function(t,r){return t().bind(function(t){var n,e,o=td.getCurrent(t);return n=o,e=new Error("Cannot find a current component to extract the value from for form part '"+r+"': "+Gr(t.element)),n.fold(function(){return dt.error(e)},dt.value)}).map(Nl.getValue)})},setValue:function(e,t){_t(t,function(n,t){Af(e,o,t).each(function(t){td.getCurrent(t).each(function(t){Nl.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return Af(t,o,n).bind(td.getCurrent)}}}},qS={getField:li(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),_f("form",XS(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=V(r,function(t){return vf({name:t,pname:XS(t)})});return Lf("form",GS,i,YS,o)}},KS=Kr("valid-input"),JS=Kr("invalid-input"),$S=Kr("validating-input"),QS="colorcustom.rgb.",ZS=function(d,m,g,p){var h=function(t,n,e,o,r){var i,u,a=d(QS+"range"),c=[Yy.parts.label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),Yy.parts.field({data:r,factory:px,inputAttributes:it({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:ic([(i=n,u=t,Vx.config({invalidClass:m("invalid"),notify:{onValidate:function(t){qo(t,$S,{type:i})},onValid:function(t){qo(t,KS,{type:i,value:Nl.getValue(t)})},onInvalid:function(t){qo(t,JS,{type:i,value:Nl.getValue(t)})}},validator:{validate:function(t){var n=Nl.getValue(t),e=u(n)?dt.value(!0):dt.error(d("aria.input.invalid"));return _x(e)},validateOnLoad:!1}})),Jy.config({})]),onSetValue:function(t){Vx.isInvalid(t)&&Vx.run(t).get($)}})],s="hex"!==n?[Yy.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;Nl.setValue(t,{red:e,green:o,blue:r})},b=gp({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),y=function(t,n){b.getOpt(t).each(function(t){qi(t.element,"background-color","#"+n.value)})};return Yf({factory:function(){var e={red:fe(st.some(255)),green:fe(st.some(255)),blue:fe(st.some(255)),hex:fe(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 Ob(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=yb(t),qS.getField(n,"hex").each(function(t){vg.isFocused(t)||Nl.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=mb(n);i("hex",st.some(n));var o=Eb(e);v(t,o),r(o),qo(t,aw,{hex:e}),y(t,e)}(t,e.value):u(t,e.type,e.value)},t=function(t){return{label:d(QS+t+".label"),description:d(QS+t+".description")}},c=t("red"),s=t("green"),l=t("blue"),f=t("hex");return zt(qS.sketch(function(t){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[t.field("red",Yy.sketch(h(_b,"red",c.label,c.description,255))),t.field("green",Yy.sketch(h(_b,"green",s.label,s.description,255))),t.field("blue",Yy.sketch(h(_b,"blue",l.label,l.description,255))),t.field("hex",Yy.sketch(h(hb,"hex",f.label,f.description,"ffffff"))),b.asSpec()],formBehaviours:ic([Vx.config({invalidClass:m("form-invalid")}),dg("rgb-form-events",[er(KS,a),er(JS,n),er($S,n)])])}}),{apis:{updateHex:function(t,n){var e,o;Nl.setValue(t,{hex:n.value}),e=t,o=Eb(n),v(e,o),r(o),y(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},tk=function(t,o){var r=WS.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=WS.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"<div class="+o("sv-palette-inner-thumb")+' role="presentation"></div>'}}),u=function(t,n){var e,o,r=t.width,i=t.height,u=t.getContext("2d");null!==u&&(u.fillStyle=n,u.fillRect(0,0,r,i),(e=u.createLinearGradient(0,0,r,0)).addColorStop(0,"rgba(255,255,255,1)"),e.addColorStop(1,"rgba(255,255,255,0)"),u.fillStyle=e,u.fillRect(0,0,r,i),(o=u.createLinearGradient(0,0,0,i)).addColorStop(0,"rgba(0,0,0,0)"),o.addColorStop(1,"rgba(0,0,0,1)"),u.fillStyle=o,u.fillRect(0,0,r,i))};return Yf({factory:function(t){var n=at({x:0,y:0}),e=ic([td.config({find:st.some}),vg.config({})]);return WS.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){qo(t,sw,{value:e})},onInit:function(t,n,e,o){u(e.element.dom,Bb(Ab))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element.dom,u(r,Bb(o))}},extraApis:{}})},nk=function(f,d){return Yf({name:"ColourPicker",configFields:[Ln("dom"),ne("onValidHex",$),ne("onInvalidHex",$)],factory:function(t){var a,v,n,e,o,r=ZS(f,d,t.onValidHex,t.onInvalidHex),i=tk(0,d),b={paletteRgba:fe(Ab)},u=gp(i.sketch({})),c=gp(r.sketch({})),s=function(t,e){u.getOpt(t).each(function(t){var n=Eb(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){lt(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[u.asSpec(),(n=d,e=WS.parts.spectrum({dom:{tag:"div",classes:[n("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=WS.parts.thumb({dom:{tag:"div",classes:[n("hue-slider-thumb")],attributes:{role:"presentation"}}}),WS.sketch({dom:{tag:"div",classes:[n("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:at({y:0})},components:[e,o],sliderBehaviours:ic([vg.config({})]),onChange:function(t,n,e){qo(t,cw,{value:e})}})),c.asSpec()],behaviours:ic([dg("colour-picker-events",[er(sw,(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?uw(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,uw(Math.round(r),Math.round(100*o),Math.round(100*i)))),g=uw(m.hue,f.x,100-f.y),p=Tb(g),h=yb(p);y(t,h,v)})),er(cw,(a=[s,l],function(t,n){var e,o,r,i=n.event.value,u=(e=i.y,o=uw((100-e)/100*360,100,100),r=Tb(o),yb(r));y(t,u,a)}))]),td.config({find:function(t){return c.getOpt(t)}}),ug.config({mode:"acyclic"})])}}})},ek=function(){return td.config({find:st.some})},ok=function(t){return td.config({find:t.getOpt})},rk=function(t){return td.config({find:function(n){return Tr(n.element,t).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}})},ik={"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"},uk=function(t){return ik[t]},ak=tinymce.util.Tools.resolve("tinymce.Resource"),ck=tinymce.util.Tools.resolve("tinymce.util.Tools"),sk=fn([ne("preprocess",ct),ne("postprocess",ct)]),lk=function(t,n,e){return Nl.config(zt({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},fk=function(t,n,e){return lk(t,function(t){return n(t.element)},function(t,n){return e(t.element,n)})},dk=function(r,t){var i=En("RepresentingConfigs.memento processors",sk,t);return Nl.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=Nl.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);Nl.setValue(o,e)}}})},mk=lk,gk=function(t){return fk(t,Vr,Pr)},pk=function(t){return Nl.config({store:{mode:"memory",initialValue:t}})},hk=function(i,u){var n=function(t,n){n.stop()},e=function(t){return function(n,e){lt(t,function(t){t(n,e)})}},o=function(t,n){var e;gv.isDisabled(t)||(e=n.event.raw,a(t,e.dataTransfer.files))},r=function(t,n){var e=n.event.raw.target;a(t,e.files)},a=function(t,n){var e,o,r;Nl.setValue(t,(e=n,o=u,r=ck.explode(o.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string")),H(Q(e),function(n){return F(r,function(t){return Se(n.name,"."+t)})}))),qo(t,ex,{name:i.name})},c=gp({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ic([dg("input-file-events",[ar(vo()),ar(Eo())])])}),t=i.label.map(function(t){return nx(t,u)}),s=Yy.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ic([pk([]),ek(),gv.config({}),Dg.config({toggleClass:"dragenter",toggleOnExecute:!1}),dg("dropzone-events",[er("dragenter",e([n,Dg.toggle])),er("dragleave",e([n,Dg.toggle])),er("dragover",n),er("drop",e([n,o])),er(ho(),r)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:u.translate("Drop an image here")}},mp.sketch({dom:{tag:"button",innerHtml:u.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:ic([Jy.config({}),Uv(u.isDisabled),Lv()])})]}]}}}});return Qy(t,s,["tox-form__group--stretched"],[])},vk=Kr("alloy-fake-before-tabstop"),bk=Kr("alloy-fake-after-tabstop"),yk=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:ic([vg.config({ignore:!0}),Jy.config({})])}},xk=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[yk([vk]),t,yk([bk])],behaviours:ic([rk(1)])}},wk=function(t,n){qo(t,mo(),{raw:{which:9,shiftKey:n}})},Sk=function(t,n){var e=n.element;Ai(e,vk)?wk(t,!0):Ai(e,bk)&&wk(t,!1)},kk=function(t){return Sy(t,["."+vk,"."+bk].join(","),c)},Ck=!(je().browser.isIE()||je().browser.isEdge()),Ok=function(t,n){var o,r,e=Ck&&t.sandboxed,i=it(it({},t.label.map(function(t){return{title:t}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),u=(o=e,r=fe(""),{getValue:function(t){return r.get()},setValue:function(t,n){var e;o?zr(t.element,"srcdoc",n):(zr(t.element,"src","javascript:''"),(e=t.element.dom.contentWindow.document).open(),e.write(n),e.close()),r.set(n)}}),a=t.label.map(function(t){return nx(t,n)}),c=Yy.parts.field({factory:{sketch:function(t){return xk({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:ic([Jy.config({}),vg.config({}),mk(st.none(),u.getValue,u.setValue)])})}}});return Qy(a,c,["tox-form__group--stretched"],[])};function _k(t,n){return Dk(document.createElement("canvas"),t,n)}function Tk(t){var n=_k(t.width,t.height);return Ek(n).drawImage(t,0,0),n}function Ek(t){return t.getContext("2d")}function Dk(t,n,e){return t.width=n,t.height=e,t}function Bk(t){return t.naturalWidth||t.width}function Ak(t){return t.naturalHeight||t.height}var Mk,Fk,Ik,Rk,Vk=window.Promise?window.Promise:(Mk=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=[],Uk(t,Pk(zk,this),Pk(Nk,this))},Fk=window,Ik=Mk.immediateFn||"function"==typeof Fk.setImmediate&&Fk.setImmediate||function(t){setTimeout(t,1)},Rk=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Mk.prototype["catch"]=function(t){return this.then(null,t)},Mk.prototype.then=function(e,o){var r=this;return new Mk(function(t,n){Hk.call(r,new jk(e,o,t,n))})},Mk.all=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var c=Array.prototype.slice.call(1===t.length&&Rk(t[0])?t[0]:t);return new Mk(function(r,i){if(0===c.length)return r([]);for(var u=c.length,t=0;t<c.length;t++)!function a(n,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void e.call(t,function(t){a(n,t)},i)}c[n]=t,0==--u&&r(c)}catch(o){i(o)}}(t,c[t])})},Mk.resolve=function(n){return n&&"object"==typeof n&&n.constructor===Mk?n:new Mk(function(t){t(n)})},Mk.reject=function(e){return new Mk(function(t,n){n(e)})},Mk.race=function(r){return new Mk(function(t,n){for(var e=0,o=r;e<o.length;e++)o[e].then(t,n)})},Mk);function Pk(t,n){return function(){return t.apply(n,arguments)}}function Hk(o){var r=this;null!==this._state?Ik(function(){var t,n=r._state?o.onFulfilled:o.onRejected;if(null!==n){try{t=n(r._value)}catch(e){return void o.reject(e)}o.resolve(t)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}function zk(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void Uk(Pk(n,t),Pk(zk,this),Pk(Nk,this))}this._state=!0,this._value=t,Lk.call(this)}catch(e){Nk.call(this,e)}}function Nk(t){this._state=!1,this._value=t,Lk.call(this)}function Lk(){for(var t=0,n=this._deferreds;t<n.length;t++){var e=n[t];Hk.call(this,e)}this._deferreds=[]}function jk(t,n,e,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof n?n:null,this.resolve=e,this.reject=o}function Uk(t,n,e){var o=!1;try{t(function(t){o||(o=!0,n(t))},function(t){o||(o=!0,e(t))})}catch(r){if(o)return;o=!0,e(r)}}function Wk(e){return new Vk(function(t,n){(function(t){var n=t.split(","),e=/data:([^;]+)/.exec(n[0]);if(!e)return st.none();for(var o=e[1],r=n[1],i=atob(r),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var l=1024*s,f=Math.min(1024+l,u),d=new Array(f-l),m=l,g=0;m<f;++g,++m)d[g]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return st.some(new Blob(c,{type:o}))})(e).fold(function(){n("uri is not base64: "+e)},t)})}function Gk(t,o,r){return o=o||"image/png",_(HTMLCanvasElement.prototype.toBlob)?new Vk(function(n,e){t.toBlob(function(t){t?n(t):e()},o,r)}):Wk(t.toDataURL(o,r))}function Xk(t){return a=t,new Vk(function(t,n){var e=URL.createObjectURL(a),o=new Image,r=function(){o.removeEventListener("load",i),o.removeEventListener("error",u)};function i(){r(),t(o)}function u(){r(),n("Unable to load data of type "+a.type+": "+e)}o.addEventListener("load",i),o.addEventListener("error",u),o.src=e,o.complete&&i()}).then(function(t){var n;n=t,URL.revokeObjectURL(n.src);var e=_k(Bk(t),Ak(t));return Ek(e).drawImage(t,0,0),e});var a}function Yk(t,n,e){var o=n.type;function r(o,r){return t.then(function(t){return e=r,n=(n=o)||"image/png",t.toDataURL(n,e);var n,e})}return{getType:at(o),toBlob:function(){return Vk.resolve(n)},toDataURL:at(e),toBase64:function(){return e.split(",")[1]},toAdjustedBlob:function(n,e){return t.then(function(t){return Gk(t,n,e)})},toAdjustedDataURL:r,toAdjustedBase64:function(t,n){return r(t,n).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(Tk)}}}function qk(n){return e=n,new Vk(function(t){var n=new FileReader;n.onloadend=function(){t(n.result)},n.readAsDataURL(e)}).then(function(t){return Yk(Xk(n),n,t)});var e}function Kk(n,t){return Gk(n,t).then(function(t){return Yk(Vk.resolve(n),t,n.toDataURL())})}var Jk=qk;function $k(t,n,e){var o="string"==typeof t?parseFloat(t):t;return e<o?o=e:o<n&&(o=n),o}function Qk(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]}var Zk=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function tC(t,n){for(var e,o=[],r=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)o[u]=n[u+5*i];for(u=0;u<5;u++){for(var a=e=0;a<5;a++)e+=t[u+5*a]*o[a];r[u+5*i]=e}}return r}function nC(u,a){return u.toCanvas().then(function(t){return n=t,e=u.getType(),o=a,r=Ek(n),i=function(t,n){for(var e,o,r,i,u=t.data,a=n[0],c=n[1],s=n[2],l=n[3],f=n[4],d=n[5],m=n[6],g=n[7],p=n[8],h=n[9],v=n[10],b=n[11],y=n[12],x=n[13],w=n[14],S=n[15],k=n[16],C=n[17],O=n[18],_=n[19],T=0;T<u.length;T+=4)e=u[T],o=u[T+1],r=u[T+2],i=u[T+3],u[T]=e*a+o*c+r*s+i*l+f,u[T+1]=e*d+o*m+r*g+i*p+h,u[T+2]=e*v+o*b+r*y+i*x+w,u[T+3]=e*S+o*k+r*C+i*O+_;return t}(r.getImageData(0,0,n.width,n.height),o),r.putImageData(i,0,0),Kk(n,e);var n,e,o,r,i})}function eC(a,c){return a.toCanvas().then(function(t){return n=t,e=a.getType(),o=c,r=Ek(n),i=r.getImageData(0,0,n.width,n.height),u=r.getImageData(0,0,n.width,n.height),u=function(t,n,e){function o(t,n,e){return e<t?t=e:t<n&&(t=n),t}for(var r=Math.round(Math.sqrt(e.length)),i=Math.floor(r/2),u=t.data,a=n.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,p=0;p<r;p++)for(var h=0;h<r;h++){var v=o(f+h-i,0,c-1),b=4*(o(l+p-i,0,s-1)*c+v),y=e[p*r+h];d+=u[b]*y,m+=u[1+b]*y,g+=u[2+b]*y}var x=4*(l*c+f);a[x]=o(d,0,255),a[1+x]=o(m,0,255),a[2+x]=o(g,0,255)}return n}(i,u,o),r.putImageData(u,0,0),Kk(n,e);var n,e,o,r,i,u})}function oC(e){return function(t,n){return nC(t,e(Qk(),n))}}var rC,iC,uC,aC,cC=(rC=[-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1],function(t){return nC(t,rC)}),sC=oC(function(t,n){return tC(t,[1,0,0,0,n=$k(255*n,-255,255),0,1,0,0,n,0,0,1,0,n,0,0,0,1,0,0,0,0,0,1])}),lC=oC(function(t,n){var e;return n=$k(n,-1,1),tC(t,[(e=(n*=100)<0?127+n/100*127:127*(e=0===(e=n%1)?Zk[n]:Zk[Math.floor(n)]*(1-e)+Zk[Math.floor(n)+1]*e)+127)/127,0,0,0,.5*(127-e),0,e/127,0,0,.5*(127-e),0,0,e/127,0,.5*(127-e),0,0,0,1,0,0,0,0,0,1])}),fC=(iC=[0,-1,0,-1,5,-1,0,-1,0],function(t){return eC(t,iC)}),dC=(uC=function(t,n){return 255*Math.pow(t/255,1-n)},aC=function(t,n,e){var o=Ek(t),r=new Array(256);for(var i=0;i<r.length;i++)r[i]=uC(i,e);var u=function(t,n){for(var e=t.data,o=0;o<e.length;o+=4)e[o]=n[e[o]],e[o+1]=n[e[o+1]],e[o+2]=n[e[o+2]];return t}(o.getImageData(0,0,t.width,t.height),r);return o.putImageData(u,0,0),Kk(t,n)},function(n,e){return n.toCanvas().then(function(t){return aC(t,n.getType(),e)})});function mC(t,n,e){var o=Bk(t),r=Ak(t),i=n/o,u=e/r,a=!1;(i<.5||2<i)&&(i=i<.5?.5:2,a=!0),(u<.5||2<u)&&(u=u<.5?.5:2,a=!0);var c,s,l,f=(c=t,s=i,l=u,new Vk(function(t){var n=Bk(c),e=Ak(c),o=Math.floor(n*s),r=Math.floor(e*l),i=_k(o,r);Ek(i).drawImage(c,0,0,n,e,0,0,o,r),t(i)}));return a?f.then(function(t){return mC(t,n,e)}):f}function gC(n,e){return n.toCanvas().then(function(t){return function(t,n,e){var o=_k(t.width,t.height),r=Ek(o),i=0,u=0;90!==(e=e<0?360+e:e)&&270!==e||Dk(o,o.height,o.width);90!==e&&180!==e||(i=o.width);270!==e&&180!==e||(u=o.height);return r.translate(i,u),r.rotate(e*Math.PI/180),r.drawImage(t,0,0),Kk(o,n)}(t,n.getType(),e)})}function pC(n,e){return n.toCanvas().then(function(t){return function(t,n,e){var o=_k(t.width,t.height),r=Ek(o);"v"===e?(r.scale(1,-1),r.drawImage(t,0,-o.height)):(r.scale(-1,1),r.drawImage(t,-o.width,0));return Kk(o,n)}(t,n.getType(),e)})}function hC(u,a,c,s,l){return u.toCanvas().then(function(t){return n=t,e=u.getType(),o=a,r=c,Ek(i=_k(s,l)).drawImage(n,-o,-r),Kk(i,e);var n,e,o,r,i})}var vC,bC=function(t){return cC(t)},yC=function(t){return fC(t)},xC=function(t,n){return dC(t,n)},wC=function(t,n,e,o){return nC(t,(r=Qk(),i=e,u=o,tC(r,[$k(n,0,2),0,0,0,0,0,i=$k(i,0,2),0,0,0,0,0,u=$k(u,0,2),0,0,0,0,0,1,0,0,0,0,0,1])));var r,i,u},SC=function(t,n){return sC(t,n)},kC=function(t,n){return lC(t,n)},CC=pC,OC=hC,_C=function(t,n,e){return r=n,i=e,(o=t).toCanvas().then(function(t){return mC(t,r,i).then(function(t){return Kk(t,o.getType())})});var o,r,i},TC=gC,EC=function(t,n){return it({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},n)},DC=function(t,n){return EC(hp(t,n),{})},BC=function(t,n){return EC(hp(t,n),{behaviours:ic([fg.config({})])})},AC=function(t,n,e){return{dom:{tag:"span",innerHtml:e.translate(t),classes:[n+"__select-label"]},behaviours:ic([fg.config({})])}},MC=Kr("toolbar.button.execute"),FC=((vC={})[_o()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],vC),IC=Kr("update-menu-text"),RC=Kr("update-menu-icon"),VC=function(n,e,o){var t=fe($),r=n.text.map(function(t){return gp(AC(t,e,o.providers))}),i=n.icon.map(function(t){return gp(BC(t,o.providers.icons))}),u=function(t,n){var e=Nl.getValue(t);return vg.focus(e),qo(e,"keydown",{raw:n.event.raw}),tw.close(e),st.some(!0)},a=n.role.fold(function(){return{}},function(t){return{role:t}}),c=n.tooltip.fold(function(){return{}},function(t){var n=o.providers.translate(t);return{title:n,"aria-label":n}});return gp(tw.sketch(it(it(it({},n.uid?{uid:n.uid}:{}),a),{dom:{tag:"button",classes:[e,e+"--select"].concat(V(n.classes,function(t){return e+"--"+t})),attributes:it({},c)},components:Jv([i.map(function(t){return t.asSpec()}),r.map(function(t){return t.asSpec()}),st.some({dom:{tag:"div",classes:[e+"__select-chevron"],innerHtml:hp("chevron-down",o.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:ic(S(n.dropdownBehaviours,[Uv(function(){return n.disabled||o.providers.isDisabled()}),Lv(),nw.config({}),fg.config({}),dg("dropdown-events",[Yv(n,t),qv(n,t)]),dg("menubutton-update-display-text",[er(IC,function(n,e){r.bind(function(t){return t.getOpt(n)}).each(function(t){fg.set(t,[fu(o.providers.translate(e.event.text))])})}),er(RC,function(n,e){i.bind(function(t){return t.getOpt(n)}).each(function(t){fg.set(t,[BC(e.event.icon,o.providers.icons)])})})])])),eventOrder:zt(FC,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ic([ug.config({mode:"special",onLeft:u,onRight:u})]),lazySink:o.getSink,toggleClass:e+"--active",parts:{menu:wh(0,n.columns,n.presets)},fetch:function(t){return Ox(y(n.fetch,t))}}))).asSpec()},PC=function(t){return"separator"===t.type},HC={type:"separator"},zC=function(t,e){var n=N(t,function(t,n){return k(n)?""===n?t:"|"===n?0<t.length&&!PC(t[t.length-1])?t.concat([HC]):t:It(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])},[]);return 0<n.length&&PC(n[n.length-1])&&n.pop(),n},NC=function(t,n){return It(t,"getSubmenuItems")?(o=n,r=(e=t).getSubmenuItems(),i=LC(r,o),{item:e,menus:zt(i.menus,Jt(e.value,i.items)),expansions:zt(i.expansions,Jt(e.value,e.value))}):{item:t,menus:{},expansions:{}};var e,o,r,i},LC=function(t,r){var n=zC(k(t)?t.split(" "):t,r);return z(n,function(t,n){var e=function(t){if(PC(t))return t;var n=Ft(t,"value").getOrThunk(function(){return Kr("generated-menu-item")});return zt({value:n},t)}(n),o=NC(e,r);return{menus:zt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:zt(t.expansions,o.expansions)}},{menus:{},expansions:{},items:[]})},jC=function(t,e,o,n){var r=Kr("primary-menu"),i=LC(t,o.shared.providers.menuItems());if(0===i.items.length)return st.none();var u=py(r,i.items,e,o,n),a=Tt(i.menus,function(t,n){return py(n,t,e,o,!1)}),c=zt(a,Jt(r,u));return st.from(Zg.tieredData(r,c,i.expansions))},UC=function(e){return{isDisabled:function(){return gv.isDisabled(e)},setDisabled:function(t){return gv.set(e,t)},setActive:function(t){var n=e.element;t?(Ei(n,"tox-tbtn--enabled"),zr(n,"aria-pressed",!0)):(Bi(n,"tox-tbtn--enabled"),Ur(n,"aria-pressed"))},isActive:function(){return Ai(e.element,"tox-tbtn--enabled")}}},WC=function(e,t,o,n){return VC({text:e.text,icon:e.icon,tooltip:e.tooltip,role:n,fetch:function(t,n){e.fetch(function(t){n(jC(t,uh.CLOSE_ON_EXECUTE,o,!1))})},onSetup:e.onSetup,getApi:UC,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Jy.config({})]},t,o.shared)},GC=function(n,r,i){return function(t){t(V(n,function(t){var n,e,o=t.text.fold(function(){return{}},function(t){return{text:t}});return it(it({type:t.type,active:!1},o),{onAction:function(t){var n=!t.isActive();t.setActive(n),e.storage.set(n),i.shared.getSink().each(function(t){r().getOpt(t).each(function(t){mc(t.element),qo(t,ix,{name:e.name,value:e.storage.get()})})})},onSetup:(n=e=t,function(t){t.setActive(n.storage.get())})})}))}},XC=function(t,n,e,o,r,i){void 0===e&&(e=[]);var u=n.fold(function(){return{}},function(t){return{action:t}}),a=it({buttonBehaviours:ic([Uv(function(){return t.disabled||i.isDisabled()}),Lv(),Jy.config({}),dg("button press",[nr("click"),nr("mousedown")])].concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=zt(a,{dom:o});return zt(c,{components:r})},YC=function(t,n,e,o){void 0===o&&(o=[]);var r={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map(function(t){return{"aria-label":e.translate(t),title:e.translate(t)}}).getOr({})},i=t.icon.map(function(t){return DC(t,e.icons)}),u=Jv([i]);return XC(t,n,o,r,u,e)},qC=function(t,n,e,o){void 0===o&&(o=[]);var r=YC(t,st.some(n),e,o);return mp.sketch(r)},KC=function(t,n,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=e.translate(t.text),u=t.icon?t.icon.map(function(t){return DC(t,e.icons)}):st.none(),a=u.isSome()?Jv([u]):[],c=u.isSome()?{}:{innerHtml:i},s=S(t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],t.borderless?["tox-button--naked"]:[],r),l=it(it({tag:"button",classes:s},c),{attributes:{title:i}});return XC(t,n,o,l,a,e)},JC=function(t,n,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=KC(t,st.some(n),e,o,r);return mp.sketch(i)},$C=function(n,e){return function(t){"custom"===e?qo(t,ix,{name:n,value:{}}):"submit"===e?Yo(t,ux):"cancel"===e?Yo(t,rx):console.error("Unknown button type: ",e)}},QC=function(n,t,e){if("menu"===t){var o=n,r=it(it({},n),{onSetup:function(t){return t.setDisabled(n.disabled),$},fetch:GC(o.items,function(){return i},e)}),i=gp(WC(r,"tox-tbtn",e,st.none()));return i.asSpec()}if("custom"===(c=t)||"cancel"===c||"submit"===c){var u=$C(n.name,t),a=it(it({},n),{borderless:!1});return JC(a,u,e.shared.providers,[])}var c;console.error("Unknown footer button type: ",t)},ZC=function(t,n){var e,o,r=$C(t.name,"custom");return e=st.none(),o=Yy.parts.field(it({factory:mp},KC(t,st.some(r),n,[pk(""),ek()]))),Qy(e,o,[],[])},tO=at([ne("field1Name","field1"),ne("field2Name","field2"),ha("onLockedChange"),da(["lockClass"]),ne("locked",!1),Wl("coupledFieldBehaviours",[td,Nl])]),nO=function(t,n){return vf({factory:Yy,name:t,overrides:function(o){return{fieldBehaviours:ic([dg("coupled-input-behaviour",[er(po(),function(e){Af(e,o,n).bind(td.getCurrent).each(function(n){Af(e,o,"lock").each(function(t){Dg.isOn(t)&&o.onLockedChange(e,n,t)})})})])])}}})},eO=at([nO("field1","field2"),nO("field2","field1"),vf({factory:mp,schema:[Ln("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:ic([Dg.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),oO=qf({name:"FormCoupledInputs",configFields:tO(),partFields:eO(),factory:function(o,t,n,e){return{uid:o.uid,dom:o.dom,components:t,behaviours:Gl(o.coupledFieldBehaviours,[td.config({find:st.some}),Nl.config({store:{mode:"manual",getValue:function(t){var n=Vf(t,o,["field1","field2"]),e={};return e[o.field1Name]=Nl.getValue(n.field1()),e[o.field2Name]=Nl.getValue(n.field2()),e},setValue:function(t,n){var e=Vf(t,o,["field1","field2"]);Rt(n,o.field1Name)&&Nl.setValue(e.field1(),n[o.field1Name]),Rt(n,o.field2Name)&&Nl.setValue(e.field2(),n[o.field2Name])}}})]),apis:{getField1:function(t){return Af(t,o,"field1")},getField2:function(t){return Af(t,o,"field2")},getLock:function(t){return Af(t,o,"lock")}}}},apis:{getField1:function(t,n){return t.getField1(n)},getField2:function(t,n){return t.getField2(n)},getLock:function(t,n){return t.getLock(n)}}}),rO=function(t){var n=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null===n)return dt.error(t);var e=parseFloat(n[1]),o=n[2];return dt.value({value:e,unit:o})},iO=function(t,n){var e={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,"in":1},o=function(t){return Object.prototype.hasOwnProperty.call(e,t)};return t.unit===n?st.some(t.value):o(t.unit)&&o(n)?e[t.unit]===e[n]?st.some(t.value):st.some(t.value/e[t.unit]*e[n]):st.none()},uO=function(t){return st.none()},aO=function(t,n){var e,o,r,i=rO(t).toOptional(),u=rO(n).toOptional();return o=u,r=function(t,o){return iO(t,o.unit).map(function(t){return o.value/t}).map(function(t){return n=t,e=o.unit,function(t){return iO(t,e).map(function(t){return{value:t*n,unit:e}})};var n,e}).getOr(uO)},((e=i).isSome()&&o.isSome()?st.some(r(e.getOrDie(),o.getOrDie())):st.none()).getOr(uO)},cO=function(o,n){var a=uO,r=Kr("ratio-event"),t=oO.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:n.translate(o.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:hp("lock",n.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:hp("unlock",n.icons)}}],buttonBehaviours:ic([gv.config({disabled:function(){return o.disabled||n.isDisabled()}}),Lv(),Jy.config({})])}),e=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},i=function(e){return Yy.parts.field({factory:px,inputClasses:["tox-textfield"],inputBehaviours:ic([gv.config({disabled:function(){return o.disabled||n.isDisabled()}}),Lv(),Jy.config({}),dg("size-input-events",[er(lo(),function(t,n){qo(t,r,{isField1:e})}),er(ho(),function(t,n){qo(t,ex,{name:o.name})})])]),selectOnFocus:!1})},u=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}},c=oO.parts.field1(e([Yy.parts.label(u("Width")),i(!0)])),s=oO.parts.field2(e([Yy.parts.label(u("Height")),i(!1)]));return oO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,e([u(" "),t])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,i,n){rO(Nl.getValue(t)).each(function(t){a(t).each(function(t){var n,e,o,r;Nl.setValue(i,(o={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,"in":4,"%":4},-1!==(r=(n=t).value.toFixed((e=n.unit)in o?o[e]:1)).indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+n.unit))})})},coupledFieldBehaviours:ic([gv.config({disabled:function(){return o.disabled||n.isDisabled()},onDisabled:function(t){oO.getField1(t).bind(Yy.getField).each(gv.disable),oO.getField2(t).bind(Yy.getField).each(gv.disable),oO.getLock(t).each(gv.disable)},onEnabled:function(t){oO.getField1(t).bind(Yy.getField).each(gv.enable),oO.getField2(t).bind(Yy.getField).each(gv.enable),oO.getLock(t).each(gv.enable)}}),Lv(),dg("size-input-events2",[er(r,function(t,n){var e=n.event.isField1,o=e?oO.getField1(t):oO.getField2(t),r=e?oO.getField2(t):oO.getField1(t),i=o.map(Nl.getValue).getOr(""),u=r.map(Nl.getValue).getOr("");a=aO(i,u)})])])})},sO={undo:at(Kr("undo")),redo:at(Kr("redo")),zoom:at(Kr("zoom")),back:at(Kr("back")),apply:at(Kr("apply")),swap:at(Kr("swap")),transform:at(Kr("transform")),tempTransform:at(Kr("temp-transform")),transformApply:at(Kr("transform-apply"))},lO=at("save-state"),fO=at("disable"),dO=at("enable"),mO={formActionEvent:ix,saveState:lO,disable:fO,enable:dO},gO=function(r,c){var t=function(t,n,e,o){return gp(JC({name:t,text:t,disabled:e,primary:o,icon:st.none(),borderless:!1},n,c))},n=function(t,n,e,o){return gp(qC({name:t,icon:st.some(t),tooltip:st.some(n),disabled:o,primary:!1,borderless:!1},e,c))},u=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(gv)&&gv.disable(n)})},a=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(gv)&&gv.enable(n)})},s={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},e=$,i=function(t,n,e){qo(t,n,e)},l=function(t){return Yo(t,mO.disable())},f=function(t){return Yo(t,mO.enable())},d=function(t,n){l(t),i(t,sO.transform(),{transform:n}),f(t)},o=function(t){return function(){J.getOpt(t).each(function(t){fg.set(t,[q])})}},m=function(t,n){l(t),i(t,sO.transformApply(),{transform:n,swap:o(t)}),f(t)},g=function(){return t("Back",function(t){return i(t,sO.back(),{swap:o(t)})},!1,!1)},p=function(){return gp({dom:{tag:"div",classes:["tox-spacer"]},behaviours:ic([gv.config({})])})},h=function(){return t("Apply",function(t){return i(t,sO.apply(),{swap:o(t)})},!0,!0)},v=[g(),p(),t("Apply",function(t){m(t,function(t){var n=r.getRect();return OC(t,n.x,n.y,n.w,n.h)}),r.hideCrop()},!1,!0)],b=Uy.sketch({dom:s,components:v.map(function(t){return t.asSpec()}),containerBehaviours:ic([dg("image-tools-crop-buttons-events",[er(mO.disable(),function(t,n){u(v,t)}),er(mO.enable(),function(t,n){a(v,t)})])])}),y=gp(cO({name:"size",label:st.none(),constrain:!0,disabled:!1},c)),x=[g(),p(),y,p(),t("Apply",function(a){y.getOpt(a).each(function(t){var n,e,o=Nl.getValue(t),r=parseInt(o.width,10),i=parseInt(o.height,10),u=(n=r,e=i,function(t){return _C(t,n,e)});m(a,u)})},!1,!0)],w=Uy.sketch({dom:s,components:x.map(function(t){return t.asSpec()}),containerBehaviours:ic([dg("image-tools-resize-buttons-events",[er(mO.disable(),function(t,n){u(x,t)}),er(mO.enable(),function(t,n){a(x,t)})])])}),S=function(n,e){return function(t){return n(t,e)}},k=S(CC,"h"),C=S(CC,"v"),O=S(TC,-90),_=S(TC,90),T=function(t,n){var e,o;o=n,l(e=t),i(e,sO.tempTransform(),{transform:o}),f(e)},E=[g(),p(),n("flip-horizontally","Flip horizontally",function(t){T(t,k)},!1),n("flip-vertically","Flip vertically",function(t){T(t,C)},!1),n("rotate-left","Rotate counterclockwise",function(t){T(t,O)},!1),n("rotate-right","Rotate clockwise",function(t){T(t,_)},!1),p(),h()],D=Uy.sketch({dom:s,components:E.map(function(t){return t.asSpec()}),containerBehaviours:ic([dg("image-tools-fliprotate-buttons-events",[er(mO.disable(),function(t,n){u(E,t)}),er(mO.enable(),function(t,n){a(E,t)})])])}),B=function(t,n,e,o,r){var i=WS.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:c.translate(t)}}),u=WS.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),a=WS.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return gp(WS.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e,maxX:r,getInitialValue:at({x:o})},components:[i,u,a],sliderBehaviours:ic([vg.config({})]),onChoose:n}))},A=function(t,n,e,o,r){return[g(),(i=n,B(t,function(t,n,e){var o=S(i,e.x/100);d(t,o)},e,o,r)),h()];var i},M=function(t,n,e,o,r){var i=A(t,n,e,o,r);return Uy.sketch({dom:s,components:i.map(function(t){return t.asSpec()}),containerBehaviours:ic([dg("image-tools-filter-panel-buttons-events",[er(mO.disable(),function(t,n){u(i,t)}),er(mO.enable(),function(t,n){a(i,t)})])])})},F=[g(),p(),h()],I=Uy.sketch({dom:s,components:F.map(function(t){return t.asSpec()})}),R=M("Brightness",SC,-100,0,100),V=M("Contrast",kC,-100,0,100),P=M("Gamma",xC,-100,0,100),H=function(t){return B(t,function(l,t,n){var e=z.getOpt(l),o=L.getOpt(l),r=N.getOpt(l);e.each(function(s){o.each(function(c){r.each(function(t){var n,e,o,r=Nl.getValue(s).x/100,i=Nl.getValue(t).x/100,u=Nl.getValue(c).x/100,a=(n=r,e=i,o=u,function(t){return wC(t,n,e,o)});d(l,a)})})})},0,100,200)},z=H("R"),N=H("G"),L=H("B"),j=[g(),z,N,L,h()],U=Uy.sketch({dom:s,components:j.map(function(t){return t.asSpec()})}),W=function(n,e,o){return function(t){i(t,sO.swap(),{transform:e,swap:function(){J.getOpt(t).each(function(t){fg.set(t,[n]),o(t)})}})}},G=st.some(yC),X=st.some(bC),Y=[n("crop","Crop",W(b,st.none(),function(t){r.showCrop()}),!1),n("resize","Resize",W(w,st.none(),function(t){y.getOpt(t).each(function(t){var n=r.getMeasurements(),e=n.width,o=n.height;Nl.setValue(t,{width:e,height:o})})}),!1),n("orientation","Orientation",W(D,st.none(),e),!1),n("brightness","Brightness",W(R,st.none(),e),!1),n("sharpen","Sharpen",W(I,G,e),!1),n("contrast","Contrast",W(V,st.none(),e),!1),n("color-levels","Color levels",W(U,st.none(),e),!1),n("gamma","Gamma",W(P,st.none(),e),!1),n("invert","Invert",W(I,X,e),!1)],q=Uy.sketch({dom:s,components:Y.map(function(t){return t.asSpec()})}),K=Uy.sketch({dom:{tag:"div"},components:[q],containerBehaviours:ic([fg.config({})])}),J=gp(K);return{memContainer:J,getApplyButton:function(t){return J.getOpt(t).map(function(t){var n=t.components()[0];return n.components()[n.components().length-1]})}}},pO=tinymce.util.Tools.resolve("tinymce.geom.Rect"),hO=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),vO=tinymce.util.Tools.resolve("tinymce.util.Observable"),bO=tinymce.util.Tools.resolve("tinymce.util.VK");function yO(t){var n,e;if(t.changedTouches)for(n="screenX screenY pageX pageY clientX clientY".split(" "),e=0;e<n.length;e++)t[n[e]]=t.changedTouches[0][n[e]]}function xO(t,m){var g,p,h,v,b=m.document||document,y=b.getElementById(m.handle||t),x=function(t){if(yO(t),t.button!==p)return w(t);t.deltaX=t.screenX-h,t.deltaY=t.screenY-v,t.preventDefault(),m.drag(t)},w=function(t){yO(t),hO(b).off("mousemove touchmove",x).off("mouseup touchend",w),g.remove(),m.stop&&m.stop(t)};this.destroy=function(){hO(y).off()},hO(y).on("mousedown touchstart",function(t){var n,e,o,r,i,u,a,c,s,l,f=(n=b,e=Math.max,o=n.documentElement,r=n.body,i=e(o.scrollWidth,r.scrollWidth),u=e(o.clientWidth,r.clientWidth),a=e(o.offsetWidth,r.offsetWidth),c=e(o.scrollHeight,r.scrollHeight),s=e(o.clientHeight,r.clientHeight),{width:i<a?u:i,height:c<e(o.offsetHeight,r.offsetHeight)?s:c});yO(t),t.preventDefault(),p=t.button;var d=y;h=t.screenX,v=t.screenY,l=window.getComputedStyle?window.getComputedStyle(d,null).getPropertyValue("cursor"):d.runtimeStyle.cursor,g=hO("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(b.body),hO(b).on("mousemove touchmove",x).on("mouseup touchend",w),m.start(t)})}var wO=0,SO=function(s,e,l,o,r){var t,n="tox-",u="tox-crid-"+wO++,a=[{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"],c=function(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}},f=function(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}};function d(t,n,e,o){var r,i=n.x,u=n.y,a=n.w,c=n.h;i+=e*t.deltaX,u+=o*t.deltaY,(a+=e*t.deltaW)<20&&(a=20),(c+=o*t.deltaH)<20&&(c=20),r=s=pO.clamp({x:i,y:u,w:a,h:c},l,"move"===t.name),r=f(l,r),h.fire("updateRect",{rect:r}),p(r)}function m(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),hO("#"+u+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}ck.each(a,function(t){hO("#"+u+"-"+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 g(t){m(s=t)}function p(t){g(c(l,t))}hO('<div id="'+u+'" class="'+n+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),ck.each(i,function(t){hO("#"+u,o).append('<div id="'+u+"-"+t+'"class="'+n+'croprect-block" style="display: none" data-mce-bogus="all">')}),ck.each(a,function(t){hO("#"+u,o).append('<div id="'+u+"-"+t.name+'" class="'+n+"croprect-handle "+n+"croprect-handle-"+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')}),t=ck.map(a,function(n){var e;return new xO(u,{document:o.ownerDocument,handle:u+"-"+n.name,start:function(){e=s},drag:function(t){d(n,e,t.deltaX,t.deltaY)}})}),m(s),hO(o).on("focusin focusout",function(t){hO(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")}),hO(o).on("keydown",function(n){var i;function t(t,n,e,o,r){t.stopPropagation(),t.preventDefault(),d(i,e,o,r)}switch(ck.each(a,function(t){if(n.target.id===u+"-"+t.name)return i=t,!1}),n.keyCode){case bO.LEFT:t(n,0,s,-10,0);break;case bO.RIGHT:t(n,0,s,10,0);break;case bO.UP:t(n,0,s,0,-10);break;case bO.DOWN:t(n,0,s,0,10);break;case bO.ENTER:case bO.SPACEBAR:n.preventDefault(),r()}});var h=ck.extend({toggleVisibility:function(t){var n=ck.map(a,function(t){return"#"+u+"-"+t.name}).concat(ck.map(i,function(t){return"#"+u+"-"+t})).join(",");t?hO(n,o).show():hO(n,o).hide()},setClampRect:function(t){l=t,m(s)},setRect:g,getInnerRect:function(){return f(l,s)},setInnerRect:p,setViewPortRect:function(t){e=t,m(s)},destroy:function(){ck.each(t,function(t){t.destroy()}),t=[]}},vO);return h},kO=function(n){var l=gp({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),f=fe(1),d=fe(st.none()),m=fe({x:0,y:0,w:1,h:1}),c=fe({x:0,y:0,w:1,h:1}),s=function(t,s){g.getOpt(t).each(function(t){var e=f.get(),o=_u(t.element),r=bu(t.element),i=s.dom.naturalWidth*e,u=s.dom.naturalHeight*e,a=Math.max(0,o/2-i/2),c=Math.max(0,r/2-u/2),n={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};Ki(s,n),l.getOpt(t).each(function(t){Ki(t.element,n)}),d.get().each(function(t){var n=m.get();t.setRect({x:n.x*e+a,y:n.y*e+c,w:n.w*e,h:n.h*e}),t.setClampRect({x:a,y:c,w:i,h:u}),t.setViewPortRect({x:0,y:0,w:o,h:r})})})},e=function(t,n){var e,a=me.fromTag("img");return zr(a,"src",n),e=a.dom,new Fp(function(t){var n=function(){e.removeEventListener("load",n),t(e)};e.complete?t(e):e.addEventListener("load",n)}).then(function(){return g.getOpt(t).map(function(t){var n=du({element:a});fg.replaceAt(t,1,st.some(n));var e=c.get(),o={x:0,y:0,w:a.dom.naturalWidth,h:a.dom.naturalHeight};c.set(o);var r,u,i=pO.inflate(o,-20,-20);return m.set(i),e.w===o.w&&e.h===o.h||(r=t,u=a,g.getOpt(r).each(function(t){var n=_u(t.element),e=bu(t.element),o=u.dom.naturalWidth,r=u.dom.naturalHeight,i=Math.min(n/o,e/r);1<=i?f.set(1):f.set(i)})),s(t,a),a})})},t=Uy.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[l.asSpec(),{dom:{tag:"img",attributes:{src:n}}},{dom:{tag:"div"},behaviours:ic([dg("image-panel-crop-events",[sr(function(t){g.getOpt(t).each(function(t){var n=t.element.dom,e=SO({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},n,function(){});e.toggleVisibility(!1),e.on("updateRect",function(t){var n=t.rect,e=f.get(),o={x:Math.round(n.x/e),y:Math.round(n.y/e),w:Math.round(n.w/e),h:Math.round(n.h/e)};m.set(o)}),d.set(st.some(e))})})])])}],containerBehaviours:ic([fg.config({}),dg("image-panel-events",[sr(function(t){e(t,n)})])])}),g=gp(t);return{memContainer:g,updateSrc:e,zoom:function(t,n){var e=f.get(),o=0<n?Math.min(2,e+.1):Math.max(.1,e-.1);f.set(o),g.getOpt(t).each(function(t){var n=t.components()[1].element;s(t,n)})},showCrop:function(){d.get().each(function(t){t.toggleVisibility(!0)})},hideCrop:function(){d.get().each(function(t){t.toggleVisibility(!1)})},getRect:function(){return m.get()},getMeasurements:function(){var t=c.get();return{width:t.w,height:t.h}}}},CO=function(t,n,e,o,r){return qC({name:t,icon:st.some(n),disabled:e,tooltip:st.some(t),primary:!1,borderless:!1},o,r)},OO=function(t,n){n?gv.enable(t):gv.disable(t)};function _O(){var e=[],o=-1;function t(){return 0<o}function n(){return-1!==o&&o<e.length-1}return{data:e,add:function(t){var n=e.splice(++o);return e.push(t),{state:t,removed:n}},undo:function(){if(t())return e[--o]},redo:function(){if(n())return e[++o]},canUndo:t,canRedo:n}}var TO,EO,DO,BO=function(t){var n=fe(t),e=fe(st.none()),r=_O();r.add(t);var i=function(t){n.set(t)},u=function(t){return{blob:t,url:URL.createObjectURL(t)}},a=function(t){URL.revokeObjectURL(t.url)},o=function(){e.get().each(a),e.set(st.none())},c=function(t){var n=u(t);i(n);var e,o=r.add(n).removed;return e=o,ck.each(e,a),n.url};return{getBlobState:function(){return n.get()},setBlobState:i,addBlobState:c,getTempState:function(){return e.get().fold(function(){return n.get()},function(t){return t})},updateTempState:function(t){var n=u(t);return o(),e.set(st.some(n)),n.url},addTempState:function(t){var n=u(t);return e.set(st.some(n)),n.url},applyTempState:function(n){return e.get().fold(function(){},function(t){c(t.blob),n()})},destroyTempState:o,undo:function(){var t=r.undo();return i(t),t.url},redo:function(){var t=r.redo();return i(t),t.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}},AO=function(t,n){var e,o,r,u=BO(t.currentState),i=function(t){var n=u.getHistoryStates();p.updateButtonUndoStates(t,n.undoEnabled,n.redoEnabled),qo(t,mO.formActionEvent,{name:mO.saveState(),value:n.undoEnabled})},a=function(t){return t.toBlob()},c=function(t){qo(t,mO.formActionEvent,{name:mO.disable(),value:{}})},s=function(t){h.getApplyButton(t).each(function(t){gv.enable(t)}),qo(t,mO.formActionEvent,{name:mO.enable(),value:{}})},l=function(t,n){return c(t),g.updateSrc(t,n)},f=function(n,t,e,o,r){return c(n),Jk(t).then(e).then(a).then(o).then(function(t){return l(n,t).then(function(t){return i(n),r(),s(n),t})})["catch"](function(t){return console.log(t),s(n),t})},d=function(t,n,e){var o=u.getBlobState().blob;f(t,o,n,function(t){return u.updateTempState(t)},e)},m=function(t){var n=u.getBlobState().url;return u.destroyTempState(),i(t),n},g=kO(t.currentState.url),p=(o=gp(CO("Undo","undo",!0,function(t){qo(t,sO.undo(),{direction:1})},e=n)),r=gp(CO("Redo","redo",!0,function(t){qo(t,sO.redo(),{direction:1})},e)),{container:Uy.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),r.asSpec(),CO("Zoom in","zoom-in",!1,function(t){qo(t,sO.zoom(),{direction:1})},e),CO("Zoom out","zoom-out",!1,function(t){qo(t,sO.zoom(),{direction:-1})},e)]}),updateButtonUndoStates:function(t,n,e){o.getOpt(t).each(function(t){OO(t,n)}),r.getOpt(t).each(function(t){OO(t,e)})}}),h=gO(g,n);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[h.memContainer.asSpec(),g.memContainer.asSpec(),p.container],behaviours:ic([Nl.config({store:{mode:"manual",getValue:function(){return u.getBlobState()}}}),dg("image-tools-events",[er(sO.undo(),function(n,t){var e=u.undo();l(n,e).then(function(t){s(n),i(n)})}),er(sO.redo(),function(n,t){var e=u.redo();l(n,e).then(function(t){s(n),i(n)})}),er(sO.zoom(),function(t,n){var e=n.event.direction;g.zoom(t,e)}),er(sO.back(),function(t,n){var e,o;o=m(e=t),l(e,o).then(function(t){s(e)}),(0,n.event.swap)(),g.hideCrop()}),er(sO.apply(),function(t,n){u.applyTempState(function(){m(t),(0,n.event.swap)()})}),er(sO.transform(),function(t,n){return d(t,n.event.transform,$)}),er(sO.tempTransform(),function(t,n){return e=t,o=n.event.transform,r=u.getTempState().blob,void f(e,r,o,function(t){return u.addTempState(t)},$);var e,o,r}),er(sO.transformApply(),function(t,n){return e=t,o=n.event.transform,r=n.event.swap,i=u.getBlobState().blob,void f(e,i,o,function(t){var n=u.addBlobState(t);return m(e),n},r);var e,o,r,i}),er(sO.swap(),function(n,t){var e;e=n,p.updateButtonUndoStates(e,!1,!1);var o=t.event.transform,r=t.event.swap;o.fold(function(){r()},function(t){d(n,t,r)})})]),ek()])}},MO=function(t){return!It(t,"items")},FO="data-value",IO=function(n,e,t,o){return V(t,function(t){return MO(t)?{type:"togglemenuitem",text:t.text,value:t.value,active:t.value===o,onAction:function(){Nl.setValue(n,t.value),qo(n,ex,{name:e}),vg.focus(n)}}:{type:"nestedmenuitem",text:t.text,getSubmenuItems:function(){return IO(n,e,t.items,o)}}})},RO=function(t,n){return Z(t,function(t){return MO(t)?Jf(t.value===n,t):RO(t.items,n)})},VO=Yf({name:"HtmlSelect",configFields:[Ln("options"),Ll("selectBehaviours",[vg,Nl]),ne("selectClasses",[]),ne("selectAttributes",{}),Kn("data")],factory:function(e,t){var n=V(e.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),o=e.data.map(function(t){return Jt("initialValue",t)}).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:n,behaviours:Ul(e.selectBehaviours,[vg.config({}),Nl.config({store:it({mode:"manual",getValue:function(t){return ou(t.element)},setValue:function(t,n){L(e.options,function(t){return t.value===n}).isSome()&&ru(t.element,n)}},o)})])}}}),PO=function(e,n){var t=e.label.map(function(t){return nx(t,n)}),o=[gv.config({disabled:function(){return e.disabled||n.isDisabled()}}),Lv(),ug.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:function(t){return Yo(t,ux),st.some(!0)}}),dg("textfield-change",[er(po(),function(t,n){qo(t,ex,{name:e.name})}),er(Co(),function(t,n){qo(t,ex,{name:e.name})})]),Jy.config({})],r=e.validation.map(function(o){return Vx.config({getRoot:function(t){return kr(t.element)},invalidClass:"tox-invalid",validator:{validate:function(t){var n=Nl.getValue(t),e=o.validator(n);return _x(!0===e?dt.value(n):dt.error(e))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=e.placeholder.fold(at({}),function(t){return{placeholder:n.translate(t)}}),u=e.inputMode.fold(at({}),function(t){return{inputmode:t}}),a=it(it({},i),u),c=Yy.parts.field({tag:!0===e.multiline?"textarea":"input",inputAttributes:a,inputClasses:[e.classname],inputBehaviours:ic(ft([o,r])),selectOnFocus:!1,factory:px}),s=(e.flex?["tox-form__group--stretched"]:[]).concat(e.maximized?["tox-form-group--maximize"]:[]),l=[gv.config({disabled:function(){return e.disabled||n.isDisabled()},onDisabled:function(t){Yy.getField(t).each(gv.disable)},onEnabled:function(t){Yy.getField(t).each(gv.enable)}}),Lv()];return Qy(t,c,s,l)},HO=/* */Object.freeze({__proto__:null,events:function(t,n){var e=t.stream.streams.setup(t,n);return Zo([er(t.event,e),lr(function(){return n.cancel()})].concat(t.cancelEvent.map(function(t){return[er(t,function(){return n.cancel()})]}).getOr([])))}}),zO=function(t){var n=fe(null);return di({readState:function(){return{timer:null!==n.get()?"set":"unset"}},setTimer:function(t){n.set(t)},cancel:function(){var t=n.get();null!==t&&t.cancel()}})},NO=/* */Object.freeze({__proto__:null,throttle:zO,init:function(t){return t.stream.streams.state(t)}}),LO=[jn("stream",An("mode",{throttle:[Ln("delay"),ne("stopEvent",!0),ba("streams",{setup:function(t,n){var e=t.stream,o=Sp(t.onStream,e.delay);return n.setTimer(o),function(t,n){o.throttle(t,n),e.stopEvent&&n.stop()}},state:zO})]})),ne("event","input"),Kn("cancelEvent"),ha("onStream")],jO=ac({fields:LO,name:"streaming",active:HO,state:NO}),UO=function(t,n,e){var o=Nl.getValue(e);Nl.setValue(n,o),GO(n)},WO=function(t,n){var e=t.element,o=ou(e),r=e.dom;"number"!==Nr(e,"type")&&n(r,o)},GO=function(t){WO(t,function(t,n){return t.setSelectionRange(n.length,n.length)})},XO=function(t,n,o){if(t.selectsOver){var e=Nl.getValue(n),r=t.getDisplayText(e),i=Nl.getValue(o);return 0===t.getDisplayText(i).indexOf(r)?st.some(function(){var t,e;UO(0,n,o),t=n,e=r.length,WO(t,function(t,n){return t.setSelectionRange(e,n.length)})}):st.none()}return st.none()},YO=at("alloy.typeahead.itemexecute"),qO=at([Kn("lazySink"),Ln("fetch"),ne("minChars",5),ne("responseTime",1e3),ga("onOpen"),ne("getHotspot",st.some),ne("getAnchorOverrides",at({})),ne("layouts",st.none()),ne("eventOrder",{}),se("model",{},[ne("getDisplayText",function(t){return t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.value}),ne("selectsOver",!0),ne("populateFromBrowse",!0)]),ga("onSetValue"),pa("onExecute"),ga("onItemExecute"),ne("inputClasses",[]),ne("inputAttributes",{}),ne("inputStyles",{}),ne("matchWidth",!0),ne("useMinWidth",!1),ne("dismissOnBlur",!0),da(["openClass"]),Kn("initialData"),Ll("typeaheadBehaviours",[vg,Nl,jO,ug,Dg,zx]),le("previewing",function(){return fe(!0)})].concat(dx()).concat($x())),KO=at([bf({schema:[fa()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(n,e){o.previewing.get()?n.getSystem().getByUid(o.uid).each(function(t){XO(o.model,t,e).fold(function(){return fd.dehighlight(n,e)},function(t){return t()})}):n.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&UO(o.model,t,e)}),o.previewing.set(!1)},onExecute:function(t,n){return t.getSystem().getByUid(o.uid).toOptional().map(function(t){return qo(t,YO(),{item:n}),!0})},onHover:function(t,n){o.previewing.set(!1),t.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&UO(o.model,t,n)})}}}})]),JO=qf({name:"Typeahead",configFields:qO(),partFields:KO(),factory:function(r,t,n,i){var e=function(t,n,e){r.previewing.set(!1);var o=zx.getCoupled(t,"sandbox");xl.isOpen(o)?td.getCurrent(o).each(function(t){fd.getHighlighted(t).fold(function(){e(t)},function(){Qo(o,t.element,"keydown",n)})}):Ux(r,u(t),t,o,i,function(t){td.getCurrent(t).each(e)},bx.HighlightFirst).get($)},o=mx(r),u=function(o){return function(t){return t.map(function(t){var n=Mt(t.menus),e=U(n,function(t){return H(t.items,function(t){return"item"===t.type})});return Nl.getState(o).update(V(e,function(t){return t.data})),t})}},a=[vg.config({}),Nl.config({onSetValue:r.onSetValue,store:it({mode:"dataset",getDataKey:function(t){return ou(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,n){ru(t.element,r.model.getDisplayText(n))}},r.initialData.map(function(t){return Jt("initialValue",t)}).getOr({}))}),jO.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(t,n){var e,o=zx.getCoupled(t,"sandbox");vg.isFocused(t)&&ou(t.element).length>=r.minChars&&(e=td.getCurrent(o).bind(function(t){return fd.getHighlighted(t).map(Nl.getValue)}),r.previewing.set(!0),Ux(r,u(t),t,o,i,function(t){td.getCurrent(o).each(function(t){e.fold(function(){r.model.selectsOver&&fd.highlightFirst(t)},function(n){fd.highlightBy(t,function(t){return Nl.getValue(t).value===n.value}),fd.getHighlighted(t).orThunk(function(){return fd.highlightFirst(t),st.none()})})})},bx.HighlightFirst).get($))},cancelEvent:Ao()}),ug.config({mode:"special",onDown:function(t,n){return e(t,n,fd.highlightFirst),st.some(!0)},onEscape:function(t){var n=zx.getCoupled(t,"sandbox");return xl.isOpen(n)?(xl.close(n),st.some(!0)):st.none()},onUp:function(t,n){return e(t,n,fd.highlightLast),st.some(!0)},onEnter:function(n){var t=zx.getCoupled(n,"sandbox"),e=xl.isOpen(t);if(e&&!r.previewing.get())return td.getCurrent(t).bind(function(t){return fd.getHighlighted(t)}).map(function(t){return qo(n,YO(),{item:t}),!0});var o=Nl.getValue(n);return Yo(n,Ao()),r.onExecute(t,n,o),e&&xl.close(t),st.some(!0)}}),Dg.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),zx.config({others:{sandbox:function(t){return Kx(r,t,{onOpen:function(){return Dg.on(t)},onClose:function(){return Dg.off(t)}})}}}),dg("typeaheadevents",[dr(function(t){var n=$;Gx(r,u(t),t,i,n,bx.HighlightFirst).get($)}),er(YO(),function(t,n){var e=zx.getCoupled(t,"sandbox");UO(r.model,t,n.event.item),Yo(t,Ao()),r.onItemExecute(t,e,n.event.item,Nl.getValue(t)),xl.close(e),GO(t)})].concat(r.dismissOnBlur?[er(ko(),function(t){var n=zx.getCoupled(t,"sandbox");pc(n.element).isNone()&&xl.close(n)})]:[]))];return{uid:r.uid,dom:gx(zt(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:it(it({},o),Ul(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),$O=function(i){return it(it({},i),{toCached:function(){return $O(i.toCached())},bindFuture:function(n){return $O(i.bind(function(t){return t.fold(function(t){return _x(dt.error(t))},function(t){return n(t)})}))},bindResult:function(n){return $O(i.map(function(t){return t.bind(n)}))},mapResult:function(n){return $O(i.map(function(t){return t.map(n)}))},mapError:function(n){return $O(i.map(function(t){return t.mapError(n)}))},foldResult:function(n,e){return i.map(function(t){return t.fold(n,e)})},withTimeout:function(t,r){return $O(Ox(function(n){var e=!1,o=setTimeout(function(){e=!0,n(dt.error(r()))},t);i.get(function(t){e||(clearTimeout(o),n(t))})}))}})},QO=function(t){return $O(Ox(t))},ZO=QO,t_={type:"separator"},n_=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},e_=function(t,n){return{type:"menuitem",value:n,text:t,meta:{attach:undefined},onAction:function(){}}},o_=function(t,n){return o=t,e=H(n,function(t){return t.type===o}),V(e,n_);var e,o},r_=function(t,n){var e=t.toLowerCase();return H(n,function(t){var n=t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.text;return we(n.toLowerCase(),e)||we(t.value.toLowerCase(),e)})},i_=function(u,t,a){var n=Nl.getValue(t),c=n.meta.text!==undefined?n.meta.text:n.value;return a.getLinkInformation().fold(function(){return[]},function(t){var n,e,o,r,i=r_(c,(n=a.getHistory(u),V(n,function(t){return e_(t,t)})));return"file"===u?(e=[i,r_(c,o_("header",t.targets)),r_(c,ft([(r=t,st.from(r.anchorTop).map(function(t){return e_("<top>",t)}).toArray()),o_("anchor",t.targets),(o=t,st.from(o.anchorBottom).map(function(t){return e_("<bottom>",t)}).toArray())]))],N(e,function(t,n){return 0===t.length||0===n.length?t.concat(n):t.concat(t_,n)},[])):i})},u_=Kr("aria-invalid"),a_=function(r,o,i){var t,n,e,u,a,c=o.shared.providers,s=function(t){var n=Nl.getValue(t);i.addToHistory(n.value,r.filetype)},l=Yy.parts.field({factory:JO,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":u_,type:"url"},minChars:0,responseTime:0,fetch:function(t){var n=i_(r.filetype,t,i),e=jC(n,uh.BUBBLE_TO_SANDBOX,o,!1);return _x(e)},getHotspot:function(t){return h.getOpt(t)},onSetValue:function(t,n){t.hasConfigured(Vx)&&Vx.run(t).get($)},typeaheadBehaviours:ic(ft([i.getValidationHandler().map(function(e){return Vx.config({getRoot:function(t){return kr(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,n){d.getOpt(t).each(function(t){zr(t.element,"title",c.translate(n))})}},validator:{validate:function(t){var n=Nl.getValue(t);return ZO(function(o){e({type:r.filetype,url:n.value},function(t){var n,e;"invalid"===t.status?(n=dt.error(t.message),o(n)):(e=dt.value(t.message),o(e))})})},validateOnLoad:!1}})}).toArray(),[gv.config({disabled:function(){return r.disabled||c.isDisabled()}}),Jy.config({}),dg("urlinput-events",ft(["file"===r.filetype?[er(po(),function(t){qo(t,ex,{name:r.name})})]:[],[er(ho(),function(t){qo(t,ex,{name:r.name}),s(t)}),er(Co(),function(t){qo(t,ex,{name:r.name}),s(t)})]]))]])),eventOrder:((t={})[po()]=["streaming","urlinput-events","invalidating"],t),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:o.shared.getSink,parts:{menu:wh(0,0,"normal")},onExecute:function(t,n,e){qo(n,ux,{})},onItemExecute:function(t,n,e,o){s(t),qo(t,ex,{name:r.name})}}),f=r.label.map(function(t){return nx(t,c)}),d=gp((n="invalid",e=st.some(u_),void 0===(u="warning")&&(u=n),void 0===a&&(a=n),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+n],innerHtml:hp(u,c.icons),attributes:it({title:c.translate(a),"aria-live":"polite"},e.fold(function(){return{}},function(t){return{id:t}}))}})),m=gp({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[d.asSpec()]}),g=i.getUrlPicker(r.filetype),p=Kr("browser.url.event"),h=gp({dom:{tag:"div",classes:["tox-control-wrap"]},components:[l,m.asSpec()],behaviours:ic([gv.config({disabled:function(){return r.disabled||c.isDisabled()}})])}),v=gp(JC({name:r.name,icon:st.some("browse"),text:r.label.getOr(""),disabled:r.disabled,primary:!1,borderless:!0},function(t){return Yo(t,p)},c,[],["tox-browse-url"]));return Yy.sketch({dom:tx([]),components:f.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:ft([[h.asSpec()],g.map(function(){return v.asSpec()}).toArray()])}]),fieldBehaviours:ic([gv.config({disabled:function(){return r.disabled||c.isDisabled()},onDisabled:function(t){Yy.getField(t).each(gv.disable),v.getOpt(t).each(gv.disable)},onEnabled:function(t){Yy.getField(t).each(gv.enable),v.getOpt(t).each(gv.enable)}}),Lv(),dg("url-input-events",[er(p,function(o){td.getCurrent(o).each(function(n){var t=Nl.getValue(n),e=it({fieldname:r.name},t);g.each(function(t){t(e).get(function(t){Nl.setValue(n,t),qo(o,ex,{name:r.name})})})})})])])})},c_=function(r){return function(n,e,o){return Ft(e,"name").fold(function(){return r(e,o)},function(t){return n.field(t,r(e,o))})}},s_={bar:c_(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:V(e.items,o.interpreter)};var e,o}),collection:c_(function(t,n){return fx(t,n.shared.providers)}),alertbanner:c_(function(t,n){return e=t,o=n.shared.providers,Uy.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+e.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[mp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:hp(e.icon,o.icons),attributes:{title:o.translate(e.iconTooltip)}},action:function(t){qo(t,ix,{name:"alert-banner",value:e.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:o.translate(e.text)}}]});var e,o}),input:c_(function(t,n){return e=t,o=n.shared.providers,PO({name:e.name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:e.disabled,classname:"tox-textfield",validation:st.none(),maximized:e.maximized},o);var e,o}),textarea:c_(function(t,n){return e=t,o=n.shared.providers,PO({name:e.name,multiline:!0,label:e.label,inputMode:st.none(),placeholder:e.placeholder,flex:!0,disabled:e.disabled,classname:"tox-textarea",validation:st.none(),maximized:e.maximized},o);var e,o}),label:c_(function(t,n){return e=t,o=n.shared,r={dom:{tag:"label",innerHtml:o.providers.translate(e.label),classes:["tox-label"]}},i=V(e.items,o.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[r].concat(i),behaviours:ic([ek(),fg.config({}),gk(st.none()),ug.config({mode:"acyclic"})])};var e,o,r,i}),iframe:(TO=function(t,n){return Ok(t,n.shared.providers)},function(t,n,e){var o=zt(n,{source:"dynamic"});return c_(TO)(t,o,e)}),button:c_(function(t,n){return ZC(t,n.shared.providers)}),checkbox:c_(function(t,n){return e=t,o=n.shared.providers,r=Nl.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,n){t.element.dom.checked=n}}}),i=function(t){return t.element.dom.click(),st.some(!0)},u=Yy.parts.field({factory:{sketch:ct},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ic([ek(),gv.config({disabled:function(){return e.disabled||o.isDisabled()}}),Jy.config({}),vg.config({}),r,ug.config({mode:"special",onEnter:i,onSpace:i,stopSpaceKeyup:!0}),dg("checkbox-events",[er(ho(),function(t,n){qo(t,ex,{name:e.name})})])])}),a=Yy.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:o.translate(e.label)},behaviours:ic([nw.config({})])}),s=gp({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[(c=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:hp("checked"===t?"selected":"unselected",o.icons)}}})("checked"),c("unchecked")]}),Yy.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[u,s.asSpec(),a],fieldBehaviours:ic([gv.config({disabled:function(){return e.disabled||o.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){Yy.getField(t).each(gv.disable)},onEnabled:function(t){Yy.getField(t).each(gv.enable)}}),Lv()])});var e,o,r,i,u,a,c,s}),colorinput:c_(function(t,n){return iw(t,n.shared,n.colorinput)}),colorpicker:c_(function(t){var n=function(t){return"tox-"+t},e=nk(uk,n),r=gp(e.sketch({dom:{tag:"div",classes:["tox-color-picker-container"],attributes:{role:"presentation"}},onValidHex:function(t){qo(t,ix,{name:"hex-valid",value:!0})},onInvalidHex:function(t){qo(t,ix,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:ic([Nl.config({store:{mode:"manual",getValue:function(t){var n=r.get(t);return td.getCurrent(n).bind(function(t){return Nl.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,n){var e=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n),o=r.get(t);td.getCurrent(o).fold(function(){console.log("Can not find form")},function(t){Nl.setValue(t,{hex:st.from(e[1]).getOr("")}),qS.getField(t,"hex").each(function(t){Yo(t,po())})})}}}),ek()])}}),dropzone:c_(function(t,n){return hk(t,n.shared.providers)}),grid:c_(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+e.columns+"col"]},components:V(e.items,o.interpreter)};var e,o}),listbox:c_(function(t,n){return o=t,e=(r=n).shared.providers,i=K(o.items).filter(MO),u=o.label.map(function(t){return nx(t,e)}),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[Yy.parts.field({dom:{},factory:{sketch:function(t){return VC({uid:t.uid,text:i.map(function(t){return t.text}),icon:st.none(),tooltip:o.label,role:st.none(),fetch:function(t,n){var e=IO(t,o.name,o.items,Nl.getValue(t));n(jC(e,uh.CLOSE_ON_EXECUTE,r,!1))},onSetup:at($),getApi:at({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Jy.config({}),Nl.config({store:{mode:"manual",initialValue:i.map(function(t){return t.value}).getOr(""),getValue:function(t){return Nr(t.element,FO)},setValue:function(n,t){RO(o.items,t).each(function(t){zr(n.element,FO,t.value),qo(n,IC,{text:t.text})})}}})]},"tox-listbox",r.shared)}}})]},Yy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:ft([u.toArray(),[a]]),fieldBehaviours:ic([gv.config({disabled:at(o.disabled),onDisabled:function(t){Yy.getField(t).each(gv.disable)},onEnabled:function(t){Yy.getField(t).each(gv.enable)}})])});var o,r,e,i,u,a}),selectbox:c_(function(t,n){return e=t,o=n.shared.providers,r=V(e.items,function(t){return{text:o.translate(t.text),value:t.value}}),i=e.label.map(function(t){return nx(t,o)}),u=Yy.parts.field({dom:{},selectAttributes:{size:e.size},options:r,factory:VO,selectBehaviours:ic([gv.config({disabled:function(){return e.disabled||o.isDisabled()}}),Jy.config({}),dg("selectbox-change",[er(ho(),function(t,n){qo(t,ex,{name:e.name})})])])}),a=1<e.size?st.none():st.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:hp("chevron-down",o.icons)}}),c={dom:{tag:"div",classes:["tox-selectfield"]},components:ft([[u],a.toArray()])},Yy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:ft([i.toArray(),[c]]),fieldBehaviours:ic([gv.config({disabled:function(){return e.disabled||o.isDisabled()},onDisabled:function(t){Yy.getField(t).each(gv.disable)},onEnabled:function(t){Yy.getField(t).each(gv.enable)}}),Lv()])});var e,o,r,i,u,a,c}),sizeinput:c_(function(t,n){return cO(t,n.shared.providers)}),urlinput:c_(function(t,n){return a_(t,n,n.urlinput)}),customeditor:c_(function(e){var o=fe(st.none()),n=gp({dom:{tag:e.tag}}),r=fe(st.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ic([dg("custom-editor-events",[sr(function(t){n.getOpt(t).each(function(n){var t;t=e,(Object.prototype.hasOwnProperty.call(t,"init")?e.init(n.element.dom):ak.load(e.scriptId,e.scriptUrl).then(function(t){return t(n.element.dom,e.settings)})).then(function(n){r.get().each(function(t){n.setValue(t)}),r.set(st.none()),o.set(st.some(n))})})})]),Nl.config({store:{mode:"manual",getValue:function(){return o.get().fold(function(){return r.get().getOr("")},function(t){return t.getValue()})},setValue:function(t,n){o.get().fold(function(){r.set(st.some(n))},function(t){return t.setValue(n)})}}}),ek()]),components:[n.asSpec()]}}),htmlpanel:c_(function(t){return"presentation"===t.presets?Uy.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):Uy.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:ic([Jy.config({}),vg.config({})])})}),imagetools:c_(function(t,n){return AO(t,n.shared.providers)}),table:c_(function(t,n){return e=t,o=n.shared.providers,u=function(t){return{dom:{tag:"th",innerHtml:o.translate(t)}}},a=function(t){return{dom:{tag:"td",innerHtml:o.translate(t)}}},c=function(t){return{dom:{tag:"tr"},components:V(t,a)}},{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(i=e.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:V(i,u)}]}),(r=e.cells,{dom:{tag:"tbody"},components:V(r,c)})],behaviours:ic([Jy.config({}),vg.config({})])};var e,o,r,i,u,a,c}),panel:c_(function(t,n){return o=n,{dom:{tag:"div",classes:(e=t).classes},components:V(e.items,o.shared.interpreter)};var e,o})},l_={field:function(t,n){return n}},f_=function(n,t,e){var o=zt(e,{shared:{interpreter:function(t){return d_(n,t,o)}}});return d_(n,t,o)},d_=function(n,e,o){return Ft(s_,e.type).fold(function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e},function(t){return t(n,e,o)})},m_={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},g_=function(t,n,e){var o=Hc(-12,12,m_),r={maxHeightFunction:Fc()};return function(){return e()?{anchor:"node",root:zi(t()),node:st.from(t()),bubble:o,layouts:{onRtl:function(){return[sp]},onLtr:function(){return[cp]}},overrides:r}:{anchor:"hotspot",hotspot:n(),bubble:o,layouts:{onRtl:function(){return[Ha]},onLtr:function(){return[za]}},overrides:r}}},p_=function(t,n,e){return function(){return e()?{anchor:"node",root:zi(t()),node:st.from(t()),layouts:{onRtl:function(){return[lp]},onLtr:function(){return[lp]}}}:{anchor:"hotspot",hotspot:n(),layouts:{onRtl:function(){return[Ua]},onLtr:function(){return[Ua]}}}}},h_=function(t,n,e){var o,r,i,u=Fv(t),a=function(){return me.fromDom(t.getBody())},c=function(){return me.fromDom(t.getContentAreaContainer())},s=function(){return u||!e()};return{inlineDialog:g_(c,n,s),banner:p_(c,n,s),cursor:(r=t,function(){return{anchor:"selection",root:i(),getSelection:function(){var t=r.selection.getRng();return st.some(Qc.range(me.fromDom(t.startContainer),t.startOffset,me.fromDom(t.endContainer),t.endOffset))}}}),node:(o=i=a,function(t){return{anchor:"node",root:o(),node:t}})}},v_=function(t){return{colorPicker:function(t,n){Kb(r)(t,n)},hasCustomColors:function(){return Hb(o)},getColors:function(){return zb(e)},getColorCols:(n=e=o=r=t,function(){return jb(n)})};var n,e,o,r},b_=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],y_=function(t){return N(t,function(t,n){if(It(n,"items")){var e=y_(n.items);return{customFormats:t.customFormats.concat(e.customFormats),formats:t.formats.concat([{title:n.title,items:e.formats}])}}if(It(n,"inline")||It(n,"block")||It(n,"selector")){var o="custom-"+(k(n.name)?n.name:n.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:o,format:n}]),formats:t.formats.concat([{title:n.title,format:o,icon:n.icon}])}}return it(it({},t),{formats:t.formats.concat(n)})},{customFormats:[],formats:[]})},x_=function(i){return t=i,st.from(t.getParam("style_formats")).filter(p).map(function(t){var n,e,o,r=(n=i,e=y_(t),o=function(t){lt(t,function(t){n.formatter.has(t.name)||n.formatter.register(t.name,t.format)})},n.formatter?o(e.customFormats):n.on("init",function(){o(e.customFormats)}),e.formats);return i.getParam("style_formats_merge",!1,"boolean")?b_.concat(r):r}).getOr(b_);var t},w_=function(t,n,e){var o={type:"formatter",isSelected:n(t.format),getStylePreview:e(t.format)};return zt(t,o)},S_=function(c,t,s,l){var f=function(t){return V(t,function(t){var n,e,o,r,i,u=Ct(t);if(Rt(t,"items")){var a=f(t.items);return zt(zt(t,{type:"submenu"}),{getStyleItems:function(){return a}})}return Rt(t,"format")?w_(t,s,l):1===u.length&&M(u,"title")?zt(t,{type:"separator"}):(e=k((n=t).name)?n.name:Kr(n.title),r={type:"formatter",format:o="custom-"+e,isSelected:s(o),getStylePreview:l(o)},i=zt(n,r),c.formatter.register(e,i),i)})};return f(t)},k_=ck.trim,C_=function(n){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===n)return!0;if(t.getAttribute("data-mce-contenteditable")===n)return!0}return!1}},O_=C_("true"),__=C_("false"),T_=function(t,n,e,o,r){return{type:t,title:n,url:e,level:o,attach:r}},E_=function(t){return t.innerText||t.textContent},D_=function(t){return(n=t)&&"A"===n.nodeName&&(n.id||n.name)!==undefined&&A_(t);var n},B_=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},A_=function(t){return function(t){for(;t=t.parentNode;){var n=t.contentEditable;if(n&&"inherit"!==n)return O_(t)}return!1}(t)&&!__(t)},M_=function(t){return B_(t)&&A_(t)},F_=function(t){var n,e,o=(n=t).id?n.id:Kr("h");return T_("header",E_(t),"#"+o,B_(e=t)?parseInt(e.nodeName.substr(1),10):0,function(){t.id=o})},I_=function(t){var n=t.id||t.name,e=E_(t);return T_("anchor",e||"#"+n,"#"+n,0,$)},R_=function(t){var n,e;return n="h1,h2,h3,h4,h5,h6,a:not([href])",e=t,V(ms(me.fromDom(e),n),function(t){return t.dom})},V_=function(t){return 0<k_(t.title).length},P_=function(t){var n=R_(t);return H(V(H(n,M_),F_).concat(V(H(n,D_),I_)),V_)},H_="tinymce-url-history",z_=function(t){return k(t)&&/^https?/.test(t)},N_=function(t){return C(t)&&At(t,function(t){return!(p(n=t)&&n.length<=5&&W(n,z_));var n}).isNone()},L_=function(){var t,n=Fb.getItem(H_);if(null===n)return{};try{t=JSON.parse(n)}catch(e){if(e instanceof SyntaxError)return console.log("Local storage "+H_+" was not valid JSON",e),{};throw e}return N_(t)?t:(console.log("Local storage "+H_+" was not valid format",t),{})},j_=function(t){var n=L_();return Object.prototype.hasOwnProperty.call(n,t)?n[t]:[]},U_=function(n,t){var e,o,r;z_(n)&&(e=L_(),o=Object.prototype.hasOwnProperty.call(e,t)?e[t]:[],r=H(o,function(t){return t!==n}),e[t]=[n].concat(r).slice(0,5),function(t){if(!N_(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));Fb.setItem(H_,JSON.stringify(t))}(e))},W_=function(t){return!!t},G_=function(t){return Tt(ck.makeMap(t,/[, ]/),W_)},X_=function(t){return st.from(t.getParam("file_picker_callback")).filter(_)},Y_=function(t,n){var e,o,r,i,u=(e=t,o=st.some(e.getParam("file_picker_types")).filter(W_),r=st.some(e.getParam("file_browser_callback_types")).filter(W_),i=o.or(r).map(G_),X_(e).fold(function(){return!1},function(t){return i.fold(function(){return!0},function(t){return 0<Ct(t).length&&t})}));return O(u)?u?X_(t):st.none():u[n]?X_(t):st.none()},q_=function(t){return st.from(t).filter(k).getOrUndefined()},K_=function(t){return st.from((e=(n=t).getParam("file_picker_validator_handler",undefined,"function"))===undefined?n.getParam("filepicker_validator_handler",undefined,"function"):e);var n,e},J_=function(n){return{getHistory:j_,addToHistory:U_,getLinkInformation:function(){return!1===(t=n).getParam("typeahead_urls")?st.none():st.some({targets:P_(t.getBody()),anchorTop:q_(t.getParam("anchor_top","#top")),anchorBottom:q_(t.getParam("anchor_bottom","#bottom"))});var t},getValidationHandler:function(){return K_(n)},getUrlPicker:function(t){return Y_(r=n,i=t).map(function(o){return function(n){return Ox(function(e){var t=it({filetype:i,fieldname:n.fieldname},st.from(n.meta).getOr({}));o.call(r,function(t,n){if(!k(t))throw new Error("Expected value to be string");if(n!==undefined&&!C(n))throw new Error("Expected meta to be a object");e({value:t,meta:n})},n.value,t)})}});var r,i}}},$_=function(t,n,e){var o,r,i=fe(!1),u={isPositionedAtTop:function(){return"top"===o.get()},getDockingMode:(o=fe(Av(n)?"bottom":"top")).get,setDockingMode:o.set},a={shared:{providers:{icons:function(){return n.ui.registry.getAll().icons},menuItems:function(){return n.ui.registry.getAll().menuItems},translate:tv.translate,isDisabled:function(){return n.mode.isReadOnly()||n.ui.isDisabled()},getSetting:n.getParam.bind(n)},interpreter:function(t){return d_(l_,t,a)},anchors:h_(n,e,u.isPositionedAtTop),header:u,getSink:function(){return dt.value(t)}},urlinput:J_(n),styleselect:function(o){var r=function(t){return function(){return o.formatter.match(t)}},i=function(n){return function(){var t=o.formatter.get(n);return t!==undefined?st.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:o.dom.parseStyle(o.formatter.getCssText(n))}):st.none()}},u=function(t){var n=t.items;return n!==undefined&&0<n.length?U(n,u):[t.format]},a=fe([]),c=fe([]),e=fe([]),s=fe([]),l=fe(!1);o.on("PreInit",function(t){var n=x_(o),e=S_(o,n,r,i);a.set(e),c.set(U(e,u))}),o.on("addStyleModifications",function(t){var n=S_(o,t.items,r,i);e.set(n),l.set(t.replace),s.set(U(n,u))});return{getData:function(){var t=l.get()?[]:a.get(),n=e.get();return t.concat(n)},getFlattenedKeys:function(){var t=l.get()?[]:c.get(),n=s.get();return t.concat(n)}}}(n),colorinput:v_(n),dialog:{isDraggableModal:(r=n,function(){return r.getParam("draggable_modal",!1,"boolean")})},isContextMenuOpen:function(){return i.get()},setContextMenuState:function(t){return i.set(t)}};return a},Q_=at(function(t,n){var e,o,r;e=t,o=Math.floor(n),r=Ou.max(e,o,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]),qi(e,"max-width",r+"px")}),Z_="contexttoolbar-hide",tT=at([Ln("dom"),ne("shell",!0),Ll("toolbarBehaviours",[fg])]),nT=at([yf({name:"groups",overrides:function(){return{behaviours:ic([fg.config({})])}}})]),eT=qf({name:"Toolbar",configFields:tT(),partFields:nT(),factory:function(n,t,e,o){var r=function(t){return n.shell?st.some(t):Af(t,n,"groups")},i=n.shell?{behaviours:[fg.config({})],components:[]}:{behaviours:[],components:t};return{uid:n.uid,dom:n.dom,components:i.components,behaviours:Ul(n.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,n){r(t).fold(function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(t){fg.set(t,n)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)}}}),oT=function(t,n,e){return{within:t,extra:n,withinWidth:e}},rT=function(t,n,o){var e,r=(e=function(t,n){var e=o(t);return st.some({element:t,start:n,finish:n+e,width:e})},N(t,function(n,t){return e(t,n.len).fold(at(n),function(t){return{len:t.finish,list:n.list.concat([t])}})},{len:0,list:[]}).list),i=H(r,function(t){return t.finish<=n}),u=z(i,function(t,n){return t+n.width},0);return{within:i,extra:r.slice(i.length),withinWidth:u}},iT=function(t){return V(t,function(t){return t.element})},uT=function(t,n,e,o){var r,i,u,a,c,s,l,f,d,m=(0===(r=rT(n,t,e)).extra.length?st.some(r):st.none()).getOrThunk(function(){return rT(n,t-e(o),e)}),g=m.within,p=m.extra,h=m.withinWidth;return 1===p.length&&p[0].width<=e(o)?(l=p,f=h,d=iT(g.concat(l)),oT(d,[],f)):1<=p.length?(u=p,a=o,c=h,s=iT(g).concat([a]),oT(s,iT(u),c)):(i=h,oT(iT(g),[],i))},aT=function(t,n){var e=V(n,function(t){return pu(t)});eT.setGroups(t,e)},cT=function(t,n,e){var o=Mf(t,n,"primary"),r=zx.getCoupled(t,"overflowGroup");qi(o.element,"visibility","hidden");var i=n.builtGroups.get().concat([r]),u=Z(i,function(n){return pc(n.element).bind(function(t){return n.getSystem().getByDom(t).toOptional()})});e([]),aT(o,i);var a=_u(o.element),c=uT(a,n.builtGroups.get(),function(t){return _u(t.element)},r);0===c.extra.length?(fg.remove(o,r),e([])):(aT(o,c.within),e(c.extra)),nu(o.element,"visibility"),eu(o.element),u.each(vg.focus)},sT=at([Ll("splitToolbarBehaviours",[zx]),le("builtGroups",function(){return fe([])})]),lT=at([da(["overflowToggledClass"]),Zn("getOverflowBounds"),Ln("lazySink"),le("overflowGroups",function(){return fe([])})].concat(sT())),fT=at([vf({factory:eT,schema:tT(),name:"primary"}),bf({schema:tT(),name:"overflow"}),bf({name:"overflow-button"}),bf({name:"overflow-group"})]),dT=at([da(["toggledClass"]),Ln("lazySink"),Gn("fetch"),Zn("getBounds"),te("fireDismissalEventInstead",[ne("event",zo())]),Wc()]),mT=at([bf({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:ic([Dg.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),bf({factory:eT,schema:tT(),name:"toolbar",overrides:function(n){return{toolbarBehaviours:ic([ug.config({mode:"cyclic",onEscape:function(t){return Af(t,n,"button").each(vg.focus),st.none()}})])}}})]),gT=function(t,n){var e=zx.getCoupled(t,"toolbarSandbox");xl.isOpen(e)?xl.close(e):xl.open(e,n.toolbar())},pT=function(t,n,e,o){var r=e.getBounds.map(function(t){return t()}),i=e.lazySink(t).getOrDie();Qs.positionWithinBounds(i,{anchor:"hotspot",hotspot:t,layouts:o,overrides:{maxWidthFunction:Q_()}},n,r)},hT=function(t,n,e,o,r){eT.setGroups(n,r),pT(t,n,e,o),Dg.on(t)},vT=qf({name:"FloatingToolbarButton",factory:function(u,t,a,n){return it(it({},mp.sketch(it(it({},n.button()),{action:function(t){gT(t,n)},buttonBehaviours:Gl({dump:n.button().buttonBehaviours},[zx.config({others:{toolbarSandbox:function(t){return o=t,e=a,r=u,{dom:{tag:"div",attributes:{id:(i=$u()).id}},behaviours:ic([ug.config({mode:"special",onEscape:function(t){return xl.close(t),st.some(!0)}}),xl.config({onOpen:function(t,n){r.fetch().get(function(t){hT(o,n,r,e.layouts,t),i.link(o.element),ug.focusIn(n)})},onClose:function(){Dg.off(o),vg.focus(o),i.unlink(o.element)},isPartOf:function(t,n,e){return Zu(n,e)||Zu(o,e)},getAttachPoint:function(){return r.lazySink(o).getOrDie()}}),fc.config({channels:it(it({},Ol(it({isExtraPart:c},r.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Tl({doReposition:function(){xl.getState(zx.getCoupled(o,"toolbarSandbox")).each(function(t){pT(o,t,r,e.layouts)})}}))})])};var o,e,r,i}}})])}))),{apis:{setGroups:function(n,e){xl.getState(zx.getCoupled(n,"toolbarSandbox")).each(function(t){hT(n,t,u,a.layouts,e)})},reposition:function(n){xl.getState(zx.getCoupled(n,"toolbarSandbox")).each(function(t){pT(n,t,u,a.layouts)})},toggle:function(t){gT(t,n)},getToolbar:function(t){return xl.getState(zx.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return xl.isOpen(zx.getCoupled(t,"toolbarSandbox"))}}})},configFields:dT(),partFields:mT(),apis:{setGroups:function(t,n,e){t.setGroups(n,e)},reposition:function(t,n){t.reposition(n)},toggle:function(t,n){t.toggle(n)},getToolbar:function(t,n){return t.getToolbar(n)},isOpen:function(t,n){return t.isOpen(n)}}}),bT=at([Ln("items"),da(["itemSelector"]),Ll("tgroupBehaviours",[ug])]),yT=at([xf({name:"items",unit:"item"})]),xT=qf({name:"ToolbarGroup",configFields:bT(),partFields:yT(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,behaviours:Ul(t.tgroupBehaviours,[ug.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),wT=function(t){return V(t,function(t){return pu(t)})},ST=function(t,e,o){cT(t,o,function(n){o.overflowGroups.set(n),e.getOpt(t).each(function(t){vT.setGroups(t,wT(n))})})},kT=qf({name:"SplitFloatingToolbar",configFields:lT(),partFields:fT(),factory:function(e,t,n,o){var r=gp(vT.sketch({fetch:function(){return Ox(function(t){t(wT(e.overflowGroups.get()))})},layouts:{onLtr:function(){return[za,Ha]},onRtl:function(){return[Ha,za]},onBottomLtr:function(){return[La,Na]},onBottomRtl:function(){return[Na,La]}},getBounds:n.getOverflowBounds,lazySink:e.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:e.markers.overflowToggledClass},parts:{button:o["overflow-button"](),toolbar:o.overflow()}}));return{uid:e.uid,dom:e.dom,components:t,behaviours:Ul(e.splitToolbarBehaviours,[zx.config({others:{overflowGroup:function(){return xT.sketch(it(it({},o["overflow-group"]()),{items:[r.asSpec()]}))}}})]),apis:{setGroups:function(t,n){e.builtGroups.set(V(n,t.getSystem().build)),ST(t,r,e)},refresh:function(t){return ST(t,r,e)},toggle:function(t){r.getOpt(t).each(function(t){vT.toggle(t)})},isOpen:function(t){return r.getOpt(t).map(vT.isOpen).getOr(!1)},reposition:function(t){r.getOpt(t).each(function(t){vT.reposition(t)})},getOverflow:function(t){return r.getOpt(t).bind(vT.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},reposition:function(t,n){t.reposition(n)},toggle:function(t,n){t.toggle(n)},isOpen:function(t,n){return t.isOpen(n)},getOverflow:function(t,n){return t.getOverflow(n)}}}),CT=function(n,t){return t.getAnimationRoot.fold(function(){return n.element},function(t){return t(n)})},OT=function(t){return t.dimension.property},_T=function(t,n){return t.dimension.getDimension(n)},TT=function(t,n){var e=CT(t,n);Fi(e,[n.shrinkingClass,n.growingClass])},ET=function(t,n){Bi(t.element,n.openClass),Ei(t.element,n.closedClass),qi(t.element,OT(n),"0px"),eu(t.element)},DT=function(t,n){Bi(t.element,n.closedClass),Ei(t.element,n.openClass),nu(t.element,OT(n))},BT=function(t,n,e,o){e.setCollapsed(),qi(t.element,OT(n),_T(n,t.element)),eu(t.element),TT(t,n),ET(t,n),n.onStartShrink(t),n.onShrunk(t)},AT=function(t,n,e,o){var r=o.getOrThunk(function(){return _T(n,t.element)});e.setCollapsed(),qi(t.element,OT(n),r),eu(t.element);var i=CT(t,n);Bi(i,n.growingClass),Ei(i,n.shrinkingClass),ET(t,n),n.onStartShrink(t)},MT=function(t,n,e){var o=_T(n,t.element);("0px"===o?BT:AT)(t,n,e,st.some(o))},FT=function(t,n,e){var o=CT(t,n),r=Ai(o,n.shrinkingClass),i=_T(n,t.element);DT(t,n);var u=_T(n,t.element);(r?function(){qi(t.element,OT(n),i),eu(t.element)}:function(){ET(t,n)})(),Bi(o,n.shrinkingClass),Ei(o,n.growingClass),DT(t,n),qi(t.element,OT(n),u),e.setExpanded(),n.onStartGrow(t)},IT=function(t,n,e){var o=CT(t,n);return!0===Ai(o,n.growingClass)},RT=function(t,n,e){var o=CT(t,n);return!0===Ai(o,n.shrinkingClass)},VT=/* */Object.freeze({__proto__:null,refresh:function(t,n,e){var o;e.isExpanded()&&(nu(t.element,OT(n)),o=_T(n,t.element),qi(t.element,OT(n),o))},grow:function(t,n,e){e.isExpanded()||FT(t,n,e)},shrink:function(t,n,e){e.isExpanded()&&MT(t,n,e)},immediateShrink:function(t,n,e){e.isExpanded()&&BT(t,n,e,st.none())},hasGrown:function(t,n,e){return e.isExpanded()},hasShrunk:function(t,n,e){return e.isCollapsed()},isGrowing:IT,isShrinking:RT,isTransitioning:function(t,n,e){return!0===IT(t,n)||!0===RT(t,n)},toggleGrow:function(t,n,e){(e.isExpanded()?MT:FT)(t,n,e)},disableTransitions:TT}),PT=/* */Object.freeze({__proto__:null,exhibit:function(t,n,e){var o=n.expanded;return gi(o?{classes:[n.openClass],styles:{}}:{classes:[n.closedClass],styles:Jt(n.dimension.property,"0px")})},events:function(e,o){return Zo([cr(bo(),function(t,n){n.event.raw.propertyName===e.dimension.property&&(TT(t,e),o.isExpanded()&&nu(t.element,e.dimension.property),(o.isExpanded()?e.onGrown:e.onShrunk)(t))})])}}),HT=[Ln("closedClass"),Ln("openClass"),Ln("shrinkingClass"),Ln("growingClass"),Kn("getAnimationRoot"),ga("onShrunk"),ga("onStartShrink"),ga("onGrown"),ga("onStartGrow"),ne("expanded",!1),jn("dimension",An("property",{width:[ba("property","width"),ba("getDimension",function(t){return _u(t)+"px"})],height:[ba("property","height"),ba("getDimension",function(t){return bu(t)+"px"})]}))],zT=ac({fields:HT,name:"sliding",active:PT,apis:VT,state:/* */Object.freeze({__proto__:null,init:function(t){var n=fe(t.expanded);return di({isExpanded:function(){return!0===n.get()},isCollapsed:function(){return!1===n.get()},setCollapsed:y(n.set,!1),setExpanded:y(n.set,!0),readState:function(){return"expanded: "+n.get()}})}})}),NT=at([da(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),ga("onOpened"),ga("onClosed")].concat(sT())),LT=at([vf({factory:eT,schema:tT(),name:"primary"}),vf({factory:eT,schema:tT(),name:"overflow",overrides:function(n){return{toolbarBehaviours:ic([zT.config({dimension:{property:"height"},closedClass:n.markers.closedClass,openClass:n.markers.openClass,shrinkingClass:n.markers.shrinkingClass,growingClass:n.markers.growingClass,onShrunk:function(t){Af(t,n,"overflow-button").each(function(t){Dg.off(t),vg.focus(t)}),n.onClosed(t)},onGrown:function(t){ug.focusIn(t),n.onOpened(t)},onStartGrow:function(t){Af(t,n,"overflow-button").each(Dg.on)}}),ug.config({mode:"acyclic",onEscape:function(t){return Af(t,n,"overflow-button").each(vg.focus),st.some(!0)}})])}}}),bf({name:"overflow-button",overrides:function(t){return{buttonBehaviours:ic([Dg.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),bf({name:"overflow-group"})]),jT=function(n,e){Af(n,e,"overflow-button").bind(function(){return Af(n,e,"overflow")}).each(function(t){UT(n,e),zT.toggleGrow(t)})},UT=function(t,n){Af(t,n,"overflow").each(function(e){cT(t,n,function(t){var n=V(t,function(t){return pu(t)});eT.setGroups(e,n)}),Af(t,n,"overflow-button").each(function(t){zT.hasGrown(e)&&Dg.on(t)}),zT.refresh(e)})},WT=qf({name:"SplitSlidingToolbar",configFields:NT(),partFields:LT(),factory:function(o,t,n,e){var r="alloy.toolbar.toggle";return{uid:o.uid,dom:o.dom,components:t,behaviours:Ul(o.splitToolbarBehaviours,[zx.config({others:{overflowGroup:function(n){return xT.sketch(it(it({},e["overflow-group"]()),{items:[mp.sketch(it(it({},e["overflow-button"]()),{action:function(t){Yo(n,r)}}))]}))}}}),dg("toolbar-toggle-events",[er(r,function(t){jT(t,o)})])]),apis:{setGroups:function(t,n){var e;e=V(n,t.getSystem().build),o.builtGroups.set(e),UT(t,o)},refresh:function(t){return UT(t,o)},toggle:function(t){return jT(t,o)},isOpen:function(t){return Af(t,o,"overflow").map(zT.hasGrown).getOr(!1)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},toggle:function(t,n){t.toggle(n)},isOpen:function(t,n){return t.isOpen(n)}}}),GT=at(Kr("toolbar-height-change")),XT=function(t){var n=t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}});return{dom:it({tag:"div",classes:["tox-toolbar__group"]},n),components:[xT.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:ic([Jy.config({}),vg.config({})])}},YT=function(t){return xT.sketch(XT(t))},qT=function(e,t){var n=sr(function(t){var n=V(e.initGroups,YT);eT.setGroups(t,n)});return ic([Gv(e.providers.isDisabled),Lv(),ug.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),dg("toolbar-events",[n])])},KT=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":XT({title:st.none(),items:[]}),"overflow-button":YC({name:"more",icon:st.some("more-drawer"),disabled:!1,tooltip:st.some("More..."),primary:!1,borderless:!1},st.none(),t.providers)},splitToolbarBehaviours:qT(t,n)}},JT=function(i){var t=KT(i),n=kT.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return kT.sketch(it(it({},t),{lazySink:i.getSink,getOverflowBounds:function(){var t=i.moreDrawerData.lazyHeader().element,n=Nu(t),e=wr(t),o=Nu(e),r=Math.max(e.dom.scrollHeight,o.height);return Hu(n.x+4,o.y,n.width-8,r)},parts:it(it({},t.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:i.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},$T=function(t){var n=WT.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),e=WT.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=KT(t);return WT.sketch(it(it({},o),{components:[n,e],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([GT()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([GT()],{type:"closed"})}}))},QT=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return eT.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===rh.scrolling?["tox-toolbar--scrolling"]:[])},components:[eT.parts.groups({})],toolbarBehaviours:qT(t,n)})},ZT=fn([Un("type"),jn("items",mn([Sn([Un("name"),qn("items",Rn)]),Rn]))].concat(Up)),tE=[Qn("text"),Qn("tooltip"),Qn("icon"),Gn("fetch"),ae("onSetup",function(){return $})],nE=fn(S([Un("type")],tE)),eE=function(t){return _n("menubutton",nE,t)},oE=fn([Un("type"),Qn("tooltip"),Qn("icon"),Qn("text"),Zn("select"),Gn("fetch"),ae("onSetup",function(){return $}),ie("presets","normal",["normal","color","listpreview"]),ne("columns",1),Gn("onAction"),Gn("onItemAction")]),rE=/* */Object.freeze({__proto__:null,events:function(i,u){var r=function(o,r){i.updateState.each(function(t){var n=t(o,r);u.set(n)}),i.renderComponents.each(function(t){var n=t(r,u.get()),e=V(n,o.getSystem().build);el(o,e)})};return Zo([er(Oo(),function(t,n){var e,o=n;o.universal||(e=i.channel,M(o.channels,e)&&r(t,o.data))}),sr(function(n,t){i.initialData.each(function(t){r(n,t)})})])}}),iE=/* */Object.freeze({__proto__:null,getState:function(t,n,e){return e}}),uE=[Ln("channel"),Kn("renderComponents"),Kn("updateState"),Kn("initialData")],aE=ac({fields:uE,name:"reflecting",active:rE,apis:iE,state:/* */Object.freeze({__proto__:null,init:function(){var n=fe(st.none());return{readState:function(){return n.get().fold(function(){return"none"},function(t){return t})},get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(st.none())}}}})}),cE=at([Ln("toggleClass"),Ln("fetch"),ha("onExecute"),ne("getHotspot",st.some),ne("getAnchorOverrides",at({})),Wc(),ha("onItemExecute"),Kn("lazySink"),Ln("dom"),ga("onOpen"),Ll("splitDropdownBehaviours",[zx,ug,vg]),ne("matchWidth",!1),ne("useMinWidth",!1),ne("eventOrder",{}),Kn("role")].concat($x())),sE=vf({factory:mp,schema:[Ln("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:ic([vg.revoke()])}},overrides:function(n){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(n.uid).each(Ko)},buttonBehaviours:ic([Dg.config({toggleOnExecute:!1,toggleClass:n.toggleClass})])}}}),lE=vf({factory:mp,schema:[Ln("dom")],name:"button",defaults:function(){return{buttonBehaviours:ic([vg.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(e.uid).each(function(t){e.onExecute(t,n)})}}}}),fE=at([sE,lE,yf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ln("text")],name:"aria-descriptor"}),bf({schema:[fa()],name:"menu",defaults:function(o){return{onExecute:function(n,e){n.getSystem().getByUid(o.uid).each(function(t){o.onItemExecute(t,n,e)})}}}}),Lx()]),dE=qf({name:"SplitDropdown",configFields:cE(),partFields:fE(),factory:function(o,t,n,e){var r,i=function(t){td.getCurrent(t).each(function(t){fd.highlightFirst(t),ug.focusIn(t)})},u=function(t){Gx(o,function(t){return t},t,e,i,bx.HighlightFirst).get($)},a=function(t){var n=Mf(t,o,"button");return Ko(n),st.some(!0)},c=it(it({},Zo([sr(function(e,t){Af(e,o,"aria-descriptor").each(function(t){var n=Kr("aria");zr(t.element,"id",n),zr(e.element,"aria-describedby",n)})})])),Ag(st.some(u))),s={repositionMenus:function(t){Dg.isOn(t)&&Jx(t)}};return{uid:o.uid,dom:o.dom,components:t,apis:s,eventOrder:it(it({},o.eventOrder),((r={})[_o()]=["disabling","toggling","alloy.base.behaviour"],r)),events:c,behaviours:Ul(o.splitDropdownBehaviours,[zx.config({others:{sandbox:function(t){var n=Mf(t,o,"arrow");return Kx(o,t,{onOpen:function(){Dg.on(n),Dg.on(t)},onClose:function(){Dg.off(n),Dg.off(t)}})}}}),ug.config({mode:"special",onSpace:a,onEnter:a,onDown:function(t){return u(t),st.some(!0)}}),vg.config({}),Dg.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,n){return t.repositionMenus(n)}}}),mE=function(n){return{isDisabled:function(){return gv.isDisabled(n)},setDisabled:function(t){return gv.set(n,t)}}},gE=function(n){return{setActive:function(t){Dg.set(n,t)},isActive:function(){return Dg.isOn(n)},isDisabled:function(){return gv.isDisabled(n)},setDisabled:function(t){return gv.set(n,t)}}},pE=function(t,n){return t.map(function(t){return{"aria-label":n.translate(t),title:n.translate(t)}}).getOr({})},hE=Kr("focus-button"),vE=["checklist","ordered-list"],bE=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],yE=function(n,e,t,o,r,i){var u,a=function(t){return tv.isRtl()&&M(vE,t)?t+"-rtl":t},c=tv.isRtl()&&n.exists(function(t){return M(bE,t)});return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:pE(t,i)},components:Jv([n.map(function(t){return DC(a(t),i.icons)}),e.map(function(t){return AC(t,"tox-tbtn",i)})]),eventOrder:((u={})[io()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:ic([Gv(i.isDisabled),Lv(),dg("common-button-display-events",[er(io(),function(t,n){n.event.prevent(),Yo(t,hE)})])].concat(o.map(function(t){return aE.config({channel:t,initialData:{icon:n,text:e},renderComponents:function(t,n){return Jv([t.icon.map(function(t){return DC(a(t),i.icons)}),t.text.map(function(t){return AC(t,"tox-tbtn",i)})])}})}).toArray()).concat(r.getOr([])))}},xE=function(t,n,e){var o,r=fe($),i=yE(t.icon,t.text,t.tooltip,st.none(),st.none(),e);return mp.sketch({dom:i.dom,components:i.components,eventOrder:FC,buttonBehaviours:ic([dg("toolbar-button-events",[(o={onAction:t.onAction,getApi:n.getApi},dr(function(n,t){Xv(o,n)(function(t){qo(n,MC,{buttonApi:t}),o.onAction(t)})})),Yv(n,r),qv(n,r)]),Gv(function(){return t.disabled||e.isDisabled()}),Lv()].concat(n.toolbarButtonBehaviours))})},wE=function(t,n,e){return xE(t,{toolbarButtonBehaviours:[].concat(0<e.length?[dg("toolbarButtonWith",e)]:[]),getApi:mE,onSetup:t.onSetup},n)},SE=function(t,n,e){return zt(xE(t,{toolbarButtonBehaviours:[fg.config({}),Dg.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<e.length?[dg("toolbarToggleButtonWith",e)]:[]),getApi:gE,onSetup:t.onSetup},n))},kE=function(n,t){var e,o,r,i,u=Kr("channel-update-split-dropdown-display"),a=function(e){return{isDisabled:function(){return gv.isDisabled(e)},setDisabled:function(t){return gv.set(e,t)},setIconFill:function(t,n){Ku(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){zr(t,"fill",n)})},setIconStroke:function(t,n){Ku(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){zr(t,"stroke",n)})},setActive:function(n){zr(e.element,"aria-pressed",n),Ku(e.element,"span").each(function(t){e.getSystem().getByDom(t).each(function(t){return Dg.set(t,n)})})},isActive:function(){return Ku(e.element,"span").exists(function(t){return e.getSystem().getByDom(t).exists(Dg.isOn)})}}},c=fe($),s={getApi:a,onSetup:n.onSetup};return dE.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:it({"aria-pressed":!1},pE(n.tooltip,t.providers))},onExecute:function(t){n.onAction(a(t))},onItemExecute:function(t,n,e){},splitDropdownBehaviours:ic([Wv(t.providers.isDisabled),Lv(),dg("split-dropdown-events",[er(hE,vg.focus),Yv(s,c),qv(s,c)]),nw.config({})]),eventOrder:((e={})[Po()]=["alloy.base.behaviour","split-dropdown-events"],e),toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:(o=a,r=n,i=t.providers,function(n){return Ox(function(t){return r.fetch(t)}).map(function(t){return st.from(hy(zt(Jb(Kr("menu-value"),t,function(t){r.onItemAction(o(n),t)},r.columns,r.presets,uh.CLOSE_ON_EXECUTE,r.select.getOr(function(){return!1}),i),{movement:Qb(r.columns,r.presets),menuBehaviours:Wh("auto"!==r.columns?[]:[sr(function(o,t){jh(o,4,vh(r.presets)).each(function(t){var n=t.numRows,e=t.numColumns;ug.setGridSize(o,n,e)})})])})))})}),parts:{menu:wh(0,n.columns,n.presets)},components:[dE.parts.button(yE(n.icon,n.text,st.none(),st.some(u),st.some([Dg.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),dE.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:hp("chevron-down",t.providers.icons)},buttonBehaviours:ic([Wv(t.providers.isDisabled),Lv()])}),dE.parts["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})},CE=function(i,u){return er(MC,function(t,n){var e,o=i.get(t),r=(e=o,{hide:function(){return Yo(e,Bo())},getValue:function(){return Nl.getValue(e)}});u.onAction(r,n.event.buttonApi)})},OE=function(t,n,e){var o,r,i,u,a,c,s,l,f,d,m,g,p={backstage:{shared:{providers:e}}};return"contextformtogglebutton"===n.type?(s=t,f=p,(d=(l=n).original).primary,m=w(d,["primary"]),g=Tn(qp(it(it({},m),{type:"togglebutton",onAction:function(){}}))),SE(g,f.backstage.shared.providers,[CE(s,l)])):(o=t,i=p,(u=(r=n).original).primary,a=w(u,["primary"]),c=Tn(Gp(it(it({},a),{type:"button",onAction:function(){}}))),wE(c,i.backstage.shared.providers,[CE(o,r)]))},_E=function(t,n){var e,o,r,i,u=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),a=gp(px.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:u,selectOnFocus:!0,inputBehaviours:ic([ug.config({mode:"special",onEnter:function(t){return c.findPrimary(t).map(function(t){return Ko(t),!0})},onLeft:function(t,n){return n.cut(),st.none()},onRight:function(t,n){return n.cut(),st.none()}})])})),c=(e=a,o=t.commands,r=n,i=V(o,function(t){return gp(OE(e,t,r))}),{asSpecs:function(){return V(i,function(t){return t.asSpec()})},findPrimary:function(e){return Z(o,function(t,n){return t.primary?st.from(i[n]).bind(function(t){return t.getOpt(e)}).filter(x(gv.isDisabled)):st.none()})}});return[{title:st.none(),items:[a.asSpec()]},{title:st.none(),items:c.asSpecs()}]},TE=_E,EE=function(t,n){var e,o,r,i,u,a=Iu(window),c=zu(me.fromDom(t.getContentAreaContainer())),s=Sv(t)||kv(t)||Ov(t),l=(e=c,o=a,r=Math.max(o.x,e.x),i=e.right-r,u=o.width-(r-o.x),{x:r,width:Math.min(i,u)}),f=l.x,d=l.width;if(t.inline&&!s)return Hu(f,a.y,d,a.height);var m=function(t,n,e,o){var r=me.fromDom(t.getContainer()),i=Ku(r,".tox-editor-header").getOr(r),u=zu(i),a=u.y>=n.bottom,c=o&&!a;if(t.inline&&c)return{y:Math.max(u.bottom,e.y),bottom:e.bottom};if(t.inline&&!c)return{y:e.y,bottom:Math.min(u.y,e.bottom)};var s=zu(r);return c?{y:Math.max(u.bottom,e.y),bottom:Math.min(s.bottom,e.bottom)}:{y:Math.max(s.y,e.y),bottom:Math.min(u.y,e.bottom)}}(t,c,a,n.header.isPositionedAtTop()),g=m.y,p=m.bottom;return Hu(f,g,d,p-g)},DE=function(n,t){var e=H(t,function(t){return t.predicate(n.dom)}),o=P(e,function(t){return"contexttoolbar"===t.type});return{contextToolbars:o.pass,contextForms:o.fail}},BE=function(t,n,e){var o=DE(t,n);if(0<o.contextForms.length)return st.some({elem:t,toolbars:[o.contextForms[0]]});var r=DE(t,e);if(0<r.contextForms.length)return st.some({elem:t,toolbars:[r.contextForms[0]]});if(0<o.contextToolbars.length||0<r.contextToolbars.length){var i=function(t){if(t.length<=1)return t;var n=function(n){return F(t,function(t){return t.position===n})},e=function(n){return H(t,function(t){return t.position===n})},o=n("selection"),r=n("node");if(o||r){if(r&&o){var i=e("node"),u=V(e("selection"),function(t){return it(it({},t),{position:"node"})});return i.concat(u)}return e(o?"selection":"node")}return e("line")}(o.contextToolbars.concat(r.contextToolbars));return st.some({elem:t,toolbars:i})}return st.none()},AE=function(t,n,i){return t(n)?st.none():Ke(n,function(t){var n=DE(t,i.inNodeScope),e=n.contextToolbars,o=n.contextForms,r=0<o.length?o:function(t){if(t.length<=1)return t;var n=function(n){return L(t,function(t){return t.position===n})};return n("selection").orThunk(function(){return n("node")}).orThunk(function(){return n("line")}).map(function(t){return t.position}).fold(function(){return[]},function(n){return H(t,function(t){return t.position===n})})}(e);return 0<r.length?st.some({elem:t,toolbars:r}):st.none()},t)},ME=function(e,r){var t={},i=[],u=[],a={},c={},o=function(n,e){var o=Tn(_n("ContextForm",nh,e));(t[n]=o).launch.map(function(t){a["form:"+n]=it(it({},e.launch),{type:"contextformtogglebutton"===t.type?"togglebutton":"button",onAction:function(){r(o)}})}),"editor"===o.scope?u.push(o):i.push(o),c[n]=o},s=function(n,e){_n("ContextToolbar",eh,e).each(function(t){"editor"===e.scope?u.push(t):i.push(t),c[n]=t})},n=Ct(e);return lt(n,function(t){var n=e[t];"contextform"===n.type?o(t,n):"contexttoolbar"===n.type&&s(t,n)}),{forms:t,inNodeScope:i,inEditorScope:u,lookupTable:c,formNavigators:a}},FE=Kr("forward-slide"),IE=Kr("backward-slide"),RE=Kr("change-slide-event"),VE="tox-pop--resizing",PE=function(t,n,e){var u,a,r,c,s,o=e.dataset,i="basic"===o.type?function(){return V(o.data,function(t){return w_(t,e.isSelectedFor,e.getPreviewFor)})}:o.getData;return{items:(u=n,a=e,r=function(t,n,e,o){var r=u.shared.providers.translate(t.title);if("separator"===t.type)return st.some({type:"separator",text:r});if("submenu"!==t.type)return st.some(it({type:"togglemenuitem",text:r,icon:t.icon,active:t.isSelected(o),disabled:e,onAction:a.onAction(t)},t.getStylePreview().fold(function(){return{}},function(t){return{meta:{style:t}}})));var i=U(t.getStyleItems(),function(t){return c(t,n,o)});return 0===n&&i.length<=0?st.none():st.some({type:"nestedmenuitem",text:r,disabled:i.length<=0,getSubmenuItems:function(){return U(t.getStyleItems(),function(t){return c(t,n,o)})}})},c=function(t,n,e){var o="formatter"===t.type&&a.isInvalid(t);return 0===n?o?[]:r(t,n,!1,e).toArray():r(t,n,o,e).toArray()},{validateItems:s=function(t){var n=a.getCurrentValue(),e=a.shouldHide?0:1;return U(t,function(t){return c(t,e,n)})},getFetch:function(r,i){return function(t,n){var e=i(),o=s(e);n(jC(o,uh.CLOSE_ON_EXECUTE,r,!1))}}}),getStyleItems:i}},HE=function(o,t,n){var e=PE(0,t,n),r=e.items,i=e.getStyleItems;return VC({text:n.icon.isSome()?st.none():st.some(""),icon:n.icon,tooltip:st.from(n.tooltip),role:st.none(),fetch:r.getFetch(t,i),onSetup:function(e){return n.setInitialValue.each(function(t){return t(e.getComponent())}),n.nodeChangeHandler.map(function(t){var n=t(e.getComponent());return o.on("NodeChange",n),function(){o.off("NodeChange",n)}}).getOr($)},getApi:function(t){return{getComponent:function(){return t}}},columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",t.shared)};(DO=EO=EO||{})[DO.SemiColon=0]="SemiColon",DO[DO.Space=1]="Space";var zE,NE,LE,jE,UE,WE,GE=function(t,n,e,o){var r,i,u=t.getParam(n,e,"string");return{type:"basic",data:(i=u,r=o===EO.SemiColon?i.replace(/;$/,"").split(";"):i.split(" "),V(r,function(t){var n=t,e=t,o=t.split("=");return 1<o.length&&(n=o[0],e=o[1]),{title:n,format:e}}))}},XE=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],YE=function(e){var n=function(t){var n=L(XE,function(t){return e.formatter.match(t.format)}).fold(function(){return"left"},function(t){return t.title.toLowerCase()});qo(t,RC,{icon:"align-"+n})},t=st.some(function(t){return function(){return n(t)}}),o=st.some(n),r={type:"basic",data:XE};return{tooltip:"Align",icon:st.some("align-left"),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:st.none,getPreviewFor:function(t){return function(){return st.none()}},onAction:function(n){return function(){return L(XE,function(t){return t.format===n.format}).each(function(t){return e.execCommand(t.command)})}},setInitialValue:o,nodeChangeHandler:t,dataset:r,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},qE=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],KE=function(t){var n=t.split(/\s*,\s*/);return V(n,function(t){return t.replace(/^['"]+|['"]+$/g,"")})},JE=function(t){var n;return 0===t.indexOf("-apple-system")&&(n=KE(t.toLowerCase()),W(qE,function(t){return-1<n.indexOf(t.toLowerCase())}))},$E=function(r){var i=function(){var e=function(t){return t?KE(t)[0]:""},t=r.queryCommandValue("FontName"),n=u.data,o=t?t.toLowerCase():"";return{matchOpt:L(n,function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()}).orThunk(function(){return JE(o)?st.from({title:"System Font",format:o}):st.none()}),font:t}},n=function(t){var n=i(),e=n.matchOpt,o=n.font,r=e.fold(function(){return o},function(t){return t.title});qo(t,IC,{text:r})},t=st.some(function(t){return function(){return n(t)}}),e=st.some(n),u=GE(r,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",EO.SemiColon);return{tooltip:"Fonts",icon:st.none(),isSelectedFor:function(n){return function(t){return t.exists(function(t){return t.format===n})}},getCurrentValue:function(){return i().matchOpt},getPreviewFor:function(t){return function(){return st.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(t){return function(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,t.format)})}},setInitialValue:e,nodeChangeHandler:t,dataset:u,shouldHide:!1,isInvalid:function(){return!1}}},QE={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},ZE={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},tD=function(t,n){return/[0-9.]+px$/.test(t)?(e=72*parseInt(t,10)/96,o=n||0,r=Math.pow(10,o),Math.round(e*r)/r+"pt"):Ft(ZE,t).getOr(t);var e,o,r},nD=function(e){var i=function(){var o=st.none(),r=u.data,i=e.queryCommandValue("FontSize");if(i)for(var t=function(t){var n=tD(i,t),e=Ft(QE,n).getOr("");o=L(r,function(t){return t.format===i||t.format===n||t.format===e})},n=3;o.isNone()&&0<=n;n--)t(n);return{matchOpt:o,size:i}},t=at(st.none),n=function(t){var n=i(),e=n.matchOpt,o=n.size,r=e.fold(function(){return o},function(t){return t.title});qo(t,IC,{text:r})},o=st.some(function(t){return function(){return n(t)}}),r=st.some(n),u=GE(e,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",EO.Space);return{tooltip:"Font sizes",icon:st.none(),isSelectedFor:function(n){return function(t){return t.exists(function(t){return t.format===n})}},getPreviewFor:t,getCurrentValue:function(){return i().matchOpt},onAction:function(t){return function(){e.undoManager.transact(function(){e.focus(),e.execCommand("FontSize",!1,t.format)})}},setInitialValue:r,nodeChangeHandler:o,dataset:u,shouldHide:!1,isInvalid:function(){return!1}}},eD=function(t,n){var e=n(),o=V(e,function(t){return t.format});return st.from(t.formatter.closest(o)).bind(function(n){return L(e,function(t){return t.format===n})}).orThunk(function(){return Jf(t.formatter.match("p"),{title:"Paragraph",format:"p"})})},oD=function(t){var n=fe(st.none()),e=function(){return n.get().each(t)};return{clear:function(){e(),n.set(st.none())},isSet:function(){return n.get().isSome()},set:function(t){e(),n.set(st.some(t))}}},rD=function(){return oD(function(t){return t.destroy()})},iD=function(){return oD(function(t){return t.unbind()})},uD=function(o,r){return function(n){var e=iD(),t=function(){n.setActive(o.formatter.match(r));var t=o.formatter.formatChanged(r,n.setActive);e.set(t)};return o.initialized?t():o.on("init",t),e.clear}},aD=function(n){return function(t){return function(){n.undoManager.transact(function(){n.focus(),n.execCommand("mceToggleFormat",!1,t.format)})}}},cD=function(e){var n=function(t){var n=eD(e,function(){return r.data}).fold(function(){return"Paragraph"},function(t){return t.title});qo(t,IC,{text:n})},t=st.some(function(t){return function(){return n(t)}}),o=st.some(n),r=GE(e,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",EO.SemiColon);return{tooltip:"Blocks",icon:st.none(),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:st.none,getPreviewFor:function(n){return function(){var t=e.formatter.get(n);return st.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(n))})}},onAction:aD(e),setInitialValue:o,nodeChangeHandler:t,dataset:r,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},sD=function(r,t){var n=function(t){var e=function(t){var n=t.items;return n!==undefined&&0<n.length?U(n,e):[{title:t.title,format:t.format}]},n=U(x_(r),e),o=eD(r,function(){return n}).fold(function(){return"Paragraph"},function(t){return t.title});qo(t,IC,{text:o})},e=st.some(function(t){return function(){return n(t)}}),o=st.some(n);return{tooltip:"Formats",icon:st.none(),isSelectedFor:function(t){return function(){return r.formatter.match(t)}},getCurrentValue:st.none,getPreviewFor:function(n){return function(){var t=r.formatter.get(n);return t!==undefined?st.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:r.dom.parseStyle(r.formatter.getCssText(n))}):st.none()}},onAction:aD(r),setInitialValue:o,nodeChangeHandler:e,shouldHide:r.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!r.formatter.canApply(t.format)},dataset:t}},lD=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],fD=function(r,i){return function(t,n,e){var o=r(t).mapError(function(t){return Dn(t)}).getOrDie();return i(o,n,e)}},dD={button:fD(Gp,function(t,n){return e=t,o=n.backstage.shared.providers,wE(e,o,[]);var e,o}),togglebutton:fD(qp,function(t,n){return e=t,o=n.backstage.shared.providers,SE(e,o,[]);var e,o}),menubutton:fD(eE,function(t,n){return WC(t,"tox-tbtn",n.backstage,st.none())}),splitbutton:fD(function(t){return _n("SplitButton",oE,t)},function(t,n){return kE(t,n.backstage.shared)}),grouptoolbarbutton:fD(function(t){return _n("GroupToolbarButton",ZT,t)},function(t,n,e){var o,r,i,u,a,c,s=e.ui.registry.getAll().buttons,l=((o={})[jc]=n.backstage.shared.header.isPositionedAtTop()?na.TopToBottom:na.BottomToTop,o);switch(Ev(e)){case rh.floating:return r=t,i=n.backstage,u=function(t){return hD(e,{buttons:s,toolbar:t,allowToolbarGroups:!1},n,st.none())},a=l,c=i.shared,vT.sketch({lazySink:c.getSink,fetch:function(){return Ox(function(t){t(V(u(r.items),YT))})},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:yE(r.icon,r.text,r.tooltip,st.none(),st.none(),c.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:a}}}});default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}}),styleSelectButton:function(t,n){return e=t,o=n.backstage,r=it({type:"advanced"},o.styleselect),HE(e,o,sD(e,r));var e,o,r},fontsizeSelectButton:function(t,n){return e=t,o=n.backstage,HE(e,o,nD(e));var e,o},fontSelectButton:function(t,n){return e=t,o=n.backstage,HE(e,o,$E(e));var e,o},formatButton:function(t,n){return e=t,o=n.backstage,HE(e,o,cD(e));var e,o},alignMenuButton:function(t,n){return e=t,o=n.backstage,HE(e,o,YE(e));var e,o}},mD={styleselect:dD.styleSelectButton,fontsizeselect:dD.fontsizeSelectButton,fontselect:dD.fontSelectButton,formatselect:dD.formatButton,align:dD.alignMenuButton},gD=function(t){var n,e,o,r=t.toolbar,i=t.buttons;return!1===r?[]:r===undefined||!0===r?(e=i,o=V(lD,function(t){var n=H(t.items,function(t){return It(e,t)||It(mD,t)});return{name:t.name,items:n}}),H(o,function(t){return 0<t.items.length})):k(r)?(n=r.split("|"),V(n,function(t){return{items:t.trim().split(" ")}})):T(r,function(t){return It(t,"name")&&It(t,"items")})?r:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},pD=function(r,n,i,u,a,t){return Ft(n,i.toLowerCase()).orThunk(function(){return t.bind(function(t){return Z(t,function(t){return Ft(n,t+i.toLowerCase())})})}).fold(function(){return Ft(mD,i.toLowerCase()).map(function(t){return t(r,a)}).orThunk(function(){return st.none()})},function(t){return"grouptoolbarbutton"!==t.type||u?(e=a,o=r,Ft(dD,(n=t).type).fold(function(){return console.error("skipping button defined by",n),st.none()},function(t){return st.some(t(n,e,o))})):(console.warn("Ignoring the '"+i+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),st.none());var n,e,o})},hD=function(e,o,r,i){var t=gD(o),n=V(t,function(t){var n=U(t.items,function(t){return 0===t.trim().length?[]:pD(e,o.buttons,t,o.allowToolbarGroups,r,i).toArray()});return{title:st.from(e.translate(t.name)),items:n}});return H(n,function(t){return 0<t.items.length})},vD={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},bD={maxHeightFunction:Fc(),maxWidthFunction:Q_()},yD={onLtr:function(){return[ja,Ua,Na,Ha,La,za,lp,fp,cp,up,sp,ap]},onRtl:function(){return[ja,Ua,La,za,Na,Ha,lp,fp,sp,ap,cp,up]}},xD={onLtr:function(){return[Ua,Ha,za,Na,La,ja,lp,fp,cp,up,sp,ap]},onRtl:function(){return[Ua,za,Ha,La,Na,ja,lp,fp,sp,ap,cp,up]}},wD=function(c,t,e,s){var o,r,l=je().deviceType.isTouch,a=gu((o={sink:e,onEscape:function(){return c.focus(),st.some(!0)}},r=fe([]),tp.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){r.set([]),tp.getContent(t).each(function(t){nu(t.element,"visibility")}),Bi(t.element,VE),nu(t.element,"width")},inlineBehaviours:ic([dg("context-toolbar-events",[cr(bo(),function(t,n){Bi(t.element,VE),nu(t.element,"width")}),er(RE,function(n,e){nu(n.element,"width");var t=_u(n.element);tp.setContent(n,e.event.contents),Ei(n.element,VE);var o=_u(n.element);qi(n.element,"width",t+"px"),tp.getContent(n).each(function(t){e.event.focus.bind(function(t){return mc(t),pc(n.element)}).orThunk(function(){return ug.focusIn(t),gc()})}),dp.setTimeout(function(){qi(n.element,"width",o+"px")},0)}),er(FE,function(t,n){tp.getContent(t).each(function(t){r.set(r.get().concat([{bar:t,focus:gc()}]))}),qo(t,RE,{contents:n.event.forwardContents,focus:st.none()})}),er(IE,function(n,t){J(r.get()).each(function(t){r.set(r.get().slice(0,r.get().length-1)),qo(n,RE,{contents:pu(t.bar),focus:t.focus})})})]),ug.config({mode:"special",onEscape:function(n){return J(r.get()).fold(function(){return o.onEscape()},function(t){return Yo(n,IE),st.some(!0)})}})]),lazySink:function(){return dt.value(o.sink)}}))),f=function(){return EE(c,s.backstage.shared)},u=function(){if(l()&&s.backstage.isContextMenuOpen())return!0;var t,n,e,o,r,i,u=(t=m.get().filter(function(t){return Ui(me.fromDom(t))}).map(function(t){return t.getBoundingClientRect()}).getOrThunk(function(){return c.selection.getRng().getBoundingClientRect()}),n=c.inline?Au().top:Nu(me.fromDom(c.getBody())).y,{y:t.top+n,bottom:t.bottom+n}),a=f();return e=u.y,o=u.bottom,r=a.y,i=a.bottom,!(Math.max(e,r)<=Math.min(o,i))},n=function(){tp.hide(a)},i=function(){d.get().each(function(t){var n=a.element;nu(n,"display"),u()?qi(n,"display","none"):Qs.positionWithinBounds(e,t,a,st.some(f()))})},d=fe(st.none()),m=fe(st.none()),g=fe(null),p=function(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:ic([ug.config({mode:"acyclic"}),dg("pop-dialog-wrap-events",[sr(function(t){c.shortcuts.add("ctrl+F9","focus statusbar",function(){return ug.focusIn(t)})}),lr(function(t){c.shortcuts.remove("ctrl+F9")})])])}},h=Lt(function(){return ME(t,function(t){var n=v([t]);qo(a,FE,{forwardContents:p(n)})})}),v=function(t){var n=c.ui.registry.getAll().buttons,e=h(),o=it(it({},n),e.formNavigators),r=Ev(c)===rh.scrolling?rh.scrolling:rh["default"],i=ft(V(t,function(t){return"contexttoolbar"===t.type?hD(c,{buttons:o,toolbar:t.items,allowToolbarGroups:!1},s,st.some(["form:"])):(n=t,e=s.backstage.shared.providers,TE(n,e));var n,e}));return QT({type:r,uid:Kr("context-toolbar"),initGroups:i,onEscape:st.none,cyclicKeying:!0,providers:s.backstage.shared.providers})};c.on("contexttoolbar-show",function(n){var t=h();Ft(t.lookupTable,n.toolbarKey).each(function(t){y([t],n.target===c?st.none():st.some(n)),tp.getContent(a).each(ug.focusIn)})});var b=function(t,n){var e,o,r="node"===t?s.backstage.shared.anchors.node(n):s.backstage.shared.anchors.cursor();return zt(r,(e=t,o=l(),"line"===e?{bubble:Hc(12,0,vD),layouts:{onLtr:function(){return[Wa]},onRtl:function(){return[Ga]}},overrides:bD}:{bubble:Hc(0,12,vD),layouts:o?xD:yD,overrides:bD}))},y=function(t,n){var e,o,r,i;w(),l()&&s.backstage.isContextMenuOpen()||(e=v(t),o=n.map(me.fromDom),r=b(t[0].position,o),d.set(st.some(r)),m.set(n),i=a.element,nu(i,"display"),tp.showWithinBounds(a,r,p(e),function(){return st.some(f())}),u()&&qi(i,"display","none"))},x=function(){var t,n,e,o,r,i,u;c.hasFocus()&&(t=h(),n=t,e=c,r=me.fromDom(e.getBody()),i=function(t){return Ge(t,r)},u=me.fromDom(e.selection.getNode()),(i(o=u)||Ye(r,o)?BE(u,n.inNodeScope,n.inEditorScope).orThunk(function(){return AE(i,u,n)}):st.none()).fold(function(){d.set(st.none()),tp.hide(a)},function(t){y(t.toolbars,st.some(t.elem.dom))}))},w=function(){var t=g.get();null!==t&&(dp.clearTimeout(t),g.set(null))},S=function(t){w(),g.set(t)};c.on("init",function(){c.on(Z_,n),c.on("ScrollContent ScrollWindow longpress",i),c.on("click keyup focus SetContent ObjectResized ResizeEditor",function(){S(dp.setEditorTimeout(c,x,0))}),c.on("focusout",function(t){dp.setEditorTimeout(c,function(){pc(e.element).isNone()&&pc(a.element).isNone()&&(d.set(st.none()),tp.hide(a))},0)}),c.on("SwitchMode",function(){c.mode.isReadOnly()&&(d.set(st.none()),tp.hide(a))}),c.on("NodeChange",function(t){pc(a.element).fold(function(){S(dp.setEditorTimeout(c,x,0))},function(t){})})})},SD=zf,kD=Sf,CD=at([ne("shell",!1),Ln("makeItem"),ne("setupItem",$),Wl("listBehaviours",[fg])]),OD=yf({name:"items",overrides:function(){return{behaviours:ic([fg.config({})])}}}),_D=at([OD]),TD=qf({name:at("CustomList")(),configFields:CD(),partFields:_D(),factory:function(s,t,n,e){var o=s.shell?{behaviours:[fg.config({})],components:[]}:{behaviours:[],components:t},r=function(t){return s.shell?st.some(t):Af(t,s,"items")};return{uid:s.uid,dom:s.dom,components:o.components,behaviours:Ul(s.listBehaviours,o.behaviours),apis:{setItems:function(a,c){r(a).fold(function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},function(n){var t=fg.contents(n),e=c.length,o=e-t.length,r=0<o?I(o,function(){return s.makeItem()}):[],i=t.slice(e);lt(i,function(t){return fg.remove(n,t)}),lt(r,function(t){return fg.append(n,t)});var u=fg.contents(n);lt(u,function(t,n){s.setupItem(a,t,c[n],n)})})}}}},apis:{setItems:function(t,n,e){t.setItems(n,e)}}}),ED=$,DD=c,BD=at([]),AD=/* */Object.freeze({__proto__:null,setup:ED,isDocked:DD,getBehaviours:BD}),MD=function(t){return(Zi(t,"position").is("fixed")?st.none():Or(t)).orThunk(function(){var e=me.fromTag("span");return kr(t).bind(function(t){Ar(t,e);var n=Or(e);return Ir(e),n})})},FD=function(t){return MD(t).map(ku).getOrThunk(function(){return wu(0,0)})},ID=Vt([{"static":[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),RD=function(t,n){var e=t.element;Ei(e,n.transitionClass),Bi(e,n.fadeOutClass),Ei(e,n.fadeInClass),n.onShow(t)},VD=function(t,n){var e=t.element;Ei(e,n.transitionClass),Bi(e,n.fadeInClass),Ei(e,n.fadeOutClass),n.onHide(t)},PD=function(t,o,r){return W(t,function(t){switch(t){case"bottom":return e=r,o.bottom<=e.bottom;case"top":return n=r,o.y>=n.y}var n,e})},HD=function(n,t){return t.getInitialPosition().map(function(t){return Hu(t.bounds.x,t.bounds.y,_u(n),bu(n))})},zD=function(t,n,e){e.setInitialPosition(st.some({style:function(t){var n={},e=t.dom;if(Ii(e))for(var o=0;o<e.style.length;o++){var r=e.style.item(o);n[r]=e.style[r]}return n}(t),position:$i(t,"position")||"static",bounds:n}))},ND=function(e,o,r){return r.getInitialPosition().bind(function(t){switch(r.setInitialPosition(st.none()),t.position){case"static":return st.some(ID["static"]());case"absolute":var n=MD(e).map(zu).getOrThunk(function(){return zu(Wi())});return st.some(ID.absolute(vc("absolute",Ft(t.style,"left").map(function(t){return o.x-n.x}),Ft(t.style,"top").map(function(t){return o.y-n.y}),Ft(t.style,"right").map(function(t){return n.right-o.right}),Ft(t.style,"bottom").map(function(t){return n.bottom-o.bottom}))));default:return st.none()}})},LD=function(t,n,e){var o,r,i,u=t.element;return Zi(u,"position").is("fixed")?(r=n,HD(o=u,i=e).filter(function(t){return PD(i.getModes(),t,r)}).bind(function(t){return ND(o,t,i)})):function(t,n,e){var o=zu(t);if(PD(e.getModes(),o,n))return st.none();zD(t,o,e);var r=Lu(),i=o.x-r.x,u=n.y-r.y,a=r.bottom-n.bottom,c=o.y<=n.y;return st.some(ID.fixed(vc("fixed",st.some(i),c?st.some(u):st.none(),st.none(),c?st.none():st.some(a))))}(u,n,e)},jD=function(n,t){lt(["left","right","top","bottom","position"],function(t){return nu(n.element,t)}),t.onUndocked(n)},UD=function(t,n,e){bc(t.element,e),("fixed"===e.position?n.onDocked:n.onUndocked)(t)},WD=function(i,t,u,a,c){void 0===c&&(c=!1),t.contextual.each(function(r){r.lazyContext(i).each(function(t){var n,e,o=(e=a,(n=t).y<e.bottom&&n.bottom>e.y);o!==u.isVisible()&&(u.setVisible(o),c&&!o?(Mi(i.element,[r.fadeOutClass]),r.onHide(i)):(o?RD:VD)(i,r))})})},GD=function(n,e,t){var o,r,i=n.element;t.setDocked(!1),o=t,r=n.element,HD(r,o).bind(function(t){return ND(r,t,o)}).each(function(t){t.fold(function(){return jD(n,e)},function(t){return UD(n,e,t)},$)}),t.setVisible(!0),e.contextual.each(function(t){Fi(i,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(n)}),XD(n,e,t)},XD=function(t,n,e){var o,r,i,u,a;t.getSystem().isConnected()&&(o=t,i=e,u=(r=n).lazyViewport(o),(a=i.isDocked())&&WD(o,r,i,u),LD(o,u,i).each(function(t){i.setDocked(!a),t.fold(function(){return jD(o,r)},function(t){return UD(o,r,t)},function(t){WD(o,r,i,u,!0),UD(o,r,t)})}))},YD=function(t,n,e){e.isDocked()&&GD(t,n,e)},qD=/* */Object.freeze({__proto__:null,refresh:XD,reset:YD,isDocked:function(t,n,e){return e.isDocked()},getModes:function(t,n,e){return e.getModes()},setModes:function(t,n,e,o){return e.setModes(o)}}),KD=/* */Object.freeze({__proto__:null,events:function(o,r){return Zo([cr(bo(),function(n,e){o.contextual.each(function(t){Ai(n.element,t.transitionClass)&&(Fi(n.element,[t.transitionClass,t.fadeInClass]),(r.isVisible()?t.onShown:t.onHidden)(n)),e.stop()})}),er(Ro(),function(t,n){XD(t,o,r)}),er(Vo(),function(t,n){YD(t,o,r)})])}}),JD=[te("contextual",[Un("fadeInClass"),Un("fadeOutClass"),Un("transitionClass"),Gn("lazyContext"),ga("onShow"),ga("onShown"),ga("onHide"),ga("onHidden")]),ae("lazyViewport",Lu),ce("modes",["top","bottom"],Rn),ga("onDocked"),ga("onUndocked")],$D=ac({fields:JD,name:"docking",active:KD,apis:qD,state:/* */Object.freeze({__proto__:null,init:function(t){var n=fe(!1),e=fe(!0),o=fe(st.none()),r=fe(t.modes);return di({isDocked:n.get,setDocked:n.set,getInitialPosition:o.get,setInitialPosition:o.set,isVisible:e.get,setVisible:e.set,getModes:r.get,setModes:r.set,readState:function(){return"docked: "+n.get()+", visible: "+e.get()+", modes: "+r.get().join(",")}})}})}),QD={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},ZD="tox-tinymce--toolbar-sticky-on",tB="tox-tinymce--toolbar-sticky-off",nB=function(r){var i=r.element;kr(i).each(function(t){var n,e,o="padding-"+$D.getModes(r)[0];$D.isDocked(r)?(n=_u(t),qi(i,"width",n+"px"),qi(t,o,yu(e=i)+(parseInt($i(e,"margin-top"),10)||0)+(parseInt($i(e,"margin-bottom"),10)||0)+"px")):(nu(i,"width"),nu(t,o))})},eB=function(t,n){n?(Bi(t,QD.fadeOutClass),Mi(t,[QD.transitionClass,QD.fadeInClass])):(Bi(t,QD.fadeInClass),Mi(t,[QD.fadeOutClass,QD.transitionClass]))},oB=function(t,n){var e=me.fromDom(t.getContainer());n?(Ei(e,ZD),Bi(e,tB)):(Ei(e,tB),Bi(e,ZD))},rB=function(c,t){var n,i=fe(st.none()),o=t.getSink,u=function(n){o().each(function(t){return n(t.element)})},e=function(t){c.inline||nB(t),oB(c,$D.isDocked(t)),t.getSystem().broadcastOn([Sl()],{}),o().each(function(t){return t.getSystem().broadcastOn([Sl()],{})})},r=c.inline?[]:[fc.config({channels:((n={})[GT()]={onReceive:nB},n)})];return S([vg.config({}),$D.config({contextual:it({lazyContext:function(t){var n,e,o=yu(t.element),r=c.inline?c.getContentAreaContainer():c.getContainer(),i=zu(me.fromDom(r)),u=i.height-o,a=i.y+(n=t,e="top",M($D.getModes(n),e)?0:o);return st.some(Hu(i.x,a,i.width,u))},onShow:function(){u(function(t){return eB(t,!0)})},onShown:function(r){u(function(t){return Fi(t,[QD.transitionClass,QD.fadeInClass])}),i.get().each(function(t){var n,e,o;n=r.element,o=yr(e=t),gc(o).filter(function(t){return!Ge(e,t)}).filter(function(t){return Ge(t,me.fromDom(o.dom.body))||Ye(n,t)}).each(function(){return mc(e)}),i.set(st.none())})},onHide:function(t){var n,e;i.set((n=t.element,e=o,pc(n).orThunk(function(){return e().toOptional().bind(function(t){return pc(t.element)})}))),u(function(t){return eB(t,!1)})},onHidden:function(){u(function(t){return Fi(t,[QD.transitionClass])})}},QD),modes:[t.header.getDockingMode()],onDocked:e,onUndocked:e})],r)},iB=/* */Object.freeze({__proto__:null,setup:function(t,n,e){t.inline||(n.header.isPositionedAtTop()||t.on("ResizeEditor",function(){e().each($D.reset)}),t.on("ResizeWindow ResizeEditor",function(){e().each(nB)}),t.on("SkinLoaded",function(){e().each(function(t){$D.isDocked(t)?$D.reset(t):$D.refresh(t)})}),t.on("FullscreenStateChanged",function(){e().each($D.reset)})),t.on("AfterScrollIntoView",function(y){e().each(function(t){$D.refresh(t);var n,e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b=t.element;tm(b)&&(n=y,r=yr(e=b),i=r.dom.defaultView.innerHeight,u=Au(r),a=me.fromDom(n.elm),c=Nu(a),s=bu(a),l=c.y,f=l+s,d=ku(e),m=bu(e),g=d.top,p=g+m,h=Math.abs(g-u.top)<2,v=Math.abs(p-(u.top+i))<2,h&&l<p?Mu(u.left,l-m,r):v&&g<f&&(o=l-i+s+m,Mu(u.left,o,r)))})}),t.on("PostRender",function(){oB(t,!1)})},isDocked:function(t){return t().map($D.isDocked).getOr(!1)},getBehaviours:rB}),uB=Yf({factory:function(n,o){var t={focus:ug.focusIn,setMenus:function(t,n){var e=V(n,function(n){var t={type:"menubutton",text:n.text,fetch:function(t){t(n.getItems())}},e=eE(t).mapError(function(t){return Dn(t)}).getOrDie();return WC(e,"tox-mbtn",o.backstage,st.some("menuitem"))});fg.set(t,e)}};return{uid:n.uid,dom:n.dom,components:[],behaviours:ic([fg.config({}),dg("menubar-events",[sr(function(t){n.onSetup(t)}),er(so(),function(e,t){Ku(e.element,".tox-mbtn--active").each(function(n){Ju(t.event.target,".tox-mbtn").each(function(t){Ge(n,t)||e.getSystem().getByDom(n).each(function(n){e.getSystem().getByDom(t).each(function(t){tw.expand(t),tw.close(n),vg.focus(t)})})})})}),er(Lo(),function(e,t){t.event.prevFocus.bind(function(t){return e.getSystem().getByDom(t).toOptional()}).each(function(n){t.event.newFocus.bind(function(t){return e.getSystem().getByDom(t).toOptional()}).each(function(t){tw.isOpen(n)&&(tw.expand(t),tw.close(n))})})})]),ug.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return n.onEscape(t),st.some(!0)}}),Jy.config({})]),apis:t,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Ln("dom"),Ln("uid"),Ln("onEscape"),Ln("backstage"),ne("onSetup",$)],apis:{focus:function(t,n){t.focus(n)},setMenus:function(t,n,e){t.setMenus(n,e)}}}),aB="container",cB=[Ll("slotBehaviours",[])],sB=function(t){return"<alloy.field."+t+">"},lB=function(r,t){var e,n=function(t){return Rf(r)},o=function(e,o){return function(t,n){return Af(t,r,n).map(function(t){return e(t,n)}).getOr(o)}},i=function(t,n){return"true"!==Nr(t.element,"aria-hidden")},u=o(i,!1),a=o(function(t,n){var e;i(t)&&(e=t.element,qi(e,"display","none"),zr(e,"aria-hidden","true"),qo(t,jo(),{name:n,visible:!1}))}),c=function(n,t){lt(t,function(t){return e(n,t)})},s=o(function(t,n){var e;i(t)||(e=t.element,nu(e,"display"),Ur(e,"aria-hidden"),qo(t,jo(),{name:n,visible:!0}))}),l={getSlotNames:n,getSlot:function(t,n){return Af(t,r,n)},isShowing:u,hideSlot:e=a,hideAllSlots:function(t){return c(t,n())},showSlot:s};return{uid:r.uid,dom:r.dom,components:t,behaviours:jl(r.slotBehaviours),apis:l}},fB=Tt({getSlotNames:function(t,n){return t.getSlotNames(n)},getSlot:function(t,n,e){return t.getSlot(n,e)},isShowing:function(t,n,e){return t.isShowing(n,e)},hideSlot:function(t,n,e){return t.hideSlot(n,e)},hideAllSlots:function(t,n){return t.hideAllSlots(n)},showSlot:function(t,n,e){return t.showSlot(n,e)}},li),dB=it(it({},fB),{sketch:function(t){var e,n=(e=[],{slot:function(t,n){return e.push(t),_f(aB,sB(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=V(r,function(t){return vf({name:t,pname:sB(t)})});return Lf(aB,cB,i,lB,o)}}),mB=fn([Qn("icon"),Qn("tooltip"),ae("onShow",$),ae("onHide",$),ae("onSetup",function(){return $})]),gB=function(t){return{element:function(){return t.element.dom}}},pB=function(e,o){var r=V(Ct(o),function(t){var n=o[t],e=Tn(_n("sidebar",mB,n));return{name:t,getApi:gB,onSetup:e.onSetup,onShow:e.onShow,onHide:e.onHide}});return V(r,function(t){var n=fe($);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Wh([Yv(t,n),qv(t,n),er(jo(),function(n,t){var e=t.event;L(r,function(t){return t.name===e.name}).each(function(t){(e.visible?t.onShow:t.onHide)(t.getApi(n))})})])})})},hB=function(t,e){td.getCurrent(t).each(function(t){return fg.set(t,[(n=e,dB.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:pB(t,n),slotBehaviours:Wh([sr(function(t){return dB.hideAllSlots(t)})])}}))]);var n})},vB=function(t){return td.getCurrent(t).bind(function(t){return zT.isGrowing(t)||zT.hasGrown(t)?td.getCurrent(t).bind(function(n){return L(dB.getSlotNames(n),function(t){return dB.isShowing(n,t)})}):st.none()})},bB=Kr("FixSizeEvent"),yB=Kr("AutoSizeEvent"),xB=function(t){var n,e,o,r=me.fromHtml(t),i=_r(r),u=(e=(n=r).dom.attributes!==undefined?n.dom.attributes:[],N(e,function(t,n){var e;return"class"===n.name?t:it(it({},t),((e={})[n.name]=n.value,e))},{})),a=(o=r,Array.prototype.slice.call(o.dom.classList,0)),c=0===i.length?{}:{innerHtml:Vr(r)};return it({tag:mr(r),classes:a,attributes:u},c)},wB=function(t,n,e){var o=t.element;!0===n?(fg.set(t,[{dom:{tag:"div",attributes:{"aria-label":e.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:xB('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:ic([ug.config({mode:"special",onTab:function(){return st.some(!0)},onShiftTab:function(){return st.some(!0)}}),vg.config({})])}]),nu(o,"display"),Ur(o,"aria-hidden")):(fg.set(t,[]),qi(o,"display","none"),zr(o,"aria-hidden","true"))},SB=kD.optional({factory:uB,name:"menubar",schema:[Ln("backstage")]}),kB=kD.optional({factory:{sketch:function(t){return TD.sketch({uid:t.uid,dom:t.dom,listBehaviours:ic([ug.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return QT({type:t.type,uid:Kr("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),st.some(!0)}})},setupItem:function(t,n,e,o){eT.setGroups(n,e)},shell:!0})}},name:"multiple-toolbar",schema:[Ln("dom"),Ln("onEscape")]}),CB=kD.optional({factory:{sketch:function(t){var n;return((n=t).type===rh.sliding?$T:n.type===rh.floating?JT:QT)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),st.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[Ln("dom"),Ln("onEscape"),Ln("getSink")]}),OB=kD.optional({factory:{sketch:function(t){var n=t.editor,e=t.sticky?rB:BD;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:ic(e(n,t.sharedBackstage))}}},name:"header",schema:[Ln("dom")]}),_B=kD.optional({name:"socket",schema:[Ln("dom")]}),TB=kD.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:ic([Jy.config({}),vg.config({}),zT.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){td.getCurrent(t).each(dB.hideAllSlots),Yo(t,yB)},onGrown:function(t){Yo(t,yB)},onStartGrow:function(t){qo(t,bB,{width:Zi(t.element,"width").getOr("")})},onStartShrink:function(t){qo(t,bB,{width:_u(t.element)+"px"})}}),fg.config({}),td.config({find:function(t){var n=fg.contents(t);return K(n)}})])}],behaviours:ic([rk(0),dg("sidebar-sliding-events",[er(bB,function(t,n){qi(t.element,"width",n.event.width)}),er(yB,function(t,n){nu(t.element,"width")})])])}}},name:"sidebar",schema:[Ln("dom")]}),EB=kD.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:ic([fg.config({})]),components:[]}}},name:"throbber",schema:[Ln("dom")]}),DB=qf({name:"OuterContainer",factory:function(e,t,n){var o={getSocket:function(t){return SD.getPart(t,e,"socket")},setSidebar:function(t,n){SD.getPart(t,e,"sidebar").each(function(t){return hB(t,n)})},toggleSidebar:function(t,o){SD.getPart(t,e,"sidebar").each(function(t){return n=t,e=o,void td.getCurrent(n).each(function(n){td.getCurrent(n).each(function(t){zT.hasGrown(n)?dB.isShowing(t,e)?zT.shrink(n):(dB.hideAllSlots(t),dB.showSlot(t,e)):(dB.hideAllSlots(t),dB.showSlot(t,e),zT.grow(n))})});var n,e})},whichSidebar:function(t){return SD.getPart(t,e,"sidebar").bind(vB).getOrNull()},getHeader:function(t){return SD.getPart(t,e,"header")},getToolbar:function(t){return SD.getPart(t,e,"toolbar")},setToolbar:function(t,n){SD.getPart(t,e,"toolbar").each(function(t){t.getApis().setGroups(t,n)})},setToolbars:function(t,n){SD.getPart(t,e,"multiple-toolbar").each(function(t){TD.setItems(t,n)})},refreshToolbar:function(t){SD.getPart(t,e,"toolbar").each(function(t){return t.getApis().refresh(t)})},toggleToolbarDrawer:function(t){SD.getPart(t,e,"toolbar").each(function(n){var t,e;t=n.getApis().toggle,e=function(t){return t(n)},t!==undefined&&null!==t?st.some(e(t)):st.none()})},isToolbarDrawerToggled:function(t){return SD.getPart(t,e,"toolbar").bind(function(n){return st.from(n.getApis().isOpen).map(function(t){return t(n)})}).getOr(!1)},getThrobber:function(t){return SD.getPart(t,e,"throbber")},focusToolbar:function(t){SD.getPart(t,e,"toolbar").orThunk(function(){return SD.getPart(t,e,"multiple-toolbar")}).each(function(t){ug.focusIn(t)})},setMenubar:function(t,n){SD.getPart(t,e,"menubar").each(function(t){uB.setMenus(t,n)})},focusMenubar:function(t){SD.getPart(t,e,"menubar").each(function(t){uB.focus(t)})}};return{uid:e.uid,dom:e.dom,components:t,apis:o,behaviours:e.behaviours}},configFields:[Ln("dom"),Ln("behaviours")],partFields:[OB,SB,CB,kB,_B,TB,EB],apis:{getSocket:function(t,n){return t.getSocket(n)},setSidebar:function(t,n,e){t.setSidebar(n,e)},toggleSidebar:function(t,n,e){t.toggleSidebar(n,e)},whichSidebar:function(t,n){return t.whichSidebar(n)},getHeader:function(t,n){return t.getHeader(n)},getToolbar:function(t,n){return t.getToolbar(n)},setToolbar:function(t,n,e){var o=V(e,YT);t.setToolbar(n,o)},setToolbars:function(t,n,e){var o=V(e,function(t){return V(t,YT)});t.setToolbars(n,o)},refreshToolbar:function(t,n){return t.refreshToolbar(n)},toggleToolbarDrawer:function(t,n){t.toggleToolbarDrawer(n)},isToolbarDrawerToggled:function(t,n){return t.isToolbarDrawerToggled(n)},getThrobber:function(t,n){return t.getThrobber(n)},setMenubar:function(t,n,e){t.setMenubar(n,e)},focusMenubar:function(t,n){t.focusMenubar(n)},focusToolbar:function(t,n){t.focusToolbar(n)}}}),BB={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},AB=function(t){return"string"==typeof t?t.split(" "):t},MB=function(i,u){var a=it(it({},BB),u.menus),n=0<Ct(u.menus).length,t=u.menubar===undefined||!0===u.menubar?AB("file edit view insert format tools table help"):AB(!1===u.menubar?"":u.menubar),e=H(t,function(t){return n&&u.menus.hasOwnProperty(t)&&u.menus[t].hasOwnProperty("items")||BB.hasOwnProperty(t)}),o=V(e,function(t){var n,e,o,r=a[t];return n={title:r.title,items:AB(r.items)},e=u,o=i.getParam("removed_menuitems","").split(/[ ,]/),{text:n.title,getItems:function(){return U(n.items,function(t){var n=t.toLowerCase();return 0===n.trim().length||F(o,function(t){return t===n})?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]})}}});return H(o,function(t){return 0<t.getItems().length&&F(t.getItems(),function(t){return"separator"!==t.type})})},FB=function(t){var n=function(){t._skinLoaded=!0,t.fire("SkinLoaded")};return function(){t.initialized?n():t.on("init",n)}},IB=function(n,e){return function(){return t={message:e},n.fire("SkinLoadError",t);var t}},RB=function(e,o,r){return new Fp(function(t,n){r.load(o,t,n),e.on("remove",function(){return r.unload(o)})})},VB=function(t,n){var e;return(e=me.fromDom(t.getElement()),Ni(e).isSome())?RB(t,n+"/skin.shadowdom.min.css",Zh.DOM.styleSheetLoader):Fp.resolve()},PB=function(t,n){var e,o,r,i,u,a=(r=(e=n).getParam("skin"),i=e.getParam("skin_url"),!1!==r&&(o=r||"oxide",i=i?e.documentBaseURI.toAbsolute(i):pv.baseURL+"/skins/ui/"+o),i);a&&n.contentCSS.push(a+(t?"/content.inline":"/content")+".min.css"),!1==(!1===n.getParam("skin"))&&k(a)?Fp.all([RB(u=n,a+"/skin.min.css",u.ui.styleSheetLoader),VB(n,a)]).then(FB(n),IB(n,"Skin could not be loaded")):FB(n)()},HB=y(PB,!1),zB=y(PB,!0),NB=function(e,t,o,r){var n,i=t.outerContainer,u=o.toolbar,a=o.buttons;T(u,k)?(n=u.map(function(t){var n={toolbar:t,buttons:a,allowToolbarGroups:o.allowToolbarGroups};return hD(e,n,{backstage:r},st.none())}),DB.setToolbars(i,n)):DB.setToolbar(i,hD(e,o,{backstage:r},st.none()))},LB=je(),jB=LB.os.isiOS()&&LB.os.version.major<=12,UB=function(e,t){var n=e.dom,o=e.getWin(),r=e.getDoc().documentElement,i=fe(wu(o.innerWidth,o.innerHeight)),u=fe(wu(r.offsetWidth,r.offsetHeight)),a=function(){var t=i.get();t.left===o.innerWidth&&t.top===o.innerHeight||(i.set(wu(o.innerWidth,o.innerHeight)),Mb(e))},c=function(){var t=e.getDoc().documentElement,n=u.get();n.left===t.offsetWidth&&n.top===t.offsetHeight||(u.set(wu(t.offsetWidth,t.offsetHeight)),Mb(e))},s=function(t){return n=t,e.fire("ScrollContent",n);var n};n.bind(o,"resize",a),n.bind(o,"scroll",s);var l=xy(me.fromDom(e.getBody()),"load",c),f=t.uiMothership.element;e.on("hide",function(){qi(f,"display","none")}),e.on("show",function(){nu(f,"display")}),e.on("NodeChange",c),e.on("remove",function(){l.unbind(),n.unbind(o,"resize",a),n.unbind(o,"scroll",s),o=null})},WB=/* */Object.freeze({__proto__:null,render:function(e,n,t,o,r){var i=fe(0),u=n.outerContainer;HB(e);var a,c,s=me.fromDom(r.targetNode),l=zi(Hi(s));a=s,c=n.mothership,sl(a,c,Dr),cl(l,n.uiMothership),e.on("PostRender",function(){NB(e,n,t,o),i.set(e.getWin().innerWidth),DB.setMenubar(u,MB(e,t)),DB.setSidebar(u,t.sidebar),UB(e,n)});var f,d,m,g,p,h=DB.getSocket(u).getOrDie("Could not find expected socket element");jB&&(Ki(h.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"}),m=function(){e.fire("ScrollContent")},g=20,p=null,f={cancel:function(){null!==p&&(clearTimeout(p),p=null)},throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null===p&&(p=setTimeout(function(){m.apply(null,t),p=null},g))}},d=yy(h.element,"scroll",f.throttle),e.on("remove",d.unbind)),Nv(e,n),e.addCommand("ToggleSidebar",function(t,n){DB.toggleSidebar(u,n),e.fire("ToggleSidebar")}),e.addQueryValueHandler("ToggleSidebar",function(){return DB.whichSidebar(u)});var v=Ev(e);v!==rh.sliding&&v!==rh.floating||e.on("ResizeWindow ResizeEditor ResizeContent",function(){var t=e.getWin().innerWidth;t!==i.get()&&(DB.refreshToolbar(n.outerContainer),i.set(t))});var b={enable:function(){zv(n,!1)},disable:function(){zv(n,!0)},isDisabled:function(){return gv.isDisabled(u)}};return{iframeContainer:h.element.dom,editorContainer:u.element.dom,api:b}}}),GB=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?st.some(parseInt(""+t,10)):st.none()},XB=function(t){return ut(t)?t+"px":t},YB=function(n,t,e){var o=t.filter(function(t){return n<t}),r=e.filter(function(t){return t<n});return o.or(r).getOr(n)},qB=function(t){var n,e,o,r;return(e=hv(n=t),o=yv(n),r=wv(n),GB(e).map(function(t){return YB(t,o,r)})).getOr(hv(t))},KB=function(t){var n=vv(t),e=bv(t),o=xv(t);return GB(n).map(function(t){return YB(t,e,o)})},JB=function(a,c,t,n,s){var e=t.uiMothership,l=t.outerContainer,o=Zh.DOM,f=Fv(a),d=Vv(a),m=xv(a).or(KB(a)),r=n.shared.header,g=r.isPositionedAtTop,i=Ev(a),p=i===rh.sliding||i===rh.floating,u=fe(!1),h=function(){return u.get()&&!a.removed},v=function(t){return p?t.fold(function(){return 0},function(t){return 1<t.components().length?bu(t.components()[1].element):0}):0},b=function(){e.broadcastOn([Sl()],{})},y=function(t){var n,e,o,r,i,u;void 0===t&&(t=!1),h()&&(f||(n=m.getOrThunk(function(){var t=GB($i(Wi(),"margin-left")).getOr(0);return _u(Wi())-ku(c).left+t}),qi(s.get().element,"max-width",n+"px")),p&&DB.refreshToolbar(l),f||(e=DB.getToolbar(l),o=v(e),r=zu(c),i=g()?Math.max(r.y-bu(s.get().element)+o,0):r.bottom,Ki(l.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})),d&&(u=s.get(),t?$D.reset(u):$D.refresh(u)),b())},x=function(t){var n,e;void 0===t&&(t=!0),!f&&d&&h()&&(n=r.getDockingMode(),(e=function(t){switch(Bv(a)){case _v.auto:var n=DB.getToolbar(l),e=v(n),o=bu(t.element)-e,r=zu(c);if(r.y>o)return"top";var i=wr(c),u=Math.max(i.dom.scrollHeight,bu(i));return r.bottom<u-o||Lu().bottom<r.bottom-o?"bottom":"top";case _v.bottom:return"bottom";case _v.top:default:return"top"}}(s.get()))!==n&&(function(t){var n=s.get();$D.setModes(n,[t]),r.setDockingMode(t);var e=g()?na.TopToBottom:na.BottomToTop;zr(n.element,jc,e)}(e),t&&y(!0)))};return{isVisible:h,isPositionedAtTop:g,show:function(){u.set(!0),qi(l.element,"display","flex"),o.addClass(a.getBody(),"mce-edit-focus"),nu(e.element,"display"),x(!1),y()},hide:function(){u.set(!1),t.outerContainer&&(qi(l.element,"display","none"),o.removeClass(a.getBody(),"mce-edit-focus")),qi(e.element,"display","none")},update:y,updateMode:x,repositionPopups:b}},$B=function(t,n){var e=zu(t);return{pos:n?e.y:e.bottom,bounds:e}},QB=/* */Object.freeze({__proto__:null,render:function(n,e,o,r,t){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=fe(null),s=me.fromDom(t.targetNode),l=JB(n,s,e,r,c),f=n.getParam("toolbar_persist",!1,"boolean");zB(n);var d=function(){var t;c.get()?l.show():(c.set(DB.getHeader(a).getOrDie()),t=Iv(n),cl(t,i),cl(t,u),NB(n,e,o,r),DB.setMenubar(a,MB(n,o)),l.show(),function(c,s,l,t){var f=fe($B(s,l.isPositionedAtTop())),n=function(t){var n=$B(s,l.isPositionedAtTop()),e=n.pos,o=n.bounds,r=f.get(),i=r.pos,u=r.bounds,a=o.height!==u.height||o.width!==u.width;f.set({pos:e,bounds:o}),a&&Mb(c,t),l.isVisible()&&(i!==e?l.update(!0):a&&(l.updateMode(),l.repositionPopups()))};t||(c.on("activate",l.show),c.on("deactivate",l.hide)),c.on("SkinLoaded ResizeWindow",function(){return l.update(!0)}),c.on("NodeChange keydown",function(t){dp.requestAnimationFrame(function(){return n(t)})}),c.on("ScrollWindow",function(){return l.updateMode()});var e=iD();e.set(xy(me.fromDom(c.getBody()),"load",n)),c.on("remove",function(){e.clear()})}(n,s,l,f),n.nodeChanged())};n.on("show",d),n.on("hide",l.hide),f||(n.on("focus",d),n.on("blur",l.hide)),n.on("init",function(){(n.hasFocus()||f)&&d()}),Nv(n,e);var m={show:function(){l.show()},hide:function(){l.hide()},enable:function(){zv(e,!1)},disable:function(){zv(e,!0)},isDisabled:function(){return gv.isDisabled(a)}};return{editorContainer:a.element.dom,api:m}}}),ZB=function(t,n){var e,o,r,i,u,a,c,s,l,f,d,m,g,p;r=PE(0,o=n,YE(e=t)),e.ui.registry.addNestedMenuItem("align",{text:o.shared.providers.translate("Align"),getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}}),a=PE(0,u=n,$E(i=t)),i.ui.registry.addNestedMenuItem("fontformats",{text:u.shared.providers.translate("Fonts"),getSubmenuItems:function(){return a.items.validateItems(a.getStyleItems())}}),c=t,l=it({type:"advanced"},(s=n).styleselect),f=PE(0,s,sD(c,l)),c.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return f.items.validateItems(f.getStyleItems())}}),m=PE(0,n,cD(d=t)),d.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return m.items.validateItems(m.getStyleItems())}}),p=PE(0,n,nD(g=t)),g.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return p.items.validateItems(p.getStyleItems())}})},tA=function(t,n){return function(){t.execCommand("mceToggleFormat",!1,n)}},nA=function(t){var n,e;!function(e){ck.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(t,n){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:uD(e,t.name),onAction:tA(e,t.name)})});for(var t=1;t<=6;t++){var n="h"+t;e.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+t,onSetup:uD(e,n),onAction:tA(e,n)})}}(t),n=t,ck.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],function(t){n.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return n.execCommand(t.action)}})}),e=t,ck.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return e.execCommand(t.action)},onSetup:uD(e,t.name)})})},eA=function(t){var n;nA(t),n=t,ck.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],function(t){n.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:function(){return n.execCommand(t.action)}})}),n.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:tA(n,"code")})},oA=function(t,n,e){var o=function(){return!!n.undoManager&&n.undoManager[e]()},r=function(){t.setDisabled(n.mode.isReadOnly()||!o())};return t.setDisabled(!o()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r),function(){return n.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r)}},rA=function(t){var n,e;(n=t).ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(t){return oA(t,n,"hasUndo")},onAction:function(){return n.execCommand("undo")}}),n.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(t){return oA(t,n,"hasRedo")},onAction:function(){return n.execCommand("redo")}}),(e=t).ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(t){return oA(t,e,"hasUndo")},onAction:function(){return e.execCommand("undo")}}),e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(t){return oA(t,e,"hasRedo")},onAction:function(){return e.execCommand("redo")}})},iA={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},uA=(NE="[eE][+-]?[0-9]+",jE=["Infinity",(zE="[0-9]+")+"\\."+(LE=function(t){return"(?:"+t+")?"})(zE)+LE(NE),"\\."+zE+LE(NE),zE+LE(NE)].join("|"),new RegExp("^([+-]?(?:"+jE+"))(.*)$")),aA=function(t,r){return st.from(uA.exec(t)).bind(function(t){var n,e=Number(t[1]),o=t[2];return n=o,F(r,function(t){return F(iA[t],function(t){return n===t})})?st.some({value:e,unit:o}):st.none()})},cA=function(t){return aA(t,["fixed","relative","empty"]).map(function(t){return t.value+t.unit}).getOr(t)},sA=function(o){var r=o.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" "),i=new Map,u=rD(),a=function(){var t=cA(o.queryCommandValue("LineHeight"));st.from(i.get(t)).fold(function(){return u.clear()},function(t){u.set({destroy:function(){t.setActive(!1)}}),t.setActive(!0)})};return o.on("nodeChange",a),V(r,function(n,e){return{type:"togglemenuitem",text:n,onSetup:function(t){return i.set(cA(n),t),e+1===r.length&&a(),function(){0===e&&(o.off("nodeChange",a),u.clear())}},onAction:function(){return o.execCommand("LineHeight",!1,n)}}})},lA=function(t){var n,e;(n=t).ui.registry.addNestedMenuItem("lineheight",{type:"nestedmenuitem",text:"Line height",getSubmenuItems:function(){return sA(n)}}),(e=t).ui.registry.addMenuButton("lineheight",{tooltip:"Line height",icon:"line-height",fetch:function(t){return t(sA(e))}})},fA=function(t,n){var e,o,r,i;!function(n){ck.each([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],function(t){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,onAction:function(){return n.execCommand(t.cmd)},icon:t.icon,onSetup:uD(n,t.name)})});var t="alignnone",e="No alignment",o="JustifyNone",r="align-none";n.ui.registry.addButton(t,{tooltip:e,onAction:function(){return n.execCommand(o)},icon:r})}(t),eA(t),ZB(t,n),rA(t),function(t){Lb(t);var n=fe(null),e=fe(null);Yb(t,"forecolor","forecolor","Text color",n),Yb(t,"backcolor","hilitecolor","Background color",e),qb(t,"forecolor","forecolor","Text color"),qb(t,"backcolor","hilitecolor","Background color")}(t),(o=e=t).ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return o.execCommand("mceToggleVisualAid")}}),(r=e).ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(t){return function(n,t){n.setActive(t.hasVisual);var e=function(t){n.setActive(t.hasVisual)};return t.on("VisualAid",e),function(){return t.off("VisualAid",e)}}(t,r)},onAction:function(){r.execCommand("mceToggleVisualAid")}}),(i=t).ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(t){return function(t,n){t.setDisabled(!n.queryCommandState("outdent"));var e=function(){t.setDisabled(!n.queryCommandState("outdent"))};return n.on("NodeChange",e),function(){return n.off("NodeChange",e)}}(t,i)},onAction:function(){return i.execCommand("outdent")}}),i.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return i.execCommand("indent")}}),lA(t)},dA=function(t,n){return{anchor:"makeshift",x:t,y:n}},mA=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},gA=function(t,n){var e,o,r,i=Zh.DOM.getPos(t);return e=n,o=i.x,r=i.y,dA(e.x+o,e.y+r)},pA=function(t,n){return"contextmenu"===n.type||"longpress"===n.type?t.inline?function(t){if(mA(t)){var n=t.touches[0];return dA(n.pageX,n.pageY)}return dA(t.pageX,t.pageY)}(n):gA(t.getContentAreaContainer(),function(t){if(mA(t)){var n=t.touches[0];return dA(n.clientX,n.clientY)}return dA(t.clientX,t.clientY)}(n)):hA(t)},hA=function(t){return{anchor:"selection",root:me.fromDom(t.selection.getNode())}},vA=function(t){return{anchor:"node",node:st.some(me.fromDom(t.selection.getNode())),root:me.fromDom(t.getBody())}},bA=function(t,n,e,o,r,i){var u=e(),a=i?vA(t):pA(t,n);jC(u,uh.CLOSE_ON_EXECUTE,o,!1).map(function(t){n.preventDefault(),tp.showMenuAt(r,a,{menu:{markers:yh("normal")},data:t})})},yA={onLtr:function(){return[Ua,Ha,za,Na,La,ja,lp,fp,cp,up,sp,ap]},onRtl:function(){return[Ua,za,Ha,La,Na,ja,lp,fp,sp,ap,cp,up]}},xA={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},wA=function(n,e,t,o,r,i,u){var a,c,s=i?vA(n):(a=n,c=e,it({bubble:Hc(0,12,xA),layouts:yA,overrides:{maxWidthFunction:Q_(),maxHeightFunction:Fc()}},pA(a,c)));jC(t,uh.CLOSE_ON_EXECUTE,o,!0).map(function(t){e.preventDefault(),tp.showMenuWithinBounds(r,s,{menu:{markers:yh("normal"),highlightImmediately:u},data:t,type:"horizontal"},function(){return st.some(EE(n,o.shared))}),n.fire(Z_)})},SA=function(n,e,o,r,i,u){var t,a=je(),c=a.os.isiOS(),s=a.os.isOSX(),l=a.os.isAndroid(),f=a.deviceType.isTouch(),d=function(){var t=o();wA(n,e,t,r,i,u,!(l||c||s&&f))};!s&&!c||u?(l&&!u&&n.selection.setCursorLocation(e.target,0),d()):(t=function(){!function(t){var n=t.selection.getRng(),e=function(){dp.setEditorTimeout(t,function(){t.selection.setRng(n)},10),i()};t.once("touchend",e);var o=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",o,!0);var r=function(){return i()};t.once("longpresscancel",r);var i=function(){t.off("touchend",e),t.off("longpresscancel",r),t.off("mousedown",o)}}(n),d()},!function(t,n){var e=t.selection;if(e.isCollapsed()||n.touches.length<1)return!1;var o=n.touches[0],r=e.getRng();return bs(t.getWin(),Qc.domRange(r)).exists(function(t){return t.left<=o.clientX&&t.right>=o.clientX&&t.top<=o.clientY&&t.bottom>=o.clientY})}(n,e)?(n.once("selectionchange",t),n.once("touchend",function(){return n.off("selectionchange",t)})):t())},kA=function(t){return"string"==typeof t?t.split(/[ ,]/):t},CA=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},OA=function(t){return e="contextmenu",o="link linkchecker image imagetools table spellchecker configurepermanentpen",r=(n=t).ui.registry.getAll().contextMenus,st.from(n.getParam(e)).map(kA).getOrThunk(function(){return H(kA(o),function(t){return It(r,t)})});var n,e,o,r},_A=function(t){return k(t)?"|"===t:"separator"===t.type},TA={type:"separator"},EA=function(n){if(k(n))return n;switch(n.type){case"separator":return TA;case"submenu":return{type:"nestedmenuitem",text:n.text,icon:n.icon,getSubmenuItems:function(){var t=n.getSubmenuItems();return k(t)?t:V(t,EA)}};default:return{type:"menuitem",text:n.text,icon:n.icon,onAction:(t=n.onAction,function(){return t()})}}var t},DA=function(t,n){if(0===n.length)return t;var e=J(t).filter(function(t){return!_A(t)}).fold(function(){return[]},function(t){return[TA]});return t.concat(e).concat(n).concat([TA])},BA=function(t,n){return"longpress"!==n.type&&(2!==n.button||n.target===t.getBody()&&""===n.pointerType)},AA=function(t,n){return BA(t,n)?t.selection.getStart(!0):n.target},MA=function(a,t,e){var o=je().deviceType.isTouch,r=gu(tp.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return a.focus()},onShow:function(){return e.setContextMenuState(!0)},onHide:function(){return e.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:ic([dg("dismissContextMenu",[er(zo(),function(t,n){xl.close(t),a.focus()})])])})),n=function(t){return tp.hide(r)},i=function(u){var t,n;CA(a)&&u.preventDefault(),t=a,u.ctrlKey&&!CA(t)||!1===a.getParam("contextmenu")||(n=function(t,n){var e=t.getParam("contextmenu_avoid_overlap","","string");if(BA(t,n))return!0;if(e){var o=AA(t,n);return Sy(me.fromDom(o),e)}return!1}(a,u),(o()?SA:bA)(a,u,function(){var r,i,t,n=AA(a,u),e=a.ui.registry.getAll(),o=OA(a);return r=e.contextMenus,i=n,0<(t=N(o,function(t,n){if(It(r,n)){var e=r[n].update(i);if(k(e))return DA(t,e.split(" "));if(0<e.length){var o=V(e,EA);return DA(t,o)}return t}return t.concat([n])},[])).length&&_A(t[t.length-1])&&t.pop(),t},e,r,n))};a.on("init",function(){var t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");a.on(t,n),a.on("longpress contextmenu",i)})},FA=Vt([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),IA=function(n){return function(t){return t.translate(-n.left,-n.top)}},RA=function(n){return function(t){return t.translate(n.left,n.top)}},VA=function(e){return function(t,n){return N(e,function(t,n){return n(t)},wu(t,n))}},PA=function(t,n,e){return t.fold(VA([RA(e),IA(n)]),VA([IA(n)]),VA([]))},HA=function(t,n,e){return t.fold(VA([RA(e)]),VA([]),VA([RA(n)]))},zA=function(t,n,e){return t.fold(VA([]),VA([IA(e)]),VA([RA(n),IA(e)]))},NA=function(t,n,e){var o=t.fold(function(t,n){return{position:st.some("absolute"),left:st.some(t+"px"),top:st.some(n+"px")}},function(t,n){return{position:st.some("absolute"),left:st.some(t-e.left+"px"),top:st.some(n-e.top+"px")}},function(t,n){return{position:st.some("fixed"),left:st.some(t+"px"),top:st.some(n+"px")}});return it({right:st.none(),bottom:st.none()},o)},LA=function(t,i,u,a){var n=function(o,r){return function(t,n){var e=o(i,u,a);return r(t.getOr(e.left),n.getOr(e.top))}};return t.fold(n(zA,jA),n(HA,UA),n(PA,WA))},jA=FA.offset,UA=FA.absolute,WA=FA.fixed,GA=function(t,n){var e=Nr(t,n);return h(e)?NaN:parseInt(e,10)},XA=function(t,n,e,o){return r=n,i=t.element,u=GA(i,r.leftAttr),a=GA(i,r.topAttr),(isNaN(u)||isNaN(a)?st.none():st.some(wu(u,a))).fold(function(){return e},function(t){return WA(t.left+o.left,t.top+o.top)});var r,i,u,a},YA=function(t,n,e,o,r,i){var u,a,c,s=XA(t,n,e,o),l=(n.mustSnap?JA:$A)(t,n,s,r,i),f=PA(s,r,i);return u=n,a=f,c=t.element,zr(c,u.leftAttr,a.left+"px"),zr(c,u.topAttr,a.top+"px"),l.fold(function(){return{coord:WA(f.left,f.top),extra:st.none()}},function(t){return{coord:t.output,extra:t.extra}})},qA=function(t,n){var e,o;e=n,o=t.element,Ur(o,e.leftAttr),Ur(o,e.topAttr)},KA=function(t,l,f,d){return Z(t,function(t){var n,e,o,r,i,u,a,c,s=t.sensor;return(n=l,e=s,o=t.range.left,r=t.range.top,a=HA(n,i=f,u=d),c=HA(e,i,u),Math.abs(a.left-c.left)<=o&&Math.abs(a.top-c.top)<=r)?st.some({output:LA(t.output,l,f,d),extra:t.extra}):st.none()})},JA=function(t,n,d,m,g){var e=n.getSnapPoints(t);return KA(e,d,m,g).orThunk(function(){return N(e,function(n,e){var t,o,r,i,u,a,c,s,l=e.sensor,f=(t=d,o=l,e.range.left,e.range.top,u=HA(t,r=m,i=g),a=HA(o,r,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top),wu(c,s));return n.deltas.fold(function(){return{deltas:st.some(f),snap:st.some(e)}},function(t){return(f.left+f.top)/2<=(t.left+t.top)/2?{deltas:st.some(f),snap:st.some(e)}:n})},{deltas:st.none(),snap:st.none()}).snap.map(function(t){return{output:LA(t.output,d,m,g),extra:t.extra}})})},$A=function(t,n,e,o,r){var i=n.getSnapPoints(t);return KA(i,e,o,r)},QA=/* */Object.freeze({__proto__:null,snapTo:function(t,n,e,o){var r,i,u,a,c,s,l,f,d=n.getTarget(t.element);n.repositionTarget&&(r=yr(t.element),i=Au(r),u=FD(d),l=i,f=u,a={coord:LA((s=o).output,s.output,l,f),extra:s.extra},c=NA(a.coord,0,u),Ji(d,c))}}),ZA="data-initial-z-index",tM=function(t,n){var e;t.getSystem().addToGui(n),kr((e=n).element).filter(pr).each(function(n){Zi(n,"z-index").each(function(t){zr(n,ZA,t)}),qi(n,"z-index",$i(e.element,"z-index"))})},nM=function(t){kr(t.element).filter(pr).each(function(n){Lr(n,ZA).fold(function(){return nu(n,"z-index")},function(t){return qi(n,"z-index",t)}),Ur(n,ZA)}),t.getSystem().removeFromGui(t)},eM=function(t,n,e){return t.getSystem().build(Uy.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[n]},events:e}))},oM=te("snaps",[Ln("getSnapPoints"),ga("onSensor"),Ln("leftAttr"),Ln("topAttr"),ne("lazyViewport",Lu),ne("mustSnap",!1)]),rM=[ne("useFixed",c),Ln("blockerClass"),ne("getTarget",ct),ne("onDrag",$),ne("repositionTarget",!0),ne("onDrop",$),ae("getBounds",Lu),oM],iM=function(n){return t=Zi(n,"left"),e=Zi(n,"top"),o=Zi(n,"position"),r=function(t,n,e){return("fixed"===e?WA:jA)(parseInt(t,10),parseInt(n,10))},(t.isSome()&&e.isSome()&&o.isSome()?st.some(r(t.getOrDie(),e.getOrDie(),o.getOrDie())):st.none()).getOrThunk(function(){var t=ku(n);return UA(t.left,t.top)});var t,e,o,r},uM=function(e,t,i,u,a,c,n){var o,r,s,l,f,d,m,g,p,h=t.fold(function(){var t,e,o,n=(t=i,e=c.left,o=c.top,t.fold(function(t,n){return jA(t+e,n+o)},function(t,n){return UA(t+e,n+o)},function(t,n){return WA(t+e,n+o)})),r=PA(n,u,a);return WA(r.left,r.top)},function(n){var t=YA(e,n,i,c,u,a);return t.extra.each(function(t){n.onSensor(e,t)}),t.coord});return o=h,r=u,s=a,f=(l=n).bounds,d=HA(o,r,s),m=_c(d.left,f.x,f.x+f.width-l.width),g=_c(d.top,f.y,f.y+f.height-l.height),p=UA(m,g),o.fold(function(){var t=zA(p,r,s);return jA(t.left,t.top)},function(){return p},function(){var t=PA(p,r,s);return WA(t.left,t.top)})},aM=function(t,n){return{bounds:t.getBounds(),height:yu(n.element),width:Tu(n.element)}},cM=function(d,m,t,n,e){var o=t.update(n,e),g=t.getStartData().getOrThunk(function(){return aM(m,d)});o.each(function(t){var n,e,o,r,i,u,a,c,s,l,f;n=d,o=g,r=t,f=(e=m).getTarget(n.element),e.repositionTarget&&(i=yr(n.element),u=Au(i),a=FD(f),c=iM(f),s=uM(n,e.snaps,c,u,a,r,o),l=NA(s,0,a),Ji(f,l)),e.onDrag(n,f,r)})},sM=function(n,t,e,o){t.each(nM),e.snaps.each(function(t){qA(n,t)});var r=e.getTarget(n.element);o.reset(),e.onDrop(n,r)},lM=function(t){return function(n,e){var o=function(t){e.setStartData(aM(n,t))};return Zo(S([er(Ro(),function(t){e.getStartData().each(function(){return o(t)})})],t(n,e,o)))}},fM=/* */Object.freeze({__proto__:null,getData:function(t){return st.from(wu(t.x,t.y))},getDelta:function(t,n){return wu(n.left-t.left,n.top-t.top)}}),dM=function(a,c,s){return[er(io(),function(n,t){var e,o,r,i,u;0===t.event.raw.button&&(t.stop(),r={drop:e=function(){return sM(n,st.some(i),a,c)},delayDrop:(o=ky(e,200)).schedule,forceDrop:e,move:function(t){o.cancel(),cM(n,a,c,fM,t)}},i=eM(n,a.blockerClass,(u=r,Zo([er(io(),u.forceDrop),er(co(),u.drop),er(uo(),function(t,n){u.move(n.event)}),er(ao(),u.delayDrop)]))),s(n),tM(n,i))})]},mM=S(rM,[ba("dragger",{handlers:lM(dM)})]),gM=/* */Object.freeze({__proto__:null,getData:function(t){var n,e=t.raw.touches;return 1===e.length?(n=e[0],st.some(wu(n.clientX,n.clientY))):st.none()},getDelta:function(t,n){return wu(n.left-t.left,n.top-t.top)}}),pM=function(u,a,c){var s=fe(st.none());return[er(no(),function(n,t){t.stop();var e,o=function(){sM(n,s.get(),u,a),s.set(st.none())},r={drop:o,delayDrop:function(){},forceDrop:o,move:function(t){cM(n,u,a,gM,t)}},i=eM(n,u.blockerClass,(e=r,Zo([er(no(),e.forceDrop),er(oo(),e.drop),er(ro(),e.drop),er(eo(),function(t,n){e.move(n.event)})])));s.set(st.some(i));c(n),tM(n,i)}),er(eo(),function(t,n){n.stop(),cM(t,u,a,gM,n.event)}),er(oo(),function(t,n){n.stop(),sM(t,s.get(),u,a),s.set(st.none())}),er(ro(),function(t){sM(t,s.get(),u,a),s.set(st.none())})]},hM=S(rM,[ba("dragger",{handlers:lM(pM)})]),vM=S(rM,[ba("dragger",{handlers:lM(function(t,n,e){return S(dM(t,n,e),pM(t,n,e))})})]),bM=sc({branchKey:"mode",branches:/* */Object.freeze({__proto__:null,mouse:mM,touch:hM,mouseOrTouch:vM}),name:"dragging",active:{events:function(t,n){return t.dragger.handlers(t,n)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:st.from(t.extra)}}},state:/* */Object.freeze({__proto__:null,init:function(){var i=st.none(),n=st.none(),t=at({});return di({readState:t,reset:function(){i=st.none(),n=st.none()},update:function(r,t){return r.getData(t).bind(function(t){return n=r,e=t,o=i.map(function(t){return n.getDelta(t,e)}),i=st.some(e),o;var n,e,o})},getStartData:function(){return n},setStartData:function(t){n=st.some(t)}})}}),apis:QA}),yM=function(t,r,i,u,n,e){return t.fold(function(){return bM.snap({sensor:UA(i-20,u-20),range:wu(n,e),output:UA(st.some(i),st.some(u)),extra:{td:r}})},function(t){var n=i-20,e=u-20,o=t.element.dom.getBoundingClientRect();return bM.snap({sensor:UA(n,e),range:wu(40,40),output:UA(st.some(i-o.width/2),st.some(u-o.height/2)),extra:{td:r}})})},xM=function(t,i,u){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,n){var e,o,r=n.td;e=i.get(),o=r,e.exists(function(t){return Ge(t,o)})||(i.set(st.some(r)),u(r))},mustSnap:!0}},wM=function(t){return gp(mp.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:ic([bM.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),nw.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},SM=function(c,e){var o=fe([]),r=fe([]),t=fe(!1),i=fe(st.none()),u=fe(st.none()),n=function(t){var n=Nu(t);return yM(f.getOpt(e),t,n.x,n.y,n.width,n.height)},a=function(t){var n=Nu(t);return yM(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=xM(function(){return V(o.get(),n)},i,function(n){u.get().each(function(t){c.fire("TableSelectorChange",{start:n,finish:t})})}),l=xM(function(){return V(r.get(),a)},u,function(n){i.get().each(function(t){c.fire("TableSelectorChange",{start:t,finish:n})})}),f=wM(s),d=wM(l),m=gu(f.asSpec()),g=gu(d.asSpec()),p=function(t,n,e,o){var r=e(n);bM.snapTo(t,r);!function(t,n,e,o){var r=n.dom.getBoundingClientRect();nu(t.element,"display");var i=Sr(me.fromDom(c.getBody())).dom.innerHeight,u=e(r),a=o(r,i);(u||a)&&qi(t.element,"display","none")}(t,n,function(t){return t[o]<0},function(t,n){return t[o]>n})},h=function(t){return p(m,t,n,"top")},v=function(t){return p(g,t,a,"bottom")};je().deviceType.isTouch()&&(c.on("TableSelectionChange",function(n){t.get()||(ol(e,m),ol(e,g),t.set(!0)),i.set(st.some(n.start)),u.set(st.some(n.finish)),n.otherCells.each(function(t){o.set(t.upOrLeftCells),r.set(t.downOrRightCells),h(n.start),v(n.finish)})}),c.on("ResizeEditor ResizeWindow ScrollContent",function(){i.get().each(h),u.get().each(v)}),c.on("TableSelectionClear",function(){t.get()&&(ul(m),ul(g),t.set(!1)),i.set(st.none()),u.set(st.none())}))};(WE=UE=UE||{})[WE.None=0]="None",WE[WE.Both=1]="Both",WE[WE.Vertical=2]="Vertical";var kM,CM,OM,_M=function(t,n,e){var o,r,i,u,a,c,s=me.fromDom(t.getContainer()),l=(o=t,r=n,i=e,u=bu(s),a=_u(s),(c={}).height=YB(u+r.top,yv(o),wv(o)),i===UE.Both&&(c.width=YB(a+r.left,bv(o),xv(o))),c);_t(l,function(t,n){return qi(s,n,XB(t))}),t.fire("ResizeEditor")},TM=function(i,u,a){u.delimiter||(u.delimiter="\xbb");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ic([ug.config({mode:"flow",selector:"div[role=button]"}),gv.config({disabled:a.isDisabled}),Lv(),Jy.config({}),fg.config({}),dg("elementPathEvents",[sr(function(r,t){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return ug.focusIn(r)}),i.on("NodeChange",function(t){var n,o,e=function(t){for(var n=[],e=t.length;0<e--;){var o=t[e];if(1===o.nodeType&&!function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1}(o)){var r=i.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||n.push({name:r.name,element:o}),r.isPropagationStopped())break}}return n}(t.parents);0<e.length?fg.set(r,(n=V(e||[],function(n,t){return mp.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":t,"tab-index":-1,"aria-level":t+1},innerHtml:n.name},action:function(t){i.focus(),i.selection.select(n.element),i.nodeChanged()},buttonBehaviours:ic([Uv(a.isDisabled),Lv()])})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+u.delimiter+" "}},N(n.slice(1),function(t,n){var e=t;return e.push(o),e.push(n),e},[n[0]]))):fg.set(r,[])})})])]),components:[]}},EM=function(u,a){var t,n,e,o,r,i;return{dom:{tag:"div",classes:["tox-statusbar"]},components:(r=function(){var t,o,n,r,e,i=[];return u.getParam("elementpath",!0,"boolean")&&i.push(TM(u,{},a)),u.hasPlugin("wordcount")&&i.push((t=u,o=a,r=function(t,n,e){return fg.set(t,[fu(o.translate(["{0} "+e,n[e]]))])},mp.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:ic([Uv(o.isDisabled),Lv(),Jy.config({}),fg.config({}),Nl.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),dg("wordcount-events",[dr(function(t){var n=Nl.getValue(t),e="words"===n.mode?"characters":"words";Nl.setValue(t,{mode:e,count:n.count}),r(t,n.count,e)}),sr(function(e){t.on("wordCountUpdate",function(t){var n=Nl.getValue(e).mode;Nl.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)})})])]),eventOrder:((n={})[_o()]=["disabling","alloy.base.behaviour","wordcount-events"],n)}))),u.getParam("branding",!0,"boolean")&&i.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(e=tv.translate(["Powered by {0}","Tiny"]))+'">'+e+"</a>"}}),0<i.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:i}]:[]}(),n=!(t=u).hasPlugin("autoresize"),(i=!1===(e=t.getParam("resize",n))?UE.None:"both"===e?UE.Both:UE.Vertical)!==UE.None&&r.push((o=i,{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:a.translate("Resize"),"aria-hidden":"true"},innerHtml:hp("resize-handle",a.icons)},behaviours:ic([bM.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,n,e){_M(u,e,o)},blockerClass:"tox-blocker"})])})),r)}},DM=function(x){var t,n,e,o=x.inline,w=o?QB:WB,S=Vv(x)?iB:AD,r=st.none(),i=je(),u=i.browser.isIE()?["tox-platform-ie"]:[],a=i.deviceType.isTouch()?["tox-platform-touch"]:[],c=Av(x),s=Ge(Wi(),Iv(x)),l=tv.isRtl()?{attributes:{dir:"rtl"}}:{},f={attributes:((t={})[jc]=c?na.BottomToTop:na.TopToBottom,t)},k=function(){return r.bind(DB.getHeader)},d=function(){qi(ot.element,"width",document.body.clientWidth+"px")},C=gu((n={dom:it({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(u).concat(a)},l),behaviours:ic([Qs.config({useFixed:function(){return S.isDocked(k)}})])},e={dom:{styles:{width:document.body.clientWidth+"px"}},events:Zo([er(Vo(),d)])},zt(n,s?e:{}))),O=function(){return dt.value(C)},m=gp({dom:{tag:"div",classes:["tox-anchorbar"]}}),_=function(){return r.bind(function(t){return DB.getThrobber(t)}).getOrDie("Could not find throbber element")},T=$_(C,x,function(){return r.bind(function(t){return m.getOpt(t)}).getOrDie("Could not find a anchor bar element")}),g=DB.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:T,onEscape:function(){x.focus()}}),E=Ev(x),p=DB.parts.toolbar(it({dom:{tag:"div",classes:["tox-toolbar"]},getSink:O,providers:T.shared.providers,onEscape:function(){x.focus()},type:E,lazyToolbar:function(){return r.bind(function(t){return DB.getToolbar(t)}).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return k().getOrDie("Could not find header element")}},f)),h=DB.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:T.shared.providers,onEscape:function(){x.focus()},type:E}),v=DB.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),b=DB.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),y=DB.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:T}),D=x.getParam("statusbar",!0,"boolean")&&!o?st.some(EM(x,T.shared.providers)):st.none(),B={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[v,b]},A=Ov(x),M=kv(x),F=Sv(x),I=DB.parts.header({dom:it({tag:"div",classes:["tox-editor-header"]},f),components:ft([F?[g]:[],A?[h]:M?[p]:[],Fv(x)?[]:[m.asSpec()]]),sticky:Vv(x),editor:x,sharedBackstage:T.shared}),R=ft([c?[]:[I],o?[]:[B],c?[I]:[]]),V=ft([[{dom:{tag:"div",classes:["tox-editor-container"]},components:R}],o?[]:D.toArray(),[y]]),P=Rv(x),H=it(it({role:"application"},tv.isRtl()?{dir:"rtl"}:{}),P?{"aria-hidden":"true"}:{}),z=gu(DB.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(o?["tox-tinymce-inline"]:[]).concat(c?["tox-tinymce--toolbar-bottom"]:[]).concat(a).concat(u),styles:it({visibility:"hidden"},P?{opacity:"0",border:"0"}:{}),attributes:H},components:V,behaviours:ic([Lv(),gv.config({disableClass:"tox-tinymce--disabled"}),ug.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a"})])})),r=st.some(z);x.shortcuts.add("alt+F9","focus menubar",function(){DB.focusMenubar(z)}),x.shortcuts.add("alt+F10","focus toolbar",function(){DB.focusToolbar(z)}),x.addCommand("ToggleToolbarDrawer",function(){DB.toggleToolbarDrawer(z)}),x.addQueryStateHandler("ToggleToolbarDrawer",function(){return DB.isToolbarDrawerToggled(z)});var N,L,j,U,W,G,X,Y,q,K,J,$,Q,Z,tt,nt,et=Wy(z),ot=Wy(C);N=x,L=et,j=ot,U=function(n,e){lt([L,j],function(t){t.broadcastEvent(n,e)})},W=function(n,e){lt([L,j],function(t){t.broadcastOn([n],e)})},G=function(t){return W(wl(),{target:t.target})},X=yy(me.fromDom(document),"touchstart",G),Y=yy(me.fromDom(document),"touchmove",function(t){return U(Fo(),t)}),q=yy(me.fromDom(document),"touchend",function(t){return U(Io(),t)}),K=yy(me.fromDom(document),"mousedown",G),J=yy(me.fromDom(document),"mouseup",function(t){0===t.raw.button&&W(kl(),{target:t.target})}),$=function(t){return W(wl(),{target:me.fromDom(t.target)})},Q=function(t){0===t.button&&W(kl(),{target:me.fromDom(t.target)})},Z=function(t){return U(Ro(),wy(t))},tt=function(t){W(Sl(),{}),U(Vo(),wy(t))},nt=function(){return W(Sl(),{})},N.on("PostRender",function(){N.on("click",$),N.on("tap",$),N.on("mouseup",Q),N.on("ScrollWindow",Z),N.on("ResizeWindow",tt),N.on("ResizeEditor",nt)}),N.on("remove",function(){N.off("click",$),N.off("tap",$),N.off("mouseup",Q),N.off("ScrollWindow",Z),N.off("ResizeWindow",tt),N.off("ResizeEditor",nt),K.unbind(),X.unbind(),Y.unbind(),q.unbind(),J.unbind()}),N.on("detach",function(){ll(L),ll(j),L.destroy(),j.destroy()});var rt=function(){var t,n=XB(qB(x)),e=XB(KB(t=x).getOr(vv(t)));return x.inline||(tu("div","width",e)&&qi(z.element,"width",e),tu("div","height",n)?qi(z.element,"height",n):qi(z.element,"height","200px")),n};return{mothership:et,uiMothership:ot,backstage:T,renderUI:function(){var o,r,e,n,i,u,a,c;S.setup(x,T.shared,k),fA(x,T),MA(x,O,T),r=(o=x).ui.registry.getAll().sidebars,lt(Ct(r),function(n){var t=r[n],e=function(){return st.from(o.queryCommandValue("ToggleSidebar")).is(n)};o.ui.registry.addToggleButton(n,{icon:t.icon,tooltip:t.tooltip,onAction:function(t){o.execCommand("ToggleSidebar",!1,n),t.setActive(e())},onSetup:function(t){var n=function(){return t.setActive(e())};return o.on("ToggleSidebar",n),function(){o.off("ToggleSidebar",n)}}})}),e=x,n=_,i=T.shared,u=fe(!1),a=fe(st.none()),c=function(t){t!==u.get()&&(wB(n(),t,i.providers),u.set(t))},e.on("ProgressState",function(t){var n;a.get().each(dp.clearTimeout),ut(t.time)?(n=dp.setEditorTimeout(e,function(){return c(t.state)},t.time),a.set(st.some(n))):(c(t.state),a.set(st.none()))}),Tt(x.getParam("toolbar_groups",{},"object"),function(t,n){x.ui.registry.addGroupToolbarButton(n,t)});var t,s=x.ui.registry.getAll(),l=s.buttons,f=s.menuItems,d=s.contextToolbars,m=s.sidebars,g=Cv(x),p={menuItems:f,menus:(t=x.getParam("menu"))?Tt(t,function(t){return it(it({},t),{items:t.items})}):{},menubar:x.getParam("menubar"),toolbar:g.getOrThunk(function(){return x.getParam("toolbar",!0)}),allowToolbarGroups:E===rh.floating,buttons:l,sidebar:m};wD(x,d,C,{backstage:T}),SM(x,C);var h=x.getElement(),v=rt(),b={mothership:et,uiMothership:ot,outerContainer:z},y={targetNode:h,height:v};return w.render(x,b,p,T,y)},getUi:function(){return{channels:{broadcastAll:ot.broadcast,broadcastOn:ot.broadcastOn,register:function(){}}}}}},BM=at([Ln("lazySink"),Kn("dragBlockClass"),ae("getBounds",Lu),ne("useTabstopAt",b),ne("eventOrder",{}),Ll("modalBehaviours",[ug]),pa("onExecute"),va("onEscape")]),AM={sketch:ct},MM=at([yf({name:"draghandle",overrides:function(t,n){return{behaviours:ic([bM.config({mode:"mouse",getTarget:function(t){return qu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(n,null,2)).message),getBounds:t.getDragBounds})])}}}),vf({schema:[Ln("dom")],name:"title"}),vf({factory:AM,schema:[Ln("dom")],name:"close"}),vf({factory:AM,schema:[Ln("dom")],name:"body"}),yf({factory:AM,schema:[Ln("dom")],name:"footer"}),bf({factory:{sketch:function(t,n){return it(it({},t),{dom:n.dom,components:n.components})}},schema:[ne("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),ne("components",[])],name:"blocker"})]),FM=/* */Object.freeze({__proto__:null,block:function(t,n,e,o){zr(t.element,"aria-busy",!0);var r=n.getRoot(t).getOr(t),i=ic([ug.config({mode:"special",onTab:function(){return st.some(!0)},onShiftTab:function(){return st.some(!0)}}),vg.config({})]),u=o(r,i),a=r.getSystem().build(u);fg.append(r,pu(a)),a.hasConfigured(ug)&&ug.focusIn(a),e.isBlocked()||n.onBlock(t),e.blockWith(function(){return fg.remove(r,a)})},unblock:function(t,n,e){Ur(t.element,"aria-busy"),e.isBlocked()&&n.onUnblock(t),e.clear()}}),IM=[ae("getRoot",st.none),ga("onBlock"),ga("onUnblock")],RM=ac({fields:IM,name:"blocking",apis:FM,state:/* */Object.freeze({__proto__:null,init:function(){var n=rD();return di({readState:n.isSet,blockWith:function(t){n.set({destroy:t})},clear:n.clear,isBlocked:n.isSet})}})}),VM=qf({name:"ModalDialog",configFields:BM(),partFields:MM(),factory:function(a,t,n,r){var e,i=fe(st.none()),o=Kr("modal-events"),u=it(it({},a.eventOrder),((e={})[Po()]=[o].concat(a.eventOrder["alloy.system.attached"]||[]),e));return{uid:a.uid,dom:a.dom,components:t,apis:{show:function(t){i.set(st.some(t));var n=a.lazySink(t).getOrDie(),e=r.blocker(),o=n.getSystem().build(it(it({},e),{components:e.components.concat([pu(t)]),behaviours:ic([vg.config({}),dg("dialog-blocker-events",[cr(lo(),function(){ug.focusIn(t)})])])}));ol(n,o),ug.focusIn(t)},hide:function(n){i.set(st.none()),kr(n.element).each(function(t){n.getSystem().getByDom(t).each(function(t){ul(t)})})},getBody:function(t){return Mf(t,a,"body")},getFooter:function(t){return Mf(t,a,"footer")},setIdle:function(t){RM.unblock(t)},setBusy:function(t,n){RM.block(t,n)}},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Ul(a.modalBehaviours,[fg.config({}),ug.config({mode:"cyclic",onEnter:a.onExecute,onEscape:a.onEscape,useTabstopAt:a.useTabstopAt}),RM.config({getRoot:i.get}),dg(o,[sr(function(t){var n,e,o,r,i,u;n=t.element,e=Mf(t,a,"title").element,o=Lr(n,"id").fold(function(){var t=Kr("dialog-label");return zr(e,"id",t),t},ct),zr(n,"aria-labelledby",o),r=t.element,i=Mf(t,a,"body").element,u=st.from(Nr(r,"id")).fold(function(){var t=Kr("dialog-describe");return zr(i,"id",t),t},ct),zr(r,"aria-describedby",u)})])])}},apis:{show:function(t,n){t.show(n)},hide:function(t,n){t.hide(n)},getBody:function(t,n){return t.getBody(n)},getFooter:function(t,n){return t.getFooter(n)},setBusy:function(t,n,e){t.setBusy(n,e)},setIdle:function(t,n){t.setIdle(n)}}}),PM=fn([Un("type"),Un("name")].concat(Rh)),HM=Vn,zM=[bn("name","name",Xt(function(){return Kr("button-name")}),Rn),Qn("icon"),ie("align","end",["start","end"]),ue("primary",!1),ue("disabled",!1)],NM=S(zM,[Un("text")]),LM=S([Wn("type",["submit","cancel","custom"])],NM),jM=S([Wn("type",["menu"]),Qn("text"),Qn("tooltip"),Qn("icon"),qn("items",PM)],zM),UM=An("type",{submit:LM,cancel:LM,custom:LM,menu:jM}),WM=[Un("type"),Un("text"),Wn("level",["info","warn","error","success"]),Un("icon"),ne("url","")],GM=fn(WM),XM=[Un("type"),Un("text"),ue("disabled",!1),ue("primary",!1),bn("name","name",Xt(function(){return Kr("button-name")}),Rn),Qn("icon"),ue("borderless",!1)],YM=fn(XM),qM=[Un("type"),Un("name"),Un("label"),ue("disabled",!1)],KM=fn(qM),JM=Vn,$M=[Un("type"),Un("name")],QM=$M.concat([Qn("label")]),ZM=QM.concat([ne("columns","auto")]),tF=fn(ZM),nF=Sn([Un("value"),Un("text"),Un("icon")]),eF=fn(QM),oF=Rn,rF=fn(QM),iF=Rn,uF=$M.concat([re("tag","textarea"),Un("scriptId"),Un("scriptUrl"),(kM=undefined,ee("settings",kM,zn))]),aF=$M.concat([re("tag","textarea"),Gn("init")]),cF=Cn(function(t){return _n("customeditor.old",ln(aF),t).orThunk(function(){return _n("customeditor.new",ln(uF),t)})}),sF=Rn,lF=fn(QM),fF=dn(wn),dF=function(t){return[Un("type"),jn("columns",In),t]},mF=[Un("type"),Un("html"),ie("presets","presentation",["presentation","document"])],gF=fn(mF),pF=QM.concat([ue("sandboxed",!0)]),hF=fn(pF),vF=Rn,bF=QM.concat([jn("currentState",fn([Ln("blob"),Un("url")]))]),yF=fn(bF),xF=QM.concat([Qn("inputMode"),Qn("placeholder"),ue("maximized",!1),ue("disabled",!1)]),wF=fn(xF),SF=Rn,kF=[Un("text"),Un("value")],CF=[Un("text"),qn("items",(CM=function(){return OF},OM=Lt(function(){return CM()}),{extract:function(t,n,e){return OM().extract(t,n,e)},toString:function(){return OM().toString()}}))],OF=mn([fn(kF),fn(CF)]),_F=QM.concat([qn("items",OF),ue("disabled",!1)]),TF=fn(_F),EF=Rn,DF=QM.concat([Yn("items",[Un("text"),Un("value")]),oe("size",1),ue("disabled",!1)]),BF=fn(DF),AF=Rn,MF=QM.concat([ue("constrain",!0),ue("disabled",!1)]),FF=fn(MF),IF=fn([Un("width"),Un("height")]),RF=[Un("type"),qn("header",Rn),qn("cells",dn(Rn))],VF=fn(RF),PF=QM.concat([Qn("placeholder"),ue("maximized",!1),ue("disabled",!1)]),HF=fn(PF),zF=Rn,NF=QM.concat([ie("filetype","file",["image","media","file"]),ne("disabled",!1)]),LF=fn(NF),jF=fn([Un("value"),ne("meta",{})]),UF=function(n){return bn("items","items",Wt(),dn(Cn(function(t){return _n("Checking item of "+n,WF,t).fold(function(t){return dt.error(Dn(t))},function(t){return dt.value(t)})})))},WF=kn(function(){return Bn("type",{alertbanner:GM,bar:fn((n=UF("bar"),[Un("type"),n])),button:YM,checkbox:KM,colorinput:eF,colorpicker:rF,dropzone:lF,grid:fn(dF(UF("grid"))),iframe:hF,input:wF,listbox:TF,selectbox:BF,sizeinput:FF,textarea:HF,urlinput:LF,customeditor:cF,htmlpanel:gF,imagetools:yF,collection:tF,label:fn((t=UF("label"),[Un("type"),Un("label"),t])),table:VF,panel:XF});var t,n}),GF=[Un("type"),ne("classes",[]),qn("items",WF)],XF=fn(GF),YF=[bn("name","name",Xt(function(){return Kr("tab-name")}),Rn),Un("title"),qn("items",WF)],qF=[Un("type"),Yn("tabs",YF)],KF=fn(qF),JF=NM,$F=UM,QF=fn([Un("title"),jn("body",Bn("type",{panel:XF,tabpanel:KF})),re("size","normal"),qn("buttons",$F),ne("initialData",{}),ae("onAction",$),ae("onChange",$),ae("onSubmit",$),ae("onClose",$),ae("onCancel",$),ne("onTabChange",$)]),ZF=fn(S([Wn("type",["cancel","custom"])],JF)),tI=fn([Un("title"),Un("url"),$n("height"),$n("width"),Jn("buttons",dn(ZF)),ae("onAction",$),ae("onCancel",$),ae("onClose",$),ae("onMessage",$)]),nI=function(t){return C(t)?[t].concat(U(Mt(t),nI)):p(t)?U(t,nI):[]},eI=function(t){return k(t.type)&&k(t.name)},oI={checkbox:JM,colorinput:oF,colorpicker:iF,dropzone:fF,input:SF,iframe:vF,sizeinput:IF,selectbox:AF,listbox:EF,size:IF,textarea:zF,urlinput:jF,customeditor:sF,collection:nF,togglemenuitem:HM},rI=function(t){var n=H(nI(t),eI),e=U(n,function(n){return t=n,st.from(oI[t.type]).fold(function(){return[]},function(t){return[jn(n.name,t)]});var t});return fn(e)},iI=function(t){return{internalDialog:Tn(_n("dialog",QF,t)),dataValidator:rI(t),initialData:t.initialData}},uI={open:function(t,n){var e=iI(n);return t(e.internalDialog,e.initialData,e.dataValidator)},openUrl:function(t,n){return t(Tn(_n("dialog",tI,n)))},redial:iI},aI=function(t){var e=[],o={};return _t(t,function(t,n){t.fold(function(){e.push(n)},function(t){o[n]=t})}),0<e.length?dt.error(e):dt.value(o)},cI=Yf({name:"TabButton",configFields:[ne("uid",undefined),Ln("value"),bn("dom","dom",Yt(function(){return{attributes:{role:"tab",id:Kr("aria"),"aria-selected":"false"}}}),Mn()),Kn("action"),ne("domModification",{}),Ll("tabButtonBehaviours",[vg,ug,Nl]),Ln("view")],factory:function(t,n){return{uid:t.uid,dom:t.dom,components:t.components,events:Ag(t.action),behaviours:Ul(t.tabButtonBehaviours,[vg.config({}),ug.config({mode:"execution",useSpace:!0,useEnter:!0}),Nl.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),sI=at([Ln("tabs"),Ln("dom"),ne("clickToDismiss",!1),Ll("tabbarBehaviours",[fd,ug]),da(["tabClass","selectedClass"])]),lI=xf({factory:cI,name:"tabs",unit:"tab",overrides:function(o){var r=function(t,n){fd.dehighlight(t,n),qo(t,Wo(),{tabbar:t,button:n})},i=function(t,n){fd.highlight(t,n),qo(t,Uo(),{tabbar:t,button:n})};return{action:function(t){var n=t.getSystem().getByUid(o.uid).getOrDie(),e=fd.isHighlighted(n,t);(e&&o.clickToDismiss?r:e?$:i)(n,t)},domModification:{classes:[o.markers.tabClass]}}}}),fI=at([lI]),dI=qf({name:"Tabbar",configFields:sI(),partFields:fI(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Ul(t.tabbarBehaviours,[fd.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,n){zr(n.element,"aria-selected","true")},onDehighlight:function(t,n){zr(n.element,"aria-selected","false")}}),ug.config({mode:"flow",getInitial:function(t){return fd.getHighlighted(t).map(function(t){return t.element})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),mI=Yf({name:"Tabview",configFields:[Ll("tabviewBehaviours",[fg])],factory:function(t,n){return{uid:t.uid,dom:t.dom,behaviours:Ul(t.tabviewBehaviours,[fg.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),gI=at([ne("selectFirst",!0),ga("onChangeTab"),ga("onDismissTab"),ne("tabs",[]),Ll("tabSectionBehaviours",[])]),pI=vf({factory:dI,schema:[Ln("dom"),Xn("markers",[Ln("tabClass"),Ln("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),hI=vf({factory:mI,name:"tabview"}),vI=at([pI,hI]),bI=qf({name:"TabSection",configFields:gI(),partFields:vI(),factory:function(i,t,n,e){var o=function(t,n){Af(t,i,"tabbar").each(function(t){n(t).each(Ko)})};return{uid:i.uid,dom:i.dom,components:t,behaviours:jl(i.tabSectionBehaviours),events:Zo(ft([i.selectFirst?[sr(function(t,n){o(t,fd.getFirst)})]:[],[er(Uo(),function(t,n){var o,r,e=n.event.button;o=e,r=Nl.getValue(o),Af(o,i,"tabview").each(function(e){L(i.tabs,function(t){return t.value===r}).each(function(t){var n=t.view();Lr(o.element,"id").each(function(t){zr(e.element,"aria-labelledby",t)}),fg.set(e,n),i.onChangeTab(e,o,n)})})}),er(Wo(),function(t,n){var e=n.event.button;i.onDismissTab(t,e)})]])),apis:{getViewItems:function(t){return Af(t,i,"tabview").map(function(t){return fg.contents(t)}).getOr([])},showTab:function(t,e){o(t,function(n){var t=fd.getCandidates(n);return L(t,function(t){return Nl.getValue(t)===e}).filter(function(t){return!fd.isHighlighted(n,t)})})}}}},apis:{getViewItems:function(t,n){return t.getViewItems(n)},showTab:function(t,n,e){t.showTab(n,e)}}}),yI=function(t,n){qi(t,"height",n+"px"),je().browser.isIE()?nu(t,"flex-basis"):qi(t,"flex-basis",n+"px")},xI=function(t,m,n){qu(t,'[role="dialog"]').each(function(d){Ku(d,'[role="tablist"]').each(function(f){n.get().map(function(t){return qi(m,"height","0"),qi(m,"flex-basis","0"),Math.min(t,(e=m,o=f,r=wr(n=d).dom,i=qu(n,".tox-dialog-wrap").getOr(n),u="fixed"===$i(i,"position")?Math.max(r.clientHeight,window.innerHeight):Math.max(r.offsetHeight,r.scrollHeight),a=bu(e),c=e.dom.offsetLeft>=o.dom.offsetLeft+_u(o)?Math.max(bu(o),a):a,s=parseInt($i(n,"margin-top"),10)||0,l=parseInt($i(n,"margin-bottom"),10)||0,u-(bu(n)+s+l-c)));var n,e,o,r,i,u,a,c,s,l}).each(function(t){yI(m,t)})})})},wI=function(t){return Ku(t,'[role="tabpanel"]')},SI=function(a){var c;return{smartTabHeight:(c=fe(st.none()),{extraEvents:[sr(function(t){var e=t.element;wI(e).each(function(u){var n;qi(u,"visibility","hidden"),t.getSystem().getByDom(u).toOptional().each(function(t){var o,r,i,n=(r=u,i=t,V(o=a,function(t,n){fg.set(i,o[n].view());var e=r.dom.getBoundingClientRect();return fg.set(i,[]),e.height})),e=K(Y(n,function(t,n){return n<t?-1:t<n?1:0}));c.set(e)}),xI(e,u,c),nu(u,"visibility"),n=t,K(a).each(function(t){return bI.showTab(n,t.value)}),dp.requestAnimationFrame(function(){xI(e,u,c)})})}),er(Vo(),function(t){var n=t.element;wI(n).each(function(t){xI(n,t,c)})}),er(lx,function(t,n){var r=t.element;wI(r).each(function(n){var t=gc();qi(n,"visibility","hidden");var e=Zi(n,"height").map(function(t){return parseInt(t,10)});nu(n,"height"),nu(n,"flex-basis");var o=n.dom.getBoundingClientRect().height;e.forall(function(t){return t<o})?(c.set(st.from(o)),xI(r,n,c)):e.each(function(t){yI(n,t)}),nu(n,"visibility"),t.each(mc)})})],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},kI="send-data-to-section",CI="send-data-to-view",OI=Kr("update-dialog"),_I=Kr("update-title"),TI=Kr("update-body"),EI=Kr("update-footer"),DI=Kr("body-send-message"),BI=function(t,n,d,e){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:it(it({},n.map(function(t){return{id:t}}).getOr({})),e?{"aria-live":"polite"}:{})},components:[],behaviours:ic([rk(0),aE.config({channel:TI,updateState:function(t,n){return st.some({isTabPanel:function(){return"tabpanel"===n.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[(r=t.body,i=d,u=fe({}),a=function(t){var n=Nl.getValue(t),e=aI(n).getOr({}),o=u.get(),r=zt(o,e);u.set(r)},c=function(t){var n=u.get();Nl.setValue(t,n)},s=fe(null),l=V(r.tabs,function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:i.shared.providers.translate(t.title)},view:function(){return[qS.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"]},components:V(t.items,function(t){return f_(n,t,i)}),formBehaviours:ic([ug.config({mode:"acyclic",useTabstopAt:x(kk)}),dg("TabView.form.events",[sr(c),lr(a)]),fc.config({channels:$t([{key:kI,value:{onReceive:a}},{key:CI,value:{onReceive:c}}])})])}})]}}}),f=SI(l).smartTabHeight,bI.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,n,e){var o=Nl.getValue(n);qo(t,sx,{name:o,oldName:s.get()}),s.set(o)},tabs:l,components:[bI.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[dI.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ic([Jy.config({})])}),bI.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:f.selectFirst,tabSectionBehaviours:ic([dg("tabpanel",f.extraEvents),ug.config({mode:"acyclic"}),td.config({find:function(t){return K(bI.getViewItems(t))}}),Nl.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([kI],{}),u.get()},setValue:function(t,n){u.set(n),t.getSystem().broadcastOn([CI],{})}}})])}))];default:return[(e=t.body,o=d,{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[(n=gp(qS.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"].concat(e.classes)},components:V(e.items,function(t){return f_(n,t,o)})}}))).asSpec()]}],behaviours:ic([ug.config({mode:"acyclic",useTabstopAt:x(kk)}),ok(n),dk(n,{postprocess:function(t){return aI(t).fold(function(t){return console.error(t),{}},function(t){return t})}})])})]}var e,o,n,r,i,u,a,c,s,l,f},initialData:t})])}},AI=Zv.deviceType.isTouch(),MI=function(t,n){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,n]}},FI=function(t,n){return VM.parts.close(mp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close")}},action:t,buttonBehaviours:ic([Jy.config({})])}))},II=function(){return VM.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},RI=function(t,n){return VM.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:xB("<p>"+n.translate(t)+"</p>")}]}]})},VI=function(t){return VM.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},PI=function(t,n){return[Uy.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Uy.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]},HI=function(n){var t,e="tox-dialog",o=e+"-wrap",r=o+"__backdrop",i=e+"__disable-scroll";return VM.sketch({lazySink:n.lazySink,onEscape:function(t){return n.onEscape(t),st.some(!0)},useTabstopAt:function(t){return!kk(t)},dom:{tag:"div",classes:[e].concat(n.extraClasses),styles:it({position:"relative"},n.extraStyles)},components:S([n.header,n.body],n.footer.toArray()),parts:{blocker:{dom:xB('<div class="'+o+'"></div>'),components:[{dom:{tag:"div",classes:AI?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:ic(S([vg.config({}),dg("dialog-events",n.dialogEvents.concat([cr(lo(),function(t,n){ug.focusIn(t)})])),dg("scroll-lock",[sr(function(){Ei(Wi(),i)}),lr(function(){Bi(Wi(),i)})])],n.extraBehaviours)),eventOrder:it(((t={})[_o()]=["dialog-events"],t[Po()]=["scroll-lock","dialog-events","alloy.base.behaviour"],t[Ho()]=["alloy.base.behaviour","dialog-events","scroll-lock"],t),n.eventOrder)})},zI=function(t){return mp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:hp("close",t.icons)}}],action:function(t){Yo(t,rx)}})},NI=function(t,n,e){var o=function(t){return[fu(e.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:it({},n.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:ic([aE.config({channel:_I,renderComponents:o})])}},LI=function(){return{dom:xB('<div class="tox-dialog__draghandle"></div>')}},jI=function(t,n){return e={title:n.shared.providers.translate(t),draggable:n.dialog.isDraggableModal()},o=n.shared.providers,r=VM.parts.title(NI(e,st.none(),o)),i=VM.parts.draghandle(LI()),u=VM.parts.close(zI(o)),a=[r].concat(e.draggable?[i]:[]).concat([u]),Uy.sketch({dom:xB('<div class="tox-dialog__header"></div>'),components:a});var e,o,r,i,u,a},UI=function(t,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":t},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:n,components:[{dom:xB('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},WI=function(t,n){return{onClose:function(){return n.closeWindow()},onBlock:function(e){VM.setBusy(t(),function(t,n){return UI(e.message,n)})},onUnblock:function(){VM.setIdle(t())}}},GI=function(t,n,e,o){var r;return gu(HI(it(it({},t),{lazySink:o.shared.getSink,extraBehaviours:S([aE.config({channel:OI,updateState:function(t,n){return st.some(n)},initialData:n}),pk({})],t.extraBehaviours),onEscape:function(t){Yo(t,rx)},dialogEvents:e,eventOrder:((r={})[Oo()]=[aE.name(),fc.name()],r[Po()]=["scroll-lock",aE.name(),"messages","dialog-events","alloy.base.behaviour"],r[Ho()]=["alloy.base.behaviour","dialog-events","messages",aE.name(),"scroll-lock"],r)})))},XI=function(t){return V(t,function(t){return"menu"===t.type?(e=V((n=t).items,function(t){var n=fe(!1);return it(it({},t),{storage:n})}),it(it({},n),{items:e})):t;var n,e})},YI=function(t){return N(t,function(t,n){return"menu"!==n.type?t:N(n.items,function(t,n){return t[n.name]=n.storage,t},t)},{})},qI=function(t,e){return[ur(lo(),Sk),t(ox,function(t,n){e.onClose(),n.onClose()}),t(rx,function(t,n,e,o){n.onCancel(t),Yo(o,ox)}),er(cx,function(t,n){return e.onUnblock()}),er(ax,function(t,n){return e.onBlock(n.event)})]},KI=function(i,t){var n=function(t,r){return er(t,function(e,o){u(e,function(t,n){r(i(),t,o.event,e)})})},u=function(n,e){aE.getState(n).get().each(function(t){e(t,n)})};return S(qI(n,t),[n(ix,function(t,n,e){n.onAction(t,{name:e.name})})])},JI=function(i,t,c){var n=function(t,r){return er(t,function(e,o){u(e,function(t,n){r(i(),t,o.event,e)})})},u=function(n,e){aE.getState(n).get().each(function(t){e(t.internalDialog,n)})};return S(qI(n,t),[n(ux,function(t,n){return n.onSubmit(t)}),n(ex,function(t,n,e){n.onChange(t,{name:e.name})}),n(ix,function(t,n,e,o){var r=function(){return ug.focusIn(o)},i=function(t){return jr(t,"disabled")||Lr(t,"aria-disabled").exists(function(t){return"true"===t})},u=Hi(o.element),a=gc(u);n.onAction(t,{name:e.name,value:e.value}),gc(u).fold(r,function(n){i(n)||a.exists(function(t){return Ye(n,t)&&i(t)})?r():c().toOptional().filter(function(t){return!Ye(t.element,n)}).each(r)})}),n(sx,function(t,n,e){n.onTabChange(t,{newTabName:e.name,oldTabName:e.oldName})}),lr(function(t){var n=i();Nl.setValue(t,n.getData())})])},$I=function(t,n){var e=n.map(function(t){return t.footerButtons}).getOr([]),o=P(e,function(t){return"start"===t.align}),r=function(t,n){return Uy.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:V(n,function(t){return t.memento.asSpec()})})};return[r("start",o.pass),r("end",o.fail)]},QI=function(t,i){return{dom:xB('<div class="tox-dialog__footer"></div>'),components:[],behaviours:ic([aE.config({channel:EI,initialData:t,updateState:function(t,n){var r=V(n.buttons,function(t){var n,e,o=gp((e=i,QC(n=t,n.type,e)));return{name:t.name,align:t.align,memento:o}});return st.some({lookupByName:function(t,n){return e=t,o=n,L(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(e)});var e,o},footerButtons:r})},renderComponents:$I})])}},ZI=QI,tR=function(t,n){return VM.parts.footer(QI(t,n))},nR=function(n,e){if(n.getRoot().getSystem().isConnected()){var o=td.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return qS.getField(o,e).fold(function(){var t=n.getFooter();return aE.getState(t).get().bind(function(t){return t.lookupByName(o,e)})},function(t){return st.some(t)})}return st.none()},eR=function(c,o,s){var t=function(t){var n=c.getRoot();n.getSystem().isConnected()&&t(n)},l={getData:function(){var t=c.getRoot(),n=t.getSystem().isConnected()?c.getFormWrapper():t,e=Nl.getValue(n),o=Tt(s,function(t){return t.get()});return it(it({},e),o)},setData:function(a){t(function(t){var n,e,o=l.getData(),r=it(it({},o),a),i=(n=r,e=c.getRoot(),aE.getState(e).get().map(function(t){return Tn(_n("data",t.dataValidator,n))}).getOr(n)),u=c.getFormWrapper();Nl.setValue(u,i),_t(s,function(t,n){It(r,n)&&t.set(r[n])})})},disable:function(t){nR(c,t).each(gv.disable)},enable:function(t){nR(c,t).each(gv.enable)},focus:function(t){nR(c,t).each(vg.focus)},block:function(n){if(!k(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){qo(t,ax,{message:n})})},unblock:function(){t(function(t){Yo(t,cx)})},showTab:function(e){t(function(t){var n=c.getBody();aE.getState(n).get().exists(function(t){return t.isTabPanel()})&&td.getCurrent(n).each(function(t){bI.showTab(t,e)})})},redial:function(e){t(function(t){var n=o(e);t.getSystem().broadcastOn([OI],n),t.getSystem().broadcastOn([_I],n.internalDialog),t.getSystem().broadcastOn([TI],n.internalDialog),t.getSystem().broadcastOn([EI],n.internalDialog),l.setData(n.initialData)})},close:function(){t(function(t){Yo(t,ox)})}};return l},oR=function(t,n,e){var o,r,i,u=jI(t.internalDialog.title,e),a=(o={body:t.internalDialog.body},r=e,i=BI(o,st.none(),r,!1),VM.parts.body(i)),c=XI(t.internalDialog.buttons),s=YI(c),l=tR({buttons:c},e),f=JI(function(){return p},WI(function(){return g},n),e.shared.getSink),d=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),m={header:u,body:a,footer:st.some(l),extraClasses:d,extraBehaviours:[],extraStyles:{}},g=GI(m,t,f,e),p=eR({getRoot:function(){return g},getBody:function(){return VM.getBody(g)},getFooter:function(){return VM.getFooter(g)},getFormWrapper:function(){var t=VM.getBody(g);return td.getCurrent(t).getOr(t)}},n.redial,s);return{dialog:g,instanceApi:p}},rR=function(t,n,e,o){var r,i,u,a,c,s,l,f,d,m=Kr("dialog-label"),g=Kr("dialog-content"),p=gp((u={title:t.internalDialog.title,draggable:!0},a=m,c=e.shared.providers,Uy.sketch({dom:xB('<div class="tox-dialog__header"></div>'),components:[NI(u,st.some(a),c),LI(),zI(c)],containerBehaviours:ic([bM.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Ju(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),h=gp((s={body:t.internalDialog.body},l=g,f=e,d=o,BI(s,st.some(l),f,d))),v=XI(t.internalDialog.buttons),b=YI(v),y=gp(ZI({buttons:v},e)),x=JI(function(){return S},{onBlock:function(e){RM.block(w,function(t,n){return UI(e.message,n)})},onUnblock:function(){RM.unblock(w)},onClose:function(){return n.closeWindow()}},e.shared.getSink),w=gu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:((r={role:"dialog"})["aria-labelledby"]=m,r["aria-describedby"]=""+g,r)},eventOrder:((i={})[Oo()]=[aE.name(),fc.name()],i[_o()]=["execute-on-form"],i[Po()]=["reflecting","execute-on-form"],i),behaviours:ic([ug.config({mode:"cyclic",onEscape:function(t){return Yo(t,ox),st.some(!0)},useTabstopAt:function(t){return!kk(t)&&("button"!==mr(t)||"disabled"!==Nr(t,"disabled"))}}),aE.config({channel:OI,updateState:function(t,n){return st.some(n)},initialData:t}),vg.config({}),dg("execute-on-form",x.concat([cr(lo(),function(t,n){ug.focusIn(t)})])),RM.config({getRoot:function(){return st.some(w)}}),fg.config({}),pk({})]),components:[p.asSpec(),h.asSpec(),y.asSpec()]}),S=eR({getRoot:function(){return w},getFooter:function(){return y.get(w)},getBody:function(){return h.get(w)},getFormWrapper:function(){var t=h.get(w);return td.getCurrent(t).getOr(t)}},n.redial,b);return{dialog:w,instanceApi:S}},iR=tinymce.util.Tools.resolve("tinymce.util.URI"),uR=["insertContent","setContent","execCommand","close","block","unblock"],aR=function(t){return C(t)&&-1!==uR.indexOf(t.mceAction)},cR=function(o,t,r,n){var e,i,u,a,c=jI(o.title,n),s=(i={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[xk({dom:{tag:"iframe",attributes:{src:o.url}},behaviours:ic([Jy.config({}),vg.config({})])})]}],behaviours:ic([ug.config({mode:"acyclic",useTabstopAt:x(kk)})])},VM.parts.body(i)),l=o.buttons.bind(function(t){return 0===t.length?st.none():st.some(tR({buttons:t},n))}),f=KI(function(){return y},WI(function(){return b},t)),d=it(it({},o.height.fold(function(){return{}},function(t){return{height:t+"px","max-height":t+"px"}})),o.width.fold(function(){return{}},function(t){return{width:t+"px","max-width":t+"px"}})),m=o.width.isNone()&&o.height.isNone()?["tox-dialog--width-lg"]:[],g=new iR(o.url,{base_uri:new iR(window.location.href)}),p=g.protocol+"://"+g.host+(g.port?":"+g.port:""),h=fe(st.none()),v=[dg("messages",[sr(function(){var t=yy(me.fromDom(window),"message",function(t){var n,e;g.isSameOrigin(new iR(t.raw.origin))&&(n=t.raw.data,aR(n)?function(t,n,e){switch(e.mceAction){case"insertContent":t.insertContent(e.content);break;case"setContent":t.setContent(e.content);break;case"execCommand":var o=!!O(e.ui)&&e.ui;t.execCommand(e.cmd,o,e.value);break;case"close":n.close();break;case"block":n.block(e.message);break;case"unblock":n.unblock()}}(r,y,n):!aR(e=n)&&C(e)&&It(e,"mceAction")&&o.onMessage(y,n))});h.set(st.some(t))}),lr(function(){h.get().each(function(t){return t.unbind()})})]),fc.config({channels:((e={})[DI]={onReceive:function(t,n){Ku(t.element,"iframe").each(function(t){t.dom.contentWindow.postMessage(n,p)})}},e)})],b=GI({header:c,body:s,footer:l,extraClasses:m,extraBehaviours:v,extraStyles:d},o,f,n),y=(a=function(t){u.getSystem().isConnected()&&t(u)},{block:function(n){if(!k(n))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a(function(t){qo(t,ax,{message:n})})},unblock:function(){a(function(t){Yo(t,cx)})},close:function(){a(function(t){Yo(t,ox)})},sendMessage:function(n){a(function(t){t.getSystem().broadcastOn([DI],n)})}});return{dialog:u=b,instanceApi:y}},sR=function(t){var c,s,l,f,p=t.backstage,h=t.editor,v=Vv(h),e=(s=(c=t).backstage.shared,{open:function(t,n){var e=function(){VM.hide(u),n()},o=gp(QC({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:st.none()},"cancel",c.backstage)),r=II(),i=FI(e,s.providers),u=gu(HI({lazySink:function(){return s.getSink()},header:MI(r,i),body:RI(t,s.providers),footer:st.some(VI(PI([],[o.asSpec()]))),onEscape:e,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[er(rx,e)],eventOrder:{}}));VM.show(u);var a=o.get(u);vg.focus(a)}}),o=(f=(l=t).backstage.shared,{open:function(t,n){var e=function(t){VM.hide(a),n(t)},o=gp(QC({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:st.none()},"submit",l.backstage)),r=QC({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:st.none()},"cancel",l.backstage),i=II(),u=FI(function(){return e(!1)},f.providers),a=gu(HI({lazySink:function(){return f.getSink()},header:MI(i,u),body:RI(t,f.providers),footer:st.some(VI(PI([],[r,o.asSpec()]))),onEscape:function(){return e(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[er(rx,function(){return e(!1)}),er(ux,function(){return e(!0)})],eventOrder:{}}));VM.show(a);var c=o.get(a);vg.focus(c)}}),r=function(t,e){return uI.openUrl(function(t){var n=cR(t,{closeWindow:function(){VM.hide(n.dialog),e(n.instanceApi)}},h,p);return VM.show(n.dialog),n.instanceApi},t)},i=function(t,i){return uI.open(function(t,n,e){var o=n,r=oR({dataValidator:e,initialData:o,internalDialog:t},{redial:uI.redial,closeWindow:function(){VM.hide(r.dialog),i(r.instanceApi)}},p);return VM.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},t)},u=function(t,d,m,g){return uI.open(function(t,n,e){var o,r,i,u=Tn(_n("data",e,n)),a=(o=fe(st.none()),{clear:function(){return o.set(st.none())},set:function(t){return o.set(st.some(t))},isSet:function(){return o.get().isSome()},on:function(t){return o.get().each(t)}}),c=p.shared.header.isPositionedAtTop(),s=function(){return a.on(function(t){tp.reposition(t),$D.refresh(t)})},l=rR({dataValidator:e,initialData:u,internalDialog:t},{redial:uI.redial,closeWindow:function(){a.on(tp.hide),h.off("ResizeEditor",s),a.clear(),m(l.instanceApi)}},p,g),f=gu(tp.sketch(it(it({lazySink:p.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},c?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:ic(S([dg("window-manager-inline-events",[er(zo(),function(t,n){Yo(l.dialog,rx)})])],(r=h,i=c,v&&i?[]:[$D.config({contextual:{lazyContext:function(){return st.some(zu(me.fromDom(r.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]))),isExtraPart:function(t,n){return Sy(e=n,".tox-alert-dialog")||Sy(e,".tox-confirm-dialog");var e}})));return a.set(f),tp.showWithin(f,d,pu(l.dialog),st.some(Wi())),v&&c||($D.refresh(f),h.on("ResizeEditor",s)),l.instanceApi.setData(u),ug.focusIn(l.dialog),l.instanceApi},t)};return{open:function(t,n,e){return n!==undefined&&"toolbar"===n.inline?u(t,p.shared.anchors.inlineDialog(),e,n.ariaAttrs):n!==undefined&&"cursor"===n.inline?u(t,p.shared.anchors.cursor(),e,n.ariaAttrs):i(t,e)},openUrl:function(t,n){return r(t,n)},alert:function(t,n){e.open(t,function(){n()})},close:function(t){t.close()},confirm:function(t,n){o.open(t,function(t){n(t)})}}};t.add("silver",function(t){var n=DM(t),e=n.uiMothership,o=n.backstage,r=n.renderUI,i=n.getUi;vy(t,o.shared);var u=sR({editor:t,backstage:o});return{renderUI:r,getWindowManagerImpl:at(u),getNotificationManagerImpl:function(){return yp(0,{backstage:o},e)},ui:i()}})}();
|
9
|
+
!function(){"use strict";var $=function(){},i=function(e,o){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(o.apply(null,t))}},at=function(t){return function(){return t}},ct=function(t){return t};function y(o){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=r.concat(t);return o.apply(null,e)}}var x=function(n){return function(t){return!n(t)}},u=function(t){return function(){throw new Error(t)}},c=at(!1),b=at(!0),t=tinymce.util.Tools.resolve("tinymce.ThemeManager"),ut=function(){return(ut=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};function w(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]]);return e}function S(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;for(var o=Array(t),r=0,n=0;n<e;n++)for(var i=arguments[n],u=0,a=i.length;u<a;u++,r++)o[r]=i[u];return o}var n,e,o,r,s,a,l=function(){return f},f=(n=function(t){return t.isNone()},{fold:function(t,n){return t()},is:c,isSome:c,isNone:b,getOr:o=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:at(null),getOrUndefined:at(undefined),or:o,orThunk:e,map:l,each:$,bind:l,exists:c,forall:b,filter:l,equals:n,equals_:n,toArray:function(){return[]},toString:at("none()")}),d=function(e){var t=at(e),n=function(){return r},o=function(t){return t(e)},r={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:b,isNone:c,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return d(t(e))},each:function(t){t(e)},bind:o,exists:o,forall:o,filter:function(t){return t(e)?r:f},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(c,function(t){return n(e,t)})}};return r},st={some:d,none:l,from:function(t){return null===t||t===undefined?f:d(t)}},m=function(o){return function(t){return e=typeof(n=t),(null===n?"null":"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e)===o;var n,e}},g=function(n){return function(t){return typeof t===n}},k=m("string"),C=m("object"),p=m("array"),O=g("boolean"),h=(r=undefined,function(t){return r===t}),v=function(t){return!(null===(n=t)||n===undefined);var n},_=g("function"),lt=g("number"),T=function(t,n){if(p(t)){for(var e=0,o=t.length;e<o;++e)if(!n(t[e]))return!1;return!0}return!1},E=Array.prototype.slice,D=Array.prototype.indexOf,B=Array.prototype.push,A=function(t,n){return D.call(t,n)},M=function(t,n){return-1<A(t,n)},F=function(t,n){for(var e=0,o=t.length;e<o;e++){if(n(t[e],e))return!0}return!1},I=function(t,n){for(var e=[],o=0;o<t;o++)e.push(n(o));return e},R=function(t,n){for(var e=[],o=0;o<t.length;o+=n){var r=E.call(t,o,o+n);e.push(r)}return e},V=function(t,n){for(var e=t.length,o=new Array(e),r=0;r<e;r++){var i=t[r];o[r]=n(i,r)}return o},ft=function(t,n){for(var e=0,o=t.length;e<o;e++){n(t[e],e)}},P=function(t,n){for(var e=[],o=[],r=0,i=t.length;r<i;r++){var u=t[r];(n(u,r)?e:o).push(u)}return{pass:e,fail:o}},H=function(t,n){for(var e=[],o=0,r=t.length;o<r;o++){var i=t[o];n(i,o)&&e.push(i)}return e},z=function(t,n,e){return function(t,n){for(var e=t.length-1;0<=e;e--){n(t[e],e)}}(t,function(t){e=n(e,t)}),e},N=function(t,n,e){return ft(t,function(t){e=n(e,t)}),e},L=function(t,n){return function(t,n,e){for(var o=0,r=t.length;o<r;o++){var i=t[o];if(n(i,o))return st.some(i);if(e(i,o))break}return st.none()}(t,n,c)},j=function(t,n){for(var e=0,o=t.length;e<o;e++){if(n(t[e],e))return st.some(e)}return st.none()},dt=function(t){for(var n=[],e=0,o=t.length;e<o;++e){if(!p(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);B.apply(n,t[e])}return n},U=function(t,n){return dt(V(t,n))},W=function(t,n){for(var e=0,o=t.length;e<o;++e){if(!0!==n(t[e],e))return!1}return!0},G=function(t){var n=E.call(t,0);return n.reverse(),n},X=function(t,n){return H(t,function(t){return!M(n,t)})},Y=function(t,n){var e=E.call(t,0);return e.sort(n),e},q=function(t,n){return 0<=n&&n<t.length?st.some(t[n]):st.none()},K=function(t){return q(t,0)},J=function(t){return q(t,t.length-1)},Q=_(Array.from)?Array.from:function(t){return E.call(t)},Z=function(t,n){for(var e=0;e<t.length;e++){var o=n(t[e],e);if(o.isSome())return o}return st.none()},tt=function(e){return{is:function(t){return e===t},isValue:b,isError:c,getOr:at(e),getOrThunk:at(e),getOrDie:at(e),or:function(t){return tt(e)},orThunk:function(t){return tt(e)},fold:function(t,n){return n(e)},map:function(t){return tt(t(e))},mapError:function(t){return tt(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return st.some(e)}}},nt=function(e){return{is:c,isValue:c,isError:b,getOr:ct,getOrThunk:function(t){return t()},getOrDie:function(){return u(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return nt(e)},mapError:function(t){return nt(t(e))},each:$,bind:function(t){return nt(e)},exists:c,forall:b,toOptional:st.none}},mt={value:tt,error:nt,fromOption:function(t,n){return t.fold(function(){return nt(n)},tt)}};(a=s=s||{})[a.Error=0]="Error",a[a.Value=1]="Value";var et,ot,rt=function(t,n,e){return t.stype===s.Error?n(t.serror):e(t.svalue)},it=function(t){return{stype:s.Value,svalue:t}},gt=function(t){return{stype:s.Error,serror:t}},pt=function(t){return t.fold(gt,it)},ht=function(t){return rt(t,mt.error,mt.value)},vt=it,bt=function(t){var n=[],e=[];return ft(t,function(t){rt(t,function(t){return e.push(t)},function(t){return n.push(t)})}),{values:n,errors:e}},yt=gt,xt=function(t,n){return t.stype===s.Value?n(t.svalue):t},wt=function(t,n){return t.stype===s.Error?n(t.serror):t},St=function(t,n){return t.stype===s.Value?{stype:s.Value,svalue:n(t.svalue)}:t},kt=function(t,n){return t.stype===s.Error?{stype:s.Error,serror:n(t.serror)}:t},Ct=Object.keys,Ot=Object.hasOwnProperty,_t=function(t,n){for(var e=Ct(t),o=0,r=e.length;o<r;o++){var i=e[o];n(t[i],i)}},Tt=function(t,e){return Et(t,function(t,n){return{k:n,v:e(t,n)}})},Et=function(t,o){var r={};return _t(t,function(t,n){var e=o(t,n);r[e.k]=e.v}),r},Dt=function(t,n){var e,o,r,i,u={};return e=n,i=u,o=function(t,n){i[n]=t},r=$,_t(t,function(t,n){(e(t,n)?o:r)(t,n)}),u},Bt=function(t,e){var o=[];return _t(t,function(t,n){o.push(e(t,n))}),o},At=function(t,n){for(var e=Ct(t),o=0,r=e.length;o<r;o++){var i=e[o],u=t[i];if(n(u,i,t))return st.some(u)}return st.none()},Mt=function(t){return Bt(t,function(t){return t})},Ft=function(t,n){return It(t,n)?st.from(t[n]):st.none()},It=function(t,n){return Ot.call(t,n)},Rt=function(t,n){return It(t,n)&&t[n]!==undefined&&null!==t[n]},Vt=function(u){if(!p(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],e={};return ft(u,function(t,o){var n=Ct(t);if(1!==n.length)throw new Error("one and only one name per case");var r=n[0],i=t[r];if(e[r]!==undefined)throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!p(i))throw new Error("case arguments must be an array");a.push(r),e[r]=function(){var t=arguments.length;if(t!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+t);for(var e=new Array(t),n=0;n<e.length;n++)e[n]=arguments[n];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[o].apply(null,e)},match:function(t){var n=Ct(t);if(a.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+n.join(","));if(!W(a,function(t){return M(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+a.join(", "));return t[r].apply(null,e)},log:function(t){console.log(t,{constructors:a,constructor:r,params:e})}}}}),e},Pt=Object.prototype.hasOwnProperty,Ht=function(u){return function(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var e={},o=0;o<t.length;o++){var r=t[o];for(var i in r)Pt.call(r,i)&&(e[i]=u(e[i],r[i]))}return e}},zt=Ht(function(t,n){return C(t)&&C(n)?zt(t,n):n}),Nt=Ht(function(t,n){return n}),Lt=function(e){var o,r=!1;return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r||(r=!0,o=e.apply(null,t)),o}},jt=Vt([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Ut=function(t){return jt.defaultedThunk(at(t))},Wt=jt.strict,Gt=jt.asOption,Xt=jt.defaultedThunk,Yt=(jt.asDefaultedOptionThunk,jt.mergeWithThunk),qt=(Vt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(t,n){var e={};return e[t]=n,e}),Kt=function(t,n){return e=n,o={},_t(t,function(t,n){M(e,n)||(o[n]=t)}),o;var e,o},Jt=qt,$t=function(t){return n={},ft(t,function(t){n[t.key]=t.value}),n;var n},Qt=function(t,n){var e,o,r,i,u,a=(e=[],o=[],ft(t,function(t){t.fold(function(t){e.push(t)},function(t){o.push(t)})}),{errors:e,values:o});return 0<a.errors.length?(u=a.errors,mt.error(dt(u))):(i=n,0===(r=a.values).length?mt.value(i):mt.value(zt(i,Nt.apply(undefined,r))))},Zt=function(t){return i(yt,dt)(t)},tn=function(t,n){var e,o,r=bt(t);return 0<r.errors.length?Zt(r.errors):(e=r.values,o=n,0<e.length?vt(zt(o,Nt.apply(undefined,e))):vt(o))},nn=function(t){var n=bt(t);return 0<n.errors.length?Zt(n.errors):vt(n.values)},en=function(t){return C(t)&&100<Ct(t).length?" removed due to size":JSON.stringify(t,null,2)},on=function(t,n){return yt([{path:t,getErrorInfo:n}])},rn=Vt([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),un=function(e,o,r){return Ft(o,r).fold(function(){return t=r,n=o,on(e,function(){return'Could not find valid *strict* value for "'+t+'" in '+en(n)});var t,n},vt)},an=function(t,n,e){var o=Ft(t,n).fold(function(){return e(t)},ct);return vt(o)},cn=function(a,c,t,s){return t.fold(function(r,e,t,o){var i=function(t){var n=o.extract(a.concat([r]),s,t);return St(n,function(t){return qt(e,s(t))})},u=function(t){return t.fold(function(){var t=qt(e,s(st.none()));return vt(t)},function(t){var n=o.extract(a.concat([r]),s,t);return St(n,function(t){return qt(e,s(st.some(t)))})})};return t.fold(function(){return xt(un(a,c,r),i)},function(t){return xt(an(c,r,t),i)},function(){return xt(vt(Ft(c,r)),u)},function(t){return xt((e=t,o=Ft(n=c,r).map(function(t){return!0===t?e(n):t}),vt(o)),u);var n,e,o},function(t){var n=t(c),e=St(an(c,r,at({})),function(t){return zt(n,t)});return xt(e,i)})},function(t,n){var e=n(c);return vt(qt(t,s(e)))})},sn=function(o){return{extract:function(e,t,n){return wt(o(n,t),function(t){return n=t,on(e,function(){return n});var n})},toString:function(){return"val"}}},ln=function(t){var u=fn(t),a=z(t,function(n,t){return t.fold(function(t){return zt(n,Jt(t,!0))},at(n))},{});return{extract:function(t,n,e){var o,r=O(e)?[]:Ct(Dt(e,function(t){return t!==undefined&&null!==t})),i=H(r,function(t){return!Rt(a,t)});return 0===i.length?u.extract(t,n,e):(o=i,on(t,function(){return"There are unsupported fields: ["+o.join(", ")+"] specified"}))},toString:u.toString}},fn=function(a){return{extract:function(t,n,e){return o=t,r=e,i=n,u=V(a,function(t){return cn(o,r,t,i)}),tn(u,{});var o,r,i,u},toString:function(){return"obj{\n"+V(a,function(t){return t.fold(function(t,n,e,o){return t+" -> "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"}}},dn=function(r){return{extract:function(e,o,t){var n=V(t,function(t,n){return r.extract(e.concat(["["+n+"]"]),o,t)});return nn(n)},toString:function(){return"array("+r.toString()+")"}}},mn=function(a){return{extract:function(t,n,e){for(var o=[],r=0,i=a;r<i.length;r++){var u=i[r].extract(t,n,e);if(u.stype===s.Value)return u;o.push(u)}return nn(o)},toString:function(){return"oneOf("+V(a,function(t){return t.toString()}).join(", ")+")"}}},gn=function(a,c){return{extract:function(e,o,r){var t,n,i=Ct(r),u=(t=e,n=i,dn(sn(a)).extract(t,ct,n));return xt(u,function(t){var n=V(t,function(t){return rn.field(t,t,Wt(),c)});return fn(n).extract(e,o,r)})},toString:function(){return"setOf("+c.toString()+")"}}},pn=at(sn(vt)),hn=i(dn,fn),vn=rn.state,bn=rn.field,yn=function(e,n,o,r,i){return Ft(r,i).fold(function(){return t=r,n=i,on(e,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+en(t)});var t,n},function(t){return t.extract(e.concat(["branch: "+i]),n,o)})},xn=function(r,i){return{extract:function(n,e,o){return Ft(o,r).fold(function(){return t=r,on(n,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return yn(n,e,o,i,t)})},toString:function(){return"chooseOn("+r+"). Possible values: "+Ct(i)}}},wn=sn(vt),Sn=function(t){return hn(t)},kn=function(o){return{extract:function(t,n,e){return o().extract(t,n,e)},toString:function(){return o().toString()}}},Cn=function(n){return sn(function(t){return n(t).fold(yt,vt)})},On=function(n,t){return gn(function(t){return pt(n(t))},t)},_n=function(t,n,e){return ht((o=t,r=ct,i=e,u=n.extract([o],r,i),kt(u,function(t){return{input:i,errors:t}})));var o,r,i,u},Tn=function(t){return t.fold(function(t){throw new Error(Dn(t))},ct)},En=function(t,n,e){return Tn(_n(t,n,e))},Dn=function(t){return"Errors: \n"+(n=t.errors,e=10<n.length?n.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):n,V(e,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}).join("\n"))+"\n\nInput object: "+en(t.input);var n,e},Bn=xn,An=function(t,n){return xn(t,Tt(n,fn))},Mn=at(wn),Fn=function(e,o){return sn(function(t){var n=typeof t;return e(t)?vt(t):yt("Expected type: "+o+" but got: "+n)})},In=Fn(lt,"number"),Rn=Fn(k,"string"),Vn=Fn(O,"boolean"),Pn=Fn(_,"function"),Hn=function(n){var t=function(t,n){for(var e=t.next();!e.done;){if(!n(e.value))return!1;e=t.next()}return!0};if(Object(n)!==n)return!0;switch({}.toString.call(n).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(n).every(function(t){return Hn(n[t])});case"Map":return t(n.keys(),Hn)&&t(n.values(),Hn);case"Set":return t(n.keys(),Hn);default:return!1}},zn=sn(function(t){return Hn(t)?vt(t):yt("Expected value to be acceptable for sending via postMessage")}),Nn=function(n){return Cn(function(t){return M(n,t)?mt.value(t):mt.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},Ln=function(t){return bn(t,t,Wt(),pn())},jn=function(t,n){return bn(t,t,Wt(),n)},Un=function(t){return jn(t,Rn)},Wn=function(t,n){return bn(t,t,Wt(),Nn(n))},Gn=function(t){return jn(t,Pn)},Xn=function(t,n){return bn(t,t,Wt(),fn(n))},Yn=function(t,n){return bn(t,t,Wt(),hn(n))},qn=function(t,n){return bn(t,t,Wt(),dn(n))},Kn=function(t){return bn(t,t,Gt(),pn())},Jn=function(t,n){return bn(t,t,Gt(),n)},$n=function(t){return Jn(t,In)},Qn=function(t){return Jn(t,Rn)},Zn=function(t){return Jn(t,Pn)},te=function(t,n){return Jn(t,fn(n))},ne=function(t,n){return bn(t,t,Ut(n),pn())},ee=function(t,n,e){return bn(t,t,Ut(n),e)},oe=function(t,n){return ee(t,n,In)},re=function(t,n){return ee(t,n,Rn)},ie=function(t,n,e){return ee(t,n,Nn(e))},ue=function(t,n){return ee(t,n,Vn)},ae=function(t,n){return ee(t,n,Pn)},ce=function(t,n,e){return ee(t,n,dn(e))},se=function(t,n,e){return ee(t,n,fn(e))},le=function(t,n){return vn(t,n)},fe=function(t){var n=t;return{get:function(){return n},set:function(t){n=t}}},de=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:t}},me={fromHtml:function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1<e.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return de(e.childNodes[0])},fromTag:function(t,n){var e=(n||document).createElement(t);return de(e)},fromText:function(t,n){var e=(n||document).createTextNode(t);return de(e)},fromDom:de,fromPoint:function(t,n,e){return st.from(t.dom.elementFromPoint(n,e)).map(de)}},ge=function(t,n){var e=function(t,n){for(var e=0;e<t.length;e++){var o=t[e];if(o.test(n))return o}return undefined}(t,n);if(!e)return{major:0,minor:0};var o=function(t){return Number(n.replace(e,"$"+t))};return he(o(1),o(2))},pe=function(){return he(0,0)},he=function(t,n){return{major:t,minor:n}},ve={nu:he,detect:function(t,n){var e=String(n).toLowerCase();return 0===t.length?pe():ge(t,e)},unknown:pe},be=function(t,n){var e=String(n).toLowerCase();return L(t,function(t){return t.search(e)})},ye=function(t,e){return be(t,e).map(function(t){var n=ve.detect(t.versionRegexes,e);return{current:t.name,version:n}})},xe=function(t,e){return be(t,e).map(function(t){var n=ve.detect(t.versionRegexes,e);return{current:t.name,version:n}})},we=function(t,n){return-1!==t.indexOf(n)},Se=function(t,n){return o=n,r=(e=t).length-n.length,""===o||e.length>=o.length&&e.substr(r,r+o.length)===o;var e,o,r},ke=(et=/^\s+|\s+$/g,function(t){return t.replace(et,"")}),Ce=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Oe=function(n){return function(t){return we(t,n)}},_e=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return we(t,"edge/")&&we(t,"chrome")&&we(t,"safari")&&we(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ce],search:function(t){return we(t,"chrome")&&!we(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return we(t,"msie")||we(t,"trident")}},{name:"Opera",versionRegexes:[Ce,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Oe("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Oe("firefox")},{name:"Safari",versionRegexes:[Ce,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(we(t,"safari")||we(t,"mobile/"))&&we(t,"applewebkit")}}],Te=[{name:"Windows",search:Oe("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return we(t,"iphone")||we(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Oe("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Oe("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Oe("linux"),versionRegexes:[]},{name:"Solaris",search:Oe("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Oe("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Oe("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Ee={browsers:at(_e),oses:at(Te)},De="Firefox",Be=function(t){var n=t.current,e=t.version,o=function(t){return function(){return n===t}};return{current:n,version:e,isEdge:o("Edge"),isChrome:o("Chrome"),isIE:o("IE"),isOpera:o("Opera"),isFirefox:o(De),isSafari:o("Safari")}},Ae={unknown:function(){return Be({current:undefined,version:ve.unknown()})},nu:Be,edge:at("Edge"),chrome:at("Chrome"),ie:at("IE"),opera:at("Opera"),firefox:at(De),safari:at("Safari")},Me="Windows",Fe="Android",Ie="Solaris",Re="FreeBSD",Ve="ChromeOS",Pe=function(t){var n=t.current,e=t.version,o=function(t){return function(){return n===t}};return{current:n,version:e,isWindows:o(Me),isiOS:o("iOS"),isAndroid:o(Fe),isOSX:o("OSX"),isLinux:o("Linux"),isSolaris:o(Ie),isFreeBSD:o(Re),isChromeOS:o(Ve)}},He={unknown:function(){return Pe({current:undefined,version:ve.unknown()})},nu:Pe,windows:at(Me),ios:at("iOS"),android:at(Fe),linux:at("Linux"),osx:at("OSX"),solaris:at(Ie),freebsd:at(Re),chromeos:at(Ve)},ze=function(t,n){var e,o,r,i,u,a,c,s,l,f,d,m,g=Ee.browsers(),p=Ee.oses(),h=ye(g,t).fold(Ae.unknown,Ae.nu),v=xe(p,t).fold(He.unknown,He.nu);return{browser:h,os:v,deviceType:(o=h,r=t,i=n,u=(e=v).isiOS()&&!0===/ipad/i.test(r),a=e.isiOS()&&!u,c=e.isiOS()||e.isAndroid(),s=c||i("(pointer:coarse)"),l=u||!a&&c&&i("(min-device-width:768px)"),f=a||c&&!l,d=o.isSafari()&&e.isiOS()&&!1===/safari/i.test(r),m=!f&&!l&&!d,{isiPad:at(u),isiPhone:at(a),isTablet:at(l),isPhone:at(f),isTouch:at(s),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:at(d),isDesktop:at(m)})}},Ne=function(t){return window.matchMedia(t).matches},Le=Lt(function(){return ze(navigator.userAgent,Ne)}),je=function(){return Le()},Ue=function(t,n){var e=t.dom;if(1!==e.nodeType)return!1;var o=e;if(o.matches!==undefined)return o.matches(n);if(o.msMatchesSelector!==undefined)return o.msMatchesSelector(n);if(o.webkitMatchesSelector!==undefined)return o.webkitMatchesSelector(n);if(o.mozMatchesSelector!==undefined)return o.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},We=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},Ge=function(t,n){return t.dom===n.dom},Xe=function(t,n){return e=t.dom,o=n.dom,r=e,i=o,u=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(r.compareDocumentPosition(i)&u);var e,o,r,i,u},Ye=function(t,n){return je().browser.isIE()?Xe(t,n):(e=n,o=t.dom,r=e.dom,o!==r&&o.contains(r));var e,o,r},qe=function(t){return _(t)?t:c},Ke=function(t,n,e){for(var o=t.dom,r=qe(e);o.parentNode;){o=o.parentNode;var i=me.fromDom(o),u=n(i);if(u.isSome())return u;if(r(i))break}return st.none()},Je=function(t,n,e){var o=n(t),r=qe(e);return o.orThunk(function(){return r(t)?st.none():Ke(t,n,r)})},$e=function(t,n){return Ge(t.element,n.event.target)},Qe=function(t){if(!Rt(t,"can")&&!Rt(t,"abort")&&!Rt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return En("Extracting event.handler",ln([ne("can",b),ne("abort",c),ne("run",$)]),t)},Ze=function(e){var n,o,r,i,t=(o=function(t){return t.can},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return N(n,function(t,n){return t&&o(n).apply(undefined,e)},!0)}),u=(r=n=e,i=function(t){return t.abort},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return N(r,function(t,n){return t||i(n).apply(undefined,e)},!1)});return Qe({can:t,abort:u,run:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];ft(e,function(t){t.run.apply(undefined,n)})}})},to=at,no=to("touchstart"),eo=to("touchmove"),oo=to("touchend"),ro=to("touchcancel"),io=to("mousedown"),uo=to("mousemove"),ao=to("mouseout"),co=to("mouseup"),so=to("mouseover"),lo=to("focusin"),fo=to("focusout"),mo=to("keydown"),go=to("keyup"),po=to("input"),ho=to("change"),vo=to("click"),bo=to("transitionend"),yo=to("selectstart"),xo=function(t){return at("alloy."+t)},wo={tap:xo("tap")},So=xo("focus"),ko=xo("blur.post"),Co=xo("paste.post"),Oo=xo("receive"),_o=xo("execute"),To=xo("focus.item"),Eo=wo.tap,Do=xo("longpress"),Bo=xo("sandbox.close"),Ao=xo("typeahead.cancel"),Mo=xo("system.init"),Fo=xo("system.touchmove"),Io=xo("system.touchend"),Ro=xo("system.scroll"),Vo=xo("system.resize"),Po=xo("system.attached"),Ho=xo("system.detached"),zo=xo("system.dismissRequested"),No=xo("system.repositionRequested"),Lo=xo("focusmanager.shifted"),jo=xo("slotcontainer.visibility"),Uo=xo("change.tab"),Wo=xo("dismiss.tab"),Go=xo("highlight"),Xo=xo("dehighlight"),Yo=function(t,n){$o(t,t.element,n,{})},qo=function(t,n,e){$o(t,t.element,n,e)},Ko=function(t){Yo(t,_o())},Jo=function(t,n,e){$o(t,n,e,{})},$o=function(t,n,e,o){var r=ut({target:n},o);t.getSystem().triggerEvent(e,n,r)},Qo=function(t,n,e,o){t.getSystem().triggerEvent(e,n,o.event)},Zo=$t,tr=function(t,n){return{key:t,value:Qe({abort:n})}},nr=function(t){return{key:t,value:Qe({run:function(t,n){n.event.prevent()}})}},er=function(t,n){return{key:t,value:Qe({run:n})}},or=function(t,e,o){return{key:t,value:Qe({run:function(t,n){e.apply(undefined,[t,n].concat(o))}})}},rr=function(t){return function(e){return{key:t,value:Qe({run:function(t,n){$e(t,n)&&e(t,n)}})}}},ir=function(t,n,e){var o,r,i=n.partUids[e];return r=i,er(o=t,function(t,n){t.getSystem().getByUid(r).each(function(t){Qo(t,t.element,o,n)})})},ur=function(t,r){return er(t,function(n,t){var e=t.event,o=n.getSystem().getByDom(e.target).fold(function(){return Je(e.target,function(t){return n.getSystem().getByDom(t).toOptional()},c).getOr(n)},function(t){return t});r(n,o,t)})},ar=function(t){return er(t,function(t,n){n.cut()})},cr=function(t,n){return rr(t)(n)},sr=rr(Po()),lr=rr(Ho()),fr=rr(Mo()),dr=(ot=_o(),function(t){return er(ot,t)}),mr=("undefined"!=typeof window||Function("return this;")(),function(t){return t.dom.nodeName.toLowerCase()}),gr=function(n){return function(t){return t.dom.nodeType===n}},pr=gr(1),hr=gr(3),vr=gr(9),br=gr(11),yr=function(t){return me.fromDom(t.dom.ownerDocument)},xr=function(t){return vr(t)?t:yr(t)},wr=function(t){return me.fromDom(xr(t).dom.documentElement)},Sr=function(t){return me.fromDom(xr(t).dom.defaultView)},kr=function(t){return st.from(t.dom.parentNode).map(me.fromDom)},Cr=kr,Or=function(t){return st.from(t.dom.offsetParent).map(me.fromDom)},_r=function(t){return V(t.dom.childNodes,me.fromDom)},Tr=function(t,n){var e=t.dom.childNodes;return st.from(e[n]).map(me.fromDom)},Er=function(n,e){kr(n).each(function(t){t.dom.insertBefore(e.dom,n.dom)})},Dr=function(t,n){var e;(e=t,st.from(e.dom.nextSibling).map(me.fromDom)).fold(function(){kr(t).each(function(t){Ar(t,n)})},function(t){Er(t,n)})},Br=function(n,e){Tr(n,0).fold(function(){Ar(n,e)},function(t){n.dom.insertBefore(e.dom,t.dom)})},Ar=function(t,n){t.dom.appendChild(n.dom)},Mr=function(n,t){ft(t,function(t){Ar(n,t)})},Fr=function(t){t.dom.textContent="",ft(_r(t),function(t){Ir(t)})},Ir=function(t){var n=t.dom;null!==n.parentNode&&n.parentNode.removeChild(n)},Rr=function(t){var n,e=_r(t);0<e.length&&(n=t,ft(e,function(t){Er(n,t)})),Ir(t)},Vr=function(t){return t.dom.innerHTML},Pr=function(t,n){var e,o,r=yr(t).dom,i=me.fromDom(r.createDocumentFragment()),u=(e=n,(o=(r||document).createElement("div")).innerHTML=e,_r(me.fromDom(o)));Mr(i,u),Fr(t),Ar(t,i)},Hr=function(t,n,e){if(!(k(e)||O(e)||lt(e)))throw console.error("Invalid call to Attribute.set. Key ",n,":: Value ",e,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,e+"")},zr=function(t,n,e){Hr(t.dom,n,e)},Nr=function(t,n){var e=t.dom.getAttribute(n);return null===e?undefined:e},Lr=function(t,n){return st.from(Nr(t,n))},jr=function(t,n){var e=t.dom;return!(!e||!e.hasAttribute)&&e.hasAttribute(n)},Ur=function(t,n){t.dom.removeAttribute(n)},Wr=function(t){return n=t,e=!1,me.fromDom(n.dom.cloneNode(e));var n,e},Gr=function(t){var n,e,o,r=Wr(t);return n=r,e=me.fromTag("div"),o=me.fromDom(n.dom.cloneNode(!0)),Ar(e,o),Vr(e)},Xr=Zo([{key:So(),value:Qe({can:function(t,n){var e,o,r=n.event,i=r.originator,u=r.target;return o=u,!(Ge(e=i,t.element)&&!Ge(e,o))||(console.warn(So()+" did not get interpreted by the desired target. \nOriginator: "+Gr(i)+"\nTarget: "+Gr(u)+"\nCheck the "+So()+" event handlers"),!1)}})}]),Yr=/* */Object.freeze({__proto__:null,events:Xr}),qr=0,Kr=function(t){var n=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++qr+String(n)},Jr=at("alloy-id-"),$r=at("data-alloy-id"),Qr=Jr(),Zr=$r(),ti=function(t,n){Object.defineProperty(t.dom,Zr,{value:n,writable:!0})},ni=function(t){var n=pr(t)?t.dom[Zr]:null;return st.from(n)},ei=Kr,oi=ct,ri=function(n){var t=function(t){return function(){throw new Error("The component must be in a context to send: "+t+(n?"\n"+Gr(n().element)+" is not in context.":""))}};return{debugInfo:at("fake"),triggerEvent:t("triggerEvent"),triggerFocus:t("triggerFocus"),triggerEscape:t("triggerEscape"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),broadcast:t("broadcast"),broadcastOn:t("broadcastOn"),broadcastEvent:t("broadcastEvent"),isConnected:c}},ii=ri(),ui=function(t){return V(t,function(t){return Se(t,"/*")?t.substring(0,t.length-"/*".length):t})},ai=function(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:ui(i)}},t},ci=Kr("alloy-premade"),si=function(t){return Jt(ci,t)},li=function(o){return t=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return o.apply(void 0,S([t.getApis(),t],n))},n=o.toString(),e=n.indexOf(")")+1,r=n.indexOf("("),i=n.substring(r+1,e-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ui(i.slice(1))}},t;var t,n,e,r,i},fi={init:function(){return di({readState:function(){return"No State required"}})}},di=function(t){return t},mi=function(t,r){var i={};return _t(t,function(t,o){_t(t,function(t,n){var e=Ft(i,n).getOr([]);i[n]=e.concat([r(o,t)])})}),i},gi=function(t){return{classes:t.classes!==undefined?t.classes:[],attributes:t.attributes!==undefined?t.attributes:{},styles:t.styles!==undefined?t.styles:{}}},pi=function(t,n){return{cHandler:y.apply(undefined,[t.handler].concat(n)),purpose:t.purpose}},hi=function(t){return t.cHandler},vi=function(t,n){return{name:t,handler:n}},bi=function(t,n,e){var o,r,i=ut(ut({},e),(o=t,r={},ft(n,function(t){r[t.name()]=t.handlers(o)}),r));return mi(i,vi)},yi=function(t){var n,i=_(n=t)?{can:at(!0),abort:at(!1),run:n}:n;return function(t,n){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var r=[t,n].concat(e);i.abort.apply(undefined,r)?n.stop():i.can.apply(undefined,r)&&i.run.apply(undefined,r)}},xi=function(t,n,e){var o,r,i=n[e];return i?function(u,a,t,c){try{var n=Y(t,function(t,n){var e=t[a],o=n[a],r=c.indexOf(e),i=c.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+e+".\nOrder specified: "+JSON.stringify(c,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(c,null,2));return r<i?-1:i<r?1:0});return mt.value(n)}catch(e){return mt.error([e])}}("Event: "+e,"name",t,i).map(function(t){var n=V(t,function(t){return t.handler});return Ze(n)}):(o=e,r=t,mt.error(["The event ("+o+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(V(r,function(t){return t.name}),null,2)]))},wi=function(t,i){var n=Bt(t,function(o,r){return(1===o.length?mt.value(o[0].handler):xi(o,i,r)).map(function(t){var n=yi(t),e=1<o.length?H(i[r],function(n){return F(o,function(t){return t.name===n})}).join(" > "):o[0].name;return Jt(r,{handler:n,purpose:e})})});return Qt(n,{})},Si="alloy.base.behaviour",ki=function(t){var n,e;return _n("custom.definition",fn([bn("dom","dom",Wt(),fn([Ln("tag"),ne("styles",{}),ne("classes",[]),ne("attributes",{}),Kn("value"),Kn("innerHtml")])),Ln("components"),Ln("uid"),ne("events",{}),ne("apis",{}),bn("eventOrder","eventOrder",((n={})[_o()]=["disabling",Si,"toggling","typeaheadevents"],n[So()]=[Si,"focusing","keying"],n[Mo()]=[Si,"disabling","toggling","representing"],n[po()]=[Si,"representing","streaming","invalidating"],n[Ho()]=[Si,"representing","item-events","tooltipping"],n[io()]=["focusing",Si,"item-type-events"],n[no()]=["focusing",Si,"item-type-events"],n[so()]=["item-type-events","tooltipping"],n[Oo()]=["receiving","reflecting","tooltipping"],e=n,jt.mergeWithThunk(at(e))),Mn()),Kn("domModification")]),t)},Ci=function(t,n){var e=Nr(t,n);return e===undefined||""===e?[]:e.split(" ")},Oi=function(t){return t.dom.classList!==undefined},_i=function(t,n){return r=n,i=Ci(e=t,o="class").concat([r]),zr(e,o,i.join(" ")),!0;var e,o,r,i},Ti=function(t,n){return r=n,0<(i=H(Ci(e=t,o="class"),function(t){return t!==r})).length?zr(e,o,i.join(" ")):Ur(e,o),!1;var e,o,r,i},Ei=function(t,n){Oi(t)?t.dom.classList.add(n):_i(t,n)},Di=function(t){0===(Oi(t)?t.dom.classList:Ci(t,"class")).length&&Ur(t,"class")},Bi=function(t,n){Oi(t)?t.dom.classList.remove(n):Ti(t,n),Di(t)},Ai=function(t,n){return Oi(t)&&t.dom.classList.contains(n)},Mi=function(n,t){ft(t,function(t){Ei(n,t)})},Fi=function(n,t){ft(t,function(t){Bi(n,t)})},Ii=function(t){return t.style!==undefined&&_(t.style.getPropertyValue)},Ri=function(t){return br(t)},Vi=_(Element.prototype.attachShadow)&&_(Node.prototype.getRootNode),Pi=at(Vi),Hi=Vi?function(t){return me.fromDom(t.dom.getRootNode())}:xr,zi=function(t){return Ri(t)?t:me.fromDom(xr(t).dom.body)},Ni=function(t){var n=Hi(t);return Ri(n)?st.some(n):st.none()},Li=function(t){return me.fromDom(t.dom.host)},ji=function(t){return v(t.dom.shadowRoot)},Ui=function(t){var n=hr(t)?t.dom.parentNode:t.dom;if(n===undefined||null===n||null===n.ownerDocument)return!1;var e,o,r=n.ownerDocument;return Ni(me.fromDom(n)).fold(function(){return r.body.contains(n)},(e=Ui,o=Li,function(t){return e(o(t))}))},Wi=function(){return Gi(me.fromDom(document))},Gi=function(t){var n=t.dom.body;if(null===n||n===undefined)throw new Error("Body is not available yet");return me.fromDom(n)},Xi=function(t,n,e){if(!k(e))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);Ii(t)&&t.style.setProperty(n,e)},Yi=function(t,n){Ii(t)&&t.style.removeProperty(n)},qi=function(t,n,e){var o=t.dom;Xi(o,n,e)},Ki=function(t,n){var e=t.dom;_t(n,function(t,n){Xi(e,n,t)})},Ji=function(t,n){var e=t.dom;_t(n,function(t,n){t.fold(function(){Yi(e,n)},function(t){Xi(e,n,t)})})},$i=function(t,n){var e=t.dom,o=window.getComputedStyle(e).getPropertyValue(n);return""!==o||Ui(t)?o:Qi(e,n)},Qi=function(t,n){return Ii(t)?t.style.getPropertyValue(n):""},Zi=function(t,n){var e=t.dom,o=Qi(e,n);return st.from(o).filter(function(t){return 0<t.length})},tu=function(t,n,e){var o=me.fromTag(t);return qi(o,n,e),Zi(o,n).isSome()},nu=function(t,n){var e=t.dom;Yi(e,n),Lr(t,"style").map(ke).is("")&&Ur(t,"style")},eu=function(t){return t.dom.offsetWidth},ou=function(t){return t.dom.value},ru=function(t,n){if(n===undefined)throw new Error("Value.set was undefined");t.dom.value=n},iu=function(t){var n,e,o,r=me.fromTag(t.tag);n=r,e=t.attributes,o=n.dom,_t(e,function(t,n){Hr(o,n,t)}),Mi(r,t.classes),Ki(r,t.styles),t.innerHtml.each(function(t){return Pr(r,t)});var i=t.domChildren;return Mr(r,i),t.value.each(function(t){ru(r,t)}),t.uid,ti(r,t.uid),r},uu=function(t,n){return e=t,r=V(o=n,function(t){return te(t.name(),[Ln("config"),ne("state",fi)])}),i=_n("component.behaviours",fn(r),e.behaviours).fold(function(t){throw new Error(Dn(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))},function(t){return t}),{list:o,data:Tt(i,function(t){var n=t.map(function(t){return{config:t.config,state:t.state.init(t.config)}});return function(){return n}})};var e,o,r,i},au=function(t){var n,e,o=(n=Ft(t,"behaviours").getOr({}),e=H(Ct(n),function(t){return n[t]!==undefined}),V(e,function(t){return n[t].me}));return uu(t,o)},cu=function(t,n,e){var o,r,i,u=ut(ut({},(o=t).dom),{uid:o.uid,domChildren:V(o.components,function(t){return t.element})}),a=t.domModification.fold(function(){return gi({})},gi),c={"alloy.base.modification":a},s=0<n.length?function(n,t,e,o){var r=ut({},t);ft(e,function(t){r[t.name()]=t.exhibit(n,o)});var i=mi(r,function(t,n){return{name:t,modification:n}}),u=function(t){return z(t,function(t,n){return ut(ut({},n.modification),t)},{})},a=z(i.classes,function(t,n){return n.modification.concat(t)},[]),c=u(i.attributes),s=u(i.styles);return gi({classes:a,attributes:c,styles:s})}(e,c,n,u):a;return i=s,ut(ut({},r=u),{attributes:ut(ut({},r.attributes),i.attributes),styles:ut(ut({},r.styles),i.styles),classes:r.classes.concat(i.classes)})},su=function(t,n,e){var o,r,i,u={"alloy.base.behaviour":t.events};return o=e,r=t.eventOrder,i=bi(o,n,u),wi(i,r).getOrDie()},lu=function(t){var n,e,o,r,i,u,a,c,s,l,f,d,m,g=oi(t),p=g.events,h=w(g,["events"]),v=(n=Ft(h,"components").getOr([]),V(n,gu)),b=ut(ut({},h),{events:ut(ut({},Yr),p),components:v});return mt.value((o=function(){return m},r=fe(ii),i=Tn(ki(e=b)),u=au(e),a=u.list,c=u.data,s=cu(i,a,c),l=iu(s),f=su(i,a,c),d=fe(i.components),m={getSystem:r.get,config:function(t){var n=c;return(_(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:function(t){return _(c[t.name()])},spec:e,readState:function(t){return c[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return i.apis},connect:function(t){r.set(t)},disconnect:function(){r.set(ri(o))},element:l,syncComponents:function(){var t=_r(l),n=U(t,function(t){return r.get().getByDom(t).fold(function(){return[]},function(t){return[t]})});d.set(n)},components:d.get,events:f}))},fu=function(t){var n=me.fromText(t);return du({element:n})},du=function(t){var n=En("external.component",ln([Ln("element"),Kn("uid")]),t),e=fe(ri());n.uid.each(function(t){ti(n.element,t)});var o={getSystem:e.get,config:st.none,hasConfigured:c,connect:function(t){e.set(t)},disconnect:function(){e.set(ri(function(){return o}))},getApis:function(){return{}},element:n.element,spec:t,readState:at("No state"),syncComponents:$,components:at([]),events:{}};return si(o)},mu=ei,gu=function(n){return Ft(n,ci).fold(function(){var t=n.hasOwnProperty("uid")?n:ut({uid:mu("")},n);return lu(t).getOrDie()},function(t){return t})},pu=si;function hu(o,r){var t=function(t){var n=r(t);if(n<=0||null===n){var e=$i(t,o);return parseFloat(e)||0}return n},i=function(r,t){return N(t,function(t,n){var e=$i(r,n),o=e===undefined?0:parseInt(e,10);return isNaN(o)?t:t+o},0)};return{set:function(t,n){if(!lt(n)&&!n.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+n);var e=t.dom;Ii(e)&&(e.style[o]=n+"px")},get:t,getOuter:t,aggregate:i,max:function(t,n,e){var o=i(t,e);return o<n?n-o:0}}}var vu=hu("height",function(t){var n=t.dom;return Ui(t)?n.getBoundingClientRect().height:n.offsetHeight}),bu=function(t){return vu.get(t)},yu=function(t){return vu.getOuter(t)},xu=function(e,o){return{left:e,top:o,translate:function(t,n){return xu(e+t,o+n)}}},wu=xu,Su=function(t,n){return t!==undefined?t:n!==undefined?n:0},ku=function(t){var n=t.dom.ownerDocument,e=n.body,o=n.defaultView,r=n.documentElement;if(e===t.dom)return wu(e.offsetLeft,e.offsetTop);var i=Su(null==o?void 0:o.pageYOffset,r.scrollTop),u=Su(null==o?void 0:o.pageXOffset,r.scrollLeft),a=Su(r.clientTop,e.clientTop),c=Su(r.clientLeft,e.clientLeft);return Cu(t).translate(u-c,i-a)},Cu=function(t){var n,e=t.dom,o=e.ownerDocument.body;return o===e?wu(o.offsetLeft,o.offsetTop):Ui(t)?(n=e.getBoundingClientRect(),wu(n.left,n.top)):wu(0,0)},Ou=hu("width",function(t){return t.dom.offsetWidth}),_u=function(t){return Ou.get(t)},Tu=function(t){return Ou.getOuter(t)},Eu=function(t){var n=me.fromDom(function(t){if(Pi()&&v(t.target)){var n=me.fromDom(t.target);if(pr(n)&&ji(n)&&t.composed&&t.composedPath){var e=t.composedPath();if(e)return K(e)}}return st.from(t.target)}(t).getOr(t.target)),e=function(){return t.stopPropagation()},o=function(){return t.preventDefault()},r=i(o,e);return{target:n,x:t.clientX,y:t.clientY,stop:e,prevent:o,kill:r,raw:t}},Du=function(t,n,e,o,r){var i,u,a=(i=e,u=o,function(t){i(t)&&u(Eu(t))});return t.dom.addEventListener(n,a,r),{unbind:y(Bu,t,n,a,r)}},Bu=function(t,n,e,o){t.dom.removeEventListener(n,e,o)},Au=function(t){var n=t!==undefined?t.dom:document,e=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return wu(e,o)},Mu=function(t,n,e){var o=(e!==undefined?e.dom:document).defaultView;o&&o.scrollTo(t,n)},Fu=function(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}},Iu=function(t){var n,e,o=t===undefined?window:t,r=o.document,i=Au(me.fromDom(r));return e=(n=o)===undefined?window:n,st.from(e.visualViewport).fold(function(){var t=o.document.documentElement,n=t.clientWidth,e=t.clientHeight;return Fu(i.left,i.top,n,e)},function(t){return Fu(Math.max(t.pageLeft,i.left),Math.max(t.pageTop,i.top),t.width,t.height)})},Ru=function(o,t){return o.view(t).fold(at([]),function(t){var n=o.owner(t),e=Ru(o,n);return[t].concat(e)})},Vu=/* */Object.freeze({__proto__:null,view:function(t){var n;return(t.dom===document?st.none():st.from(null===(n=t.dom.defaultView)||void 0===n?void 0:n.frameElement)).map(me.fromDom)},owner:yr}),Pu=function(o){var t,n,e,r,i=me.fromDom(document),u=Au(i);return(t=o,e=(n=Vu).owner(t),r=Ru(n,e),st.some(r)).fold(y(ku,o),function(t){var n=Cu(o),e=z(t,function(t,n){var e=Cu(n);return{left:t.left+e.left,top:t.top+e.top}},{left:0,top:0});return wu(e.left+n.left+u.left,e.top+n.top+u.top)})},Hu=function(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}},zu=function(t){var n=ku(t),e=Tu(t),o=yu(t);return Hu(n.left,n.top,e,o)},Nu=function(t){var n=Pu(t),e=Tu(t),o=yu(t);return Hu(n.left,n.top,e,o)},Lu=function(){return Iu(window)};function ju(t,n,e,o,r){return t(e,o)?st.some(e):_(r)&&r(e)?st.none():n(e,o,r)}var Uu,Wu,Gu=function(t,n,e){for(var o=t.dom,r=_(e)?e:c;o.parentNode;){o=o.parentNode;var i=me.fromDom(o);if(n(i))return st.some(i);if(r(i))break}return st.none()},Xu=function(t,n,e){return ju(function(t,n){return n(t)},Gu,t,n,e)},Yu=function(t,n,e){return Xu(t,n,e).isSome()},qu=function(t,n,e){return Gu(t,function(t){return Ue(t,n)},e)},Ku=function(t,n){return e=n,r=(o=t)===undefined?document:o.dom,We(r)?st.none():st.from(r.querySelector(e)).map(me.fromDom);var e,o,r},Ju=function(t,n,e){return ju(Ue,qu,t,n,e)},$u=function(){var n=Kr("aria-owns");return{id:n,link:function(t){zr(t,"aria-owns",n)},unlink:function(t){Ur(t,"aria-owns")}}},Qu=function(n,t){return Xu(t,function(t){if(!pr(t))return!1;var n=Nr(t,"id");return n!==undefined&&-1<n.indexOf("aria-owns")}).bind(function(t){var n=Nr(t,"id"),e=Hi(t);return Ku(e,'[aria-owns="'+n+'"]')}).exists(function(t){return Zu(n,t)})},Zu=function(n,t){return Yu(t,function(t){return Ge(t,n.element)},c)||Qu(n,t)},ta="unknown";(Wu=Uu=Uu||{})[Wu.STOP=0]="STOP",Wu[Wu.NORMAL=1]="NORMAL",Wu[Wu.LOGGING=2]="LOGGING";var na,ea,oa=fe({}),ra=["alloy/data/Fields","alloy/debugging/Debugging"],ia=function(n,t,e){var o,r,i,u;switch(Ft(oa.get(),n).orThunk(function(){var t=Ct(oa.get());return Z(t,function(t){return-1<n.indexOf(t)?st.some(oa.get()[t]):st.none()})}).getOr(Uu.NORMAL)){case Uu.NORMAL:return e(ua());case Uu.LOGGING:var a=(o=n,r=t,i=[],u=(new Date).getTime(),{logEventCut:function(t,n,e){i.push({outcome:"cut",target:n,purpose:e})},logEventStopped:function(t,n,e){i.push({outcome:"stopped",target:n,purpose:e})},logNoParent:function(t,n,e){i.push({outcome:"no-parent",target:n,purpose:e})},logEventNoHandlers:function(t,n){i.push({outcome:"no-handlers-left",target:n})},logEventResponse:function(t,n,e){i.push({outcome:"response",purpose:e,target:n})},write:function(){var t=(new Date).getTime();M(["mousemove","mouseover","mouseout",Mo()],o)||console.log(o,{event:o,time:t-u,target:r.dom,sequence:V(i,function(t){return M(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Gr(t.target)+")":t.outcome})})}}),c=e(a);return a.write(),c;case Uu.STOP:return!0}},ua=at({logEventCut:$,logEventStopped:$,logNoParent:$,logEventNoHandlers:$,logEventResponse:$,write:$}),aa=at([Ln("menu"),Ln("selectedMenu")]),ca=at([Ln("item"),Ln("selectedItem")]),sa=(at(fn(ca().concat(aa()))),at(fn(ca()))),la=Xn("initSize",[Ln("numColumns"),Ln("numRows")]),fa=function(){return Xn("markers",[Ln("backgroundMenu")].concat(aa()).concat(ca()))},da=function(t){return Xn("markers",V(t,Ln))},ma=function(t,n,e){!function(){var t=new Error;if(t.stack===undefined)return;var n=t.stack.split("\n");L(n,function(n){return 0<n.indexOf("alloy")&&!F(ra,function(t){return-1<n.indexOf(t)})}).getOr(ta)}();return bn(n,n,e,Cn(function(e){return mt.value(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(undefined,t)})}))},ga=function(t){return ma(0,t,Ut($))},pa=function(t){return ma(0,t,Ut(st.none))},ha=function(t){return ma(0,t,Wt())},va=function(t){return ma(0,t,Wt())},ba=function(t,n){return le(t,at(n))},ya=function(t){return le(t,ct)},xa=at(la),wa=function(t,n,e,o,r,i){return{x:t,y:n,bubble:e,direction:o,boundsRestriction:r,label:i}},Sa=Vt([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),ka=Sa.southeast,Ca=Sa.southwest,Oa=Sa.northeast,_a=Sa.northwest,Ta=Sa.south,Ea=Sa.north,Da=Sa.east,Ba=Sa.west,Aa=function(n,e){return function(t,n){for(var e={},o=0,r=t.length;o<r;o++){var i=t[o];e[String(i)]=n(i,o)}return e}(["left","right","top","bottom"],function(t){return Ft(e,t).map(function(t){return function(t,n){switch(n){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(n,t)})})},Ma=function(t){return t.x},Fa=function(t,n){return t.x+t.width/2-n.width/2},Ia=function(t,n){return t.x+t.width-n.width},Ra=function(t,n){return t.y-n.height},Va=function(t){return t.y+t.height},Pa=function(t,n){return t.y+t.height/2-n.height/2},Ha=function(t,n,e){return wa(Ma(t),Va(t),e.southeast(),ka(),Aa(t,{left:1,top:3}),"layout-se")},za=function(t,n,e){return wa(Ia(t,n),Va(t),e.southwest(),Ca(),Aa(t,{right:0,top:3}),"layout-sw")},Na=function(t,n,e){return wa(Ma(t),Ra(t,n),e.northeast(),Oa(),Aa(t,{left:1,bottom:2}),"layout-ne")},La=function(t,n,e){return wa(Ia(t,n),Ra(t,n),e.northwest(),_a(),Aa(t,{right:0,bottom:2}),"layout-nw")},ja=function(t,n,e){return wa(Fa(t,n),Ra(t,n),e.north(),Ea(),Aa(t,{bottom:2}),"layout-n")},Ua=function(t,n,e){return wa(Fa(t,n),Va(t),e.south(),Ta(),Aa(t,{top:3}),"layout-s")},Wa=function(t,n,e){return wa((o=t).x+o.width,Pa(t,n),e.east(),Da(),Aa(t,{left:0}),"layout-e");var o},Ga=function(t,n,e){return wa((o=n,t.x-o.width),Pa(t,n),e.west(),Ba(),Aa(t,{right:1}),"layout-w");var o},Xa=function(){return[Ha,za,Na,La,Ua,ja,Wa,Ga]},Ya=function(){return[za,Ha,La,Na,Ua,ja,Wa,Ga]},qa=function(){return[Na,La,Ha,za,ja,Ua]},Ka=function(){return[La,Na,za,Ha,ja,Ua]},Ja=function(){return[Ha,za,Na,La,Ua,ja]},$a=function(){return[za,Ha,La,Na,Ua,ja]},Qa=/* */Object.freeze({__proto__:null,events:function(c){return Zo([er(Oo(),function(r,t){var n,e,i=c.channels,o=Ct(i),u=t,a=(n=o,(e=u).universal?n:H(n,function(t){return M(e.channels,t)}));ft(a,function(t){var n=i[t],e=n.schema,o=En("channel["+t+"] data\nReceiver: "+Gr(r.element),e,u.data);n.onReceive(r,o)})})])}}),Za=[jn("channels",On(mt.value,ln([ha("onReceive"),ne("schema",Mn())])))],tc=function(e,o,r){return fr(function(t,n){r(t,e,o)})},nc=function(t,n,e,o,r,i){var u=ln(t),a=te(n,[Jn("config",ln(t))]);return rc(u,a,n,e,o,r,i)},ec=function(r,i,u){var t,n,e,o,a,c;return t=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=[e].concat(t);return e.config({name:at(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(t){var n=Array.prototype.slice.call(o,1);return i.apply(undefined,[e,t.config,t.state].concat(n))})},n=u,e=i.toString(),o=e.indexOf(")")+1,a=e.indexOf("("),c=e.substring(a+1,o-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:n,parameters:ui(c.slice(0,1).concat(c.slice(3)))}},t},oc=function(t){return{key:t,value:undefined}},rc=function(e,t,o,r,n,i,u){var a=function(t){return Rt(t,o)?t[o]():st.none()},c=Tt(n,function(t,n){return ec(o,t,n)}),s=Tt(i,ai),l=ut(ut(ut({},s),c),{revoke:y(oc,o),config:function(t){var n=En(o+"-config",e,t);return{key:o,value:{config:n,me:l,configAsRaw:Lt(function(){return En(o+"-config",e,t)}),initialConfig:t,state:u}}},schema:function(){return t},exhibit:function(t,e){return a(t).bind(function(n){return Ft(r,"exhibit").map(function(t){return t(e,n.config,n.state)})}).getOr(gi({}))},name:function(){return o},handlers:function(t){return a(t).map(function(t){return Ft(r,"events").getOr(function(){return{}})(t.config,t.state)}).getOr({})}});return l},ic=$t,uc=ln([Ln("fields"),Ln("name"),ne("active",{}),ne("apis",{}),ne("state",fi),ne("extra",{})]),ac=function(t){var n=En("Creating behaviour: "+t.name,uc,t);return nc(n.fields,n.name,n.active,n.apis,n.extra,n.state)},cc=ln([Ln("branchKey"),Ln("branches"),Ln("name"),ne("active",{}),ne("apis",{}),ne("state",fi),ne("extra",{})]),sc=function(t){var n,e,o,r,i,u,a,c,s=En("Creating behaviour: "+t.name,cc,t);return n=An(s.branchKey,s.branches),e=s.name,o=s.active,r=s.apis,i=s.extra,u=s.state,c=te(e,[Jn("config",a=n)]),rc(a,c,e,o,r,i,u)},lc=at(undefined),fc=ac({fields:Za,name:"receiving",active:Qa}),dc=/* */Object.freeze({__proto__:null,exhibit:function(t,n){return gi({classes:[],styles:n.useFixed()?{}:{position:"relative"}})}}),mc=function(t){return t.dom.focus()},gc=function(t){return void 0===t&&(t=me.fromDom(document)),st.from(t.dom.activeElement).map(me.fromDom)},pc=function(n){return gc(Hi(n)).filter(function(t){return n.dom.contains(t.dom)})},hc=function(t,e){var o=Hi(e),n=gc(o).bind(function(n){var r,i,t=function(t){return Ge(n,t)};return t(e)?st.some(e):(r=t,(i=function(t){for(var n=0;n<t.childNodes.length;n++){var e=me.fromDom(t.childNodes[n]);if(r(e))return st.some(e);var o=i(t.childNodes[n]);if(o.isSome())return o}return st.none()})(e.dom))}),r=t(e);return n.each(function(n){gc(o).filter(function(t){return Ge(t,n)}).fold(function(){mc(n)},$)}),r},vc=function(t,n,e,o,r){return{position:t,left:n,top:e,right:o,bottom:r}},bc=function(t,n){var e=function(t){return t+"px"};Ji(t,{position:st.some(n.position),left:n.left.map(e),top:n.top.map(e),right:n.right.map(e),bottom:n.bottom.map(e)})},yc=Vt([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),xc=function(t,n,e,o,r,i){var u,a,c,s,l,f,d,m,g,p=n.x-e,h=n.y-o,v=r-(p+n.width),b=i-(h+n.height),y=st.some(p),x=st.some(h),w=st.some(v),S=st.some(b),k=st.none();return u=n.direction,a=function(){return vc(t,y,x,k,k)},c=function(){return vc(t,k,x,w,k)},s=function(){return vc(t,y,k,k,S)},l=function(){return vc(t,k,k,w,S)},f=function(){return vc(t,y,x,k,k)},d=function(){return vc(t,y,k,k,S)},m=function(){return vc(t,y,x,k,k)},g=function(){return vc(t,k,x,w,k)},u.fold(a,c,s,l,f,d,m,g)},wc=function(t,n){var e=y(Pu,n),o=t.fold(e,e,function(){var t=Au();return Pu(n).translate(-t.left,-t.top)}),r=Tu(n),i=yu(n);return Hu(o.left,o.top,r,i)},Sc=function(t,n,e){var o=wu(n,e);return t.fold(at(o),at(o),function(){var t=Au();return o.translate(-t.left,-t.top)})},kc=(yc.none,yc.relative),Cc=yc.fixed,Oc=function(t,n,e,o){var r=t+n;return o<r?e:r<e?o:r},_c=function(t,n,e){return Math.min(Math.max(t,n),e)},Tc=Vt([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),Ec=function(t,n,e,o){var r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_,T,E,D,B,A,M,F,I,R,V,P=t.x,H=t.y,z=t.bubble.offset,N=z.left,L=z.top,j=(r=o,i=t.boundsRestriction,u=z,c=(a=function(n,e){var o="top"===n||"bottom"===n?u.top:u.left;return Ft(i,n).bind(ct).bind(function(t){return"left"===n||"top"===n?e<=t?st.some(t):st.none():t<=e?st.some(t):st.none()}).map(function(t){return t+o}).getOr(e)})("left",r.x),s=a("top",r.y),l=a("right",r.right),f=a("bottom",r.bottom),Hu(c,s,l-c,f-s)),U=j.y,W=j.bottom,G=j.x,X=j.right,Y=H+L,q=(d=P+N,m=Y,g=n,p=e,v=(h=j).x,b=h.y,y=h.width,x=h.height,S=b<=m,k=(w=v<=d)&&S,C=d+g<=v+y&&m+p<=b+x,O=Math.abs(Math.min(g,w?v+y-d:v-(d+g))),_=Math.abs(Math.min(p,S?b+x-m:b-(m+p))),T=Math.max(h.x,h.right-g),E=Math.max(h.y,h.bottom-p),{originInBounds:k,sizeInBounds:C,limitX:_c(d,h.x,T),limitY:_c(m,h.y,E),deltaW:O,deltaH:_}),K=q.originInBounds,J=q.sizeInBounds,$=q.limitX,Q=q.limitY,Z=q.deltaW,tt=q.deltaH,nt=at(Q+tt-U),et=at(W-Q),ot=(D=t.direction,A=B=et,M=nt,D.fold(B,B,M,M,B,M,A,A)),rt=at($+Z-G),it=at(X-$),ut={x:$,y:Q,width:Z,height:tt,maxHeight:ot,maxWidth:(F=t.direction,R=I=it,V=rt,F.fold(I,V,I,V,R,R,I,V)),direction:t.direction,classes:{on:t.bubble.classesOn,off:t.bubble.classesOff},label:t.label,candidateYforTest:Y};return K&&J?Tc.fit(ut):Tc.nofit(ut,Z,tt)},Dc=function(t,n,e,o){nu(n,"max-height"),nu(n,"max-width");var r,i,u,a,c,s,l,f,d,m={width:Tu(r=n),height:yu(r)};return i=o.preference,u=t,a=m,c=e,s=o.bounds,l=a.width,f=a.height,d=function(t,o,r,i){var n=t(u,a,c);return Ec(n,l,f,s).fold(Tc.fit,function(t,n,e){return i<e||r<n?Tc.nofit(t,n,e):Tc.nofit(o,r,i)})},N(i,function(t,n){var e=y(d,n);return t.fold(Tc.fit,e)},Tc.nofit({x:u.x,y:u.y,width:a.width,height:a.height,maxHeight:a.height,maxWidth:a.width,direction:ka(),classes:{on:[],off:[]},label:"none",candidateYforTest:u.y},-1,-1)).fold(ct,ct)},Bc=function(t,n,e){var o,r;bc(t,(o=e.origin,r=n,o.fold(function(){return vc("absolute",st.some(r.x),st.some(r.y),st.none(),st.none())},function(t,n,e,o){return xc("absolute",r,t,n,e,o)},function(t,n,e,o){return xc("fixed",r,t,n,e,o)})))},Ac=function(t,n){var e,o,r;e=t,o=Math.floor(n),r=vu.max(e,o,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]),qi(e,"max-height",r+"px")},Mc=at(function(t,n){Ac(t,n),Ki(t,{"overflow-x":"hidden","overflow-y":"auto"})}),Fc=at(function(t,n){Ac(t,n)}),Ic=function(t,n,e){return t[n]===undefined?e:t[n]},Rc=function(t,n,e,o,r,i){var u,a=Ic(i,"maxHeightFunction",Mc()),c=Ic(i,"maxWidthFunction",$),s=t.anchorBox,l=t.origin,f={bounds:(u=l,r.fold(function(){return u.fold(Lu,Lu,Hu)},function(e){return u.fold(e,e,function(){var t=e(),n=Sc(u,t.x,t.y);return Hu(n.left,n.top,t.width,t.height)})})),origin:l,preference:o,maxHeightFunction:a,maxWidthFunction:c};Vc(s,n,e,f)},Vc=function(t,n,e,o){var r,i,u,a,c,s,l=Dc(t,n,e,o);Bc(n,l,o),r=n,i=l.classes,Fi(r,i.off),Mi(r,i.on),u=n,a=l,(0,o.maxHeightFunction)(u,a.maxHeight),c=n,s=l,(0,o.maxWidthFunction)(c,s.maxWidth)},Pc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],Hc=function(t,n,e){var r=function(t){return Ft(e,t).getOr([])},o=function(t,n,e){var o=X(Pc,e);return{offset:wu(t,n),classesOn:U(e,r),classesOff:U(o,r)}};return{southeast:function(){return o(-t,n,["top","alignLeft"])},southwest:function(){return o(t,n,["top","alignRight"])},south:function(){return o(-t/2,n,["top","alignCentre"])},northeast:function(){return o(-t,-n,["bottom","alignLeft"])},northwest:function(){return o(t,-n,["bottom","alignRight"])},north:function(){return o(-t/2,-n,["bottom","alignCentre"])},east:function(){return o(t,-n/2,["valignCentre","left"])},west:function(){return o(-t,-n/2,["valignCentre","right"])},innerNorthwest:function(){return o(-t,n,["top","alignRight"])},innerNortheast:function(){return o(t,n,["top","alignLeft"])},innerNorth:function(){return o(-t/2,n,["top","alignCentre"])},innerSouthwest:function(){return o(-t,-n,["bottom","alignRight"])},innerSoutheast:function(){return o(t,-n,["bottom","alignLeft"])},innerSouth:function(){return o(-t/2,-n,["bottom","alignCentre"])},innerWest:function(){return o(t,-n/2,["valignCentre","right"])},innerEast:function(){return o(-t,-n/2,["valignCentre","left"])}}},zc=function(){return Hc(0,0,{})},Nc=function(n,e){return function(t){return"rtl"===Lc(t)?e:n}},Lc=function(t){return"rtl"===$i(t,"direction")?"rtl":"ltr"};(ea=na=na||{}).TopToBottom="toptobottom",ea.BottomToTop="bottomtotop";var jc="data-alloy-vertical-dir",Uc=function(t){return Yu(t,function(t){return pr(t)&&Nr(t,"data-alloy-vertical-dir")===na.BottomToTop})},Wc=function(){return te("layouts",[Ln("onLtr"),Ln("onRtl"),Kn("onBottomLtr"),Kn("onBottomRtl")])},Gc=function(n,t,e,o,r,i,u){var a=u.map(Uc).getOr(!1),c=t.layouts.map(function(t){return t.onLtr(n)}),s=t.layouts.map(function(t){return t.onRtl(n)}),l=a?t.layouts.bind(function(t){return t.onBottomLtr.map(function(t){return t(n)})}).or(c).getOr(r):c.getOr(e),f=a?t.layouts.bind(function(t){return t.onBottomRtl.map(function(t){return t(n)})}).or(s).getOr(i):s.getOr(o);return Nc(l,f)(n)},Xc=[Ln("hotspot"),Kn("bubble"),ne("overrides",{}),Wc(),ba("placement",function(t,n,e){var o=n.hotspot,r=wc(e,o.element),i=Gc(t.element,n,Ja(),$a(),qa(),Ka(),st.some(n.hotspot.element));return st.some({anchorBox:r,bubble:n.bubble.getOr(zc()),overrides:n.overrides,layouts:i,placer:st.none()})})],Yc=[Ln("x"),Ln("y"),ne("height",0),ne("width",0),ne("bubble",zc()),ne("overrides",{}),Wc(),ba("placement",function(t,n,e){var o=Sc(e,n.x,n.y),r=Hu(o.left,o.top,n.width,n.height),i=Gc(t.element,n,Xa(),Ya(),Xa(),Ya(),st.none());return st.some({anchorBox:r,bubble:n.bubble,overrides:n.overrides,layouts:i,placer:st.none()})})],qc=function(t,n,e,o){return{start:t,soffset:n,finish:e,foffset:o}},Kc=Vt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Jc=(Kc.before,Kc.on,Kc.after,function(t){return t.fold(ct,ct,ct)}),$c=Vt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Qc={domRange:$c.domRange,relative:$c.relative,exact:$c.exact,exactFromRange:function(t){return $c.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var n=t.match({domRange:function(t){return me.fromDom(t.startContainer)},relative:function(t,n){return Jc(t)},exact:function(t,n,e,o){return t}});return Sr(n)},range:qc},Zc=function(t,n,e){var o,r,i=t.document.createRange();return o=i,n.fold(function(t){o.setStartBefore(t.dom)},function(t,n){o.setStart(t.dom,n)},function(t){o.setStartAfter(t.dom)}),r=i,e.fold(function(t){r.setEndBefore(t.dom)},function(t,n){r.setEnd(t.dom,n)},function(t){r.setEndAfter(t.dom)}),i},ts=function(t,n,e,o,r){var i=t.document.createRange();return i.setStart(n.dom,e),i.setEnd(o.dom,r),i},ns=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},es=Vt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),os=function(t,n,e){return n(me.fromDom(e.startContainer),e.startOffset,me.fromDom(e.endContainer),e.endOffset)},rs=function(t,n){var r,e,o,i=(r=t,n.match({domRange:function(t){return{ltr:at(t),rtl:st.none}},relative:function(t,n){return{ltr:Lt(function(){return Zc(r,t,n)}),rtl:Lt(function(){return st.some(Zc(r,n,t))})}},exact:function(t,n,e,o){return{ltr:Lt(function(){return ts(r,t,n,e,o)}),rtl:Lt(function(){return st.some(ts(r,e,o,t,n))})}}}));return(o=(e=i).ltr()).collapsed?e.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return es.rtl(me.fromDom(t.endContainer),t.endOffset,me.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return os(0,es.ltr,o)}):os(0,es.ltr,o)};es.ltr,es.rtl;var is,us,as,cs=(is=hr,us="text",{get:function(t){if(!is(t))throw new Error("Can only get "+us+" value of a "+us+" node");return as(t).getOr("")},getOption:as=function(t){return is(t)?st.from(t.dom.nodeValue):st.none()},set:function(t,n){if(!is(t))throw new Error("Can only set raw "+us+" value of a "+us+" node");t.dom.nodeValue=n}}),ss=function(t){return cs.getOption(t)},ls=["img","br"],fs=function(t){return ss(t).filter(function(t){return 0!==t.trim().length||-1<t.indexOf("\xa0")}).isSome()||M(ls,mr(t))},ds=function(t,i){var u=function(t){for(var n=_r(t),e=n.length-1;0<=e;e--){var o=n[e];if(i(o))return st.some(o);var r=u(o);if(r.isSome())return r}return st.none()};return u(t)},ms=function(t,n){return e=n,r=(o=t)===undefined?document:o.dom,We(r)?[]:V(r.querySelectorAll(e),me.fromDom);var e,o,r},gs=function(t,n,e,o){var r,i,u,a,c,s=(i=n,u=e,a=o,(c=yr(r=t).dom.createRange()).setStart(r.dom,i),c.setEnd(u.dom,a),c),l=Ge(t,e)&&n===o;return s.collapsed&&!l},ps=function(t){if(0<t.rangeCount){var n=t.getRangeAt(0),e=t.getRangeAt(t.rangeCount-1);return st.some(qc(me.fromDom(n.startContainer),n.startOffset,me.fromDom(e.endContainer),e.endOffset))}return st.none()},hs=function(t){if(null===t.anchorNode||null===t.focusNode)return ps(t);var n=me.fromDom(t.anchorNode),e=me.fromDom(t.focusNode);return gs(n,t.anchorOffset,e,t.focusOffset)?st.some(qc(n,t.anchorOffset,e,t.focusOffset)):ps(t)},vs=function(t){return n=t,st.from(n.getSelection()).filter(function(t){return 0<t.rangeCount}).bind(hs);var n},bs=function(t,n){var i,e,o,r,u=rs(i=t,n).match({ltr:function(t,n,e,o){var r=i.document.createRange();return r.setStart(t.dom,n),r.setEnd(e.dom,o),r},rtl:function(t,n,e,o){var r=i.document.createRange();return r.setStart(e.dom,o),r.setEnd(t.dom,n),r}});return o=(e=u).getClientRects(),0<(r=0<o.length?o[0]:e.getBoundingClientRect()).width||0<r.height?st.some(r).map(ns):st.none()},ys=function(t,n){return{element:t,offset:n}},xs=function(t,n){var e=_r(t);if(0===e.length)return ys(t,n);if(n<e.length)return ys(e[n],0);var o,r=e[e.length-1],i=hr(r)?(o=r,cs.get(o).length):_r(r).length;return ys(r,i)},ws=Vt([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Ss=function(t){return t.fold(ct,function(t,n,e){return t.translate(-n,-e)})},ks=function(t){return t.fold(ct,ct)},Cs=function(t){return N(t,function(t,n){return t.translate(n.left,n.top)},wu(0,0))},Os=function(t){var n=V(t,ks);return Cs(n)},_s=ws.screen,Ts=ws.absolute,Es=function(t,n,e){var o,r,i=yr(t.element),u=Au(i),a=(o=t,r=Sr(e.root).dom,st.from(r.frameElement).map(me.fromDom).filter(function(t){var n=yr(t),e=yr(o.element);return Ge(n,e)}).map(ku).getOr(u));return Ts(a,u.left,u.top)},Ds=function(t,n,e,o){var r=t,i=n,u=e,a=o;t<0&&(r=0,u=e+t),n<0&&(i=0,a=o+n);var c=_s(wu(r,i));return st.some({point:c,width:u,height:a})},Bs=function(t,l,f,d,m){return t.map(function(t){var n,e,o,r=[l,t.point],i=(n=function(){return Os(r)},e=function(){return Os(r)},o=function(){return t=V(r,Ss),Cs(t);var t},d.fold(n,e,o)),u={x:i.left,y:i.top,width:t.width,height:t.height},a=(f.showAbove?qa:Ja)(),c=(f.showAbove?Ka:$a)(),s=Gc(m,f,a,c,a,c,st.none());return{anchorBox:u,bubble:f.bubble.getOr(zc()),overrides:f.overrides,layouts:s,placer:st.none()}})},As=function(t,n){return(hr(t)?ys:xs)(t,n)},Ms=function(t,n){return n.getSelection.getOrThunk(function(){return function(){return vs(t)}})().map(function(t){var n=As(t.start,t.soffset),e=As(t.finish,t.foffset);return Qc.range(n.element,n.offset,e.element,e.offset)})},Fs=[Kn("getSelection"),Ln("root"),Kn("bubble"),Wc(),ne("overrides",{}),ne("showAbove",!1),ba("placement",function(t,n,e){var o=Sr(n.root).dom,r=Es(t,0,n),i=Ms(o,n).bind(function(t){return bs(o,Qc.exactFromRange(t)).orThunk(function(){var n=me.fromText("\ufeff");return Er(t.start,n),bs(o,Qc.exact(n,0,n,1)).map(function(t){return Ir(n),t})}).bind(function(t){return Ds(t.left,t.top,t.width,t.height)})}),u=Ms(o,n).bind(function(t){return pr(t.start)?st.some(t.start):Cr(t.start)}).getOr(t.element);return Bs(i,r,n,e,u)})],Is=[Ln("node"),Ln("root"),Kn("bubble"),Wc(),ne("overrides",{}),ne("showAbove",!1),ba("placement",function(r,i,u){var a=Es(r,0,i);return i.node.bind(function(t){var n=t.dom.getBoundingClientRect(),e=Ds(n.left,n.top,n.width,n.height),o=i.node.getOr(r.element);return Bs(e,a,i,u,o)})})],Rs=function(t){return t.x+t.width},Vs=function(t,n){return t.x-n.width},Ps=function(t,n){return t.y-n.height+t.height},Hs=function(t){return t.y},zs=function(t,n,e){return wa(Rs(t),Hs(t),e.southeast(),ka(),Aa(t,{left:0,top:2}),"link-layout-se")},Ns=function(t,n,e){return wa(Vs(t,n),Hs(t),e.southwest(),Ca(),Aa(t,{right:1,top:2}),"link-layout-sw")},Ls=function(t,n,e){return wa(Rs(t),Ps(t,n),e.northeast(),Oa(),Aa(t,{left:0,bottom:3}),"link-layout-ne")},js=function(t,n,e){return wa(Vs(t,n),Ps(t,n),e.northwest(),_a(),Aa(t,{right:1,bottom:3}),"link-layout-nw")},Us=function(){return[zs,Ns,Ls,js]},Ws=function(){return[Ns,zs,js,Ls]},Gs=[Ln("item"),Wc(),ne("overrides",{}),ba("placement",function(t,n,e){var o=wc(e,n.item.element),r=Gc(t.element,n,Us(),Ws(),Us(),Ws(),st.none());return st.some({anchorBox:o,bubble:zc(),overrides:n.overrides,layouts:r,placer:st.none()})})],Xs=An("anchor",{selection:Fs,node:Is,hotspot:Xc,submenu:Gs,makeshift:Yc}),Ys=function(t,n,e,o,r){var i={anchorBox:e.anchorBox,origin:n};Rc(i,r.element,e.bubble,e.layouts,o,e.overrides)},qs=function(t,n,e,o,r,i){var u=i.map(zu);return Ks(t,n,e,o,r,u)},Ks=function(c,s,t,n,l,f){var d=En("positioning anchor.info",Xs,n);hc(function(){qi(l.element,"position","fixed");var t=Zi(l.element,"visibility");qi(l.element,"visibility","hidden");var n,e,o,r,i=s.useFixed()?(r=document.documentElement,Cc(0,0,r.clientWidth,r.clientHeight)):(e=ku((n=c).element),o=n.element.dom.getBoundingClientRect(),kc(e.left,e.top,o.width,o.height)),u=d.placement,a=f.map(at).or(s.getBounds);u(c,d,i).each(function(t){t.placer.getOr(Ys)(c,i,t,a,l)}),t.fold(function(){nu(l.element,"visibility")},function(t){qi(l.element,"visibility",t)}),Zi(l.element,"left").isNone()&&Zi(l.element,"top").isNone()&&Zi(l.element,"right").isNone()&&Zi(l.element,"bottom").isNone()&&Zi(l.element,"position").is("fixed")&&nu(l.element,"position")},l.element)},Js=/* */Object.freeze({__proto__:null,position:function(t,n,e,o,r){qs(t,n,e,o,r,st.none())},positionWithin:qs,positionWithinBounds:Ks,getMode:function(t,n,e){return n.useFixed()?"fixed":"absolute"}}),$s=[ne("useFixed",c),Kn("getBounds")],Qs=ac({fields:$s,name:"positioning",active:dc,apis:Js}),Zs=function(t){Yo(t,Ho());var n=t.components();ft(n,Zs)},tl=function(t){var n=t.components();ft(n,tl),Yo(t,Po())},nl=function(t,n){Ar(t.element,n.element)},el=function(n,t){var e,o=n.components();ft((e=n).components(),function(t){return Ir(t.element)}),Fr(e.element),e.syncComponents();var r=X(o,t);ft(r,function(t){Zs(t),n.getSystem().removeFromWorld(t)}),ft(t,function(t){t.getSystem().isConnected()?nl(n,t):(n.getSystem().addToWorld(t),nl(n,t),Ui(n.element)&&tl(t)),n.syncComponents()})},ol=function(t,n){rl(t,n,Ar)},rl=function(t,n,e){t.getSystem().addToWorld(n),e(t.element,n.element),Ui(t.element)&&tl(n),t.syncComponents()},il=function(t){Zs(t),Ir(t.element),t.getSystem().removeFromWorld(t)},ul=function(n){var t=kr(n.element).bind(function(t){return n.getSystem().getByDom(t).toOptional()});il(n),t.each(function(t){t.syncComponents()})},al=function(t){var n=t.components();ft(n,il),Fr(t.element),t.syncComponents()},cl=function(t,n){sl(t,n,Ar)},sl=function(t,n,e){e(t,n.element);var o=_r(n.element);ft(o,function(t){n.getByDom(t).each(tl)})},ll=function(n){var t=_r(n.element);ft(t,function(t){n.getByDom(t).each(Zs)}),Ir(n.element)},fl=function(n,t,e,o){e.get().each(function(t){al(n)});var r=t.getAttachPoint(n);ol(r,n);var i=n.getSystem().build(o);return ol(n,i),e.set(i),i},dl=function(t,n,e,o){var r=fl(t,n,e,o);return n.onOpen(t,r),r},ml=function(n,e,o){o.get().each(function(t){al(n),ul(n),e.onClose(n,t),o.clear()})},gl=function(t,n,e){return e.isOpen()},pl=function(t,n,e){var o,r,i,u,a=n.getAttachPoint(t);qi(t.element,"position",Qs.getMode(a)),o=t,r="visibility",i=n.cloakVisibilityAttr,u="hidden",Zi(o.element,r).fold(function(){Ur(o.element,i)},function(t){zr(o.element,i,t)}),qi(o.element,r,u)},hl=function(t,n,e){var o,r,i,u;o=t.element,F(["top","left","right","bottom"],function(t){return Zi(o,t).isSome()})||nu(t.element,"position"),r=t,i="visibility",u=n.cloakVisibilityAttr,Lr(r.element,u).fold(function(){return nu(r.element,i)},function(t){return qi(r.element,i,t)})},vl=/* */Object.freeze({__proto__:null,cloak:pl,decloak:hl,open:dl,openWhileCloaked:function(t,n,e,o,r){pl(t,n),dl(t,n,e,o),r(),hl(t,n)},close:ml,isOpen:gl,isPartOf:function(n,e,t,o){return gl(0,0,t)&&t.get().exists(function(t){return e.isPartOf(n,t,o)})},getState:function(t,n,e){return e.get()},setContent:function(t,n,e,o){return e.get().map(function(){return fl(t,n,e,o)})}}),bl=/* */Object.freeze({__proto__:null,events:function(e,o){return Zo([er(Bo(),function(t,n){ml(t,e,o)})])}}),yl=[ga("onOpen"),ga("onClose"),Ln("isPartOf"),Ln("getAttachPoint"),ne("cloakVisibilityAttr","data-precloak-visibility")],xl=ac({fields:yl,name:"sandboxing",active:bl,apis:vl,state:/* */Object.freeze({__proto__:null,init:function(){var n=fe(st.none()),t=at("not-implemented");return di({readState:t,isOpen:function(){return n.get().isSome()},clear:function(){n.set(st.none())},set:function(t){n.set(st.some(t))},get:function(){return n.get()}})}})}),wl=at("dismiss.popups"),Sl=at("reposition.popups"),kl=at("mouse.released"),Cl=ln([ne("isExtraPart",c),te("fireEventInstead",[ne("event",zo())])]),Ol=function(t){var e=En("Dismissal",Cl,t),n={};return n[wl()]={schema:ln([Ln("target")]),onReceive:function(n,t){xl.isOpen(n)&&(xl.isPartOf(n,t.target)||e.isExtraPart(n,t.target)||e.fireEventInstead.fold(function(){return xl.close(n)},function(t){return Yo(n,t.event)}))}},n},_l=ln([te("fireEventInstead",[ne("event",No())]),Gn("doReposition")]),Tl=function(t){var e=En("Reposition",_l,t),n={};return n[Sl()]={onReceive:function(n){xl.isOpen(n)&&e.fireEventInstead.fold(function(){return e.doReposition(n)},function(t){return Yo(n,t.event)})}},n},El=function(t,n,e){n.store.manager.onLoad(t,n,e)},Dl=function(t,n,e){n.store.manager.onUnload(t,n,e)},Bl=/* */Object.freeze({__proto__:null,onLoad:El,onUnload:Dl,setValue:function(t,n,e,o){n.store.manager.setValue(t,n,e,o)},getValue:function(t,n,e){return n.store.manager.getValue(t,n,e)},getState:function(t,n,e){return e}}),Al=/* */Object.freeze({__proto__:null,events:function(e,o){var t=e.resetOnDom?[sr(function(t,n){El(t,e,o)}),lr(function(t,n){Dl(t,e,o)})]:[tc(e,o,El)];return Zo(t)}}),Ml=function(){var t=fe(null);return di({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},Fl=function(){var i=fe({}),u=fe({});return di({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(t){return Ft(i.get(),t).orThunk(function(){return Ft(u.get(),t)})},update:function(t){var n=i.get(),e=u.get(),o={},r={};ft(t,function(n){o[n.value]=n,Ft(n,"meta").each(function(t){Ft(t,"text").each(function(t){r[t]=n})})}),i.set(ut(ut({},n),o)),u.set(ut(ut({},e),r))},clear:function(){i.set({}),u.set({})}})},Il=/* */Object.freeze({__proto__:null,memory:Ml,dataset:Fl,manual:function(){return di({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),Rl=function(t,n,e,o){var r=n.store;e.update([o]),r.setValue(t,o),n.onSetValue(t,o)},Vl=[Kn("initialValue"),Ln("getFallbackEntry"),Ln("getDataKey"),Ln("setValue"),ba("manager",{setValue:Rl,getValue:function(t,n,e){var o=n.store,r=o.getDataKey(t);return e.lookup(r).fold(function(){return o.getFallbackEntry(r)},function(t){return t})},onLoad:function(n,e,o){e.store.initialValue.each(function(t){Rl(n,e,o,t)})},onUnload:function(t,n,e){e.clear()},state:Fl})],Pl=[Ln("getValue"),ne("setValue",$),Kn("initialValue"),ba("manager",{setValue:function(t,n,e,o){n.store.setValue(t,o),n.onSetValue(t,o)},getValue:function(t,n,e){return n.store.getValue(t)},onLoad:function(n,e,t){e.store.initialValue.each(function(t){e.store.setValue(n,t)})},onUnload:$,state:fi.init})],Hl=[Kn("initialValue"),ba("manager",{setValue:function(t,n,e,o){e.set(o),n.onSetValue(t,o)},getValue:function(t,n,e){return e.get()},onLoad:function(t,n,e){n.store.initialValue.each(function(t){e.isNotSet()&&e.set(t)})},onUnload:function(t,n,e){e.clear()},state:Ml})],zl=[ee("store",{mode:"memory"},An("mode",{memory:Hl,manual:Pl,dataset:Vl})),ga("onSetValue"),ne("resetOnDom",!1)],Nl=ac({fields:zl,name:"representing",active:Al,apis:Bl,extra:{setValueFrom:function(t,n){var e=Nl.getValue(n);Nl.setValue(t,e)}},state:Il}),Ll=function(o,t){return se(o,{},V(t,function(t){return n=t.name(),e="Cannot configure "+t.name()+" for "+o,bn(n,n,Gt(),sn(function(t){return yt("The field: "+n+" is forbidden. "+e)}));var n,e}).concat([le("dump",ct)]))},jl=function(t){return t.dump},Ul=function(t,n){return ut(ut({},t.dump),ic(n))},Wl=Ll,Gl=Ul,Xl="placeholder",Yl=Vt([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),ql=function(t){return It(t,"uiType")},Kl=function(t,n,e,o){return ql(e)&&e.uiType===Xl?(i=e,u=o,(r=t).exists(function(t){return t!==i.owner})?Yl.single(!0,at(i)):Ft(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+Ct(u)+"]\nNamespace: "+r.getOr("none")+"\nSpec: "+JSON.stringify(i,null,2))},function(t){return t.replace()})):Yl.single(!1,at(e));var r,i,u},Jl=function(i,u,a,c){return Kl(i,0,a,c).fold(function(t,n){var e=ql(a)?n(u,a.config,a.validated):n(u),o=Ft(e,"components").getOr([]),r=U(o,function(t){return Jl(i,u,t,c)});return[ut(ut({},e),{components:r})]},function(t,n){if(ql(a)){var e=n(u,a.config,a.validated);return a.validated.preprocess.getOr(ct)(e)}return n(u)})},$l=function(n,e,t,o){var r,i,u,a=Tt(o,function(t,n){return o=t,r=!1,{name:at(e=n),required:function(){return o.fold(function(t,n){return t},function(t,n){return t})},used:function(){return r},replace:function(){if(r)throw new Error("Trying to use the same placeholder more than once: "+e);return r=!0,o}};var e,o,r}),c=(r=n,i=e,u=a,U(t,function(t){return Jl(r,i,t,u)}));return _t(a,function(t){if(!1===t.used()&&t.required())throw new Error("Placeholder: "+t.name()+" was not found in components list\nNamespace: "+n.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))}),c},Ql=Yl.single,Zl=Yl.multiple,tf=at(Xl),nf=Vt([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),ef=ne("factory",{sketch:ct}),of=ne("schema",[]),rf=Ln("name"),uf=bn("pname","pname",Xt(function(t){return"<alloy."+Kr(t.name)+">"}),Mn()),af=le("schema",function(){return[Kn("preprocess")]}),cf=ne("defaults",at({})),sf=ne("overrides",at({})),lf=fn([ef,of,rf,uf,cf,sf]),ff=fn([ef,of,rf,cf,sf]),df=fn([ef,of,rf,uf,cf,sf]),mf=fn([ef,af,rf,Ln("unit"),uf,cf,sf]),gf=function(t){return t.fold(st.some,st.none,st.some,st.some)},pf=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},hf=function(e,o){return function(t){var n=En("Converting part type",o,t);return e(n)}},vf=hf(nf.required,lf),bf=hf(nf.external,ff),yf=hf(nf.optional,df),xf=hf(nf.group,mf),wf=at("entirety"),Sf=/* */Object.freeze({__proto__:null,required:vf,external:bf,optional:yf,group:xf,asNamedPart:gf,name:pf,asCommon:function(t){return t.fold(ct,ct,ct,ct)},original:wf}),kf=function(t,n,e,o){return zt(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},Cf=function(r,t){var n={};return ft(t,function(t){gf(t).each(function(e){var o=Of(r,e.pname);n[e.name]=function(t){var n=En("Part: "+e.name+" in "+r,fn(e.schema),t);return ut(ut({},o),{config:t,validated:n})}})}),n},Of=function(t,n){return{uiType:tf(),owner:t,name:n}},_f=function(t,n,e){return{uiType:tf(),owner:t,name:n,config:e,validated:{}}},Tf=function(t){return U(t,function(t){return t.fold(st.none,st.some,st.none,st.none).map(function(t){return Xn(t.name,t.schema.concat([ya(wf())]))}).toArray()})},Ef=function(t){return V(t,pf)},Df=function(t,n,e){return o=n,i={},r={},ft(e,function(t){t.fold(function(o){i[o.pname]=Ql(!0,function(t,n,e){return o.factory.sketch(kf(t,o,n,e))})},function(t){var n=o.parts[t.name];r[t.name]=at(t.factory.sketch(kf(o,t,n[wf()]),n))},function(o){i[o.pname]=Ql(!1,function(t,n,e){return o.factory.sketch(kf(t,o,n,e))})},function(r){i[r.pname]=Zl(!0,function(n,t,e){var o=n[r.name];return V(o,function(t){return r.factory.sketch(zt(r.defaults(n,t,e),t,r.overrides(n,t)))})})})}),{internals:at(i),externals:at(r)};var o,i,r},Bf=function(t,n,e){return $l(st.some(t),n,n.components,e)},Af=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOptional()},Mf=function(t,n,e){return Af(t,n,e).getOrDie("Could not find part: "+e)},Ff=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return ft(e,function(t){o[t]=at(i.getByUid(r[t]))}),o},If=function(t,n){var e=t.getSystem();return Tt(n.partUids,function(t,n){return at(e.getByUid(t))})},Rf=function(t){return Ct(t.partUids)},Vf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return ft(e,function(t){o[t]=at(i.getByUid(r[t]).getOrDie())}),o},Pf=function(n,t){var e=Ef(t);return $t(V(e,function(t){return{key:t,value:n+"-"+t}}))},Hf=function(n){return bn("partUids","partUids",Yt(function(t){return Pf(t.uid,n)}),Mn())},zf=/* */Object.freeze({__proto__:null,generate:Cf,generateOne:_f,schemas:Tf,names:Ef,substitutes:Df,components:Bf,defaultUids:Pf,defaultUidsSchema:Hf,getAllParts:If,getAllPartNames:Rf,getPart:Af,getPartOrDie:Mf,getParts:Ff,getPartsOrDie:Vf}),Nf=function(t,n,e,o,r){var i,u,a=(u=r,(0<(i=o).length?[Xn("parts",i)]:[]).concat([Ln("uid"),ne("dom",{}),ne("components",[]),ya("originalSpec"),ne("debug.sketcher",{})]).concat(u));return En(t+" [SpecSchema]",ln(a.concat(n)),e)},Lf=function(t,n,e,o,r){var i=jf(r),u=Tf(e),a=Hf(e),c=Nf(t,n,i,u,[a]),s=Df(0,c,e);return o(c,Bf(t,c,s.internals()),i,s.externals())},jf=function(t){return It(t,"uid")?t:ut(ut({},t),{uid:ei("uid")})};var Uf,Wf,Gf=ln([Ln("name"),Ln("factory"),Ln("configFields"),ne("apis",{}),ne("extraApis",{})]),Xf=ln([Ln("name"),Ln("factory"),Ln("configFields"),Ln("partFields"),ne("apis",{}),ne("extraApis",{})]),Yf=function(t){var i=En("Sketcher for "+t.name,Gf,t),n=Tt(i.apis,li),e=Tt(i.extraApis,ai);return ut(ut({name:i.name,configFields:i.configFields,sketch:function(t){return n=i.name,e=i.configFields,o=i.factory,r=jf(t),o(Nf(n,e,r,[],[]),r);var n,e,o,r}},n),e)},qf=function(t){var n=En("Sketcher for "+t.name,Xf,t),e=Cf(n.name,n.partFields),o=Tt(n.apis,li),r=Tt(n.extraApis,ai);return ut(ut({name:n.name,partFields:n.partFields,configFields:n.configFields,sketch:function(t){return Lf(n.name,n.configFields,n.partFields,n.factory,t)},parts:e},o),r)},Kf=function(t){for(var n=[],e=function(t){n.push(t)},o=0;o<t.length;o++)t[o].each(e);return n},Jf=function(t,n){return t?st.some(n):st.none()},$f=function(t){return"input"===mr(t)&&"radio"!==Nr(t,"type")||"textarea"===mr(t)},Qf=/* */Object.freeze({__proto__:null,getCurrent:function(t,n,e){return n.find(t)}}),Zf=[Ln("find")],td=ac({fields:Zf,name:"composing",apis:Qf}),nd=function(e,o,t,r){var n=ms(e.element,"."+o.highlightClass);ft(n,function(n){F(r,function(t){return t.element===n})||(Bi(n,o.highlightClass),e.getSystem().getByDom(n).each(function(t){o.onDehighlight(e,t),Yo(t,Xo())}))})},ed=function(t,n,e,o){nd(t,n,0,[o]),od(t,n,e,o)||(Ei(o.element,n.highlightClass),n.onHighlight(t,o),Yo(o,Go()))},od=function(t,n,e,o){return Ai(o.element,n.highlightClass)},rd=function(t,n,e,o){var r=ms(t.element,"."+n.itemClass);return st.from(r[o]).fold(function(){return mt.error("No element found with index "+o)},t.getSystem().getByDom)},id=function(n,t,e){return Ku(n.element,"."+t.itemClass).bind(function(t){return n.getSystem().getByDom(t).toOptional()})},ud=function(n,t,e){var o=ms(n.element,"."+t.itemClass);return(0<o.length?st.some(o[o.length-1]):st.none()).bind(function(t){return n.getSystem().getByDom(t).toOptional()})},ad=function(e,n,t,o){var r=ms(e.element,"."+n.itemClass);return j(r,function(t){return Ai(t,n.highlightClass)}).bind(function(t){var n=Oc(t,o,0,r.length-1);return e.getSystem().getByDom(r[n]).toOptional()})},cd=function(n,t,e){var o=ms(n.element,"."+t.itemClass);return Kf(V(o,function(t){return n.getSystem().getByDom(t).toOptional()}))},sd=/* */Object.freeze({__proto__:null,dehighlightAll:function(t,n,e){return nd(t,n,0,[])},dehighlight:function(t,n,e,o){od(t,n,e,o)&&(Bi(o.element,n.highlightClass),n.onDehighlight(t,o),Yo(o,Xo()))},highlight:ed,highlightFirst:function(n,e,o){id(n,e).each(function(t){ed(n,e,o,t)})},highlightLast:function(n,e,o){ud(n,e).each(function(t){ed(n,e,o,t)})},highlightAt:function(n,e,o,t){rd(n,e,o,t).fold(function(t){throw new Error(t)},function(t){ed(n,e,o,t)})},highlightBy:function(n,e,o,t){var r=cd(n,e);L(r,t).each(function(t){ed(n,e,o,t)})},isHighlighted:od,getHighlighted:function(n,t,e){return Ku(n.element,"."+t.highlightClass).bind(function(t){return n.getSystem().getByDom(t).toOptional()})},getFirst:id,getLast:ud,getPrevious:function(t,n,e){return ad(t,n,0,-1)},getNext:function(t,n,e){return ad(t,n,0,1)},getCandidates:cd}),ld=[Ln("highlightClass"),Ln("itemClass"),ga("onHighlight"),ga("onDehighlight")],fd=ac({fields:ld,name:"highlighting",apis:sd}),dd=[8],md=[9],gd=[13],pd=[27],hd=[32],vd=[37],bd=[38],yd=[39],xd=[40],wd=function(t,n,e){var o=G(t.slice(0,n)),r=G(t.slice(n+1));return L(o.concat(r),e)},Sd=function(t,n,e){var o=G(t.slice(0,n));return L(o,e)},kd=function(t,n,e){var o=t.slice(0,n),r=t.slice(n+1);return L(r.concat(o),e)},Cd=function(t,n,e){var o=t.slice(n+1);return L(o,e)},Od=function(e){return function(t){var n=t.raw;return M(e,n.which)}},_d=function(t){return function(n){return W(t,function(t){return t(n)})}},Td=function(t){return!0===t.raw.shiftKey},Ed=function(t){return!0===t.raw.ctrlKey},Dd=x(Td),Bd=function(t,n){return{matches:t,classification:n}},Ad=function(t,n,e){n.exists(function(n){return e.exists(function(t){return Ge(t,n)})})||qo(t,Lo(),{prevFocus:n,newFocus:e})},Md=function(){var r=function(t){return pc(t.element)};return{get:r,set:function(t,n){var e=r(t);t.getSystem().triggerFocus(n,t.element);var o=r(t);Ad(t,e,o)}}},Fd=function(){var r=function(t){return fd.getHighlighted(t).map(function(t){return t.element})};return{get:r,set:function(n,t){var e=r(n);n.getSystem().getByDom(t).fold($,function(t){fd.highlight(n,t)});var o=r(n);Ad(n,e,o)}}};(Wf=Uf=Uf||{}).OnFocusMode="onFocus",Wf.OnEnterOrSpaceMode="onEnterOrSpace",Wf.OnApiMode="onApi";var Id,Rd=function(t,n,e,o,a){var c=function(n,e,t,o,r){var i,u,a=t(n,e,o,r);return i=a,u=e.event,L(i,function(t){return t.matches(u)}).map(function(t){return t.classification}).bind(function(t){return t(n,e,o,r)})},r={schema:function(){return t.concat([ne("focusManager",Md()),ee("focusInside","onFocus",Cn(function(t){return M(["onFocus","onEnterOrSpace","onApi"],t)?mt.value(t):mt.error("Invalid value for focusInside")})),ba("handler",r),ba("state",n),ba("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var t=i.focusInside!==Uf.OnFocusMode?st.none():a(i).map(function(e){return er(So(),function(t,n){e(t,i,u),n.stop()})}),n=[er(mo(),function(o,r){c(o,r,e,i,u).fold(function(){var n,e,t;n=o,e=r,t=Od(hd.concat(gd))(e.event),i.focusInside===Uf.OnEnterOrSpaceMode&&t&&$e(n,e)&&a(i).each(function(t){t(n,i,u),e.stop()})},function(t){r.stop()})}),er(go(),function(t,n){c(t,n,o,i,u).each(function(t){n.stop()})})];return Zo(t.toArray().concat(n))}};return r},Vd=function(t){var n=[Kn("onEscape"),Kn("onEnter"),ne("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),ne("firstTabstop",0),ne("useTabstopAt",b),Kn("visibilitySelector")].concat([t]),u=function(t,n){var e=t.visibilitySelector.bind(function(t){return Ju(n,t)}).getOr(n);return 0<bu(e)},e=function(n,e,t){var o,r,i;o=e,r=ms(n.element,o.selector),i=H(r,function(t){return u(o,t)}),st.from(i[o.firstTabstop]).each(function(t){e.focusManager.set(n,t)})},a=function(n,t,e,o,r){return r(t,e,function(t){return u(n=o,e=t)&&n.useTabstopAt(e);var n,e}).fold(function(){return o.cyclic?st.some(!0):st.none()},function(t){return o.focusManager.set(n,t),st.some(!0)})},r=function(n,t,e,o){var r,i,u=ms(n.element,e.selector);return r=n,(i=e).focusManager.get(r).bind(function(t){return Ju(t,i.selector)}).bind(function(t){return j(u,y(Ge,t)).bind(function(t){return a(n,u,t,e,o)})})},o=at([Bd(_d([Td,Od(md)]),function(t,n,e){var o=e.cyclic?wd:Sd;return r(t,0,e,o)}),Bd(Od(md),function(t,n,e){var o=e.cyclic?kd:Cd;return r(t,0,e,o)}),Bd(Od(pd),function(n,e,t){return t.onEscape.bind(function(t){return t(n,e)})}),Bd(_d([Dd,Od(gd)]),function(n,e,t){return t.onEnter.bind(function(t){return t(n,e)})})]),i=at([]);return Rd(n,fi.init,o,i,function(){return st.some(e)})},Pd=Vd(le("cyclic",c)),Hd=Vd(le("cyclic",b)),zd=function(t,n,e){return $f(e)&&Od(hd)(n.event)?st.none():(Jo(t,e,_o()),st.some(!0))},Nd=function(t,n){return st.some(!0)},Ld=[ne("execute",zd),ne("useSpace",!1),ne("useEnter",!0),ne("useControlEnter",!1),ne("useDown",!1)],jd=function(t,n,e){return e.execute(t,n,t.element)},Ud=Rd(Ld,fi.init,function(t,n,e,o){var r=e.useSpace&&!$f(t.element)?hd:[],i=e.useEnter?gd:[],u=e.useDown?xd:[],a=r.concat(i).concat(u);return[Bd(Od(a),jd)].concat(e.useControlEnter?[Bd(_d([Ed,Od(gd)]),jd)]:[])},function(t,n,e,o){return e.useSpace&&!$f(t.element)?[Bd(Od(hd),Nd)]:[]},function(){return st.none()}),Wd=function(){var e=fe(st.none());return di({readState:function(){return e.get().map(function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,n){e.set(st.some({numRows:t,numColumns:n}))},getNumRows:function(){return e.get().map(function(t){return t.numRows})},getNumColumns:function(){return e.get().map(function(t){return t.numColumns})}})},Gd=/* */Object.freeze({__proto__:null,flatgrid:Wd,init:function(t){return t.state(t)}}),Xd=function(i){return function(t,n,e,o){var r=i(t.element);return Jd(r,t,n,e,o)}},Yd=function(t,n){var e=Nc(t,n);return Xd(e)},qd=function(t,n){var e=Nc(n,t);return Xd(e)},Kd=function(r){return function(t,n,e,o){return Jd(r,t,n,e,o)}},Jd=function(n,e,t,o,r){return o.focusManager.get(e).bind(function(t){return n(e.element,t,o,r)}).map(function(t){return o.focusManager.set(e,t),!0})},$d=Kd,Qd=Kd,Zd=Kd,tm=function(t){return!((n=t.dom).offsetWidth<=0&&n.offsetHeight<=0);var n},nm=function(t,n,e){var o,r=ms(t,e),i=H(r,tm);return j(o=i,function(t){return Ge(t,n)}).map(function(t){return{index:t,candidates:o}})},em=function(t,n){return j(t,function(t){return Ge(n,t)})},om=function(e,t,o,n){return n(Math.floor(t/o),t%o).bind(function(t){var n=t.row*o+t.column;return 0<=n&&n<e.length?st.some(e[n]):st.none()})},rm=function(r,t,i,u,a){return om(r,t,u,function(t,n){var e=t===i-1?r.length-t*u:u,o=Oc(n,a,0,e-1);return st.some({row:t,column:o})})},im=function(i,t,u,a,c){return om(i,t,a,function(t,n){var e=Oc(t,c,0,u-1),o=e===u-1?i.length-e*a:a,r=_c(n,0,o-1);return st.some({row:e,column:r})})},um=[Ln("selector"),ne("execute",zd),pa("onEscape"),ne("captureTab",!1),xa()],am=function(n,e,t){Ku(n.element,e.selector).each(function(t){e.focusManager.set(n,t)})},cm=function(r){return function(t,n,e,o){return nm(t,n,e.selector).bind(function(t){return r(t.candidates,t.index,o.getNumRows().getOr(e.initSize.numRows),o.getNumColumns().getOr(e.initSize.numColumns))})}},sm=function(t,n,e){return e.captureTab?st.some(!0):st.none()},lm=cm(function(t,n,e,o){return rm(t,n,e,o,-1)}),fm=cm(function(t,n,e,o){return rm(t,n,e,o,1)}),dm=cm(function(t,n,e,o){return im(t,n,e,o,-1)}),mm=cm(function(t,n,e,o){return im(t,n,e,o,1)}),gm=at([Bd(Od(vd),Yd(lm,fm)),Bd(Od(yd),qd(lm,fm)),Bd(Od(bd),$d(dm)),Bd(Od(xd),Qd(mm)),Bd(_d([Td,Od(md)]),sm),Bd(_d([Dd,Od(md)]),sm),Bd(Od(pd),function(t,n,e){return e.onEscape(t,n)}),Bd(Od(hd.concat(gd)),function(n,e,o,t){return r=n,(i=o).focusManager.get(r).bind(function(t){return Ju(t,i.selector)}).bind(function(t){return o.execute(n,e,t)});var r,i})]),pm=at([Bd(Od(hd),Nd)]),hm=Rd(um,Wd,gm,pm,function(){return st.some(am)}),vm=function(t,n,e,i){var u=function(t,n,e){var o,r=Oc(n,i,0,e.length-1);return r===t?st.none():(o=e[r],"button"===mr(o)&&"disabled"===Nr(o,"disabled")?u(t,r,e):st.from(e[r]))};return nm(t,e,n).bind(function(t){var n=t.index,e=t.candidates;return u(n,n,e)})},bm=[Ln("selector"),ne("getInitial",st.none),ne("execute",zd),pa("onEscape"),ne("executeOnMove",!1),ne("allowVertical",!0)],ym=function(n,e,o){return t=n,(r=o).focusManager.get(t).bind(function(t){return Ju(t,r.selector)}).bind(function(t){return o.execute(n,e,t)});var t,r},xm=function(n,e,t){e.getInitial(n).orThunk(function(){return Ku(n.element,e.selector)}).each(function(t){e.focusManager.set(n,t)})},wm=function(t,n,e){return vm(t,e.selector,n,-1)},Sm=function(t,n,e){return vm(t,e.selector,n,1)},km=function(r){return function(t,n,e,o){return r(t,n,e,o).bind(function(){return e.executeOnMove?ym(t,n,e):st.some(!0)})}},Cm=function(t,n,e){return e.onEscape(t,n)},Om=at([Bd(Od(hd),Nd)]),_m=Rd(bm,fi.init,function(t,n,e,o){var r=vd.concat(e.allowVertical?bd:[]),i=yd.concat(e.allowVertical?xd:[]);return[Bd(Od(r),km(Yd(wm,Sm))),Bd(Od(i),km(qd(wm,Sm))),Bd(Od(gd),ym),Bd(Od(hd),ym),Bd(Od(pd),Cm)]},Om,function(){return st.some(xm)}),Tm=function(t,n,e){return st.from(t[n]).bind(function(t){return st.from(t[e]).map(function(t){return{rowIndex:n,columnIndex:e,cell:t}})})},Em=function(t,n,e,o){var r=t[n].length,i=Oc(e,o,0,r-1);return Tm(t,n,i)},Dm=function(t,n,e,o){var r=Oc(e,o,0,t.length-1),i=t[r].length,u=_c(n,0,i-1);return Tm(t,r,u)},Bm=function(t,n,e,o){var r=t[n].length,i=_c(e+o,0,r-1);return Tm(t,n,i)},Am=function(t,n,e,o){var r=_c(e+o,0,t.length-1),i=t[r].length,u=_c(n,0,i-1);return Tm(t,r,u)},Mm=[Xn("selectors",[Ln("row"),Ln("cell")]),ne("cycles",!0),ne("previousSelector",st.none),ne("execute",zd)],Fm=function(n,e,t){e.previousSelector(n).orThunk(function(){var t=e.selectors;return Ku(n.element,t.cell)}).each(function(t){e.focusManager.set(n,t)})},Im=function(t,n){return function(e,o,i){var u=i.cycles?t:n;return Ju(o,i.selectors.row).bind(function(t){var n=ms(t,i.selectors.cell);return em(n,o).bind(function(o){var r=ms(e,i.selectors.row);return em(r,t).bind(function(t){var n,e=(n=i,V(r,function(t){return ms(t,n.selectors.cell)}));return u(e,t,o).map(function(t){return t.cell})})})})}},Rm=Im(function(t,n,e){return Em(t,n,e,-1)},function(t,n,e){return Bm(t,n,e,-1)}),Vm=Im(function(t,n,e){return Em(t,n,e,1)},function(t,n,e){return Bm(t,n,e,1)}),Pm=Im(function(t,n,e){return Dm(t,e,n,-1)},function(t,n,e){return Am(t,e,n,-1)}),Hm=Im(function(t,n,e){return Dm(t,e,n,1)},function(t,n,e){return Am(t,e,n,1)}),zm=at([Bd(Od(vd),Yd(Rm,Vm)),Bd(Od(yd),qd(Rm,Vm)),Bd(Od(bd),$d(Pm)),Bd(Od(xd),Qd(Hm)),Bd(Od(hd.concat(gd)),function(n,e,o){return pc(n.element).bind(function(t){return o.execute(n,e,t)})})]),Nm=at([Bd(Od(hd),Nd)]),Lm=Rd(Mm,fi.init,zm,Nm,function(){return st.some(Fm)}),jm=[Ln("selector"),ne("execute",zd),ne("moveOnTab",!1)],Um=function(n,e,o){return o.focusManager.get(n).bind(function(t){return o.execute(n,e,t)})},Wm=function(n,e,t){Ku(n.element,e.selector).each(function(t){e.focusManager.set(n,t)})},Gm=function(t,n,e){return vm(t,e.selector,n,-1)},Xm=function(t,n,e){return vm(t,e.selector,n,1)},Ym=at([Bd(Od(bd),Zd(Gm)),Bd(Od(xd),Zd(Xm)),Bd(_d([Td,Od(md)]),function(t,n,e,o){return e.moveOnTab?Zd(Gm)(t,n,e,o):st.none()}),Bd(_d([Dd,Od(md)]),function(t,n,e,o){return e.moveOnTab?Zd(Xm)(t,n,e,o):st.none()}),Bd(Od(gd),Um),Bd(Od(hd),Um)]),qm=at([Bd(Od(hd),Nd)]),Km=Rd(jm,fi.init,Ym,qm,function(){return st.some(Wm)}),Jm=[pa("onSpace"),pa("onEnter"),pa("onShiftEnter"),pa("onLeft"),pa("onRight"),pa("onTab"),pa("onShiftTab"),pa("onUp"),pa("onDown"),pa("onEscape"),ne("stopSpaceKeyup",!1),Kn("focusIn")],$m=Rd(Jm,fi.init,function(t,n,e){return[Bd(Od(hd),e.onSpace),Bd(_d([Dd,Od(gd)]),e.onEnter),Bd(_d([Td,Od(gd)]),e.onShiftEnter),Bd(_d([Td,Od(md)]),e.onShiftTab),Bd(_d([Dd,Od(md)]),e.onTab),Bd(Od(bd),e.onUp),Bd(Od(xd),e.onDown),Bd(Od(vd),e.onLeft),Bd(Od(yd),e.onRight),Bd(Od(hd),e.onSpace),Bd(Od(pd),e.onEscape)]},function(t,n,e){return e.stopSpaceKeyup?[Bd(Od(hd),Nd)]:[]},function(t){return t.focusIn}),Qm=Pd.schema(),Zm=Hd.schema(),tg=_m.schema(),ng=hm.schema(),eg=Lm.schema(),og=Ud.schema(),rg=Km.schema(),ig=$m.schema(),ug=sc({branchKey:"mode",branches:/* */Object.freeze({__proto__:null,acyclic:Qm,cyclic:Zm,flow:tg,flatgrid:ng,matrix:eg,execution:og,menu:rg,special:ig}),name:"keying",active:{events:function(t,n){return t.handler.toEvents(t,n)}},apis:{focusIn:function(n,e,o){e.sendFocusIn(e).fold(function(){n.getSystem().triggerFocus(n.element,n.element)},function(t){t(n,e,o)})},setGridSize:function(t,n,e,o,r){Rt(e,"setGridSize")?e.setGridSize(o,r):console.error("Layout does not support setGridSize")}},state:Gd}),ag=function(t,n,e,o){var r=t.getSystem().build(o);rl(t,r,e)},cg=function(t,n,e,o){var r=sg(t);L(r,function(t){return Ge(o.element,t.element)}).each(ul)},sg=function(t,n){return t.components()},lg=function(n,t,e,r,o){var i=sg(n);return st.from(i[r]).map(function(t){return cg(n,0,0,t),o.each(function(t){ag(n,0,function(t,n){var e,o;o=n,Tr(e=t,r).fold(function(){Ar(e,o)},function(t){Er(t,o)})},t)}),t})},fg=ac({fields:[],name:"replacing",apis:/* */Object.freeze({__proto__:null,append:function(t,n,e,o){ag(t,0,Ar,o)},prepend:function(t,n,e,o){ag(t,0,Br,o)},remove:cg,replaceAt:lg,replaceBy:function(n,t,e,o,r){var i=sg(n);return j(i,o).bind(function(t){return lg(n,0,0,t,r)})},set:function(n,t,e,o){hc(function(){var t=V(o,n.getSystem().build);el(n,t)},n.element)},contents:sg})}),dg=function(t,n){var e,o;return{key:t,value:{config:{},me:(e=t,o=Zo(n),ac({fields:[Ln("enabled")],name:e,active:{events:at(o)}})),configAsRaw:at({}),initialConfig:{},state:fi}}},mg=function(t,n){n.ignore||(mc(t.element),n.onFocus(t))},gg=/* */Object.freeze({__proto__:null,focus:mg,blur:function(t,n){n.ignore||t.element.dom.blur()},isFocused:function(t){return n=t.element,e=Hi(n).dom,n.dom===e.activeElement;var n,e}}),pg=/* */Object.freeze({__proto__:null,exhibit:function(t,n){var e=n.ignore?{}:{attributes:{tabindex:"-1"}};return gi(e)},events:function(e){return Zo([er(So(),function(t,n){mg(t,e),n.stop()})].concat(e.stopMousedown?[er(io(),function(t,n){n.event.prevent()})]:[]))}}),hg=[ga("onFocus"),ne("stopMousedown",!1),ne("ignore",!1)],vg=ac({fields:hg,name:"focusing",active:pg,apis:gg}),bg=function(t,n,e){var o=n.aria;o.update(t,o,e.get())},yg=function(n,t,e){t.toggleClass.each(function(t){(e.get()?Ei:Bi)(n.element,t)})},xg=function(t,n,e){kg(t,n,e,!e.get())},wg=function(t,n,e){e.set(!0),yg(t,n,e),bg(t,n,e)},Sg=function(t,n,e){e.set(!1),yg(t,n,e),bg(t,n,e)},kg=function(t,n,e,o){(o?wg:Sg)(t,n,e)},Cg=function(t,n,e){kg(t,n,e,n.selected)},Og=/* */Object.freeze({__proto__:null,onLoad:Cg,toggle:xg,isOn:function(t,n,e){return e.get()},on:wg,off:Sg,set:kg}),_g=/* */Object.freeze({__proto__:null,exhibit:function(){return gi({})},events:function(t,n){var e,o,r,i=(e=t,o=n,r=xg,dr(function(t){r(t,e,o)})),u=tc(t,n,Cg);return Zo(dt([t.toggleOnExecute?[i]:[],[u]]))}}),Tg=function(t,n,e){zr(t.element,"aria-expanded",e)},Eg=[ne("selected",!1),Kn("toggleClass"),ne("toggleOnExecute",!0),ee("aria",{mode:"none"},An("mode",{pressed:[ne("syncWithExpanded",!1),ba("update",function(t,n,e){zr(t.element,"aria-pressed",e),n.syncWithExpanded&&Tg(t,n,e)})],checked:[ba("update",function(t,n,e){zr(t.element,"aria-checked",e)})],expanded:[ba("update",Tg)],selected:[ba("update",function(t,n,e){zr(t.element,"aria-selected",e)})],none:[ba("update",$)]}))],Dg=ac({fields:Eg,name:"toggling",active:_g,apis:Og,state:(Id=!1,{init:function(){var n=fe(Id);return{get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(Id)},readState:function(){return n.get()}}}})}),Bg=function(){var t=function(t,n){n.stop(),Ko(t)};return[er(vo(),t),er(Eo(),t),ar(no()),ar(io())]},Ag=function(t){return Zo(dt([t.map(function(e){return dr(function(t,n){e(t),n.stop()})}).toArray(),Bg()]))},Mg="alloy.item-hover",Fg="alloy.item-focus",Ig=function(t){(pc(t.element).isNone()||vg.isFocused(t))&&(vg.isFocused(t)||vg.focus(t),qo(t,Mg,{item:t}))},Rg=function(t){qo(t,Fg,{item:t})},Vg=at(Mg),Pg=at(Fg),Hg=[Ln("data"),Ln("components"),Ln("dom"),ne("hasSubmenu",!1),Kn("toggling"),Wl("itemBehaviours",[Dg,vg,ug,Nl]),ne("ignoreFocus",!1),ne("domModification",{}),ba("builder",function(t){return{dom:t.dom,domModification:ut(ut({},t.domModification),{attributes:ut(ut(ut({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Gl(t.itemBehaviours,[t.toggling.fold(Dg.revoke,function(t){return Dg.config(ut({aria:{mode:"checked"}},t))}),vg.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){Rg(t)}}),ug.config({mode:"execution"}),Nl.config({store:{mode:"memory",initialValue:t.data}}),dg("item-type-events",S(Bg(),[er(so(),Ig),er(To(),vg.focus)]))]),components:t.components,eventOrder:t.eventOrder}}),ne("eventOrder",{})],zg=[Ln("dom"),Ln("components"),ba("builder",function(t){return{dom:t.dom,components:t.components,events:Zo([(n=To(),er(n,function(t,n){n.stop()}))])};var n})],Ng=function(){return"item-widget"},Lg=at([vf({name:"widget",overrides:function(n){return{behaviours:ic([Nl.config({store:{mode:"manual",getValue:function(t){return n.data},setValue:function(){}}})])}}})]),jg=[Ln("uid"),Ln("data"),Ln("components"),Ln("dom"),ne("autofocus",!1),ne("ignoreFocus",!1),Wl("widgetBehaviours",[Nl,vg,ug]),ne("domModification",{}),Hf(Lg()),ba("builder",function(e){var t=Df(Ng(),e,Lg()),n=Bf(Ng(),e,t.internals()),o=function(t){return Af(t,e,"widget").map(function(t){return ug.focusIn(t),t})},r=function(t,n){return $f(n.event.target)||e.autofocus&&n.setSource(t.element),st.none()};return{dom:e.dom,components:n,domModification:e.domModification,events:Zo([dr(function(t,n){o(t).each(function(t){n.stop()})}),er(so(),Ig),er(To(),function(t,n){e.autofocus?o(t):vg.focus(t)})]),behaviours:Gl(e.widgetBehaviours,[Nl.config({store:{mode:"memory",initialValue:e.data}}),vg.config({ignore:e.ignoreFocus,onFocus:function(t){Rg(t)}}),ug.config({mode:"special",focusIn:e.autofocus?function(t){o(t)}:lc(),onLeft:r,onRight:r,onEscape:function(t,n){return vg.isFocused(t)||e.autofocus?(e.autofocus&&n.setSource(t.element),st.none()):(vg.focus(t),st.some(!0))}})])}})],Ug=An("type",{widget:jg,item:Hg,separator:zg}),Wg=at([xf({factory:{sketch:function(t){var n=En("menu.spec item",Ug,t);return n.builder(n)}},name:"items",unit:"item",defaults:function(t,n){return n.hasOwnProperty("uid")?n:ut(ut({},n),{uid:ei("item")})},overrides:function(t,n){return{type:n.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Gg=at([Ln("value"),Ln("items"),Ln("dom"),Ln("components"),ne("eventOrder",{}),Ll("menuBehaviours",[fd,Nl,td,ug]),ee("movement",{mode:"menu",moveOnTab:!0},An("mode",{grid:[xa(),ba("config",function(t,n){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:n.initSize.numColumns,numRows:n.initSize.numRows},focusManager:t.focusManager}})],matrix:[ba("config",function(t,n){return{mode:"matrix",selectors:{row:n.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}}),Ln("rowSelector")],menu:[ne("moveOnTab",!0),ba("config",function(t,n){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:n.moveOnTab,focusManager:t.focusManager}})]})),jn("markers",sa()),ne("fakeFocus",!1),ne("focusManager",Md()),ga("onHighlight")]),Xg=at("alloy.menu-focus"),Yg=qf({name:"Menu",configFields:Gg(),partFields:Wg(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Ul(t.menuBehaviours,[fd.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Nl.config({store:{mode:"memory",initialValue:t.value}}),td.config({find:st.some}),ug.config(t.movement.config(t,t.movement))]),events:Zo([er(Pg(),function(n,e){var t=e.event;n.getSystem().getByDom(t.target).each(function(t){fd.highlight(n,t),e.stop(),qo(n,Xg(),{menu:n,item:t})})}),er(Vg(),function(t,n){var e=n.event.item;fd.highlight(t,e)})]),components:n,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),qg=function(e,o,r,t){return Ft(r,t).bind(function(t){return Ft(e,t).bind(function(t){var n=qg(e,o,r,t);return st.some([t].concat(n))})}).getOr([])},Kg=function(t,n){var e={};_t(t,function(t,n){ft(t,function(t){e[t]=n})});var o=n,r=Et(n,function(t,n){return{k:t,v:n}}),i=Tt(r,function(t,n){return[n].concat(qg(e,o,r,n))});return Tt(e,function(t){return Ft(i,t).getOr([t])})},Jg=function(t){return"prepared"===t.type?st.some(t.menu):st.none()},$g={init:function(){var i=fe({}),u=fe({}),a=fe({}),c=fe(st.none()),s=fe({}),r=function(t,o,r){return e(t).bind(function(n){return e=t,At(i.get(),function(t,n){return t===e}).bind(function(t){return o(t).map(function(t){return{triggeredMenu:n,triggeringItem:t,triggeringPath:r}})});var e})},e=function(t){return n(t).bind(Jg)},n=function(t){return Ft(u.get(),t)},l=function(t){return Ft(i.get(),t)};return{setMenuBuilt:function(t,n){var e;u.set(ut(ut({},u.get()),((e={})[t]={type:"prepared",menu:n},e)))},setContents:function(t,n,e,o){c.set(st.some(t)),i.set(e),u.set(n),s.set(o);var r=Kg(o,e);a.set(r)},expand:function(e){return Ft(i.get(),e).map(function(t){var n=Ft(a.get(),e).getOr([]);return[t].concat(n)})},refresh:function(t){return Ft(a.get(),t)},collapse:function(t){return Ft(a.get(),t).bind(function(t){return 1<t.length?st.some(t.slice(1)):st.none()})},lookupMenu:n,lookupItem:l,otherMenus:function(t){var n=s.get();return X(Ct(n),t)},getPrimary:function(){return c.get().bind(e)},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),a.set({}),c.set(st.none())},isClear:function(){return c.get().isNone()},getTriggeringPath:function(t,o){var n=H(l(t).toArray(),function(t){return e(t).isSome()});return Ft(a.get(),t).bind(function(t){var e=G(n.concat(t));return function(t){for(var n=[],e=0;e<t.length;e++){var o=t[e];if(!o.isSome())return st.none();n.push(o.getOrDie())}return st.some(n)}(U(e,function(t,n){return r(t,o,e.slice(0,n+1)).fold(function(){return c.get().is(t)?[]:[st.none()]},function(t){return[st.some(t)]})}))})}}},extractPreparedMenu:Jg},Qg=at("collapse-item"),Zg=Yf({name:"TieredMenu",configFields:[va("onExecute"),va("onEscape"),ha("onOpenMenu"),ha("onOpenSubmenu"),ga("onRepositionMenu"),ga("onCollapseMenu"),ne("highlightImmediately",!0),Xn("data",[Ln("primary"),Ln("menus"),Ln("expansions")]),ne("fakeFocus",!1),ga("onHighlight"),ga("onHover"),fa(),Ln("dom"),ne("navigateOnHover",!0),ne("stayInDom",!1),Ll("tmenuBehaviours",[ug,fd,td,fg]),ne("eventOrder",{})],apis:{collapseMenu:function(t,n){t.collapseMenu(n)},highlightPrimary:function(t,n){t.highlightPrimary(n)},repositionMenus:function(t,n){t.repositionMenus(n)}},factory:function(a,t){var c,n,i=fe(st.none()),s=$g.init(),e=function(t){var o,r,n,e=(o=t,r=a.data.primary,n=a.data.menus,Tt(n,function(t,n){var e=function(){return Yg.sketch(ut(ut({},t),{value:n,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:(a.fakeFocus?Fd:Md)()}))};return n===r?{type:"prepared",menu:o.getSystem().build(e())}:{type:"notbuilt",nbMenu:e}})),i=u();return s.setContents(a.data.primary,e,a.data.expansions,i),s.getPrimary()},l=function(t){return Nl.getValue(t).value},u=function(t){return Tt(a.data.menus,function(t,n){return U(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})})},f=function(n,t){fd.highlight(n,t),fd.getHighlighted(t).orThunk(function(){return fd.getFirst(t)}).each(function(t){Jo(n,t.element,To())})},d=function(n,t){return Kf(V(t,function(t){return n.lookupMenu(t).bind(function(t){return"prepared"===t.type?st.some(t.menu):st.none()})}))},m=function(n,t,e){var o=d(t,t.otherMenus(e));ft(o,function(t){Fi(t.element,[a.markers.backgroundMenu]),a.stayInDom||fg.remove(n,t)})},g=function(t,o){var r,n=(r=t,i.get().getOrThunk(function(){var e={},t=ms(r.element,"."+a.markers.item),n=H(t,function(t){return"true"===Nr(t,"aria-haspopup")});return ft(n,function(t){r.getSystem().getByDom(t).each(function(t){var n=l(t);e[n]=t})}),i.set(st.some(e)),e}));_t(n,function(t,n){var e=M(o,n);zr(t.element,"aria-expanded",e)})},p=function(o,r,i){return st.from(i[0]).bind(function(t){return r.lookupMenu(t).bind(function(t){if("notbuilt"===t.type)return st.none();var n=t.menu,e=d(r,i.slice(1));return ft(e,function(t){Ei(t.element,a.markers.backgroundMenu)}),Ui(n.element)||fg.append(o,pu(n)),Fi(n.element,[a.markers.backgroundMenu]),f(o,n),m(o,r,i),st.some(n)})})};(n=c=c||{})[n.HighlightSubmenu=0]="HighlightSubmenu",n[n.HighlightParent=1]="HighlightParent";var h=function(r,i,u){void 0===u&&(u=c.HighlightSubmenu);var t=l(i);return s.expand(t).bind(function(o){return g(r,o),st.from(o[0]).bind(function(e){return s.lookupMenu(e).bind(function(t){var n=function(t,n,e){if("notbuilt"!==e.type)return e.menu;var o=t.getSystem().build(e.nbMenu());return s.setMenuBuilt(n,o),o}(r,e,t);return Ui(n.element)||fg.append(r,pu(n)),a.onOpenSubmenu(r,i,n,G(o)),u===c.HighlightSubmenu?(fd.highlightFirst(n),p(r,s,o)):(fd.dehighlightAll(n),st.some(i))})})})},o=function(n,e){var t=l(e);return s.collapse(t).bind(function(t){return g(n,t),p(n,s,t).map(function(t){return a.onCollapseMenu(n,e,t),t})})},r=function(e){return function(n,t){return Ju(t.getSource(),"."+a.markers.item).bind(function(t){return n.getSystem().getByDom(t).toOptional().bind(function(t){return e(n,t).map(function(){return!0})})})}},v=Zo([er(Xg(),function(e,o){var t=o.event.item;s.lookupItem(l(t)).each(function(){var t=o.event.menu;fd.highlight(e,t);var n=l(o.event.item);s.refresh(n).each(function(t){return m(e,s,t)})})}),dr(function(n,t){var e=t.event.target;n.getSystem().getByDom(e).each(function(t){0===l(t).indexOf("collapse-item")&&o(n,t),h(n,t,c.HighlightSubmenu).fold(function(){a.onExecute(n,t)},function(){})})}),sr(function(n,t){e(n).each(function(t){fg.append(n,pu(t)),a.onOpenMenu(n,t),a.highlightImmediately&&f(n,t)})})].concat(a.navigateOnHover?[er(Vg(),function(t,n){var e,o,r=n.event.item;e=t,o=l(r),s.refresh(o).bind(function(t){return g(e,t),p(e,s,t)}),h(t,r,c.HighlightParent),a.onHover(t,r)})]:[])),b=function(t){return fd.getHighlighted(t).bind(fd.getHighlighted)},y={collapseMenu:function(n){b(n).each(function(t){o(n,t)})},highlightPrimary:function(n){s.getPrimary().each(function(t){f(n,t)})},repositionMenus:function(o){s.getPrimary().bind(function(n){return b(o).bind(function(t){var n=l(t),e=Mt(s.getMenus()),o=Kf(V(e,$g.extractPreparedMenu));return s.getTriggeringPath(n,function(t){return e=t,Z(o,function(t){if(!t.getSystem().isConnected())return st.none();var n=fd.getCandidates(t);return L(n,function(t){return l(t)===e})});var e})}).map(function(t){return{primary:n,triggeringPath:t}})}).fold(function(){var t;t=o,st.from(t.components()[0]).filter(function(t){return"menu"===Nr(t.element,"role")}).each(function(t){a.onRepositionMenu(o,t,[])})},function(t){var n=t.primary,e=t.triggeringPath;a.onRepositionMenu(o,n,e)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:Ul(a.tmenuBehaviours,[ug.config({mode:"special",onRight:r(function(t,n){return $f(n.element)?st.none():h(t,n,c.HighlightSubmenu)}),onLeft:r(function(t,n){return $f(n.element)?st.none():o(t,n)}),onEscape:r(function(t,n){return o(t,n).orThunk(function(){return a.onEscape(t,n).map(function(){return t})})}),focusIn:function(n,t){s.getPrimary().each(function(t){Jo(n,t.element,To())})}}),fd.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),td.config({find:function(t){return fd.getHighlighted(t)}}),fg.config({})]),eventOrder:a.eventOrder,apis:y,events:v}},extraApis:{tieredData:function(t,n,e){return{primary:t,menus:n,expansions:e}},singleData:function(t,n){return{primary:t,menus:Jt(t,n),expansions:{}}},collapseItem:function(t){return{value:Kr(Qg()),meta:{text:t}}}}}),tp=Yf({name:"InlineView",configFields:[Ln("lazySink"),ga("onShow"),ga("onHide"),Zn("onEscape"),Ll("inlineBehaviours",[xl,Nl,fc]),te("fireDismissalEventInstead",[ne("event",zo())]),te("fireRepositionEventInstead",[ne("event",No())]),ne("getRelated",st.none),ne("isExtraPart",c),ne("eventOrder",st.none)],factory:function(m,t){var o=function(t,n,e,o){r(t,n,e,function(){return o.map(zu)})},r=function(t,n,e,o){var r=m.lazySink(t).getOrDie();xl.openWhileCloaked(t,e,function(){return Qs.positionWithinBounds(r,n,t,o())}),Nl.setValue(t,st.some({mode:"position",anchor:n,getBounds:o}))},i=function(t,n,e,o){var r,i,u,a,c,s,l,f,d=(r=m,i=t,u=n,c=o,s=function(){return r.lazySink(i)},l="horizontal"===(a=e).type?{layouts:{onLtr:Ja,onRtl:$a}}:{},f=function(t){return 2===t.length?l:{}},Zg.sketch({dom:{tag:"div"},data:a.data,markers:a.menu.markers,highlightImmediately:a.menu.highlightImmediately,onEscape:function(){return xl.close(i),r.onEscape.map(function(t){return t(i)}),st.some(!0)},onExecute:function(){return st.some(!0)},onOpenMenu:function(t,n){Qs.positionWithinBounds(s().getOrDie(),u,n,c())},onOpenSubmenu:function(t,n,e,o){var r=s().getOrDie();Qs.position(r,ut({anchor:"submenu",item:n},f(o)),e)},onRepositionMenu:function(t,n,e){var o=s().getOrDie();Qs.positionWithinBounds(o,u,n,c()),ft(e,function(t){var n=f(t.triggeringPath);Qs.position(o,ut({anchor:"submenu",item:t.triggeringItem},n),t.triggeredMenu)})}}));xl.open(t,d),Nl.setValue(t,st.some({mode:"menu",menu:d}))},n=function(e){xl.isOpen(e)&&Nl.getValue(e).each(function(t){switch(t.mode){case"menu":xl.getState(e).each(function(t){Zg.repositionMenus(t)});break;case"position":var n=m.lazySink(e).getOrDie();Qs.positionWithinBounds(n,t.anchor,e,t.getBounds())}})},e={setContent:function(t,n){xl.setContent(t,n)},showAt:function(t,n,e){o(t,n,e,st.none())},showWithin:o,showWithinBounds:r,showMenuAt:function(t,n,e){i(t,n,e,function(){return st.none()})},showMenuWithinBounds:i,hide:function(t){xl.isOpen(t)&&(Nl.setValue(t,st.none()),xl.close(t))},getContent:function(t){return xl.getState(t)},reposition:n,isOpen:xl.isOpen};return{uid:m.uid,dom:m.dom,behaviours:Ul(m.inlineBehaviours,[xl.config({isPartOf:function(t,n,e){return Zu(n,e)||(o=t,r=e,m.getRelated(o).exists(function(t){return Zu(t,r)}));var o,r},getAttachPoint:function(t){return m.lazySink(t).getOrDie()},onOpen:function(t){m.onShow(t)},onClose:function(t){m.onHide(t)}}),Nl.config({store:{mode:"memory",initialValue:st.none()}}),fc.config({channels:ut(ut({},Ol(ut({isExtraPart:t.isExtraPart},m.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Tl(ut(ut({},m.fireRepositionEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})),{doReposition:n})))})]),eventOrder:m.eventOrder,apis:e}},apis:{showAt:function(t,n,e,o){t.showAt(n,e,o)},showWithin:function(t,n,e,o,r){t.showWithin(n,e,o,r)},showWithinBounds:function(t,n,e,o,r){t.showWithinBounds(n,e,o,r)},showMenuAt:function(t,n,e,o){t.showMenuAt(n,e,o)},showMenuWithinBounds:function(t,n,e,o,r){t.showMenuWithinBounds(n,e,o,r)},hide:function(t,n){t.hide(n)},isOpen:function(t,n){return t.isOpen(n)},getContent:function(t,n){return t.getContent(n)},setContent:function(t,n,e){t.setContent(n,e)},reposition:function(t,n){t.reposition(n)}}}),np=function(t){return t.x},ep=function(t,n){return t.x+t.width/2-n.width/2},op=function(t,n){return t.x+t.width-n.width},rp=function(t){return t.y},ip=function(t,n){return t.y+t.height-n.height},up=function(t,n,e){return wa(op(t,n),ip(t,n),e.innerSoutheast(),_a(),Aa(t,{right:0,bottom:3}),"layout-inner-se")},ap=function(t,n,e){return wa(np(t),ip(t,n),e.innerSouthwest(),Oa(),Aa(t,{left:1,bottom:3}),"layout-inner-sw")},cp=function(t,n,e){return wa(op(t,n),rp(t),e.innerNortheast(),Ca(),Aa(t,{right:0,top:2}),"layout-inner-ne")},sp=function(t,n,e){return wa(np(t),rp(t),e.innerNorthwest(),ka(),Aa(t,{left:1,top:2}),"layout-inner-nw")},lp=function(t,n,e){return wa(ep(t,n),rp(t),e.innerNorth(),Ta(),Aa(t,{top:2}),"layout-inner-n")},fp=function(t,n,e){return wa(ep(t,n),ip(t,n),e.innerSouth(),Ea(),Aa(t,{bottom:3}),"layout-inner-s")},dp=tinymce.util.Tools.resolve("tinymce.util.Delay"),mp=Yf({name:"Button",factory:function(t){var n=Ag(t.action),e=t.dom.tag,o=function(n){return Ft(t.dom,"attributes").bind(function(t){return Ft(t,n)})};return{uid:t.uid,dom:t.dom,components:t.components,events:n,behaviours:Gl(t.buttonBehaviours,[vg.config({}),ug.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==e)return{role:o("role").getOr("button")};var t=o("type").getOr("button"),n=o("role").map(function(t){return{role:t}}).getOr({});return ut({type:t},n)}()},eventOrder:t.eventOrder}},configFields:[ne("uid",undefined),Ln("dom"),ne("components",[]),Wl("buttonBehaviours",[vg,ug]),Kn("action"),Kn("role"),ne("eventOrder",{})]}),gp=function(t){var n=t.uid!==undefined&&Rt(t,"uid")?t.uid:ei("memento");return{get:function(t){return t.getSystem().getByUid(n).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(n).toOptional()},asSpec:function(){return ut(ut({},t),{uid:n})}}},pp=function(t){return st.from(t()["temporary-placeholder"]).getOr("!not found!")},hp=function(t,n){return st.from(n()[t.toLowerCase()]).getOrThunk(function(){return pp(n)})},vp={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},bp=Yf({name:"Notification",factory:function(n){var t,e,o=gp({dom:{tag:"p",innerHtml:n.translationProvider(n.text)},behaviours:ic([fg.config({})])}),r=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},i=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},u=gp({dom:{tag:"div",classes:n.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[r(0)]},i(0)],behaviours:ic([fg.config({})])}),a={updateProgress:function(t,n){t.getSystem().isConnected()&&u.getOpt(t).each(function(t){fg.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[r(n)]},i(n)])})},updateText:function(t,n){var e;t.getSystem().isConnected()&&(e=o.get(t),fg.set(e,[fu(n)]))}},c=dt([n.icon.toArray(),n.level.toArray(),n.level.bind(function(t){return st.from(vp[t])}).toArray()]),s=gp(mp.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:hp("close",n.iconProvider),attributes:{"aria-label":n.translationProvider("Close")}}}],action:function(t){n.onAction(t)}})),l=[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:(t=c,e=n.iconProvider,Z(t,function(t){return st.from(e()[t.toLowerCase()])}).getOrThunk(function(){return pp(e)}))}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:ic([fg.config({})])}];return{uid:n.uid,dom:{tag:"div",attributes:{role:"alert"},classes:n.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]}).getOr(["tox-notification","tox-notification--in"])},behaviours:ic([vg.config({}),dg("notification-events",[er(lo(),function(t){s.getOpt(t).each(vg.focus)})])]),components:l.concat(n.progress?[u.asSpec()]:[]).concat(n.closeButton?[s.asSpec()]:[]),apis:a}},configFields:[Kn("level"),Ln("progress"),Ln("icon"),Ln("onAction"),Ln("text"),Ln("iconProvider"),Ln("translationProvider"),ue("closeButton",!0)],apis:{updateProgress:function(t,n,e){t.updateProgress(n,e)},updateText:function(t,n,e){t.updateText(n,e)}}});function yp(t,u,a){var c=u.backstage;return{open:function(t,n){var e=!t.closeButton&&t.timeout&&(0<t.timeout||t.timeout<0),o=function(){n(),tp.hide(i)},r=gu(bp.sketch({text:t.text,level:M(["success","error","warning","warn","info"],t.type)?t.type:undefined,progress:!0===t.progressBar,icon:st.from(t.icon),closeButton:!e,onAction:o,iconProvider:c.shared.providers.icons,translationProvider:c.shared.providers.translate})),i=gu(tp.sketch(ut({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:u.backstage.shared.getSink,fireDismissalEventInstead:{}},c.shared.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return a.add(i),0<t.timeout&&dp.setTimeout(function(){o()},t.timeout),{close:o,moveTo:function(t,n){tp.showAt(i,{anchor:"makeshift",x:t,y:n},pu(r))},moveRel:function(t,n){var e,o;"banner"!==n?(e=function(t){switch(t){case"bc-bc":return fp;case"tc-tc":return lp;case"tc-bc":return ja;case"bc-tc":default:return Ua}}(n),o={anchor:"node",root:Wi(),node:st.some(me.fromDom(t)),layouts:{onRtl:function(){return[e]},onLtr:function(){return[e]}}},tp.showAt(i,o,pu(r))):tp.showAt(i,u.backstage.shared.anchors.banner(),pu(r))},text:function(t){bp.updateText(r,t)},settings:t,getEl:function(){return r.element.dom},progressBar:{value:function(t){bp.updateProgress(r,t)}}}},close:function(t){t.close()},reposition:function(t){var e;ft(t,function(t){return t.moveTo(0,0)}),0<(e=t).length&&(K(e).each(function(t){return t.moveRel(null,"banner")}),ft(e,function(t,n){0<n&&t.moveRel(e[n-1].getEl(),"bc-tc")}))},getArgs:function(t){return t.settings}}}var xp,wp,Sp=function(e,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null!==r&&clearTimeout(r),r=setTimeout(function(){e.apply(null,t),r=null},o)}}},kp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Cp=function(o,t,n,e,r){var i=kp(o,function(t){return e=t,(n=o).isBlock(e)||M(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===n.getContentEditable(e);var n,e});return st.from(i.backwards(t,n,e,r))},Op=function(e,n){return _p(me.fromDom(e.selection.getNode())).getOrThunk(function(){var t=me.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',e.getDoc());return Ar(t,me.fromDom(n.extractContents())),n.insertNode(t.dom),kr(t).each(function(t){return t.dom.normalize()}),ds(t,fs).map(function(t){var n;e.selection.setCursorLocation(t.dom,"img"===mr(n=t)?1:ss(n).fold(function(){return _r(n).length},function(t){return t.length}))}),t})},_p=function(t){return Ju(t,"[data-mce-autocompleter]")},Tp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},Ep=function(t){return""!==t&&-1!==" \xa0\f\n\r\t\x0B".indexOf(t)},Dp=function(t,n){return t.substring(n.length)},Bp=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 Cp(t,o.startContainer,o.startOffset,function(t,n,e){return function(t,n,e){for(var o=n-1;0<=o;o--){var r=t.charAt(o);if(Ep(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=Tp(n);return 0!==e.lastIndexOf(r)||Dp(e,r).length<i?st.none():st.some({text:Dp(e,r),range:n,triggerChar:r})})},Ap=function(o,t,r,n){return void 0===n&&(n=0),_p(me.fromDom(t.startContainer)).fold(function(){return Bp(o,t,r,n)},function(t){var n=o.createRng();n.selectNode(t.dom);var e=Tp(n);return st.some({range:n,text:Dp(e,r),triggerChar:r})})},Mp=function(e,t){t.on("keypress compositionend",e.onKeypress.throttle),t.on("remove",e.onKeypress.cancel);var o=function(t,n){qo(t,mo(),{raw:n})};t.on("keydown",function(n){var t=function(){return e.getView().bind(fd.getHighlighted)};8===n.which&&e.onKeypress.throttle(n),e.isActive()&&(27===n.which&&e.cancelIfNecessary(),e.isMenuOpen()?13===n.which?(t().each(Ko),n.preventDefault()):40===n.which?(t().fold(function(){e.getView().each(fd.highlightFirst)},function(t){o(t,n)}),n.preventDefault(),n.stopImmediatePropagation()):37!==n.which&&38!==n.which&&39!==n.which||t().each(function(t){o(t,n),n.preventDefault(),n.stopImmediatePropagation()}):13!==n.which&&38!==n.which&&40!==n.which||e.cancelIfNecessary())}),t.on("NodeChange",function(t){e.isActive()&&!e.isProcessingAction()&&_p(me.fromDom(t.element)).isNone()&&e.cancelIfNecessary()})},Fp=tinymce.util.Tools.resolve("tinymce.util.Promise"),Ip=function(t,n){return{container:t,offset:n}},Rp=function(t){if(3===t.nodeType)return Ip(t,t.data.length);var n=t.childNodes;return 0<n.length?Rp(n[n.length-1]):Ip(t,n.length)},Vp=function(t,n){var e=t.childNodes;return 0<e.length&&n<e.length?Vp(e[n],0):0<e.length&&1===t.nodeType&&e.length===n?Rp(e[e.length-1]):Ip(t,n)},Pp=function(r){return function(t){var n,e,o=Vp(t.startContainer,t.startOffset);return!Cp(n=r,(e=o).container,e.offset,function(t,n){return 0===n?-1:n},n.getRoot()).filter(function(t){var n=t.container.data.charAt(t.offset-1);return!Ep(n)}).isSome()}},Hp=function(n,e){var o,r,t=e(),i=n.selection.getRng();return o=n.dom,r=i,Z(t.triggerChars,function(t){return Ap(o,r,t)}).bind(function(t){return zp(n,e,t)})},zp=function(n,t,e,o){void 0===o&&(o={});var r=t(),i=n.selection.getRng().startContainer.nodeValue,u=H(r.lookupByChar(e.triggerChar),function(t){return e.text.length>=t.minChars&&t.matches.getOrThunk(function(){return Pp(n.dom)})(e.range,i,e.text)});if(0===u.length)return st.none();var a=Fp.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,highlightOn:n.highlightOn}})}));return st.some({lookupData:a,context:e})},Np=fn([Un("type"),Qn("text")]),Lp=fn([ne("type","autocompleteitem"),ne("active",!1),ne("disabled",!1),ne("meta",{}),Un("value"),Qn("text"),Qn("icon")]),jp=fn([Un("type"),Un("ch"),oe("minChars",1),ne("columns",1),oe("maxResults",10),Zn("matches"),Gn("fetch"),Gn("onAction"),ce("highlightOn",[],Rn)]),Up=[ue("disabled",!1),Qn("tooltip"),Qn("icon"),Qn("text"),ae("onSetup",function(){return $})],Wp=fn([Un("type"),Gn("onAction")].concat(Up)),Gp=function(t){return _n("toolbarbutton",Wp,t)},Xp=[ue("active",!1)].concat(Up),Yp=fn(Xp.concat([Un("type"),Gn("onAction")])),qp=function(t){return _n("ToggleButton",Yp,t)},Kp=[ae("predicate",function(){return!1}),ie("scope","node",["node","editor"]),ie("position","selection",["node","selection","line"])],Jp=Up.concat([ne("type","contextformbutton"),ne("primary",!1),Gn("onAction"),le("original",ct)]),$p=Xp.concat([ne("type","contextformbutton"),ne("primary",!1),Gn("onAction"),le("original",ct)]),Qp=Up.concat([ne("type","contextformbutton")]),Zp=Xp.concat([ne("type","contextformtogglebutton")]),th=An("type",{contextformbutton:Jp,contextformtogglebutton:$p}),nh=fn([ne("type","contextform"),ae("initValue",function(){return""}),Qn("label"),qn("commands",th),Jn("launch",An("type",{contextformbutton:Qp,contextformtogglebutton:Zp}))].concat(Kp)),eh=fn([ne("type","contexttoolbar"),Un("items")].concat(Kp)),oh=function(t){var n,e,o=t.ui.registry.getAll().popups,r=Tt(o,function(t){return _n("Autocompleter",jp,t).fold(function(t){throw new Error(Dn(t))},function(t){return t})}),i=(n=Bt(r,function(t){return t.ch}),e={},ft(n,function(t){e[t]={}}),Ct(e)),u=Mt(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return H(u,function(t){return t.ch===n})}}};(wp=xp=xp||{})[wp.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",wp[wp.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var rh,ih,uh=xp,ah="tox-menu-nav__js",ch="tox-collection__item",sh="tox-swatch",lh={normal:ah,color:sh},fh="tox-collection__item--enabled",dh="tox-collection__item-label",mh="tox-collection__item-caret",gh="tox-collection__item--active",ph="tox-collection__item-container",hh="tox-collection__item-container--row",vh=function(t){return Ft(lh,t).getOr(ah)},bh=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:"color"===t?"tox-swatches":"tox-menu",tieredMenu:"tox-tiered-menu"}},yh=function(t){var n=bh(t);return{backgroundMenu:n.backgroundMenu,selectedMenu:n.selectedMenu,menu:n.menu,selectedItem:n.selectedItem,item:vh(t)}},xh=[Yg.parts.items({})],wh=function(t,n,e){var o=bh(e);return{dom:{tag:"div",classes:dt([[o.tieredMenu]])},markers:yh(e)}},Sh=function(e,o){return function(t){var n=R(t,o);return V(n,function(t){return{dom:e,components:t}})}},kh=function(t,e){var o=[],r=[];return ft(t,function(t,n){e(t,n)?(0<r.length&&o.push(r),r=[],It(t.dom,"innerHtml")&&r.push(t)):r.push(t)}),0<r.length&&o.push(r),V(o,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}})},Ch=function(n,e,t){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===n?["tox-collection--list"]:["tox-collection--grid"])},components:[Yg.parts.items({preprocess:function(t){return"auto"!==n&&1<n?Sh({tag:"div",classes:["tox-collection__group"]},n)(t):kh(t,function(t,n){return"separator"===e[n].type})}})]}},Oh=function(t){return F(t,function(t){return"icon"in t&&t.icon!==undefined})},_h=function(t){return console.error(Dn(t)),console.log(t),st.none()},Th=function(t,n,e,o,r){var i,u=(i=e,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Yg.parts.items({preprocess:function(t){return kh(t,function(t,n){return"separator"===i[n].type})}})]});return{value:t,dom:u.dom,components:u.components,items:e}},Eh=function(t,n,e,o,r){var i,u,a,c,s,l;return"color"===r?{value:t,dom:(a=(i=o,{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Yg.parts.items({preprocess:"auto"!==i?Sh({tag:"div",classes:["tox-swatches__row"]},i):ct})]}]})).dom,components:a.components,items:e}:"normal"===r&&"auto"===o?{value:t,dom:(a=Ch(o,e)).dom,components:a.components,items:e}:"normal"===r&&1===o?{value:t,dom:(a=Ch(1,e)).dom,components:a.components,items:e}:"normal"===r?{value:t,dom:(a=Ch(o,e)).dom,components:a.components,items:e}:"listpreview"!==r||"auto"===o?{value:t,dom:(c=n,s=o,l=bh(r),{tag:"div",classes:dt([[l.menu,"tox-menu-"+s+"-column"],c?[l.hasIcons]:[]])}),components:xh,items:e}:{value:t,dom:(a=(u=o,{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Yg.parts.items({preprocess:Sh({tag:"div",classes:["tox-collection__group"]},u)})]})).dom,components:a.components,items:e}},Dh=[Un("type"),Un("src"),Qn("alt"),ce("classes",[],Rn)],Bh=fn(Dh),Ah=[Un("type"),Un("text"),Qn("name"),ce("classes",["tox-collection__item-label"],Rn)],Mh=fn(Ah),Fh=kn(function(){return Bn("type",{cardimage:Bh,cardtext:Mh,cardcontainer:Ih})}),Ih=fn([Un("type"),re("direction","horizontal"),re("align","left"),re("valign","middle"),qn("items",Fh)]),Rh=[ue("disabled",!1),Qn("text"),Qn("shortcut"),bn("value","value",Xt(function(){return Kr("menuitem-value")}),Mn()),ne("meta",{})],Vh=fn([Un("type"),Qn("label"),qn("items",Fh),ae("onSetup",function(){return $}),ae("onAction",$)].concat(Rh)),Ph=fn([Un("type"),ue("active",!1),Qn("icon")].concat(Rh)),Hh=fn([Un("type"),Wn("fancytype",["inserttable","colorswatch"]),ae("onAction",$)]),zh=fn([Un("type"),ae("onSetup",function(){return $}),ae("onAction",$),Qn("icon")].concat(Rh)),Nh=fn([Un("type"),Gn("getSubmenuItems"),ae("onSetup",function(){return $}),Qn("icon")].concat(Rh)),Lh=fn([Un("type"),Qn("icon"),ue("active",!1),ae("onSetup",function(){return $}),Gn("onAction")].concat(Rh)),jh=function(t,o,n){var r=ms(t.element,"."+n);if(0<r.length){var e=j(r,function(t){var n=t.dom.getBoundingClientRect().top,e=r[0].dom.getBoundingClientRect().top;return Math.abs(n-e)>o}).getOr(r.length);return st.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return st.none()},Uh=function(t,n){return ic([dg(t,n)])},Wh=function(t){return Uh(Kr("unnamed-events"),t)},Gh=[Ln("lazySink"),Ln("tooltipDom"),ne("exclusive",!0),ne("tooltipComponents",[]),ne("delay",300),ie("mode","normal",["normal","follow-highlight"]),ne("anchor",function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:at([Ua,ja,Ha,Na,za,La]),onRtl:at([Ua,ja,Ha,Na,za,La])}}}),ga("onHide"),ga("onShow")],Xh=/* */Object.freeze({__proto__:null,init:function(){var e=fe(st.none()),n=fe(st.none()),o=function(){e.get().each(function(t){clearTimeout(t)})},t=at("not-implemented");return di({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(setTimeout(function(){t()},n)))},readState:t})}}),Yh=Kr("tooltip.exclusive"),qh=Kr("tooltip.show"),Kh=Kr("tooltip.hide"),Jh=function(t,n,e){t.getSystem().broadcastOn([Yh],{})},$h=/* */Object.freeze({__proto__:null,hideAllExclusive:Jh,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&fg.set(t,o)})}}),Qh=ac({fields:Gh,name:"tooltipping",active:/* */Object.freeze({__proto__:null,events:function(r,i){var e=function(n){i.getTooltip().each(function(t){ul(t),r.onHide(n,t),i.clearTooltip()}),i.clearTimer()};return Zo(dt([[er(qh,function(o){i.resetTimer(function(){var n,t,e;n=o,i.isShowing()||(Jh(n),t=r.lazySink(n).getOrDie(),e=n.getSystem().build({dom:r.tooltipDom,components:r.tooltipComponents,events:Zo("normal"===r.mode?[er(so(),function(t){Yo(n,qh)}),er(ao(),function(t){Yo(n,Kh)})]:[]),behaviours:ic([fg.config({})])}),i.setTooltip(e),ol(t,e),r.onShow(n,e),Qs.position(t,r.anchor(n),e))},r.delay)}),er(Kh,function(t){i.resetTimer(function(){e(t)},r.delay)}),er(Oo(),function(t,n){n.universal||M(n.channels,Yh)&&e(t)}),lr(function(t){e(t)})],"normal"===r.mode?[er(lo(),function(t){Yo(t,qh)}),er(ko(),function(t){Yo(t,Kh)}),er(so(),function(t){Yo(t,qh)}),er(ao(),function(t){Yo(t,Kh)})]:[er(Go(),function(t,n){Yo(t,qh)}),er(Xo(),function(t){Yo(t,Kh)})]]))}}),state:Xh,apis:$h}),Zh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),tv=tinymce.util.Tools.resolve("tinymce.util.I18n"),nv=["input","button","textarea","select"],ev=function(t,n,e){(n.disabled()?cv:sv)(t,n)},ov=function(t,n){return!0===n.useNative&&M(nv,mr(t.element))},rv=function(t){zr(t.element,"disabled","disabled")},iv=function(t){Ur(t.element,"disabled")},uv=function(t){zr(t.element,"aria-disabled","true")},av=function(t){zr(t.element,"aria-disabled","false")},cv=function(n,t,e){t.disableClass.each(function(t){Ei(n.element,t)}),(ov(n,t)?rv:uv)(n),t.onDisabled(n)},sv=function(n,t,e){t.disableClass.each(function(t){Bi(n.element,t)}),(ov(n,t)?iv:av)(n),t.onEnabled(n)},lv=function(t,n){return ov(t,n)?jr(t.element,"disabled"):"true"===Nr(t.element,"aria-disabled")},fv=/* */Object.freeze({__proto__:null,enable:sv,disable:cv,isDisabled:lv,onLoad:ev,set:function(t,n,e,o){(o?cv:sv)(t,n)}}),dv=/* */Object.freeze({__proto__:null,exhibit:function(t,n){return gi({classes:n.disabled()?n.disableClass.toArray():[]})},events:function(e,t){return Zo([tr(_o(),function(t,n){return lv(t,e)}),tc(e,t,ev)])}}),mv=[ae("disabled",c),ne("useNative",!0),Kn("disableClass"),ga("onDisabled"),ga("onEnabled")],gv=ac({fields:mv,name:"disabling",active:dv,apis:fv}),pv=tinymce.util.Tools.resolve("tinymce.EditorManager"),hv=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},vv=function(t){return t.getParam("width",Zh.DOM.getStyle(t.getElement(),"width"))},bv=function(t){return st.from(t.getParam("min_width")).filter(lt)},yv=function(t){return st.from(t.getParam("min_height")).filter(lt)},xv=function(t){return st.from(t.getParam("max_width")).filter(lt)},wv=function(t){return st.from(t.getParam("max_height")).filter(lt)},Sv=function(t){return!1!==t.getParam("menubar",!0,"boolean")},kv=function(t){var n=t.getParam("toolbar",!0),e=!0===n,o=k(n),r=p(n)&&0<n.length;return!Ov(t)&&(r||o||e)},Cv=function(n){var t=I(9,function(t){return n.getParam("toolbar"+(t+1),!1,"string")}),e=H(t,function(t){return"string"==typeof t});return 0<e.length?st.some(e):st.none()},Ov=function(t){return Cv(t).fold(function(){return 0<t.getParam("toolbar",[],"string[]").length},function(){return!0})};(ih=rh=rh||{})["default"]="wrap",ih.floating="floating",ih.sliding="sliding",ih.scrolling="scrolling";var _v,Tv,Ev=function(t){return t.getParam("toolbar_mode","","string")};(Tv=_v=_v||{}).auto="auto",Tv.top="top",Tv.bottom="bottom";var Dv,Bv=function(t){return t.getParam("toolbar_location",_v.auto,"string")},Av=function(t){return Bv(t)===_v.bottom},Mv=function(t){var n=t.getParam("fixed_toolbar_container","","string");return 0<n.length&&t.inline?Ku(Wi(),n):st.none()},Fv=function(t){return t.inline&&Mv(t).isSome()},Iv=function(t){return Mv(t).getOrThunk(function(){return zi(Hi(me.fromDom(t.getElement())))})},Rv=function(t){return t.inline&&!Sv(t)&&!kv(t)&&!Ov(t)},Vv=function(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!Fv(t)&&!Rv(t)},Pv="silver.readonly",Hv=fn([jn("readonly",Vn)]),zv=function(t,n){var e=t.outerContainer.element;n&&(t.mothership.broadcastOn([wl()],{target:e}),t.uiMothership.broadcastOn([wl()],{target:e})),t.mothership.broadcastOn([Pv],{readonly:n}),t.uiMothership.broadcastOn([Pv],{readonly:n})},Nv=function(t,n){t.on("init",function(){t.mode.isReadOnly()&&zv(n,!0)}),t.on("SwitchMode",function(){return zv(n,t.mode.isReadOnly())}),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly")},Lv=function(){var t;return fc.config({channels:((t={})[Pv]={schema:Hv,onReceive:function(t,n){gv.set(t,n.readonly)}},t)})},jv=function(t){return gv.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},Uv=function(t){return gv.config({disabled:t})},Wv=function(t){return gv.config({disabled:t,disableClass:"tox-tbtn--disabled"})},Gv=function(t){return gv.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Xv=function(t,n){var e=t.getApi(n);return function(t){t(e)}},Yv=function(e,o){return sr(function(t){Xv(e,t)(function(t){var n=e.onSetup(t);null!==n&&n!==undefined&&o.set(n)})})},qv=function(n,e){return lr(function(t){return Xv(n,t)(e.get())})},Kv=((Dv={})[_o()]=["disabling","alloy.base.behaviour","toggling","item-events"],Dv),Jv=function(t){return U(t,function(t){return t.toArray()})},$v=function(t,n,e,o){var r,i,u=fe($);return{type:"item",dom:n.dom,components:Jv(n.optComponents),data:t.data,eventOrder:Kv,hasSubmenu:t.triggersSubmenu,itemBehaviours:ic([dg("item-events",[(r=t,i=e,dr(function(t,n){Xv(r,t)(r.onAction),r.triggersSubmenu||i!==uh.CLOSE_ON_EXECUTE||(Yo(t,Bo()),n.stop())})),Yv(t,u),qv(t,u)]),jv(function(){return t.disabled||o.isDisabled()}),Lv(),fg.config({})].concat(t.itemBehaviours))}},Qv=function(t){return{value:t.value,meta:ut({text:t.text.getOr("")},t.meta)}},Zv=tinymce.util.Tools.resolve("tinymce.Env"),tb=function(t){return{dom:{tag:"div",classes:["tox-collection__item-icon"],innerHtml:t}}},nb=function(t){return{dom:{tag:"div",classes:[dh]},components:[fu(tv.translate(t))]}},eb=function(t,n){return{dom:{tag:"div",classes:n,innerHtml:t}}},ob=function(t,n){return{dom:{tag:"div",classes:[dh]},components:[{dom:{tag:t.tag,styles:t.styles},components:[fu(tv.translate(n))]}]}},rb=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:(n=t,e=Zv.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 It(e,n)?e[n]:t}),Zv.mac?r.join(""):r.join("+"))}};var n,e,o,r},ib=function(t){return{dom:{tag:"div",classes:["tox-collection__item-checkmark"],innerHtml:hp("checkmark",t)}}},ub=function(t,n){var e=n.map(function(t){return{attributes:{title:tv.translate(t)}}}).getOr({});return ut({tag:"div",classes:[ah,ch].concat(t?["tox-collection__item-icon-rtl"]:[])},e)},ab=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],cb=["list-bull-circle","list-bull-default","list-bull-square"],sb=function(t,r,n,i){void 0===i&&(i=st.none());var e,o,u,a,c,s,l,f,d,m,g,p,h=tv.isRtl()&&t.iconContent.exists(function(t){return M(cb,t)}),v=t.iconContent.map(function(t){return tv.isRtl()&&M(ab,t)?t+"-rtl":t}).map(function(t){return n=t,e=r.icons,o=i,st.from(e()[n.toLowerCase()]).or(o).getOrThunk(function(){return pp(e)});var n,e,o}),b=st.from(t.meta).fold(function(){return nb},function(t){return It(t,"style")?y(ob,t.style):nb});return"color"===t.presets?(f=t.ariaLabel,d=t.value,m=r,{dom:(g=v.getOr(""),p={tag:"div",attributes:f.map(function(t){return{title:m.translate(t)}}).getOr({}),classes:["tox-swatch"]},ut(ut({},p),"custom"===d?{tag:"button",classes:S(p.classes,["tox-swatches__picker-btn"]),innerHtml:g}:"remove"===d?{classes:S(p.classes,["tox-swatch--remove"]),innerHtml:g}:{attributes:ut(ut({},p.attributes),{"data-mce-color":d}),styles:{"background-color":d}})),optComponents:[]}):(e=t,o=v,u=b,a=h,c=n?o.or(st.some("")).map(tb):st.none(),s=e.checkMark,l=e.htmlContent.fold(function(){return e.textContent.map(u)},function(t){return st.some(eb(t,[dh]))}),{dom:ub(a,e.ariaLabel),optComponents:[c,l,e.shortcutContent.map(rb),s,e.caret]})},lb=function(t,n){return Ft(t,"tooltipWorker").map(function(e){return[Qh.config({lazySink:n.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:Fc}}},mode:"follow-highlight",onShow:function(n,t){e(function(t){Qh.setComponents(n,[du({element:me.fromDom(t)})])})}})]}).getOr([])},fb=function(t,n){var e,o=tv.translate(t),r=(e=o,Zh.DOM.encode(e));if(0<n.length){var i=new RegExp(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");return r.replace(i,function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"})}return r},db=Cf(Ng(),Lg()),mb=function(t){return{value:t}},gb=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,pb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,hb=function(t){return gb.test(t)||pb.test(t)},vb=function(t){var n={value:t.value.replace(gb,function(t,n,e,o){return n+n+e+e+o+o})},e=pb.exec(n.value);return null===e?["FFFFFF","FF","FF","FF"]:e},bb=function(t){var n=t.toString(16);return 1===n.length?"0"+n:n},yb=function(t){var n=bb(t.red)+bb(t.green)+bb(t.blue);return mb(n)},xb=Math.min,wb=Math.max,Sb=Math.round,kb=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Cb=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Ob=function(t,n,e,o){return{red:t,green:n,blue:e,alpha:o}},_b=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},Tb=function(t){var n,e,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100,i=wb(0,xb(i,1)),u=wb(0,xb(u,1));if(0===i)return n=e=o=Sb(255*u),Ob(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=Sb(255*(n+l)),e=Sb(255*(e+l)),o=Sb(255*(o+l)),Ob(n,e,o,1)},Eb=function(t){var n=vb(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return Ob(e,o,r,1)},Db=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return Ob(r,i,u,a)},Bb=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},Ab=Ob(255,0,0,1),Mb=function(t,n){return t.fire("ResizeContent",n)},Fb=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Ib="tinymce-custom-colors";var Rb="choiceitem",Vb=[{type:Rb,text:"Light Green",value:"#BFEDD2"},{type:Rb,text:"Light Yellow",value:"#FBEEB8"},{type:Rb,text:"Light Red",value:"#F8CAC6"},{type:Rb,text:"Light Purple",value:"#ECCAFA"},{type:Rb,text:"Light Blue",value:"#C2E0F4"},{type:Rb,text:"Green",value:"#2DC26B"},{type:Rb,text:"Yellow",value:"#F1C40F"},{type:Rb,text:"Red",value:"#E03E2D"},{type:Rb,text:"Purple",value:"#B96AD9"},{type:Rb,text:"Blue",value:"#3598DB"},{type:Rb,text:"Dark Turquoise",value:"#169179"},{type:Rb,text:"Orange",value:"#E67E23"},{type:Rb,text:"Dark Red",value:"#BA372A"},{type:Rb,text:"Dark Purple",value:"#843FA1"},{type:Rb,text:"Dark Blue",value:"#236FA1"},{type:Rb,text:"Light Gray",value:"#ECF0F1"},{type:Rb,text:"Medium Gray",value:"#CED4D9"},{type:Rb,text:"Gray",value:"#95A5A6"},{type:Rb,text:"Dark Gray",value:"#7E8C8D"},{type:Rb,text:"Navy Blue",value:"#34495E"},{type:Rb,text:"Black",value:"#000000"},{type:Rb,text:"White",value:"#ffffff"}],Pb=function(e){void 0===e&&(e=10);var t,n=Fb.getItem(Ib),o=k(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(),Fb.setItem(Ib,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),Hb=function(t){return!1!==t.getParam("custom_colors")},zb=function(t){var n=t.getParam("color_map");return n!==undefined?function(t){var n=[],u=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=0;e<t.length;e+=2)n.push({text:t[e+1],value: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)}(t[e]),type:"choiceitem"});return n}(n):Vb},Nb=function(t){Pb.add(t)},Lb=function(i){i.addCommand("mceApplyTextcolor",function(t,n){var e,o,r;o=t,r=n,(e=i).undoManager.transact(function(){e.focus(),e.formatter.apply(o,{value:r}),e.nodeChanged()})}),i.addCommand("mceRemoveTextcolor",function(t){var n,e;e=t,(n=i).undoManager.transact(function(){n.focus(),n.formatter.remove(e,{value:null},null,!0),n.nodeChanged()})})},jb=function(t){var n,e,o=zb(t),r=(n=o.length,Math.max(5,Math.ceil(Math.sqrt(n))));return e=r,t.getParam("color_cols",e,"number")},Ub=function(n,e,t,o){"custom"===t?Kb(n)(function(t){t.each(function(t){Nb(t),n.execCommand("mceApplyTextcolor",e,t),o(t)})},"#000000"):"remove"===t?(o(""),n.execCommand("mceRemoveTextcolor",e)):(o(t),n.execCommand("mceApplyTextcolor",e,t))},Wb=function(t,n){return t.concat(V(Pb.state(),function(t){return{type:Rb,text:t,value:t}}).concat((o={type:e="choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"},n?[o,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[o])));var e,o},Gb=function(n,e){return function(t){t(Wb(n,e))}},Xb=function(t,n,e){var o,r;o="forecolor"===n?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",r=e,t.setIconFill(o,r),t.setIconStroke(o,r)},Yb=function(i,e,u,t,o){i.ui.registry.addSplitButton(e,{tooltip:t,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){var t,o,r;return st.from((o=u,(t=i).dom.getParents(t.selection.getStart(),function(t){var n;(n=t.style["forecolor"===o?"color":"background-color"])&&(r=r||n)}),r)).bind(function(t){return function(t){if("transparent"===t)return st.some(Ob(0,0,0,0));var n=kb.exec(t);if(null!==n)return st.some(Db(n[1],n[2],n[3],"1"));var e=Cb.exec(t);return null!==e?st.some(Db(e[1],e[2],e[3],e[4])):st.none()}(t).map(function(t){var n=yb(t).value;return we(e.toLowerCase(),n)})}).getOr(!1)},columns:jb(i),fetch:Gb(zb(i),Hb(i)),onAction:function(t){null!==o.get()&&Ub(i,u,o.get(),function(){})},onItemAction:function(t,n){Ub(i,u,n,function(t){var n;o.set(t),n={name:e,color:t},i.fire("TextColorChange",n)})},onSetup:function(n){null!==o.get()&&Xb(n,e,o.get());var t=function(t){t.name===e&&Xb(n,t.name,t.color)};return i.on("TextColorChange",t),function(){i.off("TextColorChange",t)}}})},qb=function(n,t,e,o){n.ui.registry.addNestedMenuItem(t,{text:o,icon:"forecolor"===t?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(t){Ub(n,e,t.value,$)}}]}})},Kb=function(i){return function(t,n){var e,o={colorpicker:n},r=(e=t,function(t){var n=t.getData();e(st.from(n.colorpicker)),t.close()});i.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(t,n){"hex-valid"===n.name&&(n.value?t.enable("ok"):t.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){t(st.none())}})}},Jb=function(t,n,e,o,r,i,u,a){var c=Oh(n),s=$b(n,e,o,"color"!==r?"normal":"color",i,u,a);return Eh(t,c,s,o,r)},$b=function(e,o,r,i,u,a,c){return Kf(V(e,function(n){return"choiceitem"===n.type?_n("choicemenuitem",Ph,n).fold(_h,function(t){return st.some(function(n,t,e,o,r,i,u,a){void 0===a&&(a=!0);var c=sb({presets:e,textContent:t?n.text:st.none(),htmlContent:st.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:t?n.shortcut:st.none(),checkMark:t?st.some(ib(u.icons)):st.none(),caret:st.none(),value:n.value},u,a);return zt($v({data:Qv(n),disabled:n.disabled,getApi:function(n){return{setActive:function(t){Dg.set(n,t)},isActive:function(){return Dg.isOn(n)},isDisabled:function(){return gv.isDisabled(n)},setDisabled:function(t){return gv.set(n,t)}}},onAction:function(t){return o(n.value)},onSetup:function(t){return t.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:fh,toggleOnExecute:!1,selected:n.active}})}(t,1===r,i,o,a(n.value),u,c,Oh(e)))}):st.none()}))},Qb=function(t,n){var e=yh(n);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+e.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===n?"tox-swatches__row":"tox-collection__group")}};var Zb,ty,ny=Kr("cell-over"),ey=Kr("cell-execute"),oy=function(t,n,e){for(var o=[],r=0;r<n;r++){for(var i=[],u=0;u<e;u++)i.push(function(n,e,t){var o,r=function(t){return qo(t,ey,{row:n,col:e})},i=function(t,n){n.stop(),r(t)};return gu({dom:{tag:"div",attributes:((o={role:"button"})["aria-labelledby"]=t,o)},behaviours:ic([dg("insert-table-picker-cell",[er(so(),vg.focus),er(_o(),r),er(vo(),i),er(Eo(),i)]),Dg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),vg.config({onFocus:function(t){return qo(t,ny,{row:n,col:e})}})])})}(r,u,t));o.push(i)}return o},ry={inserttable:function(o){var t=Kr("size-label"),i=oy(t,10,10),u=gp({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:t}},components:[fu("0x0")],behaviours:ic([fg.config({})])});return{type:"widget",data:{value:Kr("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[db.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:U(i,function(t){return V(t,pu)}).concat(u.asSpec()),behaviours:ic([dg("insert-table-picker",[ur(ny,function(t,n,e){var o=e.event.row,r=e.event.col;!function(t,n,e,o,r){for(var i=0;i<o;i++)for(var u=0;u<r;u++)Dg.set(t[i][u],i<=n&&u<=e)}(i,o,r,10,10),fg.set(u.get(t),[fu(r+1+"x"+(o+1))])}),ur(ey,function(t,n,e){o.onAction({numRows:e.event.row+1,numColumns:e.event.col+1}),Yo(t,Bo())})]),ug.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(n,t){var e=Wb(t.colorinput.getColors(),t.colorinput.hasCustomColors()),o=t.colorinput.getColorCols(),r=Jb(Kr("menu-value"),e,function(t){n.onAction({value:t})},o,"color",uh.CLOSE_ON_EXECUTE,function(){return!1},t.shared.providers),i=ut(ut({},r),{markers:yh("color"),movement:Qb(o,"color")});return{type:"widget",data:{value:Kr("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[db.widget(Yg.sketch(i))]}}},iy=function(t,s){return V(t,function(t){switch(t.type){case"cardcontainer":return u=iy((i=t).items,s),a="vertical"===i.direction?"tox-collection__item-container--column":hh,c="left"===i.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right",{dom:{tag:"div",classes:[ph,a,c,function(){switch(i.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:u};case"cardimage":return e=t.src,o=t.classes,r=t.alt,{dom:{tag:"img",classes:o,attributes:{src:e,alt:r.getOr("")}}};case"cardtext":var n=t.name.exists(function(t){return M(s.cardText.highlightOn,t)})?st.from(s.cardText.matchText).getOr(""):"";return eb(fb(t.text,n),t.classes)}var e,o,r,i,u,a,c})},uy=function(n,e,t,o,r,i,u,a){void 0===a&&(a=!0);var c=sb({presets:o,textContent:st.none(),htmlContent:t?n.text.map(function(t){return fb(t,e)}):st.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:st.none(),checkMark:st.none(),caret:st.none(),value:n.value},u.providers,a,n.icon);return $v({data:Qv(n),disabled:n.disabled,getApi:function(){return{}},onAction:function(t){return r(n.value,n.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:lb(n.meta,u)},c,i,u.providers)},ay=function(t){var n=t.text.fold(function(){return{}},function(t){return{innerHtml:t}});return{type:"separator",dom:ut({tag:"div",classes:[ch,"tox-collection__group-heading"]},n),components:[]}},cy=function(t,n,e,o){void 0===o&&(o=!0);var r=sb({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:st.none(),ariaLabel:t.text,caret:st.none(),checkMark:st.none(),shortcutContent:t.shortcut},e,o);return $v({data:Qv(t),getApi:function(n){return{isDisabled:function(){return gv.isDisabled(n)},setDisabled:function(t){return gv.set(n,t)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e)},sy=function(t,n,e,o,r){void 0===o&&(o=!0),void 0===r&&(r=!1);var i,u,a=r?(u=e.icons,{dom:{tag:"div",classes:[mh],innerHtml:hp("chevron-down",u)}}):(i=e.icons,{dom:{tag:"div",classes:[mh],innerHtml:hp("chevron-right",i)}}),c=sb({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:st.none(),ariaLabel:t.text,caret:st.some(a),checkMark:st.none(),shortcutContent:t.shortcut},e,o);return $v({data:Qv(t),getApi:function(n){return{isDisabled:function(){return gv.isDisabled(n)},setDisabled:function(t){return gv.set(n,t)}}},disabled:t.disabled,onAction:$,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},c,n,e)},ly=function(t,n,e,o){void 0===o&&(o=!0);var r=sb({iconContent:t.icon,textContent:t.text,htmlContent:st.none(),ariaLabel:t.text,checkMark:st.some(ib(e.icons)),caret:st.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},e,o);return zt($v({data:Qv(t),disabled:t.disabled,getApi:function(n){return{setActive:function(t){Dg.set(n,t)},isActive:function(){return Dg.isOn(n)},isDisabled:function(){return gv.isDisabled(n)},setDisabled:function(t){return gv.set(n,t)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e),{toggling:{toggleClass:fh,toggleOnExecute:!1,selected:t.active}})},fy=function(n,e){return t=ry,o=n.fancytype,(Object.prototype.hasOwnProperty.call(t,o)?st.some(t[o]):st.none()).map(function(t){return t(n,e)});var t,o},dy=function(t,n,e,o){var r={dom:ub(!1,t.label),optComponents:[st.some({dom:{tag:"div",classes:[ph,hh]},components:iy(t.items,o)})]};return $v({data:Qv(ut({text:st.none()},t)),disabled:t.disabled,getApi:function(e){return{isDisabled:function(){return gv.isDisabled(e)},setDisabled:function(n){gv.set(e,n),ft(ms(e.element,"*"),function(t){e.getSystem().getByDom(t).each(function(t){t.hasConfigured(gv)&&gv.set(t,n)})})}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:st.from(o.itemBehaviours).getOr([])},r,n,e.providers)};(ty=Zb=Zb||{})[ty.ContentFocus=0]="ContentFocus",ty[ty.UiFocus=1]="UiFocus";var my=function(t,n,e,o,r){var i=e.shared.providers,u=function(t){return r?ut(ut({},t),{shortcut:st.none(),icon:t.text.isSome()?st.none():t.icon}):t};switch(t.type){case"menuitem":return _n("menuitem",zh,t).fold(_h,function(t){return st.some(cy(u(t),n,i,o))});case"nestedmenuitem":return _n("nestedmenuitem",Nh,t).fold(_h,function(t){return st.some(sy(u(t),n,i,o,r))});case"togglemenuitem":return _n("togglemenuitem",Lh,t).fold(_h,function(t){return st.some(ly(u(t),n,i,o))});case"separator":return _n("separatormenuitem",Np,t).fold(_h,function(t){return st.some(ay(t))});case"fancymenuitem":return _n("fancymenuitem",Hh,t).fold(_h,function(t){return fy(u(t),e)});default:return console.error("Unknown item in general menu",t),st.none()}},gy=function(t,e,o,n,r,i,u){var a=1===n,c=!a||Oh(t);return Kf(V(t,function(t){switch(t.type){case"separator":return _n("Autocompleter.Separator",Np,t).fold(_h,function(t){return st.some(ay(t))});case"cardmenuitem":return _n("cardmenuitem",Vh,t).fold(_h,function(n){return st.some(dy(ut(ut({},n),{onAction:function(t){n.onAction(t),o(n.value,n.meta)}}),r,i,{itemBehaviours:lb(n.meta,i),cardText:{matchText:e,highlightOn:u}}))});case"autocompleteitem":default:return _n("Autocompleter.Item",Lp,t).fold(_h,function(t){return st.some(uy(t,e,a,"normal",o,r,i,c))})}}))},py=function(t,n,e,o,r){var i=Oh(n),u=Kf(V(n,function(t){var n=function(t){return my(t,e,o,(n=t,r?!n.hasOwnProperty("text"):i),r);var n};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?n(ut(ut({},t),{disabled:!0})):n(t)}));return(r?Th:Eh)(t,i,u,1,"normal")},hy=function(t){return Zg.singleData(t.value,t)},vy=function(d,c){var e=fe(st.none()),s=fe(!1),m=gu(tp.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:ic([dg("dismissAutocompleter",[er(zo(),function(){return f()})])]),lazySink:c.getSink})),o=function(){return e.get().isSome()},l=function(){o()&&tp.hide(m)},f=function(){var t;o()&&(t=e.get().map(function(t){return t.element}),_p(t.getOr(me.fromDom(d.selection.getNode()))).each(Rr),l(),e.set(st.none()),s.set(!1))},r=Lt(function(){return oh(d)}),g=function(t,n,e,o){t.matchLength=n.text.length;var r,i,u,a,c,s,l,f=Z(e,function(t){return st.from(t.columns)}).getOr(1);tp.showAt(m,{anchor:"node",root:me.fromDom(d.getBody()),node:st.from(t.element)},Yg.sketch((r=Eh("autocompleter-value",!0,o,f,"normal"),i=f,u=Zb.ContentFocus,a="normal",c=(u===Zb.ContentFocus?Fd:Md)(),s=Qb(i,a),l=yh(a),{dom:r.dom,components:r.components,items:r.items,value:r.value,markers:{selectedItem:l.selectedItem,item:l.item},movement:s,fakeFocus:u===Zb.ContentFocus,focusManager:c,menuBehaviours:Wh("auto"!==i?[]:[sr(function(o,t){jh(o,4,l.item).each(function(t){var n=t.numColumns,e=t.numRows;ug.setGridSize(o,e,n)})})])}))),tp.getContent(m).each(fd.highlightFirst)},p=function(t){var n;n=t,e.get().map(function(t){return Ap(d.dom,d.selection.getRng(),t.triggerChar).bind(function(t){return zp(d,r,t,n)})}).getOrThunk(function(){return Hp(d,r)}).fold(f,function(a){var t,n;t=a.context,o()||(n=Op(d,t.range),e.set(st.some({triggerChar:t.triggerChar,element:n,matchLength:t.text.length})),s.set(!1)),a.lookupData.then(function(u){e.get().map(function(t){var n,e,o,r,i=a.context;t.triggerChar===i.triggerChar&&(e=i.triggerChar,r=Z(o=u,function(t){return st.from(t.columns)}).getOr(1),0<(n=U(o,function(i){var t=i.items;return gy(t,i.matchText,function(o,r){var t=d.selection.getRng();Ap(d.dom,t,e).fold(function(){return console.error("Lost context. Cursor probably moved")},function(t){var n=t.range,e={hide:function(){f()},reload:function(t){l(),p(t)}};s.set(!0),i.onAction(e,n,o,r),s.set(!1)})},r,uh.BUBBLE_TO_SANDBOX,c,i.highlightOn)})).length?g(t,i,u,n):(10<=i.text.length-t.matchLength?f:l)())})})})},t={onKeypress:Sp(function(t){27!==t.which&&p()},50),cancelIfNecessary:f,isMenuOpen:function(){return tp.isOpen(m)},isActive:o,isProcessingAction:s.get,getView:function(){return tp.getContent(m)}};!1===d.hasPlugin("rtc")&&Mp(t,d)},by=b,yy=function(t,n,e){return Du(t,n,by,e,!1)},xy=function(t,n,e){return Du(t,n,by,e,!0)},wy=Eu,Sy=function(t,n,e){return Ju(t,n,e).isSome()};function ky(e,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r=setTimeout(function(){e.apply(null,t),r=null},o)}}}var Cy=function(t){var n=t.raw;return n.touches===undefined||1!==n.touches.length?st.none():st.some(n.touches[0])},Oy=function(e){var u=fe(st.none()),o=fe(!1),r=ky(function(t){e.triggerEvent(Do(),t),o.set(!0)},400),i=$t([{key:no(),value:function(e){return Cy(e).each(function(t){r.cancel();var n={x:t.clientX,y:t.clientY,target:e.target};r.schedule(e),o.set(!1),u.set(st.some(n))}),st.none()}},{key:eo(),value:function(t){return r.cancel(),Cy(t).each(function(i){u.get().each(function(t){var n,e,o,r;n=i,e=t,o=Math.abs(n.clientX-e.x),r=Math.abs(n.clientY-e.y),(5<o||5<r)&&u.set(st.none())})}),st.none()}},{key:oo(),value:function(n){r.cancel();return u.get().filter(function(t){return Ge(t.target,n.target)}).map(function(t){return o.get()?(n.prevent(),!1):e.triggerEvent(Eo(),n)})}}]);return{fireIfReady:function(n,t){return Ft(i,t).bind(function(t){return t(n)})}}},_y=function(){return je().browser.isFirefox()},Ty=ln([Gn("triggerEvent"),ne("stopBackspace",!0)]),Ey=function(n,t){var e,o,r,i,u=En("Getting GUI events settings",Ty,t),a=Oy(u),c=V(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(t){return yy(n,t,function(n){a.fireIfReady(n,t).each(function(t){t&&n.kill()}),u.triggerEvent(t,n)&&n.kill()})}),s=fe(st.none()),l=yy(n,"paste",function(n){a.fireIfReady(n,"paste").each(function(t){t&&n.kill()}),u.triggerEvent("paste",n)&&n.kill(),s.set(st.some(setTimeout(function(){u.triggerEvent(Co(),n)},0)))}),f=yy(n,"keydown",function(t){var n;u.triggerEvent("keydown",t)?t.kill():!0!==u.stopBackspace||((n=t).raw.which!==dd[0]||M(["input","textarea"],mr(n.target))||Sy(n.target,'[contenteditable="true"]'))||t.prevent()}),d=(e=n,o=function(t){u.triggerEvent("focusin",t)&&t.kill()},_y()?xy(e,"focus",o):yy(e,"focusin",o)),m=fe(st.none()),g=(r=n,i=function(t){u.triggerEvent("focusout",t)&&t.kill(),m.set(st.some(setTimeout(function(){u.triggerEvent(ko(),t)},0)))},_y()?xy(r,"blur",i):yy(r,"focusout",i));return{unbind:function(){ft(c,function(t){t.unbind()}),f.unbind(),d.unbind(),g.unbind(),l.unbind(),s.get().each(clearTimeout),m.get().each(clearTimeout)}}},Dy=function(t,n){var e=Ft(t,"target").getOr(n);return fe(e)},By=Vt([{stopped:[]},{resume:["element"]},{complete:[]}]),Ay=function(t,o,n,e,r,i){var u,a,c,s,l=t(o,e),f=(u=n,a=r,c=fe(!1),s=fe(!1),{stop:function(){c.set(!0)},cut:function(){s.set(!0)},isStopped:c.get,isCut:s.get,event:u,setSource:a.set,getSource:a.get});return l.fold(function(){return i.logEventNoHandlers(o,e),By.complete()},function(n){var e=n.descHandler;return hi(e)(f),f.isStopped()?(i.logEventStopped(o,n.element,e.purpose),By.stopped()):f.isCut()?(i.logEventCut(o,n.element,e.purpose),By.complete()):kr(n.element).fold(function(){return i.logNoParent(o,n.element,e.purpose),By.complete()},function(t){return i.logEventResponse(o,n.element,e.purpose),By.resume(t)})})},My=function(n,e,o,t,r,i){return Ay(n,e,o,t,r,i).fold(function(){return!0},function(t){return My(n,e,o,t,r,i)},function(){return!1})},Fy=function(t,n,e){var o,r,i=(o=n,r=fe(!1),{stop:function(){r.set(!0)},cut:$,isStopped:r.get,isCut:c,event:o,setSource:u("Cannot set source of a broadcasted event"),getSource:u("Cannot get source of a broadcasted event")});return ft(t,function(t){var n=t.descHandler;hi(n)(i)}),i.isStopped()},Iy=function(t,n,e,o,r){var i=Dy(e,o);return My(t,n,e,o,i,r)},Ry=function(t,n){return{element:t,descHandler:n}},Vy=function(t,n){return{id:t,descHandler:n}};function Py(){var i={};return{registerId:function(o,r,t){_t(t,function(t,n){var e=i[n]!==undefined?i[n]:{};e[r]=pi(t,o),i[n]=e})},unregisterId:function(e){_t(i,function(t,n){t.hasOwnProperty(e)&&delete t[e]})},filterByType:function(t){return Ft(i,t).map(function(t){return Bt(t,function(t,n){return Vy(n,t)})}).getOr([])},find:function(t,n,e){var r=Ft(i,n);return Je(e,function(t){return e=r,ni(o=t).fold(function(){return st.none()},function(n){return e.bind(function(t){return Ft(t,n)}).map(function(t){return Ry(o,t)})});var e,o},t)}}}function Hy(){var o=Py(),r={},i=function(o){var t=o.element;return ni(t).fold(function(){return t="uid-",n=o.element,e=Kr(Qr+t),ti(n,e),e;var t,n,e},function(t){return t})},u=function(t){ni(t.element).each(function(t){delete r[t],o.unregisterId(t)})};return{find:function(t,n,e){return o.find(t,n,e)},filter:function(t){return o.filterByType(t)},register:function(t){var n=i(t);Rt(r,n)&&function(t,n){var e=r[n];if(e!==t)throw new Error('The tagId "'+n+'" is already used by: '+Gr(e.element)+"\nCannot use it for: "+Gr(t.element)+"\nThe conflicting element is"+(Ui(e.element)?" ":" not ")+"already in the DOM");u(t)}(t,n);var e=[t];o.registerId(e,n,t.events),r[n]=t},unregister:u,getById:function(t){return Ft(r,t)}}}var zy,Ny,Ly,jy,Uy=Yf({name:"Container",factory:function(t){var n=t.dom,e=n.attributes,o=w(n,["attributes"]);return{uid:t.uid,dom:ut({tag:"div",attributes:ut({role:"presentation"},e)},o),components:t.components,behaviours:jl(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[ne("components",[]),Ll("containerBehaviours",[]),ne("events",{}),ne("domModification",{}),ne("eventOrder",{})]}),Wy=function(e){var o=function(n){return kr(e.element).fold(function(){return!0},function(t){return Ge(n,t)})},r=Hy(),s=function(t,n){return r.find(o,t,n)},t=Ey(e.element,{triggerEvent:function(o,r){return ia(o,r.target,function(t){return e=t,Iy(s,o,n=r,n.target,e);var n,e})}}),i={debugInfo:at("real"),triggerEvent:function(n,e,o){ia(n,e,function(t){return Iy(s,n,o,e,t)})},triggerFocus:function(a,c){ni(a).fold(function(){mc(a)},function(t){ia(So(),a,function(t){var n,e,o,r,i,u;return n=s,e=So(),i=t,u=Dy(o={originator:c,kill:$,prevent:$,target:a},r=a),Ay(n,e,o,r,u,i),!1})})},triggerEscape:function(t,n){i.triggerEvent("keydown",t.element,n.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:gu,addToGui:function(t){a(t)},removeFromGui:function(t){c(t)},addToWorld:function(t){n(t)},removeFromWorld:function(t){u(t)},broadcast:function(t){f(t)},broadcastOn:function(t,n){d(t,n)},broadcastEvent:function(t,n){m(t,n)},isConnected:b},n=function(t){t.connect(i),hr(t.element)||(r.register(t),ft(t.components(),n),i.triggerEvent(Mo(),t.element,{target:t.element}))},u=function(t){hr(t.element)||(ft(t.components(),u),r.unregister(t)),t.disconnect()},a=function(t){ol(e,t)},c=function(t){ul(t)},l=function(e){var t=r.filter(Oo());ft(t,function(t){var n=t.descHandler;hi(n)(e)})},f=function(t){l({universal:!0,data:t})},d=function(t,n){l({universal:!1,channels:t,data:n})},m=function(t,n){var e=r.filter(t);return Fy(e,n)},g=function(t){return r.getById(t).fold(function(){return mt.error(new Error('Could not find component with uid: "'+t+'" in system.'))},mt.value)},p=function(t){var n=ni(t).getOr("not found");return g(n)};return n(e),{root:e,element:e.element,destroy:function(){t.unbind(),Ir(e.element)},add:a,remove:c,getByUid:g,getByDom:p,addToWorld:n,removeFromWorld:u,broadcast:f,broadcastOn:d,broadcastEvent:m}},Gy=at([ne("prefix","form-field"),Ll("fieldBehaviours",[td,Nl])]),Xy=at([yf({schema:[Ln("dom")],name:"label"}),yf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ln("text")],name:"aria-descriptor"}),vf({factory:{sketch:function(t){var n=Kt(t,["factory"]);return t.factory.sketch(n)}},schema:[Ln("factory")],name:"field"})]),Yy=qf({name:"FormField",configFields:Gy(),partFields:Xy(),factory:function(r,t,n,e){var o=Ul(r.fieldBehaviours,[td.config({find:function(t){return Af(t,r,"field")}}),Nl.config({store:{mode:"manual",getValue:function(t){return td.getCurrent(t).bind(Nl.getValue)},setValue:function(t,n){td.getCurrent(t).each(function(t){Nl.setValue(t,n)})}}})]),i=Zo([sr(function(t,n){var o=Ff(t,r,["label","field","aria-descriptor"]);o.field().each(function(e){var n=Kr(r.prefix);o.label().each(function(t){zr(t.element,"for",n),zr(e.element,"id",n)}),o["aria-descriptor"]().each(function(t){var n=Kr(r.prefix);zr(t.element,"id",n),zr(e.element,"aria-describedby",n)})})})]),u={getField:function(t){return Af(t,r,"field")},getLabel:function(t){return Af(t,r,"label")}};return{uid:r.uid,dom:r.dom,components:t,behaviours:o,events:i,apis:u}},apis:{getField:function(t,n){return t.getField(n)},getLabel:function(t,n){return t.getLabel(n)}}}),qy=/* */Object.freeze({__proto__:null,exhibit:function(t,n){return gi({attributes:$t([{key:n.tabAttr,value:"true"}])})}}),Ky=[ne("tabAttr","data-alloy-tabstop")],Jy=ac({fields:Ky,name:"tabstopping",active:qy}),$y=tinymce.util.Tools.resolve("tinymce.html.Entities"),Qy=function(t,n,e,o){var r=Zy(t,n,e,o);return Yy.sketch(r)},Zy=function(t,n,e,o){return{dom:tx(e),components:t.toArray().concat([n]),fieldBehaviours:ic(o)}},tx=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},nx=function(t,n){return Yy.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}})},ex=Kr("form-component-change"),ox=Kr("form-close"),rx=Kr("form-cancel"),ix=Kr("form-action"),ux=Kr("form-submit"),ax=Kr("form-block"),cx=Kr("form-unblock"),sx=Kr("form-tabchange"),lx=Kr("form-resize"),fx=function(u,a){var t,n,e,o=u.label.map(function(t){return nx(t,a)}),r=function(o){return function(n,e){Ju(e.event.target,"[data-collection-item-value]").each(function(t){o(n,e,t,Nr(t,"data-collection-item-value"))})}},i=r(function(t,n,e,o){n.stop(),a.isDisabled()||qo(t,ix,{name:u.name,value:o})}),c=[er(so(),r(function(t,n,e){mc(e)})),er(vo(),i),er(Eo(),i),er(lo(),r(function(t,n,e){Ku(t.element,"."+gh).each(function(t){Bi(t,gh)}),Ei(e,gh)})),er(fo(),r(function(t){Ku(t.element,"."+gh).each(function(t){Bi(t,gh)})})),dr(r(function(t,n,e,o){qo(t,ix,{name:u.name,value:o})}))],s=function(t,n){return V(ms(t.element,".tox-collection__item"),n)},l=Yy.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==u.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:ct},behaviours:ic([gv.config({disabled:a.isDisabled,onDisabled:function(t){s(t,function(t){Ei(t,"tox-collection__item--state-disabled"),zr(t,"aria-disabled",!0)})},onEnabled:function(t){s(t,function(t){Bi(t,"tox-collection__item--state-disabled"),Ur(t,"aria-disabled")})}}),Lv(),fg.config({}),Nl.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){var n,e,r,i;n=o,e=V(t,function(t){var n=tv.translate(t.text),e=1===u.columns?'<div class="tox-collection__item-label">'+n+"</div>":"",o='<div class="tox-collection__item-icon">'+t.icon+"</div>",r={_:" "," - ":" ","-":" "},i=n.replace(/\_| \- |\-/g,function(t){return r[t]});return'<div class="tox-collection__item'+(a.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+$y.encodeAllRaw(t.value)+'" title="'+i+'" aria-label="'+i+'">'+o+e+"</div>"}),r="auto"!==u.columns&&1<u.columns?R(e,u.columns):[e],i=V(r,function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}),Pr(n.element,i.join("")),"auto"===u.columns&&jh(o,5,"tox-collection__item").each(function(t){var n=t.numRows,e=t.numColumns;ug.setGridSize(o,n,e)}),Yo(o,lx)}}),Jy.config({}),ug.config((n=u.columns,e="normal",1===n?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===n?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===e?".tox-swatches__row":".tox-collection__group",cell:"color"===e?"."+sh:"."+ch}})),dg("collection-events",c)]),eventOrder:((t={})[_o()]=["disabling","alloy.base.behaviour","collection-events"],t)});return Qy(o,l,["tox-form__group--collection"],[])},dx=at([Kn("data"),ne("inputAttributes",{}),ne("inputStyles",{}),ne("tag","input"),ne("inputClasses",[]),ga("onSetValue"),ne("styles",{}),ne("eventOrder",{}),Ll("inputBehaviours",[Nl,vg]),ne("selectOnFocus",!0)]),mx=function(t){return ic([vg.config({onFocus:t.selectOnFocus?function(t){var n=t.element,e=ou(n);n.dom.setSelectionRange(0,e.length)}:$})])},gx=function(t){return{tag:t.tag,attributes:ut({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},px=Yf({name:"Input",configFields:dx(),factory:function(t,n){return{uid:t.uid,dom:gx(t),components:[],behaviours:ut(ut({},mx(e=t)),Ul(e.inputBehaviours,[Nl.config({store:ut(ut({mode:"manual"},e.data.map(function(t){return{initialValue:t}}).getOr({})),{getValue:function(t){return ou(t.element)},setValue:function(t,n){ou(t.element)!==n&&ru(t.element,n)}}),onSetValue:e.onSetValue})])),eventOrder:t.eventOrder};var e}}),hx={},vx={exports:hx};zy=undefined,Ny=hx,Ly=vx,jy=undefined,function(t){"object"==typeof Ny&&void 0!==Ly?Ly.exports=t():"function"==typeof zy&&zy.amd?zy([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function l(i,u,a){function c(n,t){if(!u[n]){if(!i[n]){var e="function"==typeof jy&&jy;if(!t&&e)return e(n,!0);if(s)return s(n,!0);var o=new Error("Cannot find module '"+n+"'");throw o.code="MODULE_NOT_FOUND",o}var r=u[n]={exports:{}};i[n][0].call(r.exports,function(t){return c(i[n][1][t]||t)},r,r.exports,l,i,u,a)}return u[n].exports}for(var s="function"==typeof jy&&jy,t=0;t<a.length;t++)c(a[t]);return c}({1:[function(t,n,e){var o,r,i=n.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(t){if(o===setTimeout)return setTimeout(t,0);if((o===u||!o)&&setTimeout)return o=setTimeout,setTimeout(t,0);try{return o(t,0)}catch(n){try{return o.call(null,t,0)}catch(n){return o.call(this,t,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:u}catch(t){o=u}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var n=l.length;n;){for(s=l,l=[];++d<n;)s&&s[d].run();d=-1,n=l.length}s=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(n){try{return r.call(null,t)}catch(n){return r.call(this,t)}}}(t)}}function p(t,n){this.fun=t,this.array=n}function h(){}i.nextTick=function(t){var n=new Array(arguments.length-1);if(1<arguments.length)for(var e=1;e<arguments.length;e++)n[e-1]=arguments[e];l.push(new p(t,n)),1!==l.length||f||c(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,f,n){(function(n){function o(){}function u(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=0,this._handled=!1,this._value=undefined,this._deferreds=[],l(t,this)}function r(o,r){for(;3===o._state;)o=o._value;0!==o._state?(o._handled=!0,u._immediateFn(function(){var t,n=1===o._state?r.onFulfilled:r.onRejected;if(null!==n){try{t=n(o._value)}catch(e){return void a(r.promise,e)}i(r.promise,t)}else(1===o._state?i:a)(r.promise,o._value)})):o._deferreds.push(r)}function i(t,n){try{if(n===t)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if(n instanceof u)return t._state=3,t._value=n,void c(t);if("function"==typeof e)return void l((o=e,r=n,function(){o.apply(r,arguments)}),t)}t._state=1,t._value=n,c(t)}catch(i){a(t,i)}var o,r}function a(t,n){t._state=2,t._value=n,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&u._immediateFn(function(){t._handled||u._unhandledRejectionFn(t._value)});for(var n=0,e=t._deferreds.length;n<e;n++)r(t,t._deferreds[n]);t._deferreds=null}function s(t,n,e){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof n?n:null,this.promise=e}function l(t,n){var e=!1;try{t(function(t){e||(e=!0,i(n,t))},function(t){e||(e=!0,a(n,t))})}catch(o){if(e)return;e=!0,a(n,o)}}var t,e;t=this,e=setTimeout,u.prototype["catch"]=function(t){return this.then(null,t)},u.prototype.then=function(t,n){var e=new this.constructor(o);return r(this,new s(t,n,e)),e},u.all=function(t){var c=Array.prototype.slice.call(t);return new u(function(r,i){if(0===c.length)return r([]);var u=c.length;for(var t=0;t<c.length;t++)!function a(n,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void e.call(t,function(t){a(n,t)},i)}c[n]=t,0==--u&&r(c)}catch(o){i(o)}}(t,c[t])})},u.resolve=function(n){return n&&"object"==typeof n&&n.constructor===u?n:new u(function(t){t(n)})},u.reject=function(e){return new u(function(t,n){n(e)})},u.race=function(r){return new u(function(t,n){for(var e=0,o=r.length;e<o;e++)r[e].then(t,n)})},u._immediateFn="function"==typeof n?function(t){n(t)}:function(t){e(t,0)},u._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},u._setImmediateFn=function(t){u._immediateFn=t},u._setUnhandledRejectionFn=function(t){u._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=u:t.Promise||(t.Promise=u)}).call(this,t("timers").setImmediate)},{timers:3}],3:[function(c,t,s){(function(t,n){var o=c("process/browser.js").nextTick,e=Function.prototype.apply,r=Array.prototype.slice,i={},u=0;function a(t,n){this._id=t,this._clearFn=n}s.setTimeout=function(){return new a(e.call(setTimeout,window,arguments),clearTimeout)},s.setInterval=function(){return new a(e.call(setInterval,window,arguments),clearInterval)},s.clearTimeout=s.clearInterval=function(t){t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},s.enroll=function(t,n){clearTimeout(t._idleTimeoutId),t._idleTimeout=n},s.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},s._unrefActive=s.active=function(t){clearTimeout(t._idleTimeoutId);var n=t._idleTimeout;0<=n&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},n))},s.setImmediate="function"==typeof t?t:function(t){var n=u++,e=!(arguments.length<2)&&r.call(arguments,1);return i[n]=!0,o(function(){i[n]&&(e?t.apply(null,e):t.call(null),s.clearImmediate(n))}),n},s.clearImmediate="function"==typeof n?n:function(t){delete i[t]}}).call(this,c("timers").setImmediate,c("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,n,e){var o=t("promise-polyfill"),r="undefined"!=typeof window?window:Function("return this;")();n.exports={boltExport:r.Promise||o}},{"promise-polyfill":2}]},{},[4])(4)});var bx,yx,xx=vx.exports.boltExport,wx=function(t){var e=st.none(),n=[],o=function(t){r()?u(t):n.push(t)},r=function(){return e.isSome()},i=function(t){ft(t,u)},u=function(n){e.each(function(t){setTimeout(function(){n(t)},0)})};return t(function(t){r()||(e=st.some(t),i(n),n=[])}),{get:o,map:function(e){return wx(function(n){o(function(t){n(e(t))})})},isReady:r}},Sx={nu:wx,pure:function(n){return wx(function(t){t(n)})}},kx=function(t){setTimeout(function(){throw t},0)},Cx=function(e){var t=function(t){e().then(t,kx)};return{map:function(t){return Cx(function(){return e().then(t)})},bind:function(n){return Cx(function(){return e().then(function(t){return n(t).toPromise()})})},anonBind:function(t){return Cx(function(){return e().then(function(){return t.toPromise()})})},toLazy:function(){return Sx.nu(t)},toCached:function(){var t=null;return Cx(function(){return null===t&&(t=e()),t})},toPromise:e,get:t}},Ox=function(t){return Cx(function(){return new xx(t)})},_x=function(t){return Cx(function(){return xx.resolve(t)})},Tx=["input","textarea"],Ex=function(t){var n=mr(t);return M(Tx,n)},Dx=function(t,n){var e=n.getRoot(t).getOr(t.element);Bi(e,n.invalidClass),n.notify.each(function(n){Ex(t.element)&&zr(t.element,"aria-invalid",!1),n.getContainer(t).each(function(t){Pr(t,n.validHtml)}),n.onValid(t)})},Bx=function(n,t,e,o){var r=t.getRoot(n).getOr(n.element);Ei(r,t.invalidClass),t.notify.each(function(t){Ex(n.element)&&zr(n.element,"aria-invalid",!0),t.getContainer(n).each(function(t){Pr(t,o)}),t.onInvalid(n,o)})},Ax=function(n,t,e){return t.validator.fold(function(){return _x(mt.value(!0))},function(t){return t.validate(n)})},Mx=function(n,e,t){return e.notify.each(function(t){t.onValidate(n)}),Ax(n,e).map(function(t){return n.getSystem().isConnected()?t.fold(function(t){return Bx(n,e,0,t),mt.error(t)},function(t){return Dx(n,e),mt.value(t)}):mt.error("No longer in system")})},Fx=/* */Object.freeze({__proto__:null,markValid:Dx,markInvalid:Bx,query:Ax,run:Mx,isInvalid:function(t,n){var e=n.getRoot(t).getOr(t.element);return Ai(e,n.invalidClass)}}),Ix=/* */Object.freeze({__proto__:null,events:function(n,t){return n.validator.map(function(t){return Zo([er(t.onEvent,function(t){Mx(t,n).get(ct)})].concat(t.validateOnLoad?[sr(function(t){Mx(t,n).get($)})]:[]))}).getOr({})}}),Rx=[Ln("invalidClass"),ne("getRoot",st.none),te("notify",[ne("aria","alert"),ne("getContainer",st.none),ne("validHtml",""),ga("onValid"),ga("onInvalid"),ga("onValidate")]),te("validator",[Ln("validate"),ne("onEvent","input"),ne("validateOnLoad",!0)])],Vx=ac({fields:Rx,name:"invalidating",active:Ix,apis:Fx,extra:{validation:function(e){return function(t){var n=Nl.getValue(t);return _x(e(n))}}}}),Px=/* */Object.freeze({__proto__:null,getCoupled:function(t,n,e,o){return e.getOrCreate(t,n,o)}}),Hx=[jn("others",On(mt.value,Mn()))],zx=ac({fields:Hx,name:"coupling",apis:Px,state:/* */Object.freeze({__proto__:null,init:function(){var i={},t=at({});return di({readState:t,getOrCreate:function(e,o,r){var t=Ct(o.others);if(t)return Ft(i,r).getOrThunk(function(){var t=Ft(o.others,r).getOrDie("No information found for coupled component: "+r)(e),n=e.getSystem().build(t);return i[r]=n});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(t,null,2))}})}})}),Nx=at("sink"),Lx=at(yf({name:Nx(),overrides:at({dom:{tag:"div"},behaviours:ic([Qs.config({useFixed:b})]),events:Zo([ar(mo()),ar(io()),ar(vo())])})}));(yx=bx=bx||{})[yx.HighlightFirst=0]="HighlightFirst",yx[yx.HighlightNone=1]="HighlightNone";var jx=function(t,n){var e=t.getHotspot(n).getOr(n),o=t.getAnchorOverrides();return t.layouts.fold(function(){return{anchor:"hotspot",hotspot:e,overrides:o}},function(t){return{anchor:"hotspot",hotspot:e,overrides:o,layouts:t}})},Ux=function(t,n,e,o,r,i,u){var a,c,s,l,f,d,m,g,p,h,v=jx(t,e);return(c=v,l=o,f=r,d=u,m=n,g=s=e,p=(0,(a=t).fetch)(g).map(m),h=Yx(s,a),p.map(function(t){return t.bind(function(t){return st.from(Zg.sketch(ut(ut({},f.menu()),{uid:ei(""),data:t,highlightImmediately:d===bx.HighlightFirst,onOpenMenu:function(t,n){var e=h().getOrDie();Qs.position(e,c,n),xl.decloak(l)},onOpenSubmenu:function(t,n,e){var o=h().getOrDie();Qs.position(o,{anchor:"submenu",item:n},e),xl.decloak(l)},onRepositionMenu:function(t,n,e){var o=h().getOrDie();Qs.position(o,c,n),ft(e,function(t){Qs.position(o,{anchor:"submenu",item:t.triggeringItem},t.triggeredMenu)})},onEscape:function(){return vg.focus(s),xl.close(l),st.some(!0)}})))})})).map(function(t){return t.fold(function(){xl.isOpen(o)&&xl.close(o)},function(t){xl.cloak(o),xl.open(o,t),i(o)}),o})},Wx=function(t,n,e,o,r,i,u){return xl.close(o),_x(o)},Gx=function(t,n,e,o,r,i){var u=zx.getCoupled(e,"sandbox");return(xl.isOpen(u)?Wx:Ux)(t,n,e,u,o,r,i)},Xx=function(t,n,e){var o,r,i=td.getCurrent(n).getOr(n),u=_u(t.element);e?qi(i.element,"min-width",u+"px"):(o=i.element,r=u,Ou.set(o,r))},Yx=function(n,t){return n.getSystem().getByUid(t.uid+"-"+Nx()).map(function(t){return function(){return mt.value(t)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return mt.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(n)}})})},qx=function(t){xl.getState(t).each(function(t){Zg.repositionMenus(t)})},Kx=function(o,r,i){var u=$u(),t=Yx(r,o);return{dom:{tag:"div",classes:o.sandboxClasses,attributes:{id:u.id,role:"listbox"}},behaviours:Gl(o.sandboxBehaviours,[Nl.config({store:{mode:"memory",initialValue:r}}),xl.config({onOpen:function(t,n){var e=jx(o,r);u.link(r.element),o.matchWidth&&Xx(e.hotspot,n,o.useMinWidth),o.onOpen(e,t,n),i!==undefined&&i.onOpen!==undefined&&i.onOpen(t,n)},onClose:function(t,n){u.unlink(r.element),i!==undefined&&i.onClose!==undefined&&i.onClose(t,n)},isPartOf:function(t,n,e){return Zu(n,e)||Zu(r,e)},getAttachPoint:function(){return t().getOrDie()}}),td.config({find:function(t){return xl.getState(t).bind(function(t){return td.getCurrent(t)})}}),fc.config({channels:ut(ut({},Ol({isExtraPart:c})),Tl({doReposition:qx}))})])}},Jx=function(t){var n=zx.getCoupled(t,"sandbox");qx(n)},$x=function(){return[ne("sandboxClasses",[]),Wl("sandboxBehaviours",[td,fc,xl,Nl])]},Qx=at([Ln("dom"),Ln("fetch"),ga("onOpen"),pa("onExecute"),ne("getHotspot",st.some),ne("getAnchorOverrides",at({})),Wc(),Ll("dropdownBehaviours",[Dg,zx,ug,vg]),Ln("toggleClass"),ne("eventOrder",{}),Kn("lazySink"),ne("matchWidth",!1),ne("useMinWidth",!1),Kn("role")].concat($x())),Zx=at([bf({schema:[fa()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Lx()]),tw=qf({name:"Dropdown",configFields:Qx(),partFields:Zx(),factory:function(n,t,e,o){var r,i,u=function(t){xl.getState(t).each(function(t){Zg.highlightPrimary(t)})},a={expand:function(t){Dg.isOn(t)||Gx(n,function(t){return t},t,o,$,bx.HighlightNone).get($)},open:function(t){Dg.isOn(t)||Gx(n,function(t){return t},t,o,$,bx.HighlightFirst).get($)},isOpen:Dg.isOn,close:function(t){Dg.isOn(t)&&Gx(n,function(t){return t},t,o,$,bx.HighlightFirst).get($)},repositionMenus:function(t){Dg.isOn(t)&&Jx(t)}},c=function(t,n){return Ko(t),st.some(!0)};return{uid:n.uid,dom:n.dom,components:t,behaviours:Ul(n.dropdownBehaviours,[Dg.config({toggleClass:n.toggleClass,aria:{mode:"expanded"}}),zx.config({others:{sandbox:function(t){return Kx(n,t,{onOpen:function(){Dg.on(t)},onClose:function(){Dg.off(t)}})}}}),ug.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,n){var e;return tw.isOpen(t)?(e=zx.getCoupled(t,"sandbox"),u(e)):tw.open(t),st.some(!0)},onEscape:function(t,n){return tw.isOpen(t)?(tw.close(t),st.some(!0)):st.none()}}),vg.config({})]),events:Ag(st.some(function(t){Gx(n,function(t){return t},t,o,u,bx.HighlightFirst).get($)})),eventOrder:ut(ut({},n.eventOrder),((r={})[_o()]=["disabling","toggling","alloy.base.behaviour"],r)),apis:a,domModification:{attributes:ut(ut({"aria-haspopup":"true"},n.role.fold(function(){return{}},function(t){return{role:t}})),"button"===n.dom.tag?{type:(i="type",Ft(n.dom,"attributes").bind(function(t){return Ft(t,i)}).getOr("button"))}:{})}}},apis:{open:function(t,n){return t.open(n)},expand:function(t,n){return t.expand(n)},close:function(t,n){return t.close(n)},isOpen:function(t,n){return t.isOpen(n)},repositionMenus:function(t,n){return t.repositionMenus(n)}}}),nw=ac({fields:[],name:"unselecting",active:/* */Object.freeze({__proto__:null,events:function(){return Zo([tr(yo(),b)])},exhibit:function(){return gi({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),ew=Kr("color-input-change"),ow=Kr("color-swatch-change"),rw=Kr("color-picker-cancel"),iw=function(e,n,o){var r,i,t=Yy.parts.field({factory:px,inputClasses:["tox-textfield"],onSetValue:function(t){return Vx.run(t).get(function(){})},inputBehaviours:ic([gv.config({disabled:n.providers.isDisabled}),Lv(),Jy.config({}),Vx.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return kr(t.element)},notify:{onValid:function(t){var n=Nl.getValue(t);qo(t,ew,{color:n})}},validator:{validateOnLoad:!1,validate:function(t){var n=Nl.getValue(t);if(0===n.length)return _x(mt.value(!0));var e=me.fromTag("span");qi(e,"background-color",n);var o=Zi(e,"background-color").fold(function(){return mt.error("blah")},function(t){return mt.value(n)});return _x(o)}}})]),selectOnFocus:!1}),u=e.label.map(function(t){return nx(t,n.providers)}),a=function(t,n){qo(t,ow,{value:n})},c=gp((r={dom:{tag:"span",attributes:{"aria-label":n.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[za,Ha,Ua]},onLtr:function(){return[Ha,za,Ua]}},components:[],fetch:Gb(o.getColors(),o.hasCustomColors()),columns:o.getColorCols(),presets:"color",onItemAction:function(t,e){c.getOpt(t).each(function(n){"custom"===e?o.colorPicker(function(t){t.fold(function(){return Yo(n,rw)},function(t){a(n,t),Nb(t)})},"#ffffff"):a(n,"remove"===e?"":e)})}},i=n,tw.sketch({dom:r.dom,components:r.components,toggleClass:"mce-active",dropdownBehaviours:ic([Uv(i.providers.isDisabled),Lv(),nw.config({}),Jy.config({})]),layouts:r.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:i.getSink,fetch:function(n){return Ox(function(t){return r.fetch(t)}).map(function(t){return st.from(hy(zt(Jb(Kr("menu-value"),t,function(t){r.onItemAction(n,t)},r.columns,r.presets,uh.CLOSE_ON_EXECUTE,function(){return!1},i.providers),{movement:Qb(r.columns,r.presets)})))})},parts:{menu:wh(0,0,r.presets)}})));return Yy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:u.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[t,c.asSpec()]}]),fieldBehaviours:ic([dg("form-field-events",[er(ew,function(t,n){c.getOpt(t).each(function(t){qi(t.element,"background-color",n.event.color)}),qo(t,ex,{name:e.name})}),er(ow,function(n,e){Yy.getField(n).each(function(t){Nl.setValue(t,e.event.value),td.getCurrent(n).each(vg.focus)})}),er(rw,function(n,t){Yy.getField(n).each(function(t){td.getCurrent(n).each(vg.focus)})})])])})},uw=function(t,n,e){return{hue:t,saturation:n,value:e}},aw=Kr("rgb-hex-update"),cw=Kr("slider-update"),sw=Kr("palette-update"),lw=yf({schema:[Ln("dom")],name:"label"}),fw=function(n){return yf({name:n+"-edge",overrides:function(t){return t.model.manager.edgeActions[n].fold(function(){return{}},function(o){return{events:Zo([or(no(),function(t,n,e){return o(t,e)},[t]),or(io(),function(t,n,e){return o(t,e)},[t]),or(uo(),function(t,n,e){e.mouseIsDown.get()&&o(t,e)},[t])])}})}})},dw=fw("top-left"),mw=fw("top"),gw=fw("top-right"),pw=fw("right"),hw=fw("bottom-right"),vw=fw("bottom"),bw=fw("bottom-left"),yw=[lw,fw("left"),pw,mw,vw,dw,gw,bw,hw,vf({name:"thumb",defaults:at({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Zo([ir(no(),t,"spectrum"),ir(eo(),t,"spectrum"),ir(oo(),t,"spectrum"),ir(io(),t,"spectrum"),ir(uo(),t,"spectrum"),ir(co(),t,"spectrum")])}}}),vf({schema:[le("mouseIsDown",function(){return fe(!1)})],name:"spectrum",overrides:function(e){var o=e.model.manager,r=function(n,t){return o.getValueFromEvent(t).map(function(t){return o.setValueFrom(n,e,t)})};return{behaviours:ic([ug.config({mode:"special",onLeft:function(t){return o.onLeft(t,e)},onRight:function(t){return o.onRight(t,e)},onUp:function(t){return o.onUp(t,e)},onDown:function(t){return o.onDown(t,e)}}),vg.config({})]),events:Zo([er(no(),r),er(eo(),r),er(io(),r),er(uo(),function(t,n){e.mouseIsDown.get()&&r(t,n)})])}}})],xw=at("slider.change.value"),ww=function(t){var n=t.event.raw;return-1===n.type.indexOf("touch")?n.clientX!==undefined?st.some(n).map(function(t){return wu(t.clientX,t.clientY)}):st.none():n.touches!==undefined&&1===n.touches.length?st.some(n.touches[0]).map(function(t){return wu(t.clientX,t.clientY)}):st.none()},Sw=function(t){return t.model.minX},kw=function(t){return t.model.minY},Cw=function(t){return t.model.minX-1},Ow=function(t){return t.model.minY-1},_w=function(t){return t.model.maxX},Tw=function(t){return t.model.maxY},Ew=function(t){return t.model.maxX+1},Dw=function(t){return t.model.maxY+1},Bw=function(t,n,e){return n(t)-e(t)},Aw=function(t){return Bw(t,_w,Sw)},Mw=function(t){return Bw(t,Tw,kw)},Fw=function(t){return Aw(t)/2},Iw=function(t){return Mw(t)/2},Rw=function(t){return t.stepSize},Vw=function(t){return t.snapToGrid},Pw=function(t){return t.snapStart},Hw=function(t){return t.rounded},zw=function(t,n){return t[n+"-edge"]!==undefined},Nw=function(t){return zw(t,"left")},Lw=function(t){return zw(t,"right")},jw=function(t){return zw(t,"top")},Uw=function(t){return zw(t,"bottom")},Ww=function(t){return t.model.value.get()},Gw=function(t){return{x:t}},Xw=function(t){return{y:t}},Yw=function(t,n){return{x:t,y:n}},qw=function(t,n){qo(t,xw(),{value:n})},Kw=function(t,n,e,o){return t<n?t:e<t?e:t===n?n-1:Math.max(n,t-o)},Jw=function(t,n,e,o){return e<t?t:t<n?n:t===e?e+1:Math.min(e,t+o)},$w=function(t,n,e){return Math.max(n,Math.min(e,t))},Qw=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?n-1:n,p=l?e+1:e;if(r<f)return g;if(d<r)return p;var h,v,b,y,x,w,S,k=(x=r,w=f,S=d,Math.min(S,Math.max(x,w))-w),C=$w(k/m*o+n,g,p);return u&&n<=C&&C<=e?(h=C,v=n,b=e,y=i,a.fold(function(){var t=h-v,n=Math.round(t/y)*y;return $w(v+n,v-1,b+1)},function(t){var n=(h-t)%y,e=Math.round(n/y),o=Math.floor((h-t)/y),r=Math.floor((b-t)/y),i=t+Math.min(r,o+e)*y;return Math.max(t,i)})):c?Math.round(C):C},Zw=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return r<n?i?0:s:e<r?u?a:l:(r-n)/o*c},tS="left",nS=function(t){return t.element.dom.getBoundingClientRect()},eS=function(t,n){return t[n]},oS=function(t){var n=nS(t);return eS(n,tS)},rS=function(t){var n=nS(t);return eS(n,"right")},iS=function(t){var n=nS(t);return eS(n,"top")},uS=function(t){var n=nS(t);return eS(n,"bottom")},aS=function(t){var n=nS(t);return eS(n,"width")},cS=function(t){var n=nS(t);return eS(n,"height")},sS=function(t,n,e){return(t+n)/2-e},lS=function(t,n){var e=nS(t),o=nS(n),r=eS(e,tS),i=eS(e,"right"),u=eS(o,tS);return sS(r,i,u)},fS=function(t,n){var e=nS(t),o=nS(n),r=eS(e,"top"),i=eS(e,"bottom"),u=eS(o,"top");return sS(r,i,u)},dS=function(t,n){qo(t,xw(),{value:n})},mS=function(t){return{x:t}},gS=function(t,n,e){var o={min:Sw(n),max:_w(n),range:Aw(n),value:e,step:Rw(n),snap:Vw(n),snapStart:Pw(n),rounded:Hw(n),hasMinEdge:Nw(n),hasMaxEdge:Lw(n),minBound:oS(t),maxBound:rS(t),screenRange:aS(t)};return Qw(o)},pS=function(i){return function(t,n){return e=t,r=(0<i?Jw:Kw)(Ww(o=n).x,Sw(o),_w(o),Rw(o)),dS(e,mS(r)),st.some(r).map(function(){return!0});var e,o,r}},hS=function(t,n,e,o,r,i){var u,a,c,s,l,f,d,m,g,p=(a=i,c=e,s=o,l=r,f=aS(u=n),d=s.bind(function(t){return st.some(lS(t,u))}).getOr(0),m=l.bind(function(t){return st.some(lS(t,u))}).getOr(f),g={min:Sw(a),max:_w(a),range:Aw(a),value:c,hasMinEdge:Nw(a),hasMaxEdge:Lw(a),minBound:oS(u),minOffset:0,maxBound:rS(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:m},Zw(g));return oS(n)-oS(t)+p},vS=pS(-1),bS=pS(1),yS=st.none,xS=st.none,wS={"top-left":st.none(),top:st.none(),"top-right":st.none(),right:st.some(function(t,n){qw(t,Gw(Ew(n)))}),"bottom-right":st.none(),bottom:st.none(),"bottom-left":st.none(),left:st.some(function(t,n){qw(t,Gw(Cw(n)))})},SS=/* */Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=gS(t,n,e),r=mS(o);return dS(t,r),o},setToMin:function(t,n){var e=Sw(n);dS(t,mS(e))},setToMax:function(t,n){var e=_w(n);dS(t,mS(e))},findValueOfOffset:gS,getValueFromEvent:function(t){return ww(t).map(function(t){return t.left})},findPositionOfValue:hS,setPositionFromValue:function(t,n,e,o){var r=Ww(e),i=hS(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),e),u=_u(n.element)/2;qi(n.element,"left",i-u+"px")},onLeft:vS,onRight:bS,onUp:yS,onDown:xS,edgeActions:wS}),kS=function(t,n){qo(t,xw(),{value:n})},CS=function(t){return{y:t}},OS=function(t,n,e){var o={min:kw(n),max:Tw(n),range:Mw(n),value:e,step:Rw(n),snap:Vw(n),snapStart:Pw(n),rounded:Hw(n),hasMinEdge:jw(n),hasMaxEdge:Uw(n),minBound:iS(t),maxBound:uS(t),screenRange:cS(t)};return Qw(o)},_S=function(i){return function(t,n){return e=t,r=(0<i?Jw:Kw)(Ww(o=n).y,kw(o),Tw(o),Rw(o)),kS(e,CS(r)),st.some(r).map(function(){return!0});var e,o,r}},TS=function(t,n,e,o,r,i){var u,a,c,s,l,f,d,m,g,p=(a=i,c=e,s=o,l=r,f=cS(u=n),d=s.bind(function(t){return st.some(fS(t,u))}).getOr(0),m=l.bind(function(t){return st.some(fS(t,u))}).getOr(f),g={min:kw(a),max:Tw(a),range:Mw(a),value:c,hasMinEdge:jw(a),hasMaxEdge:Uw(a),minBound:iS(u),minOffset:0,maxBound:uS(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:m},Zw(g));return iS(n)-iS(t)+p},ES=st.none,DS=st.none,BS=_S(-1),AS=_S(1),MS={"top-left":st.none(),top:st.some(function(t,n){qw(t,Xw(Ow(n)))}),"top-right":st.none(),right:st.none(),"bottom-right":st.none(),bottom:st.some(function(t,n){qw(t,Xw(Dw(n)))}),"bottom-left":st.none(),left:st.none()},FS=/* */Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=OS(t,n,e),r=CS(o);return kS(t,r),o},setToMin:function(t,n){var e=kw(n);kS(t,CS(e))},setToMax:function(t,n){var e=Tw(n);kS(t,CS(e))},findValueOfOffset:OS,getValueFromEvent:function(t){return ww(t).map(function(t){return t.top})},findPositionOfValue:TS,setPositionFromValue:function(t,n,e,o){var r=Ww(e),i=TS(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),e),u=bu(n.element)/2;qi(n.element,"top",i-u+"px")},onLeft:ES,onRight:DS,onUp:BS,onDown:AS,edgeActions:MS}),IS=function(t,n){qo(t,xw(),{value:n})},RS=function(t,n){return{x:t,y:n}},VS=function(c,s){return function(t,n){return o=t,r=n,i=0<c?Jw:Kw,u=(e=s)?Ww(r).x:i(Ww(r).x,Sw(r),_w(r),Rw(r)),a=e?i(Ww(r).y,kw(r),Tw(r),Rw(r)):Ww(r).y,IS(o,RS(u,a)),st.some(u).map(function(){return!0});var e,o,r,i,u,a}},PS=ww,HS=VS(-1,!1),zS=VS(1,!1),NS=VS(-1,!0),LS=VS(1,!0),jS={"top-left":st.some(function(t,n){qw(t,Yw(Cw(n),Ow(n)))}),top:st.some(function(t,n){qw(t,Yw(Fw(n),Ow(n)))}),"top-right":st.some(function(t,n){qw(t,Yw(Ew(n),Ow(n)))}),right:st.some(function(t,n){qw(t,Yw(Ew(n),Iw(n)))}),"bottom-right":st.some(function(t,n){qw(t,Yw(Ew(n),Dw(n)))}),bottom:st.some(function(t,n){qw(t,Yw(Fw(n),Dw(n)))}),"bottom-left":st.some(function(t,n){qw(t,Yw(Cw(n),Dw(n)))}),left:st.some(function(t,n){qw(t,Yw(Cw(n),Iw(n)))})},US=/* */Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=gS(t,n,e.left),r=OS(t,n,e.top),i=RS(o,r);return IS(t,i),i},setToMin:function(t,n){var e=Sw(n),o=kw(n);IS(t,RS(e,o))},setToMax:function(t,n){var e=_w(n),o=Tw(n);IS(t,RS(e,o))},getValueFromEvent:PS,setPositionFromValue:function(t,n,e,o){var r=Ww(e),i=hS(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),e),u=TS(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),e),a=_u(n.element)/2,c=bu(n.element)/2;qi(n.element,"left",i-a+"px"),qi(n.element,"top",u-c+"px")},onLeft:HS,onRight:zS,onUp:NS,onDown:LS,edgeActions:jS}),WS=qf({name:"Slider",configFields:[ne("stepSize",1),ne("onChange",$),ne("onChoose",$),ne("onInit",$),ne("onDragStart",$),ne("onDragEnd",$),ne("snapToGrid",!1),ne("rounded",!0),Kn("snapStart"),jn("model",An("mode",{x:[ne("minX",0),ne("maxX",100),le("value",function(t){return fe(t.mode.minX)}),Ln("getInitialValue"),ba("manager",SS)],y:[ne("minY",0),ne("maxY",100),le("value",function(t){return fe(t.mode.minY)}),Ln("getInitialValue"),ba("manager",FS)],xy:[ne("minX",0),ne("maxX",100),ne("minY",0),ne("maxY",100),le("value",function(t){return fe({x:t.mode.minX,y:t.mode.minY})}),Ln("getInitialValue"),ba("manager",US)]})),Ll("sliderBehaviours",[ug,Nl]),le("mouseIsDown",function(){return fe(!1)})],partFields:yw,factory:function(i,t,n,e){var o,u=function(t){return Mf(t,i,"thumb")},a=function(t){return Mf(t,i,"spectrum")},r=function(t){return Af(t,i,"left-edge")},c=function(t){return Af(t,i,"right-edge")},s=function(t){return Af(t,i,"top-edge")},l=function(t){return Af(t,i,"bottom-edge")},f=i.model,d=f.manager,m=function(t,n){d.setPositionFromValue(t,n,i,{getLeftEdge:r,getRightEdge:c,getTopEdge:s,getBottomEdge:l,getSpectrum:a})},g=function(t,n){f.value.set(n);var e=u(t);return m(t,e),i.onChange(t,e,n),st.some(!0)},p=function(e){var t=i.mouseIsDown.get();i.mouseIsDown.set(!1),t&&Af(e,i,"thumb").each(function(t){var n=f.value.get();i.onChoose(e,t,n)})},h=function(t,n){n.stop(),i.mouseIsDown.set(!0),i.onDragStart(t,u(t))},v=function(t,n){n.stop(),i.onDragEnd(t,u(t)),p(t)};return{uid:i.uid,dom:i.dom,components:t,behaviours:Ul(i.sliderBehaviours,[ug.config({mode:"special",focusIn:function(t){return Af(t,i,"spectrum").map(ug.focusIn).map(b)}}),Nl.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),fc.config({channels:((o={})[kl()]={onReceive:p},o)})]),events:Zo([er(xw(),function(t,n){g(t,n.event.value)}),sr(function(t,n){var e=f.getInitialValue();f.value.set(e);var o=u(t);m(t,o);var r=a(t);i.onInit(t,o,r,f.value.get())}),er(no(),h),er(oo(),v),er(io(),h),er(co(),v)]),apis:{resetToMin:function(t){d.setToMin(t,i)},resetToMax:function(t){d.setToMax(t,i)},changeValue:g,refresh:m},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,n){t.resetToMin(n)},resetToMax:function(t,n){t.resetToMax(n)},refresh:function(t,n){t.refresh(n)}}}),GS=[Ll("formBehaviours",[Nl])],XS=function(t){return"<alloy.field."+t+">"},YS=function(o,t){return{uid:o.uid,dom:o.dom,components:t,behaviours:Ul(o.formBehaviours,[Nl.config({store:{mode:"manual",getValue:function(t){var n=If(t,o);return Tt(n,function(t,r){return t().bind(function(t){var n,e,o=td.getCurrent(t);return n=o,e=new Error("Cannot find a current component to extract the value from for form part '"+r+"': "+Gr(t.element)),n.fold(function(){return mt.error(e)},mt.value)}).map(Nl.getValue)})},setValue:function(e,t){_t(t,function(n,t){Af(e,o,t).each(function(t){td.getCurrent(t).each(function(t){Nl.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return Af(t,o,n).bind(td.getCurrent)}}}},qS={getField:li(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),_f("form",XS(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=V(r,function(t){return vf({name:t,pname:XS(t)})});return Lf("form",GS,i,YS,o)}},KS=Kr("valid-input"),JS=Kr("invalid-input"),$S=Kr("validating-input"),QS="colorcustom.rgb.",ZS=function(d,m,g,p){var h=function(t,n,e,o,r){var i,u,a=d(QS+"range"),c=[Yy.parts.label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),Yy.parts.field({data:r,factory:px,inputAttributes:ut({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:ic([(i=n,u=t,Vx.config({invalidClass:m("invalid"),notify:{onValidate:function(t){qo(t,$S,{type:i})},onValid:function(t){qo(t,KS,{type:i,value:Nl.getValue(t)})},onInvalid:function(t){qo(t,JS,{type:i,value:Nl.getValue(t)})}},validator:{validate:function(t){var n=Nl.getValue(t),e=u(n)?mt.value(!0):mt.error(d("aria.input.invalid"));return _x(e)},validateOnLoad:!1}})),Jy.config({})]),onSetValue:function(t){Vx.isInvalid(t)&&Vx.run(t).get($)}})],s="hex"!==n?[Yy.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;Nl.setValue(t,{red:e,green:o,blue:r})},b=gp({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),y=function(t,n){b.getOpt(t).each(function(t){qi(t.element,"background-color","#"+n.value)})};return Yf({factory:function(){var e={red:fe(st.some(255)),green:fe(st.some(255)),blue:fe(st.some(255)),hex:fe(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 Ob(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=yb(t),qS.getField(n,"hex").each(function(t){vg.isFocused(t)||Nl.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=mb(n);i("hex",st.some(n));var o=Eb(e);v(t,o),r(o),qo(t,aw,{hex:e}),y(t,e)}(t,e.value):u(t,e.type,e.value)},t=function(t){return{label:d(QS+t+".label"),description:d(QS+t+".description")}},c=t("red"),s=t("green"),l=t("blue"),f=t("hex");return zt(qS.sketch(function(t){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[t.field("red",Yy.sketch(h(_b,"red",c.label,c.description,255))),t.field("green",Yy.sketch(h(_b,"green",s.label,s.description,255))),t.field("blue",Yy.sketch(h(_b,"blue",l.label,l.description,255))),t.field("hex",Yy.sketch(h(hb,"hex",f.label,f.description,"ffffff"))),b.asSpec()],formBehaviours:ic([Vx.config({invalidClass:m("form-invalid")}),dg("rgb-form-events",[er(KS,a),er(JS,n),er($S,n)])])}}),{apis:{updateHex:function(t,n){var e,o;Nl.setValue(t,{hex:n.value}),e=t,o=Eb(n),v(e,o),r(o),y(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},tk=function(t,o){var r=WS.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=WS.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"<div class="+o("sv-palette-inner-thumb")+' role="presentation"></div>'}}),u=function(t,n){var e,o,r=t.width,i=t.height,u=t.getContext("2d");null!==u&&(u.fillStyle=n,u.fillRect(0,0,r,i),(e=u.createLinearGradient(0,0,r,0)).addColorStop(0,"rgba(255,255,255,1)"),e.addColorStop(1,"rgba(255,255,255,0)"),u.fillStyle=e,u.fillRect(0,0,r,i),(o=u.createLinearGradient(0,0,0,i)).addColorStop(0,"rgba(0,0,0,0)"),o.addColorStop(1,"rgba(0,0,0,1)"),u.fillStyle=o,u.fillRect(0,0,r,i))};return Yf({factory:function(t){var n=at({x:0,y:0}),e=ic([td.config({find:st.some}),vg.config({})]);return WS.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){qo(t,sw,{value:e})},onInit:function(t,n,e,o){u(e.element.dom,Bb(Ab))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element.dom,u(r,Bb(o))}},extraApis:{}})},nk=function(f,d){return Yf({name:"ColourPicker",configFields:[Ln("dom"),ne("onValidHex",$),ne("onInvalidHex",$)],factory:function(t){var a,v,n,e,o,r=ZS(f,d,t.onValidHex,t.onInvalidHex),i=tk(0,d),b={paletteRgba:fe(Ab)},u=gp(i.sketch({})),c=gp(r.sketch({})),s=function(t,e){u.getOpt(t).each(function(t){var n=Eb(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){ft(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[u.asSpec(),(n=d,e=WS.parts.spectrum({dom:{tag:"div",classes:[n("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=WS.parts.thumb({dom:{tag:"div",classes:[n("hue-slider-thumb")],attributes:{role:"presentation"}}}),WS.sketch({dom:{tag:"div",classes:[n("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:at({y:0})},components:[e,o],sliderBehaviours:ic([vg.config({})]),onChange:function(t,n,e){qo(t,cw,{value:e})}})),c.asSpec()],behaviours:ic([dg("colour-picker-events",[er(sw,(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?uw(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,uw(Math.round(r),Math.round(100*o),Math.round(100*i)))),g=uw(m.hue,f.x,100-f.y),p=Tb(g),h=yb(p);y(t,h,v)})),er(cw,(a=[s,l],function(t,n){var e,o,r,i=n.event.value,u=(e=i.y,o=uw((100-e)/100*360,100,100),r=Tb(o),yb(r));y(t,u,a)}))]),td.config({find:function(t){return c.getOpt(t)}}),ug.config({mode:"acyclic"})])}}})},ek=function(){return td.config({find:st.some})},ok=function(t){return td.config({find:t.getOpt})},rk=function(t){return td.config({find:function(n){return Tr(n.element,t).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}})},ik={"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"},uk=function(t){return ik[t]},ak=tinymce.util.Tools.resolve("tinymce.Resource"),ck=tinymce.util.Tools.resolve("tinymce.util.Tools"),sk=fn([ne("preprocess",ct),ne("postprocess",ct)]),lk=function(t,n,e){return Nl.config(zt({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},fk=function(t,n,e){return lk(t,function(t){return n(t.element)},function(t,n){return e(t.element,n)})},dk=function(r,t){var i=En("RepresentingConfigs.memento processors",sk,t);return Nl.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=Nl.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);Nl.setValue(o,e)}}})},mk=lk,gk=function(t){return fk(t,Vr,Pr)},pk=function(t){return Nl.config({store:{mode:"memory",initialValue:t}})},hk=function(i,u){var n=function(t,n){n.stop()},e=function(t){return function(n,e){ft(t,function(t){t(n,e)})}},o=function(t,n){var e;gv.isDisabled(t)||(e=n.event.raw,a(t,e.dataTransfer.files))},r=function(t,n){var e=n.event.raw.target;a(t,e.files)},a=function(t,n){var e,o,r;Nl.setValue(t,(e=n,o=u,r=ck.explode(o.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string")),H(Q(e),function(n){return F(r,function(t){return Se(n.name,"."+t)})}))),qo(t,ex,{name:i.name})},c=gp({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ic([dg("input-file-events",[ar(vo()),ar(Eo())])])}),t=i.label.map(function(t){return nx(t,u)}),s=Yy.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ic([pk([]),ek(),gv.config({}),Dg.config({toggleClass:"dragenter",toggleOnExecute:!1}),dg("dropzone-events",[er("dragenter",e([n,Dg.toggle])),er("dragleave",e([n,Dg.toggle])),er("dragover",n),er("drop",e([n,o])),er(ho(),r)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:u.translate("Drop an image here")}},mp.sketch({dom:{tag:"button",innerHtml:u.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:ic([Jy.config({}),Uv(u.isDisabled),Lv()])})]}]}}}});return Qy(t,s,["tox-form__group--stretched"],[])},vk=Kr("alloy-fake-before-tabstop"),bk=Kr("alloy-fake-after-tabstop"),yk=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:ic([vg.config({ignore:!0}),Jy.config({})])}},xk=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[yk([vk]),t,yk([bk])],behaviours:ic([rk(1)])}},wk=function(t,n){qo(t,mo(),{raw:{which:9,shiftKey:n}})},Sk=function(t,n){var e=n.element;Ai(e,vk)?wk(t,!0):Ai(e,bk)&&wk(t,!1)},kk=function(t){return Sy(t,["."+vk,"."+bk].join(","),c)},Ck=!(je().browser.isIE()||je().browser.isEdge()),Ok=function(t,n){var o,r,e=Ck&&t.sandboxed,i=ut(ut({},t.label.map(function(t){return{title:t}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),u=(o=e,r=fe(""),{getValue:function(t){return r.get()},setValue:function(t,n){var e;o?zr(t.element,"srcdoc",n):(zr(t.element,"src","javascript:''"),(e=t.element.dom.contentWindow.document).open(),e.write(n),e.close()),r.set(n)}}),a=t.label.map(function(t){return nx(t,n)}),c=Yy.parts.field({factory:{sketch:function(t){return xk({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:ic([Jy.config({}),vg.config({}),mk(st.none(),u.getValue,u.setValue)])})}}});return Qy(a,c,["tox-form__group--stretched"],[])};function _k(t,n){return Dk(document.createElement("canvas"),t,n)}function Tk(t){var n=_k(t.width,t.height);return Ek(n).drawImage(t,0,0),n}function Ek(t){return t.getContext("2d")}function Dk(t,n,e){return t.width=n,t.height=e,t}function Bk(t){return t.naturalWidth||t.width}function Ak(t){return t.naturalHeight||t.height}var Mk,Fk,Ik,Rk,Vk=window.Promise?window.Promise:(Mk=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=[],Uk(t,Pk(zk,this),Pk(Nk,this))},Fk=window,Ik=Mk.immediateFn||"function"==typeof Fk.setImmediate&&Fk.setImmediate||function(t){setTimeout(t,1)},Rk=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Mk.prototype["catch"]=function(t){return this.then(null,t)},Mk.prototype.then=function(e,o){var r=this;return new Mk(function(t,n){Hk.call(r,new jk(e,o,t,n))})},Mk.all=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var c=Array.prototype.slice.call(1===t.length&&Rk(t[0])?t[0]:t);return new Mk(function(r,i){if(0===c.length)return r([]);for(var u=c.length,t=0;t<c.length;t++)!function a(n,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void e.call(t,function(t){a(n,t)},i)}c[n]=t,0==--u&&r(c)}catch(o){i(o)}}(t,c[t])})},Mk.resolve=function(n){return n&&"object"==typeof n&&n.constructor===Mk?n:new Mk(function(t){t(n)})},Mk.reject=function(e){return new Mk(function(t,n){n(e)})},Mk.race=function(r){return new Mk(function(t,n){for(var e=0,o=r;e<o.length;e++)o[e].then(t,n)})},Mk);function Pk(t,n){return function(){return t.apply(n,arguments)}}function Hk(o){var r=this;null!==this._state?Ik(function(){var t,n=r._state?o.onFulfilled:o.onRejected;if(null!==n){try{t=n(r._value)}catch(e){return void o.reject(e)}o.resolve(t)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}function zk(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void Uk(Pk(n,t),Pk(zk,this),Pk(Nk,this))}this._state=!0,this._value=t,Lk.call(this)}catch(e){Nk.call(this,e)}}function Nk(t){this._state=!1,this._value=t,Lk.call(this)}function Lk(){for(var t=0,n=this._deferreds;t<n.length;t++){var e=n[t];Hk.call(this,e)}this._deferreds=[]}function jk(t,n,e,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof n?n:null,this.resolve=e,this.reject=o}function Uk(t,n,e){var o=!1;try{t(function(t){o||(o=!0,n(t))},function(t){o||(o=!0,e(t))})}catch(r){if(o)return;o=!0,e(r)}}function Wk(e){return new Vk(function(t,n){(function(t){var n=t.split(","),e=/data:([^;]+)/.exec(n[0]);if(!e)return st.none();for(var o=e[1],r=n[1],i=atob(r),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var l=1024*s,f=Math.min(1024+l,u),d=new Array(f-l),m=l,g=0;m<f;++g,++m)d[g]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return st.some(new Blob(c,{type:o}))})(e).fold(function(){n("uri is not base64: "+e)},t)})}function Gk(t,o,r){return o=o||"image/png",_(HTMLCanvasElement.prototype.toBlob)?new Vk(function(n,e){t.toBlob(function(t){t?n(t):e()},o,r)}):Wk(t.toDataURL(o,r))}function Xk(t){return a=t,new Vk(function(t,n){var e=URL.createObjectURL(a),o=new Image,r=function(){o.removeEventListener("load",i),o.removeEventListener("error",u)};function i(){r(),t(o)}function u(){r(),n("Unable to load data of type "+a.type+": "+e)}o.addEventListener("load",i),o.addEventListener("error",u),o.src=e,o.complete&&i()}).then(function(t){var n;n=t,URL.revokeObjectURL(n.src);var e=_k(Bk(t),Ak(t));return Ek(e).drawImage(t,0,0),e});var a}function Yk(t,n,e){var o=n.type;function r(o,r){return t.then(function(t){return e=r,n=(n=o)||"image/png",t.toDataURL(n,e);var n,e})}return{getType:at(o),toBlob:function(){return Vk.resolve(n)},toDataURL:at(e),toBase64:function(){return e.split(",")[1]},toAdjustedBlob:function(n,e){return t.then(function(t){return Gk(t,n,e)})},toAdjustedDataURL:r,toAdjustedBase64:function(t,n){return r(t,n).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(Tk)}}}function qk(n){return e=n,new Vk(function(t){var n=new FileReader;n.onloadend=function(){t(n.result)},n.readAsDataURL(e)}).then(function(t){return Yk(Xk(n),n,t)});var e}function Kk(n,t){return Gk(n,t).then(function(t){return Yk(Vk.resolve(n),t,n.toDataURL())})}var Jk=qk;function $k(t,n,e){var o="string"==typeof t?parseFloat(t):t;return e<o?o=e:o<n&&(o=n),o}function Qk(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]}var Zk=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function tC(t,n){for(var e,o=[],r=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)o[u]=n[u+5*i];for(u=0;u<5;u++){for(var a=e=0;a<5;a++)e+=t[u+5*a]*o[a];r[u+5*i]=e}}return r}function nC(u,a){return u.toCanvas().then(function(t){return n=t,e=u.getType(),o=a,r=Ek(n),i=function(t,n){for(var e,o,r,i,u=t.data,a=n[0],c=n[1],s=n[2],l=n[3],f=n[4],d=n[5],m=n[6],g=n[7],p=n[8],h=n[9],v=n[10],b=n[11],y=n[12],x=n[13],w=n[14],S=n[15],k=n[16],C=n[17],O=n[18],_=n[19],T=0;T<u.length;T+=4)e=u[T],o=u[T+1],r=u[T+2],i=u[T+3],u[T]=e*a+o*c+r*s+i*l+f,u[T+1]=e*d+o*m+r*g+i*p+h,u[T+2]=e*v+o*b+r*y+i*x+w,u[T+3]=e*S+o*k+r*C+i*O+_;return t}(r.getImageData(0,0,n.width,n.height),o),r.putImageData(i,0,0),Kk(n,e);var n,e,o,r,i})}function eC(a,c){return a.toCanvas().then(function(t){return n=t,e=a.getType(),o=c,r=Ek(n),i=r.getImageData(0,0,n.width,n.height),u=r.getImageData(0,0,n.width,n.height),u=function(t,n,e){function o(t,n,e){return e<t?t=e:t<n&&(t=n),t}for(var r=Math.round(Math.sqrt(e.length)),i=Math.floor(r/2),u=t.data,a=n.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,p=0;p<r;p++)for(var h=0;h<r;h++){var v=o(f+h-i,0,c-1),b=4*(o(l+p-i,0,s-1)*c+v),y=e[p*r+h];d+=u[b]*y,m+=u[1+b]*y,g+=u[2+b]*y}var x=4*(l*c+f);a[x]=o(d,0,255),a[1+x]=o(m,0,255),a[2+x]=o(g,0,255)}return n}(i,u,o),r.putImageData(u,0,0),Kk(n,e);var n,e,o,r,i,u})}function oC(e){return function(t,n){return nC(t,e(Qk(),n))}}var rC,iC,uC,aC,cC=(rC=[-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1],function(t){return nC(t,rC)}),sC=oC(function(t,n){return tC(t,[1,0,0,0,n=$k(255*n,-255,255),0,1,0,0,n,0,0,1,0,n,0,0,0,1,0,0,0,0,0,1])}),lC=oC(function(t,n){var e;return n=$k(n,-1,1),tC(t,[(e=(n*=100)<0?127+n/100*127:127*(e=0===(e=n%1)?Zk[n]:Zk[Math.floor(n)]*(1-e)+Zk[Math.floor(n)+1]*e)+127)/127,0,0,0,.5*(127-e),0,e/127,0,0,.5*(127-e),0,0,e/127,0,.5*(127-e),0,0,0,1,0,0,0,0,0,1])}),fC=(iC=[0,-1,0,-1,5,-1,0,-1,0],function(t){return eC(t,iC)}),dC=(uC=function(t,n){return 255*Math.pow(t/255,1-n)},aC=function(t,n,e){var o=Ek(t),r=new Array(256);for(var i=0;i<r.length;i++)r[i]=uC(i,e);var u=function(t,n){for(var e=t.data,o=0;o<e.length;o+=4)e[o]=n[e[o]],e[o+1]=n[e[o+1]],e[o+2]=n[e[o+2]];return t}(o.getImageData(0,0,t.width,t.height),r);return o.putImageData(u,0,0),Kk(t,n)},function(n,e){return n.toCanvas().then(function(t){return aC(t,n.getType(),e)})});function mC(t,n,e){var o=Bk(t),r=Ak(t),i=n/o,u=e/r,a=!1;(i<.5||2<i)&&(i=i<.5?.5:2,a=!0),(u<.5||2<u)&&(u=u<.5?.5:2,a=!0);var c,s,l,f=(c=t,s=i,l=u,new Vk(function(t){var n=Bk(c),e=Ak(c),o=Math.floor(n*s),r=Math.floor(e*l),i=_k(o,r);Ek(i).drawImage(c,0,0,n,e,0,0,o,r),t(i)}));return a?f.then(function(t){return mC(t,n,e)}):f}function gC(n,e){return n.toCanvas().then(function(t){return function(t,n,e){var o=_k(t.width,t.height),r=Ek(o),i=0,u=0;90!==(e=e<0?360+e:e)&&270!==e||Dk(o,o.height,o.width);90!==e&&180!==e||(i=o.width);270!==e&&180!==e||(u=o.height);return r.translate(i,u),r.rotate(e*Math.PI/180),r.drawImage(t,0,0),Kk(o,n)}(t,n.getType(),e)})}function pC(n,e){return n.toCanvas().then(function(t){return function(t,n,e){var o=_k(t.width,t.height),r=Ek(o);"v"===e?(r.scale(1,-1),r.drawImage(t,0,-o.height)):(r.scale(-1,1),r.drawImage(t,-o.width,0));return Kk(o,n)}(t,n.getType(),e)})}function hC(u,a,c,s,l){return u.toCanvas().then(function(t){return n=t,e=u.getType(),o=a,r=c,Ek(i=_k(s,l)).drawImage(n,-o,-r),Kk(i,e);var n,e,o,r,i})}var vC,bC=function(t){return cC(t)},yC=function(t){return fC(t)},xC=function(t,n){return dC(t,n)},wC=function(t,n,e,o){return nC(t,(r=Qk(),i=e,u=o,tC(r,[$k(n,0,2),0,0,0,0,0,i=$k(i,0,2),0,0,0,0,0,u=$k(u,0,2),0,0,0,0,0,1,0,0,0,0,0,1])));var r,i,u},SC=function(t,n){return sC(t,n)},kC=function(t,n){return lC(t,n)},CC=pC,OC=hC,_C=function(t,n,e){return r=n,i=e,(o=t).toCanvas().then(function(t){return mC(t,r,i).then(function(t){return Kk(t,o.getType())})});var o,r,i},TC=gC,EC=function(t,n){return ut({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},n)},DC=function(t,n){return EC(hp(t,n),{})},BC=function(t,n){return EC(hp(t,n),{behaviours:ic([fg.config({})])})},AC=function(t,n,e){return{dom:{tag:"span",innerHtml:e.translate(t),classes:[n+"__select-label"]},behaviours:ic([fg.config({})])}},MC=Kr("toolbar.button.execute"),FC=((vC={})[_o()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],vC),IC=Kr("update-menu-text"),RC=Kr("update-menu-icon"),VC=function(n,e,o){var t=fe($),r=n.text.map(function(t){return gp(AC(t,e,o.providers))}),i=n.icon.map(function(t){return gp(BC(t,o.providers.icons))}),u=function(t,n){var e=Nl.getValue(t);return vg.focus(e),qo(e,"keydown",{raw:n.event.raw}),tw.close(e),st.some(!0)},a=n.role.fold(function(){return{}},function(t){return{role:t}}),c=n.tooltip.fold(function(){return{}},function(t){var n=o.providers.translate(t);return{title:n,"aria-label":n}});return gp(tw.sketch(ut(ut(ut({},n.uid?{uid:n.uid}:{}),a),{dom:{tag:"button",classes:[e,e+"--select"].concat(V(n.classes,function(t){return e+"--"+t})),attributes:ut({},c)},components:Jv([i.map(function(t){return t.asSpec()}),r.map(function(t){return t.asSpec()}),st.some({dom:{tag:"div",classes:[e+"__select-chevron"],innerHtml:hp("chevron-down",o.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:ic(S(n.dropdownBehaviours,[Uv(function(){return n.disabled||o.providers.isDisabled()}),Lv(),nw.config({}),fg.config({}),dg("dropdown-events",[Yv(n,t),qv(n,t)]),dg("menubutton-update-display-text",[er(IC,function(n,e){r.bind(function(t){return t.getOpt(n)}).each(function(t){fg.set(t,[fu(o.providers.translate(e.event.text))])})}),er(RC,function(n,e){i.bind(function(t){return t.getOpt(n)}).each(function(t){fg.set(t,[BC(e.event.icon,o.providers.icons)])})})])])),eventOrder:zt(FC,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ic([ug.config({mode:"special",onLeft:u,onRight:u})]),lazySink:o.getSink,toggleClass:e+"--active",parts:{menu:wh(0,n.columns,n.presets)},fetch:function(t){return Ox(y(n.fetch,t))}}))).asSpec()},PC=function(t){return"separator"===t.type},HC={type:"separator"},zC=function(t,e){var n=N(t,function(t,n){return k(n)?""===n?t:"|"===n?0<t.length&&!PC(t[t.length-1])?t.concat([HC]):t:It(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])},[]);return 0<n.length&&PC(n[n.length-1])&&n.pop(),n},NC=function(t,n){return It(t,"getSubmenuItems")?(o=n,r=(e=t).getSubmenuItems(),i=LC(r,o),{item:e,menus:zt(i.menus,Jt(e.value,i.items)),expansions:zt(i.expansions,Jt(e.value,e.value))}):{item:t,menus:{},expansions:{}};var e,o,r,i},LC=function(t,r){var n=zC(k(t)?t.split(" "):t,r);return z(n,function(t,n){var e=function(t){if(PC(t))return t;var n=Ft(t,"value").getOrThunk(function(){return Kr("generated-menu-item")});return zt({value:n},t)}(n),o=NC(e,r);return{menus:zt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:zt(t.expansions,o.expansions)}},{menus:{},expansions:{},items:[]})},jC=function(t,e,o,n){var r=Kr("primary-menu"),i=LC(t,o.shared.providers.menuItems());if(0===i.items.length)return st.none();var u=py(r,i.items,e,o,n),a=Tt(i.menus,function(t,n){return py(n,t,e,o,!1)}),c=zt(a,Jt(r,u));return st.from(Zg.tieredData(r,c,i.expansions))},UC=function(e){return{isDisabled:function(){return gv.isDisabled(e)},setDisabled:function(t){return gv.set(e,t)},setActive:function(t){var n=e.element;t?(Ei(n,"tox-tbtn--enabled"),zr(n,"aria-pressed",!0)):(Bi(n,"tox-tbtn--enabled"),Ur(n,"aria-pressed"))},isActive:function(){return Ai(e.element,"tox-tbtn--enabled")}}},WC=function(e,t,o,n){return VC({text:e.text,icon:e.icon,tooltip:e.tooltip,role:n,fetch:function(t,n){e.fetch(function(t){n(jC(t,uh.CLOSE_ON_EXECUTE,o,!1))})},onSetup:e.onSetup,getApi:UC,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Jy.config({})]},t,o.shared)},GC=function(n,r,i){return function(t){t(V(n,function(t){var n,e,o=t.text.fold(function(){return{}},function(t){return{text:t}});return ut(ut({type:t.type,active:!1},o),{onAction:function(t){var n=!t.isActive();t.setActive(n),e.storage.set(n),i.shared.getSink().each(function(t){r().getOpt(t).each(function(t){mc(t.element),qo(t,ix,{name:e.name,value:e.storage.get()})})})},onSetup:(n=e=t,function(t){t.setActive(n.storage.get())})})}))}},XC=function(t,n,e,o,r,i){void 0===e&&(e=[]);var u=n.fold(function(){return{}},function(t){return{action:t}}),a=ut({buttonBehaviours:ic([Uv(function(){return t.disabled||i.isDisabled()}),Lv(),Jy.config({}),dg("button press",[nr("click"),nr("mousedown")])].concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=zt(a,{dom:o});return zt(c,{components:r})},YC=function(t,n,e,o){void 0===o&&(o=[]);var r={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map(function(t){return{"aria-label":e.translate(t),title:e.translate(t)}}).getOr({})},i=t.icon.map(function(t){return DC(t,e.icons)}),u=Jv([i]);return XC(t,n,o,r,u,e)},qC=function(t,n,e,o){void 0===o&&(o=[]);var r=YC(t,st.some(n),e,o);return mp.sketch(r)},KC=function(t,n,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=e.translate(t.text),u=t.icon?t.icon.map(function(t){return DC(t,e.icons)}):st.none(),a=u.isSome()?Jv([u]):[],c=u.isSome()?{}:{innerHtml:i},s=S(t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],t.borderless?["tox-button--naked"]:[],r),l=ut(ut({tag:"button",classes:s},c),{attributes:{title:i}});return XC(t,n,o,l,a,e)},JC=function(t,n,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=KC(t,st.some(n),e,o,r);return mp.sketch(i)},$C=function(n,e){return function(t){"custom"===e?qo(t,ix,{name:n,value:{}}):"submit"===e?Yo(t,ux):"cancel"===e?Yo(t,rx):console.error("Unknown button type: ",e)}},QC=function(n,t,e){if("menu"===t){var o=n,r=ut(ut({},n),{onSetup:function(t){return t.setDisabled(n.disabled),$},fetch:GC(o.items,function(){return i},e)}),i=gp(WC(r,"tox-tbtn",e,st.none()));return i.asSpec()}if("custom"===(c=t)||"cancel"===c||"submit"===c){var u=$C(n.name,t),a=ut(ut({},n),{borderless:!1});return JC(a,u,e.shared.providers,[])}var c;console.error("Unknown footer button type: ",t)},ZC=function(t,n){var e,o,r=$C(t.name,"custom");return e=st.none(),o=Yy.parts.field(ut({factory:mp},KC(t,st.some(r),n,[pk(""),ek()]))),Qy(e,o,[],[])},tO=at([ne("field1Name","field1"),ne("field2Name","field2"),ha("onLockedChange"),da(["lockClass"]),ne("locked",!1),Wl("coupledFieldBehaviours",[td,Nl])]),nO=function(t,n){return vf({factory:Yy,name:t,overrides:function(o){return{fieldBehaviours:ic([dg("coupled-input-behaviour",[er(po(),function(e){Af(e,o,n).bind(td.getCurrent).each(function(n){Af(e,o,"lock").each(function(t){Dg.isOn(t)&&o.onLockedChange(e,n,t)})})})])])}}})},eO=at([nO("field1","field2"),nO("field2","field1"),vf({factory:mp,schema:[Ln("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:ic([Dg.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),oO=qf({name:"FormCoupledInputs",configFields:tO(),partFields:eO(),factory:function(o,t,n,e){return{uid:o.uid,dom:o.dom,components:t,behaviours:Gl(o.coupledFieldBehaviours,[td.config({find:st.some}),Nl.config({store:{mode:"manual",getValue:function(t){var n=Vf(t,o,["field1","field2"]),e={};return e[o.field1Name]=Nl.getValue(n.field1()),e[o.field2Name]=Nl.getValue(n.field2()),e},setValue:function(t,n){var e=Vf(t,o,["field1","field2"]);Rt(n,o.field1Name)&&Nl.setValue(e.field1(),n[o.field1Name]),Rt(n,o.field2Name)&&Nl.setValue(e.field2(),n[o.field2Name])}}})]),apis:{getField1:function(t){return Af(t,o,"field1")},getField2:function(t){return Af(t,o,"field2")},getLock:function(t){return Af(t,o,"lock")}}}},apis:{getField1:function(t,n){return t.getField1(n)},getField2:function(t,n){return t.getField2(n)},getLock:function(t,n){return t.getLock(n)}}}),rO=function(t){var n=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null===n)return mt.error(t);var e=parseFloat(n[1]),o=n[2];return mt.value({value:e,unit:o})},iO=function(t,n){var e={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,"in":1},o=function(t){return Object.prototype.hasOwnProperty.call(e,t)};return t.unit===n?st.some(t.value):o(t.unit)&&o(n)?e[t.unit]===e[n]?st.some(t.value):st.some(t.value/e[t.unit]*e[n]):st.none()},uO=function(t){return st.none()},aO=function(t,n){var e,o,r,i=rO(t).toOptional(),u=rO(n).toOptional();return o=u,r=function(t,o){return iO(t,o.unit).map(function(t){return o.value/t}).map(function(t){return n=t,e=o.unit,function(t){return iO(t,e).map(function(t){return{value:t*n,unit:e}})};var n,e}).getOr(uO)},((e=i).isSome()&&o.isSome()?st.some(r(e.getOrDie(),o.getOrDie())):st.none()).getOr(uO)},cO=function(o,n){var a=uO,r=Kr("ratio-event"),t=oO.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:n.translate(o.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:hp("lock",n.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:hp("unlock",n.icons)}}],buttonBehaviours:ic([gv.config({disabled:function(){return o.disabled||n.isDisabled()}}),Lv(),Jy.config({})])}),e=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},i=function(e){return Yy.parts.field({factory:px,inputClasses:["tox-textfield"],inputBehaviours:ic([gv.config({disabled:function(){return o.disabled||n.isDisabled()}}),Lv(),Jy.config({}),dg("size-input-events",[er(lo(),function(t,n){qo(t,r,{isField1:e})}),er(ho(),function(t,n){qo(t,ex,{name:o.name})})])]),selectOnFocus:!1})},u=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}},c=oO.parts.field1(e([Yy.parts.label(u("Width")),i(!0)])),s=oO.parts.field2(e([Yy.parts.label(u("Height")),i(!1)]));return oO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,e([u(" "),t])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,i,n){rO(Nl.getValue(t)).each(function(t){a(t).each(function(t){var n,e,o,r;Nl.setValue(i,(o={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,"in":4,"%":4},-1!==(r=(n=t).value.toFixed((e=n.unit)in o?o[e]:1)).indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+n.unit))})})},coupledFieldBehaviours:ic([gv.config({disabled:function(){return o.disabled||n.isDisabled()},onDisabled:function(t){oO.getField1(t).bind(Yy.getField).each(gv.disable),oO.getField2(t).bind(Yy.getField).each(gv.disable),oO.getLock(t).each(gv.disable)},onEnabled:function(t){oO.getField1(t).bind(Yy.getField).each(gv.enable),oO.getField2(t).bind(Yy.getField).each(gv.enable),oO.getLock(t).each(gv.enable)}}),Lv(),dg("size-input-events2",[er(r,function(t,n){var e=n.event.isField1,o=e?oO.getField1(t):oO.getField2(t),r=e?oO.getField2(t):oO.getField1(t),i=o.map(Nl.getValue).getOr(""),u=r.map(Nl.getValue).getOr("");a=aO(i,u)})])])})},sO={undo:at(Kr("undo")),redo:at(Kr("redo")),zoom:at(Kr("zoom")),back:at(Kr("back")),apply:at(Kr("apply")),swap:at(Kr("swap")),transform:at(Kr("transform")),tempTransform:at(Kr("temp-transform")),transformApply:at(Kr("transform-apply"))},lO=at("save-state"),fO=at("disable"),dO=at("enable"),mO={formActionEvent:ix,saveState:lO,disable:fO,enable:dO},gO=function(r,c){var t=function(t,n,e,o){return gp(JC({name:t,text:t,disabled:e,primary:o,icon:st.none(),borderless:!1},n,c))},n=function(t,n,e,o){return gp(qC({name:t,icon:st.some(t),tooltip:st.some(n),disabled:o,primary:!1,borderless:!1},e,c))},u=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(gv)&&gv.disable(n)})},a=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(gv)&&gv.enable(n)})},s={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},e=$,i=function(t,n,e){qo(t,n,e)},l=function(t){return Yo(t,mO.disable())},f=function(t){return Yo(t,mO.enable())},d=function(t,n){l(t),i(t,sO.transform(),{transform:n}),f(t)},o=function(t){return function(){J.getOpt(t).each(function(t){fg.set(t,[q])})}},m=function(t,n){l(t),i(t,sO.transformApply(),{transform:n,swap:o(t)}),f(t)},g=function(){return t("Back",function(t){return i(t,sO.back(),{swap:o(t)})},!1,!1)},p=function(){return gp({dom:{tag:"div",classes:["tox-spacer"]},behaviours:ic([gv.config({})])})},h=function(){return t("Apply",function(t){return i(t,sO.apply(),{swap:o(t)})},!0,!0)},v=[g(),p(),t("Apply",function(t){m(t,function(t){var n=r.getRect();return OC(t,n.x,n.y,n.w,n.h)}),r.hideCrop()},!1,!0)],b=Uy.sketch({dom:s,components:v.map(function(t){return t.asSpec()}),containerBehaviours:ic([dg("image-tools-crop-buttons-events",[er(mO.disable(),function(t,n){u(v,t)}),er(mO.enable(),function(t,n){a(v,t)})])])}),y=gp(cO({name:"size",label:st.none(),constrain:!0,disabled:!1},c)),x=[g(),p(),y,p(),t("Apply",function(a){y.getOpt(a).each(function(t){var n,e,o=Nl.getValue(t),r=parseInt(o.width,10),i=parseInt(o.height,10),u=(n=r,e=i,function(t){return _C(t,n,e)});m(a,u)})},!1,!0)],w=Uy.sketch({dom:s,components:x.map(function(t){return t.asSpec()}),containerBehaviours:ic([dg("image-tools-resize-buttons-events",[er(mO.disable(),function(t,n){u(x,t)}),er(mO.enable(),function(t,n){a(x,t)})])])}),S=function(n,e){return function(t){return n(t,e)}},k=S(CC,"h"),C=S(CC,"v"),O=S(TC,-90),_=S(TC,90),T=function(t,n){var e,o;o=n,l(e=t),i(e,sO.tempTransform(),{transform:o}),f(e)},E=[g(),p(),n("flip-horizontally","Flip horizontally",function(t){T(t,k)},!1),n("flip-vertically","Flip vertically",function(t){T(t,C)},!1),n("rotate-left","Rotate counterclockwise",function(t){T(t,O)},!1),n("rotate-right","Rotate clockwise",function(t){T(t,_)},!1),p(),h()],D=Uy.sketch({dom:s,components:E.map(function(t){return t.asSpec()}),containerBehaviours:ic([dg("image-tools-fliprotate-buttons-events",[er(mO.disable(),function(t,n){u(E,t)}),er(mO.enable(),function(t,n){a(E,t)})])])}),B=function(t,n,e,o,r){var i=WS.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:c.translate(t)}}),u=WS.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),a=WS.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return gp(WS.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e,maxX:r,getInitialValue:at({x:o})},components:[i,u,a],sliderBehaviours:ic([vg.config({})]),onChoose:n}))},A=function(t,n,e,o,r){return[g(),(i=n,B(t,function(t,n,e){var o=S(i,e.x/100);d(t,o)},e,o,r)),h()];var i},M=function(t,n,e,o,r){var i=A(t,n,e,o,r);return Uy.sketch({dom:s,components:i.map(function(t){return t.asSpec()}),containerBehaviours:ic([dg("image-tools-filter-panel-buttons-events",[er(mO.disable(),function(t,n){u(i,t)}),er(mO.enable(),function(t,n){a(i,t)})])])})},F=[g(),p(),h()],I=Uy.sketch({dom:s,components:F.map(function(t){return t.asSpec()})}),R=M("Brightness",SC,-100,0,100),V=M("Contrast",kC,-100,0,100),P=M("Gamma",xC,-100,0,100),H=function(t){return B(t,function(l,t,n){var e=z.getOpt(l),o=L.getOpt(l),r=N.getOpt(l);e.each(function(s){o.each(function(c){r.each(function(t){var n,e,o,r=Nl.getValue(s).x/100,i=Nl.getValue(t).x/100,u=Nl.getValue(c).x/100,a=(n=r,e=i,o=u,function(t){return wC(t,n,e,o)});d(l,a)})})})},0,100,200)},z=H("R"),N=H("G"),L=H("B"),j=[g(),z,N,L,h()],U=Uy.sketch({dom:s,components:j.map(function(t){return t.asSpec()})}),W=function(n,e,o){return function(t){i(t,sO.swap(),{transform:e,swap:function(){J.getOpt(t).each(function(t){fg.set(t,[n]),o(t)})}})}},G=st.some(yC),X=st.some(bC),Y=[n("crop","Crop",W(b,st.none(),function(t){r.showCrop()}),!1),n("resize","Resize",W(w,st.none(),function(t){y.getOpt(t).each(function(t){var n=r.getMeasurements(),e=n.width,o=n.height;Nl.setValue(t,{width:e,height:o})})}),!1),n("orientation","Orientation",W(D,st.none(),e),!1),n("brightness","Brightness",W(R,st.none(),e),!1),n("sharpen","Sharpen",W(I,G,e),!1),n("contrast","Contrast",W(V,st.none(),e),!1),n("color-levels","Color levels",W(U,st.none(),e),!1),n("gamma","Gamma",W(P,st.none(),e),!1),n("invert","Invert",W(I,X,e),!1)],q=Uy.sketch({dom:s,components:Y.map(function(t){return t.asSpec()})}),K=Uy.sketch({dom:{tag:"div"},components:[q],containerBehaviours:ic([fg.config({})])}),J=gp(K);return{memContainer:J,getApplyButton:function(t){return J.getOpt(t).map(function(t){var n=t.components()[0];return n.components()[n.components().length-1]})}}},pO=tinymce.util.Tools.resolve("tinymce.geom.Rect"),hO=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),vO=tinymce.util.Tools.resolve("tinymce.util.Observable"),bO=tinymce.util.Tools.resolve("tinymce.util.VK");function yO(t){var n,e;if(t.changedTouches)for(n="screenX screenY pageX pageY clientX clientY".split(" "),e=0;e<n.length;e++)t[n[e]]=t.changedTouches[0][n[e]]}function xO(t,m){var g,p,h,v,b=m.document||document,y=b.getElementById(m.handle||t),x=function(t){if(yO(t),t.button!==p)return w(t);t.deltaX=t.screenX-h,t.deltaY=t.screenY-v,t.preventDefault(),m.drag(t)},w=function(t){yO(t),hO(b).off("mousemove touchmove",x).off("mouseup touchend",w),g.remove(),m.stop&&m.stop(t)};this.destroy=function(){hO(y).off()},hO(y).on("mousedown touchstart",function(t){var n,e,o,r,i,u,a,c,s,l,f=(n=b,e=Math.max,o=n.documentElement,r=n.body,i=e(o.scrollWidth,r.scrollWidth),u=e(o.clientWidth,r.clientWidth),a=e(o.offsetWidth,r.offsetWidth),c=e(o.scrollHeight,r.scrollHeight),s=e(o.clientHeight,r.clientHeight),{width:i<a?u:i,height:c<e(o.offsetHeight,r.offsetHeight)?s:c});yO(t),t.preventDefault(),p=t.button;var d=y;h=t.screenX,v=t.screenY,l=window.getComputedStyle?window.getComputedStyle(d,null).getPropertyValue("cursor"):d.runtimeStyle.cursor,g=hO("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(b.body),hO(b).on("mousemove touchmove",x).on("mouseup touchend",w),m.start(t)})}var wO=0,SO=function(s,e,l,o,r){var t,n="tox-",u="tox-crid-"+wO++,a=[{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"],c=function(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}},f=function(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}};function d(t,n,e,o){var r,i=n.x,u=n.y,a=n.w,c=n.h;i+=e*t.deltaX,u+=o*t.deltaY,(a+=e*t.deltaW)<20&&(a=20),(c+=o*t.deltaH)<20&&(c=20),r=s=pO.clamp({x:i,y:u,w:a,h:c},l,"move"===t.name),r=f(l,r),h.fire("updateRect",{rect:r}),p(r)}function m(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),hO("#"+u+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}ck.each(a,function(t){hO("#"+u+"-"+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 g(t){m(s=t)}function p(t){g(c(l,t))}hO('<div id="'+u+'" class="'+n+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),ck.each(i,function(t){hO("#"+u,o).append('<div id="'+u+"-"+t+'"class="'+n+'croprect-block" style="display: none" data-mce-bogus="all">')}),ck.each(a,function(t){hO("#"+u,o).append('<div id="'+u+"-"+t.name+'" class="'+n+"croprect-handle "+n+"croprect-handle-"+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')}),t=ck.map(a,function(n){var e;return new xO(u,{document:o.ownerDocument,handle:u+"-"+n.name,start:function(){e=s},drag:function(t){d(n,e,t.deltaX,t.deltaY)}})}),m(s),hO(o).on("focusin focusout",function(t){hO(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")}),hO(o).on("keydown",function(n){var i;function t(t,n,e,o,r){t.stopPropagation(),t.preventDefault(),d(i,e,o,r)}switch(ck.each(a,function(t){if(n.target.id===u+"-"+t.name)return i=t,!1}),n.keyCode){case bO.LEFT:t(n,0,s,-10,0);break;case bO.RIGHT:t(n,0,s,10,0);break;case bO.UP:t(n,0,s,0,-10);break;case bO.DOWN:t(n,0,s,0,10);break;case bO.ENTER:case bO.SPACEBAR:n.preventDefault(),r()}});var h=ck.extend({toggleVisibility:function(t){var n=ck.map(a,function(t){return"#"+u+"-"+t.name}).concat(ck.map(i,function(t){return"#"+u+"-"+t})).join(",");t?hO(n,o).show():hO(n,o).hide()},setClampRect:function(t){l=t,m(s)},setRect:g,getInnerRect:function(){return f(l,s)},setInnerRect:p,setViewPortRect:function(t){e=t,m(s)},destroy:function(){ck.each(t,function(t){t.destroy()}),t=[]}},vO);return h},kO=function(n){var l=gp({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),f=fe(1),d=fe(st.none()),m=fe({x:0,y:0,w:1,h:1}),c=fe({x:0,y:0,w:1,h:1}),s=function(t,s){g.getOpt(t).each(function(t){var e=f.get(),o=_u(t.element),r=bu(t.element),i=s.dom.naturalWidth*e,u=s.dom.naturalHeight*e,a=Math.max(0,o/2-i/2),c=Math.max(0,r/2-u/2),n={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};Ki(s,n),l.getOpt(t).each(function(t){Ki(t.element,n)}),d.get().each(function(t){var n=m.get();t.setRect({x:n.x*e+a,y:n.y*e+c,w:n.w*e,h:n.h*e}),t.setClampRect({x:a,y:c,w:i,h:u}),t.setViewPortRect({x:0,y:0,w:o,h:r})})})},e=function(t,n){var e,a=me.fromTag("img");return zr(a,"src",n),e=a.dom,new Fp(function(t){var n=function(){e.removeEventListener("load",n),t(e)};e.complete?t(e):e.addEventListener("load",n)}).then(function(){return g.getOpt(t).map(function(t){var n=du({element:a});fg.replaceAt(t,1,st.some(n));var e=c.get(),o={x:0,y:0,w:a.dom.naturalWidth,h:a.dom.naturalHeight};c.set(o);var r,u,i=pO.inflate(o,-20,-20);return m.set(i),e.w===o.w&&e.h===o.h||(r=t,u=a,g.getOpt(r).each(function(t){var n=_u(t.element),e=bu(t.element),o=u.dom.naturalWidth,r=u.dom.naturalHeight,i=Math.min(n/o,e/r);1<=i?f.set(1):f.set(i)})),s(t,a),a})})},t=Uy.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[l.asSpec(),{dom:{tag:"img",attributes:{src:n}}},{dom:{tag:"div"},behaviours:ic([dg("image-panel-crop-events",[sr(function(t){g.getOpt(t).each(function(t){var n=t.element.dom,e=SO({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},n,function(){});e.toggleVisibility(!1),e.on("updateRect",function(t){var n=t.rect,e=f.get(),o={x:Math.round(n.x/e),y:Math.round(n.y/e),w:Math.round(n.w/e),h:Math.round(n.h/e)};m.set(o)}),d.set(st.some(e))})})])])}],containerBehaviours:ic([fg.config({}),dg("image-panel-events",[sr(function(t){e(t,n)})])])}),g=gp(t);return{memContainer:g,updateSrc:e,zoom:function(t,n){var e=f.get(),o=0<n?Math.min(2,e+.1):Math.max(.1,e-.1);f.set(o),g.getOpt(t).each(function(t){var n=t.components()[1].element;s(t,n)})},showCrop:function(){d.get().each(function(t){t.toggleVisibility(!0)})},hideCrop:function(){d.get().each(function(t){t.toggleVisibility(!1)})},getRect:function(){return m.get()},getMeasurements:function(){var t=c.get();return{width:t.w,height:t.h}}}},CO=function(t,n,e,o,r){return qC({name:t,icon:st.some(n),disabled:e,tooltip:st.some(t),primary:!1,borderless:!1},o,r)},OO=function(t,n){n?gv.enable(t):gv.disable(t)};function _O(){var e=[],o=-1;function t(){return 0<o}function n(){return-1!==o&&o<e.length-1}return{data:e,add:function(t){var n=e.splice(++o);return e.push(t),{state:t,removed:n}},undo:function(){if(t())return e[--o]},redo:function(){if(n())return e[++o]},canUndo:t,canRedo:n}}var TO,EO,DO,BO=function(t){var n=fe(t),e=fe(st.none()),r=_O();r.add(t);var i=function(t){n.set(t)},u=function(t){return{blob:t,url:URL.createObjectURL(t)}},a=function(t){URL.revokeObjectURL(t.url)},o=function(){e.get().each(a),e.set(st.none())},c=function(t){var n=u(t);i(n);var e,o=r.add(n).removed;return e=o,ck.each(e,a),n.url};return{getBlobState:function(){return n.get()},setBlobState:i,addBlobState:c,getTempState:function(){return e.get().fold(function(){return n.get()},function(t){return t})},updateTempState:function(t){var n=u(t);return o(),e.set(st.some(n)),n.url},addTempState:function(t){var n=u(t);return e.set(st.some(n)),n.url},applyTempState:function(n){return e.get().fold(function(){},function(t){c(t.blob),n()})},destroyTempState:o,undo:function(){var t=r.undo();return i(t),t.url},redo:function(){var t=r.redo();return i(t),t.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}},AO=function(t,n){var e,o,r,u=BO(t.currentState),i=function(t){var n=u.getHistoryStates();p.updateButtonUndoStates(t,n.undoEnabled,n.redoEnabled),qo(t,mO.formActionEvent,{name:mO.saveState(),value:n.undoEnabled})},a=function(t){return t.toBlob()},c=function(t){qo(t,mO.formActionEvent,{name:mO.disable(),value:{}})},s=function(t){h.getApplyButton(t).each(function(t){gv.enable(t)}),qo(t,mO.formActionEvent,{name:mO.enable(),value:{}})},l=function(t,n){return c(t),g.updateSrc(t,n)},f=function(n,t,e,o,r){return c(n),Jk(t).then(e).then(a).then(o).then(function(t){return l(n,t).then(function(t){return i(n),r(),s(n),t})})["catch"](function(t){return console.log(t),s(n),t})},d=function(t,n,e){var o=u.getBlobState().blob;f(t,o,n,function(t){return u.updateTempState(t)},e)},m=function(t){var n=u.getBlobState().url;return u.destroyTempState(),i(t),n},g=kO(t.currentState.url),p=(o=gp(CO("Undo","undo",!0,function(t){qo(t,sO.undo(),{direction:1})},e=n)),r=gp(CO("Redo","redo",!0,function(t){qo(t,sO.redo(),{direction:1})},e)),{container:Uy.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),r.asSpec(),CO("Zoom in","zoom-in",!1,function(t){qo(t,sO.zoom(),{direction:1})},e),CO("Zoom out","zoom-out",!1,function(t){qo(t,sO.zoom(),{direction:-1})},e)]}),updateButtonUndoStates:function(t,n,e){o.getOpt(t).each(function(t){OO(t,n)}),r.getOpt(t).each(function(t){OO(t,e)})}}),h=gO(g,n);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[h.memContainer.asSpec(),g.memContainer.asSpec(),p.container],behaviours:ic([Nl.config({store:{mode:"manual",getValue:function(){return u.getBlobState()}}}),dg("image-tools-events",[er(sO.undo(),function(n,t){var e=u.undo();l(n,e).then(function(t){s(n),i(n)})}),er(sO.redo(),function(n,t){var e=u.redo();l(n,e).then(function(t){s(n),i(n)})}),er(sO.zoom(),function(t,n){var e=n.event.direction;g.zoom(t,e)}),er(sO.back(),function(t,n){var e,o;o=m(e=t),l(e,o).then(function(t){s(e)}),(0,n.event.swap)(),g.hideCrop()}),er(sO.apply(),function(t,n){u.applyTempState(function(){m(t),(0,n.event.swap)()})}),er(sO.transform(),function(t,n){return d(t,n.event.transform,$)}),er(sO.tempTransform(),function(t,n){return e=t,o=n.event.transform,r=u.getTempState().blob,void f(e,r,o,function(t){return u.addTempState(t)},$);var e,o,r}),er(sO.transformApply(),function(t,n){return e=t,o=n.event.transform,r=n.event.swap,i=u.getBlobState().blob,void f(e,i,o,function(t){var n=u.addBlobState(t);return m(e),n},r);var e,o,r,i}),er(sO.swap(),function(n,t){var e;e=n,p.updateButtonUndoStates(e,!1,!1);var o=t.event.transform,r=t.event.swap;o.fold(function(){r()},function(t){d(n,t,r)})})]),ek()])}},MO=function(t){return!It(t,"items")},FO="data-value",IO=function(n,e,t,o){return V(t,function(t){return MO(t)?{type:"togglemenuitem",text:t.text,value:t.value,active:t.value===o,onAction:function(){Nl.setValue(n,t.value),qo(n,ex,{name:e}),vg.focus(n)}}:{type:"nestedmenuitem",text:t.text,getSubmenuItems:function(){return IO(n,e,t.items,o)}}})},RO=function(t,n){return Z(t,function(t){return MO(t)?Jf(t.value===n,t):RO(t.items,n)})},VO=Yf({name:"HtmlSelect",configFields:[Ln("options"),Ll("selectBehaviours",[vg,Nl]),ne("selectClasses",[]),ne("selectAttributes",{}),Kn("data")],factory:function(e,t){var n=V(e.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),o=e.data.map(function(t){return Jt("initialValue",t)}).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:n,behaviours:Ul(e.selectBehaviours,[vg.config({}),Nl.config({store:ut({mode:"manual",getValue:function(t){return ou(t.element)},setValue:function(t,n){L(e.options,function(t){return t.value===n}).isSome()&&ru(t.element,n)}},o)})])}}}),PO=function(e,n){var t=e.label.map(function(t){return nx(t,n)}),o=[gv.config({disabled:function(){return e.disabled||n.isDisabled()}}),Lv(),ug.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:function(t){return Yo(t,ux),st.some(!0)}}),dg("textfield-change",[er(po(),function(t,n){qo(t,ex,{name:e.name})}),er(Co(),function(t,n){qo(t,ex,{name:e.name})})]),Jy.config({})],r=e.validation.map(function(o){return Vx.config({getRoot:function(t){return kr(t.element)},invalidClass:"tox-invalid",validator:{validate:function(t){var n=Nl.getValue(t),e=o.validator(n);return _x(!0===e?mt.value(n):mt.error(e))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=e.placeholder.fold(at({}),function(t){return{placeholder:n.translate(t)}}),u=e.inputMode.fold(at({}),function(t){return{inputmode:t}}),a=ut(ut({},i),u),c=Yy.parts.field({tag:!0===e.multiline?"textarea":"input",inputAttributes:a,inputClasses:[e.classname],inputBehaviours:ic(dt([o,r])),selectOnFocus:!1,factory:px}),s=(e.flex?["tox-form__group--stretched"]:[]).concat(e.maximized?["tox-form-group--maximize"]:[]),l=[gv.config({disabled:function(){return e.disabled||n.isDisabled()},onDisabled:function(t){Yy.getField(t).each(gv.disable)},onEnabled:function(t){Yy.getField(t).each(gv.enable)}}),Lv()];return Qy(t,c,s,l)},HO=/* */Object.freeze({__proto__:null,events:function(t,n){var e=t.stream.streams.setup(t,n);return Zo([er(t.event,e),lr(function(){return n.cancel()})].concat(t.cancelEvent.map(function(t){return[er(t,function(){return n.cancel()})]}).getOr([])))}}),zO=function(t){var n=fe(null);return di({readState:function(){return{timer:null!==n.get()?"set":"unset"}},setTimer:function(t){n.set(t)},cancel:function(){var t=n.get();null!==t&&t.cancel()}})},NO=/* */Object.freeze({__proto__:null,throttle:zO,init:function(t){return t.stream.streams.state(t)}}),LO=[jn("stream",An("mode",{throttle:[Ln("delay"),ne("stopEvent",!0),ba("streams",{setup:function(t,n){var e=t.stream,o=Sp(t.onStream,e.delay);return n.setTimer(o),function(t,n){o.throttle(t,n),e.stopEvent&&n.stop()}},state:zO})]})),ne("event","input"),Kn("cancelEvent"),ha("onStream")],jO=ac({fields:LO,name:"streaming",active:HO,state:NO}),UO=function(t,n,e){var o=Nl.getValue(e);Nl.setValue(n,o),GO(n)},WO=function(t,n){var e=t.element,o=ou(e),r=e.dom;"number"!==Nr(e,"type")&&n(r,o)},GO=function(t){WO(t,function(t,n){return t.setSelectionRange(n.length,n.length)})},XO=function(t,n,o){if(t.selectsOver){var e=Nl.getValue(n),r=t.getDisplayText(e),i=Nl.getValue(o);return 0===t.getDisplayText(i).indexOf(r)?st.some(function(){var t,e;UO(0,n,o),t=n,e=r.length,WO(t,function(t,n){return t.setSelectionRange(e,n.length)})}):st.none()}return st.none()},YO=at("alloy.typeahead.itemexecute"),qO=at([Kn("lazySink"),Ln("fetch"),ne("minChars",5),ne("responseTime",1e3),ga("onOpen"),ne("getHotspot",st.some),ne("getAnchorOverrides",at({})),ne("layouts",st.none()),ne("eventOrder",{}),se("model",{},[ne("getDisplayText",function(t){return t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.value}),ne("selectsOver",!0),ne("populateFromBrowse",!0)]),ga("onSetValue"),pa("onExecute"),ga("onItemExecute"),ne("inputClasses",[]),ne("inputAttributes",{}),ne("inputStyles",{}),ne("matchWidth",!0),ne("useMinWidth",!1),ne("dismissOnBlur",!0),da(["openClass"]),Kn("initialData"),Ll("typeaheadBehaviours",[vg,Nl,jO,ug,Dg,zx]),le("previewing",function(){return fe(!0)})].concat(dx()).concat($x())),KO=at([bf({schema:[fa()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(n,e){o.previewing.get()?n.getSystem().getByUid(o.uid).each(function(t){XO(o.model,t,e).fold(function(){return fd.dehighlight(n,e)},function(t){return t()})}):n.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&UO(o.model,t,e)}),o.previewing.set(!1)},onExecute:function(t,n){return t.getSystem().getByUid(o.uid).toOptional().map(function(t){return qo(t,YO(),{item:n}),!0})},onHover:function(t,n){o.previewing.set(!1),t.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&UO(o.model,t,n)})}}}})]),JO=qf({name:"Typeahead",configFields:qO(),partFields:KO(),factory:function(r,t,n,i){var e=function(t,n,e){r.previewing.set(!1);var o=zx.getCoupled(t,"sandbox");xl.isOpen(o)?td.getCurrent(o).each(function(t){fd.getHighlighted(t).fold(function(){e(t)},function(){Qo(o,t.element,"keydown",n)})}):Ux(r,u(t),t,o,i,function(t){td.getCurrent(t).each(e)},bx.HighlightFirst).get($)},o=mx(r),u=function(o){return function(t){return t.map(function(t){var n=Mt(t.menus),e=U(n,function(t){return H(t.items,function(t){return"item"===t.type})});return Nl.getState(o).update(V(e,function(t){return t.data})),t})}},a=[vg.config({}),Nl.config({onSetValue:r.onSetValue,store:ut({mode:"dataset",getDataKey:function(t){return ou(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,n){ru(t.element,r.model.getDisplayText(n))}},r.initialData.map(function(t){return Jt("initialValue",t)}).getOr({}))}),jO.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(t,n){var e,o=zx.getCoupled(t,"sandbox");vg.isFocused(t)&&ou(t.element).length>=r.minChars&&(e=td.getCurrent(o).bind(function(t){return fd.getHighlighted(t).map(Nl.getValue)}),r.previewing.set(!0),Ux(r,u(t),t,o,i,function(t){td.getCurrent(o).each(function(t){e.fold(function(){r.model.selectsOver&&fd.highlightFirst(t)},function(n){fd.highlightBy(t,function(t){return Nl.getValue(t).value===n.value}),fd.getHighlighted(t).orThunk(function(){return fd.highlightFirst(t),st.none()})})})},bx.HighlightFirst).get($))},cancelEvent:Ao()}),ug.config({mode:"special",onDown:function(t,n){return e(t,n,fd.highlightFirst),st.some(!0)},onEscape:function(t){var n=zx.getCoupled(t,"sandbox");return xl.isOpen(n)?(xl.close(n),st.some(!0)):st.none()},onUp:function(t,n){return e(t,n,fd.highlightLast),st.some(!0)},onEnter:function(n){var t=zx.getCoupled(n,"sandbox"),e=xl.isOpen(t);if(e&&!r.previewing.get())return td.getCurrent(t).bind(function(t){return fd.getHighlighted(t)}).map(function(t){return qo(n,YO(),{item:t}),!0});var o=Nl.getValue(n);return Yo(n,Ao()),r.onExecute(t,n,o),e&&xl.close(t),st.some(!0)}}),Dg.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),zx.config({others:{sandbox:function(t){return Kx(r,t,{onOpen:function(){return Dg.on(t)},onClose:function(){return Dg.off(t)}})}}}),dg("typeaheadevents",[dr(function(t){var n=$;Gx(r,u(t),t,i,n,bx.HighlightFirst).get($)}),er(YO(),function(t,n){var e=zx.getCoupled(t,"sandbox");UO(r.model,t,n.event.item),Yo(t,Ao()),r.onItemExecute(t,e,n.event.item,Nl.getValue(t)),xl.close(e),GO(t)})].concat(r.dismissOnBlur?[er(ko(),function(t){var n=zx.getCoupled(t,"sandbox");pc(n.element).isNone()&&xl.close(n)})]:[]))];return{uid:r.uid,dom:gx(zt(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:ut(ut({},o),Ul(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),$O=function(i){return ut(ut({},i),{toCached:function(){return $O(i.toCached())},bindFuture:function(n){return $O(i.bind(function(t){return t.fold(function(t){return _x(mt.error(t))},function(t){return n(t)})}))},bindResult:function(n){return $O(i.map(function(t){return t.bind(n)}))},mapResult:function(n){return $O(i.map(function(t){return t.map(n)}))},mapError:function(n){return $O(i.map(function(t){return t.mapError(n)}))},foldResult:function(n,e){return i.map(function(t){return t.fold(n,e)})},withTimeout:function(t,r){return $O(Ox(function(n){var e=!1,o=setTimeout(function(){e=!0,n(mt.error(r()))},t);i.get(function(t){e||(clearTimeout(o),n(t))})}))}})},QO=function(t){return $O(Ox(t))},ZO=QO,t_={type:"separator"},n_=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},e_=function(t,n){return{type:"menuitem",value:n,text:t,meta:{attach:undefined},onAction:function(){}}},o_=function(t,n){return o=t,e=H(n,function(t){return t.type===o}),V(e,n_);var e,o},r_=function(t,n){var e=t.toLowerCase();return H(n,function(t){var n=t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.text;return we(n.toLowerCase(),e)||we(t.value.toLowerCase(),e)})},i_=function(u,t,a){var n=Nl.getValue(t),c=n.meta.text!==undefined?n.meta.text:n.value;return a.getLinkInformation().fold(function(){return[]},function(t){var n,e,o,r,i=r_(c,(n=a.getHistory(u),V(n,function(t){return e_(t,t)})));return"file"===u?(e=[i,r_(c,o_("header",t.targets)),r_(c,dt([(r=t,st.from(r.anchorTop).map(function(t){return e_("<top>",t)}).toArray()),o_("anchor",t.targets),(o=t,st.from(o.anchorBottom).map(function(t){return e_("<bottom>",t)}).toArray())]))],N(e,function(t,n){return 0===t.length||0===n.length?t.concat(n):t.concat(t_,n)},[])):i})},u_=Kr("aria-invalid"),a_=function(r,o,i){var t,n,e,u,a,c=o.shared.providers,s=function(t){var n=Nl.getValue(t);i.addToHistory(n.value,r.filetype)},l=Yy.parts.field({factory:JO,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":u_,type:"url"},minChars:0,responseTime:0,fetch:function(t){var n=i_(r.filetype,t,i),e=jC(n,uh.BUBBLE_TO_SANDBOX,o,!1);return _x(e)},getHotspot:function(t){return h.getOpt(t)},onSetValue:function(t,n){t.hasConfigured(Vx)&&Vx.run(t).get($)},typeaheadBehaviours:ic(dt([i.getValidationHandler().map(function(e){return Vx.config({getRoot:function(t){return kr(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,n){d.getOpt(t).each(function(t){zr(t.element,"title",c.translate(n))})}},validator:{validate:function(t){var n=Nl.getValue(t);return ZO(function(o){e({type:r.filetype,url:n.value},function(t){var n,e;"invalid"===t.status?(n=mt.error(t.message),o(n)):(e=mt.value(t.message),o(e))})})},validateOnLoad:!1}})}).toArray(),[gv.config({disabled:function(){return r.disabled||c.isDisabled()}}),Jy.config({}),dg("urlinput-events",dt(["file"===r.filetype?[er(po(),function(t){qo(t,ex,{name:r.name})})]:[],[er(ho(),function(t){qo(t,ex,{name:r.name}),s(t)}),er(Co(),function(t){qo(t,ex,{name:r.name}),s(t)})]]))]])),eventOrder:((t={})[po()]=["streaming","urlinput-events","invalidating"],t),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:o.shared.getSink,parts:{menu:wh(0,0,"normal")},onExecute:function(t,n,e){qo(n,ux,{})},onItemExecute:function(t,n,e,o){s(t),qo(t,ex,{name:r.name})}}),f=r.label.map(function(t){return nx(t,c)}),d=gp((n="invalid",e=st.some(u_),void 0===(u="warning")&&(u=n),void 0===a&&(a=n),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+n],innerHtml:hp(u,c.icons),attributes:ut({title:c.translate(a),"aria-live":"polite"},e.fold(function(){return{}},function(t){return{id:t}}))}})),m=gp({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[d.asSpec()]}),g=i.getUrlPicker(r.filetype),p=Kr("browser.url.event"),h=gp({dom:{tag:"div",classes:["tox-control-wrap"]},components:[l,m.asSpec()],behaviours:ic([gv.config({disabled:function(){return r.disabled||c.isDisabled()}})])}),v=gp(JC({name:r.name,icon:st.some("browse"),text:r.label.getOr(""),disabled:r.disabled,primary:!1,borderless:!0},function(t){return Yo(t,p)},c,[],["tox-browse-url"]));return Yy.sketch({dom:tx([]),components:f.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:dt([[h.asSpec()],g.map(function(){return v.asSpec()}).toArray()])}]),fieldBehaviours:ic([gv.config({disabled:function(){return r.disabled||c.isDisabled()},onDisabled:function(t){Yy.getField(t).each(gv.disable),v.getOpt(t).each(gv.disable)},onEnabled:function(t){Yy.getField(t).each(gv.enable),v.getOpt(t).each(gv.enable)}}),Lv(),dg("url-input-events",[er(p,function(o){td.getCurrent(o).each(function(n){var t=Nl.getValue(n),e=ut({fieldname:r.name},t);g.each(function(t){t(e).get(function(t){Nl.setValue(n,t),qo(o,ex,{name:r.name})})})})})])])})},c_=function(r){return function(n,e,o){return Ft(e,"name").fold(function(){return r(e,o)},function(t){return n.field(t,r(e,o))})}},s_={bar:c_(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:V(e.items,o.interpreter)};var e,o}),collection:c_(function(t,n){return fx(t,n.shared.providers)}),alertbanner:c_(function(t,n){return e=t,o=n.shared.providers,Uy.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+e.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[mp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:hp(e.icon,o.icons),attributes:{title:o.translate(e.iconTooltip)}},action:function(t){qo(t,ix,{name:"alert-banner",value:e.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:o.translate(e.text)}}]});var e,o}),input:c_(function(t,n){return e=t,o=n.shared.providers,PO({name:e.name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:e.disabled,classname:"tox-textfield",validation:st.none(),maximized:e.maximized},o);var e,o}),textarea:c_(function(t,n){return e=t,o=n.shared.providers,PO({name:e.name,multiline:!0,label:e.label,inputMode:st.none(),placeholder:e.placeholder,flex:!0,disabled:e.disabled,classname:"tox-textarea",validation:st.none(),maximized:e.maximized},o);var e,o}),label:c_(function(t,n){return e=t,o=n.shared,r={dom:{tag:"label",innerHtml:o.providers.translate(e.label),classes:["tox-label"]}},i=V(e.items,o.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[r].concat(i),behaviours:ic([ek(),fg.config({}),gk(st.none()),ug.config({mode:"acyclic"})])};var e,o,r,i}),iframe:(TO=function(t,n){return Ok(t,n.shared.providers)},function(t,n,e){var o=zt(n,{source:"dynamic"});return c_(TO)(t,o,e)}),button:c_(function(t,n){return ZC(t,n.shared.providers)}),checkbox:c_(function(t,n){return e=t,o=n.shared.providers,r=Nl.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,n){t.element.dom.checked=n}}}),i=function(t){return t.element.dom.click(),st.some(!0)},u=Yy.parts.field({factory:{sketch:ct},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ic([ek(),gv.config({disabled:function(){return e.disabled||o.isDisabled()}}),Jy.config({}),vg.config({}),r,ug.config({mode:"special",onEnter:i,onSpace:i,stopSpaceKeyup:!0}),dg("checkbox-events",[er(ho(),function(t,n){qo(t,ex,{name:e.name})})])])}),a=Yy.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:o.translate(e.label)},behaviours:ic([nw.config({})])}),s=gp({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[(c=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:hp("checked"===t?"selected":"unselected",o.icons)}}})("checked"),c("unchecked")]}),Yy.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[u,s.asSpec(),a],fieldBehaviours:ic([gv.config({disabled:function(){return e.disabled||o.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){Yy.getField(t).each(gv.disable)},onEnabled:function(t){Yy.getField(t).each(gv.enable)}}),Lv()])});var e,o,r,i,u,a,c,s}),colorinput:c_(function(t,n){return iw(t,n.shared,n.colorinput)}),colorpicker:c_(function(t){var n=function(t){return"tox-"+t},e=nk(uk,n),r=gp(e.sketch({dom:{tag:"div",classes:["tox-color-picker-container"],attributes:{role:"presentation"}},onValidHex:function(t){qo(t,ix,{name:"hex-valid",value:!0})},onInvalidHex:function(t){qo(t,ix,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:ic([Nl.config({store:{mode:"manual",getValue:function(t){var n=r.get(t);return td.getCurrent(n).bind(function(t){return Nl.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,n){var e=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n),o=r.get(t);td.getCurrent(o).fold(function(){console.log("Can not find form")},function(t){Nl.setValue(t,{hex:st.from(e[1]).getOr("")}),qS.getField(t,"hex").each(function(t){Yo(t,po())})})}}}),ek()])}}),dropzone:c_(function(t,n){return hk(t,n.shared.providers)}),grid:c_(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+e.columns+"col"]},components:V(e.items,o.interpreter)};var e,o}),listbox:c_(function(t,n){return o=t,e=(r=n).shared.providers,i=K(o.items).filter(MO),u=o.label.map(function(t){return nx(t,e)}),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[Yy.parts.field({dom:{},factory:{sketch:function(t){return VC({uid:t.uid,text:i.map(function(t){return t.text}),icon:st.none(),tooltip:o.label,role:st.none(),fetch:function(t,n){var e=IO(t,o.name,o.items,Nl.getValue(t));n(jC(e,uh.CLOSE_ON_EXECUTE,r,!1))},onSetup:at($),getApi:at({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Jy.config({}),Nl.config({store:{mode:"manual",initialValue:i.map(function(t){return t.value}).getOr(""),getValue:function(t){return Nr(t.element,FO)},setValue:function(n,t){RO(o.items,t).each(function(t){zr(n.element,FO,t.value),qo(n,IC,{text:t.text})})}}})]},"tox-listbox",r.shared)}}})]},Yy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:dt([u.toArray(),[a]]),fieldBehaviours:ic([gv.config({disabled:at(o.disabled),onDisabled:function(t){Yy.getField(t).each(gv.disable)},onEnabled:function(t){Yy.getField(t).each(gv.enable)}})])});var o,r,e,i,u,a}),selectbox:c_(function(t,n){return e=t,o=n.shared.providers,r=V(e.items,function(t){return{text:o.translate(t.text),value:t.value}}),i=e.label.map(function(t){return nx(t,o)}),u=Yy.parts.field({dom:{},selectAttributes:{size:e.size},options:r,factory:VO,selectBehaviours:ic([gv.config({disabled:function(){return e.disabled||o.isDisabled()}}),Jy.config({}),dg("selectbox-change",[er(ho(),function(t,n){qo(t,ex,{name:e.name})})])])}),a=1<e.size?st.none():st.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:hp("chevron-down",o.icons)}}),c={dom:{tag:"div",classes:["tox-selectfield"]},components:dt([[u],a.toArray()])},Yy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:dt([i.toArray(),[c]]),fieldBehaviours:ic([gv.config({disabled:function(){return e.disabled||o.isDisabled()},onDisabled:function(t){Yy.getField(t).each(gv.disable)},onEnabled:function(t){Yy.getField(t).each(gv.enable)}}),Lv()])});var e,o,r,i,u,a,c}),sizeinput:c_(function(t,n){return cO(t,n.shared.providers)}),urlinput:c_(function(t,n){return a_(t,n,n.urlinput)}),customeditor:c_(function(e){var o=fe(st.none()),n=gp({dom:{tag:e.tag}}),r=fe(st.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ic([dg("custom-editor-events",[sr(function(t){n.getOpt(t).each(function(n){var t;t=e,(Object.prototype.hasOwnProperty.call(t,"init")?e.init(n.element.dom):ak.load(e.scriptId,e.scriptUrl).then(function(t){return t(n.element.dom,e.settings)})).then(function(n){r.get().each(function(t){n.setValue(t)}),r.set(st.none()),o.set(st.some(n))})})})]),Nl.config({store:{mode:"manual",getValue:function(){return o.get().fold(function(){return r.get().getOr("")},function(t){return t.getValue()})},setValue:function(t,n){o.get().fold(function(){r.set(st.some(n))},function(t){return t.setValue(n)})}}}),ek()]),components:[n.asSpec()]}}),htmlpanel:c_(function(t){return"presentation"===t.presets?Uy.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):Uy.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:ic([Jy.config({}),vg.config({})])})}),imagetools:c_(function(t,n){return AO(t,n.shared.providers)}),table:c_(function(t,n){return e=t,o=n.shared.providers,u=function(t){return{dom:{tag:"th",innerHtml:o.translate(t)}}},a=function(t){return{dom:{tag:"td",innerHtml:o.translate(t)}}},c=function(t){return{dom:{tag:"tr"},components:V(t,a)}},{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(i=e.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:V(i,u)}]}),(r=e.cells,{dom:{tag:"tbody"},components:V(r,c)})],behaviours:ic([Jy.config({}),vg.config({})])};var e,o,r,i,u,a,c}),panel:c_(function(t,n){return o=n,{dom:{tag:"div",classes:(e=t).classes},components:V(e.items,o.shared.interpreter)};var e,o})},l_={field:function(t,n){return n}},f_=function(n,t,e){var o=zt(e,{shared:{interpreter:function(t){return d_(n,t,o)}}});return d_(n,t,o)},d_=function(n,e,o){return Ft(s_,e.type).fold(function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e},function(t){return t(n,e,o)})},m_={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},g_=function(t,n,e){var o=Hc(-12,12,m_),r={maxHeightFunction:Fc()};return function(){return e()?{anchor:"node",root:zi(t()),node:st.from(t()),bubble:o,layouts:{onRtl:function(){return[sp]},onLtr:function(){return[cp]}},overrides:r}:{anchor:"hotspot",hotspot:n(),bubble:o,layouts:{onRtl:function(){return[Ha]},onLtr:function(){return[za]}},overrides:r}}},p_=function(t,n,e){return function(){return e()?{anchor:"node",root:zi(t()),node:st.from(t()),layouts:{onRtl:function(){return[lp]},onLtr:function(){return[lp]}}}:{anchor:"hotspot",hotspot:n(),layouts:{onRtl:function(){return[Ua]},onLtr:function(){return[Ua]}}}}},h_=function(t,n,e){var o,r,i,u=Fv(t),a=function(){return me.fromDom(t.getBody())},c=function(){return me.fromDom(t.getContentAreaContainer())},s=function(){return u||!e()};return{inlineDialog:g_(c,n,s),banner:p_(c,n,s),cursor:(r=t,function(){return{anchor:"selection",root:i(),getSelection:function(){var t=r.selection.getRng();return st.some(Qc.range(me.fromDom(t.startContainer),t.startOffset,me.fromDom(t.endContainer),t.endOffset))}}}),node:(o=i=a,function(t){return{anchor:"node",root:o(),node:t}})}},v_=function(t){return{colorPicker:function(t,n){Kb(r)(t,n)},hasCustomColors:function(){return Hb(o)},getColors:function(){return zb(e)},getColorCols:(n=e=o=r=t,function(){return jb(n)})};var n,e,o,r},b_=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],y_=function(t){return N(t,function(t,n){if(It(n,"items")){var e=y_(n.items);return{customFormats:t.customFormats.concat(e.customFormats),formats:t.formats.concat([{title:n.title,items:e.formats}])}}if(It(n,"inline")||It(n,"block")||It(n,"selector")){var o="custom-"+(k(n.name)?n.name:n.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:o,format:n}]),formats:t.formats.concat([{title:n.title,format:o,icon:n.icon}])}}return ut(ut({},t),{formats:t.formats.concat(n)})},{customFormats:[],formats:[]})},x_=function(i){return t=i,st.from(t.getParam("style_formats")).filter(p).map(function(t){var n,e,o,r=(n=i,e=y_(t),o=function(t){ft(t,function(t){n.formatter.has(t.name)||n.formatter.register(t.name,t.format)})},n.formatter?o(e.customFormats):n.on("init",function(){o(e.customFormats)}),e.formats);return i.getParam("style_formats_merge",!1,"boolean")?b_.concat(r):r}).getOr(b_);var t},w_=function(t,n,e){var o={type:"formatter",isSelected:n(t.format),getStylePreview:e(t.format)};return zt(t,o)},S_=function(c,t,s,l){var f=function(t){return V(t,function(t){var n,e,o,r,i,u=Ct(t);if(Rt(t,"items")){var a=f(t.items);return zt(zt(t,{type:"submenu"}),{getStyleItems:function(){return a}})}return Rt(t,"format")?w_(t,s,l):1===u.length&&M(u,"title")?zt(t,{type:"separator"}):(e=k((n=t).name)?n.name:Kr(n.title),r={type:"formatter",format:o="custom-"+e,isSelected:s(o),getStylePreview:l(o)},i=zt(n,r),c.formatter.register(e,i),i)})};return f(t)},k_=ck.trim,C_=function(n){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===n)return!0;if(t.getAttribute("data-mce-contenteditable")===n)return!0}return!1}},O_=C_("true"),__=C_("false"),T_=function(t,n,e,o,r){return{type:t,title:n,url:e,level:o,attach:r}},E_=function(t){return t.innerText||t.textContent},D_=function(t){return(n=t)&&"A"===n.nodeName&&(n.id||n.name)!==undefined&&A_(t);var n},B_=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},A_=function(t){return function(t){for(;t=t.parentNode;){var n=t.contentEditable;if(n&&"inherit"!==n)return O_(t)}return!1}(t)&&!__(t)},M_=function(t){return B_(t)&&A_(t)},F_=function(t){var n,e,o=(n=t).id?n.id:Kr("h");return T_("header",E_(t),"#"+o,B_(e=t)?parseInt(e.nodeName.substr(1),10):0,function(){t.id=o})},I_=function(t){var n=t.id||t.name,e=E_(t);return T_("anchor",e||"#"+n,"#"+n,0,$)},R_=function(t){var n,e;return n="h1,h2,h3,h4,h5,h6,a:not([href])",e=t,V(ms(me.fromDom(e),n),function(t){return t.dom})},V_=function(t){return 0<k_(t.title).length},P_=function(t){var n=R_(t);return H(V(H(n,M_),F_).concat(V(H(n,D_),I_)),V_)},H_="tinymce-url-history",z_=function(t){return k(t)&&/^https?/.test(t)},N_=function(t){return C(t)&&At(t,function(t){return!(p(n=t)&&n.length<=5&&W(n,z_));var n}).isNone()},L_=function(){var t,n=Fb.getItem(H_);if(null===n)return{};try{t=JSON.parse(n)}catch(e){if(e instanceof SyntaxError)return console.log("Local storage "+H_+" was not valid JSON",e),{};throw e}return N_(t)?t:(console.log("Local storage "+H_+" was not valid format",t),{})},j_=function(t){var n=L_();return Object.prototype.hasOwnProperty.call(n,t)?n[t]:[]},U_=function(n,t){var e,o,r;z_(n)&&(e=L_(),o=Object.prototype.hasOwnProperty.call(e,t)?e[t]:[],r=H(o,function(t){return t!==n}),e[t]=[n].concat(r).slice(0,5),function(t){if(!N_(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));Fb.setItem(H_,JSON.stringify(t))}(e))},W_=function(t){return!!t},G_=function(t){return Tt(ck.makeMap(t,/[, ]/),W_)},X_=function(t){return st.from(t.getParam("file_picker_callback")).filter(_)},Y_=function(t,n){var e,o,r,i,u=(e=t,o=st.some(e.getParam("file_picker_types")).filter(W_),r=st.some(e.getParam("file_browser_callback_types")).filter(W_),i=o.or(r).map(G_),X_(e).fold(function(){return!1},function(t){return i.fold(function(){return!0},function(t){return 0<Ct(t).length&&t})}));return O(u)?u?X_(t):st.none():u[n]?X_(t):st.none()},q_=function(t){return st.from(t).filter(k).getOrUndefined()},K_=function(t){return st.from((e=(n=t).getParam("file_picker_validator_handler",undefined,"function"))===undefined?n.getParam("filepicker_validator_handler",undefined,"function"):e);var n,e},J_=function(n){return{getHistory:j_,addToHistory:U_,getLinkInformation:function(){return!1===(t=n).getParam("typeahead_urls")?st.none():st.some({targets:P_(t.getBody()),anchorTop:q_(t.getParam("anchor_top","#top")),anchorBottom:q_(t.getParam("anchor_bottom","#bottom"))});var t},getValidationHandler:function(){return K_(n)},getUrlPicker:function(t){return Y_(r=n,i=t).map(function(o){return function(n){return Ox(function(e){var t=ut({filetype:i,fieldname:n.fieldname},st.from(n.meta).getOr({}));o.call(r,function(t,n){if(!k(t))throw new Error("Expected value to be string");if(n!==undefined&&!C(n))throw new Error("Expected meta to be a object");e({value:t,meta:n})},n.value,t)})}});var r,i}}},$_=function(t,n,e){var o,r,i=fe(!1),u={isPositionedAtTop:function(){return"top"===o.get()},getDockingMode:(o=fe(Av(n)?"bottom":"top")).get,setDockingMode:o.set},a={shared:{providers:{icons:function(){return n.ui.registry.getAll().icons},menuItems:function(){return n.ui.registry.getAll().menuItems},translate:tv.translate,isDisabled:function(){return n.mode.isReadOnly()||n.ui.isDisabled()},getSetting:n.getParam.bind(n)},interpreter:function(t){return d_(l_,t,a)},anchors:h_(n,e,u.isPositionedAtTop),header:u,getSink:function(){return mt.value(t)}},urlinput:J_(n),styleselect:function(o){var r=function(t){return function(){return o.formatter.match(t)}},i=function(n){return function(){var t=o.formatter.get(n);return t!==undefined?st.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:o.dom.parseStyle(o.formatter.getCssText(n))}):st.none()}},u=function(t){var n=t.items;return n!==undefined&&0<n.length?U(n,u):[t.format]},a=fe([]),c=fe([]),e=fe([]),s=fe([]),l=fe(!1);o.on("PreInit",function(t){var n=x_(o),e=S_(o,n,r,i);a.set(e),c.set(U(e,u))}),o.on("addStyleModifications",function(t){var n=S_(o,t.items,r,i);e.set(n),l.set(t.replace),s.set(U(n,u))});return{getData:function(){var t=l.get()?[]:a.get(),n=e.get();return t.concat(n)},getFlattenedKeys:function(){var t=l.get()?[]:c.get(),n=s.get();return t.concat(n)}}}(n),colorinput:v_(n),dialog:{isDraggableModal:(r=n,function(){return r.getParam("draggable_modal",!1,"boolean")})},isContextMenuOpen:function(){return i.get()},setContextMenuState:function(t){return i.set(t)}};return a},Q_=at(function(t,n){var e,o,r;e=t,o=Math.floor(n),r=Ou.max(e,o,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]),qi(e,"max-width",r+"px")}),Z_="contexttoolbar-hide",tT=at([Ln("dom"),ne("shell",!0),Ll("toolbarBehaviours",[fg])]),nT=at([yf({name:"groups",overrides:function(){return{behaviours:ic([fg.config({})])}}})]),eT=qf({name:"Toolbar",configFields:tT(),partFields:nT(),factory:function(n,t,e,o){var r=function(t){return n.shell?st.some(t):Af(t,n,"groups")},i=n.shell?{behaviours:[fg.config({})],components:[]}:{behaviours:[],components:t};return{uid:n.uid,dom:n.dom,components:i.components,behaviours:Ul(n.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,n){r(t).fold(function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(t){fg.set(t,n)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)}}}),oT=function(t,n,e){return{within:t,extra:n,withinWidth:e}},rT=function(t,n,o){var e,r=(e=function(t,n){var e=o(t);return st.some({element:t,start:n,finish:n+e,width:e})},N(t,function(n,t){return e(t,n.len).fold(at(n),function(t){return{len:t.finish,list:n.list.concat([t])}})},{len:0,list:[]}).list),i=H(r,function(t){return t.finish<=n}),u=z(i,function(t,n){return t+n.width},0);return{within:i,extra:r.slice(i.length),withinWidth:u}},iT=function(t){return V(t,function(t){return t.element})},uT=function(t,n,e,o){var r,i,u,a,c,s,l,f,d,m=(0===(r=rT(n,t,e)).extra.length?st.some(r):st.none()).getOrThunk(function(){return rT(n,t-e(o),e)}),g=m.within,p=m.extra,h=m.withinWidth;return 1===p.length&&p[0].width<=e(o)?(l=p,f=h,d=iT(g.concat(l)),oT(d,[],f)):1<=p.length?(u=p,a=o,c=h,s=iT(g).concat([a]),oT(s,iT(u),c)):(i=h,oT(iT(g),[],i))},aT=function(t,n){var e=V(n,function(t){return pu(t)});eT.setGroups(t,e)},cT=function(t,n,e){var o=Mf(t,n,"primary"),r=zx.getCoupled(t,"overflowGroup");qi(o.element,"visibility","hidden");var i=n.builtGroups.get().concat([r]),u=Z(i,function(n){return pc(n.element).bind(function(t){return n.getSystem().getByDom(t).toOptional()})});e([]),aT(o,i);var a=_u(o.element),c=uT(a,n.builtGroups.get(),function(t){return _u(t.element)},r);0===c.extra.length?(fg.remove(o,r),e([])):(aT(o,c.within),e(c.extra)),nu(o.element,"visibility"),eu(o.element),u.each(vg.focus)},sT=at([Ll("splitToolbarBehaviours",[zx]),le("builtGroups",function(){return fe([])})]),lT=at([da(["overflowToggledClass"]),Zn("getOverflowBounds"),Ln("lazySink"),le("overflowGroups",function(){return fe([])})].concat(sT())),fT=at([vf({factory:eT,schema:tT(),name:"primary"}),bf({schema:tT(),name:"overflow"}),bf({name:"overflow-button"}),bf({name:"overflow-group"})]),dT=at([da(["toggledClass"]),Ln("lazySink"),Gn("fetch"),Zn("getBounds"),te("fireDismissalEventInstead",[ne("event",zo())]),Wc()]),mT=at([bf({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:ic([Dg.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),bf({factory:eT,schema:tT(),name:"toolbar",overrides:function(n){return{toolbarBehaviours:ic([ug.config({mode:"cyclic",onEscape:function(t){return Af(t,n,"button").each(vg.focus),st.none()}})])}}})]),gT=function(t,n){var e=zx.getCoupled(t,"toolbarSandbox");xl.isOpen(e)?xl.close(e):xl.open(e,n.toolbar())},pT=function(t,n,e,o){var r=e.getBounds.map(function(t){return t()}),i=e.lazySink(t).getOrDie();Qs.positionWithinBounds(i,{anchor:"hotspot",hotspot:t,layouts:o,overrides:{maxWidthFunction:Q_()}},n,r)},hT=function(t,n,e,o,r){eT.setGroups(n,r),pT(t,n,e,o),Dg.on(t)},vT=qf({name:"FloatingToolbarButton",factory:function(u,t,a,n){return ut(ut({},mp.sketch(ut(ut({},n.button()),{action:function(t){gT(t,n)},buttonBehaviours:Gl({dump:n.button().buttonBehaviours},[zx.config({others:{toolbarSandbox:function(t){return o=t,e=a,r=u,{dom:{tag:"div",attributes:{id:(i=$u()).id}},behaviours:ic([ug.config({mode:"special",onEscape:function(t){return xl.close(t),st.some(!0)}}),xl.config({onOpen:function(t,n){r.fetch().get(function(t){hT(o,n,r,e.layouts,t),i.link(o.element),ug.focusIn(n)})},onClose:function(){Dg.off(o),vg.focus(o),i.unlink(o.element)},isPartOf:function(t,n,e){return Zu(n,e)||Zu(o,e)},getAttachPoint:function(){return r.lazySink(o).getOrDie()}}),fc.config({channels:ut(ut({},Ol(ut({isExtraPart:c},r.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Tl({doReposition:function(){xl.getState(zx.getCoupled(o,"toolbarSandbox")).each(function(t){pT(o,t,r,e.layouts)})}}))})])};var o,e,r,i}}})])}))),{apis:{setGroups:function(n,e){xl.getState(zx.getCoupled(n,"toolbarSandbox")).each(function(t){hT(n,t,u,a.layouts,e)})},reposition:function(n){xl.getState(zx.getCoupled(n,"toolbarSandbox")).each(function(t){pT(n,t,u,a.layouts)})},toggle:function(t){gT(t,n)},getToolbar:function(t){return xl.getState(zx.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return xl.isOpen(zx.getCoupled(t,"toolbarSandbox"))}}})},configFields:dT(),partFields:mT(),apis:{setGroups:function(t,n,e){t.setGroups(n,e)},reposition:function(t,n){t.reposition(n)},toggle:function(t,n){t.toggle(n)},getToolbar:function(t,n){return t.getToolbar(n)},isOpen:function(t,n){return t.isOpen(n)}}}),bT=at([Ln("items"),da(["itemSelector"]),Ll("tgroupBehaviours",[ug])]),yT=at([xf({name:"items",unit:"item"})]),xT=qf({name:"ToolbarGroup",configFields:bT(),partFields:yT(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,behaviours:Ul(t.tgroupBehaviours,[ug.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),wT=function(t){return V(t,function(t){return pu(t)})},ST=function(t,e,o){cT(t,o,function(n){o.overflowGroups.set(n),e.getOpt(t).each(function(t){vT.setGroups(t,wT(n))})})},kT=qf({name:"SplitFloatingToolbar",configFields:lT(),partFields:fT(),factory:function(e,t,n,o){var r=gp(vT.sketch({fetch:function(){return Ox(function(t){t(wT(e.overflowGroups.get()))})},layouts:{onLtr:function(){return[za,Ha]},onRtl:function(){return[Ha,za]},onBottomLtr:function(){return[La,Na]},onBottomRtl:function(){return[Na,La]}},getBounds:n.getOverflowBounds,lazySink:e.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:e.markers.overflowToggledClass},parts:{button:o["overflow-button"](),toolbar:o.overflow()}}));return{uid:e.uid,dom:e.dom,components:t,behaviours:Ul(e.splitToolbarBehaviours,[zx.config({others:{overflowGroup:function(){return xT.sketch(ut(ut({},o["overflow-group"]()),{items:[r.asSpec()]}))}}})]),apis:{setGroups:function(t,n){e.builtGroups.set(V(n,t.getSystem().build)),ST(t,r,e)},refresh:function(t){return ST(t,r,e)},toggle:function(t){r.getOpt(t).each(function(t){vT.toggle(t)})},isOpen:function(t){return r.getOpt(t).map(vT.isOpen).getOr(!1)},reposition:function(t){r.getOpt(t).each(function(t){vT.reposition(t)})},getOverflow:function(t){return r.getOpt(t).bind(vT.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},reposition:function(t,n){t.reposition(n)},toggle:function(t,n){t.toggle(n)},isOpen:function(t,n){return t.isOpen(n)},getOverflow:function(t,n){return t.getOverflow(n)}}}),CT=function(n,t){return t.getAnimationRoot.fold(function(){return n.element},function(t){return t(n)})},OT=function(t){return t.dimension.property},_T=function(t,n){return t.dimension.getDimension(n)},TT=function(t,n){var e=CT(t,n);Fi(e,[n.shrinkingClass,n.growingClass])},ET=function(t,n){Bi(t.element,n.openClass),Ei(t.element,n.closedClass),qi(t.element,OT(n),"0px"),eu(t.element)},DT=function(t,n){Bi(t.element,n.closedClass),Ei(t.element,n.openClass),nu(t.element,OT(n))},BT=function(t,n,e,o){e.setCollapsed(),qi(t.element,OT(n),_T(n,t.element)),eu(t.element),TT(t,n),ET(t,n),n.onStartShrink(t),n.onShrunk(t)},AT=function(t,n,e,o){var r=o.getOrThunk(function(){return _T(n,t.element)});e.setCollapsed(),qi(t.element,OT(n),r),eu(t.element);var i=CT(t,n);Bi(i,n.growingClass),Ei(i,n.shrinkingClass),ET(t,n),n.onStartShrink(t)},MT=function(t,n,e){var o=_T(n,t.element);("0px"===o?BT:AT)(t,n,e,st.some(o))},FT=function(t,n,e){var o=CT(t,n),r=Ai(o,n.shrinkingClass),i=_T(n,t.element);DT(t,n);var u=_T(n,t.element);(r?function(){qi(t.element,OT(n),i),eu(t.element)}:function(){ET(t,n)})(),Bi(o,n.shrinkingClass),Ei(o,n.growingClass),DT(t,n),qi(t.element,OT(n),u),e.setExpanded(),n.onStartGrow(t)},IT=function(t,n,e){var o=CT(t,n);return!0===Ai(o,n.growingClass)},RT=function(t,n,e){var o=CT(t,n);return!0===Ai(o,n.shrinkingClass)},VT=/* */Object.freeze({__proto__:null,refresh:function(t,n,e){var o;e.isExpanded()&&(nu(t.element,OT(n)),o=_T(n,t.element),qi(t.element,OT(n),o))},grow:function(t,n,e){e.isExpanded()||FT(t,n,e)},shrink:function(t,n,e){e.isExpanded()&&MT(t,n,e)},immediateShrink:function(t,n,e){e.isExpanded()&&BT(t,n,e,st.none())},hasGrown:function(t,n,e){return e.isExpanded()},hasShrunk:function(t,n,e){return e.isCollapsed()},isGrowing:IT,isShrinking:RT,isTransitioning:function(t,n,e){return!0===IT(t,n)||!0===RT(t,n)},toggleGrow:function(t,n,e){(e.isExpanded()?MT:FT)(t,n,e)},disableTransitions:TT}),PT=/* */Object.freeze({__proto__:null,exhibit:function(t,n,e){var o=n.expanded;return gi(o?{classes:[n.openClass],styles:{}}:{classes:[n.closedClass],styles:Jt(n.dimension.property,"0px")})},events:function(e,o){return Zo([cr(bo(),function(t,n){n.event.raw.propertyName===e.dimension.property&&(TT(t,e),o.isExpanded()&&nu(t.element,e.dimension.property),(o.isExpanded()?e.onGrown:e.onShrunk)(t))})])}}),HT=[Ln("closedClass"),Ln("openClass"),Ln("shrinkingClass"),Ln("growingClass"),Kn("getAnimationRoot"),ga("onShrunk"),ga("onStartShrink"),ga("onGrown"),ga("onStartGrow"),ne("expanded",!1),jn("dimension",An("property",{width:[ba("property","width"),ba("getDimension",function(t){return _u(t)+"px"})],height:[ba("property","height"),ba("getDimension",function(t){return bu(t)+"px"})]}))],zT=ac({fields:HT,name:"sliding",active:PT,apis:VT,state:/* */Object.freeze({__proto__:null,init:function(t){var n=fe(t.expanded);return di({isExpanded:function(){return!0===n.get()},isCollapsed:function(){return!1===n.get()},setCollapsed:y(n.set,!1),setExpanded:y(n.set,!0),readState:function(){return"expanded: "+n.get()}})}})}),NT=at([da(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),ga("onOpened"),ga("onClosed")].concat(sT())),LT=at([vf({factory:eT,schema:tT(),name:"primary"}),vf({factory:eT,schema:tT(),name:"overflow",overrides:function(n){return{toolbarBehaviours:ic([zT.config({dimension:{property:"height"},closedClass:n.markers.closedClass,openClass:n.markers.openClass,shrinkingClass:n.markers.shrinkingClass,growingClass:n.markers.growingClass,onShrunk:function(t){Af(t,n,"overflow-button").each(function(t){Dg.off(t),vg.focus(t)}),n.onClosed(t)},onGrown:function(t){ug.focusIn(t),n.onOpened(t)},onStartGrow:function(t){Af(t,n,"overflow-button").each(Dg.on)}}),ug.config({mode:"acyclic",onEscape:function(t){return Af(t,n,"overflow-button").each(vg.focus),st.some(!0)}})])}}}),bf({name:"overflow-button",overrides:function(t){return{buttonBehaviours:ic([Dg.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),bf({name:"overflow-group"})]),jT=function(n,e){Af(n,e,"overflow-button").bind(function(){return Af(n,e,"overflow")}).each(function(t){UT(n,e),zT.toggleGrow(t)})},UT=function(t,n){Af(t,n,"overflow").each(function(e){cT(t,n,function(t){var n=V(t,function(t){return pu(t)});eT.setGroups(e,n)}),Af(t,n,"overflow-button").each(function(t){zT.hasGrown(e)&&Dg.on(t)}),zT.refresh(e)})},WT=qf({name:"SplitSlidingToolbar",configFields:NT(),partFields:LT(),factory:function(o,t,n,e){var r="alloy.toolbar.toggle";return{uid:o.uid,dom:o.dom,components:t,behaviours:Ul(o.splitToolbarBehaviours,[zx.config({others:{overflowGroup:function(n){return xT.sketch(ut(ut({},e["overflow-group"]()),{items:[mp.sketch(ut(ut({},e["overflow-button"]()),{action:function(t){Yo(n,r)}}))]}))}}}),dg("toolbar-toggle-events",[er(r,function(t){jT(t,o)})])]),apis:{setGroups:function(t,n){var e;e=V(n,t.getSystem().build),o.builtGroups.set(e),UT(t,o)},refresh:function(t){return UT(t,o)},toggle:function(t){return jT(t,o)},isOpen:function(t){return Af(t,o,"overflow").map(zT.hasGrown).getOr(!1)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},toggle:function(t,n){t.toggle(n)},isOpen:function(t,n){return t.isOpen(n)}}}),GT=at(Kr("toolbar-height-change")),XT=function(t){var n=t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}});return{dom:ut({tag:"div",classes:["tox-toolbar__group"]},n),components:[xT.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:ic([Jy.config({}),vg.config({})])}},YT=function(t){return xT.sketch(XT(t))},qT=function(e,t){var n=sr(function(t){var n=V(e.initGroups,YT);eT.setGroups(t,n)});return ic([Gv(e.providers.isDisabled),Lv(),ug.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),dg("toolbar-events",[n])])},KT=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":XT({title:st.none(),items:[]}),"overflow-button":YC({name:"more",icon:st.some("more-drawer"),disabled:!1,tooltip:st.some("More..."),primary:!1,borderless:!1},st.none(),t.providers)},splitToolbarBehaviours:qT(t,n)}},JT=function(i){var t=KT(i),n=kT.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return kT.sketch(ut(ut({},t),{lazySink:i.getSink,getOverflowBounds:function(){var t=i.moreDrawerData.lazyHeader().element,n=Nu(t),e=wr(t),o=Nu(e),r=Math.max(e.dom.scrollHeight,o.height);return Hu(n.x+4,o.y,n.width-8,r)},parts:ut(ut({},t.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:i.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))},$T=function(t){var n=WT.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),e=WT.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=KT(t);return WT.sketch(ut(ut({},o),{components:[n,e],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([GT()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([GT()],{type:"closed"})}}))},QT=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return eT.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===rh.scrolling?["tox-toolbar--scrolling"]:[])},components:[eT.parts.groups({})],toolbarBehaviours:qT(t,n)})},ZT=fn([Un("type"),jn("items",mn([Sn([Un("name"),qn("items",Rn)]),Rn]))].concat(Up)),tE=[Qn("text"),Qn("tooltip"),Qn("icon"),Gn("fetch"),ae("onSetup",function(){return $})],nE=fn(S([Un("type")],tE)),eE=function(t){return _n("menubutton",nE,t)},oE=fn([Un("type"),Qn("tooltip"),Qn("icon"),Qn("text"),Zn("select"),Gn("fetch"),ae("onSetup",function(){return $}),ie("presets","normal",["normal","color","listpreview"]),ne("columns",1),Gn("onAction"),Gn("onItemAction")]),rE=/* */Object.freeze({__proto__:null,events:function(i,u){var r=function(o,r){i.updateState.each(function(t){var n=t(o,r);u.set(n)}),i.renderComponents.each(function(t){var n=t(r,u.get()),e=V(n,o.getSystem().build);el(o,e)})};return Zo([er(Oo(),function(t,n){var e,o=n;o.universal||(e=i.channel,M(o.channels,e)&&r(t,o.data))}),sr(function(n,t){i.initialData.each(function(t){r(n,t)})})])}}),iE=/* */Object.freeze({__proto__:null,getState:function(t,n,e){return e}}),uE=[Ln("channel"),Kn("renderComponents"),Kn("updateState"),Kn("initialData")],aE=ac({fields:uE,name:"reflecting",active:rE,apis:iE,state:/* */Object.freeze({__proto__:null,init:function(){var n=fe(st.none());return{readState:function(){return n.get().fold(function(){return"none"},function(t){return t})},get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(st.none())}}}})}),cE=at([Ln("toggleClass"),Ln("fetch"),ha("onExecute"),ne("getHotspot",st.some),ne("getAnchorOverrides",at({})),Wc(),ha("onItemExecute"),Kn("lazySink"),Ln("dom"),ga("onOpen"),Ll("splitDropdownBehaviours",[zx,ug,vg]),ne("matchWidth",!1),ne("useMinWidth",!1),ne("eventOrder",{}),Kn("role")].concat($x())),sE=vf({factory:mp,schema:[Ln("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:ic([vg.revoke()])}},overrides:function(n){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(n.uid).each(Ko)},buttonBehaviours:ic([Dg.config({toggleOnExecute:!1,toggleClass:n.toggleClass})])}}}),lE=vf({factory:mp,schema:[Ln("dom")],name:"button",defaults:function(){return{buttonBehaviours:ic([vg.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(e.uid).each(function(t){e.onExecute(t,n)})}}}}),fE=at([sE,lE,yf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Ln("text")],name:"aria-descriptor"}),bf({schema:[fa()],name:"menu",defaults:function(o){return{onExecute:function(n,e){n.getSystem().getByUid(o.uid).each(function(t){o.onItemExecute(t,n,e)})}}}}),Lx()]),dE=qf({name:"SplitDropdown",configFields:cE(),partFields:fE(),factory:function(o,t,n,e){var r,i=function(t){td.getCurrent(t).each(function(t){fd.highlightFirst(t),ug.focusIn(t)})},u=function(t){Gx(o,function(t){return t},t,e,i,bx.HighlightFirst).get($)},a=function(t){var n=Mf(t,o,"button");return Ko(n),st.some(!0)},c=ut(ut({},Zo([sr(function(e,t){Af(e,o,"aria-descriptor").each(function(t){var n=Kr("aria");zr(t.element,"id",n),zr(e.element,"aria-describedby",n)})})])),Ag(st.some(u))),s={repositionMenus:function(t){Dg.isOn(t)&&Jx(t)}};return{uid:o.uid,dom:o.dom,components:t,apis:s,eventOrder:ut(ut({},o.eventOrder),((r={})[_o()]=["disabling","toggling","alloy.base.behaviour"],r)),events:c,behaviours:Ul(o.splitDropdownBehaviours,[zx.config({others:{sandbox:function(t){var n=Mf(t,o,"arrow");return Kx(o,t,{onOpen:function(){Dg.on(n),Dg.on(t)},onClose:function(){Dg.off(n),Dg.off(t)}})}}}),ug.config({mode:"special",onSpace:a,onEnter:a,onDown:function(t){return u(t),st.some(!0)}}),vg.config({}),Dg.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,n){return t.repositionMenus(n)}}}),mE=function(n){return{isDisabled:function(){return gv.isDisabled(n)},setDisabled:function(t){return gv.set(n,t)}}},gE=function(n){return{setActive:function(t){Dg.set(n,t)},isActive:function(){return Dg.isOn(n)},isDisabled:function(){return gv.isDisabled(n)},setDisabled:function(t){return gv.set(n,t)}}},pE=function(t,n){return t.map(function(t){return{"aria-label":n.translate(t),title:n.translate(t)}}).getOr({})},hE=Kr("focus-button"),vE=["checklist","ordered-list"],bE=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],yE=function(n,e,t,o,r,i){var u,a=function(t){return tv.isRtl()&&M(vE,t)?t+"-rtl":t},c=tv.isRtl()&&n.exists(function(t){return M(bE,t)});return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:pE(t,i)},components:Jv([n.map(function(t){return DC(a(t),i.icons)}),e.map(function(t){return AC(t,"tox-tbtn",i)})]),eventOrder:((u={})[io()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:ic([Gv(i.isDisabled),Lv(),dg("common-button-display-events",[er(io(),function(t,n){n.event.prevent(),Yo(t,hE)})])].concat(o.map(function(t){return aE.config({channel:t,initialData:{icon:n,text:e},renderComponents:function(t,n){return Jv([t.icon.map(function(t){return DC(a(t),i.icons)}),t.text.map(function(t){return AC(t,"tox-tbtn",i)})])}})}).toArray()).concat(r.getOr([])))}},xE=function(t,n,e){var o,r=fe($),i=yE(t.icon,t.text,t.tooltip,st.none(),st.none(),e);return mp.sketch({dom:i.dom,components:i.components,eventOrder:FC,buttonBehaviours:ic([dg("toolbar-button-events",[(o={onAction:t.onAction,getApi:n.getApi},dr(function(n,t){Xv(o,n)(function(t){qo(n,MC,{buttonApi:t}),o.onAction(t)})})),Yv(n,r),qv(n,r)]),Gv(function(){return t.disabled||e.isDisabled()}),Lv()].concat(n.toolbarButtonBehaviours))})},wE=function(t,n,e){return xE(t,{toolbarButtonBehaviours:[].concat(0<e.length?[dg("toolbarButtonWith",e)]:[]),getApi:mE,onSetup:t.onSetup},n)},SE=function(t,n,e){return zt(xE(t,{toolbarButtonBehaviours:[fg.config({}),Dg.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<e.length?[dg("toolbarToggleButtonWith",e)]:[]),getApi:gE,onSetup:t.onSetup},n))},kE=function(n,t){var e,o,r,i,u=Kr("channel-update-split-dropdown-display"),a=function(e){return{isDisabled:function(){return gv.isDisabled(e)},setDisabled:function(t){return gv.set(e,t)},setIconFill:function(t,n){Ku(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){zr(t,"fill",n)})},setIconStroke:function(t,n){Ku(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){zr(t,"stroke",n)})},setActive:function(n){zr(e.element,"aria-pressed",n),Ku(e.element,"span").each(function(t){e.getSystem().getByDom(t).each(function(t){return Dg.set(t,n)})})},isActive:function(){return Ku(e.element,"span").exists(function(t){return e.getSystem().getByDom(t).exists(Dg.isOn)})}}},c=fe($),s={getApi:a,onSetup:n.onSetup};return dE.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:ut({"aria-pressed":!1},pE(n.tooltip,t.providers))},onExecute:function(t){n.onAction(a(t))},onItemExecute:function(t,n,e){},splitDropdownBehaviours:ic([Wv(t.providers.isDisabled),Lv(),dg("split-dropdown-events",[er(hE,vg.focus),Yv(s,c),qv(s,c)]),nw.config({})]),eventOrder:((e={})[Po()]=["alloy.base.behaviour","split-dropdown-events"],e),toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:(o=a,r=n,i=t.providers,function(n){return Ox(function(t){return r.fetch(t)}).map(function(t){return st.from(hy(zt(Jb(Kr("menu-value"),t,function(t){r.onItemAction(o(n),t)},r.columns,r.presets,uh.CLOSE_ON_EXECUTE,r.select.getOr(function(){return!1}),i),{movement:Qb(r.columns,r.presets),menuBehaviours:Wh("auto"!==r.columns?[]:[sr(function(o,t){jh(o,4,vh(r.presets)).each(function(t){var n=t.numRows,e=t.numColumns;ug.setGridSize(o,n,e)})})])})))})}),parts:{menu:wh(0,n.columns,n.presets)},components:[dE.parts.button(yE(n.icon,n.text,st.none(),st.some(u),st.some([Dg.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),dE.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:hp("chevron-down",t.providers.icons)},buttonBehaviours:ic([Wv(t.providers.isDisabled),Lv()])}),dE.parts["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})},CE=function(i,u){return er(MC,function(t,n){var e,o=i.get(t),r=(e=o,{hide:function(){return Yo(e,Bo())},getValue:function(){return Nl.getValue(e)}});u.onAction(r,n.event.buttonApi)})},OE=function(t,n,e){var o,r,i,u,a,c,s,l,f,d,m,g,p={backstage:{shared:{providers:e}}};return"contextformtogglebutton"===n.type?(s=t,f=p,(d=(l=n).original).primary,m=w(d,["primary"]),g=Tn(qp(ut(ut({},m),{type:"togglebutton",onAction:function(){}}))),SE(g,f.backstage.shared.providers,[CE(s,l)])):(o=t,i=p,(u=(r=n).original).primary,a=w(u,["primary"]),c=Tn(Gp(ut(ut({},a),{type:"button",onAction:function(){}}))),wE(c,i.backstage.shared.providers,[CE(o,r)]))},_E=function(t,n){var e,o,r,i,u=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),a=gp(px.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:u,selectOnFocus:!0,inputBehaviours:ic([ug.config({mode:"special",onEnter:function(t){return c.findPrimary(t).map(function(t){return Ko(t),!0})},onLeft:function(t,n){return n.cut(),st.none()},onRight:function(t,n){return n.cut(),st.none()}})])})),c=(e=a,o=t.commands,r=n,i=V(o,function(t){return gp(OE(e,t,r))}),{asSpecs:function(){return V(i,function(t){return t.asSpec()})},findPrimary:function(e){return Z(o,function(t,n){return t.primary?st.from(i[n]).bind(function(t){return t.getOpt(e)}).filter(x(gv.isDisabled)):st.none()})}});return[{title:st.none(),items:[a.asSpec()]},{title:st.none(),items:c.asSpecs()}]},TE=_E,EE=function(t,n){var e,o,r,i,u,a=Iu(window),c=zu(me.fromDom(t.getContentAreaContainer())),s=Sv(t)||kv(t)||Ov(t),l=(e=c,o=a,r=Math.max(o.x,e.x),i=e.right-r,u=o.width-(r-o.x),{x:r,width:Math.min(i,u)}),f=l.x,d=l.width;if(t.inline&&!s)return Hu(f,a.y,d,a.height);var m=function(t,n,e,o){var r=me.fromDom(t.getContainer()),i=Ku(r,".tox-editor-header").getOr(r),u=zu(i),a=u.y>=n.bottom,c=o&&!a;if(t.inline&&c)return{y:Math.max(u.bottom,e.y),bottom:e.bottom};if(t.inline&&!c)return{y:e.y,bottom:Math.min(u.y,e.bottom)};var s=zu(r);return c?{y:Math.max(u.bottom,e.y),bottom:Math.min(s.bottom,e.bottom)}:{y:Math.max(s.y,e.y),bottom:Math.min(u.y,e.bottom)}}(t,c,a,n.header.isPositionedAtTop()),g=m.y,p=m.bottom;return Hu(f,g,d,p-g)},DE=function(n,t){var e=H(t,function(t){return t.predicate(n.dom)}),o=P(e,function(t){return"contexttoolbar"===t.type});return{contextToolbars:o.pass,contextForms:o.fail}},BE=function(t,n,e){var o=DE(t,n);if(0<o.contextForms.length)return st.some({elem:t,toolbars:[o.contextForms[0]]});var r=DE(t,e);if(0<r.contextForms.length)return st.some({elem:t,toolbars:[r.contextForms[0]]});if(0<o.contextToolbars.length||0<r.contextToolbars.length){var i=function(t){if(t.length<=1)return t;var n=function(n){return F(t,function(t){return t.position===n})},e=function(n){return H(t,function(t){return t.position===n})},o=n("selection"),r=n("node");if(o||r){if(r&&o){var i=e("node"),u=V(e("selection"),function(t){return ut(ut({},t),{position:"node"})});return i.concat(u)}return e(o?"selection":"node")}return e("line")}(o.contextToolbars.concat(r.contextToolbars));return st.some({elem:t,toolbars:i})}return st.none()},AE=function(t,n,i){return t(n)?st.none():Ke(n,function(t){var n=DE(t,i.inNodeScope),e=n.contextToolbars,o=n.contextForms,r=0<o.length?o:function(t){if(t.length<=1)return t;var n=function(n){return L(t,function(t){return t.position===n})};return n("selection").orThunk(function(){return n("node")}).orThunk(function(){return n("line")}).map(function(t){return t.position}).fold(function(){return[]},function(n){return H(t,function(t){return t.position===n})})}(e);return 0<r.length?st.some({elem:t,toolbars:r}):st.none()},t)},ME=function(e,r){var t={},i=[],u=[],a={},c={},o=function(n,e){var o=Tn(_n("ContextForm",nh,e));(t[n]=o).launch.map(function(t){a["form:"+n]=ut(ut({},e.launch),{type:"contextformtogglebutton"===t.type?"togglebutton":"button",onAction:function(){r(o)}})}),"editor"===o.scope?u.push(o):i.push(o),c[n]=o},s=function(n,e){_n("ContextToolbar",eh,e).each(function(t){"editor"===e.scope?u.push(t):i.push(t),c[n]=t})},n=Ct(e);return ft(n,function(t){var n=e[t];"contextform"===n.type?o(t,n):"contexttoolbar"===n.type&&s(t,n)}),{forms:t,inNodeScope:i,inEditorScope:u,lookupTable:c,formNavigators:a}},FE=Kr("forward-slide"),IE=Kr("backward-slide"),RE=Kr("change-slide-event"),VE="tox-pop--resizing",PE=function(t,n,e){var u,a,r,c,s,o=e.dataset,i="basic"===o.type?function(){return V(o.data,function(t){return w_(t,e.isSelectedFor,e.getPreviewFor)})}:o.getData;return{items:(u=n,a=e,r=function(t,n,e,o){var r=u.shared.providers.translate(t.title);if("separator"===t.type)return st.some({type:"separator",text:r});if("submenu"!==t.type)return st.some(ut({type:"togglemenuitem",text:r,icon:t.icon,active:t.isSelected(o),disabled:e,onAction:a.onAction(t)},t.getStylePreview().fold(function(){return{}},function(t){return{meta:{style:t}}})));var i=U(t.getStyleItems(),function(t){return c(t,n,o)});return 0===n&&i.length<=0?st.none():st.some({type:"nestedmenuitem",text:r,disabled:i.length<=0,getSubmenuItems:function(){return U(t.getStyleItems(),function(t){return c(t,n,o)})}})},c=function(t,n,e){var o="formatter"===t.type&&a.isInvalid(t);return 0===n?o?[]:r(t,n,!1,e).toArray():r(t,n,o,e).toArray()},{validateItems:s=function(t){var n=a.getCurrentValue(),e=a.shouldHide?0:1;return U(t,function(t){return c(t,e,n)})},getFetch:function(r,i){return function(t,n){var e=i(),o=s(e);n(jC(o,uh.CLOSE_ON_EXECUTE,r,!1))}}}),getStyleItems:i}},HE=function(o,t,n){var e=PE(0,t,n),r=e.items,i=e.getStyleItems;return VC({text:n.icon.isSome()?st.none():st.some(""),icon:n.icon,tooltip:st.from(n.tooltip),role:st.none(),fetch:r.getFetch(t,i),onSetup:function(e){return n.setInitialValue.each(function(t){return t(e.getComponent())}),n.nodeChangeHandler.map(function(t){var n=t(e.getComponent());return o.on("NodeChange",n),function(){o.off("NodeChange",n)}}).getOr($)},getApi:function(t){return{getComponent:function(){return t}}},columns:1,presets:"normal",classes:n.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",t.shared)};(DO=EO=EO||{})[DO.SemiColon=0]="SemiColon",DO[DO.Space=1]="Space";var zE,NE,LE,jE,UE,WE,GE=function(t,n,e,o){var r,i,u=t.getParam(n,e,"string");return{type:"basic",data:(i=u,r=o===EO.SemiColon?i.replace(/;$/,"").split(";"):i.split(" "),V(r,function(t){var n=t,e=t,o=t.split("=");return 1<o.length&&(n=o[0],e=o[1]),{title:n,format:e}}))}},XE=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],YE=function(e){var n=function(t){var n=L(XE,function(t){return e.formatter.match(t.format)}).fold(function(){return"left"},function(t){return t.title.toLowerCase()});qo(t,RC,{icon:"align-"+n})},t=st.some(function(t){return function(){return n(t)}}),o=st.some(n),r={type:"basic",data:XE};return{tooltip:"Align",icon:st.some("align-left"),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:st.none,getPreviewFor:function(t){return function(){return st.none()}},onAction:function(n){return function(){return L(XE,function(t){return t.format===n.format}).each(function(t){return e.execCommand(t.command)})}},setInitialValue:o,nodeChangeHandler:t,dataset:r,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},qE=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],KE=function(t){var n=t.split(/\s*,\s*/);return V(n,function(t){return t.replace(/^['"]+|['"]+$/g,"")})},JE=function(t){var n;return 0===t.indexOf("-apple-system")&&(n=KE(t.toLowerCase()),W(qE,function(t){return-1<n.indexOf(t.toLowerCase())}))},$E=function(r){var i=function(){var e=function(t){return t?KE(t)[0]:""},t=r.queryCommandValue("FontName"),n=u.data,o=t?t.toLowerCase():"";return{matchOpt:L(n,function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()}).orThunk(function(){return JE(o)?st.from({title:"System Font",format:o}):st.none()}),font:t}},n=function(t){var n=i(),e=n.matchOpt,o=n.font,r=e.fold(function(){return o},function(t){return t.title});qo(t,IC,{text:r})},t=st.some(function(t){return function(){return n(t)}}),e=st.some(n),u=GE(r,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",EO.SemiColon);return{tooltip:"Fonts",icon:st.none(),isSelectedFor:function(n){return function(t){return t.exists(function(t){return t.format===n})}},getCurrentValue:function(){return i().matchOpt},getPreviewFor:function(t){return function(){return st.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(t){return function(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,t.format)})}},setInitialValue:e,nodeChangeHandler:t,dataset:u,shouldHide:!1,isInvalid:function(){return!1}}},QE={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},ZE={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},tD=function(t,n){return/[0-9.]+px$/.test(t)?(e=72*parseInt(t,10)/96,o=n||0,r=Math.pow(10,o),Math.round(e*r)/r+"pt"):Ft(ZE,t).getOr(t);var e,o,r},nD=function(e){var i=function(){var o=st.none(),r=u.data,i=e.queryCommandValue("FontSize");if(i)for(var t=function(t){var n=tD(i,t),e=Ft(QE,n).getOr("");o=L(r,function(t){return t.format===i||t.format===n||t.format===e})},n=3;o.isNone()&&0<=n;n--)t(n);return{matchOpt:o,size:i}},t=at(st.none),n=function(t){var n=i(),e=n.matchOpt,o=n.size,r=e.fold(function(){return o},function(t){return t.title});qo(t,IC,{text:r})},o=st.some(function(t){return function(){return n(t)}}),r=st.some(n),u=GE(e,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",EO.Space);return{tooltip:"Font sizes",icon:st.none(),isSelectedFor:function(n){return function(t){return t.exists(function(t){return t.format===n})}},getPreviewFor:t,getCurrentValue:function(){return i().matchOpt},onAction:function(t){return function(){e.undoManager.transact(function(){e.focus(),e.execCommand("FontSize",!1,t.format)})}},setInitialValue:r,nodeChangeHandler:o,dataset:u,shouldHide:!1,isInvalid:function(){return!1}}},eD=function(t,n){var e=n(),o=V(e,function(t){return t.format});return st.from(t.formatter.closest(o)).bind(function(n){return L(e,function(t){return t.format===n})}).orThunk(function(){return Jf(t.formatter.match("p"),{title:"Paragraph",format:"p"})})},oD=function(t){var n=fe(st.none()),e=function(){return n.get().each(t)};return{clear:function(){e(),n.set(st.none())},isSet:function(){return n.get().isSome()},set:function(t){e(),n.set(st.some(t))}}},rD=function(){return oD(function(t){return t.destroy()})},iD=function(){return oD(function(t){return t.unbind()})},uD=function(o,r){return function(n){var e=iD(),t=function(){n.setActive(o.formatter.match(r));var t=o.formatter.formatChanged(r,n.setActive);e.set(t)};return o.initialized?t():o.on("init",t),e.clear}},aD=function(n){return function(t){return function(){n.undoManager.transact(function(){n.focus(),n.execCommand("mceToggleFormat",!1,t.format)})}}},cD=function(e){var n=function(t){var n=eD(e,function(){return r.data}).fold(function(){return"Paragraph"},function(t){return t.title});qo(t,IC,{text:n})},t=st.some(function(t){return function(){return n(t)}}),o=st.some(n),r=GE(e,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",EO.SemiColon);return{tooltip:"Blocks",icon:st.none(),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:st.none,getPreviewFor:function(n){return function(){var t=e.formatter.get(n);return st.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(n))})}},onAction:aD(e),setInitialValue:o,nodeChangeHandler:t,dataset:r,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},sD=function(r,t){var n=function(t){var e=function(t){var n=t.items;return n!==undefined&&0<n.length?U(n,e):[{title:t.title,format:t.format}]},n=U(x_(r),e),o=eD(r,function(){return n}).fold(function(){return"Paragraph"},function(t){return t.title});qo(t,IC,{text:o})},e=st.some(function(t){return function(){return n(t)}}),o=st.some(n);return{tooltip:"Formats",icon:st.none(),isSelectedFor:function(t){return function(){return r.formatter.match(t)}},getCurrentValue:st.none,getPreviewFor:function(n){return function(){var t=r.formatter.get(n);return t!==undefined?st.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:r.dom.parseStyle(r.formatter.getCssText(n))}):st.none()}},onAction:aD(r),setInitialValue:o,nodeChangeHandler:e,shouldHide:r.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!r.formatter.canApply(t.format)},dataset:t}},lD=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],fD=function(r,i){return function(t,n,e){var o=r(t).mapError(function(t){return Dn(t)}).getOrDie();return i(o,n,e)}},dD={button:fD(Gp,function(t,n){return e=t,o=n.backstage.shared.providers,wE(e,o,[]);var e,o}),togglebutton:fD(qp,function(t,n){return e=t,o=n.backstage.shared.providers,SE(e,o,[]);var e,o}),menubutton:fD(eE,function(t,n){return WC(t,"tox-tbtn",n.backstage,st.none())}),splitbutton:fD(function(t){return _n("SplitButton",oE,t)},function(t,n){return kE(t,n.backstage.shared)}),grouptoolbarbutton:fD(function(t){return _n("GroupToolbarButton",ZT,t)},function(t,n,e){var o,r,i,u,a,c,s=e.ui.registry.getAll().buttons,l=((o={})[jc]=n.backstage.shared.header.isPositionedAtTop()?na.TopToBottom:na.BottomToTop,o);switch(Ev(e)){case rh.floating:return r=t,i=n.backstage,u=function(t){return hD(e,{buttons:s,toolbar:t,allowToolbarGroups:!1},n,st.none())},a=l,c=i.shared,vT.sketch({lazySink:c.getSink,fetch:function(){return Ox(function(t){t(V(u(r.items),YT))})},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:yE(r.icon,r.text,r.tooltip,st.none(),st.none(),c.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:a}}}});default:throw new Error("Toolbar groups are only supported when using floating toolbar mode")}}),styleSelectButton:function(t,n){return e=t,o=n.backstage,r=ut({type:"advanced"},o.styleselect),HE(e,o,sD(e,r));var e,o,r},fontsizeSelectButton:function(t,n){return e=t,o=n.backstage,HE(e,o,nD(e));var e,o},fontSelectButton:function(t,n){return e=t,o=n.backstage,HE(e,o,$E(e));var e,o},formatButton:function(t,n){return e=t,o=n.backstage,HE(e,o,cD(e));var e,o},alignMenuButton:function(t,n){return e=t,o=n.backstage,HE(e,o,YE(e));var e,o}},mD={styleselect:dD.styleSelectButton,fontsizeselect:dD.fontsizeSelectButton,fontselect:dD.fontSelectButton,formatselect:dD.formatButton,align:dD.alignMenuButton},gD=function(t){var n,e,o,r=t.toolbar,i=t.buttons;return!1===r?[]:r===undefined||!0===r?(e=i,o=V(lD,function(t){var n=H(t.items,function(t){return It(e,t)||It(mD,t)});return{name:t.name,items:n}}),H(o,function(t){return 0<t.items.length})):k(r)?(n=r.split("|"),V(n,function(t){return{items:t.trim().split(" ")}})):T(r,function(t){return It(t,"name")&&It(t,"items")})?r:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},pD=function(r,n,i,u,a,t){return Ft(n,i.toLowerCase()).orThunk(function(){return t.bind(function(t){return Z(t,function(t){return Ft(n,t+i.toLowerCase())})})}).fold(function(){return Ft(mD,i.toLowerCase()).map(function(t){return t(r,a)}).orThunk(function(){return st.none()})},function(t){return"grouptoolbarbutton"!==t.type||u?(e=a,o=r,Ft(dD,(n=t).type).fold(function(){return console.error("skipping button defined by",n),st.none()},function(t){return st.some(t(n,e,o))})):(console.warn("Ignoring the '"+i+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),st.none());var n,e,o})},hD=function(e,o,r,i){var t=gD(o),n=V(t,function(t){var n=U(t.items,function(t){return 0===t.trim().length?[]:pD(e,o.buttons,t,o.allowToolbarGroups,r,i).toArray()});return{title:st.from(e.translate(t.name)),items:n}});return H(n,function(t){return 0<t.items.length})},vD={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},bD={maxHeightFunction:Fc(),maxWidthFunction:Q_()},yD={onLtr:function(){return[ja,Ua,Na,Ha,La,za,lp,fp,cp,up,sp,ap]},onRtl:function(){return[ja,Ua,La,za,Na,Ha,lp,fp,sp,ap,cp,up]}},xD={onLtr:function(){return[Ua,Ha,za,Na,La,ja,lp,fp,cp,up,sp,ap]},onRtl:function(){return[Ua,za,Ha,La,Na,ja,lp,fp,sp,ap,cp,up]}},wD=function(c,t,e,s){var o,r,l=je().deviceType.isTouch,a=gu((o={sink:e,onEscape:function(){return c.focus(),st.some(!0)}},r=fe([]),tp.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){r.set([]),tp.getContent(t).each(function(t){nu(t.element,"visibility")}),Bi(t.element,VE),nu(t.element,"width")},inlineBehaviours:ic([dg("context-toolbar-events",[cr(bo(),function(t,n){Bi(t.element,VE),nu(t.element,"width")}),er(RE,function(n,e){nu(n.element,"width");var t=_u(n.element);tp.setContent(n,e.event.contents),Ei(n.element,VE);var o=_u(n.element);qi(n.element,"width",t+"px"),tp.getContent(n).each(function(t){e.event.focus.bind(function(t){return mc(t),pc(n.element)}).orThunk(function(){return ug.focusIn(t),gc()})}),dp.setTimeout(function(){qi(n.element,"width",o+"px")},0)}),er(FE,function(t,n){tp.getContent(t).each(function(t){r.set(r.get().concat([{bar:t,focus:gc()}]))}),qo(t,RE,{contents:n.event.forwardContents,focus:st.none()})}),er(IE,function(n,t){J(r.get()).each(function(t){r.set(r.get().slice(0,r.get().length-1)),qo(n,RE,{contents:pu(t.bar),focus:t.focus})})})]),ug.config({mode:"special",onEscape:function(n){return J(r.get()).fold(function(){return o.onEscape()},function(t){return Yo(n,IE),st.some(!0)})}})]),lazySink:function(){return mt.value(o.sink)}}))),f=function(){return EE(c,s.backstage.shared)},u=function(){if(l()&&s.backstage.isContextMenuOpen())return!0;var t,n,e,o,r,i,u=(t=m.get().filter(function(t){return Ui(me.fromDom(t))}).map(function(t){return t.getBoundingClientRect()}).getOrThunk(function(){return c.selection.getRng().getBoundingClientRect()}),n=c.inline?Au().top:Nu(me.fromDom(c.getBody())).y,{y:t.top+n,bottom:t.bottom+n}),a=f();return e=u.y,o=u.bottom,r=a.y,i=a.bottom,!(Math.max(e,r)<=Math.min(o,i))},n=function(){tp.hide(a)},i=function(){d.get().each(function(t){var n=a.element;nu(n,"display"),u()?qi(n,"display","none"):Qs.positionWithinBounds(e,t,a,st.some(f()))})},d=fe(st.none()),m=fe(st.none()),g=fe(null),p=function(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:ic([ug.config({mode:"acyclic"}),dg("pop-dialog-wrap-events",[sr(function(t){c.shortcuts.add("ctrl+F9","focus statusbar",function(){return ug.focusIn(t)})}),lr(function(t){c.shortcuts.remove("ctrl+F9")})])])}},h=Lt(function(){return ME(t,function(t){var n=v([t]);qo(a,FE,{forwardContents:p(n)})})}),v=function(t){var n=c.ui.registry.getAll().buttons,e=h(),o=ut(ut({},n),e.formNavigators),r=Ev(c)===rh.scrolling?rh.scrolling:rh["default"],i=dt(V(t,function(t){return"contexttoolbar"===t.type?hD(c,{buttons:o,toolbar:t.items,allowToolbarGroups:!1},s,st.some(["form:"])):(n=t,e=s.backstage.shared.providers,TE(n,e));var n,e}));return QT({type:r,uid:Kr("context-toolbar"),initGroups:i,onEscape:st.none,cyclicKeying:!0,providers:s.backstage.shared.providers})};c.on("contexttoolbar-show",function(n){var t=h();Ft(t.lookupTable,n.toolbarKey).each(function(t){y([t],n.target===c?st.none():st.some(n)),tp.getContent(a).each(ug.focusIn)})});var b=function(t,n){var e,o,r="node"===t?s.backstage.shared.anchors.node(n):s.backstage.shared.anchors.cursor();return zt(r,(e=t,o=l(),"line"===e?{bubble:Hc(12,0,vD),layouts:{onLtr:function(){return[Wa]},onRtl:function(){return[Ga]}},overrides:bD}:{bubble:Hc(0,12,vD),layouts:o?xD:yD,overrides:bD}))},y=function(t,n){var e,o,r,i;w(),l()&&s.backstage.isContextMenuOpen()||(e=v(t),o=n.map(me.fromDom),r=b(t[0].position,o),d.set(st.some(r)),m.set(n),i=a.element,nu(i,"display"),tp.showWithinBounds(a,r,p(e),function(){return st.some(f())}),u()&&qi(i,"display","none"))},x=function(){var t,n,e,o,r,i,u;c.hasFocus()&&(t=h(),n=t,e=c,r=me.fromDom(e.getBody()),i=function(t){return Ge(t,r)},u=me.fromDom(e.selection.getNode()),(i(o=u)||Ye(r,o)?BE(u,n.inNodeScope,n.inEditorScope).orThunk(function(){return AE(i,u,n)}):st.none()).fold(function(){d.set(st.none()),tp.hide(a)},function(t){y(t.toolbars,st.some(t.elem.dom))}))},w=function(){var t=g.get();null!==t&&(dp.clearTimeout(t),g.set(null))},S=function(t){w(),g.set(t)};c.on("init",function(){c.on(Z_,n),c.on("ScrollContent ScrollWindow longpress",i),c.on("click keyup focus SetContent ObjectResized ResizeEditor",function(){S(dp.setEditorTimeout(c,x,0))}),c.on("focusout",function(t){dp.setEditorTimeout(c,function(){pc(e.element).isNone()&&pc(a.element).isNone()&&(d.set(st.none()),tp.hide(a))},0)}),c.on("SwitchMode",function(){c.mode.isReadOnly()&&(d.set(st.none()),tp.hide(a))}),c.on("NodeChange",function(t){pc(a.element).fold(function(){S(dp.setEditorTimeout(c,x,0))},function(t){})})})},SD=zf,kD=Sf,CD=at([ne("shell",!1),Ln("makeItem"),ne("setupItem",$),Wl("listBehaviours",[fg])]),OD=yf({name:"items",overrides:function(){return{behaviours:ic([fg.config({})])}}}),_D=at([OD]),TD=qf({name:at("CustomList")(),configFields:CD(),partFields:_D(),factory:function(s,t,n,e){var o=s.shell?{behaviours:[fg.config({})],components:[]}:{behaviours:[],components:t},r=function(t){return s.shell?st.some(t):Af(t,s,"items")};return{uid:s.uid,dom:s.dom,components:o.components,behaviours:Ul(s.listBehaviours,o.behaviours),apis:{setItems:function(a,c){r(a).fold(function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},function(n){var t=fg.contents(n),e=c.length,o=e-t.length,r=0<o?I(o,function(){return s.makeItem()}):[],i=t.slice(e);ft(i,function(t){return fg.remove(n,t)}),ft(r,function(t){return fg.append(n,t)});var u=fg.contents(n);ft(u,function(t,n){s.setupItem(a,t,c[n],n)})})}}}},apis:{setItems:function(t,n,e){t.setItems(n,e)}}}),ED=$,DD=c,BD=at([]),AD=/* */Object.freeze({__proto__:null,setup:ED,isDocked:DD,getBehaviours:BD}),MD=function(t){return(Zi(t,"position").is("fixed")?st.none():Or(t)).orThunk(function(){var e=me.fromTag("span");return kr(t).bind(function(t){Ar(t,e);var n=Or(e);return Ir(e),n})})},FD=function(t){return MD(t).map(ku).getOrThunk(function(){return wu(0,0)})},ID=Vt([{"static":[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),RD=function(t,n){var e=t.element;Ei(e,n.transitionClass),Bi(e,n.fadeOutClass),Ei(e,n.fadeInClass),n.onShow(t)},VD=function(t,n){var e=t.element;Ei(e,n.transitionClass),Bi(e,n.fadeInClass),Ei(e,n.fadeOutClass),n.onHide(t)},PD=function(t,o,r){return W(t,function(t){switch(t){case"bottom":return e=r,o.bottom<=e.bottom;case"top":return n=r,o.y>=n.y}var n,e})},HD=function(n,t){return t.getInitialPosition().map(function(t){return Hu(t.bounds.x,t.bounds.y,_u(n),bu(n))})},zD=function(t,n,e){e.setInitialPosition(st.some({style:function(t){var n={},e=t.dom;if(Ii(e))for(var o=0;o<e.style.length;o++){var r=e.style.item(o);n[r]=e.style[r]}return n}(t),position:$i(t,"position")||"static",bounds:n}))},ND=function(e,o,r){return r.getInitialPosition().bind(function(t){switch(r.setInitialPosition(st.none()),t.position){case"static":return st.some(ID["static"]());case"absolute":var n=MD(e).map(zu).getOrThunk(function(){return zu(Wi())});return st.some(ID.absolute(vc("absolute",Ft(t.style,"left").map(function(t){return o.x-n.x}),Ft(t.style,"top").map(function(t){return o.y-n.y}),Ft(t.style,"right").map(function(t){return n.right-o.right}),Ft(t.style,"bottom").map(function(t){return n.bottom-o.bottom}))));default:return st.none()}})},LD=function(t,n,e){var o,r,i,u=t.element;return Zi(u,"position").is("fixed")?(r=n,HD(o=u,i=e).filter(function(t){return PD(i.getModes(),t,r)}).bind(function(t){return ND(o,t,i)})):function(t,n,e){var o=zu(t);if(PD(e.getModes(),o,n))return st.none();zD(t,o,e);var r=Lu(),i=o.x-r.x,u=n.y-r.y,a=r.bottom-n.bottom,c=o.y<=n.y;return st.some(ID.fixed(vc("fixed",st.some(i),c?st.some(u):st.none(),st.none(),c?st.none():st.some(a))))}(u,n,e)},jD=function(n,t){ft(["left","right","top","bottom","position"],function(t){return nu(n.element,t)}),t.onUndocked(n)},UD=function(t,n,e){bc(t.element,e),("fixed"===e.position?n.onDocked:n.onUndocked)(t)},WD=function(i,t,u,a,c){void 0===c&&(c=!1),t.contextual.each(function(r){r.lazyContext(i).each(function(t){var n,e,o=(e=a,(n=t).y<e.bottom&&n.bottom>e.y);o!==u.isVisible()&&(u.setVisible(o),c&&!o?(Mi(i.element,[r.fadeOutClass]),r.onHide(i)):(o?RD:VD)(i,r))})})},GD=function(n,e,t){var o,r,i=n.element;t.setDocked(!1),o=t,r=n.element,HD(r,o).bind(function(t){return ND(r,t,o)}).each(function(t){t.fold(function(){return jD(n,e)},function(t){return UD(n,e,t)},$)}),t.setVisible(!0),e.contextual.each(function(t){Fi(i,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(n)}),XD(n,e,t)},XD=function(t,n,e){var o,r,i,u,a;t.getSystem().isConnected()&&(o=t,i=e,u=(r=n).lazyViewport(o),(a=i.isDocked())&&WD(o,r,i,u),LD(o,u,i).each(function(t){i.setDocked(!a),t.fold(function(){return jD(o,r)},function(t){return UD(o,r,t)},function(t){WD(o,r,i,u,!0),UD(o,r,t)})}))},YD=function(t,n,e){e.isDocked()&&GD(t,n,e)},qD=/* */Object.freeze({__proto__:null,refresh:XD,reset:YD,isDocked:function(t,n,e){return e.isDocked()},getModes:function(t,n,e){return e.getModes()},setModes:function(t,n,e,o){return e.setModes(o)}}),KD=/* */Object.freeze({__proto__:null,events:function(o,r){return Zo([cr(bo(),function(n,e){o.contextual.each(function(t){Ai(n.element,t.transitionClass)&&(Fi(n.element,[t.transitionClass,t.fadeInClass]),(r.isVisible()?t.onShown:t.onHidden)(n)),e.stop()})}),er(Ro(),function(t,n){XD(t,o,r)}),er(Vo(),function(t,n){YD(t,o,r)})])}}),JD=[te("contextual",[Un("fadeInClass"),Un("fadeOutClass"),Un("transitionClass"),Gn("lazyContext"),ga("onShow"),ga("onShown"),ga("onHide"),ga("onHidden")]),ae("lazyViewport",Lu),ce("modes",["top","bottom"],Rn),ga("onDocked"),ga("onUndocked")],$D=ac({fields:JD,name:"docking",active:KD,apis:qD,state:/* */Object.freeze({__proto__:null,init:function(t){var n=fe(!1),e=fe(!0),o=fe(st.none()),r=fe(t.modes);return di({isDocked:n.get,setDocked:n.set,getInitialPosition:o.get,setInitialPosition:o.set,isVisible:e.get,setVisible:e.set,getModes:r.get,setModes:r.set,readState:function(){return"docked: "+n.get()+", visible: "+e.get()+", modes: "+r.get().join(",")}})}})}),QD={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},ZD="tox-tinymce--toolbar-sticky-on",tB="tox-tinymce--toolbar-sticky-off",nB=function(r){var i=r.element;kr(i).each(function(t){var n,e,o="padding-"+$D.getModes(r)[0];$D.isDocked(r)?(n=_u(t),qi(i,"width",n+"px"),qi(t,o,yu(e=i)+(parseInt($i(e,"margin-top"),10)||0)+(parseInt($i(e,"margin-bottom"),10)||0)+"px")):(nu(i,"width"),nu(t,o))})},eB=function(t,n){n?(Bi(t,QD.fadeOutClass),Mi(t,[QD.transitionClass,QD.fadeInClass])):(Bi(t,QD.fadeInClass),Mi(t,[QD.fadeOutClass,QD.transitionClass]))},oB=function(t,n){var e=me.fromDom(t.getContainer());n?(Ei(e,ZD),Bi(e,tB)):(Ei(e,tB),Bi(e,ZD))},rB=function(c,t){var n,i=fe(st.none()),o=t.getSink,u=function(n){o().each(function(t){return n(t.element)})},e=function(t){c.inline||nB(t),oB(c,$D.isDocked(t)),t.getSystem().broadcastOn([Sl()],{}),o().each(function(t){return t.getSystem().broadcastOn([Sl()],{})})},r=c.inline?[]:[fc.config({channels:((n={})[GT()]={onReceive:nB},n)})];return S([vg.config({}),$D.config({contextual:ut({lazyContext:function(t){var n,e,o=yu(t.element),r=c.inline?c.getContentAreaContainer():c.getContainer(),i=zu(me.fromDom(r)),u=i.height-o,a=i.y+(n=t,e="top",M($D.getModes(n),e)?0:o);return st.some(Hu(i.x,a,i.width,u))},onShow:function(){u(function(t){return eB(t,!0)})},onShown:function(r){u(function(t){return Fi(t,[QD.transitionClass,QD.fadeInClass])}),i.get().each(function(t){var n,e,o;n=r.element,o=yr(e=t),gc(o).filter(function(t){return!Ge(e,t)}).filter(function(t){return Ge(t,me.fromDom(o.dom.body))||Ye(n,t)}).each(function(){return mc(e)}),i.set(st.none())})},onHide:function(t){var n,e;i.set((n=t.element,e=o,pc(n).orThunk(function(){return e().toOptional().bind(function(t){return pc(t.element)})}))),u(function(t){return eB(t,!1)})},onHidden:function(){u(function(t){return Fi(t,[QD.transitionClass])})}},QD),modes:[t.header.getDockingMode()],onDocked:e,onUndocked:e})],r)},iB=/* */Object.freeze({__proto__:null,setup:function(t,n,e){t.inline||(n.header.isPositionedAtTop()||t.on("ResizeEditor",function(){e().each($D.reset)}),t.on("ResizeWindow ResizeEditor",function(){e().each(nB)}),t.on("SkinLoaded",function(){e().each(function(t){$D.isDocked(t)?$D.reset(t):$D.refresh(t)})}),t.on("FullscreenStateChanged",function(){e().each($D.reset)})),t.on("AfterScrollIntoView",function(y){e().each(function(t){$D.refresh(t);var n,e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b=t.element;tm(b)&&(n=y,r=yr(e=b),i=r.dom.defaultView.innerHeight,u=Au(r),a=me.fromDom(n.elm),c=Nu(a),s=bu(a),l=c.y,f=l+s,d=ku(e),m=bu(e),g=d.top,p=g+m,h=Math.abs(g-u.top)<2,v=Math.abs(p-(u.top+i))<2,h&&l<p?Mu(u.left,l-m,r):v&&g<f&&(o=l-i+s+m,Mu(u.left,o,r)))})}),t.on("PostRender",function(){oB(t,!1)})},isDocked:function(t){return t().map($D.isDocked).getOr(!1)},getBehaviours:rB}),uB=Yf({factory:function(n,o){var t={focus:ug.focusIn,setMenus:function(t,n){var e=V(n,function(n){var t={type:"menubutton",text:n.text,fetch:function(t){t(n.getItems())}},e=eE(t).mapError(function(t){return Dn(t)}).getOrDie();return WC(e,"tox-mbtn",o.backstage,st.some("menuitem"))});fg.set(t,e)}};return{uid:n.uid,dom:n.dom,components:[],behaviours:ic([fg.config({}),dg("menubar-events",[sr(function(t){n.onSetup(t)}),er(so(),function(e,t){Ku(e.element,".tox-mbtn--active").each(function(n){Ju(t.event.target,".tox-mbtn").each(function(t){Ge(n,t)||e.getSystem().getByDom(n).each(function(n){e.getSystem().getByDom(t).each(function(t){tw.expand(t),tw.close(n),vg.focus(t)})})})})}),er(Lo(),function(e,t){t.event.prevFocus.bind(function(t){return e.getSystem().getByDom(t).toOptional()}).each(function(n){t.event.newFocus.bind(function(t){return e.getSystem().getByDom(t).toOptional()}).each(function(t){tw.isOpen(n)&&(tw.expand(t),tw.close(n))})})})]),ug.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return n.onEscape(t),st.some(!0)}}),Jy.config({})]),apis:t,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Ln("dom"),Ln("uid"),Ln("onEscape"),Ln("backstage"),ne("onSetup",$)],apis:{focus:function(t,n){t.focus(n)},setMenus:function(t,n,e){t.setMenus(n,e)}}}),aB="container",cB=[Ll("slotBehaviours",[])],sB=function(t){return"<alloy.field."+t+">"},lB=function(r,t){var e,n=function(t){return Rf(r)},o=function(e,o){return function(t,n){return Af(t,r,n).map(function(t){return e(t,n)}).getOr(o)}},i=function(t,n){return"true"!==Nr(t.element,"aria-hidden")},u=o(i,!1),a=o(function(t,n){var e;i(t)&&(e=t.element,qi(e,"display","none"),zr(e,"aria-hidden","true"),qo(t,jo(),{name:n,visible:!1}))}),c=function(n,t){ft(t,function(t){return e(n,t)})},s=o(function(t,n){var e;i(t)||(e=t.element,nu(e,"display"),Ur(e,"aria-hidden"),qo(t,jo(),{name:n,visible:!0}))}),l={getSlotNames:n,getSlot:function(t,n){return Af(t,r,n)},isShowing:u,hideSlot:e=a,hideAllSlots:function(t){return c(t,n())},showSlot:s};return{uid:r.uid,dom:r.dom,components:t,behaviours:jl(r.slotBehaviours),apis:l}},fB=Tt({getSlotNames:function(t,n){return t.getSlotNames(n)},getSlot:function(t,n,e){return t.getSlot(n,e)},isShowing:function(t,n,e){return t.isShowing(n,e)},hideSlot:function(t,n,e){return t.hideSlot(n,e)},hideAllSlots:function(t,n){return t.hideAllSlots(n)},showSlot:function(t,n,e){return t.showSlot(n,e)}},li),dB=ut(ut({},fB),{sketch:function(t){var e,n=(e=[],{slot:function(t,n){return e.push(t),_f(aB,sB(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=V(r,function(t){return vf({name:t,pname:sB(t)})});return Lf(aB,cB,i,lB,o)}}),mB=fn([Qn("icon"),Qn("tooltip"),ae("onShow",$),ae("onHide",$),ae("onSetup",function(){return $})]),gB=function(t){return{element:function(){return t.element.dom}}},pB=function(e,o){var r=V(Ct(o),function(t){var n=o[t],e=Tn(_n("sidebar",mB,n));return{name:t,getApi:gB,onSetup:e.onSetup,onShow:e.onShow,onHide:e.onHide}});return V(r,function(t){var n=fe($);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Wh([Yv(t,n),qv(t,n),er(jo(),function(n,t){var e=t.event;L(r,function(t){return t.name===e.name}).each(function(t){(e.visible?t.onShow:t.onHide)(t.getApi(n))})})])})})},hB=function(t,e){td.getCurrent(t).each(function(t){return fg.set(t,[(n=e,dB.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:pB(t,n),slotBehaviours:Wh([sr(function(t){return dB.hideAllSlots(t)})])}}))]);var n})},vB=function(t){return td.getCurrent(t).bind(function(t){return zT.isGrowing(t)||zT.hasGrown(t)?td.getCurrent(t).bind(function(n){return L(dB.getSlotNames(n),function(t){return dB.isShowing(n,t)})}):st.none()})},bB=Kr("FixSizeEvent"),yB=Kr("AutoSizeEvent"),xB=function(t){var n,e,o,r=me.fromHtml(t),i=_r(r),u=(e=(n=r).dom.attributes!==undefined?n.dom.attributes:[],N(e,function(t,n){var e;return"class"===n.name?t:ut(ut({},t),((e={})[n.name]=n.value,e))},{})),a=(o=r,Array.prototype.slice.call(o.dom.classList,0)),c=0===i.length?{}:{innerHtml:Vr(r)};return ut({tag:mr(r),classes:a,attributes:u},c)},wB=function(t,n,e){var o=t.element;!0===n?(fg.set(t,[{dom:{tag:"div",attributes:{"aria-label":e.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:xB('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:ic([ug.config({mode:"special",onTab:function(){return st.some(!0)},onShiftTab:function(){return st.some(!0)}}),vg.config({})])}]),nu(o,"display"),Ur(o,"aria-hidden")):(fg.set(t,[]),qi(o,"display","none"),zr(o,"aria-hidden","true"))},SB=kD.optional({factory:uB,name:"menubar",schema:[Ln("backstage")]}),kB=kD.optional({factory:{sketch:function(t){return TD.sketch({uid:t.uid,dom:t.dom,listBehaviours:ic([ug.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return QT({type:t.type,uid:Kr("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),st.some(!0)}})},setupItem:function(t,n,e,o){eT.setGroups(n,e)},shell:!0})}},name:"multiple-toolbar",schema:[Ln("dom"),Ln("onEscape")]}),CB=kD.optional({factory:{sketch:function(t){var n;return((n=t).type===rh.sliding?$T:n.type===rh.floating?JT:QT)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),st.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[Ln("dom"),Ln("onEscape"),Ln("getSink")]}),OB=kD.optional({factory:{sketch:function(t){var n=t.editor,e=t.sticky?rB:BD;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:ic(e(n,t.sharedBackstage))}}},name:"header",schema:[Ln("dom")]}),_B=kD.optional({name:"socket",schema:[Ln("dom")]}),TB=kD.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:ic([Jy.config({}),vg.config({}),zT.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){td.getCurrent(t).each(dB.hideAllSlots),Yo(t,yB)},onGrown:function(t){Yo(t,yB)},onStartGrow:function(t){qo(t,bB,{width:Zi(t.element,"width").getOr("")})},onStartShrink:function(t){qo(t,bB,{width:_u(t.element)+"px"})}}),fg.config({}),td.config({find:function(t){var n=fg.contents(t);return K(n)}})])}],behaviours:ic([rk(0),dg("sidebar-sliding-events",[er(bB,function(t,n){qi(t.element,"width",n.event.width)}),er(yB,function(t,n){nu(t.element,"width")})])])}}},name:"sidebar",schema:[Ln("dom")]}),EB=kD.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:ic([fg.config({})]),components:[]}}},name:"throbber",schema:[Ln("dom")]}),DB=qf({name:"OuterContainer",factory:function(e,t,n){var o={getSocket:function(t){return SD.getPart(t,e,"socket")},setSidebar:function(t,n){SD.getPart(t,e,"sidebar").each(function(t){return hB(t,n)})},toggleSidebar:function(t,o){SD.getPart(t,e,"sidebar").each(function(t){return n=t,e=o,void td.getCurrent(n).each(function(n){td.getCurrent(n).each(function(t){zT.hasGrown(n)?dB.isShowing(t,e)?zT.shrink(n):(dB.hideAllSlots(t),dB.showSlot(t,e)):(dB.hideAllSlots(t),dB.showSlot(t,e),zT.grow(n))})});var n,e})},whichSidebar:function(t){return SD.getPart(t,e,"sidebar").bind(vB).getOrNull()},getHeader:function(t){return SD.getPart(t,e,"header")},getToolbar:function(t){return SD.getPart(t,e,"toolbar")},setToolbar:function(t,n){SD.getPart(t,e,"toolbar").each(function(t){t.getApis().setGroups(t,n)})},setToolbars:function(t,n){SD.getPart(t,e,"multiple-toolbar").each(function(t){TD.setItems(t,n)})},refreshToolbar:function(t){SD.getPart(t,e,"toolbar").each(function(t){return t.getApis().refresh(t)})},toggleToolbarDrawer:function(t){SD.getPart(t,e,"toolbar").each(function(n){var t,e;t=n.getApis().toggle,e=function(t){return t(n)},t!==undefined&&null!==t?st.some(e(t)):st.none()})},isToolbarDrawerToggled:function(t){return SD.getPart(t,e,"toolbar").bind(function(n){return st.from(n.getApis().isOpen).map(function(t){return t(n)})}).getOr(!1)},getThrobber:function(t){return SD.getPart(t,e,"throbber")},focusToolbar:function(t){SD.getPart(t,e,"toolbar").orThunk(function(){return SD.getPart(t,e,"multiple-toolbar")}).each(function(t){ug.focusIn(t)})},setMenubar:function(t,n){SD.getPart(t,e,"menubar").each(function(t){uB.setMenus(t,n)})},focusMenubar:function(t){SD.getPart(t,e,"menubar").each(function(t){uB.focus(t)})}};return{uid:e.uid,dom:e.dom,components:t,apis:o,behaviours:e.behaviours}},configFields:[Ln("dom"),Ln("behaviours")],partFields:[OB,SB,CB,kB,_B,TB,EB],apis:{getSocket:function(t,n){return t.getSocket(n)},setSidebar:function(t,n,e){t.setSidebar(n,e)},toggleSidebar:function(t,n,e){t.toggleSidebar(n,e)},whichSidebar:function(t,n){return t.whichSidebar(n)},getHeader:function(t,n){return t.getHeader(n)},getToolbar:function(t,n){return t.getToolbar(n)},setToolbar:function(t,n,e){var o=V(e,YT);t.setToolbar(n,o)},setToolbars:function(t,n,e){var o=V(e,function(t){return V(t,YT)});t.setToolbars(n,o)},refreshToolbar:function(t,n){return t.refreshToolbar(n)},toggleToolbarDrawer:function(t,n){t.toggleToolbarDrawer(n)},isToolbarDrawerToggled:function(t,n){return t.isToolbarDrawerToggled(n)},getThrobber:function(t,n){return t.getThrobber(n)},setMenubar:function(t,n,e){t.setMenubar(n,e)},focusMenubar:function(t,n){t.focusMenubar(n)},focusToolbar:function(t,n){t.focusToolbar(n)}}}),BB={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},AB=function(t){return"string"==typeof t?t.split(" "):t},MB=function(i,u){var a=ut(ut({},BB),u.menus),n=0<Ct(u.menus).length,t=u.menubar===undefined||!0===u.menubar?AB("file edit view insert format tools table help"):AB(!1===u.menubar?"":u.menubar),e=H(t,function(t){return n&&u.menus.hasOwnProperty(t)&&u.menus[t].hasOwnProperty("items")||BB.hasOwnProperty(t)}),o=V(e,function(t){var n,e,o,r=a[t];return n={title:r.title,items:AB(r.items)},e=u,o=i.getParam("removed_menuitems","").split(/[ ,]/),{text:n.title,getItems:function(){return U(n.items,function(t){var n=t.toLowerCase();return 0===n.trim().length||F(o,function(t){return t===n})?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]})}}});return H(o,function(t){return 0<t.getItems().length&&F(t.getItems(),function(t){return"separator"!==t.type})})},FB=function(t){var n=function(){t._skinLoaded=!0,t.fire("SkinLoaded")};return function(){t.initialized?n():t.on("init",n)}},IB=function(n,e){return function(){return t={message:e},n.fire("SkinLoadError",t);var t}},RB=function(e,o,r){return new Fp(function(t,n){r.load(o,t,n),e.on("remove",function(){return r.unload(o)})})},VB=function(t,n){var e;return(e=me.fromDom(t.getElement()),Ni(e).isSome())?RB(t,n+"/skin.shadowdom.min.css",Zh.DOM.styleSheetLoader):Fp.resolve()},PB=function(t,n){var e,o,r,i,u,a=(r=(e=n).getParam("skin"),i=e.getParam("skin_url"),!1!==r&&(o=r||"oxide",i=i?e.documentBaseURI.toAbsolute(i):pv.baseURL+"/skins/ui/"+o),i);a&&n.contentCSS.push(a+(t?"/content.inline":"/content")+".min.css"),!1==(!1===n.getParam("skin"))&&k(a)?Fp.all([RB(u=n,a+"/skin.min.css",u.ui.styleSheetLoader),VB(n,a)]).then(FB(n),IB(n,"Skin could not be loaded")):FB(n)()},HB=y(PB,!1),zB=y(PB,!0),NB=function(e,t,o,r){var n,i=t.outerContainer,u=o.toolbar,a=o.buttons;T(u,k)?(n=u.map(function(t){var n={toolbar:t,buttons:a,allowToolbarGroups:o.allowToolbarGroups};return hD(e,n,{backstage:r},st.none())}),DB.setToolbars(i,n)):DB.setToolbar(i,hD(e,o,{backstage:r},st.none()))},LB=je(),jB=LB.os.isiOS()&&LB.os.version.major<=12,UB=function(e,t){var n=e.dom,o=e.getWin(),r=e.getDoc().documentElement,i=fe(wu(o.innerWidth,o.innerHeight)),u=fe(wu(r.offsetWidth,r.offsetHeight)),a=function(){var t=i.get();t.left===o.innerWidth&&t.top===o.innerHeight||(i.set(wu(o.innerWidth,o.innerHeight)),Mb(e))},c=function(){var t=e.getDoc().documentElement,n=u.get();n.left===t.offsetWidth&&n.top===t.offsetHeight||(u.set(wu(t.offsetWidth,t.offsetHeight)),Mb(e))},s=function(t){return n=t,e.fire("ScrollContent",n);var n};n.bind(o,"resize",a),n.bind(o,"scroll",s);var l=xy(me.fromDom(e.getBody()),"load",c),f=t.uiMothership.element;e.on("hide",function(){qi(f,"display","none")}),e.on("show",function(){nu(f,"display")}),e.on("NodeChange",c),e.on("remove",function(){l.unbind(),n.unbind(o,"resize",a),n.unbind(o,"scroll",s),o=null})},WB=/* */Object.freeze({__proto__:null,render:function(e,n,t,o,r){var i=fe(0),u=n.outerContainer;HB(e);var a,c,s=me.fromDom(r.targetNode),l=zi(Hi(s));a=s,c=n.mothership,sl(a,c,Dr),cl(l,n.uiMothership),e.on("PostRender",function(){NB(e,n,t,o),i.set(e.getWin().innerWidth),DB.setMenubar(u,MB(e,t)),DB.setSidebar(u,t.sidebar),UB(e,n)});var f,d,m,g,p,h=DB.getSocket(u).getOrDie("Could not find expected socket element");jB&&(Ki(h.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"}),m=function(){e.fire("ScrollContent")},g=20,p=null,f={cancel:function(){null!==p&&(clearTimeout(p),p=null)},throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null===p&&(p=setTimeout(function(){m.apply(null,t),p=null},g))}},d=yy(h.element,"scroll",f.throttle),e.on("remove",d.unbind)),Nv(e,n),e.addCommand("ToggleSidebar",function(t,n){DB.toggleSidebar(u,n),e.fire("ToggleSidebar")}),e.addQueryValueHandler("ToggleSidebar",function(){return DB.whichSidebar(u)});var v=Ev(e);v!==rh.sliding&&v!==rh.floating||e.on("ResizeWindow ResizeEditor ResizeContent",function(){var t=e.getWin().innerWidth;t!==i.get()&&(DB.refreshToolbar(n.outerContainer),i.set(t))});var b={enable:function(){zv(n,!1)},disable:function(){zv(n,!0)},isDisabled:function(){return gv.isDisabled(u)}};return{iframeContainer:h.element.dom,editorContainer:u.element.dom,api:b}}}),GB=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?st.some(parseInt(""+t,10)):st.none()},XB=function(t){return lt(t)?t+"px":t},YB=function(n,t,e){var o=t.filter(function(t){return n<t}),r=e.filter(function(t){return t<n});return o.or(r).getOr(n)},qB=function(t){var n,e,o,r;return(e=hv(n=t),o=yv(n),r=wv(n),GB(e).map(function(t){return YB(t,o,r)})).getOr(hv(t))},KB=function(t){var n=vv(t),e=bv(t),o=xv(t);return GB(n).map(function(t){return YB(t,e,o)})},JB=function(a,c,t,n,s){var e=t.uiMothership,l=t.outerContainer,o=Zh.DOM,f=Fv(a),d=Vv(a),m=xv(a).or(KB(a)),r=n.shared.header,g=r.isPositionedAtTop,i=Ev(a),p=i===rh.sliding||i===rh.floating,u=fe(!1),h=function(){return u.get()&&!a.removed},v=function(t){return p?t.fold(function(){return 0},function(t){return 1<t.components().length?bu(t.components()[1].element):0}):0},b=function(){e.broadcastOn([Sl()],{})},y=function(t){var n,e,o,r,i,u;void 0===t&&(t=!1),h()&&(f||(n=m.getOrThunk(function(){var t=GB($i(Wi(),"margin-left")).getOr(0);return _u(Wi())-ku(c).left+t}),qi(s.get().element,"max-width",n+"px")),p&&DB.refreshToolbar(l),f||(e=DB.getToolbar(l),o=v(e),r=zu(c),i=g()?Math.max(r.y-bu(s.get().element)+o,0):r.bottom,Ki(l.element,{position:"absolute",top:Math.round(i)+"px",left:Math.round(r.x)+"px"})),d&&(u=s.get(),t?$D.reset(u):$D.refresh(u)),b())},x=function(t){var n,e;void 0===t&&(t=!0),!f&&d&&h()&&(n=r.getDockingMode(),(e=function(t){switch(Bv(a)){case _v.auto:var n=DB.getToolbar(l),e=v(n),o=bu(t.element)-e,r=zu(c);if(r.y>o)return"top";var i=wr(c),u=Math.max(i.dom.scrollHeight,bu(i));return r.bottom<u-o||Lu().bottom<r.bottom-o?"bottom":"top";case _v.bottom:return"bottom";case _v.top:default:return"top"}}(s.get()))!==n&&(function(t){var n=s.get();$D.setModes(n,[t]),r.setDockingMode(t);var e=g()?na.TopToBottom:na.BottomToTop;zr(n.element,jc,e)}(e),t&&y(!0)))};return{isVisible:h,isPositionedAtTop:g,show:function(){u.set(!0),qi(l.element,"display","flex"),o.addClass(a.getBody(),"mce-edit-focus"),nu(e.element,"display"),x(!1),y()},hide:function(){u.set(!1),t.outerContainer&&(qi(l.element,"display","none"),o.removeClass(a.getBody(),"mce-edit-focus")),qi(e.element,"display","none")},update:y,updateMode:x,repositionPopups:b}},$B=function(t,n){var e=zu(t);return{pos:n?e.y:e.bottom,bounds:e}},QB=/* */Object.freeze({__proto__:null,render:function(n,e,o,r,t){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=fe(null),s=me.fromDom(t.targetNode),l=JB(n,s,e,r,c),f=n.getParam("toolbar_persist",!1,"boolean");zB(n);var d=function(){var t;c.get()?l.show():(c.set(DB.getHeader(a).getOrDie()),t=Iv(n),cl(t,i),cl(t,u),NB(n,e,o,r),DB.setMenubar(a,MB(n,o)),l.show(),function(c,s,l,t){var f=fe($B(s,l.isPositionedAtTop())),n=function(t){var n=$B(s,l.isPositionedAtTop()),e=n.pos,o=n.bounds,r=f.get(),i=r.pos,u=r.bounds,a=o.height!==u.height||o.width!==u.width;f.set({pos:e,bounds:o}),a&&Mb(c,t),l.isVisible()&&(i!==e?l.update(!0):a&&(l.updateMode(),l.repositionPopups()))};t||(c.on("activate",l.show),c.on("deactivate",l.hide)),c.on("SkinLoaded ResizeWindow",function(){return l.update(!0)}),c.on("NodeChange keydown",function(t){dp.requestAnimationFrame(function(){return n(t)})}),c.on("ScrollWindow",function(){return l.updateMode()});var e=iD();e.set(xy(me.fromDom(c.getBody()),"load",n)),c.on("remove",function(){e.clear()})}(n,s,l,f),n.nodeChanged())};n.on("show",d),n.on("hide",l.hide),f||(n.on("focus",d),n.on("blur",l.hide)),n.on("init",function(){(n.hasFocus()||f)&&d()}),Nv(n,e);var m={show:function(){l.show()},hide:function(){l.hide()},enable:function(){zv(e,!1)},disable:function(){zv(e,!0)},isDisabled:function(){return gv.isDisabled(a)}};return{editorContainer:a.element.dom,api:m}}}),ZB=function(t,n){var e,o,r,i,u,a,c,s,l,f,d,m,g,p;r=PE(0,o=n,YE(e=t)),e.ui.registry.addNestedMenuItem("align",{text:o.shared.providers.translate("Align"),getSubmenuItems:function(){return r.items.validateItems(r.getStyleItems())}}),a=PE(0,u=n,$E(i=t)),i.ui.registry.addNestedMenuItem("fontformats",{text:u.shared.providers.translate("Fonts"),getSubmenuItems:function(){return a.items.validateItems(a.getStyleItems())}}),c=t,l=ut({type:"advanced"},(s=n).styleselect),f=PE(0,s,sD(c,l)),c.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return f.items.validateItems(f.getStyleItems())}}),m=PE(0,n,cD(d=t)),d.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return m.items.validateItems(m.getStyleItems())}}),p=PE(0,n,nD(g=t)),g.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return p.items.validateItems(p.getStyleItems())}})},tA=function(t,n){return function(){t.execCommand("mceToggleFormat",!1,n)}},nA=function(t){var n,e;!function(e){ck.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(t,n){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:uD(e,t.name),onAction:tA(e,t.name)})});for(var t=1;t<=6;t++){var n="h"+t;e.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+t,onSetup:uD(e,n),onAction:tA(e,n)})}}(t),n=t,ck.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],function(t){n.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return n.execCommand(t.action)}})}),e=t,ck.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return e.execCommand(t.action)},onSetup:uD(e,t.name)})})},eA=function(t){var n;nA(t),n=t,ck.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],function(t){n.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:function(){return n.execCommand(t.action)}})}),n.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:tA(n,"code")})},oA=function(t,n,e){var o=function(){return!!n.undoManager&&n.undoManager[e]()},r=function(){t.setDisabled(n.mode.isReadOnly()||!o())};return t.setDisabled(!o()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r),function(){return n.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r)}},rA=function(t){var n,e;(n=t).ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(t){return oA(t,n,"hasUndo")},onAction:function(){return n.execCommand("undo")}}),n.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(t){return oA(t,n,"hasRedo")},onAction:function(){return n.execCommand("redo")}}),(e=t).ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(t){return oA(t,e,"hasUndo")},onAction:function(){return e.execCommand("undo")}}),e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(t){return oA(t,e,"hasRedo")},onAction:function(){return e.execCommand("redo")}})},iA={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},uA=(NE="[eE][+-]?[0-9]+",jE=["Infinity",(zE="[0-9]+")+"\\."+(LE=function(t){return"(?:"+t+")?"})(zE)+LE(NE),"\\."+zE+LE(NE),zE+LE(NE)].join("|"),new RegExp("^([+-]?(?:"+jE+"))(.*)$")),aA=function(t,r){return st.from(uA.exec(t)).bind(function(t){var n,e=Number(t[1]),o=t[2];return n=o,F(r,function(t){return F(iA[t],function(t){return n===t})})?st.some({value:e,unit:o}):st.none()})},cA=function(t){return aA(t,["fixed","relative","empty"]).map(function(t){return t.value+t.unit}).getOr(t)},sA=function(o){var r=o.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" "),i=new Map,u=rD(),a=function(){var t=cA(o.queryCommandValue("LineHeight"));st.from(i.get(t)).fold(function(){return u.clear()},function(t){u.set({destroy:function(){t.setActive(!1)}}),t.setActive(!0)})};return o.on("nodeChange",a),V(r,function(n,e){return{type:"togglemenuitem",text:n,onSetup:function(t){return i.set(cA(n),t),e+1===r.length&&a(),function(){0===e&&(o.off("nodeChange",a),u.clear())}},onAction:function(){return o.execCommand("LineHeight",!1,n)}}})},lA=function(t){var n,e;(n=t).ui.registry.addNestedMenuItem("lineheight",{type:"nestedmenuitem",text:"Line height",getSubmenuItems:function(){return sA(n)}}),(e=t).ui.registry.addMenuButton("lineheight",{tooltip:"Line height",icon:"line-height",fetch:function(t){return t(sA(e))}})},fA=function(t,n){var e,o,r,i;!function(n){ck.each([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],function(t){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,onAction:function(){return n.execCommand(t.cmd)},icon:t.icon,onSetup:uD(n,t.name)})});var t="alignnone",e="No alignment",o="JustifyNone",r="align-none";n.ui.registry.addButton(t,{tooltip:e,onAction:function(){return n.execCommand(o)},icon:r})}(t),eA(t),ZB(t,n),rA(t),function(t){Lb(t);var n=fe(null),e=fe(null);Yb(t,"forecolor","forecolor","Text color",n),Yb(t,"backcolor","hilitecolor","Background color",e),qb(t,"forecolor","forecolor","Text color"),qb(t,"backcolor","hilitecolor","Background color")}(t),(o=e=t).ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return o.execCommand("mceToggleVisualAid")}}),(r=e).ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(t){return function(n,t){n.setActive(t.hasVisual);var e=function(t){n.setActive(t.hasVisual)};return t.on("VisualAid",e),function(){return t.off("VisualAid",e)}}(t,r)},onAction:function(){r.execCommand("mceToggleVisualAid")}}),(i=t).ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(t){return function(t,n){t.setDisabled(!n.queryCommandState("outdent"));var e=function(){t.setDisabled(!n.queryCommandState("outdent"))};return n.on("NodeChange",e),function(){return n.off("NodeChange",e)}}(t,i)},onAction:function(){return i.execCommand("outdent")}}),i.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return i.execCommand("indent")}}),lA(t)},dA=function(t,n){return{anchor:"makeshift",x:t,y:n}},mA=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},gA=function(t,n){var e,o,r,i=Zh.DOM.getPos(t);return e=n,o=i.x,r=i.y,dA(e.x+o,e.y+r)},pA=function(t,n){return"contextmenu"===n.type||"longpress"===n.type?t.inline?function(t){if(mA(t)){var n=t.touches[0];return dA(n.pageX,n.pageY)}return dA(t.pageX,t.pageY)}(n):gA(t.getContentAreaContainer(),function(t){if(mA(t)){var n=t.touches[0];return dA(n.clientX,n.clientY)}return dA(t.clientX,t.clientY)}(n)):hA(t)},hA=function(t){return{anchor:"selection",root:me.fromDom(t.selection.getNode())}},vA=function(t){return{anchor:"node",node:st.some(me.fromDom(t.selection.getNode())),root:me.fromDom(t.getBody())}},bA=function(t,n,e,o,r,i){var u=e(),a=i?vA(t):pA(t,n);jC(u,uh.CLOSE_ON_EXECUTE,o,!1).map(function(t){n.preventDefault(),tp.showMenuAt(r,a,{menu:{markers:yh("normal")},data:t})})},yA={onLtr:function(){return[Ua,Ha,za,Na,La,ja,lp,fp,cp,up,sp,ap]},onRtl:function(){return[Ua,za,Ha,La,Na,ja,lp,fp,sp,ap,cp,up]}},xA={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},wA=function(n,e,t,o,r,i,u){var a,c,s=i?vA(n):(a=n,c=e,ut({bubble:Hc(0,12,xA),layouts:yA,overrides:{maxWidthFunction:Q_(),maxHeightFunction:Fc()}},pA(a,c)));jC(t,uh.CLOSE_ON_EXECUTE,o,!0).map(function(t){e.preventDefault(),tp.showMenuWithinBounds(r,s,{menu:{markers:yh("normal"),highlightImmediately:u},data:t,type:"horizontal"},function(){return st.some(EE(n,o.shared))}),n.fire(Z_)})},SA=function(n,e,o,r,i,u){var t,a=je(),c=a.os.isiOS(),s=a.os.isOSX(),l=a.os.isAndroid(),f=a.deviceType.isTouch(),d=function(){var t=o();wA(n,e,t,r,i,u,!(l||c||s&&f))};!s&&!c||u?(l&&!u&&n.selection.setCursorLocation(e.target,0),d()):(t=function(){!function(t){var n=t.selection.getRng(),e=function(){dp.setEditorTimeout(t,function(){t.selection.setRng(n)},10),i()};t.once("touchend",e);var o=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",o,!0);var r=function(){return i()};t.once("longpresscancel",r);var i=function(){t.off("touchend",e),t.off("longpresscancel",r),t.off("mousedown",o)}}(n),d()},!function(t,n){var e=t.selection;if(e.isCollapsed()||n.touches.length<1)return!1;var o=n.touches[0],r=e.getRng();return bs(t.getWin(),Qc.domRange(r)).exists(function(t){return t.left<=o.clientX&&t.right>=o.clientX&&t.top<=o.clientY&&t.bottom>=o.clientY})}(n,e)?(n.once("selectionchange",t),n.once("touchend",function(){return n.off("selectionchange",t)})):t())},kA=function(t){return"string"==typeof t?t.split(/[ ,]/):t},CA=function(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")},OA=function(t){return e="contextmenu",o="link linkchecker image imagetools table spellchecker configurepermanentpen",r=(n=t).ui.registry.getAll().contextMenus,st.from(n.getParam(e)).map(kA).getOrThunk(function(){return H(kA(o),function(t){return It(r,t)})});var n,e,o,r},_A=function(t){return k(t)?"|"===t:"separator"===t.type},TA={type:"separator"},EA=function(n){if(k(n))return n;switch(n.type){case"separator":return TA;case"submenu":return{type:"nestedmenuitem",text:n.text,icon:n.icon,getSubmenuItems:function(){var t=n.getSubmenuItems();return k(t)?t:V(t,EA)}};default:return{type:"menuitem",text:n.text,icon:n.icon,onAction:(t=n.onAction,function(){return t()})}}var t},DA=function(t,n){if(0===n.length)return t;var e=J(t).filter(function(t){return!_A(t)}).fold(function(){return[]},function(t){return[TA]});return t.concat(e).concat(n).concat([TA])},BA=function(t,n){return"longpress"!==n.type&&(2!==n.button||n.target===t.getBody()&&""===n.pointerType)},AA=function(t,n){return BA(t,n)?t.selection.getStart(!0):n.target},MA=function(a,t,e){var o=je().deviceType.isTouch,r=gu(tp.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return a.focus()},onShow:function(){return e.setContextMenuState(!0)},onHide:function(){return e.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:ic([dg("dismissContextMenu",[er(zo(),function(t,n){xl.close(t),a.focus()})])])})),n=function(t){return tp.hide(r)},i=function(u){var t,n;CA(a)&&u.preventDefault(),t=a,u.ctrlKey&&!CA(t)||!1===a.getParam("contextmenu")||(n=function(t,n){var e=t.getParam("contextmenu_avoid_overlap","","string");if(BA(t,n))return!0;if(e){var o=AA(t,n);return Sy(me.fromDom(o),e)}return!1}(a,u),(o()?SA:bA)(a,u,function(){var r,i,t,n=AA(a,u),e=a.ui.registry.getAll(),o=OA(a);return r=e.contextMenus,i=n,0<(t=N(o,function(t,n){if(It(r,n)){var e=r[n].update(i);if(k(e))return DA(t,e.split(" "));if(0<e.length){var o=V(e,EA);return DA(t,o)}return t}return t.concat([n])},[])).length&&_A(t[t.length-1])&&t.pop(),t},e,r,n))};a.on("init",function(){var t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");a.on(t,n),a.on("longpress contextmenu",i)})},FA=Vt([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),IA=function(n){return function(t){return t.translate(-n.left,-n.top)}},RA=function(n){return function(t){return t.translate(n.left,n.top)}},VA=function(e){return function(t,n){return N(e,function(t,n){return n(t)},wu(t,n))}},PA=function(t,n,e){return t.fold(VA([RA(e),IA(n)]),VA([IA(n)]),VA([]))},HA=function(t,n,e){return t.fold(VA([RA(e)]),VA([]),VA([RA(n)]))},zA=function(t,n,e){return t.fold(VA([]),VA([IA(e)]),VA([RA(n),IA(e)]))},NA=function(t,n,e){var o=t.fold(function(t,n){return{position:st.some("absolute"),left:st.some(t+"px"),top:st.some(n+"px")}},function(t,n){return{position:st.some("absolute"),left:st.some(t-e.left+"px"),top:st.some(n-e.top+"px")}},function(t,n){return{position:st.some("fixed"),left:st.some(t+"px"),top:st.some(n+"px")}});return ut({right:st.none(),bottom:st.none()},o)},LA=function(t,i,u,a){var n=function(o,r){return function(t,n){var e=o(i,u,a);return r(t.getOr(e.left),n.getOr(e.top))}};return t.fold(n(zA,jA),n(HA,UA),n(PA,WA))},jA=FA.offset,UA=FA.absolute,WA=FA.fixed,GA=function(t,n){var e=Nr(t,n);return h(e)?NaN:parseInt(e,10)},XA=function(t,n,e,o){return r=n,i=t.element,u=GA(i,r.leftAttr),a=GA(i,r.topAttr),(isNaN(u)||isNaN(a)?st.none():st.some(wu(u,a))).fold(function(){return e},function(t){return WA(t.left+o.left,t.top+o.top)});var r,i,u,a},YA=function(t,n,e,o,r,i){var u,a,c,s=XA(t,n,e,o),l=(n.mustSnap?JA:$A)(t,n,s,r,i),f=PA(s,r,i);return u=n,a=f,c=t.element,zr(c,u.leftAttr,a.left+"px"),zr(c,u.topAttr,a.top+"px"),l.fold(function(){return{coord:WA(f.left,f.top),extra:st.none()}},function(t){return{coord:t.output,extra:t.extra}})},qA=function(t,n){var e,o;e=n,o=t.element,Ur(o,e.leftAttr),Ur(o,e.topAttr)},KA=function(t,l,f,d){return Z(t,function(t){var n,e,o,r,i,u,a,c,s=t.sensor;return(n=l,e=s,o=t.range.left,r=t.range.top,a=HA(n,i=f,u=d),c=HA(e,i,u),Math.abs(a.left-c.left)<=o&&Math.abs(a.top-c.top)<=r)?st.some({output:LA(t.output,l,f,d),extra:t.extra}):st.none()})},JA=function(t,n,d,m,g){var e=n.getSnapPoints(t);return KA(e,d,m,g).orThunk(function(){return N(e,function(n,e){var t,o,r,i,u,a,c,s,l=e.sensor,f=(t=d,o=l,e.range.left,e.range.top,u=HA(t,r=m,i=g),a=HA(o,r,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top),wu(c,s));return n.deltas.fold(function(){return{deltas:st.some(f),snap:st.some(e)}},function(t){return(f.left+f.top)/2<=(t.left+t.top)/2?{deltas:st.some(f),snap:st.some(e)}:n})},{deltas:st.none(),snap:st.none()}).snap.map(function(t){return{output:LA(t.output,d,m,g),extra:t.extra}})})},$A=function(t,n,e,o,r){var i=n.getSnapPoints(t);return KA(i,e,o,r)},QA=/* */Object.freeze({__proto__:null,snapTo:function(t,n,e,o){var r,i,u,a,c,s,l,f,d=n.getTarget(t.element);n.repositionTarget&&(r=yr(t.element),i=Au(r),u=FD(d),l=i,f=u,a={coord:LA((s=o).output,s.output,l,f),extra:s.extra},c=NA(a.coord,0,u),Ji(d,c))}}),ZA="data-initial-z-index",tM=function(t,n){var e;t.getSystem().addToGui(n),kr((e=n).element).filter(pr).each(function(n){Zi(n,"z-index").each(function(t){zr(n,ZA,t)}),qi(n,"z-index",$i(e.element,"z-index"))})},nM=function(t){kr(t.element).filter(pr).each(function(n){Lr(n,ZA).fold(function(){return nu(n,"z-index")},function(t){return qi(n,"z-index",t)}),Ur(n,ZA)}),t.getSystem().removeFromGui(t)},eM=function(t,n,e){return t.getSystem().build(Uy.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[n]},events:e}))},oM=te("snaps",[Ln("getSnapPoints"),ga("onSensor"),Ln("leftAttr"),Ln("topAttr"),ne("lazyViewport",Lu),ne("mustSnap",!1)]),rM=[ne("useFixed",c),Ln("blockerClass"),ne("getTarget",ct),ne("onDrag",$),ne("repositionTarget",!0),ne("onDrop",$),ae("getBounds",Lu),oM],iM=function(n){return t=Zi(n,"left"),e=Zi(n,"top"),o=Zi(n,"position"),r=function(t,n,e){return("fixed"===e?WA:jA)(parseInt(t,10),parseInt(n,10))},(t.isSome()&&e.isSome()&&o.isSome()?st.some(r(t.getOrDie(),e.getOrDie(),o.getOrDie())):st.none()).getOrThunk(function(){var t=ku(n);return UA(t.left,t.top)});var t,e,o,r},uM=function(e,t,i,u,a,c,n){var o,r,s,l,f,d,m,g,p,h=t.fold(function(){var t,e,o,n=(t=i,e=c.left,o=c.top,t.fold(function(t,n){return jA(t+e,n+o)},function(t,n){return UA(t+e,n+o)},function(t,n){return WA(t+e,n+o)})),r=PA(n,u,a);return WA(r.left,r.top)},function(n){var t=YA(e,n,i,c,u,a);return t.extra.each(function(t){n.onSensor(e,t)}),t.coord});return o=h,r=u,s=a,f=(l=n).bounds,d=HA(o,r,s),m=_c(d.left,f.x,f.x+f.width-l.width),g=_c(d.top,f.y,f.y+f.height-l.height),p=UA(m,g),o.fold(function(){var t=zA(p,r,s);return jA(t.left,t.top)},function(){return p},function(){var t=PA(p,r,s);return WA(t.left,t.top)})},aM=function(t,n){return{bounds:t.getBounds(),height:yu(n.element),width:Tu(n.element)}},cM=function(d,m,t,n,e){var o=t.update(n,e),g=t.getStartData().getOrThunk(function(){return aM(m,d)});o.each(function(t){var n,e,o,r,i,u,a,c,s,l,f;n=d,o=g,r=t,f=(e=m).getTarget(n.element),e.repositionTarget&&(i=yr(n.element),u=Au(i),a=FD(f),c=iM(f),s=uM(n,e.snaps,c,u,a,r,o),l=NA(s,0,a),Ji(f,l)),e.onDrag(n,f,r)})},sM=function(n,t,e,o){t.each(nM),e.snaps.each(function(t){qA(n,t)});var r=e.getTarget(n.element);o.reset(),e.onDrop(n,r)},lM=function(t){return function(n,e){var o=function(t){e.setStartData(aM(n,t))};return Zo(S([er(Ro(),function(t){e.getStartData().each(function(){return o(t)})})],t(n,e,o)))}},fM=/* */Object.freeze({__proto__:null,getData:function(t){return st.from(wu(t.x,t.y))},getDelta:function(t,n){return wu(n.left-t.left,n.top-t.top)}}),dM=function(a,c,s){return[er(io(),function(n,t){var e,o,r,i,u;0===t.event.raw.button&&(t.stop(),r={drop:e=function(){return sM(n,st.some(i),a,c)},delayDrop:(o=ky(e,200)).schedule,forceDrop:e,move:function(t){o.cancel(),cM(n,a,c,fM,t)}},i=eM(n,a.blockerClass,(u=r,Zo([er(io(),u.forceDrop),er(co(),u.drop),er(uo(),function(t,n){u.move(n.event)}),er(ao(),u.delayDrop)]))),s(n),tM(n,i))})]},mM=S(rM,[ba("dragger",{handlers:lM(dM)})]),gM=/* */Object.freeze({__proto__:null,getData:function(t){var n,e=t.raw.touches;return 1===e.length?(n=e[0],st.some(wu(n.clientX,n.clientY))):st.none()},getDelta:function(t,n){return wu(n.left-t.left,n.top-t.top)}}),pM=function(u,a,c){var s=fe(st.none());return[er(no(),function(n,t){t.stop();var e,o=function(){sM(n,s.get(),u,a),s.set(st.none())},r={drop:o,delayDrop:function(){},forceDrop:o,move:function(t){cM(n,u,a,gM,t)}},i=eM(n,u.blockerClass,(e=r,Zo([er(no(),e.forceDrop),er(oo(),e.drop),er(ro(),e.drop),er(eo(),function(t,n){e.move(n.event)})])));s.set(st.some(i));c(n),tM(n,i)}),er(eo(),function(t,n){n.stop(),cM(t,u,a,gM,n.event)}),er(oo(),function(t,n){n.stop(),sM(t,s.get(),u,a),s.set(st.none())}),er(ro(),function(t){sM(t,s.get(),u,a),s.set(st.none())})]},hM=S(rM,[ba("dragger",{handlers:lM(pM)})]),vM=S(rM,[ba("dragger",{handlers:lM(function(t,n,e){return S(dM(t,n,e),pM(t,n,e))})})]),bM=sc({branchKey:"mode",branches:/* */Object.freeze({__proto__:null,mouse:mM,touch:hM,mouseOrTouch:vM}),name:"dragging",active:{events:function(t,n){return t.dragger.handlers(t,n)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:st.from(t.extra)}}},state:/* */Object.freeze({__proto__:null,init:function(){var i=st.none(),n=st.none(),t=at({});return di({readState:t,reset:function(){i=st.none(),n=st.none()},update:function(r,t){return r.getData(t).bind(function(t){return n=r,e=t,o=i.map(function(t){return n.getDelta(t,e)}),i=st.some(e),o;var n,e,o})},getStartData:function(){return n},setStartData:function(t){n=st.some(t)}})}}),apis:QA}),yM=function(t,r,i,u,n,e){return t.fold(function(){return bM.snap({sensor:UA(i-20,u-20),range:wu(n,e),output:UA(st.some(i),st.some(u)),extra:{td:r}})},function(t){var n=i-20,e=u-20,o=t.element.dom.getBoundingClientRect();return bM.snap({sensor:UA(n,e),range:wu(40,40),output:UA(st.some(i-o.width/2),st.some(u-o.height/2)),extra:{td:r}})})},xM=function(t,i,u){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,n){var e,o,r=n.td;e=i.get(),o=r,e.exists(function(t){return Ge(t,o)})||(i.set(st.some(r)),u(r))},mustSnap:!0}},wM=function(t){return gp(mp.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:ic([bM.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),nw.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},SM=function(c,e){var o=fe([]),r=fe([]),t=fe(!1),i=fe(st.none()),u=fe(st.none()),n=function(t){var n=Nu(t);return yM(f.getOpt(e),t,n.x,n.y,n.width,n.height)},a=function(t){var n=Nu(t);return yM(d.getOpt(e),t,n.right,n.bottom,n.width,n.height)},s=xM(function(){return V(o.get(),n)},i,function(n){u.get().each(function(t){c.fire("TableSelectorChange",{start:n,finish:t})})}),l=xM(function(){return V(r.get(),a)},u,function(n){i.get().each(function(t){c.fire("TableSelectorChange",{start:t,finish:n})})}),f=wM(s),d=wM(l),m=gu(f.asSpec()),g=gu(d.asSpec()),p=function(t,n,e,o){var r=e(n);bM.snapTo(t,r);!function(t,n,e,o){var r=n.dom.getBoundingClientRect();nu(t.element,"display");var i=Sr(me.fromDom(c.getBody())).dom.innerHeight,u=e(r),a=o(r,i);(u||a)&&qi(t.element,"display","none")}(t,n,function(t){return t[o]<0},function(t,n){return t[o]>n})},h=function(t){return p(m,t,n,"top")},v=function(t){return p(g,t,a,"bottom")};je().deviceType.isTouch()&&(c.on("TableSelectionChange",function(n){t.get()||(ol(e,m),ol(e,g),t.set(!0)),i.set(st.some(n.start)),u.set(st.some(n.finish)),n.otherCells.each(function(t){o.set(t.upOrLeftCells),r.set(t.downOrRightCells),h(n.start),v(n.finish)})}),c.on("ResizeEditor ResizeWindow ScrollContent",function(){i.get().each(h),u.get().each(v)}),c.on("TableSelectionClear",function(){t.get()&&(ul(m),ul(g),t.set(!1)),i.set(st.none()),u.set(st.none())}))};(WE=UE=UE||{})[WE.None=0]="None",WE[WE.Both=1]="Both",WE[WE.Vertical=2]="Vertical";var kM,CM,OM,_M=function(t,n,e){var o,r,i,u,a,c,s=me.fromDom(t.getContainer()),l=(o=t,r=n,i=e,u=bu(s),a=_u(s),(c={}).height=YB(u+r.top,yv(o),wv(o)),i===UE.Both&&(c.width=YB(a+r.left,bv(o),xv(o))),c);_t(l,function(t,n){return qi(s,n,XB(t))}),t.fire("ResizeEditor")},TM=function(i,u,a){u.delimiter||(u.delimiter="\xbb");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ic([ug.config({mode:"flow",selector:"div[role=button]"}),gv.config({disabled:a.isDisabled}),Lv(),Jy.config({}),fg.config({}),dg("elementPathEvents",[sr(function(r,t){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return ug.focusIn(r)}),i.on("NodeChange",function(t){var n,o,e=function(t){for(var n=[],e=t.length;0<e--;){var o=t[e];if(1===o.nodeType&&!function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1}(o)){var r=i.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||n.push({name:r.name,element:o}),r.isPropagationStopped())break}}return n}(t.parents);0<e.length?fg.set(r,(n=V(e||[],function(n,t){return mp.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":t,"tab-index":-1,"aria-level":t+1},innerHtml:n.name},action:function(t){i.focus(),i.selection.select(n.element),i.nodeChanged()},buttonBehaviours:ic([Uv(a.isDisabled),Lv()])})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+u.delimiter+" "}},N(n.slice(1),function(t,n){var e=t;return e.push(o),e.push(n),e},[n[0]]))):fg.set(r,[])})})])]),components:[]}},EM=function(u,a){var t,n,e,o,r,i;return{dom:{tag:"div",classes:["tox-statusbar"]},components:(r=function(){var t,o,n,r,e,i=[];return u.getParam("elementpath",!0,"boolean")&&i.push(TM(u,{},a)),u.hasPlugin("wordcount")&&i.push((t=u,o=a,r=function(t,n,e){return fg.set(t,[fu(o.translate(["{0} "+e,n[e]]))])},mp.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:ic([Uv(o.isDisabled),Lv(),Jy.config({}),fg.config({}),Nl.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),dg("wordcount-events",[dr(function(t){var n=Nl.getValue(t),e="words"===n.mode?"characters":"words";Nl.setValue(t,{mode:e,count:n.count}),r(t,n.count,e)}),sr(function(e){t.on("wordCountUpdate",function(t){var n=Nl.getValue(e).mode;Nl.setValue(e,{mode:n,count:t.wordCount}),r(e,t.wordCount,n)})})])]),eventOrder:((n={})[_o()]=["disabling","alloy.base.behaviour","wordcount-events"],n)}))),u.getParam("branding",!0,"boolean")&&i.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce&utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(e=tv.translate(["Powered by {0}","Tiny"]))+'">'+e+"</a>"}}),0<i.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:i}]:[]}(),n=!(t=u).hasPlugin("autoresize"),(i=!1===(e=t.getParam("resize",n))?UE.None:"both"===e?UE.Both:UE.Vertical)!==UE.None&&r.push((o=i,{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:a.translate("Resize"),"aria-hidden":"true"},innerHtml:hp("resize-handle",a.icons)},behaviours:ic([bM.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,n,e){_M(u,e,o)},blockerClass:"tox-blocker"})])})),r)}},DM=function(x){var t,n,e,o,r=x.inline,w=r?QB:WB,S=Vv(x)?iB:AD,i=st.none(),u=je(),a=u.browser.isIE()?["tox-platform-ie"]:[],c=u.deviceType.isTouch()?["tox-platform-touch"]:[],s=Av(x),l=Iv(x),f=tv.isRtl()?{attributes:{dir:"rtl"}}:{},d={attributes:((t={})[jc]=s?na.BottomToTop:na.TopToBottom,t)},k=function(){return i.bind(DB.getHeader)},m=function(){qi(rt.element,"width",document.body.clientWidth+"px")},C=gu((n=Ge(Wi(),l)&&"grid"===$i(l,"display"),e={dom:ut({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(a).concat(c)},f),behaviours:ic([Qs.config({useFixed:function(){return S.isDocked(k)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:Zo([er(Vo(),m)])},zt(e,n?o:{}))),O=function(){return mt.value(C)},g=gp({dom:{tag:"div",classes:["tox-anchorbar"]}}),_=function(){return i.bind(function(t){return DB.getThrobber(t)}).getOrDie("Could not find throbber element")},T=$_(C,x,function(){return i.bind(function(t){return g.getOpt(t)}).getOrDie("Could not find a anchor bar element")}),p=DB.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:T,onEscape:function(){x.focus()}}),E=Ev(x),h=DB.parts.toolbar(ut({dom:{tag:"div",classes:["tox-toolbar"]},getSink:O,providers:T.shared.providers,onEscape:function(){x.focus()},type:E,lazyToolbar:function(){return i.bind(function(t){return DB.getToolbar(t)}).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return k().getOrDie("Could not find header element")}},d)),v=DB.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:T.shared.providers,onEscape:function(){x.focus()},type:E}),b=DB.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),y=DB.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),D=DB.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:T}),B=x.getParam("statusbar",!0,"boolean")&&!r?st.some(EM(x,T.shared.providers)):st.none(),A={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[b,y]},M=Ov(x),F=kv(x),I=Sv(x),R=DB.parts.header({dom:ut({tag:"div",classes:["tox-editor-header"]},d),components:dt([I?[p]:[],M?[v]:F?[h]:[],Fv(x)?[]:[g.asSpec()]]),sticky:Vv(x),editor:x,sharedBackstage:T.shared}),V=dt([s?[]:[R],r?[]:[A],s?[R]:[]]),P=dt([[{dom:{tag:"div",classes:["tox-editor-container"]},components:V}],r?[]:B.toArray(),[D]]),H=Rv(x),z=ut(ut({role:"application"},tv.isRtl()?{dir:"rtl"}:{}),H?{"aria-hidden":"true"}:{}),N=gu(DB.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(r?["tox-tinymce-inline"]:[]).concat(s?["tox-tinymce--toolbar-bottom"]:[]).concat(c).concat(a),styles:ut({visibility:"hidden"},H?{opacity:"0",border:"0"}:{}),attributes:z},components:P,behaviours:ic([Lv(),gv.config({disableClass:"tox-tinymce--disabled"}),ug.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a"})])})),i=st.some(N);x.shortcuts.add("alt+F9","focus menubar",function(){DB.focusMenubar(N)}),x.shortcuts.add("alt+F10","focus toolbar",function(){DB.focusToolbar(N)}),x.addCommand("ToggleToolbarDrawer",function(){DB.toggleToolbarDrawer(N)}),x.addQueryStateHandler("ToggleToolbarDrawer",function(){return DB.isToolbarDrawerToggled(N)});var L,j,U,W,G,X,Y,q,K,J,$,Q,Z,tt,nt,et,ot=Wy(N),rt=Wy(C);L=x,j=ot,U=rt,W=function(n,e){ft([j,U],function(t){t.broadcastEvent(n,e)})},G=function(n,e){ft([j,U],function(t){t.broadcastOn([n],e)})},X=function(t){return G(wl(),{target:t.target})},Y=yy(me.fromDom(document),"touchstart",X),q=yy(me.fromDom(document),"touchmove",function(t){return W(Fo(),t)}),K=yy(me.fromDom(document),"touchend",function(t){return W(Io(),t)}),J=yy(me.fromDom(document),"mousedown",X),$=yy(me.fromDom(document),"mouseup",function(t){0===t.raw.button&&G(kl(),{target:t.target})}),Q=function(t){return G(wl(),{target:me.fromDom(t.target)})},Z=function(t){0===t.button&&G(kl(),{target:me.fromDom(t.target)})},tt=function(t){return W(Ro(),wy(t))},nt=function(t){G(Sl(),{}),W(Vo(),wy(t))},et=function(){return G(Sl(),{})},L.on("PostRender",function(){L.on("click",Q),L.on("tap",Q),L.on("mouseup",Z),L.on("ScrollWindow",tt),L.on("ResizeWindow",nt),L.on("ResizeEditor",et)}),L.on("remove",function(){L.off("click",Q),L.off("tap",Q),L.off("mouseup",Z),L.off("ScrollWindow",tt),L.off("ResizeWindow",nt),L.off("ResizeEditor",et),J.unbind(),Y.unbind(),q.unbind(),K.unbind(),$.unbind()}),L.on("detach",function(){ll(j),ll(U),j.destroy(),U.destroy()});var it=function(){var t,n=XB(qB(x)),e=XB(KB(t=x).getOr(vv(t)));return x.inline||(tu("div","width",e)&&qi(N.element,"width",e),tu("div","height",n)?qi(N.element,"height",n):qi(N.element,"height","200px")),n};return{mothership:ot,uiMothership:rt,backstage:T,renderUI:function(){var o,r,e,n,i,u,a,c;S.setup(x,T.shared,k),fA(x,T),MA(x,O,T),r=(o=x).ui.registry.getAll().sidebars,ft(Ct(r),function(n){var t=r[n],e=function(){return st.from(o.queryCommandValue("ToggleSidebar")).is(n)};o.ui.registry.addToggleButton(n,{icon:t.icon,tooltip:t.tooltip,onAction:function(t){o.execCommand("ToggleSidebar",!1,n),t.setActive(e())},onSetup:function(t){var n=function(){return t.setActive(e())};return o.on("ToggleSidebar",n),function(){o.off("ToggleSidebar",n)}}})}),e=x,n=_,i=T.shared,u=fe(!1),a=fe(st.none()),c=function(t){t!==u.get()&&(wB(n(),t,i.providers),u.set(t))},e.on("ProgressState",function(t){var n;a.get().each(dp.clearTimeout),lt(t.time)?(n=dp.setEditorTimeout(e,function(){return c(t.state)},t.time),a.set(st.some(n))):(c(t.state),a.set(st.none()))}),Tt(x.getParam("toolbar_groups",{},"object"),function(t,n){x.ui.registry.addGroupToolbarButton(n,t)});var t,s=x.ui.registry.getAll(),l=s.buttons,f=s.menuItems,d=s.contextToolbars,m=s.sidebars,g=Cv(x),p={menuItems:f,menus:(t=x.getParam("menu"))?Tt(t,function(t){return ut(ut({},t),{items:t.items})}):{},menubar:x.getParam("menubar"),toolbar:g.getOrThunk(function(){return x.getParam("toolbar",!0)}),allowToolbarGroups:E===rh.floating,buttons:l,sidebar:m};wD(x,d,C,{backstage:T}),SM(x,C);var h=x.getElement(),v=it(),b={mothership:ot,uiMothership:rt,outerContainer:N},y={targetNode:h,height:v};return w.render(x,b,p,T,y)},getUi:function(){return{channels:{broadcastAll:rt.broadcast,broadcastOn:rt.broadcastOn,register:function(){}}}}}},BM=at([Ln("lazySink"),Kn("dragBlockClass"),ae("getBounds",Lu),ne("useTabstopAt",b),ne("eventOrder",{}),Ll("modalBehaviours",[ug]),pa("onExecute"),va("onEscape")]),AM={sketch:ct},MM=at([yf({name:"draghandle",overrides:function(t,n){return{behaviours:ic([bM.config({mode:"mouse",getTarget:function(t){return qu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(n,null,2)).message),getBounds:t.getDragBounds})])}}}),vf({schema:[Ln("dom")],name:"title"}),vf({factory:AM,schema:[Ln("dom")],name:"close"}),vf({factory:AM,schema:[Ln("dom")],name:"body"}),yf({factory:AM,schema:[Ln("dom")],name:"footer"}),bf({factory:{sketch:function(t,n){return ut(ut({},t),{dom:n.dom,components:n.components})}},schema:[ne("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),ne("components",[])],name:"blocker"})]),FM=/* */Object.freeze({__proto__:null,block:function(t,n,e,o){zr(t.element,"aria-busy",!0);var r=n.getRoot(t).getOr(t),i=ic([ug.config({mode:"special",onTab:function(){return st.some(!0)},onShiftTab:function(){return st.some(!0)}}),vg.config({})]),u=o(r,i),a=r.getSystem().build(u);fg.append(r,pu(a)),a.hasConfigured(ug)&&ug.focusIn(a),e.isBlocked()||n.onBlock(t),e.blockWith(function(){return fg.remove(r,a)})},unblock:function(t,n,e){Ur(t.element,"aria-busy"),e.isBlocked()&&n.onUnblock(t),e.clear()}}),IM=[ae("getRoot",st.none),ga("onBlock"),ga("onUnblock")],RM=ac({fields:IM,name:"blocking",apis:FM,state:/* */Object.freeze({__proto__:null,init:function(){var n=rD();return di({readState:n.isSet,blockWith:function(t){n.set({destroy:t})},clear:n.clear,isBlocked:n.isSet})}})}),VM=qf({name:"ModalDialog",configFields:BM(),partFields:MM(),factory:function(a,t,n,r){var e,i=fe(st.none()),o=Kr("modal-events"),u=ut(ut({},a.eventOrder),((e={})[Po()]=[o].concat(a.eventOrder["alloy.system.attached"]||[]),e));return{uid:a.uid,dom:a.dom,components:t,apis:{show:function(t){i.set(st.some(t));var n=a.lazySink(t).getOrDie(),e=r.blocker(),o=n.getSystem().build(ut(ut({},e),{components:e.components.concat([pu(t)]),behaviours:ic([vg.config({}),dg("dialog-blocker-events",[cr(lo(),function(){ug.focusIn(t)})])])}));ol(n,o),ug.focusIn(t)},hide:function(n){i.set(st.none()),kr(n.element).each(function(t){n.getSystem().getByDom(t).each(function(t){ul(t)})})},getBody:function(t){return Mf(t,a,"body")},getFooter:function(t){return Mf(t,a,"footer")},setIdle:function(t){RM.unblock(t)},setBusy:function(t,n){RM.block(t,n)}},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Ul(a.modalBehaviours,[fg.config({}),ug.config({mode:"cyclic",onEnter:a.onExecute,onEscape:a.onEscape,useTabstopAt:a.useTabstopAt}),RM.config({getRoot:i.get}),dg(o,[sr(function(t){var n,e,o,r,i,u;n=t.element,e=Mf(t,a,"title").element,o=Lr(n,"id").fold(function(){var t=Kr("dialog-label");return zr(e,"id",t),t},ct),zr(n,"aria-labelledby",o),r=t.element,i=Mf(t,a,"body").element,u=st.from(Nr(r,"id")).fold(function(){var t=Kr("dialog-describe");return zr(i,"id",t),t},ct),zr(r,"aria-describedby",u)})])])}},apis:{show:function(t,n){t.show(n)},hide:function(t,n){t.hide(n)},getBody:function(t,n){return t.getBody(n)},getFooter:function(t,n){return t.getFooter(n)},setBusy:function(t,n,e){t.setBusy(n,e)},setIdle:function(t,n){t.setIdle(n)}}}),PM=fn([Un("type"),Un("name")].concat(Rh)),HM=Vn,zM=[bn("name","name",Xt(function(){return Kr("button-name")}),Rn),Qn("icon"),ie("align","end",["start","end"]),ue("primary",!1),ue("disabled",!1)],NM=S(zM,[Un("text")]),LM=S([Wn("type",["submit","cancel","custom"])],NM),jM=S([Wn("type",["menu"]),Qn("text"),Qn("tooltip"),Qn("icon"),qn("items",PM)],zM),UM=An("type",{submit:LM,cancel:LM,custom:LM,menu:jM}),WM=[Un("type"),Un("text"),Wn("level",["info","warn","error","success"]),Un("icon"),ne("url","")],GM=fn(WM),XM=[Un("type"),Un("text"),ue("disabled",!1),ue("primary",!1),bn("name","name",Xt(function(){return Kr("button-name")}),Rn),Qn("icon"),ue("borderless",!1)],YM=fn(XM),qM=[Un("type"),Un("name"),Un("label"),ue("disabled",!1)],KM=fn(qM),JM=Vn,$M=[Un("type"),Un("name")],QM=$M.concat([Qn("label")]),ZM=QM.concat([ne("columns","auto")]),tF=fn(ZM),nF=Sn([Un("value"),Un("text"),Un("icon")]),eF=fn(QM),oF=Rn,rF=fn(QM),iF=Rn,uF=$M.concat([re("tag","textarea"),Un("scriptId"),Un("scriptUrl"),(kM=undefined,ee("settings",kM,zn))]),aF=$M.concat([re("tag","textarea"),Gn("init")]),cF=Cn(function(t){return _n("customeditor.old",ln(aF),t).orThunk(function(){return _n("customeditor.new",ln(uF),t)})}),sF=Rn,lF=fn(QM),fF=dn(wn),dF=function(t){return[Un("type"),jn("columns",In),t]},mF=[Un("type"),Un("html"),ie("presets","presentation",["presentation","document"])],gF=fn(mF),pF=QM.concat([ue("sandboxed",!0)]),hF=fn(pF),vF=Rn,bF=QM.concat([jn("currentState",fn([Ln("blob"),Un("url")]))]),yF=fn(bF),xF=QM.concat([Qn("inputMode"),Qn("placeholder"),ue("maximized",!1),ue("disabled",!1)]),wF=fn(xF),SF=Rn,kF=[Un("text"),Un("value")],CF=[Un("text"),qn("items",(CM=function(){return OF},OM=Lt(function(){return CM()}),{extract:function(t,n,e){return OM().extract(t,n,e)},toString:function(){return OM().toString()}}))],OF=mn([fn(kF),fn(CF)]),_F=QM.concat([qn("items",OF),ue("disabled",!1)]),TF=fn(_F),EF=Rn,DF=QM.concat([Yn("items",[Un("text"),Un("value")]),oe("size",1),ue("disabled",!1)]),BF=fn(DF),AF=Rn,MF=QM.concat([ue("constrain",!0),ue("disabled",!1)]),FF=fn(MF),IF=fn([Un("width"),Un("height")]),RF=[Un("type"),qn("header",Rn),qn("cells",dn(Rn))],VF=fn(RF),PF=QM.concat([Qn("placeholder"),ue("maximized",!1),ue("disabled",!1)]),HF=fn(PF),zF=Rn,NF=QM.concat([ie("filetype","file",["image","media","file"]),ne("disabled",!1)]),LF=fn(NF),jF=fn([Un("value"),ne("meta",{})]),UF=function(n){return bn("items","items",Wt(),dn(Cn(function(t){return _n("Checking item of "+n,WF,t).fold(function(t){return mt.error(Dn(t))},function(t){return mt.value(t)})})))},WF=kn(function(){return Bn("type",{alertbanner:GM,bar:fn((n=UF("bar"),[Un("type"),n])),button:YM,checkbox:KM,colorinput:eF,colorpicker:rF,dropzone:lF,grid:fn(dF(UF("grid"))),iframe:hF,input:wF,listbox:TF,selectbox:BF,sizeinput:FF,textarea:HF,urlinput:LF,customeditor:cF,htmlpanel:gF,imagetools:yF,collection:tF,label:fn((t=UF("label"),[Un("type"),Un("label"),t])),table:VF,panel:XF});var t,n}),GF=[Un("type"),ne("classes",[]),qn("items",WF)],XF=fn(GF),YF=[bn("name","name",Xt(function(){return Kr("tab-name")}),Rn),Un("title"),qn("items",WF)],qF=[Un("type"),Yn("tabs",YF)],KF=fn(qF),JF=NM,$F=UM,QF=fn([Un("title"),jn("body",Bn("type",{panel:XF,tabpanel:KF})),re("size","normal"),qn("buttons",$F),ne("initialData",{}),ae("onAction",$),ae("onChange",$),ae("onSubmit",$),ae("onClose",$),ae("onCancel",$),ne("onTabChange",$)]),ZF=fn(S([Wn("type",["cancel","custom"])],JF)),tI=fn([Un("title"),Un("url"),$n("height"),$n("width"),Jn("buttons",dn(ZF)),ae("onAction",$),ae("onCancel",$),ae("onClose",$),ae("onMessage",$)]),nI=function(t){return C(t)?[t].concat(U(Mt(t),nI)):p(t)?U(t,nI):[]},eI=function(t){return k(t.type)&&k(t.name)},oI={checkbox:JM,colorinput:oF,colorpicker:iF,dropzone:fF,input:SF,iframe:vF,sizeinput:IF,selectbox:AF,listbox:EF,size:IF,textarea:zF,urlinput:jF,customeditor:sF,collection:nF,togglemenuitem:HM},rI=function(t){var n=H(nI(t),eI),e=U(n,function(n){return t=n,st.from(oI[t.type]).fold(function(){return[]},function(t){return[jn(n.name,t)]});var t});return fn(e)},iI=function(t){return{internalDialog:Tn(_n("dialog",QF,t)),dataValidator:rI(t),initialData:t.initialData}},uI={open:function(t,n){var e=iI(n);return t(e.internalDialog,e.initialData,e.dataValidator)},openUrl:function(t,n){return t(Tn(_n("dialog",tI,n)))},redial:iI},aI=function(t){var e=[],o={};return _t(t,function(t,n){t.fold(function(){e.push(n)},function(t){o[n]=t})}),0<e.length?mt.error(e):mt.value(o)},cI=Yf({name:"TabButton",configFields:[ne("uid",undefined),Ln("value"),bn("dom","dom",Yt(function(){return{attributes:{role:"tab",id:Kr("aria"),"aria-selected":"false"}}}),Mn()),Kn("action"),ne("domModification",{}),Ll("tabButtonBehaviours",[vg,ug,Nl]),Ln("view")],factory:function(t,n){return{uid:t.uid,dom:t.dom,components:t.components,events:Ag(t.action),behaviours:Ul(t.tabButtonBehaviours,[vg.config({}),ug.config({mode:"execution",useSpace:!0,useEnter:!0}),Nl.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),sI=at([Ln("tabs"),Ln("dom"),ne("clickToDismiss",!1),Ll("tabbarBehaviours",[fd,ug]),da(["tabClass","selectedClass"])]),lI=xf({factory:cI,name:"tabs",unit:"tab",overrides:function(o){var r=function(t,n){fd.dehighlight(t,n),qo(t,Wo(),{tabbar:t,button:n})},i=function(t,n){fd.highlight(t,n),qo(t,Uo(),{tabbar:t,button:n})};return{action:function(t){var n=t.getSystem().getByUid(o.uid).getOrDie(),e=fd.isHighlighted(n,t);(e&&o.clickToDismiss?r:e?$:i)(n,t)},domModification:{classes:[o.markers.tabClass]}}}}),fI=at([lI]),dI=qf({name:"Tabbar",configFields:sI(),partFields:fI(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Ul(t.tabbarBehaviours,[fd.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,n){zr(n.element,"aria-selected","true")},onDehighlight:function(t,n){zr(n.element,"aria-selected","false")}}),ug.config({mode:"flow",getInitial:function(t){return fd.getHighlighted(t).map(function(t){return t.element})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),mI=Yf({name:"Tabview",configFields:[Ll("tabviewBehaviours",[fg])],factory:function(t,n){return{uid:t.uid,dom:t.dom,behaviours:Ul(t.tabviewBehaviours,[fg.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),gI=at([ne("selectFirst",!0),ga("onChangeTab"),ga("onDismissTab"),ne("tabs",[]),Ll("tabSectionBehaviours",[])]),pI=vf({factory:dI,schema:[Ln("dom"),Xn("markers",[Ln("tabClass"),Ln("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),hI=vf({factory:mI,name:"tabview"}),vI=at([pI,hI]),bI=qf({name:"TabSection",configFields:gI(),partFields:vI(),factory:function(i,t,n,e){var o=function(t,n){Af(t,i,"tabbar").each(function(t){n(t).each(Ko)})};return{uid:i.uid,dom:i.dom,components:t,behaviours:jl(i.tabSectionBehaviours),events:Zo(dt([i.selectFirst?[sr(function(t,n){o(t,fd.getFirst)})]:[],[er(Uo(),function(t,n){var o,r,e=n.event.button;o=e,r=Nl.getValue(o),Af(o,i,"tabview").each(function(e){L(i.tabs,function(t){return t.value===r}).each(function(t){var n=t.view();Lr(o.element,"id").each(function(t){zr(e.element,"aria-labelledby",t)}),fg.set(e,n),i.onChangeTab(e,o,n)})})}),er(Wo(),function(t,n){var e=n.event.button;i.onDismissTab(t,e)})]])),apis:{getViewItems:function(t){return Af(t,i,"tabview").map(function(t){return fg.contents(t)}).getOr([])},showTab:function(t,e){o(t,function(n){var t=fd.getCandidates(n);return L(t,function(t){return Nl.getValue(t)===e}).filter(function(t){return!fd.isHighlighted(n,t)})})}}}},apis:{getViewItems:function(t,n){return t.getViewItems(n)},showTab:function(t,n,e){t.showTab(n,e)}}}),yI=function(t,n){qi(t,"height",n+"px"),je().browser.isIE()?nu(t,"flex-basis"):qi(t,"flex-basis",n+"px")},xI=function(t,m,n){qu(t,'[role="dialog"]').each(function(d){Ku(d,'[role="tablist"]').each(function(f){n.get().map(function(t){return qi(m,"height","0"),qi(m,"flex-basis","0"),Math.min(t,(e=m,o=f,r=wr(n=d).dom,i=qu(n,".tox-dialog-wrap").getOr(n),u="fixed"===$i(i,"position")?Math.max(r.clientHeight,window.innerHeight):Math.max(r.offsetHeight,r.scrollHeight),a=bu(e),c=e.dom.offsetLeft>=o.dom.offsetLeft+_u(o)?Math.max(bu(o),a):a,s=parseInt($i(n,"margin-top"),10)||0,l=parseInt($i(n,"margin-bottom"),10)||0,u-(bu(n)+s+l-c)));var n,e,o,r,i,u,a,c,s,l}).each(function(t){yI(m,t)})})})},wI=function(t){return Ku(t,'[role="tabpanel"]')},SI=function(a){var c;return{smartTabHeight:(c=fe(st.none()),{extraEvents:[sr(function(t){var e=t.element;wI(e).each(function(u){var n;qi(u,"visibility","hidden"),t.getSystem().getByDom(u).toOptional().each(function(t){var o,r,i,n=(r=u,i=t,V(o=a,function(t,n){fg.set(i,o[n].view());var e=r.dom.getBoundingClientRect();return fg.set(i,[]),e.height})),e=K(Y(n,function(t,n){return n<t?-1:t<n?1:0}));c.set(e)}),xI(e,u,c),nu(u,"visibility"),n=t,K(a).each(function(t){return bI.showTab(n,t.value)}),dp.requestAnimationFrame(function(){xI(e,u,c)})})}),er(Vo(),function(t){var n=t.element;wI(n).each(function(t){xI(n,t,c)})}),er(lx,function(t,n){var r=t.element;wI(r).each(function(n){var t=gc();qi(n,"visibility","hidden");var e=Zi(n,"height").map(function(t){return parseInt(t,10)});nu(n,"height"),nu(n,"flex-basis");var o=n.dom.getBoundingClientRect().height;e.forall(function(t){return t<o})?(c.set(st.from(o)),xI(r,n,c)):e.each(function(t){yI(n,t)}),nu(n,"visibility"),t.each(mc)})})],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},kI="send-data-to-section",CI="send-data-to-view",OI=Kr("update-dialog"),_I=Kr("update-title"),TI=Kr("update-body"),EI=Kr("update-footer"),DI=Kr("body-send-message"),BI=function(t,n,d,e){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:ut(ut({},n.map(function(t){return{id:t}}).getOr({})),e?{"aria-live":"polite"}:{})},components:[],behaviours:ic([rk(0),aE.config({channel:TI,updateState:function(t,n){return st.some({isTabPanel:function(){return"tabpanel"===n.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[(r=t.body,i=d,u=fe({}),a=function(t){var n=Nl.getValue(t),e=aI(n).getOr({}),o=u.get(),r=zt(o,e);u.set(r)},c=function(t){var n=u.get();Nl.setValue(t,n)},s=fe(null),l=V(r.tabs,function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:i.shared.providers.translate(t.title)},view:function(){return[qS.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"]},components:V(t.items,function(t){return f_(n,t,i)}),formBehaviours:ic([ug.config({mode:"acyclic",useTabstopAt:x(kk)}),dg("TabView.form.events",[sr(c),lr(a)]),fc.config({channels:$t([{key:kI,value:{onReceive:a}},{key:CI,value:{onReceive:c}}])})])}})]}}}),f=SI(l).smartTabHeight,bI.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,n,e){var o=Nl.getValue(n);qo(t,sx,{name:o,oldName:s.get()}),s.set(o)},tabs:l,components:[bI.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[dI.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ic([Jy.config({})])}),bI.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:f.selectFirst,tabSectionBehaviours:ic([dg("tabpanel",f.extraEvents),ug.config({mode:"acyclic"}),td.config({find:function(t){return K(bI.getViewItems(t))}}),Nl.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([kI],{}),u.get()},setValue:function(t,n){u.set(n),t.getSystem().broadcastOn([CI],{})}}})])}))];default:return[(e=t.body,o=d,{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[(n=gp(qS.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"].concat(e.classes)},components:V(e.items,function(t){return f_(n,t,o)})}}))).asSpec()]}],behaviours:ic([ug.config({mode:"acyclic",useTabstopAt:x(kk)}),ok(n),dk(n,{postprocess:function(t){return aI(t).fold(function(t){return console.error(t),{}},function(t){return t})}})])})]}var e,o,n,r,i,u,a,c,s,l,f},initialData:t})])}},AI=Zv.deviceType.isTouch(),MI=function(t,n){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,n]}},FI=function(t,n){return VM.parts.close(mp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close")}},action:t,buttonBehaviours:ic([Jy.config({})])}))},II=function(){return VM.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},RI=function(t,n){return VM.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:xB("<p>"+n.translate(t)+"</p>")}]}]})},VI=function(t){return VM.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},PI=function(t,n){return[Uy.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Uy.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]},HI=function(n){var t,e="tox-dialog",o=e+"-wrap",r=o+"__backdrop",i=e+"__disable-scroll";return VM.sketch({lazySink:n.lazySink,onEscape:function(t){return n.onEscape(t),st.some(!0)},useTabstopAt:function(t){return!kk(t)},dom:{tag:"div",classes:[e].concat(n.extraClasses),styles:ut({position:"relative"},n.extraStyles)},components:S([n.header,n.body],n.footer.toArray()),parts:{blocker:{dom:xB('<div class="'+o+'"></div>'),components:[{dom:{tag:"div",classes:AI?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:ic(S([vg.config({}),dg("dialog-events",n.dialogEvents.concat([cr(lo(),function(t,n){ug.focusIn(t)})])),dg("scroll-lock",[sr(function(){Ei(Wi(),i)}),lr(function(){Bi(Wi(),i)})])],n.extraBehaviours)),eventOrder:ut(((t={})[_o()]=["dialog-events"],t[Po()]=["scroll-lock","dialog-events","alloy.base.behaviour"],t[Ho()]=["alloy.base.behaviour","dialog-events","scroll-lock"],t),n.eventOrder)})},zI=function(t){return mp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:hp("close",t.icons)}}],action:function(t){Yo(t,rx)}})},NI=function(t,n,e){var o=function(t){return[fu(e.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:ut({},n.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:ic([aE.config({channel:_I,renderComponents:o})])}},LI=function(){return{dom:xB('<div class="tox-dialog__draghandle"></div>')}},jI=function(t,n){return e={title:n.shared.providers.translate(t),draggable:n.dialog.isDraggableModal()},o=n.shared.providers,r=VM.parts.title(NI(e,st.none(),o)),i=VM.parts.draghandle(LI()),u=VM.parts.close(zI(o)),a=[r].concat(e.draggable?[i]:[]).concat([u]),Uy.sketch({dom:xB('<div class="tox-dialog__header"></div>'),components:a});var e,o,r,i,u,a},UI=function(t,n){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":t},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:n,components:[{dom:xB('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},WI=function(t,n){return{onClose:function(){return n.closeWindow()},onBlock:function(e){VM.setBusy(t(),function(t,n){return UI(e.message,n)})},onUnblock:function(){VM.setIdle(t())}}},GI=function(t,n,e,o){var r;return gu(HI(ut(ut({},t),{lazySink:o.shared.getSink,extraBehaviours:S([aE.config({channel:OI,updateState:function(t,n){return st.some(n)},initialData:n}),pk({})],t.extraBehaviours),onEscape:function(t){Yo(t,rx)},dialogEvents:e,eventOrder:((r={})[Oo()]=[aE.name(),fc.name()],r[Po()]=["scroll-lock",aE.name(),"messages","dialog-events","alloy.base.behaviour"],r[Ho()]=["alloy.base.behaviour","dialog-events","messages",aE.name(),"scroll-lock"],r)})))},XI=function(t){return V(t,function(t){return"menu"===t.type?(e=V((n=t).items,function(t){var n=fe(!1);return ut(ut({},t),{storage:n})}),ut(ut({},n),{items:e})):t;var n,e})},YI=function(t){return N(t,function(t,n){return"menu"!==n.type?t:N(n.items,function(t,n){return t[n.name]=n.storage,t},t)},{})},qI=function(t,e){return[ur(lo(),Sk),t(ox,function(t,n){e.onClose(),n.onClose()}),t(rx,function(t,n,e,o){n.onCancel(t),Yo(o,ox)}),er(cx,function(t,n){return e.onUnblock()}),er(ax,function(t,n){return e.onBlock(n.event)})]},KI=function(i,t){var n=function(t,r){return er(t,function(e,o){u(e,function(t,n){r(i(),t,o.event,e)})})},u=function(n,e){aE.getState(n).get().each(function(t){e(t,n)})};return S(qI(n,t),[n(ix,function(t,n,e){n.onAction(t,{name:e.name})})])},JI=function(i,t,c){var n=function(t,r){return er(t,function(e,o){u(e,function(t,n){r(i(),t,o.event,e)})})},u=function(n,e){aE.getState(n).get().each(function(t){e(t.internalDialog,n)})};return S(qI(n,t),[n(ux,function(t,n){return n.onSubmit(t)}),n(ex,function(t,n,e){n.onChange(t,{name:e.name})}),n(ix,function(t,n,e,o){var r=function(){return ug.focusIn(o)},i=function(t){return jr(t,"disabled")||Lr(t,"aria-disabled").exists(function(t){return"true"===t})},u=Hi(o.element),a=gc(u);n.onAction(t,{name:e.name,value:e.value}),gc(u).fold(r,function(n){i(n)||a.exists(function(t){return Ye(n,t)&&i(t)})?r():c().toOptional().filter(function(t){return!Ye(t.element,n)}).each(r)})}),n(sx,function(t,n,e){n.onTabChange(t,{newTabName:e.name,oldTabName:e.oldName})}),lr(function(t){var n=i();Nl.setValue(t,n.getData())})])},$I=function(t,n){var e=n.map(function(t){return t.footerButtons}).getOr([]),o=P(e,function(t){return"start"===t.align}),r=function(t,n){return Uy.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:V(n,function(t){return t.memento.asSpec()})})};return[r("start",o.pass),r("end",o.fail)]},QI=function(t,i){return{dom:xB('<div class="tox-dialog__footer"></div>'),components:[],behaviours:ic([aE.config({channel:EI,initialData:t,updateState:function(t,n){var r=V(n.buttons,function(t){var n,e,o=gp((e=i,QC(n=t,n.type,e)));return{name:t.name,align:t.align,memento:o}});return st.some({lookupByName:function(t,n){return e=t,o=n,L(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(e)});var e,o},footerButtons:r})},renderComponents:$I})])}},ZI=QI,tR=function(t,n){return VM.parts.footer(QI(t,n))},nR=function(n,e){if(n.getRoot().getSystem().isConnected()){var o=td.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return qS.getField(o,e).fold(function(){var t=n.getFooter();return aE.getState(t).get().bind(function(t){return t.lookupByName(o,e)})},function(t){return st.some(t)})}return st.none()},eR=function(c,o,s){var t=function(t){var n=c.getRoot();n.getSystem().isConnected()&&t(n)},l={getData:function(){var t=c.getRoot(),n=t.getSystem().isConnected()?c.getFormWrapper():t,e=Nl.getValue(n),o=Tt(s,function(t){return t.get()});return ut(ut({},e),o)},setData:function(a){t(function(t){var n,e,o=l.getData(),r=ut(ut({},o),a),i=(n=r,e=c.getRoot(),aE.getState(e).get().map(function(t){return Tn(_n("data",t.dataValidator,n))}).getOr(n)),u=c.getFormWrapper();Nl.setValue(u,i),_t(s,function(t,n){It(r,n)&&t.set(r[n])})})},disable:function(t){nR(c,t).each(gv.disable)},enable:function(t){nR(c,t).each(gv.enable)},focus:function(t){nR(c,t).each(vg.focus)},block:function(n){if(!k(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){qo(t,ax,{message:n})})},unblock:function(){t(function(t){Yo(t,cx)})},showTab:function(e){t(function(t){var n=c.getBody();aE.getState(n).get().exists(function(t){return t.isTabPanel()})&&td.getCurrent(n).each(function(t){bI.showTab(t,e)})})},redial:function(e){t(function(t){var n=o(e);t.getSystem().broadcastOn([OI],n),t.getSystem().broadcastOn([_I],n.internalDialog),t.getSystem().broadcastOn([TI],n.internalDialog),t.getSystem().broadcastOn([EI],n.internalDialog),l.setData(n.initialData)})},close:function(){t(function(t){Yo(t,ox)})}};return l},oR=function(t,n,e){var o,r,i,u=jI(t.internalDialog.title,e),a=(o={body:t.internalDialog.body},r=e,i=BI(o,st.none(),r,!1),VM.parts.body(i)),c=XI(t.internalDialog.buttons),s=YI(c),l=tR({buttons:c},e),f=JI(function(){return p},WI(function(){return g},n),e.shared.getSink),d=function(t){switch(t){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(t.internalDialog.size),m={header:u,body:a,footer:st.some(l),extraClasses:d,extraBehaviours:[],extraStyles:{}},g=GI(m,t,f,e),p=eR({getRoot:function(){return g},getBody:function(){return VM.getBody(g)},getFooter:function(){return VM.getFooter(g)},getFormWrapper:function(){var t=VM.getBody(g);return td.getCurrent(t).getOr(t)}},n.redial,s);return{dialog:g,instanceApi:p}},rR=function(t,n,e,o){var r,i,u,a,c,s,l,f,d,m=Kr("dialog-label"),g=Kr("dialog-content"),p=gp((u={title:t.internalDialog.title,draggable:!0},a=m,c=e.shared.providers,Uy.sketch({dom:xB('<div class="tox-dialog__header"></div>'),components:[NI(u,st.some(a),c),LI(),zI(c)],containerBehaviours:ic([bM.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Ju(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),h=gp((s={body:t.internalDialog.body},l=g,f=e,d=o,BI(s,st.some(l),f,d))),v=XI(t.internalDialog.buttons),b=YI(v),y=gp(ZI({buttons:v},e)),x=JI(function(){return S},{onBlock:function(e){RM.block(w,function(t,n){return UI(e.message,n)})},onUnblock:function(){RM.unblock(w)},onClose:function(){return n.closeWindow()}},e.shared.getSink),w=gu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:((r={role:"dialog"})["aria-labelledby"]=m,r["aria-describedby"]=""+g,r)},eventOrder:((i={})[Oo()]=[aE.name(),fc.name()],i[_o()]=["execute-on-form"],i[Po()]=["reflecting","execute-on-form"],i),behaviours:ic([ug.config({mode:"cyclic",onEscape:function(t){return Yo(t,ox),st.some(!0)},useTabstopAt:function(t){return!kk(t)&&("button"!==mr(t)||"disabled"!==Nr(t,"disabled"))}}),aE.config({channel:OI,updateState:function(t,n){return st.some(n)},initialData:t}),vg.config({}),dg("execute-on-form",x.concat([cr(lo(),function(t,n){ug.focusIn(t)})])),RM.config({getRoot:function(){return st.some(w)}}),fg.config({}),pk({})]),components:[p.asSpec(),h.asSpec(),y.asSpec()]}),S=eR({getRoot:function(){return w},getFooter:function(){return y.get(w)},getBody:function(){return h.get(w)},getFormWrapper:function(){var t=h.get(w);return td.getCurrent(t).getOr(t)}},n.redial,b);return{dialog:w,instanceApi:S}},iR=tinymce.util.Tools.resolve("tinymce.util.URI"),uR=["insertContent","setContent","execCommand","close","block","unblock"],aR=function(t){return C(t)&&-1!==uR.indexOf(t.mceAction)},cR=function(o,t,r,n){var e,i,u,a,c=jI(o.title,n),s=(i={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[xk({dom:{tag:"iframe",attributes:{src:o.url}},behaviours:ic([Jy.config({}),vg.config({})])})]}],behaviours:ic([ug.config({mode:"acyclic",useTabstopAt:x(kk)})])},VM.parts.body(i)),l=o.buttons.bind(function(t){return 0===t.length?st.none():st.some(tR({buttons:t},n))}),f=KI(function(){return y},WI(function(){return b},t)),d=ut(ut({},o.height.fold(function(){return{}},function(t){return{height:t+"px","max-height":t+"px"}})),o.width.fold(function(){return{}},function(t){return{width:t+"px","max-width":t+"px"}})),m=o.width.isNone()&&o.height.isNone()?["tox-dialog--width-lg"]:[],g=new iR(o.url,{base_uri:new iR(window.location.href)}),p=g.protocol+"://"+g.host+(g.port?":"+g.port:""),h=fe(st.none()),v=[dg("messages",[sr(function(){var t=yy(me.fromDom(window),"message",function(t){var n,e;g.isSameOrigin(new iR(t.raw.origin))&&(n=t.raw.data,aR(n)?function(t,n,e){switch(e.mceAction){case"insertContent":t.insertContent(e.content);break;case"setContent":t.setContent(e.content);break;case"execCommand":var o=!!O(e.ui)&&e.ui;t.execCommand(e.cmd,o,e.value);break;case"close":n.close();break;case"block":n.block(e.message);break;case"unblock":n.unblock()}}(r,y,n):!aR(e=n)&&C(e)&&It(e,"mceAction")&&o.onMessage(y,n))});h.set(st.some(t))}),lr(function(){h.get().each(function(t){return t.unbind()})})]),fc.config({channels:((e={})[DI]={onReceive:function(t,n){Ku(t.element,"iframe").each(function(t){t.dom.contentWindow.postMessage(n,p)})}},e)})],b=GI({header:c,body:s,footer:l,extraClasses:m,extraBehaviours:v,extraStyles:d},o,f,n),y=(a=function(t){u.getSystem().isConnected()&&t(u)},{block:function(n){if(!k(n))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a(function(t){qo(t,ax,{message:n})})},unblock:function(){a(function(t){Yo(t,cx)})},close:function(){a(function(t){Yo(t,ox)})},sendMessage:function(n){a(function(t){t.getSystem().broadcastOn([DI],n)})}});return{dialog:u=b,instanceApi:y}},sR=function(t){var c,s,l,f,p=t.backstage,h=t.editor,v=Vv(h),e=(s=(c=t).backstage.shared,{open:function(t,n){var e=function(){VM.hide(u),n()},o=gp(QC({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:st.none()},"cancel",c.backstage)),r=II(),i=FI(e,s.providers),u=gu(HI({lazySink:function(){return s.getSink()},header:MI(r,i),body:RI(t,s.providers),footer:st.some(VI(PI([],[o.asSpec()]))),onEscape:e,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[er(rx,e)],eventOrder:{}}));VM.show(u);var a=o.get(u);vg.focus(a)}}),o=(f=(l=t).backstage.shared,{open:function(t,n){var e=function(t){VM.hide(a),n(t)},o=gp(QC({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:st.none()},"submit",l.backstage)),r=QC({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:st.none()},"cancel",l.backstage),i=II(),u=FI(function(){return e(!1)},f.providers),a=gu(HI({lazySink:function(){return f.getSink()},header:MI(i,u),body:RI(t,f.providers),footer:st.some(VI(PI([],[r,o.asSpec()]))),onEscape:function(){return e(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[er(rx,function(){return e(!1)}),er(ux,function(){return e(!0)})],eventOrder:{}}));VM.show(a);var c=o.get(a);vg.focus(c)}}),r=function(t,e){return uI.openUrl(function(t){var n=cR(t,{closeWindow:function(){VM.hide(n.dialog),e(n.instanceApi)}},h,p);return VM.show(n.dialog),n.instanceApi},t)},i=function(t,i){return uI.open(function(t,n,e){var o=n,r=oR({dataValidator:e,initialData:o,internalDialog:t},{redial:uI.redial,closeWindow:function(){VM.hide(r.dialog),i(r.instanceApi)}},p);return VM.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},t)},u=function(t,d,m,g){return uI.open(function(t,n,e){var o,r,i,u=Tn(_n("data",e,n)),a=(o=fe(st.none()),{clear:function(){return o.set(st.none())},set:function(t){return o.set(st.some(t))},isSet:function(){return o.get().isSome()},on:function(t){return o.get().each(t)}}),c=p.shared.header.isPositionedAtTop(),s=function(){return a.on(function(t){tp.reposition(t),$D.refresh(t)})},l=rR({dataValidator:e,initialData:u,internalDialog:t},{redial:uI.redial,closeWindow:function(){a.on(tp.hide),h.off("ResizeEditor",s),a.clear(),m(l.instanceApi)}},p,g),f=gu(tp.sketch(ut(ut({lazySink:p.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},c?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:ic(S([dg("window-manager-inline-events",[er(zo(),function(t,n){Yo(l.dialog,rx)})])],(r=h,i=c,v&&i?[]:[$D.config({contextual:{lazyContext:function(){return st.some(zu(me.fromDom(r.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]))),isExtraPart:function(t,n){return Sy(e=n,".tox-alert-dialog")||Sy(e,".tox-confirm-dialog");var e}})));return a.set(f),tp.showWithin(f,d,pu(l.dialog),st.some(Wi())),v&&c||($D.refresh(f),h.on("ResizeEditor",s)),l.instanceApi.setData(u),ug.focusIn(l.dialog),l.instanceApi},t)};return{open:function(t,n,e){return n!==undefined&&"toolbar"===n.inline?u(t,p.shared.anchors.inlineDialog(),e,n.ariaAttrs):n!==undefined&&"cursor"===n.inline?u(t,p.shared.anchors.cursor(),e,n.ariaAttrs):i(t,e)},openUrl:function(t,n){return r(t,n)},alert:function(t,n){e.open(t,function(){n()})},close:function(t){t.close()},confirm:function(t,n){o.open(t,function(t){n(t)})}}};t.add("silver",function(t){var n=DM(t),e=n.uiMothership,o=n.backstage,r=n.renderUI,i=n.getUi;vy(t,o.shared);var u=sR({editor:t,backstage:o});return{renderUI:r,getWindowManagerImpl:at(u),getNotificationManagerImpl:function(){return yp(0,{backstage:o},e)},ui:i()}})}();
|