/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.2.1 (2020-03-25) */ !function(v){"use strict";function Z(){}function i(e,o){return function(){for(var n=[],t=0;t "+o.toString()},function(n,t){return"state("+n+")"})}).join("\n")+"}"}}},Wo=nn(Pn(Eo)),Go=i(Ln,Uo),Xo=jo.state,Yo=jo.field,qo=Pn(Eo),Ko=function(o){return{extract:function(n,t,e){return o().extract(n,t,e)},toString:function(){return o().toString()}}},Jo=function(n){return"Errors: \n"+function(n){var t=10 ")+")\n"+n.getErrorInfo()})}(n.errors).join("\n")+"\n\nInput object: "+In(n.input)},$o=nn(qo),Qo=Zn(rn,"number"),Zo=Zn(J,"string"),nr=Zn(en,"boolean"),tr=Zn(on,"function"),er=function(t){function n(n,t){for(var e=n.next();!e.done;){if(!t(e.value))return!1;e=n.next()}return!0}if(Object(t)!==t)return!0;switch({}.toString.call(t).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(t).every(function(n){return er(t[n])});case"Map":return n(t.keys(),er)&&n(t.values(),er);case"Set":return n(t.keys(),er);default:return!1}},or=Pn(function(n){return er(n)?Eo(n):Do("Expected value to be acceptable for sending via postMessage")}),rr=function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return rr(t())}}},ir=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:nn(n)}},ur={fromHtml:function(n,t){var e=(t||v.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1 "):o[0].name();return Dn(r,function(n,t){return{handler:n,purpose:nn(t)}}(t,e))})});return Mn(t,{})},$i=U(function(){return Qi(ur.fromDom(v.document))}),Qi=function(n){var t=n.dom().body;if(null===t||t===undefined)throw new Error("Body is not available yet");return ur.fromDom(t)},Zi=function(n,t){return to(n)?n.style.getPropertyValue(t):""},nu=function(n){var t=Jn("external.component",zn([tt("element"),st("uid")]),n),e=rr(Fe());t.uid.each(function(n){Li(t.element,n)});var o={getSystem:e.get,config:tn.none,hasConfigured:nn(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(Fe(function(){return o}))},getApis:function(){return{}},element:nn(t.element),spec:nn(n),readState:nn("No state"),syncComponents:Z,components:nn([]),events:nn({})};return Re(o)},tu=Me,eu=function(t){return function(n){return bn(n,Xi)}(t).fold(function(){var n=t.hasOwnProperty("uid")?t:P({uid:tu("")},t);return wo(n).getOrDie()},function(n){return n})},ou=Re;function ru(o,r){function n(n){var t=r(n);if(t<=0||null===t){var e=co(n,o);return parseFloat(e)||0}return t}function i(r,n){return C(n,function(n,t){var e=co(r,t),o=e===undefined?0:parseInt(e,10);return isNaN(o)?n:n+o},0)}return{set:function(n,t){if(!rn(t)&&!t.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+t);var e=n.dom();to(e)&&(e.style[o]=t+"px")},get:n,getOuter:n,aggregate:i,max:function(n,t,e){var o=i(n,e);return o"}),$o()),vl=kt("schema",function(){return[st("preprocess")]}),bl=pt("defaults",nn({})),yl=pt("overrides",nn({})),xl=Uo([ml,gl,pl,hl,bl,yl]),wl=Uo([ml,gl,pl,bl,yl]),Sl=Uo([ml,gl,pl,hl,bl,yl]),kl=Uo([ml,vl,pl,tt("unit"),hl,bl,yl]),Cl=$s(dl.required,xl),Ol=$s(dl.external,wl),_l=$s(dl.optional,Sl),Tl=$s(dl.group,kl),El=nn("entirety"),Bl=/* */Object.freeze({__proto__:null,required:Cl,external:Ol,optional:_l,group:Tl,asNamedPart:Ks,name:Js,asCommon:function(n){return n.fold(B,B,B,B)},original:El}),Dl=function(n,t){return{uiType:ll(),owner:n,name:t}},Al=/* */Object.freeze({__proto__:null,generate:Zs,generateOne:nf,schemas:tf,names:ef,substitutes:of,components:rf,defaultUids:df,defaultUidsSchema:mf,getAllParts:sf,getAllPartNames:ff,getPart:uf,getPartOrDie:af,getParts:cf,getPartsOrDie:lf}),Ml=function(n){return function(n){return yn(n,"uid")}(n)?n:P(P({},n),{uid:Me("uid")})};function Fl(n){var t=Jn("Sketcher for "+n.name,nd,n),e=L(t.apis,Ve),o=L(t.extraApis,function(n,t){return Ie(n,t)});return P(P({name:nn(t.name),configFields:nn(t.configFields),sketch:function(n){return function(n,t,e,o){var r=Ml(o);return e(gf(n,t,r,[],[]),r)}(t.name,t.configFields,t.factory,n)}},e),o)}function Il(n){var t=Jn("Sketcher for "+n.name,td,n),e=Zs(t.name,t.partFields),o=L(t.apis,Ve),r=L(t.extraApis,function(n,t){return Ie(n,t)});return P(P({name:nn(t.name),partFields:nn(t.partFields),configFields:nn(t.configFields),sketch:function(n){return pf(t.name,t.configFields,t.partFields,t.factory,n)},parts:nn(e)},o),r)}function Rl(n){for(var t=[],e=function(n){t.push(n)},o=0;o',t.getDoc());return Di(n,ur.fromDom(e.extractContents())),e.insertNode(n.dom()),ce(n).each(function(n){return n.dom().normalize()}),function(n){return bf(n,ns)}(n).map(function(n){t.selection.setCursorLocation(n.dom(),function(n){return"img"===xe(n)?1:Zc(n).fold(function(){return fe(n).length},function(n){return n.length})}(n))}),n})}function Op(n){return n.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")}function _p(n){return""!==n&&-1!==" \xa0\f\n\r\t\x0B".indexOf(n)}function Tp(n,t){return n.substring(t.length)}function Ep(n,o,r,i){if(void 0===i&&(i=0),!function(n){return n.collapsed&&3===n.startContainer.nodeType}(o))return tn.none();var t=n.getParent(o.startContainer,n.isBlock)||n.getRoot();return kp(n,o.startContainer,o.startOffset,function(n,t,e){return function(n,t,e){var o;for(o=t-1;0<=o;o--){var r=n.charAt(o);if(_p(r))return tn.none();if(r===e)break}return tn.some(o)}(e,t,r).getOr(t)},t).bind(function(n){var t=o.cloneRange();if(t.setStart(n.container,n.offset),t.setEnd(o.endContainer,o.endOffset),t.collapsed)return tn.none();var e=Op(t);return 0!==e.lastIndexOf(r)||Tp(e,r).lengtho}).getOr(r.length);return tn.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return tn.none()}function Rp(n,t){return Ca([nm(n,t)])}function Vp(n,t,e){n.getSystem().broadcastOn([kh],{})}function Hp(n){return bn(Mh,n).getOr(Bh)}function Np(n){return{dom:{tag:"div",classes:[Ih],innerHtml:n}}}function Pp(n){return{dom:{tag:"div",classes:[Rh]},components:[So(Eh.translate(n))]}}function zp(n,t){return{dom:{tag:"div",classes:[Rh]},components:[{dom:{tag:n.tag,styles:n.styles},components:[So(Eh.translate(t))]}]}}function Lp(n){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:Ph(n)}}}function jp(n){return{dom:{tag:"div",classes:[Ih,"tox-collection__item-checkmark"],innerHtml:hp("checkmark",n)}}}function Up(n,t,e,o,r){var i=e?n.checkMark.orThunk(function(){return t.or(tn.some("")).map(Np)}):tn.none(),u=n.ariaLabel.map(function(n){return{attributes:{title:Eh.translate(n)}}}).getOr({});return{dom:P({tag:"div",classes:[Bh,Dh].concat(r?["tox-collection__item-icon-rtl"]:[])},u),optComponents:[i,n.htmlContent.fold(function(){return n.textContent.map(o)},function(n){return tn.some(function(n){return{dom:{tag:"div",classes:[Rh],innerHtml:n}}}(n))}),n.shortcutContent.map(Lp),n.caret]}}function Wp(n,t,e,o){void 0===o&&(o=tn.none());var r=Eh.isRtl()&&n.iconContent.exists(function(n){return sn(Lh,n)}),i=n.iconContent.map(function(n){return Eh.isRtl()&&sn(zh,n)?n+"-rtl":n}).map(function(n){return function(n,t,e){return tn.from(t()[n]).or(e).getOrThunk(function(){return pp(t)})}(n,t.icons,o)}),u=tn.from(n.meta).fold(function(){return Pp},function(n){return yn(n,"style")?l(zp,n.style):Pp});return"color"===n.presets?function(n,t,e,o){var r,i;return{dom:(r=e.getOr(""),i={tag:"div",attributes:n.map(function(n){return{title:o.translate(n)}}).getOr({}),classes:["tox-swatch"]},P(P({},i),"custom"===t?{tag:"button",classes:p(i.classes,["tox-swatches__picker-btn"]),innerHtml:r}:"remove"===t?{classes:p(i.classes,["tox-swatch--remove"]),innerHtml:r}:{attributes:P(P({},i.attributes),{"data-mce-color":t}),styles:{"background-color":t}})),optComponents:[]}}(n.ariaLabel,n.value,i,t):Up(n,i,e,u,r)}function Gp(n,t,e){t.disabled&&Uh(n,t)}function Xp(n,t){return!0===t.useNative&&sn(jh,xe(n.element()))}function Yp(n){ke(n.element(),"disabled","disabled")}function qp(n){Te(n.element(),"disabled")}function Kp(n){ke(n.element(),"aria-disabled","true")}function Jp(n){ke(n.element(),"aria-disabled","false")}function $p(t,n,e){n.disableClass.each(function(n){$e(t.element(),n)}),(Xp(t,n)?qp:Jp)(t),n.onEnabled(t)}function Qp(n,t){return Xp(n,t)?function(n){return _e(n.element(),"disabled")}(n):function(n){return"true"===Ce(n.element(),"aria-disabled")}(n)}function Zp(n,t){var e=n.getApi(t);return function(n){n(e)}}function nh(e,o){return _i(function(n){Zp(e,n)(function(n){var t=e.onSetup(n);null!==t&&t!==undefined&&o.set(t)})})}function th(t,e){return Ti(function(n){return Zp(t,n)(e.get())})}var eh,oh,rh=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),ih=function(n){return Nu(n,"[data-mce-autocompleter]")},uh=function(e,n){n.on("keypress compositionend",e.onKeypress.throttle),n.on("remove",e.onKeypress.cancel);function o(n,t){Lt(n,Xr(),{raw:t})}n.on("keydown",function(t){function n(){return e.getView().bind(dd.getHighlighted)}8===t.which&&e.onKeypress.throttle(t),e.isActive()&&(27===t.which&&e.cancelIfNecessary(),e.isMenuOpen()?13===t.which?(n().each(jt),t.preventDefault()):40===t.which?(n().fold(function(){e.getView().each(dd.highlightFirst)},function(n){o(n,t)}),t.preventDefault(),t.stopImmediatePropagation()):37!==t.which&&38!==t.which&&39!==t.which||n().each(function(n){o(n,t),t.preventDefault(),t.stopImmediatePropagation()}):13!==t.which&&38!==t.which&&40!==t.which||e.cancelIfNecessary())}),n.on("NodeChange",function(n){e.isActive()&&!e.isProcessingAction()&&ih(ur.fromDom(n.element)).isNone()&&e.cancelIfNecessary()})},ah=tinymce.util.Tools.resolve("tinymce.util.Promise"),ch=function(n){if(function(n){return n.nodeType===v.Node.TEXT_NODE}(n))return Dp(n,n.data.length);var t=n.childNodes;return 0=n.minChars&&n.matches.getOrThunk(function(){return Ap(t.dom)})(e.range,i,e.text)});if(0===u.length)return tn.none();var a=ah.all(w(u,function(t){return t.fetch(e.text,t.maxResults,o).then(function(n){return{matchText:e.text,items:n,columns:t.columns,onAction:t.onAction}})}));return tn.some({lookupData:a,context:e})},lh=Uo([ot("type"),dt("text")]),dh=Uo([kt("type",function(){return"autocompleteitem"}),kt("active",function(){return!1}),kt("disabled",function(){return!1}),pt("meta",{}),ot("value"),dt("text"),dt("icon")]),mh=Uo([ot("type"),ot("ch"),vt("minChars",1),pt("columns",1),vt("maxResults",10),mt("matches"),it("fetch"),it("onAction")]),gh=[xt("disabled",!1),dt("text"),dt("shortcut"),Yo("value","value",No(function(){return Ae("menuitem-value")}),$o()),pt("meta",{})],ph=Uo([ot("type"),wt("onSetup",function(){return Z}),wt("onAction",Z),dt("icon")].concat(gh)),hh=Uo([ot("type"),it("getSubmenuItems"),wt("onSetup",function(){return Z}),dt("icon")].concat(gh)),vh=Uo([ot("type"),xt("active",!1),wt("onSetup",function(){return Z}),it("onAction")].concat(gh)),bh=Uo([ot("type"),xt("active",!1),dt("icon")].concat(gh)),yh=Uo([ot("type"),rt("fancytype",["inserttable","colorswatch"]),wt("onAction",Z)]),xh=function(n){return Rp(Ae("unnamed-events"),n)},wh=[tt("lazySink"),tt("tooltipDom"),pt("exclusive",!0),pt("tooltipComponents",[]),pt("delay",300),yt("mode","normal",["normal","follow-highlight"]),pt("anchor",function(n){return{anchor:"hotspot",hotspot:n,layouts:{onLtr:nn([mc,dc,sa,la,fa,da]),onRtl:nn([mc,dc,sa,la,fa,da])}}}),Ju("onHide"),Ju("onShow")],Sh=/* */Object.freeze({__proto__:null,init:function(){function e(){o.get().each(function(n){v.clearTimeout(n)})}var o=rr(tn.none()),t=rr(tn.none()),n=nn("not-implemented");return qi({getTooltip:function(){return t.get()},isShowing:function(){return t.get().isSome()},setTooltip:function(n){t.set(tn.some(n))},clearTooltip:function(){t.set(tn.none())},clearTimer:e,resetTimer:function(n,t){e(),o.set(tn.some(v.setTimeout(function(){n()},t)))},readState:n})}}),kh=Ae("tooltip.exclusive"),Ch=Ae("tooltip.show"),Oh=Ae("tooltip.hide"),_h=/* */Object.freeze({__proto__:null,hideAllExclusive:Vp,setComponents:function(n,t,e,o){e.getTooltip().each(function(n){n.getSystem().isConnected()&&Og.set(n,o)})}}),Th=Oa({fields:wh,name:"tooltipping",active:/* */Object.freeze({__proto__:null,events:function(o,r){function e(t){r.getTooltip().each(function(n){Es(n),o.onHide(t,n),r.clearTooltip()}),r.clearTimer()}return Gt(z([[qt(Ch,function(n){r.resetTimer(function(){!function(t){if(!r.isShowing()){Vp(t);var n=o.lazySink(t).getOrDie(),e=t.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:Gt("normal"===o.mode?[qt(Ur(),function(n){zt(t,Ch)}),qt(Lr(),function(n){zt(t,Oh)})]:[]),behaviours:Ca([Og.config({})])});r.setTooltip(e),_s(n,e),o.onShow(t,e),If.position(n,o.anchor(t),e)}}(n)},o.delay)}),qt(Oh,function(n){r.resetTimer(function(){e(n)},o.delay)}),qt(oi(),function(n,t){sn(t.channels(),kh)&&e(n)}),Ti(function(n){e(n)})],"normal"===o.mode?[qt(Wr(),function(n){zt(n,Ch)}),qt(ti(),function(n){zt(n,Oh)}),qt(Ur(),function(n){zt(n,Ch)}),qt(Lr(),function(n){zt(n,Oh)})]:[qt(ki(),function(n,t){zt(n,Ch)}),qt(Ci(),function(n){zt(n,Oh)})]]))}}),state:Sh,apis:_h}),Eh=tinymce.util.Tools.resolve("tinymce.util.I18n"),Bh="tox-menu-nav__js",Dh="tox-collection__item",Ah="tox-swatch",Mh={normal:Bh,color:Ah},Fh="tox-collection__item--enabled",Ih="tox-collection__item-icon",Rh="tox-collection__item-label",Vh="tox-collection__item-caret",Hh="tox-collection__item--active",Nh=tinymce.util.Tools.resolve("tinymce.Env"),Ph=function(n){var e=Nh.mac?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},t=n.split("+"),o=w(t,function(n){var t=n.toLowerCase().trim();return yn(e,t)?e[t]:n});return Nh.mac?o.join(""):o.join("+")},zh=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],Lh=["list-bull-circle","list-bull-default","list-bull-square"],jh=["input","button","textarea","select"],Uh=function(t,n,e){n.disableClass.each(function(n){Ke(t.element(),n)}),(Xp(t,n)?Yp:Kp)(t),n.onDisabled(t)},Wh=/* */Object.freeze({__proto__:null,enable:$p,disable:Uh,isDisabled:Qp,onLoad:Gp,set:function(n,t,e,o){(o?Uh:$p)(n,t,e)}}),Gh=/* */Object.freeze({__proto__:null,exhibit:function(n,t){return Ne({classes:t.disabled?t.disableClass.map(M).getOr([]):[]})},events:function(e,n){return Gt([Xt(ri(),function(n,t){return Qp(n,e)}),xa(e,n,Gp)])}}),Xh=[pt("disabled",!1),pt("useNative",!0),st("disableClass"),Ju("onDisabled"),Ju("onEnabled")],Yh=Oa({fields:Xh,name:"disabling",active:Gh,apis:Wh}),qh=function(n){return Yh.config({disabled:n,disableClass:"tox-collection__item--state-disabled"})},Kh=function(n){return Yh.config({disabled:n})},Jh=function(n){return Yh.config({disabled:n,disableClass:"tox-tbtn--disabled"})},$h=function(n){return Yh.config({disabled:n,disableClass:"tox-tbtn--disabled",useNative:!1})};(oh=eh=eh||{})[oh.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",oh[oh.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";function Qh(n){return T(n,function(n){return n.toArray()})}function Zh(n,t,e){var o=rr(Z);return{type:"item",dom:t.dom,components:Qh(t.optComponents),data:n.data,eventOrder:rv,hasSubmenu:n.triggersSubmenu,itemBehaviours:Ca([nm("item-events",[function(e,o){return Bi(function(n,t){Zp(e,n)(e.onAction),e.triggersSubmenu||o!==ov.CLOSE_ON_EXECUTE||(zt(n,ci()),t.stop())})}(n,e),nh(n,o),th(n,o)]),qh(n.disabled),Og.config({})].concat(n.itemBehaviours))}}function nv(n){return{value:n.value,meta:P({text:n.text.getOr("")},n.meta)}}function tv(n,t){var e=function(n){return rp.DOM.encode(n)}(Eh.translate(n));if(0'+n+""})}return e}function ev(t,e,n){function o(n){return Lt(n,av,{row:t,col:e})}function r(n,t){t.stop(),o(n)}var i;return eu({dom:{tag:"div",attributes:(i={role:"button"},i["aria-labelledby"]=n,i)},behaviours:Ca([nm("insert-table-picker-cell",[qt(Ur(),Bg.focus),qt(ri(),o),qt(Jr(),r),qt(ui(),r)]),Rg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Bg.config({onFocus:function(n){return Lt(n,uv,{row:t,col:e})}})])})}var ov=eh,rv={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},iv=nn(Zs("item-widget",jg())),uv=Ae("cell-over"),av=Ae("cell-execute");function cv(n){return{value:nn(n)}}function sv(n){return yv.test(n)||xv.test(n)}function fv(n){var t=function(n){var t=n.value().replace(yv,function(n,t,e,o){return t+t+e+e+o+o});return{value:nn(t)}}(n),e=xv.exec(t.value());return null===e?["FFFFFF","FF","FF","FF"]:e}function lv(n){var t=n.toString(16);return 1===t.length?"0"+t:t}function dv(n){var t=lv(n.red())+lv(n.green())+lv(n.blue());return cv(t)}function mv(n,t,e,o){return{red:nn(n),green:nn(t),blue:nn(e),alpha:nn(o)}}function gv(n){var t=parseInt(n,10);return t.toString()===n&&0<=t&&t<=255}function pv(n){var t,e,o,r=(n.hue()||0)%360,i=n.saturation()/100,u=n.value()/100;if(i=Sv(0,wv(i,1)),u=Sv(0,wv(u,1)),0===i)return t=e=o=kv(255*u),mv(t,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),f=u-c;switch(Math.floor(a)){case 0:t=c,e=s,o=0;break;case 1:t=s,e=c,o=0;break;case 2:t=0,e=c,o=s;break;case 3:t=0,e=s,o=c;break;case 4:t=s,e=0,o=c;break;case 5:t=c,e=0,o=s;break;default:t=e=o=0}return t=kv(255*(t+f)),e=kv(255*(e+f)),o=kv(255*(o+f)),mv(t,e,o,1)}function hv(n){var t=fv(n),e=parseInt(t[1],16),o=parseInt(t[2],16),r=parseInt(t[3],16);return mv(e,o,r,1)}function vv(n,t,e,o){var r=parseInt(n,10),i=parseInt(t,10),u=parseInt(e,10),a=parseFloat(o);return mv(r,i,u,a)}function bv(n){return"rgba("+n.red()+","+n.green()+","+n.blue()+","+n.alpha()+")"}var yv=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,xv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,wv=Math.min,Sv=Math.max,kv=Math.round,Cv=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Ov=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,_v=nn(mv(255,0,0,1)),Tv=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Ev="tinymce-custom-colors";function Bv(n){var t=[],u=v.document.createElement("canvas");u.height=1,u.width=1;for(var a=u.getContext("2d"),c=function(n,t){var e=t/255;return("0"+Math.round(n*e+255*(1-e)).toString(16)).slice(-2).toUpperCase()},e=function(n){if(/^[0-9A-Fa-f]{6}$/.test(n))return"#"+n.toUpperCase();a.clearRect(0,0,u.width,u.height),a.fillStyle="#FFFFFF",a.fillStyle=n,a.fillRect(0,0,1,1);var t=a.getImageData(0,0,1,1).data,e=t[0],o=t[1],r=t[2],i=t[3];return"#"+c(e,i)+c(o,i)+c(r,i)},o=0;ot&&r.pop(),Tv.setItem(Ev,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),tb=function(n,t){return n.getParam("color_cols",t,"number")},eb=function(n){return!1!==n.getParam("custom_colors")},ob=function(n){var t=Dv(n);return t!==undefined?Bv(t):Zv},rb=function(){return w(nb.state(),function(n){return{type:Qv,text:n,value:n}})},ib=function(n){nb.add(n)},ub=function(n){return n.fire("SkinLoaded")},ab=function(n,t){return n.fire("SkinLoadError",t)},cb=function(n){return n.fire("ResizeEditor")},sb=function(n,t){return n.fire("ScrollContent",t)},fb=function(n,t){return n.fire("ResizeContent",t)},lb=function(n,t){return n.fire("TextColorChange",t)},db=function(i){return function(n,t){var e,o={colorpicker:t},r=(e=n,function(n){var t=n.getData();e(tn.from(t.colorpicker)),n.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(n,t){"hex-valid"===t.name&&(t.value?n.enable("ok"):n.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){n(tn.none())}})}},mb={register:function(n){!function(e){e.addCommand("mceApplyTextcolor",function(n,t){!function(n,t,e){n.undoManager.transact(function(){n.focus(),n.formatter.apply(t,{value:e}),n.nodeChanged()})}(e,n,t)}),e.addCommand("mceRemoveTextcolor",function(n){!function(n,t){n.undoManager.transact(function(){n.focus(),n.formatter.remove(t,{value:null},null,!0),n.nodeChanged()})}(e,n)})}(n);var t=rr(null),e=rr(null);Nv(n,"forecolor","forecolor","Text color",t),Nv(n,"backcolor","hilitecolor","Background color",e),Pv(n,"forecolor","forecolor","Text color"),Pv(n,"backcolor","hilitecolor","Background color")},getColors:Rv,getFetch:Vv,colorPickerDialog:db,getCurrentColor:Av,getColorCols:Fv,calcCols:Mv},gb=[qg.parts().items({})],pb=function(n,e,o,r,i,u,a){return Rl(w(n,function(t){return"choiceitem"===t.type?function(n){return qn("choicemenuitem",bh,n)}(t).fold(Yv,function(n){return tn.some(function(t,n,e,o,r,i,u){var a=Wp({presets:e,textContent:n?t.text:tn.none(),htmlContent:tn.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:n?t.shortcut:tn.none(),checkMark:n?tn.some(jp(u.icons)):tn.none(),caret:tn.none(),value:t.value},u,!0);return Sn(Zh({data:nv(t),disabled:t.disabled,getApi:function(t){return{setActive:function(n){Rg.set(t,n)},isActive:function(){return Rg.isOn(t)},isDisabled:function(){return Yh.isDisabled(t)},setDisabled:function(n){return Yh.set(t,n)}}},onAction:function(n){return o(t.value)},onSetup:function(n){return n.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},a,i),{toggling:{toggleClass:Fh,toggleOnExecute:!1,selected:t.active}})}(n,1===o,r,e,u(t.value),i,a))}):tn.none()}))};var hb,vb,bb={inserttable:function fI(o){var n=Ae("size-label"),i=function(n,t,e){for(var o=[],r=0;r"}function hw(d,m,g,p){function h(n,t,e,o,r){var i=d(yS+"range"),u=[by.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),by.parts().field({data:r,factory:xy,inputAttributes:P({type:"text"},"hex"===t?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:Ca([function(t,o){return Uy.config({invalidClass:m("invalid"),notify:{onValidate:function(n){Lt(n,bS,{type:t})},onValid:function(n){Lt(n,hS,{type:t,value:ol.getValue(n)})},onInvalid:function(n){Lt(n,vS,{type:t,value:ol.getValue(n)})}},validator:{validate:function(n){var t=ol.getValue(n),e=o(t)?K.value(!0):K.error(d("aria.input.invalid"));return Ny(e)},validateOnLoad:!1}})}(t,n),Xy.config({})]),onSetValue:function(n){Uy.isInvalid(n)&&Uy.run(n).get(Z)}})],a="hex"!==t?[by.parts()["aria-descriptor"]({text:i})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:u.concat(a)}}function v(n,t){var e=t.red(),o=t.green(),r=t.blue();ol.setValue(n,{red:e,green:o,blue:r})}function b(n,t){y.getOpt(n).each(function(n){io(n.element(),"background-color","#"+t.value())})}var y=gp({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});return Fl({factory:function(){function r(n){return u[n]().get()}function i(n,t){u[n]().set(t)}function t(n,t){var e=t.event();"hex"!==e.type()?i(e.type(),tn.none()):p(n)}function o(e,n,t){var o=parseInt(t,10);i(n,tn.some(o)),r("red").bind(function(e){return r("green").bind(function(t){return r("blue").map(function(n){return mv(e,t,n,1)})})}).each(function(n){var t=function(t,n){var e=dv(n);return pS.getField(t,"hex").each(function(n){Bg.isFocused(n)||ol.setValue(t,{hex:e.value()})}),e}(e,n);b(e,t)})}function e(n,t){var e=t.event();!function(n){return"hex"===n.type()}(e)?o(n,e.type(),e.value()):function(n,t){g(n);var e=cv(t);i("hex",tn.some(t));var o=hv(e);v(n,o),a(o),Lt(n,Iw(),{hex:e}),b(n,e)}(n,e.value())}function n(n){return{label:d(yS+n+".label"),description:d(yS+n+".description")}}var u={red:nn(rr(tn.some(255))),green:nn(rr(tn.some(255))),blue:nn(rr(tn.some(255))),hex:nn(rr(tn.some("ffffff")))},a=function(n){var t=n.red(),e=n.green(),o=n.blue();i("red",tn.some(t)),i("green",tn.some(e)),i("blue",tn.some(o))},c=n("red"),s=n("green"),f=n("blue"),l=n("hex");return Sn(pS.sketch(function(n){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[n.field("red",by.sketch(h(gv,"red",c.label,c.description,255))),n.field("green",by.sketch(h(gv,"green",s.label,s.description,255))),n.field("blue",by.sketch(h(gv,"blue",f.label,f.description,255))),n.field("hex",by.sketch(h(sv,"hex",l.label,l.description,"ffffff"))),y.asSpec()],formBehaviours:Ca([Uy.config({invalidClass:m("form-invalid")}),nm("rgb-form-events",[qt(hS,e),qt(vS,t),qt(bS,t)])])}}),{apis:{updateHex:function(n,t){ol.setValue(n,{hex:t.value()}),function(n,t){var e=hv(t);v(n,e),a(e)}(n,t),b(n,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(n,t,e){n.updateHex(t,e)}},extraApis:{}})}function vw(n,o){function r(n,t){var e=n.width,o=n.height,r=n.getContext("2d");if(null!==r){r.fillStyle=t,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)}}var i=dS.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),u=dS.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"'}});return Fl({factory:function(n){var t=nn({x:nn(0),y:nn(0)}),e=Ca([rd.config({find:tn.some}),Bg.config({})]);return dS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:t},rounded:!1,components:[i,u],onChange:function(n,t,e){Lt(n,Vw(),{value:e})},onInit:function(n,t,e,o){r(e.element().dom(),bv(_v()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(n,t,e){!function(n,t){var e=n.components()[0].element().dom();r(e,bv(t))}(t,e)}},extraApis:{}})}function bw(l,d){return Fl({name:"ColourPicker",configFields:[tt("dom"),pt("onValidHex",Z),pt("onInvalidHex",Z)],factory:function(n){function t(n,e){u.getOpt(n).each(function(n){var t=hv(e);s.paletteRgba().set(t),i.setRgba(n,t)})}function e(n,t){f.getOpt(n).each(function(n){r.updateHex(n,t)})}function a(t,e,n){fn(n,function(n){n(t,e)})}var o,c,r=hw(l,d,n.onValidHex,n.onInvalidHex),i=vw(0,d),s={paletteRgba:nn(rr(_v()))},u=gp(i.sketch({})),f=gp(r.sketch({}));return{uid:n.uid,dom:n.dom,components:[u.asSpec(),function(n,t){var e=dS.parts().spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=dS.parts().thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return dS.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:nn({y:nn(0)})},components:[e,o],sliderBehaviours:Ca([Bg.config({})]),onChange:function(n,t,e){Lt(n,Rw(),{value:e})}})}(0,d),f.asSpec()],behaviours:Ca([nm("colour-picker-events",[qt(Vw(),(c=[e],function(n,t){var e=t.event().value(),o=function(n){var t,e=0,o=0,r=n.red()/255,i=n.green()/255,u=n.blue()/255,a=Math.min(r,Math.min(i,u)),c=Math.max(r,Math.max(i,u));return a===c?fx(0,0,100*(o=a)):(e=60*((e=r===a?3:u===a?1:5)-(r===a?i-u:u===a?r-i:u-r)/(c-a)),t=(c-a)/c,o=c,fx(Math.round(e),Math.round(100*t),Math.round(100*o)))}(s.paletteRgba().get()),r=fx(o.hue(),e.x(),100-e.y()),i=pv(r),u=dv(i);a(n,u,c)})),qt(Rw(),(o=[t,e],function(n,t){var e=function(n){var t=fx((100-n)/100*360,100,100),e=pv(t);return dv(e)}(t.event().value().y());a(n,e,o)}))]),rd.config({find:function(n){return f.getOpt(n)}}),kg.config({mode:"acyclic"})])}}})}function yw(n){return function(n){return kS[n]}(n)}function xw(n,t,e){return ol.config(Sn({store:{mode:"manual",getValue:t,setValue:e}},n.map(function(n){return{store:{initialValue:n}}}).getOr({})))}function ww(n,t,e){return xw(n,function(n){return t(n.element())},function(n,t){return e(n.element(),t)})}function Sw(e,t){function o(n,t){t.stop()}function r(n){return function(t,e){fn(n,function(n){n(t,e)})}}function i(n,t){if(!Yh.isDisabled(n)){var e=t.event().raw();a(n,e.dataTransfer.files)}}function u(n,t){var e=t.event().raw().target.files;a(n,e)}var a=function(n,t){ol.setValue(n,function(n){var t=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i");return S(dn(n),function(n){return t.test(n.name)})}(t)),Lt(n,ay,{name:e.name})},c=gp({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Ca([nm("input-file-events",[Zt(Jr()),Zt(ui())])])}),n=e.label.map(function(n){return Dy(n,t)}),s=by.parts().field({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Ca([BS([]),xS(),Yh.config({}),Rg.config({toggleClass:"dragenter",toggleOnExecute:!1}),nm("dropzone-events",[qt("dragenter",r([o,Rg.toggle])),qt("dragleave",r([o,Rg.toggle])),qt("dragover",o),qt("drop",r([o,i])),qt(Kr(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:t.translate("Drop an image here")}},bp.sketch({dom:{tag:"button",innerHtml:t.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(n){c.get(n).element().dom().click()},buttonBehaviours:Ca([Xy.config({})])})]}]}}}});return By(n,s,["tox-form__group--stretched"],[])}function kw(n){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:n},behaviours:Ca([Bg.config({ignore:!0}),Xy.config({})])}}function Cw(n,t){Lt(n,Xr(),{raw:{which:9,shiftKey:t}})}function Ow(n,t){var e=RS&&n.sandboxed,o=P(P({},n.label.map(function(n){return{title:n}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),r=function(o){var r=rr("");return{getValue:function(n){return r.get()},setValue:function(n,t){if(o)ke(n.element(),"srcdoc",t);else{ke(n.element(),"src","javascript:''");var e=n.element().dom().contentWindow.document;e.open(),e.write(t),e.close()}r.set(t)}}}(e),i=n.label.map(function(n){return Dy(n,t)}),u=by.parts().field({factory:{sketch:function(n){return IS({uid:n.uid,dom:{tag:"iframe",attributes:o},behaviours:Ca([Xy.config({}),Bg.config({}),TS(tn.none(),r.getValue,r.setValue)])})}}});return By(i,u,["tox-form__group--stretched"],[])}var _w=function(t,n){return t.getSystem().getByUid(n.uid+"-"+Qy()).map(function(n){return function(){return K.value(n)}}).getOrThunk(function(){return n.lazySink.fold(function(){return function(){return K.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(n){return function(){return n(t)}})})},Tw=nn([tt("dom"),tt("fetch"),Ju("onOpen"),$u("onExecute"),pt("getHotspot",tn.some),pt("getAnchorOverrides",nn({})),Hc(),Us("dropdownBehaviours",[Rg,$y,kg,Bg]),tt("toggleClass"),pt("eventOrder",{}),st("lazySink"),pt("matchWidth",!1),pt("useMinWidth",!1),st("role")].concat(cx())),Ew=nn([Ol({schema:[Yu()],name:"menu",defaults:function(n){return{onExecute:n.onExecute}}}),Zy()]),Bw=Il({name:"Dropdown",configFields:Tw(),partFields:Ew(),factory:function(t,n,e,o){function r(n){Wf.getState(n).each(function(n){Zg.highlightPrimary(n)})}function i(n,t){return jt(n),tn.some(!0)}var u,a,c={expand:function(n){Rg.isOn(n)||ox(t,function(n){return n},n,o,Z,Ay.HighlightNone).get(Z)},open:function(n){Rg.isOn(n)||ox(t,function(n){return n},n,o,Z,Ay.HighlightFirst).get(Z)},isOpen:Rg.isOn,close:function(n){Rg.isOn(n)&&ox(t,function(n){return n},n,o,Z,Ay.HighlightFirst).get(Z)},repositionMenus:function(n){Rg.isOn(n)&&ax(n)}};return{uid:t.uid,dom:t.dom,components:n,behaviours:Gs(t.dropdownBehaviours,[Rg.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),$y.config({others:{sandbox:function(n){return ux(t,n,{onOpen:function(){Rg.on(n)},onClose:function(){Rg.off(n)}})}}}),kg.config({mode:"special",onSpace:i,onEnter:i,onDown:function(n,t){if(Bw.isOpen(n)){var e=$y.getCoupled(n,"sandbox");r(e)}else Bw.open(n);return tn.some(!0)},onEscape:function(n,t){return Bw.isOpen(n)?(Bw.close(n),tn.some(!0)):tn.none()}}),Bg.config({})]),events:sm(tn.some(function(n){ox(t,function(n){return n},n,o,r,Ay.HighlightFirst).get(Z)})),eventOrder:P(P({},t.eventOrder),(u={},u[ri()]=["disabling","toggling","alloy.base.behaviour"],u)),apis:c,domModification:{attributes:P(P({"aria-haspopup":"true"},t.role.fold(function(){return{}},function(n){return{role:n}})),"button"===t.dom.tag?{type:(a="type",bn(t.dom,"attributes").bind(function(n){return bn(n,a)})).getOr("button")}:{})}}},apis:{open:function(n,t){return n.open(t)},expand:function(n,t){return n.expand(t)},close:function(n,t){return n.close(t)},isOpen:function(n,t){return n.isOpen(t)},repositionMenus:function(n,t){return n.repositionMenus(t)}}}),Dw=Oa({fields:[],name:"unselecting",active:/* */Object.freeze({__proto__:null,events:function(){return Gt([Xt(Qr(),nn(!0))])},exhibit:function(){return Ne({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Aw=Ae("color-input-change"),Mw=Ae("color-swatch-change"),Fw=Ae("color-picker-cancel"),Iw=nn(Ae("rgb-hex-update")),Rw=nn(Ae("slider-update")),Vw=nn(Ae("palette-update")),Hw=_l({schema:[tt("dom")],name:"label"}),Nw=lx("top-left"),Pw=lx("top"),zw=lx("top-right"),Lw=lx("right"),jw=lx("bottom-right"),Uw=lx("bottom"),Ww=lx("bottom-left"),Gw=[Hw,lx("left"),Lw,Pw,Uw,Nw,zw,Ww,jw,Cl({name:"thumb",defaults:nn({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:Gt([$t(Rr(),n,"spectrum"),$t(Vr(),n,"spectrum"),$t(Hr(),n,"spectrum"),$t(Pr(),n,"spectrum"),$t(zr(),n,"spectrum"),$t(jr(),n,"spectrum")])}}}),Cl({schema:[kt("mouseIsDown",function(){return rr(!1)})],name:"spectrum",overrides:function(e){function o(t,n){return r.getValueFromEvent(n).map(function(n){return r.setValueFrom(t,e,n)})}var r=e.model.manager;return{behaviours:Ca([kg.config({mode:"special",onLeft:function(n){return r.onLeft(n,e)},onRight:function(n){return r.onRight(n,e)},onUp:function(n){return r.onUp(n,e)},onDown:function(n){return r.onDown(n,e)}}),Bg.config({})]),events:Gt([qt(Rr(),o),qt(Vr(),o),qt(Pr(),o),qt(zr(),function(n,t){e.mouseIsDown.get()&&o(n,t)})])}}})],Xw=nn("slider.change.value"),Yw="left",qw=iw(-1),Kw=iw(1),Jw=tn.none,$w=tn.none,Qw={"top-left":tn.none(),top:tn.none(),"top-right":tn.none(),right:tn.some(function(n,t){Px(n,Vx(yx(t)))}),"bottom-right":tn.none(),bottom:tn.none(),"bottom-left":tn.none(),left:tn.some(function(n,t){Px(n,Vx(px(t)))})},Zw=/* */Object.freeze({__proto__:null,setValueFrom:function(n,t,e){var o=rw(n,t,e),r=ow(o);return ew(n,r),o},setToMin:function(n,t){var e=mx(t);ew(n,ow(e))},setToMax:function(n,t){var e=vx(t);ew(n,ow(e))},findValueOfOffset:rw,getValueFromEvent:function(n){return dx(n).map(function(n){return n.left()})},findPositionOfValue:uw,setPositionFromValue:function(n,t,e,o){var r=Rx(e),i=uw(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=su(t.element())/2;io(t.element(),"left",i-u+"px")},onLeft:qw,onRight:Kw,onUp:Jw,onDown:$w,edgeActions:Qw}),nS=tn.none,tS=tn.none,eS=fw(-1),oS=fw(1),rS={"top-left":tn.none(),top:tn.some(function(n,t){Px(n,Hx(hx(t)))}),"top-right":tn.none(),right:tn.none(),"bottom-right":tn.none(),bottom:tn.some(function(n,t){Px(n,Hx(xx(t)))}),"bottom-left":tn.none(),left:tn.none()},iS=/* */Object.freeze({__proto__:null,setValueFrom:function(n,t,e){var o=sw(n,t,e),r=cw(o);return aw(n,r),o},setToMin:function(n,t){var e=gx(t);aw(n,cw(e))},setToMax:function(n,t){var e=bx(t);aw(n,cw(e))},findValueOfOffset:sw,getValueFromEvent:function(n){return dx(n).map(function(n){return n.top()})},findPositionOfValue:lw,setPositionFromValue:function(n,t,e,o){var r=Rx(e),i=lw(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),u=iu(t.element())/2;io(t.element(),"top",i-u+"px")},onLeft:nS,onRight:tS,onUp:eS,onDown:oS,edgeActions:rS}),uS=gw(-1,!1),aS=gw(1,!1),cS=gw(-1,!0),sS=gw(1,!0),fS={"top-left":tn.some(function(n,t){Px(n,Nx(px(t),hx(t)))}),top:tn.some(function(n,t){Px(n,Nx(Cx(t),hx(t)))}),"top-right":tn.some(function(n,t){Px(n,Nx(yx(t),hx(t)))}),right:tn.some(function(n,t){Px(n,Nx(yx(t),Ox(t)))}),"bottom-right":tn.some(function(n,t){Px(n,Nx(yx(t),xx(t)))}),bottom:tn.some(function(n,t){Px(n,Nx(Cx(t),xx(t)))}),"bottom-left":tn.some(function(n,t){Px(n,Nx(px(t),xx(t)))}),left:tn.some(function(n,t){Px(n,Nx(px(t),Ox(t)))})},lS=/* */Object.freeze({__proto__:null,setValueFrom:function(n,t,e){var o=rw(n,t,e.left()),r=sw(n,t,e.top()),i=mw(o,r);return dw(n,i),i},setToMin:function(n,t){var e=mx(t),o=gx(t);dw(n,mw(e,o))},setToMax:function(n,t){var e=vx(t),o=bx(t);dw(n,mw(e,o))},getValueFromEvent:function(n){return dx(n)},setPositionFromValue:function(n,t,e,o){var r=Rx(e),i=uw(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=lw(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),a=su(t.element())/2,c=iu(t.element())/2;io(t.element(),"left",i-a+"px"),io(t.element(),"top",u-c+"px")},onLeft:uS,onRight:aS,onUp:cS,onDown:sS,edgeActions:fS}),dS=Il({name:"Slider",configFields:[pt("stepSize",1),pt("onChange",Z),pt("onChoose",Z),pt("onInit",Z),pt("onDragStart",Z),pt("onDragEnd",Z),pt("snapToGrid",!1),pt("rounded",!0),st("snapStart"),et("model",Qn("mode",{x:[pt("minX",0),pt("maxX",100),kt("value",function(n){return rr(n.mode.minX)}),tt("getInitialValue"),na("manager",Zw)],y:[pt("minY",0),pt("maxY",100),kt("value",function(n){return rr(n.mode.minY)}),tt("getInitialValue"),na("manager",iS)],xy:[pt("minX",0),pt("maxX",100),pt("minY",0),pt("maxY",100),kt("value",function(n){return rr({x:nn(n.mode.minX),y:nn(n.mode.minY)})}),tt("getInitialValue"),na("manager",lS)]})),Us("sliderBehaviours",[kg,ol]),kt("mouseIsDown",function(){return rr(!1)})],partFields:Gw,factory:function(i,n,t,e){function u(n){return af(n,i,"thumb")}function a(n){return af(n,i,"spectrum")}function o(n){return uf(n,i,"left-edge")}function r(n){return uf(n,i,"right-edge")}function c(n){return uf(n,i,"top-edge")}function s(n){return uf(n,i,"bottom-edge")}function f(n,t){v.setPositionFromValue(n,t,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})}function l(n,t){h.value.set(t);var e=u(n);return f(n,e),i.onChange(n,e,t),tn.some(!0)}function d(e){var n=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&uf(e,i,"thumb").each(function(n){var t=h.value.get();i.onChoose(e,n,t)})}function m(n,t){t.stop(),i.mouseIsDown.set(!0),i.onDragStart(n,u(n))}function g(n,t){t.stop(),i.onDragEnd(n,u(n)),d(n)}var p,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:n,behaviours:Gs(i.sliderBehaviours,[kg.config({mode:"special",focusIn:function(n){return uf(n,i,"spectrum").map(kg.focusIn).map(nn(!0))}}),ol.config({store:{mode:"manual",getValue:function(n){return h.value.get()}}}),xc.config({channels:(p={},p[Yf()]={onReceive:d},p)})]),events:Gt([qt(Xw(),function(n,t){l(n,t.event().value())}),_i(function(n,t){var e=h.getInitialValue();h.value.set(e);var o=u(n);f(n,o);var r=a(n);i.onInit(n,o,r,h.value.get())}),qt(Rr(),m),qt(Hr(),g),qt(Pr(),m),qt(jr(),g)]),apis:{resetToMin:function(n){v.setToMin(n,i)},resetToMax:function(n){v.setToMax(n,i)},changeValue:l,refresh:f},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,t){n.resetToMin(t)},resetToMax:function(n,t){n.resetToMax(t)},refresh:function(n,t){n.refresh(t)}}}),mS=[Us("formBehaviours",[ol])],gS=function(o,n){return{uid:o.uid,dom:o.dom,components:n,behaviours:Gs(o.formBehaviours,[ol.config({store:{mode:"manual",getValue:function(n){var t=sf(n,o);return L(t,function(n,t){return n().bind(function(n){return function(n,t){return n.fold(function(){return K.error(t)},K.value)}(rd.getCurrent(n),new Error("Cannot find a current component to extract the value from for form part '"+t+"': "+De(n.element())))}).map(ol.getValue)})},setValue:function(e,n){pn(n,function(t,n){uf(e,o,n).each(function(n){rd.getCurrent(n).each(function(n){ol.setValue(n,t)})})})}}})]),apis:{getField:function(n,t){return uf(n,o,t).bind(rd.getCurrent)}}}},pS={getField:Ve(function(n,t,e){return n.getField(t,e)}),sketch:function(n){var e,t=(e=[],{field:function(n,t){return e.push(n),nf("form",pw(n),t)},record:function(){return e}}),o=n(t),r=t.record(),i=w(r,function(n){return Cl({name:n,pname:pw(n)})});return pf("form",mS,i,gS,o)}},hS=Ae("valid-input"),vS=Ae("invalid-input"),bS=Ae("validating-input"),yS="colorcustom.rgb.",xS=function(){return rd.config({find:tn.some})},wS=function(n){return rd.config({find:n.getOpt})},SS=function(n){return rd.config({find:function(t){return le(t.element(),n).bind(function(n){return t.getSystem().getByDom(n).toOption()})}})},kS={"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"},CS=tinymce.util.Tools.resolve("tinymce.Resource"),OS=Uo([pt("preprocess",B),pt("postprocess",B)]),_S=function(r,n){var i=Jn("RepresentingConfigs.memento processors",OS,n);return ol.config({store:{mode:"manual",getValue:function(n){var t=r.get(n),e=ol.getValue(t);return i.postprocess(e)},setValue:function(n,t){var e=i.preprocess(t),o=r.get(n);ol.setValue(o,e)}}})},TS=xw,ES=function(n){return ww(n,be,ye)},BS=function(n){return ol.config({store:{mode:"memory",initialValue:n}})},DS=Ae("alloy-fake-before-tabstop"),AS=Ae("alloy-fake-after-tabstop"),MS=function(n){return Fb(n,["."+DS,"."+AS].join(","),nn(!1))},FS=function(n,t){var e=t.element();Qe(e,DS)?Cw(n,!0):Qe(e,AS)&&Cw(n,!1)},IS=function(n){return{dom:{tag:"div",classes:["tox-navobj"]},components:[kw([DS]),n,kw([AS])],behaviours:Ca([SS(1)])}},RS=!(At().browser.isIE()||At().browser.isEdge());function VS(n,t){return PS(v.document.createElement("canvas"),n,t)}function HS(n){var t=VS(n.width,n.height);return NS(t).drawImage(n,0,0),t}function NS(n){return n.getContext("2d")}function PS(n,t,e){return n.width=t,n.height=e,n}function zS(n){return n.naturalWidth||n.width}function LS(n){return n.naturalHeight||n.height}var jS,US,WS=window.Promise?window.Promise:(jS=GS.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){v.setTimeout(n,1)},US=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},GS.prototype["catch"]=function(n){return this.then(null,n)},GS.prototype.then=function(e,o){var r=this;return new GS(function(n,t){YS.call(r,new $S(e,o,n,t))})},GS.all=function(){for(var n=[],t=0;t").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:e}).appendTo(d.body),hC(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(n)},c=function(n){if(wC(n),n.button!==u)return a(n);n.deltaX=n.screenX-f,n.deltaY=n.screenY-l,n.preventDefault(),r.drag(n)},a=function(n){wC(n),hC(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(n)},this.destroy=function(){hC(m).off()},hC(m).on("mousedown touchstart",t)}function kC(t){function u(n,s){c.getOpt(n).each(function(n){var e=l.get(),o=su(n.element()),r=iu(n.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),t={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};uo(s,t),f.getOpt(n).each(function(n){uo(n.element(),t)}),d.get().each(function(n){var t=m.get();n.setRect({x:t.x*e+a,y:t.y*e+c,w:t.w*e,h:t.h*e}),n.setClampRect({x:a,y:c,w:i,h:u}),n.setViewPortRect({x:0,y:0,w:o,h:r})})})}function e(n,t){var i=ur.fromTag("img");return ke(i,"src",t),function(e){return new ah(function(n){var t=function(){e.removeEventListener("load",t),n(e)};e.complete?n(e):e.addEventListener("load",t)})}(i.dom()).then(function(){return c.getOpt(n).map(function(n){var t=nu({element:i});Og.replaceAt(n,1,tn.some(t));var e=a.get(),o={x:0,y:0,w:i.dom().naturalWidth,h:i.dom().naturalHeight};a.set(o);var r=vC.inflate(o,-20,-20);return m.set(r),e.w===o.w&&e.h===o.h||function(n,u){c.getOpt(n).each(function(n){var t=su(n.element()),e=iu(n.element()),o=u.dom().naturalWidth,r=u.dom().naturalHeight,i=Math.min(t/o,e/r);1<=i?l.set(1):l.set(i)})}(n,i),u(n,i),i})})}var f=gp({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),l=rr(1),d=rr(tn.none()),m=rr({x:0,y:0,w:1,h:1}),a=rr({x:0,y:0,w:1,h:1}),n=uy.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[f.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:Ca([nm("image-panel-crop-events",[_i(function(n){c.getOpt(n).each(function(n){var t=n.element().dom(),e=TC({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t,function(){});e.toggleVisibility(!1),e.on("updateRect",function(n){var t=n.rect,e=l.get(),o={x:Math.round(t.x/e),y:Math.round(t.y/e),w:Math.round(t.w/e),h:Math.round(t.h/e)};m.set(o)}),d.set(tn.some(e))})})])])}],containerBehaviours:Ca([Og.config({}),nm("image-panel-events",[_i(function(n){e(n,t)})])])}),c=gp(n);return{memContainer:c,updateSrc:e,zoom:function(n,t){var e=l.get(),o=0').appendTo(o),yC.each(i,function(n){hC("#"+a,o).append(''),components:[],behaviours:Ca([NT.config({channel:nI,initialData:n,updateState:function(n,t){var e=w(t.buttons,function(n){var t=gp(function(n,t){return Yk(n,n.type,t)}(n,o));return{name:n.name,align:n.align,memento:t}});return tn.some({lookupByName:function(n,t){return function(t,n,e){return O(n,function(n){return n.name===e}).bind(function(n){return n.memento.getOpt(t)})}(n,e,t)},footerButtons:e})},renderComponents:uM})])}}function cM(n,t){return OM.parts().footer(aM(n,t))}function sM(t,e){if(t.getRoot().getSystem().isConnected()){var o=rd.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return pS.getField(o,e).fold(function(){var n=t.getFooter();return NT.getState(n).get().bind(function(n){return n.lookupByName(o,e)})},function(n){return tn.some(n)})}return tn.none()}function fM(u,o,a){function n(n){var t=u.getRoot();t.getSystem().isConnected()&&n(t)}var c={getData:function(){var n=u.getRoot(),t=n.getSystem().isConnected()?u.getFormWrapper():n,e=ol.getValue(t),o=L(a,function(n){return n.get()});return P(P({},e),o)},setData:function(i){n(function(n){var t=c.getData(),e=P(P({},t),i),o=function(n,t){var e=n.getRoot();return NT.getState(e).get().map(function(n){return Kn(qn("data",n.dataValidator,t))}).getOr(t)}(u,e),r=u.getFormWrapper();ol.setValue(r,o),pn(a,function(n,t){yn(e,t)&&n.set(e[t])})})},disable:function(n){sM(u,n).each(Yh.disable)},enable:function(n){sM(u,n).each(Yh.enable)},focus:function(n){sM(u,n).each(Bg.focus)},block:function(t){if(!J(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){Lt(n,dy,{message:t})})},unblock:function(){n(function(n){zt(n,my)})},showTab:function(e){n(function(n){var t=u.getBody();NT.getState(t).get().exists(function(n){return n.isTabPanel()})&&rd.getCurrent(t).each(function(n){qF.showTab(n,e)})})},redial:function(e){n(function(n){var t=o(e);n.getSystem().broadcastOn([$F],t),n.getSystem().broadcastOn([QF],t.internalDialog),n.getSystem().broadcastOn([ZF],t.internalDialog),n.getSystem().broadcastOn([nI],t.internalDialog),c.setData(t.initialData)})},close:function(){n(function(n){zt(n,cy)})}};return c}function lM(n,t,e){var o=nM(n.internalDialog.title,e),r=function(n,t){var e=UA(n,tn.none(),t,!1);return OM.parts().body(e)}({body:n.internalDialog.body},e),i=oM(n.internalDialog.buttons),u=rM(i),a=cM({buttons:i},e),c=rI(function(){return d},tM(function(){return l},t),e.shared.getSink),s="normal"!==n.internalDialog.size?"large"===n.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],f={header:o,body:r,footer:tn.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},l=eM(f,n,c,e),d=fM({getRoot:function(){return l},getBody:function(){return OM.getBody(l)},getFooter:function(){return OM.getFooter(l)},getFormWrapper:function(){var n=OM.getBody(l);return rd.getCurrent(n).getOr(n)}},t.redial,u);return{dialog:l,instanceApi:d}}function dM(n,t,e,o){var r,i,u=Ae("dialog-label"),a=Ae("dialog-content"),c=gp(function(n,t,e){return uy.sketch({dom:NE('
'),components:[QA(n,tn.some(t),e),ZA(),$A(e)],containerBehaviours:Ca([TA.config({mode:"mouse",blockerClass:"blocker",getTarget:function(n){return Nu(n,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})}({title:n.internalDialog.title,draggable:!0},u,e.shared.providers)),s=gp(function(n,t,e,o){return UA(n,tn.some(t),e,o)}({body:n.internalDialog.body},a,e,o)),f=oM(n.internalDialog.buttons),l=rM(f),d=gp(function(n,t){return aM(n,t)}({buttons:f},e)),m=rI(function(){return p},{onBlock:function(){},onUnblock:function(){},onClose:function(){return t.closeWindow()}},e.shared.getSink),g=eu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(r={role:"dialog"},r["aria-labelledby"]=u,r["aria-describedby"]=""+a,r)},eventOrder:(i={},i[oi()]=[NT.name(),xc.name()],i[ri()]=["execute-on-form"],i[pi()]=["reflecting","execute-on-form"],i),behaviours:Ca([kg.config({mode:"cyclic",onEscape:function(n){return zt(n,cy),tn.some(!0)},useTabstopAt:function(n){return!MS(n)&&("button"!==xe(n)||"disabled"!==Ce(n,"disabled"))}}),NT.config({channel:$F,updateState:function(n,t){return tn.some(t)},initialData:n}),Bg.config({}),nm("execute-on-form",m.concat([ne(Wr(),function(n,t){kg.focusIn(n)})])),BS({})]),components:[c.asSpec(),s.asSpec(),d.asSpec()]}),p=fM({getRoot:function(){return g},getFooter:function(){return d.get(g)},getBody:function(){return s.get(g)},getFormWrapper:function(){var n=s.get(g);return rd.getCurrent(n).getOr(n)}},t.redial,l);return{dialog:g,instanceApi:p}}function mM(n){return $(n)&&-1!==uI.indexOf(n.mceAction)}function gM(e,n,o,t){var r,i=nM(e.title,t),u=function(n){var t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[IS({dom:{tag:"iframe",attributes:{src:n.url}},behaviours:Ca([Xy.config({}),Bg.config({})])})]}],behaviours:Ca([kg.config({mode:"acyclic",useTabstopAt:b(MS)})])};return OM.parts().body(t)}(e),a=e.buttons.bind(function(n){return 0===n.length?tn.none():tn.some(cM({buttons:n},t))}),c=oI(function(){return h},tM(function(){return p},n)),s=P(P({},e.height.fold(function(){return{}},function(n){return{height:n+"px","max-height":n+"px"}})),e.width.fold(function(){return{}},function(n){return{width:n+"px","max-width":n+"px"}})),f=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[],l=new iI(e.url,{base_uri:new iI(v.window.location.href)}),d=l.protocol+"://"+l.host+(l.port?":"+l.port:""),m=rr(tn.none()),g=[nm("messages",[_i(function(){var n=Ab(ur.fromDom(v.window),"message",function(n){if(l.isSameOrigin(new iI(n.raw().origin))){var t=n.raw().data;mM(t)?function(n,t,e){switch(e.mceAction){case"insertContent":n.insertContent(e.content);break;case"setContent":n.setContent(e.content);break;case"execCommand":var o=!!en(e.ui)&&e.ui;n.execCommand(e.cmd,o,e.value);break;case"close":t.close();break;case"block":t.block(e.message);break;case"unblock":t.unblock()}}(o,h,t):function(n){return!mM(n)&&$(n)&&yn(n,"mceAction")}(t)&&e.onMessage(h,t)}});m.set(tn.some(n))}),Ti(function(){m.get().each(function(n){return n.unbind()})})]),xc.config({channels:(r={},r[tI]={onReceive:function(n,t){Hu(n.element(),"iframe").each(function(n){n.dom().contentWindow.postMessage(t,d)})}},r)})],p=eM({header:i,body:u,footer:a,extraClasses:f,extraBehaviours:g,extraStyles:s},e,c,t),h=function(t){function n(n){t.getSystem().isConnected()&&n(t)}return{block:function(t){if(!J(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){Lt(n,dy,{message:t})})},unblock:function(){n(function(n){zt(n,my)})},close:function(){n(function(n){zt(n,cy)})},sendMessage:function(t){n(function(n){n.getSystem().broadcastOn([tI],t)})}}}(p);return{dialog:p,instanceApi:h}}var pM,hM,vM,bM,yM=function(i,r){r.delimiter||(r.delimiter="\xbb");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Ca([kg.config({mode:"flow",selector:"div[role=button]"}),Xy.config({}),Og.config({}),nm("elementPathEvents",[_i(function(e,n){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return kg.focusIn(e)}),i.on("NodeChange",function(n){var t=function(n){for(var t=[],e=n.length;0