/** * 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.0.16 (2019-09-24) */ !function(M){"use strict";function Z(){}function c(e,o){return function(){for(var n=[],t=0;t "+o.toString()},function(n,t){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return ue.objOf(w(o,function(n){return n.fold(function(n,t,e,o){return ae.field(n,e,o)},function(n,t){return ae.state(n)})}))}}},fe=nn(Xn($t)),le=c(qn,se),de=ce.state,me=ce.field,ge=Xn($t),pe=function(o){return{extract:function(n,t,e){return o().extract(n,t,e)},toString:function(){return o().toString()},toDsl:function(){return o().toDsl()}}},he=function(n){return"Errors: \n"+function(n){var t=10 ")+")\n"+n.getErrorInfo()})}(n.errors)+"\n\nInput object: "+Ln(n.input)},ve=nn(ge),be=it(mn,"number"),ye=it(cn,"string"),xe=it(ln,"boolean"),we=it(dn,"function"),Se=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 Se(t[n])});case"Map":return n(t.keys(),Se)&&n(t.values(),Se);case"Set":return n(t.keys(),Se);default:return!1}},ke=Xn(function(n){return Se(n)?$t(n):Zt("Expected value to be acceptable for sending via postMessage")}),Ce=function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return Ce(t())}}},Oe=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:nn(n)}},Te={fromHtml:function(n,t){var e=(t||M.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1 "):o[0].name();return q(r,function(n,t){return{handler:n,purpose:nn(t)}}(t,e))})});return J(t,{})},cu=function(n,t){return oi(n)?n.style.getPropertyValue(t):""},su=function(n){var t=et("external.component",Yn([at("element"),pt("uid")]),n),e=Ce(Rr());t.uid.each(function(n){Qi(t.element,n)});var o={getSystem:e.get,config:on.none,hasConfigured:nn(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(Rr(function(){return o}))},getApis:function(){return{}},element:nn(t.element),spec:nn(n),readState:nn("No state"),syncComponents:Z,components:nn([]),events:nn({})};return Nr(o)},fu=Ir,lu=function(t){return function(n){return Vn(n,ou)}(t).fold(function(){var n=t.hasOwnProperty("uid")?t:I({uid:fu("")},t);return xi(n).getOrDie()},function(n){return n})},du=Nr,mu=function(t,n){return function(n,t,e){return qo(n,t,e).isSome()}(n,function(n){return zt(n,t.element())},nn(!1))||Ti(t,n)},gu="unknown";(Mi=Fi=Fi||{})[Mi.STOP=0]="STOP",Mi[Mi.NORMAL=1]="NORMAL",Mi[Mi.LOGGING=2]="LOGGING";function pu(t,n,e){switch(Vn(Ru.get(),t).orThunk(function(){var n=xn(Ru.get());return Bi(n,function(n){return-1=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}var za=na("height",function(n){var t=n.dom();return Xo(n)?t.getBoundingClientRect().height:t.offsetHeight}),La=na("width",function(n){return n.dom().offsetWidth}),ja=(Ye.detect().browser.isSafari(),function(o,n){return o.view(n).fold(nn([]),function(n){var t=o.owner(n),e=ja(o,t);return[n].concat(e)})}),Ua=/* */Object.freeze({view:function(n){return(n.dom()===M.document?on.none():on.from(n.dom().defaultView.frameElement)).map(Te.fromDom)},owner:function(n){return fr(n)}}),Wa=ur("point","width","height"),Ga=ur("x","y","width","height"),Xa=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],Ya=ur("x","y","bubble","direction","label"),qa=Tn([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Ka=qa.southeast,Ja=qa.southwest,$a=qa.northeast,Qa=qa.northwest,Za=qa.south,nc=qa.north,tc=qa.east,ec=qa.west,oc=sr(["x","y","width","height","maxHeight","direction","classes","label","candidateYforTest"],[]),rc=ur("position","left","top","right","bottom"),ic=Tn([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),uc=ic.relative,ac=ic.fixed,cc=function(n){return"rtl"===ci(n,"direction")?"rtl":"ltr"},sc=[at("hotspot"),pt("bubble"),wt("overrides",{}),Fa(),Cu("placement",function(n,t,e){var o=t.hotspot,r=_a(e,o.element()),i=Ma(n.element(),t,Ta(),Ea());return on.some(Da({anchorBox:r,bubble:t.bubble.getOr(la()),overrides:t.overrides,layouts:i,placer:on.none()}))})],fc=[at("x"),at("y"),wt("height",0),wt("width",0),wt("bubble",la()),wt("overrides",{}),Fa(),Cu("placement",function(n,t,e){var o=aa(t.x,t.y,t.width,t.height),r=Ma(n.element(),t,Ta(),Ea());return on.some(Da({anchorBox:o,bubble:t.bubble,overrides:t.overrides,layouts:r,placer:on.none()}))})],lc={create:ur("start","soffset","finish","foffset")},dc=Tn([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),mc=(dc.before,dc.on,dc.after,function(n){return n.fold(f,f,f)}),gc=Tn([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),pc={domRange:gc.domRange,relative:gc.relative,exact:gc.exact,exactFromRange:function(n){return gc.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){var t=function(n){return n.match({domRange:function(n){return Te.fromDom(n.startContainer)},relative:function(n,t){return mc(n)},exact:function(n,t,e,o){return n}})}(n);return lr(t)},range:lc.create},hc=Tn([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);function vc(n){return Is.get(n)}function bc(n){return Is.getOption(n)}function yc(e,o,n,t,r){function i(n){var t=e.dom().createRange();return t.setStart(o.dom(),n),t.collapse(!0),t}var u=vc(o).length,a=function(n,t,e,o,r){if(0===r)return 0;if(t===o)return r-1;for(var i=o,u=1;u"}),ve()),If=_t("schema",function(){return[pt("preprocess")]}),Rf=wt("defaults",nn({})),Vf=wt("overrides",nn({})),Nf=se([Df,Af,Ff,Mf,Rf,Vf]),Hf=se([Df,Af,Ff,Rf,Vf]),Pf=se([Df,Af,Ff,Mf,Rf,Vf]),zf=se([Df,If,Ff,at("unit"),Mf,Rf,Vf]),Lf=hs(_f.required,Nf),jf=hs(_f.external,Hf),Uf=hs(_f.optional,Pf),Wf=hs(_f.group,zf),Gf=nn("entirety"),Xf=/* */Object.freeze({required:Lf,external:jf,optional:Uf,group:Wf,asNamedPart:gs,name:ps,asCommon:function(n){return n.fold(f,f,f,f)},original:Gf}),Yf=function(n,t){return{uiType:Bf(),owner:n,name:t}},qf=/* */Object.freeze({generate:bs,generateOne:ys,schemas:xs,names:ws,substitutes:Ss,components:ks,defaultUids:Ds,defaultUidsSchema:As,getAllParts:Es,getAllPartNames:Bs,getPart:Cs,getPartOrDie:Os,getParts:Ts,getPartsOrDie:_s}),Kf=function(n){return n.hasOwnProperty("uid")?n:I(I({},n),{uid:Ir("uid")})};function Jf(n){var t=et("Sketcher for "+n.name,wl,n),e=N(t.apis,Hr),o=N(t.extraApis,function(n,t){return Vr(n,t)});return I(I({name:nn(t.name),partFields:nn([]),configFields:nn(t.configFields),sketch:function(n){return function(n,t,e,o){var r=Kf(o);return e(Fs(n,t,r,[],[]),r)}(t.name,t.configFields,t.factory,n)}},e),o)}function $f(n){var t=et("Sketcher for "+n.name,Sl,n),e=bs(t.name,t.partFields),o=N(t.apis,Hr),r=N(t.extraApis,function(n,t){return Vr(n,t)});return I(I({name:nn(t.name),partFields:nn(t.partFields),configFields:nn(t.configFields),sketch:function(n){return Ms(t.name,t.configFields,t.partFields,t.factory,n)},parts:nn(e)},o),r)}function Qf(n){return"input"===Wo(n)&&"radio"!==Er(n,"type")||"textarea"===Wo(n)}function Zf(n,t,e,o){var r=n+t;return o',t.getDoc());return Ui(n,Te.fromDom(e.extractContents())),e.insertNode(n.dom()),dr(n).each(function(n){return n.dom().normalize()}),Sc(n).map(function(n){t.selection.setCursorLocation(n.dom(),function(n){return"img"===Wo(n)?1:bc(n).fold(function(){return gr(n).length},function(n){return n.length})}(n))}),n})}function Og(n,t){return n.toString().substring(t.length).replace(/\u00A0/g," ").replace(/\uFEFF/g,"")}function Tg(n,u,a,c){return void 0===c&&(c=0),function(n){return n.collapsed&&3===n.startContainer.nodeType}(u)?kg(n,u.startContainer,u.startOffset,function(e,o,r,n){var i=n.getOr(r.length);return function(n,t,e,o){var r;for(r=t-1;0<=r;r--){var i=n.charAt(r);if(ap.test(i))return on.none();if(i===e)break}return-1===r||t-ro}).getOr(r.length);return on.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return on.none()}function Fg(n,t){return Du([Td(n,t)])}function Mg(n,t,e){n.getSystem().broadcastOn([Op],{})}function Ig(n){var t=Te.fromHtml(n),e=gr(t),o=function(n){var t=n.dom().attributes!==undefined?n.dom().attributes:[];return C(t,function(n,t){var e;return"class"===t.name?n:I(I({},n),((e={})[t.name]=t.value,e))},{})}(t),r=function(n){return Array.prototype.slice.call(n.dom().classList,0)}(t),i=0===e.length?{}:{innerHtml:Sr(t)};return I({tag:Wo(t),classes:r,attributes:o},i)}function Rg(n){return Vn(Ip,n).getOr(Ap)}function Vg(n){return{dom:{tag:"div",classes:[Vp],innerHtml:n}}}function Ng(n){return{dom:{tag:"div",classes:[Np]},components:[wi(Dp.translate(n))]}}function Hg(n,t){return{dom:{tag:"div",classes:[Np]},components:[{dom:{tag:n.tag,attributes:{style:n.styleAttr}},components:[wi(Dp.translate(t))]}]}}function Pg(n){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:zp(n)}}}function zg(n){return{dom:{tag:"div",classes:[Vp,"tox-collection__item-checkmark"],innerHtml:zd("checkmark",n)}}}function Lg(n,t,e,o,r){var i=e?n.checkMark.orThunk(function(){return t.or(on.some("")).map(Vg)}):on.none(),u=n.ariaLabel.map(function(n){return{attributes:{title:Dp.translate(n)}}}).getOr({});return{dom:_n({tag:"div",classes:[Ap,Fp].concat(r?["tox-collection__item-icon-rtl"]:[])},u),optComponents:[i,n.htmlContent.fold(function(){return n.textContent.map(o)},function(n){return on.some(function(n){return{dom:{tag:"div",classes:[Np],innerHtml:n}}}(n))}),n.shortcutContent.map(Pg),n.caret]}}function jg(n,t,e,o){void 0===o&&(o=on.none());var r=Dp.isRtl()&&n.iconContent.exists(function(n){return vn(jp,n)}),i=n.iconContent.map(function(n){return Dp.isRtl()&&vn(Lp,n)?n+"-rtl":n}).map(function(n){return function(n,t,e){return on.from(t()[n]).or(e).getOrThunk(function(){return Pd(t)})}(n,t.icons,o)}),u=on.from(n.meta).fold(function(){return Ng},function(n){return On(n,"style")?l(Hg,n.style):Ng});return"color"===n.presets?function(n,t,e,o){var r,i,u;return{dom:(r=Mp,i=e.getOr(""),u=n.map(function(n){return' title="'+o.translate(n)+'"'}).getOr(""),Ig("custom"===t?'":"remove"===t?'
"+i+"
":'
")),optComponents:[]}}(n.ariaLabel,n.value,i,t):Lg(n,i,e,u,r)}function Ug(n,t,e){t.disabled&&Wp(n,t)}function Wg(n,t){return!0===t.useNative&&vn(Up,Wo(n.element()))}function Gg(n){Or(n.element(),"disabled","disabled")}function Xg(n){_r(n.element(),"disabled")}function Yg(n){Or(n.element(),"aria-disabled","true")}function qg(n){Or(n.element(),"aria-disabled","false")}function Kg(t,n,e){n.disableClass.each(function(n){Zr(t.element(),n)}),(Wg(t,n)?Xg:qg)(t),n.onEnabled(t)}function Jg(n,t){return Wg(n,t)?function(n){return Br(n.element(),"disabled")}(n):function(n){return"true"===Er(n.element(),"aria-disabled")}(n)}function $g(n,t){var e=n.getApi(t);return function(n){n(e)}}function Qg(e,o){return Pi(function(n){$g(e,n)(function(n){var t=e.onSetup(n);null!==t&&t!==undefined&&o.set(t)})})}function Zg(t,e){return zi(function(n){return $g(t,n)(e.get())})}var np,tp,ep=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),op=Tn([{aborted:[]},{edge:["element"]},{success:["info"]}]),rp=Tn([{abort:[]},{kontinue:[]},{finish:["info"]}]),ip=function(t,e,n,o,r,i){function u(){return i.fold(op.aborted,op.edge)}function a(){var n=r();return n?ip(t,n,on.none(),o,r,on.some(e)):u()}if(t.isBlock(e))return u();if(function(n){return n.nodeType===M.Node.TEXT_NODE}(e)){var c=e.textContent;return o(rp,e,c,n).fold(op.aborted,function(){return a()},op.success)}return a()},up=function(n){return Ci(n,"[data-mce-autocompleter]")},ap=/[\u00a0 \t\r\n]/,cp=function(e,n){n.on("keypress compositionend",e.onKeypress.throttle),n.on("remove",e.onKeypress.cancel);function o(n,t){Gt(n,fo(),{raw:t})}n.on("keydown",function(t){function n(){return e.getView().bind(Ml.getHighlighted)}8===t.which&&e.onKeypress.throttle(t),e.isActive()&&(27===t.which&&e.cancelIfNecessary(),e.isMenuOpen()?13===t.which?(n().each(Xt),t.preventDefault()):40===t.which?(n().fold(function(){e.getView().each(Ml.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()&&up(Te.fromDom(n.element)).isNone()&&e.cancelIfNecessary()})},sp=tinymce.util.Tools.resolve("tinymce.util.Promise"),fp=function(n){if(function(n){return n.nodeType===M.Node.TEXT_NODE}(n))return Bg(n,n.data.length);var t=n.childNodes;return 0=n.minChars&&n.matches.getOrThunk(function(){return function(e){function o(n,t,e,o){var r=o.getOr(e.length);return 0===r?n.kontinue():n.finish(/\s/.test(e.charAt(r-1)))}return function(n){var t=lp(n.startContainer,n.startOffset);return kg(e,t.element,t.offset,o).fold(nn(!0),nn(!0),f)}}(t.dom)})(e.range,i,e.text)});if(0===u.length)return on.none();var a=sp.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 on.some({lookupData:a,context:e})},mp=se([st("type"),bt("text")]),gp=se([_t("type",function(){return"autocompleteitem"}),_t("active",function(){return!1}),_t("disabled",function(){return!1}),wt("meta",{}),st("value"),bt("text"),bt("icon")]),pp=se([st("type"),st("ch"),kt("minChars",1),wt("columns",1),kt("maxResults",10),yt("matches"),lt("fetch"),lt("onAction")]),hp=[Tt("disabled",!1),bt("text"),bt("shortcut"),me("value","value",Mn(function(){return Mr("menuitem-value")}),ve()),wt("meta",{})],vp=se([st("type"),Et("onSetup",function(){return Z}),Et("onAction",Z),bt("icon")].concat(hp)),bp=se([st("type"),lt("getSubmenuItems"),Et("onSetup",function(){return Z}),bt("icon")].concat(hp)),yp=se([st("type"),Tt("active",!1),Et("onSetup",function(){return Z}),lt("onAction")].concat(hp)),xp=se([st("type"),Tt("active",!1),bt("icon")].concat(hp)),wp=se([st("type"),ft("fancytype",["inserttable","colorswatch"]),Et("onAction",Z)]),Sp=function(n){return Fg(Mr("unnamed-events"),n)},kp=[at("lazySink"),at("tooltipDom"),wt("exclusive",!0),wt("tooltipComponents",[]),wt("delay",300),Ot("mode","normal",["normal","follow-highlight"]),wt("anchor",function(n){return{anchor:"hotspot",hotspot:n,layouts:{onLtr:nn([ka,Sa,ba,xa,ya,wa]),onRtl:nn([ka,Sa,ba,xa,ya,wa])}}}),xu("onHide"),xu("onShow")],Cp=/* */Object.freeze({init:function(){function e(){o.get().each(function(n){M.clearTimeout(n)})}var o=Ce(on.none()),t=Ce(on.none()),n=nn("not-implemented");return iu({getTooltip:function(){return t.get()},isShowing:function(){return t.get().isSome()},setTooltip:function(n){t.set(on.some(n))},clearTooltip:function(){t.set(on.none())},clearTimer:e,resetTimer:function(n,t){e(),o.set(on.some(M.setTimeout(function(){n()},t)))},readState:n})}}),Op=Mr("tooltip.exclusive"),Tp=Mr("tooltip.show"),Ep=Mr("tooltip.hide"),Bp=/* */Object.freeze({hideAllExclusive:Mg,setComponents:function(n,t,e,o){e.getTooltip().each(function(n){n.getSystem().isConnected()&&Im.set(n,o)})}}),_p=Au({fields:kp,name:"tooltipping",active:/* */Object.freeze({events:function(o,r){function e(t){r.getTooltip().each(function(n){ts(n),o.onHide(t,n),r.clearTooltip()}),r.clearTimer()}return Jo(R([[Zo(Tp,function(n){r.resetTimer(function(){!function(t){if(!r.isShowing()){Mg(t);var n=o.lazySink(t).getOrDie(),e=t.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:Jo("normal"===o.mode?[Zo(ao(),function(n){Wt(t,Tp)}),Zo(io(),function(n){Wt(t,Ep)})]:[]),behaviours:Du([Im.config({})])});r.setTooltip(e),Zc(n,e),o.onShow(t,e),uf.position(n,o.anchor(t),e)}}(n)},o.delay)}),Zo(Ep,function(n){r.resetTimer(function(){e(n)},o.delay)}),Zo(So(),function(n,t){vn(t.channels(),Op)&&e(n)}),zi(function(n){e(n)})],"normal"===o.mode?[Zo(co(),function(n){Wt(n,Tp)}),Zo(xo(),function(n){Wt(n,Ep)}),Zo(ao(),function(n){Wt(n,Tp)}),Zo(io(),function(n){Wt(n,Ep)})]:[Zo(zo(),function(n,t){Wt(n,Tp)}),Zo(Lo(),function(n){Wt(n,Ep)})]]))}}),state:Cp,apis:Bp}),Dp=tinymce.util.Tools.resolve("tinymce.util.I18n"),Ap="tox-menu-nav__js",Fp="tox-collection__item",Mp="tox-swatch",Ip={normal:Ap,color:Mp},Rp="tox-collection__item--enabled",Vp="tox-collection__item-icon",Np="tox-collection__item-label",Hp="tox-collection__item--active",Pp=tinymce.util.Tools.resolve("tinymce.Env"),zp=function(n){var e=Pp.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 On(e,t)?e[t]:n});return Pp.mac?o.join(""):o.join("+")},Lp=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],jp=["list-bull-circle","list-bull-default","list-bull-square"],Up=["input","button","textarea","select"],Wp=function(t,n,e){n.disableClass.each(function(n){$r(t.element(),n)}),(Wg(t,n)?Gg:Yg)(t),n.onDisabled(t)},Gp=/* */Object.freeze({enable:Kg,disable:Wp,isDisabled:Jg,onLoad:Ug,set:function(n,t,e,o){(o?Wp:Kg)(n,t,e)}}),Xp=/* */Object.freeze({exhibit:function(n,t,e){return zr({classes:t.disabled?t.disableClass.map(A).getOr([]):[]})},events:function(e,n){return Jo([$o(ko(),function(n,t){return Jg(n,e)}),Tu(e,n,Ug)])}}),Yp=[wt("disabled",!1),wt("useNative",!0),pt("disableClass"),xu("onDisabled"),xu("onEnabled")],qp=Au({fields:Yp,name:"disabling",active:Xp,apis:Gp}),Kp=function(n){return qp.config({disabled:n,disableClass:"tox-collection__item--state-disabled"})},Jp=function(n){return qp.config({disabled:n})},$p=function(n){return qp.config({disabled:n,disableClass:"tox-tbtn--disabled"})},Qp=function(n){return qp.config({disabled:n,disableClass:"tox-tbtn--disabled",useNative:!1})};(tp=np=np||{})[tp.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",tp[tp.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";function Zp(n){return E(n,function(n){return n.toArray()})}function nh(n,t,e){var o=Ce(Z);return{type:"item",dom:t.dom,components:Zp(t.optComponents),data:n.data,eventOrder:ih,hasSubmenu:n.triggersSubmenu,itemBehaviours:Du([Td("item-events",[function(e,o){return ji(function(n,t){$g(e,n)(e.onAction),e.triggersSubmenu||o!==rh.CLOSE_ON_EXECUTE||(Wt(n,Bo()),t.stop())})}(n,e),Qg(n,o),Zg(n,o)]),Kp(n.disabled),Im.config({})].concat(n.itemBehaviours))}}function th(n){return{value:n.value,meta:_n({text:n.text.getOr("")},n.meta)}}function eh(n,t){var e=function(n){return uh.DOM.encode(n)}(Dp.translate(n));if(0'+n+""})}return e}function oh(t,e,n){function o(n){return Gt(n,sh,{row:t,col:e})}var r;return lu({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:Du([Td("insert-table-picker-cell",[Zo(ao(),Xm.focus),Zo(ko(),o),Zo(To(),o)]),Qm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Xm.config({onFocus:function(n){return Gt(n,ch,{row:t,col:e})}})])})}var rh=np,ih={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},uh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),ah=nn(bs("item-widget",ig())),ch=Mr("cell-over"),sh=Mr("cell-execute");function fh(n){return{value:nn(n)}}function lh(n){return wh.test(n)||Sh.test(n)}function dh(n){var t=function(n){var t=n.value().replace(wh,function(n,t,e,o){return t+t+e+e+o+o});return{value:nn(t)}}(n),e=Sh.exec(t.value());return null===e?["FFFFFF","FF","FF","FF"]:e}function mh(n){var t=n.toString(16);return 1===t.length?"0"+t:t}function gh(n){var t=mh(n.red())+mh(n.green())+mh(n.blue());return fh(t)}function ph(n,t,e,o){return{red:nn(n),green:nn(t),blue:nn(e),alpha:nn(o)}}function hh(n){var t=parseInt(n,10);return t.toString()===n&&0<=t&&t<=255}function vh(n){var t,e,o,r=(n.hue()||0)%360,i=n.saturation()/100,u=n.value()/100;if(i=Ch(0,kh(i,1)),u=Ch(0,kh(u,1)),0===i)return t=e=o=Oh(255*u),ph(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=Oh(255*(t+f)),e=Oh(255*(e+f)),o=Oh(255*(o+f)),ph(t,e,o,1)}function bh(n){var t=dh(n),e=parseInt(t[1],16),o=parseInt(t[2],16),r=parseInt(t[3],16);return ph(e,o,r,1)}function yh(n,t,e,o){var r=parseInt(n,10),i=parseInt(t,10),u=parseInt(e,10),a=parseFloat(o);return ph(r,i,u,a)}function xh(n){return"rgba("+n.red()+","+n.green()+","+n.blue()+","+n.alpha()+")"}var wh=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Sh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,kh=Math.min,Ch=Math.max,Oh=Math.round,Th=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,Eh=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,Bh=nn(ph(255,0,0,1)),_h=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Dh="tinymce-custom-colors";function Ah(n){var t=[],u=M.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(),_h.setItem(Dh,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),tv=function(n,t){return n.getParam("color_cols",t,"number")},ev=function(n){return!1!==n.getParam("custom_colors")},ov=function(n){var t=Fh(n);return t!==undefined?Ah(t):Zh},rv=function(){return w(nv.state(),function(n){return{type:Qh,text:n,value:n}})},iv=function(n){nv.add(n)},uv=function(n){return n.fire("SkinLoaded")},av=function(n){return n.fire("ResizeEditor")},cv=function(n){return n.fire("ResizeContent")},sv=function(n,t){n.fire("TextColorChange",t)},fv=function(i){return function(n,t){var e,o={colorpicker:t},r=(e=n,function(n){var t=n.getData();e(on.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(on.none())}})}},lv={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=Ce(null),e=Ce(null);zh(n,"forecolor","forecolor","Text color",t),zh(n,"backcolor","hilitecolor","Background color",e),Lh(n,"forecolor","forecolor","Text color"),Lh(n,"backcolor","hilitecolor","Background color")},getColors:Nh,getFetch:Hh,colorPickerDialog:fv,getCurrentColor:Mh,getColorCols:Rh,calcCols:Ih},dv=[lg.parts().items({})],mv=function(n,e,o,r,i,u,a){return Ei(w(n,function(t){return"choiceitem"===t.type?function(n){return nt("choicemenuitem",xp,n)}(t).fold(qh,function(n){return on.some(function(t,n,e,o,r,i,u){var a=jg({presets:e,textContent:n?t.text:on.none(),htmlContent:on.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:n?t.shortcut:on.none(),checkMark:n?on.some(zg(u.icons)):on.none(),caret:on.none(),value:t.value},u,!0);return Bn(nh({data:th(t),disabled:t.disabled,getApi:function(t){return{setActive:function(n){Qm.set(t,n)},isActive:function(){return Qm.isOn(t)},isDisabled:function(){return qp.isDisabled(t)},setDisabled:function(n){return qp.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:Rp,toggleOnExecute:!1,selected:t.active}})}(n,1===o,r,e,u(t.value),i,a))}):on.none()}))};var gv,pv,hv={inserttable:function TF(o){var n=Mr("size-label"),i=function(n,t,e){for(var o=[],r=0;r"}function Ex(n){return function(n){return iS[n]}(n)}function Bx(n,t,e){return jm.config(Bn({store:{mode:"manual",getValue:t,setValue:e}},n.map(function(n){return{store:{initialValue:n}}}).getOr({})))}function _x(n,t,e){return Bx(n,function(n){return t(n.element())},function(n,t){return e(n.element(),t)})}function Dx(e,t){function o(n,t){t.stop()}function r(n){return function(t,e){bn(n,function(n){n(t,e)})}}function i(n,t){if(!qp.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){jm.setValue(n,function(n){var t=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i");return S(yn(n),function(n){return t.test(n.name)})}(t)),Gt(n,bb,{name:e.name})},c=Hd({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Du([Td("input-file-events",[rr(To())])])}),n=e.label.map(function(n){return fy(n,t)}),s=_b.parts().field({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Du([lS([]),eS(),qp.config({}),Qm.config({toggleClass:"dragenter",toggleOnExecute:!1}),Td("dropzone-events",[Zo("dragenter",r([o,Qm.toggle])),Zo("dragleave",r([o,Qm.toggle])),Zo("dragover",o),Zo("drop",r([o,i])),Zo(go(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:t.translate("Drop an image here")}},vg.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:Du([Zx.config({})])})]}]}}}});return cy(n,s,["tox-form__group--stretched"],[])}function Ax(n){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:n},behaviours:Du([Xm.config({ignore:!0}),Zx.config({})])}}function Fx(n,t){Gt(n,fo(),{raw:{which:9,shiftKey:t}})}function Mx(n,t){var e=vS&&n.sandboxed,o=I(I({},n.label.map(function(n){return{title:n}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),r=function(o){var r=Ce("");return{getValue:function(n){return r.get()},setValue:function(n,t){if(o)Or(n.element(),"srcdoc",t);else{Or(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 fy(n,t)}),u=_b.parts().field({factory:{sketch:function(n){return hS({uid:n.uid,dom:{tag:"iframe",attributes:o},behaviours:Du([Zx.config({}),Xm.config({}),sS(on.none(),r.getValue,r.setValue)])})}}});return cy(i,u,["tox-form__group--stretched"],[])}var Ix=function(t,n){return t.getSystem().getByUid(n.uid+"-"+qb()).map(function(n){return function(){return an.value(n)}}).getOrThunk(function(){return n.lazySink.fold(function(){return function(){return an.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(n){return function(){return n(t)}})})},Rx=function(n){oy(n,function(n,t){return n.setSelectionRange(t.length,t.length)})},Vx=nn([pt("data"),wt("inputAttributes",{}),wt("inputStyles",{}),wt("tag","input"),wt("inputClasses",[]),xu("onSetValue"),wt("styles",{}),wt("eventOrder",{}),ss("inputBehaviours",[jm,Xm]),wt("selectOnFocus",!0)]),Nx=nn("alloy.typeahead.itemexecute"),Hx=nn([pt("lazySink"),at("fetch"),wt("minChars",5),wt("responseTime",1e3),xu("onOpen"),wt("getHotspot",on.some),wt("getAnchorOverrides",nn({})),wt("layouts",on.none()),wt("eventOrder",{}),Bt("model",{},[wt("getDisplayText",function(n){return n.meta!==undefined&&n.meta.text!==undefined?n.meta.text:n.value}),wt("selectsOver",!0),wt("populateFromBrowse",!0)]),xu("onSetValue"),wu("onExecute"),xu("onItemExecute"),wt("inputClasses",[]),wt("inputAttributes",{}),wt("inputStyles",{}),wt("matchWidth",!0),wt("useMinWidth",!1),wt("dismissOnBlur",!0),bu(["openClass"]),pt("initialData"),ss("typeaheadBehaviours",[Xm,jm,Vb,Fm,Qm,Fb]),_t("previewing",function(){return Ce(!0)})].concat(Vx()).concat(ay())),Px=nn([jf({schema:[vu()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(t,e){o.previewing.get()?t.getSystem().getByUid(o.uid).each(function(n){ry(o.model,n,e).fold(function(){return Ml.dehighlight(t,e)},function(n){return n()})}):t.getSystem().getByUid(o.uid).each(function(n){o.model.populateFromBrowse&&ey(o.model,n,e)}),o.previewing.set(!1)},onExecute:function(n,t){return n.getSystem().getByUid(o.uid).toOption().map(function(n){return Gt(n,Nx(),{item:t}),!0})},onHover:function(n,t){o.previewing.set(!1),n.getSystem().getByUid(o.uid).each(function(n){o.model.populateFromBrowse&&ey(o.model,n,t)})}}}})]),zx=$f({name:"Typeahead",configFields:Hx(),partFields:Px(),factory:function(r,n,t,i){function e(n,t,e){r.previewing.set(!1);var o=Fb.getCoupled(n,"sandbox");if(hf.isOpen(o))Ol.getCurrent(o).each(function(n){Ml.getHighlighted(n).fold(function(){e(n)},function(){qt(o,n.element(),"keydown",t)})});else{$b(r,u(n),n,o,i,function(n){Ol.getCurrent(n).each(e)},zb.HighlightFirst).get(Z)}}var o=iy(r),u=function(o){return function(n){return n.map(function(n){var t=H(n.menus),e=E(t,function(n){return S(n.items,function(n){return"item"===n.type})});return jm.getState(o).update(w(e,function(n){return n.data})),n})}},a=[Xm.config({}),jm.config({onSetValue:r.onSetValue,store:I({mode:"dataset",getDataKey:function(n){return mi(n.element())},getFallbackEntry:function(n){return{value:n,meta:{}}},setValue:function(n,t){gi(n.element(),r.model.getDisplayText(t))}},r.initialData.map(function(n){return q("initialValue",n)}).getOr({}))}),Vb.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(n,t){var e=Fb.getCoupled(n,"sandbox");if(Xm.isFocused(n)&&mi(n.element()).length>=r.minChars){var o=Ol.getCurrent(e).bind(function(n){return Ml.getHighlighted(n).map(jm.getValue)});r.previewing.set(!0);$b(r,u(n),n,e,i,function(n){Ol.getCurrent(e).each(function(n){o.fold(function(){r.model.selectsOver&&Ml.highlightFirst(n)},function(t){Ml.highlightBy(n,function(n){return jm.getValue(n).value===t.value}),Ml.getHighlighted(n).orThunk(function(){return Ml.highlightFirst(n),on.none()})})})},zb.HighlightFirst).get(Z)}},cancelEvent:_o()}),Fm.config({mode:"special",onDown:function(n,t){return e(n,t,Ml.highlightFirst),on.some(!0)},onEscape:function(n){var t=Fb.getCoupled(n,"sandbox");return hf.isOpen(t)?(hf.close(t),on.some(!0)):on.none()},onUp:function(n,t){return e(n,t,Ml.highlightLast),on.some(!0)},onEnter:function(t){var n=Fb.getCoupled(t,"sandbox"),e=hf.isOpen(n);if(e&&!r.previewing.get())return Ol.getCurrent(n).bind(function(n){return Ml.getHighlighted(n)}).map(function(n){return Gt(t,Nx(),{item:n}),!0});var o=jm.getValue(t);return Wt(t,_o()),r.onExecute(n,t,o),e&&hf.close(n),on.some(!0)}}),Qm.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),Fb.config({others:{sandbox:function(n){return ty(r,n,{onOpen:function(){return Qm.on(n)},onClose:function(){return Qm.off(n)}})}}}),Td("typeaheadevents",[ji(function(n){var t=Z;Zb(r,u(n),n,i,t,zb.HighlightFirst).get(Z)}),Zo(Nx(),function(n,t){var e=Fb.getCoupled(n,"sandbox");ey(r.model,n,t.event().item()),Wt(n,_o()),r.onItemExecute(n,e,t.event().item(),jm.getValue(n)),hf.close(e),Rx(n)})].concat(r.dismissOnBlur?[Zo(xo(),function(n){var t=Fb.getCoupled(n,"sandbox");pl(t.element()).isNone()&&hf.close(t)})]:[]))];return{uid:r.uid,dom:uy(Bn(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:I(I({},o),ls(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),Lx=function(n,t,e,o){return{dom:jx(e),components:n.toArray().concat([t]),fieldBehaviours:Du(o)}},jx=function(n){return{tag:"div",classes:["tox-form__group"].concat(n)}},Ux={type:"separator"},Wx=function(n,r){var t=dy(cn(n)?n.split(" "):n,r);return k(t,function(n,t){var e=function(n){if(ly(n))return n;var t=Vn(n,"value").getOrThunk(function(){return Mr("generated-menu-item")});return Bn({value:t},n)}(t),o=my(e,r);return{menus:Bn(n.menus,o.menus),items:[o.item].concat(n.items),expansions:Bn(n.expansions,o.expansions)}},{menus:{},expansions:{},items:[]})},Gx=Jf({name:"Input",configFields:Vx(),factory:function(n,t){return{uid:n.uid,dom:uy(n),components:[],behaviours:function(n){return I(I({},iy(n)),ls(n.inputBehaviours,[jm.config({store:{mode:"manual",initialValue:n.data.getOr(undefined),getValue:function(n){return mi(n.element())},setValue:function(n,t){mi(n.element())!==t&&gi(n.element(),t)}},onSetValue:n.onSetValue})]))}(n),eventOrder:n.eventOrder}}}),Xx=["input","textarea"],Yx=/* */Object.freeze({markValid:hy,markInvalid:vy,query:by,run:yy,isInvalid:function(n,t){var e=t.getRoot(n).getOr(n.element());return ni(e,t.invalidClass)}}),qx=/* */Object.freeze({events:function(t,n){return t.validator.map(function(n){return Jo([Zo(n.onEvent,function(n){yy(n,t).get(f)})].concat(n.validateOnLoad?[Pi(function(n){yy(n,t).get(Z)})]:[]))}).getOr({})}}),Kx=[at("invalidClass"),wt("getRoot",on.none),xt("notify",[wt("aria","alert"),wt("getContainer",on.none),wt("validHtml",""),xu("onValid"),xu("onInvalid"),xu("onValidate")]),xt("validator",[at("validate"),wt("onEvent","input"),wt("validateOnLoad",!0)])],Jx=Au({fields:Kx,name:"invalidating",active:qx,apis:Yx,extra:{validation:function(e){return function(n){var t=jm.getValue(n);return Yb(e(t))}}}}),$x=/* */Object.freeze({exhibit:function(n,t){return zr({attributes:K([{key:t.tabAttr,value:"true"}])})}}),Qx=[wt("tabAttr","data-alloy-tabstop")],Zx=Au({fields:Qx,name:"tabstopping",active:$x}),nw=nn([at("dom"),at("fetch"),xu("onOpen"),wu("onExecute"),wt("getHotspot",on.some),wt("getAnchorOverrides",nn({})),wt("layouts",on.none()),ss("dropdownBehaviours",[Qm,Fb,Fm,Xm]),at("toggleClass"),wt("eventOrder",{}),pt("lazySink"),wt("matchWidth",!1),wt("useMinWidth",!1),pt("role")].concat(ay())),tw=nn([jf({schema:[vu()],name:"menu",defaults:function(n){return{onExecute:n.onExecute}}}),Kb()]),ew=$f({name:"Dropdown",configFields:nw(),partFields:tw(),factory:function(t,n,e,o){function r(n){hf.getState(n).each(function(n){pg.highlightPrimary(n)})}function i(n,t){return Xt(n),on.some(!0)}var u,a,c={expand:function(n){Qm.isOn(n)||Zb(t,function(n){return n},n,o,Z,zb.HighlightNone).get(Z)},open:function(n){Qm.isOn(n)||Zb(t,function(n){return n},n,o,Z,zb.HighlightFirst).get(Z)},isOpen:Qm.isOn,close:function(n){Qm.isOn(n)&&Zb(t,function(n){return n},n,o,Z,zb.HighlightFirst).get(Z)}};return{uid:t.uid,dom:t.dom,components:n,behaviours:ls(t.dropdownBehaviours,[Qm.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),Fb.config({others:{sandbox:function(n){return ty(t,n,{onOpen:function(){Qm.on(n)},onClose:function(){Qm.off(n)}})}}}),Fm.config({mode:"special",onSpace:i,onEnter:i,onDown:function(n,t){if(ew.isOpen(n)){var e=Fb.getCoupled(n,"sandbox");r(e)}else ew.open(n);return on.some(!0)},onEscape:function(n,t){return ew.isOpen(n)?(ew.close(n),on.some(!0)):on.none()}}),Xm.config({})]),events:Nd(on.some(function(n){Zb(t,function(n){return n},n,o,r,zb.HighlightFirst).get(Z)})),eventOrder:I(I({},t.eventOrder),(u={},u[ko()]=["disabling","toggling","alloy.base.behaviour"],u)),apis:c,domModification:{attributes:I(I({"aria-haspopup":"true"},t.role.fold(function(){return{}},function(n){return{role:n}})),"button"===t.dom.tag?{type:(a="type",Vn(t.dom,"attributes").bind(function(n){return Vn(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)}}}),ow=Au({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(n){return Jo([$o(vo(),nn(!0))])},exhibit:function(n,t){return zr({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),rw=Mr("color-input-change"),iw=Mr("color-swatch-change"),uw=Mr("color-picker-cancel"),aw=nn(Mr("rgb-hex-update")),cw=nn(Mr("slider-update")),sw=nn(Mr("palette-update")),fw=Ye.detect().deviceType.isTouch(),lw=Uf({schema:[at("dom")],name:"label"}),dw=Sy("top-left"),mw=Sy("top"),gw=Sy("top-right"),pw=Sy("right"),hw=Sy("bottom-right"),vw=Sy("bottom"),bw=Sy("bottom-left"),yw=[lw,Sy("left"),pw,mw,vw,dw,gw,bw,hw,Lf({name:"thumb",defaults:nn({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:Jo([er(no(),n,"spectrum"),er(to(),n,"spectrum"),er(eo(),n,"spectrum"),er(oo(),n,"spectrum"),er(ro(),n,"spectrum"),er(uo(),n,"spectrum")])}}}),Lf({schema:[_t("mouseIsDown",function(){return Ce(!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,n=Jo([Zo(no(),o),Zo(to(),o)]),t=Jo([Zo(oo(),o),Zo(ro(),function(n,t){e.mouseIsDown.get()&&o(n,t)})]);return{behaviours:Du(fw?[]:[Fm.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)}}),Xm.config({})]),events:fw?n:t}}})],xw=Ye.detect().deviceType.isTouch(),ww=nn("slider.change.value"),Sw="left",kw=hx(-1),Cw=hx(1),Ow=on.none,Tw=on.none,Ew={"top-left":on.none(),top:on.none(),"top-right":on.none(),right:on.some(function(n,t){Jy(n,Yy(Dy(t)))}),"bottom-right":on.none(),bottom:on.none(),"bottom-left":on.none(),left:on.some(function(n,t){Jy(n,Yy(Ty(t)))})},Bw=/* */Object.freeze({setValueFrom:function(n,t,e){var o=px(n,t,e),r=gx(o);return mx(n,r),o},setToMin:function(n,t){var e=Cy(t);mx(n,gx(e))},setToMax:function(n,t){var e=By(t);mx(n,gx(e))},findValueOfOffset:px,getValueFromEvent:function(n){return ky(n).map(function(n){return n.left()})},findPositionOfValue:vx,setPositionFromValue:function(n,t,e,o){var r=Xy(e),i=vx(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=oa(t.element())/2;ui(t.element(),"left",i-u+"px")},onLeft:kw,onRight:Cw,onUp:Ow,onDown:Tw,edgeActions:Ew}),_w=on.none,Dw=on.none,Aw=wx(-1),Fw=wx(1),Mw={"top-left":on.none(),top:on.some(function(n,t){Jy(n,qy(Ey(t)))}),"top-right":on.none(),right:on.none(),"bottom-right":on.none(),bottom:on.some(function(n,t){Jy(n,qy(Ay(t)))}),"bottom-left":on.none(),left:on.none()},Iw=/* */Object.freeze({setValueFrom:function(n,t,e){var o=xx(n,t,e),r=yx(o);return bx(n,r),o},setToMin:function(n,t){var e=Oy(t);bx(n,yx(e))},setToMax:function(n,t){var e=_y(t);bx(n,yx(e))},findValueOfOffset:xx,getValueFromEvent:function(n){return ky(n).map(function(n){return n.top()})},findPositionOfValue:Sx,setPositionFromValue:function(n,t,e,o){var r=Xy(e),i=Sx(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),u=ta(t.element())/2;ui(t.element(),"top",i-u+"px")},onLeft:_w,onRight:Dw,onUp:Aw,onDown:Fw,edgeActions:Mw}),Rw=Ox(-1,!1),Vw=Ox(1,!1),Nw=Ox(-1,!0),Hw=Ox(1,!0),Pw={"top-left":on.some(function(n,t){Jy(n,Ky(Ty(t),Ey(t)))}),top:on.some(function(n,t){Jy(n,Ky(Ry(t),Ey(t)))}),"top-right":on.some(function(n,t){Jy(n,Ky(Dy(t),Ey(t)))}),right:on.some(function(n,t){Jy(n,Ky(Dy(t),Vy(t)))}),"bottom-right":on.some(function(n,t){Jy(n,Ky(Dy(t),Ay(t)))}),bottom:on.some(function(n,t){Jy(n,Ky(Ry(t),Ay(t)))}),"bottom-left":on.some(function(n,t){Jy(n,Ky(Ty(t),Ay(t)))}),left:on.some(function(n,t){Jy(n,Ky(Ty(t),Vy(t)))})},zw=/* */Object.freeze({setValueFrom:function(n,t,e){var o=px(n,t,e.left()),r=xx(n,t,e.top()),i=Cx(o,r);return kx(n,i),i},setToMin:function(n,t){var e=Cy(t),o=Oy(t);kx(n,Cx(e,o))},setToMax:function(n,t){var e=By(t),o=_y(t);kx(n,Cx(e,o))},getValueFromEvent:function(n){return ky(n)},setPositionFromValue:function(n,t,e,o){var r=Xy(e),i=vx(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=Sx(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),a=oa(t.element())/2,c=ta(t.element())/2;ui(t.element(),"left",i-a+"px"),ui(t.element(),"top",u-c+"px")},onLeft:Rw,onRight:Vw,onUp:Nw,onDown:Hw,edgeActions:Pw}),Lw=Ye.detect().deviceType.isTouch(),jw=[wt("stepSize",1),wt("onChange",Z),wt("onChoose",Z),wt("onInit",Z),wt("onDragStart",Z),wt("onDragEnd",Z),wt("snapToGrid",!1),wt("rounded",!0),pt("snapStart"),ct("model",rt("mode",{x:[wt("minX",0),wt("maxX",100),_t("value",function(n){return Ce(n.mode.minX)}),at("getInitialValue"),Cu("manager",Bw)],y:[wt("minY",0),wt("maxY",100),_t("value",function(n){return Ce(n.mode.minY)}),at("getInitialValue"),Cu("manager",Iw)],xy:[wt("minX",0),wt("maxX",100),wt("minY",0),wt("maxY",100),_t("value",function(n){return Ce({x:nn(n.mode.minX),y:nn(n.mode.minY)})}),at("getInitialValue"),Cu("manager",zw)]})),ss("sliderBehaviours",[Fm,jm])].concat(Lw?[]:[_t("mouseIsDown",function(){return Ce(!1)})]),Uw=Ye.detect().deviceType.isTouch(),Ww=$f({name:"Slider",configFields:jw,partFields:yw,factory:function(i,n,t,e){function u(n){return Os(n,i,"thumb")}function a(n){return Os(n,i,"spectrum")}function o(n){return Cs(n,i,"left-edge")}function r(n){return Cs(n,i,"right-edge")}function c(n){return Cs(n,i,"top-edge")}function s(n){return Cs(n,i,"bottom-edge")}function f(n,t){m.setPositionFromValue(n,t,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})}function l(n,t){d.value.set(t);var e=u(n);return f(n,e),i.onChange(n,e,t),on.some(!0)}var d=i.model,m=d.manager,g=[Zo(no(),function(n,t){i.onDragStart(n,u(n))}),Zo(eo(),function(n,t){i.onDragEnd(n,u(n))})],p=[Zo(oo(),function(n,t){t.stop(),i.onDragStart(n,u(n)),i.mouseIsDown.set(!0)}),Zo(uo(),function(n,t){i.onDragEnd(n,u(n))})],h=Uw?g:p;return{uid:i.uid,dom:i.dom,components:n,behaviours:ls(i.sliderBehaviours,R([Uw?[]:[Fm.config({mode:"special",focusIn:function(n){return Cs(n,i,"spectrum").map(Fm.focusIn).map(nn(!0))}})],[jm.config({store:{mode:"manual",getValue:function(n){return d.value.get()}}}),Ku.config({channels:{"mouse.released":{onReceive:function(e,n){var t=i.mouseIsDown.get();i.mouseIsDown.set(!1),t&&Cs(e,i,"thumb").each(function(n){var t=d.value.get();i.onChoose(e,n,t)})}}}})]])),events:Jo([Zo(ww(),function(n,t){l(n,t.event().value())}),Pi(function(n,t){var e=d.getInitialValue();d.value.set(e);var o=u(n);f(n,o);var r=a(n);i.onInit(n,o,r,d.value.get())})].concat(h)),apis:{resetToMin:function(n){m.setToMin(n,i)},resetToMax:function(n){m.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)}}}),Gw=function(n,t){var e=Ww.parts().spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=Ww.parts().thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return Ww.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:Du([Xm.config({})]),onChange:function(n,t,e){Gt(n,cw(),{value:e})}})},Xw=[ss("formBehaviours",[jm])],Yw=function(o,n,t){return{uid:o.uid,dom:o.dom,components:n,behaviours:ls(o.formBehaviours,[jm.config({store:{mode:"manual",getValue:function(n){var t=Es(n,o);return N(t,function(n,t){return n().bind(function(n){return function(n,t){return n.fold(function(){return an.error(t)},an.value)}(Ol.getCurrent(n),"missing current")}).map(jm.getValue)})},setValue:function(e,n){Sn(n,function(t,n){Cs(e,o,n).each(function(n){Ol.getCurrent(n).each(function(n){jm.setValue(n,t)})})})}}})]),apis:{getField:function(n,t){return Cs(n,o,t).bind(Ol.getCurrent)}}}},qw={getField:Hr(function(n,t,e){return n.getField(t,e)}),sketch:function(n){var e,t=(e=[],{field:function(n,t){return e.push(n),ys("form",Tx(n),t)},record:function(){return e}}),o=n(t),r=t.record(),i=w(r,function(n){return Lf({name:n,pname:Tx(n)})});return Ms("form",Xw,i,Yw,o)}},Kw=Mr("valid-input"),Jw=Mr("invalid-input"),$w=Mr("validating-input"),Qw="colorcustom.rgb.",Zw=function(d,m,g,p){function h(n,t,e,o,r){var i=d(Qw+"range"),u=[_b.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),_b.parts().field({data:r,factory:Gx,inputAttributes:I({type:"text"},"hex"===t?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:Du([function(t,o){return Jx.config({invalidClass:m("invalid"),notify:{onValidate:function(n){Gt(n,$w,{type:t})},onValid:function(n){Gt(n,Kw,{type:t,value:jm.getValue(n)})},onInvalid:function(n){Gt(n,Jw,{type:t,value:jm.getValue(n)})}},validator:{validate:function(n){var t=jm.getValue(n),e=o(t)?an.value(!0):an.error(d("aria.input.invalid"));return Yb(e)},validateOnLoad:!1}})}(t,n),Zx.config({})]),onSetValue:function(n){Jx.isInvalid(n)&&Jx.run(n).get(Z)}})],a="hex"!==t?[_b.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();jm.setValue(n,{red:e,green:o,blue:r})}function b(n,t){y.getOpt(n).each(function(n){ui(n.element(),"background-color","#"+t.value())})}var y=Hd({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});return Jf({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(),on.none()):p(n)}function o(e,n,t){var o=parseInt(t,10);i(n,on.some(o)),r("red").bind(function(e){return r("green").bind(function(t){return r("blue").map(function(n){return ph(e,t,n,1)})})}).each(function(n){var t=function(t,n){var e=gh(n);return qw.getField(t,"hex").each(function(n){Xm.isFocused(n)||jm.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=fh(t);i("hex",on.some(t));var o=bh(e);v(n,o),a(o),Gt(n,aw(),{hex:e}),b(n,e)}(n,e.value())}function n(n){return{label:d(Qw+n+".label"),description:d(Qw+n+".description")}}var u={red:nn(Ce(on.some(255))),green:nn(Ce(on.some(255))),blue:nn(Ce(on.some(255))),hex:nn(Ce(on.some("ffffff")))},a=function(n){var t=n.red(),e=n.green(),o=n.blue();i("red",on.some(t)),i("green",on.some(e)),i("blue",on.some(o))},c=n("red"),s=n("green"),f=n("blue"),l=n("hex");return Bn(qw.sketch(function(n){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[n.field("red",_b.sketch(h(hh,"red",c.label,c.description,255))),n.field("green",_b.sketch(h(hh,"green",s.label,s.description,255))),n.field("blue",_b.sketch(h(hh,"blue",f.label,f.description,255))),n.field("hex",_b.sketch(h(lh,"hex",l.label,l.description,"ffffff"))),y.asSpec()],formBehaviours:Du([Jx.config({invalidClass:m("form-invalid")}),Td("rgb-form-events",[Zo(Kw,e),Zo(Jw,t),Zo($w,t)])])}}),{apis:{updateHex:function(n,t){jm.setValue(n,{hex:t.value()}),function(n,t){var e=bh(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:{}})},nS=function(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=Ww.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),u=Ww.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"'}});return Jf({factory:function(n){var t=nn({x:nn(0),y:nn(0)}),e=Du([Ol.config({find:on.some}),Xm.config({})]);return Ww.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){Gt(n,sw(),{value:e})},onInit:function(n,t,e,o){r(e.element().dom(),xh(Bh()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(n,t,e){!function(n,t){var e=n.components()[0].element().dom();r(e,xh(t))}(t,e)}},extraApis:{}})},tS=function(l,d){return Jf({name:"ColourPicker",configFields:[at("dom"),wt("onValidHex",Z),wt("onInvalidHex",Z)],factory:function(n){function t(n,e){u.getOpt(n).each(function(n){var t=bh(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){bn(n,function(n){n(t,e)})}var o,c,r=Zw(l,d,n.onValidHex,n.onInvalidHex),i=nS(l,d),s={paletteRgba:nn(Ce(Bh()))},u=Hd(i.sketch({})),f=Hd(r.sketch({}));return{uid:n.uid,dom:n.dom,components:[u.asSpec(),Gw(l,d),f.asSpec()],behaviours:Du([Td("colour-picker-events",[Zo(sw(),(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?wy(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,wy(Math.round(e),Math.round(100*t),Math.round(100*o)))}(s.paletteRgba().get()),r=wy(o.hue(),e.x(),100-e.y()),i=vh(r),u=gh(i);a(n,u,c)})),Zo(cw(),(o=[t,e],function(n,t){var e=function(n){var t=wy((100-n)/100*360,100,100),e=vh(t);return gh(e)}(t.event().value().y());a(n,e,o)}))]),Ol.config({find:function(n){return f.getOpt(n)}}),Fm.config({mode:"acyclic"})])}}})},eS=function(){return Ol.config({find:on.some})},oS=function(n){return Ol.config({find:n.getOpt})},rS=function(n){return Ol.config({find:function(t){return pr(t.element(),n).bind(function(n){return t.getSystem().getByDom(n).toOption()})}})},iS={"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"},uS=tinymce.util.Tools.resolve("tinymce.Resource"),aS=se([wt("preprocess",f),wt("postprocess",f)]),cS=function(r,n){var i=et("RepresentingConfigs.memento processors",aS,n);return jm.config({store:{mode:"manual",getValue:function(n){var t=r.get(n),e=jm.getValue(t);return i.postprocess(e)},setValue:function(n,t){var e=i.preprocess(t),o=r.get(n);jm.setValue(o,e)}}})},sS=Bx,fS=function(n){return _x(n,Sr,kr)},lS=function(n){return jm.config({store:{mode:"memory",initialValue:n}})},dS=Mr("alloy-fake-before-tabstop"),mS=Mr("alloy-fake-after-tabstop"),gS=function(n){return Mv(n,["."+dS,"."+mS].join(","),nn(!1))},pS=function(n,t){var e=t.element();ni(e,dS)?Fx(n,!0):ni(e,mS)&&Fx(n,!1)},hS=function(n){return{dom:{tag:"div",classes:["tox-navobj"]},components:[Ax([dS]),n,Ax([mS])],behaviours:Du([rS(1)])}},vS=!(Ye.detect().browser.isIE()||Ye.detect().browser.isEdge());function bS(n,t){return wS(M.document.createElement("canvas"),n,t)}function yS(n){var t=bS(n.width,n.height);return xS(t).drawImage(n,0,0),t}function xS(n){return n.getContext("2d")}function wS(n,t,e){return n.width=t,n.height=e,n}function SS(n){return n.naturalWidth||n.width}function kS(n){return n.naturalHeight||n.height}var CS,OS,TS=window.Promise?window.Promise:(CS=ES.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){M.setTimeout(n,1)},OS=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},ES.prototype["catch"]=function(n){return this.then(null,n)},ES.prototype.then=function(e,o){var r=this;return new ES(function(n,t){_S.call(r,new MS(e,o,n,t))})},ES.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),Gk(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(n)},c=function(n){if(Jk(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){Jk(n),Gk(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(n)},this.destroy=function(){Gk(m).off()},Gk(m).on("mousedown touchstart",t)}function Qk(t){function u(n,s){c.getOpt(n).each(function(n){var e=l.get(),o=oa(n.element()),r=ta(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"};ai(s,t),f.getOpt(n).each(function(n){ai(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=Te.fromTag("img");return Or(i,"src",t),function(e){return new sp(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=su({element:i});Im.replaceAt(n,1,on.some(t));var e=a.get(),o={x:0,y:0,w:i.dom().naturalWidth,h:i.dom().naturalHeight};a.set(o);var r=Xk.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=oa(n.element()),e=ta(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=Hd({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),l=Ce(1),d=Ce(on.none()),m=Ce({x:0,y:0,w:1,h:1}),a=Ce({x:0,y:0,w:1,h:1}),n=ab.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[f.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:Du([Td("image-panel-crop-events",[Pi(function(n){c.getOpt(n).each(function(n){var t=n.element().dom(),e=eC({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(on.some(e))})})])])}],containerBehaviours:Du([Im.config({}),Td("image-panel-events",[Pi(function(n){e(n,t)})])])}),c=Hd(n);return{memContainer:c,updateSrc:e,zoom:function(n,t){var e=l.get(),o=0').appendTo(o),qk.each(i,function(n){Gk("#"+a,o).append(''),components:[],behaviours:Du([rE.config({channel:pF,initialData:n,updateState:function(n,t){var e=w(t.buttons,function(n){var t=Hd(function(n,t){return Ok(n,n.type,t)}(n,o));return{name:n.name,align:n.align,memento:t}});return on.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:uD})])}}function cD(n,t){return zD.parts().footer(aD(n,t))}function sD(t,e){if(t.getRoot().getSystem().isConnected()){var o=Ol.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return qw.getField(o,e).fold(function(){var n=t.getFooter();return rE.getState(n).get().bind(function(n){return n.lookupByName(o,e)})},function(n){return on.some(n)})}return on.none()}function fD(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=jm.getValue(t),o=N(a,function(n){return n.get()});return I(I({},e),o)},setData:function(i){n(function(n){var t=c.getData(),e=_n(t,i),o=function(n,t){var e=n.getRoot();return rE.getState(e).get().map(function(n){return tt(nt("data",n.dataValidator,t))}).getOr(t)}(u,e),r=u.getFormWrapper();jm.setValue(r,o),Sn(a,function(n,t){On(e,t)&&n.set(e[t])})})},disable:function(n){sD(u,n).each(qp.disable)},enable:function(n){sD(u,n).each(qp.enable)},focus:function(n){sD(u,n).each(Xm.focus)},block:function(t){if(!cn(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){Gt(n,kb,{message:t})})},unblock:function(){n(function(n){Wt(n,Cb)})},showTab:function(e){n(function(n){var t=u.getBody();rE.getState(t).get().exists(function(n){return n.isTabPanel()})&&Ol.getCurrent(t).each(function(n){sF.showTab(n,e)})})},redial:function(e){n(function(n){var t=o(e);n.getSystem().broadcastOn([dF],t),n.getSystem().broadcastOn([mF],t.internalDialog),n.getSystem().broadcastOn([gF],t.internalDialog),n.getSystem().broadcastOn([pF],t.internalDialog),c.setData(t.initialData)})},close:function(){n(function(n){Wt(n,yb)})}};return c}function lD(n){return vg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close"),title:n.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:''}}],action:function(n){Wt(n,xb)}})}function dD(n,t,e){function o(n){return[wi(e.translate(n.title))]}return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:I({},t.map(function(n){return{id:n}}).getOr({}))},components:o(n),behaviours:Du([rE.config({channel:mF,renderComponents:o})])}}function mD(){return{dom:Ig('
')}}function gD(n,t){return function(n,t){var e=zD.parts().title(dD(n,on.none(),t)),o=zD.parts().draghandle(mD()),r=zD.parts().close(lD(t)),i=[e].concat(n.draggable?[o]:[]).concat([r]);return ab.sketch({dom:Ig('
'),components:i})}({title:t.shared.providers.translate(n),draggable:t.dialog.isDraggableModal()},t.shared.providers)}function pD(n,t){return{onClose:function(){return t.closeWindow()},onBlock:function(e){zD.setBusy(n(),function(n,t){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:t,components:[{dom:Ig('
')}]}})},onUnblock:function(){zD.setIdle(n())}}}function hD(n,t,e,o){var r;return lu(zD.sketch({lazySink:o.shared.getSink,onEscape:function(n){return Wt(n,xb),on.some(!0)},useTabstopAt:function(n){return!gS(n)},modalBehaviours:Du(d([rE.config({channel:dF,updateState:function(n,t){return on.some(t)},initialData:t}),lS({}),Xm.config({}),Td("execute-on-form",e.concat([ir(co(),function(n,t){Fm.focusIn(n)})])),Td("scroll-lock",[Pi(function(){$r(Vi(),"tox-dialog__disable-scroll")}),zi(function(){Zr(Vi(),"tox-dialog__disable-scroll")})])],n.extraBehaviours)),eventOrder:(r={},r[ko()]=["execute-on-form"],r[So()]=["reflecting","receiving"],r[Mo()]=["scroll-lock","reflecting","messages","execute-on-form","alloy.base.behaviour"],r[Io()]=["alloy.base.behaviour","execute-on-form","messages","reflecting","scroll-lock"],r),dom:{tag:"div",classes:["tox-dialog"].concat(n.extraClasses),styles:I({position:"relative"},n.extraStyles)},components:d([n.header,n.body],n.footer.toArray()),dragBlockClass:"tox-dialog-wrap",parts:{blocker:{dom:Ig('
'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}}}))}function vD(n){return w(n,function(n){return"menu"===n.type?function(n){var t=w(n.items,function(n){var t=Ce(!1);return I(I({},n),{storage:t})});return I(I({},n),{items:t})}(n):n})}function bD(n){return C(n,function(n,t){return"menu"!==t.type?n:C(t.items,function(n,t){return n[t.name]=t.storage,n},n)},{})}function yD(n,t,e){var o=gD(n.internalDialog.title,e),r=function(n,t){var e=rD(n,on.none(),t,!1);return zD.parts().body(e)}({body:n.internalDialog.body},e),i=vD(n.internalDialog.buttons),u=bD(i),a=cD({buttons:i},e),c=bF(function(){return d},pD(function(){return l},t)),s="normal"!==n.internalDialog.size?"large"===n.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],f={header:o,body:r,footer:on.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},l=hD(f,n,c,e),d=fD({getRoot:function(){return l},getBody:function(){return zD.getBody(l)},getFooter:function(){return zD.getFooter(l)},getFormWrapper:function(){var n=zD.getBody(l);return Ol.getCurrent(n).getOr(n)}},t.redial,u);return{dialog:l,instanceApi:d}}function xD(n){return sn(n)&&-1!==xF.indexOf(n.mceAction)}function wD(e,n,o,t){var r,i=gD(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:[hS({dom:{tag:"iframe",attributes:{src:n.url}},behaviours:Du([Zx.config({}),Xm.config({})])})]}],behaviours:Du([Fm.config({mode:"acyclic",useTabstopAt:v(gS)})])};return zD.parts().body(t)}(e),a=e.buttons.bind(function(n){return 0===n.length?on.none():on.some(cD({buttons:n},t))}),c=vF(function(){return h},pD(function(){return p},n)),s=I(I({},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 yF(e.url,{base_uri:new yF(M.window.location.href)}),d=l.protocol+"://"+l.host+(l.port?":"+l.port:""),m=Ce(on.none()),g=[Td("messages",[Pi(function(){var n=Av(Te.fromDom(M.window),"message",function(n){if(l.isSameOrigin(new yF(n.raw().origin))){var t=n.raw().data;xD(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=!!ln(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!xD(n)&&sn(n)&&On(n,"mceAction")}(t)&&e.onMessage(h,t)}});m.set(on.some(n))}),zi(function(){m.get().each(function(n){return n.unbind()})})]),Ku.config({channels:(r={},r[hF]={onReceive:function(n,t){ki(n.element(),"iframe").each(function(n){n.dom().contentWindow.postMessage(t,d)})}},r)})],p=hD({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(!cn(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){Gt(n,kb,{message:t})})},unblock:function(){n(function(n){Wt(n,Cb)})},close:function(){n(function(n){Wt(n,yb)})},sendMessage:function(t){n(function(n){n.getSystem().broadcastOn([hF],t)})}}}(p);return{dialog:p,instanceApi:h}}function SD(n,t,e,o){var r,i,u=Mr("dialog-label"),a=Mr("dialog-content"),c=Hd(function(n,t,e){return ab.sketch({dom:Ig('
'),components:[dD(n,on.some(t),e),mD(),lD(e)],containerBehaviours:Du([W_.config({mode:"mouse",blockerClass:"blocker",getTarget:function(n){return Ci(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=Hd(function(n,t,e,o){return rD(n,on.some(t),e,o)}({body:n.internalDialog.body},a,e,o)),f=vD(n.internalDialog.buttons),l=bD(f),d=Hd(function(n,t){return aD(n,t)}({buttons:f},e)),m=bF(function(){return p},{onBlock:function(){},onUnblock:function(){},onClose:function(){return t.closeWindow()}}),g=lu({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[So()]=[rE.name(),Ku.name()],i[ko()]=["execute-on-form"],i[Mo()]=["reflecting","execute-on-form"],i),behaviours:Du([Fm.config({mode:"cyclic",onEscape:function(n){return Wt(n,yb),on.some(!0)},useTabstopAt:function(n){return!gS(n)&&("button"!==Wo(n)||"disabled"!==Er(n,"disabled"))}}),rE.config({channel:dF,updateState:function(n,t){return on.some(t)},initialData:n}),Xm.config({}),Td("execute-on-form",m.concat([ir(co(),function(n,t){Fm.focusIn(n)})])),lS({})]),components:[c.asSpec(),s.asSpec(),d.asSpec()]}),p=fD({getRoot:function(){return g},getFooter:function(){return d.get(g)},getBody:function(){return s.get(g)},getFormWrapper:function(){var n=s.get(g);return Ol.getCurrent(n).getOr(n)}},t.redial,l);return{dialog:g,instanceApi:p}}function kD(n,t){return zD.parts().close(vg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:n,buttonBehaviours:Du([Zx.config({})])}))}function CD(){return zD.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})}function OD(n,t){return zD.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:Ig("

"+t.translate(n)+"

")}]}]})}function TD(n){return zD.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:n})}function ED(n,t){return[ab.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:n}),ab.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})]}function BD(e){return zD.sketch({lazySink:e.lazySink,onEscape:function(){return e.onCancel(),on.some(!0)},dom:{tag:"div",classes:["tox-dialog"].concat(e.extraClasses)},components:[Bn(e.headerOverride.getOr(SF),{components:[e.partSpecs.title,e.partSpecs.close]}),e.partSpecs.body,e.partSpecs.footer],parts:{blocker:{dom:Ig('
'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}},modalBehaviours:Du([Td("basic-dialog-events",[Zo(xb,function(n,t){e.onCancel()}),Zo(Sb,function(n,t){e.onSubmit()})])])})}var _D,DD,AD,FD,MD,ID=function(i,r){r.delimiter||(r.delimiter="\xbb");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Du([Fm.config({mode:"flow",selector:"div[role=button]"}),Zx.config({}),Im.config({}),Td("elementPathEvents",[Pi(function(e,n){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return Fm.focusIn(e)}),i.on("NodeChange",function(n){var t=function(n){for(var t=[],e=n.length;0