agenda-libre-ruby/public/assets/tinymce/themes/silver/theme-02294426af3edeff56daa3e5fd3ef013944295525b150b8114eaca9de6201af7.js
2019-05-11 17:19:15 +02:00

11 lines
349 KiB
JavaScript

/**
* 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.5 (2019-05-09)
*/
!function(x){"use strict";var tt=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},t=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e()}},p=function(e,o){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(o.apply(null,t))}},nt=function(t){return function(){return t}},d=function(t){return t};function w(o){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=r.concat(t);return o.apply(null,e)}}var n,e,o,r,i,S=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return!e.apply(null,t)}},u=function(t){return function(){throw new Error(t)}},a=nt(!1),c=nt(!0),s=a,f=c,l=function(){return m},m=(r={fold:function(t,n){return t()},is:s,isSome:s,isNone:f,getOr:o=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:o,orThunk:e,map:l,ap:l,each:function(){},bind:l,flatten:l,exists:s,forall:f,filter:l,equals:n=function(t){return t.isNone()},equals_:n,toArray:function(){return[]},toString:nt("none()")},Object.freeze&&Object.freeze(r),r),g=function(e){var t=function(){return e},n=function(){return r},o=function(t){return t(e)},r={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:f,isNone:s,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return g(t(e))},ap:function(t){return t.fold(l,function(t){return g(t(e))})},each:function(t){t(e)},bind:o,flatten:t,exists:o,forall:o,filter:function(t){return t(e)?r:m},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(s,function(t){return n(e,t)})},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return r},et={some:g,none:l,from:function(t){return null===t||t===undefined?m:g(t)}},h=function(n){return function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"===n&&Array.prototype.isPrototypeOf(t)?"array":"object"===n&&String.prototype.isPrototypeOf(t)?"string":n}(t)===n}},k=h("string"),C=h("object"),A=h("array"),O=(h("null"),h("boolean")),E=(h("undefined"),h("function")),D=h("number"),v=(i=Array.prototype.indexOf)===undefined?function(t,n){return P(t,n)}:function(t,n){return i.call(t,n)},b=function(t,n){var e=v(t,n);return-1===e?et.none():et.some(e)},T=function(t,n){return-1<v(t,n)},y=function(t,n){return N(t,n).isSome()},B=function(t,n){for(var e=[],o=0;o<t.length;o+=n){var r=t.slice(o,o+n);e.push(r)}return e},_=function(t,n){for(var e=t.length,o=new Array(e),r=0;r<e;r++){var i=t[r];o[r]=n(i,r,t)}return o},M=function(t,n){for(var e=0,o=t.length;e<o;e++)n(t[e],e,t)},F=function(t,n){for(var e=t.length-1;0<=e;e--)n(t[e],e,t)},I=function(t,n){for(var e=[],o=[],r=0,i=t.length;r<i;r++){var u=t[r];(n(u,r,t)?e:o).push(u)}return{pass:e,fail:o}},V=function(t,n){for(var e=[],o=0,r=t.length;o<r;o++){var i=t[o];n(i,o,t)&&e.push(i)}return e},R=function(t,n,e){return F(t,function(t){e=n(e,t)}),e},U=function(t,n,e){return M(t,function(t){e=n(e,t)}),e},H=function(t,n){for(var e=0,o=t.length;e<o;e++){var r=t[e];if(n(r,e,t))return et.some(r)}return et.none()},N=function(t,n){for(var e=0,o=t.length;e<o;e++)if(n(t[e],e,t))return et.some(e);return et.none()},P=function(t,n){for(var e=0,o=t.length;e<o;++e)if(t[e]===n)return e;return-1},z=Array.prototype.push,L=function(t){for(var n=[],e=0,o=t.length;e<o;++e){if(!Array.prototype.isPrototypeOf(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);z.apply(n,t[e])}return n},j=function(t,n){var e=_(t,n);return L(e)},W=function(t,n){for(var e=0,o=t.length;e<o;++e)if(!0!==n(t[e],e,t))return!1;return!0},G=Array.prototype.slice,X=function(t){var n=G.call(t,0);return n.reverse(),n},Y=function(t,n){return V(t,function(t){return!T(n,t)})},q=function(t){return[t]},K=function(t,n){var e=G.call(t,0);return e.sort(n),e},J=function(t){return 0===t.length?et.none():et.some(t[0])},$=function(t){return 0===t.length?et.none():et.some(t[t.length-1])},Q=E(Array.from)?Array.from:function(t){return G.call(t)},Z=Object.keys,ot=Object.hasOwnProperty,rt=function(t,n){for(var e=Z(t),o=0,r=e.length;o<r;o++){var i=e[o];n(t[i],i,t)}},it=function(t,o){return ut(t,function(t,n,e){return{k:n,v:o(t,n,e)}})},ut=function(o,r){var i={};return rt(o,function(t,n){var e=r(t,n,o);i[e.k]=e.v}),i},at=function(t,e){var o=[];return rt(t,function(t,n){o.push(e(t,n))}),o},ct=function(t,n){for(var e=Z(t),o=0,r=e.length;o<r;o++){var i=e[o],u=t[i];if(n(u,i,t))return et.some(u)}return et.none()},st=function(t){return at(t,function(t){return t})},ft=function(t,n){return lt(t,n)?et.from(t[n]):et.none()},lt=function(t,n){return ot.call(t,n)},dt=function(n){return function(t){return lt(t,n)?et.from(t[n]):et.none()}},mt=function(t,n){return dt(n)(t)},gt=function(t,n){var e={};return e[t]=n,e},pt=function(e){return{is:function(t){return e===t},isValue:c,isError:a,getOr:nt(e),getOrThunk:nt(e),getOrDie:nt(e),or:function(t){return pt(e)},orThunk:function(t){return pt(e)},fold:function(t,n){return n(e)},map:function(t){return pt(t(e))},mapError:function(t){return pt(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOption:function(){return et.some(e)}}},ht=function(e){return{is:a,isValue:a,isError:c,getOr:d,getOrThunk:function(t){return t()},getOrDie:function(){return u(String(e))()},or:function(t){return t},orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return ht(e)},mapError:function(t){return ht(t(e))},each:tt,bind:function(t){return ht(e)},exists:a,forall:c,toOption:et.none}},vt={value:pt,error:ht,fromOption:function(t,n){return t.fold(function(){return ht(n)},pt)}},bt=function(u){if(!A(u))throw new Error("cases must be an array");if(0===u.length)throw new Error("there must be at least one case");var a=[],e={};return M(u,function(t,o){var n=Z(t);if(1!==n.length)throw new Error("one and only one name per case");var r=n[0],i=t[r];if(e[r]!==undefined)throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!A(i))throw new Error("case arguments must be an array");a.push(r),e[r]=function(){var t=arguments.length;if(t!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+t);for(var e=new Array(t),n=0;n<e.length;n++)e[n]=arguments[n];return{fold:function(){if(arguments.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+arguments.length);return arguments[o].apply(null,e)},match:function(t){var n=Z(t);if(a.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+n.join(","));if(!W(a,function(t){return T(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+a.join(", "));return t[r].apply(null,e)},log:function(t){x.console.log(t,{constructors:a,constructor:r,params:e})}}}}),e},yt=(bt([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),Object.prototype.hasOwnProperty),xt=function(u){return function(){for(var t=new Array(arguments.length),n=0;n<t.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var e={},o=0;o<t.length;o++){var r=t[o];for(var i in r)yt.call(r,i)&&(e[i]=u(e[i],r[i]))}return e}},wt=xt(function(t,n){return C(t)&&C(n)?wt(t,n):n}),St=xt(function(t,n){return n}),kt=function(t,n){return e=n,o={},rt(t,function(t,n){T(e,n)||(o[n]=t)}),o;var e,o},Ct=function(t){return dt(t)},Ot=function(t,n){return e=t,o=n,function(t){return lt(t,e)?t[e]:o};var e,o},Et=function(t,n){return mt(t,n)},Tt=function(t,n){return gt(t,n)},Bt=function(t){return n={},M(t,function(t){n[t.key]=t.value}),n;var n},At=function(t,n){var e,o,r,i,u,a=(e=[],o=[],M(t,function(t){t.fold(function(t){e.push(t)},function(t){o.push(t)})}),{errors:e,values:o});return 0<a.errors.length?(u=a.errors,p(vt.error,L)(u)):(i=n,0===(r=a.values).length?vt.value(i):vt.value(wt(i,St.apply(undefined,r))))},Dt=function(t,n){return lt(e=t,o=n)&&e[o]!==undefined&&null!==e[o];var e,o},_t=function(t){var n=t,e=function(){return n};return{get:e,set:function(t){n=t},clone:function(){return _t(e())}}},Mt=function(t){for(var n=[],e=function(t){n.push(t)},o=0;o<t.length;o++)t[o].each(e);return n},Ft=function(t,n){for(var e=0;e<t.length;e++){var o=n(t[e],e);if(o.isSome())return o}return et.none()},It=function(t,n){for(var e=[],o=0;o<t.length;o++){var r=t[o];if(!r.isSome())return et.none();e.push(r.getOrDie())}return et.some(n.apply(null,e))};(function RD(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=t.pop();return It(t,e)});var Vt,Rt,Ht=nt("touchstart"),Nt=nt("touchmove"),Pt=nt("touchend"),zt=nt("mousedown"),Lt=nt("mousemove"),jt=nt("mouseout"),Ut=nt("mouseup"),Wt=nt("mouseover"),Gt=nt("focusin"),Xt=nt("focusout"),Yt=nt("keydown"),qt=nt("keyup"),Kt=nt("input"),Jt=nt("change"),$t=nt("click"),Qt=nt("transitionend"),Zt=nt("selectstart"),tn=function(e){var o,r=!1;return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r||(r=!0,o=e.apply(null,t)),o}},nn=function(t,n){var e=function(t,n){for(var e=0;e<t.length;e++){var o=t[e];if(o.test(n))return o}return undefined}(t,n);if(!e)return{major:0,minor:0};var o=function(t){return Number(n.replace(e,"$"+t))};return on(o(1),o(2))},en=function(){return on(0,0)},on=function(t,n){return{major:t,minor:n}},rn={nu:on,detect:function(t,n){var e=String(n).toLowerCase();return 0===t.length?en():nn(t,e)},unknown:en},un="Firefox",an=function(t,n){return function(){return n===t}},cn=function(t){var n=t.current;return{current:n,version:t.version,isEdge:an("Edge",n),isChrome:an("Chrome",n),isIE:an("IE",n),isOpera:an("Opera",n),isFirefox:an(un,n),isSafari:an("Safari",n)}},sn={unknown:function(){return cn({current:undefined,version:rn.unknown()})},nu:cn,edge:nt("Edge"),chrome:nt("Chrome"),ie:nt("IE"),opera:nt("Opera"),firefox:nt(un),safari:nt("Safari")},fn="Windows",ln="Android",dn="Solaris",mn="FreeBSD",gn=function(t,n){return function(){return n===t}},pn=function(t){var n=t.current;return{current:n,version:t.version,isWindows:gn(fn,n),isiOS:gn("iOS",n),isAndroid:gn(ln,n),isOSX:gn("OSX",n),isLinux:gn("Linux",n),isSolaris:gn(dn,n),isFreeBSD:gn(mn,n)}},hn={unknown:function(){return pn({current:undefined,version:rn.unknown()})},nu:pn,windows:nt(fn),ios:nt("iOS"),android:nt(ln),linux:nt("Linux"),osx:nt("OSX"),solaris:nt(dn),freebsd:nt(mn)},vn=function(t,n){var e=String(n).toLowerCase();return H(t,function(t){return t.search(e)})},bn=function(t,e){return vn(t,e).map(function(t){var n=rn.detect(t.versionRegexes,e);return{current:t.name,version:n}})},yn=function(t,e){return vn(t,e).map(function(t){var n=rn.detect(t.versionRegexes,e);return{current:t.name,version:n}})},xn=function(t,n){return-1!==t.indexOf(n)},wn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Sn=function(n){return function(t){return xn(t,n)}},kn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return xn(t,"edge/")&&xn(t,"chrome")&&xn(t,"safari")&&xn(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,wn],search:function(t){return xn(t,"chrome")&&!xn(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return xn(t,"msie")||xn(t,"trident")}},{name:"Opera",versionRegexes:[wn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Sn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Sn("firefox")},{name:"Safari",versionRegexes:[wn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(xn(t,"safari")||xn(t,"mobile/"))&&xn(t,"applewebkit")}}],Cn=[{name:"Windows",search:Sn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return xn(t,"iphone")||xn(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Sn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Sn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Sn("linux"),versionRegexes:[]},{name:"Solaris",search:Sn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Sn("freebsd"),versionRegexes:[]}],On={browsers:nt(kn),oses:nt(Cn)},En=function(t){var n,e,o,r,i,u,a,c,s,f,l,d=On.browsers(),m=On.oses(),g=bn(d,t).fold(sn.unknown,sn.nu),p=yn(m,t).fold(hn.unknown,hn.nu);return{browser:g,os:p,deviceType:(e=g,o=t,r=(n=p).isiOS()&&!0===/ipad/i.test(o),i=n.isiOS()&&!r,u=n.isAndroid()&&3===n.version.major,a=n.isAndroid()&&4===n.version.major,c=r||u||a&&!0===/mobile/i.test(o),s=n.isiOS()||n.isAndroid(),f=s&&!c,l=e.isSafari()&&n.isiOS()&&!1===/safari/i.test(o),{isiPad:nt(r),isiPhone:nt(i),isTablet:nt(c),isPhone:nt(f),isTouch:nt(s),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:nt(l)})}},Tn={detect:tn(function(){var t=x.navigator.userAgent;return En(t)})},Bn={tap:nt("alloy.tap")},An=nt("alloy.focus"),Dn=nt("alloy.blur.post"),_n=nt("alloy.paste.post"),Mn=nt("alloy.receive"),Fn=nt("alloy.execute"),In=nt("alloy.focus.item"),Vn=Bn.tap,Rn=Tn.detect().deviceType.isTouch()?Bn.tap:$t,Hn=nt("alloy.longpress"),Nn=nt("alloy.sandbox.close"),Pn=nt("alloy.typeahead.cancel"),zn=nt("alloy.system.init"),Ln=nt("alloy.system.scroll"),jn=nt("alloy.system.resize"),Un=nt("alloy.system.attached"),Wn=nt("alloy.system.detached"),Gn=nt("alloy.system.dismissRequested"),Xn=nt("alloy.focusmanager.shifted"),Yn=nt("alloy.slotcontainer.visibility"),qn=nt("alloy.change.tab"),Kn=nt("alloy.dismiss.tab"),Jn=nt("alloy.highlight"),$n=nt("alloy.dehighlight"),Qn=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:nt(t)}},Zn={fromHtml:function(t,n){var e=(n||x.document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1<e.childNodes.length)throw x.console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Qn(e.childNodes[0])},fromTag:function(t,n){var e=(n||x.document).createElement(t);return Qn(e)},fromText:function(t,n){var e=(n||x.document).createTextNode(t);return Qn(e)},fromDom:Qn,fromPoint:function(t,n,e){var o=t.dom();return et.from(o.elementFromPoint(n,e)).map(Qn)}},te=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(n.length!==e.length)throw new Error('Wrong number of arguments to struct. Expected "['+n.length+']", got '+e.length+" arguments");var o={};return M(n,function(t,n){o[t]=nt(e[n])}),o}},ne=function(t){return t.slice(0).sort()},ee=function(n,t){if(!A(t))throw new Error("The "+n+" fields must be an array. Was: "+t+".");M(t,function(t){if(!k(t))throw new Error("The value "+t+" in the "+n+" fields was not a string.")})},oe=function(r,i){var e,u=r.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return ee("required",r),ee("optional",i),e=ne(u),H(e,function(t,n){return n<e.length-1&&t===e[n+1]}).each(function(t){throw new Error("The field: "+t+" occurs more than once in the combined fields: ["+e.join(", ")+"].")}),function(n){var e=Z(n);W(r,function(t){return T(e,t)})||function(t,n){throw new Error("All required keys ("+ne(t).join(", ")+") were not specified. Specified keys were: "+ne(n).join(", ")+".")}(r,e);var t=V(e,function(t){return!T(u,t)});0<t.length&&function(t){throw new Error("Unsupported keys for object: "+ne(t).join(", "))}(t);var o={};return M(r,function(t){o[t]=nt(n[t])}),M(i,function(t){o[t]=nt(Object.prototype.hasOwnProperty.call(n,t)?et.some(n[t]):et.none())}),o}},re="undefined"!=typeof x.window?x.window:Function("return this;")(),ie=function(t,n){return function(t,n){for(var e=n!==undefined&&null!==n?n:re,o=0;o<t.length&&e!==undefined&&null!==e;++o)e=e[t[o]];return e}(t.split("."),n)},ue={getOrDie:function(t,n){var e=ie(t,n);if(e===undefined||null===e)throw t+" not available on this browser";return e}},ae=(x.Node.ATTRIBUTE_NODE,x.Node.CDATA_SECTION_NODE,x.Node.COMMENT_NODE,x.Node.DOCUMENT_NODE),ce=(x.Node.DOCUMENT_TYPE_NODE,x.Node.DOCUMENT_FRAGMENT_NODE,x.Node.ELEMENT_NODE),se=x.Node.TEXT_NODE,fe=(x.Node.PROCESSING_INSTRUCTION_NODE,x.Node.ENTITY_REFERENCE_NODE,x.Node.ENTITY_NODE,x.Node.NOTATION_NODE,ce),le=ae,de=function(t,n){var e=t.dom();if(e.nodeType!==fe)return!1;if(e.matches!==undefined)return e.matches(n);if(e.msMatchesSelector!==undefined)return e.msMatchesSelector(n);if(e.webkitMatchesSelector!==undefined)return e.webkitMatchesSelector(n);if(e.mozMatchesSelector!==undefined)return e.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")},me=function(t){return t.nodeType!==fe&&t.nodeType!==le||0===t.childElementCount},ge=function(t,n){var e=n===undefined?x.document:n.dom();return me(e)?[]:_(e.querySelectorAll(t),Zn.fromDom)},pe=function(t,n){var e=n===undefined?x.document:n.dom();return me(e)?et.none():et.from(e.querySelector(t)).map(Zn.fromDom)},he=function(t,n){return t.dom()===n.dom()},ve=(Tn.detect().browser.isIE(),function(t){return Zn.fromDom(t.dom().ownerDocument)}),be=function(t){var n=t.dom().ownerDocument.defaultView;return Zn.fromDom(n)},ye=function(t){var n=t.dom();return et.from(n.parentNode).map(Zn.fromDom)},xe=function(t){var n=t.dom();return et.from(n.offsetParent).map(Zn.fromDom)},we=function(t){var n=t.dom();return _(n.childNodes,Zn.fromDom)},ke=function(t,n){var e=t.dom().childNodes;return et.from(e[n]).map(Zn.fromDom)},Ce=(te("element","offset"),function(n,e){ye(n).each(function(t){t.dom().insertBefore(e.dom(),n.dom())})}),Oe=function(t,n){var e;(e=t.dom(),et.from(e.nextSibling).map(Zn.fromDom)).fold(function(){ye(t).each(function(t){Te(t,n)})},function(t){Ce(t,n)})},Ee=function(n,e){ke(n,0).fold(function(){Te(n,e)},function(t){n.dom().insertBefore(e.dom(),t.dom())})},Te=function(t,n){t.dom().appendChild(n.dom())},Be=function(n,t){M(t,function(t){Te(n,t)})},Ae=function(t){t.dom().textContent="",M(we(t),function(t){De(t)})},De=function(t){var n=t.dom();null!==n.parentNode&&n.parentNode.removeChild(n)},_e=function(t){return t.dom().innerHTML},Me=function(t,n){var e,o,r=ve(t).dom(),i=Zn.fromDom(r.createDocumentFragment()),u=(e=n,(o=(r||x.document).createElement("div")).innerHTML=e,we(Zn.fromDom(o)));Be(i,u),Ae(t),Te(t,i)},Fe=function(t){return t.dom().nodeName.toLowerCase()},Ie=function(t){return t.dom().nodeType},Ve=function(n){return function(t){return Ie(t)===n}},Re=Ve(ce),He=Ve(se),Ne=Ve(ae),Pe=function(t,n,e){if(!(k(e)||O(e)||D(e)))throw x.console.error("Invalid call to Attr.set. Key ",n,":: Value ",e,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,e+"")},ze=function(t,n,e){Pe(t.dom(),n,e)},Le=function(t,n){var e=t.dom().getAttribute(n);return null===e?undefined:e},je=function(t,n){var e=t.dom();return!(!e||!e.hasAttribute)&&e.hasAttribute(n)},Ue=function(t,n){t.dom().removeAttribute(n)},We=function(t){return n=t,e=!1,Zn.fromDom(n.dom().cloneNode(e));var n,e},Ge=function(t){var n,e,o,r=We(t);return n=r,e=Zn.fromTag("div"),o=Zn.fromDom(n.dom().cloneNode(!0)),Te(e,o),_e(e)},Xe=function(t){return Ge(t)},Ye="unknown",qe="__CHROME_INSPECTOR_CONNECTION_TO_ALLOY__";(Rt=Vt||(Vt={}))[Rt.STOP=0]="STOP",Rt[Rt.NORMAL=1]="NORMAL",Rt[Rt.LOGGING=2]="LOGGING";var Ke=_t({}),Je=function(n,t,e){var o,r,i,u;switch(Et(Ke.get(),n).orThunk(function(){var t=Z(Ke.get());return Ft(t,function(t){return-1<n.indexOf(t)?et.some(Ke.get()[t]):et.none()})}).getOr(Vt.NORMAL)){case Vt.NORMAL:return e(no());case Vt.LOGGING:var a=(o=n,r=t,i=[],u=(new Date).getTime(),{logEventCut:function(t,n,e){i.push({outcome:"cut",target:n,purpose:e})},logEventStopped:function(t,n,e){i.push({outcome:"stopped",target:n,purpose:e})},logNoParent:function(t,n,e){i.push({outcome:"no-parent",target:n,purpose:e})},logEventNoHandlers:function(t,n){i.push({outcome:"no-handlers-left",target:n})},logEventResponse:function(t,n,e){i.push({outcome:"response",purpose:e,target:n})},write:function(){var t=(new Date).getTime();T(["mousemove","mouseover","mouseout",zn()],o)||x.console.log(o,{event:o,time:t-u,target:r.dom(),sequence:_(i,function(t){return T(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Xe(t.target)+")":t.outcome})})}}),c=e(a);return a.write(),c;case Vt.STOP:return!0}},$e=["alloy/data/Fields","alloy/debugging/Debugging"],Qe=function(t,n,e){return Je(t,n,e)},Ze=function(){if(x.window[qe]!==undefined)return x.window[qe];var n=function(t,n){var e=Ke.get();e[t]=n,Ke.set(e)};return x.window[qe]={systems:{},lookup:function(n){var e=x.window[qe].systems,t=Z(e);return Ft(t,function(t){return e[t].getByUid(n).toOption().map(function(t){return Tt(Xe(t.element()),(n=function(e){var t=e.spec();return{"(original.spec)":t,"(dom.ref)":e.element().dom(),"(element)":Xe(e.element()),"(initComponents)":_(t.components!==undefined?t.components:[],n),"(components)":_(e.components(),n),"(bound.events)":at(e.events(),function(t,n){return[n]}).join(", "),"(behaviours)":t.behaviours!==undefined?it(t.behaviours,function(t,n){return t===undefined?"--revoked--":{config:t.configAsRaw(),"original-config":t.initialConfig,state:e.readState(n)}}):"none"}})(t));var n})}).orThunk(function(){return et.some({error:"Systems ("+t.join(", ")+") did not contain uid: "+n})})},events:{setToNormal:function(t){n(t,Vt.NORMAL)},setToLogging:function(t){n(t,Vt.LOGGING)},setToStop:function(t){n(t,Vt.STOP)}}},x.window[qe]},to=function(t,n){Ze().systems[t]=n},no=nt({logEventCut:tt,logEventStopped:tt,logNoParent:tt,logEventNoHandlers:tt,logEventResponse:tt,write:tt}),eo=0,oo=function(t){var n=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++eo+String(n)},ro=tinymce.util.Tools.resolve("tinymce.ThemeManager"),io=function(){return(io=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};function uo(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&(e[o[r]]=t[o[r]])}return e}(function HD(t,n){function e(){this.constructor=t}Se(t,n),t.prototype=null===n?Object.create(n):(n.prototype,new e)}),function ND(t,n,e,o){var r,i=arguments.length,u=i<3?n:null===o?Object.getOwnPropertyDescriptor(n,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)Reflect.decorate(t,n,e,o);else for(var a=t.length-1;0<=a;a--)t[a]&&(i<3?r(u):3<i?r(n,e,u):r(n,e));return 3<i&&u&&Object.defineProperty(n,e,u),u},function PD(e,o){return function(t,n){o(t,n,e)}},function zD(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)},function LD(n,u,a,c){return new(a||Promise)(function(t,e){function o(t){try{i(c.next(t))}catch(n){e(n)}}function r(t){try{i(c["throw"](t))}catch(n){e(n)}}function i(n){n.done?t(n.value):new a(function(t){t(n.value)}).then(o,r)}i(c.apply(n,u||[]).next())})},function jD(o,r){var i,u,a,t,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return n(0),n(1),n(2),"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function n(n){return function(t){return function e(t){if(i)throw new TypeError("Generator is already executing.");for(;c;)try{if(u&&(2&t[0]?u["return"]:t[0]?u["throw"]||(u["return"]&&a.call(u),0):u.next)&&!a.call(u,t[1]).done)return a;switch(a&&(t[0],a.value),t[0]){case 0:case 1:break;case 4:return c.label++,{value:t[1],done:!1};case 5:c.label++,t[1];continue;case 7:c.ops.pop(),c.trys.pop();continue;default:if(!(0<c.trys.length&&a[a.length-1]||6!==t[0]&&2!==t[0]))continue;if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){c.label=t[1];break}if(6===t[0]&&c.label<a[1]){c.label=a[1];break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(t);break}a[2]&&c.ops.pop(),c.trys.pop();continue}r.call(o,c)}catch(n){}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([n,t])}}},function UD(t,n){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])},function WD(){for(var t=[],n=0;n<arguments.length;n++)t.concat(bf(arguments[n]));return t},function GD(t,n,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=e.apply(t,n||[]),u=[];return o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(o){i[o]&&(r[o]=function(e){return new Promise(function(t,n){1<u.push([o,e,t,n])||a(o,e)})})}function a(t,n){try{!function e(t){t.value instanceof df?Promise.resolve(t.value.v).then(c,s):f(u[0][2],t)}(i[t](n))}catch(o){f(u[0][3],o)}}function c(t){a("next",t)}function s(t){a("throw",t)}function f(t,n){t(n),u.shift(),u.length&&a(u[0][0],u[0][1])}},function XD(o){var t,r;return n("next"),n("throw",function(t){throw t}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,e){t[n]=o[n]?function(t){return r?e?e(t):t:{value:df(o[n](t)),done:"return"===n}}:e}},function YD(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=i[Symbol.asyncIterator];return n?n.call(i):(af(),e("next"),e("throw"),e("return"),t[Symbol.asyncIterator]=function(){return this},t);function e(o){t[o]=i[o]&&function(e){return new Promise(function(t,n){!function r(n,t,e,o){Promise.resolve(o).then(function(t){n({value:t,done:e})},t)}(t,n,i[o](e).done,e.value)})}}},function qD(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t},function KD(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n["default"]=t,n},function JD(t){return t&&t.__esModule?t:{"default":t}};var ao,co,so=bt([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),fo=function(t){return so.defaultedThunk(nt(t))},lo=so.strict,mo=so.asOption,go=so.defaultedThunk,po=so.mergeWithThunk;(co=ao||(ao={}))[co.Error=0]="Error",co[co.Value=1]="Value";var ho=function(t,n,e){return t.stype===ao.Error?n(t.serror):e(t.svalue)},vo=function(t){return{stype:ao.Value,svalue:t}},bo=function(t){return{stype:ao.Error,serror:t}},yo=function(t){return t.fold(bo,vo)},xo=function(t){return ho(t,vt.error,vt.value)},wo=vo,So=function(t){var n=[],e=[];return M(t,function(t){ho(t,function(t){return e.push(t)},function(t){return n.push(t)})}),{values:n,errors:e}},ko=bo,Co=function(t,n){return t.stype===ao.Value?n(t.svalue):t},Oo=function(t,n){return t.stype===ao.Error?n(t.serror):t},Eo=function(t,n){return t.stype===ao.Value?{stype:ao.Value,svalue:n(t.svalue)}:t},To=function(t,n){return t.stype===ao.Error?{stype:ao.Error,serror:n(t.serror)}:t},Bo=function(t){return p(ko,L)(t)},Ao=function(t,n){var e,o,r=So(t);return 0<r.errors.length?Bo(r.errors):(e=r.values,o=n,0<e.length?wo(wt(o,St.apply(undefined,e))):wo(o))},Do=function(t){var n=So(t);return 0<n.errors.length?Bo(n.errors):wo(n.values)},_o=bt([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),Mo=bt([{field:["name","presence","type"]},{state:["name"]}]),Fo=function(){return ue.getOrDie("JSON")},Io=function(t,n,e){return Fo().stringify(t,n,e)},Vo=function(t){return C(t)&&100<Z(t).length?" removed due to size":Io(t,null,2)},Ro=function(t,n){return ko([{path:t,getErrorInfo:n}])},Ho=bt([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),No=function(e,o,r){return mt(o,r).fold(function(){return t=r,n=o,Ro(e,function(){return'Could not find valid *strict* value for "'+t+'" in '+Vo(n)});var t,n},wo)},Po=function(t,n,e){var o=mt(t,n).fold(function(){return e(t)},d);return wo(o)},zo=function(a,c,t,s){return t.fold(function(r,e,t,o){var i=function(t){var n=o.extract(a.concat([r]),s,t);return Eo(n,function(t){return gt(e,s(t))})},u=function(t){return t.fold(function(){var t=gt(e,s(et.none()));return wo(t)},function(t){var n=o.extract(a.concat([r]),s,t);return Eo(n,function(t){return gt(e,s(et.some(t)))})})};return t.fold(function(){return Co(No(a,c,r),i)},function(t){return Co(Po(c,r,t),i)},function(){return Co(wo(mt(c,r)),u)},function(t){return Co((e=t,o=mt(n=c,r).map(function(t){return!0===t?e(n):t}),wo(o)),u);var n,e,o},function(t){var n=t(c),e=Eo(Po(c,r,nt({})),function(t){return wt(n,t)});return Co(e,i)})},function(t,n){var e=n(c);return wo(gt(t,s(e)))})},Lo=function(o){return{extract:function(e,t,n){return Oo(o(n,t),function(t){return n=t,Ro(e,function(){return n});var n})},toString:function(){return"val"},toDsl:function(){return _o.itemOf(o)}}},jo=function(t){var c=Uo(t),s=R(t,function(n,t){return t.fold(function(t){return wt(n,Tt(t,!0))},nt(n))},{});return{extract:function(t,n,e){var o,r,i,u=O(e)?[]:(r=Z(o=e),V(r,function(t){return Dt(o,t)})),a=V(u,function(t){return!Dt(s,t)});return 0===a.length?c.extract(t,n,e):(i=a,Ro(t,function(){return"There are unsupported fields: ["+i.join(", ")+"] specified"}))},toString:c.toString,toDsl:c.toDsl}},Uo=function(a){return{extract:function(t,n,e){return o=t,r=e,i=n,u=_(a,function(t){return zo(o,r,t,i)}),Ao(u,{});var o,r,i,u},toString:function(){return"obj{\n"+_(a,function(t){return t.fold(function(t,n,e,o){return t+" -> "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"},toDsl:function(){return _o.objOf(_(a,function(t){return t.fold(function(t,n,e,o){return Mo.field(t,e,o)},function(t,n){return Mo.state(t)})}))}}},Wo=function(r){return{extract:function(e,o,t){var n=_(t,function(t,n){return r.extract(e.concat(["["+n+"]"]),o,t)});return Do(n)},toString:function(){return"array("+r.toString()+")"},toDsl:function(){return _o.arrOf(r)}}},Go=function(a,c){return{extract:function(e,o,r){var t,n,i=Z(r),u=(t=e,n=i,Wo(Lo(a)).extract(t,d,n));return Co(u,function(t){var n=_(t,function(t){return Ho.field(t,t,lo(),c)});return Uo(n).extract(e,o,r)})},toString:function(){return"setOf("+c.toString()+")"},toDsl:function(){return _o.setOf(a,c)}}},Xo=nt(Lo(wo)),Yo=p(Wo,Uo),qo=Ho.state,Ko=Ho.field,Jo=function(e,n,o,r,i){return Et(r,i).fold(function(){return t=r,n=i,Ro(e,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Vo(t)});var t,n},function(t){return Uo(t).extract(e.concat(["branch: "+i]),n,o)})},$o=function(r,i){return{extract:function(n,e,o){return Et(o,r).fold(function(){return t=r,Ro(n,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return Jo(n,e,o,i,t)})},toString:function(){return"chooseOn("+r+"). Possible values: "+Z(i)},toDsl:function(){return _o.choiceOf(r,i)}}},Qo=Lo(wo),Zo=function(t){return Yo(t)},tr=function(){return Wo(Qo)},nr=function(n){return Lo(function(t){return n(t).fold(ko,wo)})},er=function(n,t){return Go(function(t){return yo(n(t))},t)},or=function(t,n,e,o){var r=n.extract([t],e,o);return To(r,function(t){return{input:o,errors:t}})},rr=function(t,n,e){return xo(or(t,n,d,e))},ir=function(t){return t.fold(function(t){throw new Error(ar(t))},d)},ur=function(t,n,e){return ir(rr(t,n,e))},ar=function(t){return"Errors: \n"+(n=t.errors,e=10<n.length?n.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):n,_(e,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}))+"\n\nInput object: "+Vo(t.input);var n,e},cr=function(t,n){return $o(t,n)},sr=nt(Qo),fr=function(e,o){return Lo(function(t){var n=typeof t;return e(t)?wo(t):ko("Expected type: "+o+" but got: "+n)})},lr=fr(D,"number"),dr=fr(k,"string"),mr=fr(O,"boolean"),gr=fr(E,"function"),pr=function(n){return nr(function(t){return T(n,t)?vt.value(t):vt.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},hr=function(t){return Ko(t,t,lo(),Xo())},vr=function(t,n){return Ko(t,t,lo(),n)},br=function(t){return vr(t,dr)},yr=function(t,n){return Ko(t,t,lo(),pr(n))},xr=function(t){return vr(t,gr)},wr=function(t,n){return Ko(t,t,lo(),Uo(n))},Sr=function(t,n){return Ko(t,t,lo(),Yo(n))},kr=function(t,n){return Ko(t,t,lo(),Wo(n))},Cr=function(t){return Ko(t,t,mo(),Xo())},Or=function(t,n){return Ko(t,t,mo(),n)},Er=function(t){return Or(t,lr)},Tr=function(t){return Or(t,dr)},Br=function(t){return Or(t,gr)},Ar=function(t,n){return Or(t,Uo(n))},Dr=function(t,n){return Ko(t,t,fo(n),Xo())},_r=function(t,n,e){return Ko(t,t,fo(n),e)},Mr=function(t,n){return _r(t,n,lr)},Fr=function(t,n){return _r(t,n,dr)},Ir=function(t,n,e){return _r(t,n,pr(e))},Vr=function(t,n){return _r(t,n,mr)},Rr=function(t,n){return _r(t,n,gr)},Hr=function(t,n,e){return _r(t,n,Uo(e))},Nr=function(t,n){return qo(t,n)},Pr=function(t,n){return he(t.element(),n.event().target())},zr=function(t){if(!Dt(t,"can")&&!Dt(t,"abort")&&!Dt(t,"run"))throw new Error("EventHandler defined by: "+Io(t,null,2)+" does not have can, abort, or run!");return ur("Extracting event.handler",jo([Dr("can",nt(!0)),Dr("abort",nt(!1)),Dr("run",tt)]),t)},Lr=function(e){var n,o,r,i,t=(n=e,o=function(t){return t.can},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return U(n,function(t,n){return t&&o(n).apply(undefined,e)},!0)}),u=(r=e,i=function(t){return t.abort},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return U(r,function(t,n){return t||i(n).apply(undefined,e)},!1)});return zr({can:t,abort:u,run:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];M(e,function(t){t.run.apply(undefined,n)})}})},jr=function(t,n){Xr(t,t.element(),n,{})},Ur=function(t,n,e){Xr(t,t.element(),n,e)},Wr=function(t){jr(t,Fn())},Gr=function(t,n,e){Xr(t,n,e,{})},Xr=function(t,n,e,o){var r=io({target:n},o);t.getSystem().triggerEvent(e,n,it(r,nt))},Yr=function(t,n,e,o){t.getSystem().triggerEvent(e,n,o.event())};function qr(t,n,e,o,r){return t(e,o)?et.some(e):E(r)&&r(e)?et.none():n(e,o,r)}var Kr,Jr=function(t){var n=He(t)?t.dom().parentNode:t.dom();return n!==undefined&&null!==n&&n.ownerDocument.body.contains(n)},$r=tn(function(){return Qr(Zn.fromDom(x.document))}),Qr=function(t){var n=t.dom().body;if(null===n||n===undefined)throw new Error("Body is not available yet");return Zn.fromDom(n)},Zr=function(t,n,e){for(var o=t.dom(),r=E(e)?e:nt(!1);o.parentNode;){o=o.parentNode;var i=Zn.fromDom(o);if(n(i))return et.some(i);if(r(i))break}return et.none()},ti=function(t,n,e){return qr(function(t){return n(t)},Zr,t,n,e)},ni=function(t,o){var r=function(t){for(var n=0;n<t.childNodes.length;n++){if(o(Zn.fromDom(t.childNodes[n])))return et.some(Zn.fromDom(t.childNodes[n]));var e=r(t.childNodes[n]);if(e.isSome())return e}return et.none()};return r(t.dom())},ei=function(t,n,e){return ti(t,function(t){return n(t).isSome()},e).bind(n)},oi=function(t){return Bt(t)},ri=function(t,n){return{key:t,value:zr({abort:n})}},ii=function(t,n){return{key:t,value:zr({can:n})}},ui=function(t){return{key:t,value:zr({run:function(t,n){n.event().prevent()}})}},ai=function(t,n){return{key:t,value:zr({run:n})}},ci=function(t,n,e){return{key:t,value:zr({run:function(t){n.apply(undefined,[t].concat(e))}})}},si=function(t){return function(e){return{key:t,value:zr({run:function(t,n){Pr(t,n)&&e(t,n)}})}}},fi=function(e,o){return ai(e,function(t,n){t.getSystem().getByUid(o).each(function(t){Yr(t,t.element(),e,n)})})},li=function(t,n,e){var o=n.partUids[e];return fi(t,o)},di=function(t,r){return ai(t,function(n,t){var e=t.event(),o=n.getSystem().getByDom(e.target()).fold(function(){return ei(e.target(),function(t){return n.getSystem().getByDom(t).toOption()},nt(!1)).getOr(n)},function(t){return t});r(n,o,t)})},mi=function(t){return ai(t,function(t,n){n.cut()})},gi=function(t){return ai(t,function(t,n){n.stop()})},pi=function(t,n){return si(t)(n)},hi=si(Un()),vi=si(Wn()),bi=si(zn()),yi=(Kr=Fn(),function(t){return ai(Kr,t)}),xi=oi([ii(An(),function(t,n){var e,o,r=n.event().originator(),i=n.event().target();return o=i,!(he(e=r,t.element())&&!he(e,o)&&(x.console.warn(An()+" did not get interpreted by the desired target. \nOriginator: "+Xe(r)+"\nTarget: "+Xe(i)+"\nCheck the "+An()+" event handlers"),1))})]),wi=/* */Object.freeze({events:xi}),Si=nt("alloy-id-"),ki=nt("data-alloy-id"),Ci=Si(),Oi=ki(),Ei=function(t,n){Object.defineProperty(t.dom(),Oi,{value:n,writable:!0})},Ti=function(t){var n=Re(t)?t.dom()[Oi]:null;return et.from(n)},Bi=function(t){return oo(t)},Ai=d,Di=function(n){var t=function(t){return function(){throw new Error("The component must be in a context to send: "+t+"\n"+Xe(n().element())+" is not in context.")}};return{debugInfo:nt("fake"),triggerEvent:t("triggerEvent"),triggerFocus:t("triggerFocus"),triggerEscape:t("triggerEscape"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),broadcast:t("broadcast"),broadcastOn:t("broadcastOn"),broadcastEvent:t("broadcastEvent"),isConnected:nt(!1)}},_i=Di(),Mi=function(t){return _(t,function(t){return o=n="/*",r=(e=t).length-n.length,""!==o&&(e.length<o.length||e.substr(r,r+o.length)!==o)?t:t.substring(0,t.length-"/*".length);var n,e,o,r})},Fi=function(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:Mi(i)}},t},Ii=oo("alloy-premade"),Vi=function(t){return Tt(Ii,t)},Ri=function(t){return Et(t,Ii)},Hi=function(o){return t=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return o.apply(undefined,[t.getApis()].concat([t].concat(n)))},n=o.toString(),e=n.indexOf(")")+1,r=n.indexOf("("),i=n.substring(r+1,e-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Mi(i.slice(1))}},t;var t,n,e,r,i},Ni={init:function(){return Pi({readState:function(){return"No State required"}})}},Pi=function(t){return t},zi=function(t,r){var i={};return rt(t,function(t,o){rt(t,function(t,n){var e=Ot(n,[])(i);i[n]=e.concat([r(o,t)])})}),i},Li=function(t){return{classes:t.classes!==undefined?t.classes:[],attributes:t.attributes!==undefined?t.attributes:{},styles:t.styles!==undefined?t.styles:{}}},ji=function(t,n){return e=w.apply(undefined,[t.handler].concat(n)),o=t.purpose(),{cHandler:e,purpose:nt(o)};var e,o},Ui=function(t){return t.cHandler},Wi=function(t,n){return{name:nt(t),handler:nt(n)}},Gi=function(t,n,e){var o,r,i=io({},e,(o=t,r={},M(n,function(t){r[t.name()]=t.handlers(o)}),r));return zi(i,Wi)},Xi=function(t){var n,i=E(n=t)?{can:nt(!0),abort:nt(!1),run:n}:n;return function(t,n){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var r=[t,n].concat(e);i.abort.apply(undefined,r)?n.stop():i.can.apply(undefined,r)&&i.run.apply(undefined,r)}},Yi=function(t,n,e){var o,r,i=n[e];return i?function(u,a,t,c){var n=t.slice(0);try{var e=n.sort(function(t,n){var e=t[a](),o=n[a](),r=c.indexOf(e),i=c.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+e+".\nOrder specified: "+Io(c,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+Io(c,null,2));return r<i?-1:i<r?1:0});return vt.value(e)}catch(o){return vt.error([o])}}("Event: "+e,"name",t,i).map(function(t){var n=_(t,function(t){return t.handler()});return Lr(n)}):(o=e,r=t,vt.error(["The event ("+o+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+Io(_(r,function(t){return t.name()}),null,2)]))},qi=function(t,i){var n=at(t,function(o,r){return(1===o.length?vt.value(o[0].handler()):Yi(o,i,r)).map(function(t){var n=Xi(t),e=1<o.length?V(i,function(n){return T(o,function(t){return t.name()===n})}).join(" > "):o[0].name();return Tt(r,{handler:n,purpose:nt(e)})})});return At(n,{})},Ki=function(t){return rr("custom.definition",Uo([Ko("dom","dom",lo(),Uo([hr("tag"),Dr("styles",{}),Dr("classes",[]),Dr("attributes",{}),Cr("value"),Cr("innerHtml")])),hr("components"),hr("uid"),Dr("events",{}),Dr("apis",{}),Ko("eventOrder","eventOrder",(n={"alloy.execute":["disabling","alloy.base.behaviour","toggling","typeaheadevents"],"alloy.focus":["alloy.base.behaviour","focusing","keying"],"alloy.system.init":["alloy.base.behaviour","disabling","toggling","representing"],input:["alloy.base.behaviour","representing","streaming","invalidating"],"alloy.system.detached":["alloy.base.behaviour","representing","item-events","tooltipping"],mousedown:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]},so.mergeWithThunk(nt(n))),sr()),Cr("domModification")]),t);var n},Ji=function(t,n){var e=Le(t,n);return e===undefined||""===e?[]:e.split(" ")},$i=function(t){return t.dom().classList!==undefined},Qi=function(t){return Ji(t,"class")},Zi=function(t,n){return r=n,i=Ji(e=t,o="class").concat([r]),ze(e,o,i.join(" ")),!0;var e,o,r,i},tu=function(t,n){return r=n,0<(i=V(Ji(e=t,o="class"),function(t){return t!==r})).length?ze(e,o,i.join(" ")):Ue(e,o),!1;var e,o,r,i},nu=function(t,n){$i(t)?t.dom().classList.add(n):Zi(t,n)},eu=function(t,n){var e;$i(t)?t.dom().classList.remove(n):tu(t,n),0===($i(e=t)?e.dom().classList:Qi(e)).length&&Ue(e,"class")},ou=function(t,n){return $i(t)&&t.dom().classList.contains(n)},ru=function(n,t){M(t,function(t){nu(n,t)})},iu=function(n,t){M(t,function(t){eu(n,t)})},uu=function(t){return t.style!==undefined},au=function(t,n,e){if(!k(e))throw x.console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);uu(t)&&t.style.setProperty(n,e)},cu=function(t,n){uu(t)&&t.style.removeProperty(n)},su=function(t,n,e){var o=t.dom();au(o,n,e)},fu=function(t,n){var e=t.dom();rt(n,function(t,n){au(e,n,t)})},lu=function(t,n){var e=t.dom();rt(n,function(t,n){t.fold(function(){cu(e,n)},function(t){au(e,n,t)})})},du=function(t,n){var e=t.dom(),o=x.window.getComputedStyle(e).getPropertyValue(n),r=""!==o||Jr(t)?o:mu(e,n);return null===r?undefined:r},mu=function(t,n){return uu(t)?t.style.getPropertyValue(n):""},gu=function(t,n){var e=t.dom(),o=mu(e,n);return et.from(o).filter(function(t){return 0<t.length})},pu=function(t,n,e){var o=Zn.fromTag(t);return su(o,n,e),gu(o,n).isSome()},hu=function(t,n){var e=t.dom();cu(e,n),je(t,"style")&&""===Le(t,"style").replace(/^\s+|\s+$/g,"")&&Ue(t,"style")},vu=function(t){return t.dom().offsetWidth},bu=function(t){return t.dom().value},yu=function(t,n){if(n===undefined)throw new Error("Value.set was undefined");t.dom().value=n},xu=function(t){var n,e,o,r=Zn.fromTag(t.tag);n=r,e=t.attributes,o=n.dom(),rt(e,function(t,n){Pe(o,n,t)}),ru(r,t.classes),fu(r,t.styles),t.innerHtml.each(function(t){return Me(r,t)});var i=t.domChildren;return Be(r,i),t.value.each(function(t){yu(r,t)}),t.uid,Ei(r,t.uid),r},wu=function(t,n){return e=t,r=_(o=n,function(t){return Ar(t.name(),[hr("config"),Dr("state",Ni)])}),i=rr("component.behaviours",Uo(r),e.behaviours).fold(function(t){throw new Error(ar(t)+"\nComplete spec:\n"+Io(e,null,2))},function(t){return t}),{list:o,data:it(i,function(t){var n=t.map(function(t){return{config:t.config,state:t.state.init(t.config)}});return function(){return n}})};var e,o,r,i},Su=function(t){var n,e,o,r=(n=t,e=Ot("behaviours",{})(n),o=V(Z(e),function(t){return e[t]!==undefined}),_(o,function(t){return e[t].me}));return wu(t,r)},ku=function(t,n,e){var o,r,i,u=io({},(o=t).dom,{uid:o.uid,domChildren:_(o.components,function(t){return t.element()})}),a=t.domModification.fold(function(){return Li({})},Li),c={"alloy.base.modification":a},s=0<n.length?function(n,t,e,o){var r=io({},t);M(e,function(t){r[t.name()]=t.exhibit(n,o)});var i=zi(r,function(t,n){return{name:t,modification:n}}),u=function(t){return R(t,function(t,n){return io({},n.modification,t)},{})},a=R(i.classes,function(t,n){return n.modification.concat(t)},[]),c=u(i.attributes),s=u(i.styles);return Li({classes:a,attributes:c,styles:s})}(e,c,n,u):a;return i=s,io({},r=u,{attributes:io({},r.attributes,i.attributes),styles:io({},r.styles,i.styles),classes:r.classes.concat(i.classes)})},Cu=function(t,n,e){var o,r,i,u,a,c,s={"alloy.base.behaviour":(o=t,o.events)};return(r=e,i=t.eventOrder,u=n,a=s,c=Gi(r,u,a),qi(c,i)).getOrDie()},Ou=function(t){var n,e,o,r,i,u,a,c,s,f,l,d,m,g,p=Ai(t),h=p.events,v=uo(p,["events"]),b=(n=v,e=Ot("components",[])(n),_(e,Au)),y=io({},v,{events:io({},wi,h),components:b});return vt.value((o=y,r=function(){return g},i=_t(_i),u=ir(Ki(o)),a=Su(o),c=a.list,s=a.data,f=ku(u,c,s),l=xu(f),d=Cu(u,c,s),m=_t(u.components),g={getSystem:i.get,config:function(t){var n=s;return(E(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+Io(o,null,2))})()},hasConfigured:function(t){return E(s[t.name()])},spec:nt(o),readState:function(t){return s[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return u.apis},connect:function(t){i.set(t)},disconnect:function(){i.set(Di(r))},element:nt(l),syncComponents:function(){var t=we(l),n=j(t,function(t){return i.get().getByDom(t).fold(function(){return[]},function(t){return[t]})});m.set(n)},components:m.get,events:nt(d)}))},Eu=function(t){var n=Zn.fromText(t);return Tu({element:n})},Tu=function(t){var n=ur("external.component",jo([hr("element"),Cr("uid")]),t),e=_t(Di());n.uid.each(function(t){Ei(n.element,t)});var o={getSystem:e.get,config:et.none,hasConfigured:nt(!1),connect:function(t){e.set(t)},disconnect:function(){e.set(Di(function(){return o}))},getApis:function(){return{}},element:nt(n.element),spec:nt(t),readState:nt("No state"),syncComponents:tt,components:nt([]),events:nt({})};return Vi(o)},Bu=Bi,Au=function(n){return Ri(n).fold(function(){var t=n.hasOwnProperty("uid")?n:io({uid:Bu("")},n);return Ou(t).getOrDie()},function(t){return t})},Du=Vi,_u=function(t,n,e){return ti(t,n,e).isSome()},Mu=function(t,n,e){return Zr(t,function(t){return de(t,n)},e)},Fu=function(t,n){return pe(n,t)},Iu=function(t,n,e){return qr(de,Mu,t,n,e)},Vu=function(n,t){return(e=t,ti(e,function(t){if(!Re(t))return!1;var n=Le(t,"id");return n!==undefined&&-1<n.indexOf("aria-owns")}).bind(function(t){var n=Le(t,"id"),e=ve(t);return Fu(e,'[aria-owns="'+n+'"]')})).exists(function(t){return Ru(n,t)});var e},Ru=function(n,t){return _u(t,function(t){return he(t,n.element())},nt(!1))||Vu(n,t)},Hu=nt([hr("menu"),hr("selectedMenu")]),Nu=nt([hr("item"),hr("selectedItem")]),Pu=(nt(Uo(Nu().concat(Hu()))),nt(Uo(Nu()))),zu=wr("initSize",[hr("numColumns"),hr("numRows")]),Lu=function(){return wr("markers",[hr("backgroundMenu")].concat(Hu()).concat(Nu()))},ju=function(t){return wr("markers",_(t,hr))},Uu=function(t,n,e){return function(){var t=new Error;if(t.stack!==undefined){var n=t.stack.split("\n");H(n,function(n){return 0<n.indexOf("alloy")&&!y($e,function(t){return-1<n.indexOf(t)})}).getOr(Ye)}}(),Ko(n,n,e,nr(function(e){return vt.value(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(undefined,t)})}))},Wu=function(t){return Uu(0,t,fo(tt))},Gu=function(t){return Uu(0,t,fo(et.none))},Xu=function(t){return Uu(0,t,lo())},Yu=function(t){return Uu(0,t,lo())},qu=function(t,n){return Nr(t,nt(n))},Ku=function(t){return Nr(t,d)},Ju=nt(zu),$u=function(e,o,r){return bi(function(t,n){r(t,e,o)})},Qu=function(t,n,e,o,r,i){var u,a,c=jo(t),s=Ar(n,[(u="config",a=t,Or(u,jo(a)))]);return na(c,s,n,e,o,r,i)},Zu=function(r,i,u){var t,n,e,o,a,c;return t=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=[e].concat(t);return e.config({name:nt(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(t){var n=Array.prototype.slice.call(o,1);return i.apply(undefined,[e,t.config,t.state].concat(n))})},n=u,e=i.toString(),o=e.indexOf(")")+1,a=e.indexOf("("),c=e.substring(a+1,o-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:n,parameters:Mi(c.slice(0,1).concat(c.slice(3)))}},t},ta=function(t){return{key:t,value:undefined}},na=function(e,t,o,r,n,i,u){var a=function(t){return Dt(t,o)?t[o]():et.none()},c=it(n,function(t,n){return Zu(o,t,n)}),s=it(i,function(t,n){return Fi(t,n)}),f=io({},s,c,{revoke:w(ta,o),config:function(t){var n=ur(o+"-config",e,t);return{key:o,value:{config:n,me:f,configAsRaw:tn(function(){return ur(o+"-config",e,t)}),initialConfig:t,state:u}}},schema:function(){return t},exhibit:function(t,e){return a(t).bind(function(n){return Et(r,"exhibit").map(function(t){return t(e,n.config,n.state)})}).getOr(Li({}))},name:function(){return o},handlers:function(t){return a(t).map(function(t){return Ot("events",function(t,n){return{}})(r)(t.config,t.state)}).getOr({})}});return f},ea=function(t){return Bt(t)},oa=jo([hr("fields"),hr("name"),Dr("active",{}),Dr("apis",{}),Dr("state",Ni),Dr("extra",{})]),ra=function(t){var n=ur("Creating behaviour: "+t.name,oa,t);return Qu(n.fields,n.name,n.active,n.apis,n.extra,n.state)},ia=jo([hr("branchKey"),hr("branches"),hr("name"),Dr("active",{}),Dr("apis",{}),Dr("state",Ni),Dr("extra",{})]),ua=function(t){var n,e,o,r,i,u,a,c,s=ur("Creating behaviour: "+t.name,ia,t);return n=cr(s.branchKey,s.branches),e=s.name,o=s.active,r=s.apis,i=s.extra,u=s.state,c=Ar(e,[Or("config",a=n)]),na(a,c,e,o,r,i,u)},aa=nt(undefined),ca=/* */Object.freeze({events:function(a){return oi([ai(Mn(),function(r,i){var t,n,u=a.channels,e=Z(u),o=(t=e,(n=i).universal()?t:V(t,function(t){return T(n.channels(),t)}));M(o,function(t){var n=u[t],e=n.schema,o=ur("channel["+t+"] data\nReceiver: "+Xe(r.element()),e,i.data());n.onReceive(r,o)})})])}}),sa=[vr("channels",er(vt.value,jo([Xu("onReceive"),Dr("schema",sr())])))],fa=ra({fields:sa,name:"receiving",active:ca}),la=/* */Object.freeze({exhibit:function(t,n){return Li({classes:[],styles:n.useFixed?{}:{position:"relative"}})}}),da=function(e,o){return{left:nt(e),top:nt(o),translate:function(t,n){return da(e+t,o+n)}}},ma=da,ga=function(t,n){return t!==undefined?t:n!==undefined?n:0},pa=function(t){var n,e,o=t.dom().ownerDocument,r=o.body,i=(n=Zn.fromDom(o),(e=n.dom())===e.window&&n instanceof x.Window?n:Ne(n)?e.defaultView||e.parentWindow:null),u=o.documentElement,a=ga(i.pageYOffset,u.scrollTop),c=ga(i.pageXOffset,u.scrollLeft),s=ga(u.clientTop,r.clientTop),f=ga(u.clientLeft,r.clientLeft);return ha(t).translate(c-f,a-s)},ha=function(t){var n,e,o,r=t.dom(),i=r.ownerDocument,u=i.body,a=Zn.fromDom(i.documentElement);return u===r?ma(u.offsetLeft,u.offsetTop):(n=t,e=a||Zn.fromDom(x.document.documentElement),Zr(n,w(he,e)).isSome()?(o=r.getBoundingClientRect(),ma(o.left,o.top)):ma(0,0))},va=(Tn.detect().browser.isSafari(),function(t){var n=t!==undefined?t.dom():x.document,e=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return ma(e,o)});function ba(o,r){var t=function(t){var n=r(t);if(n<=0||null===n){var e=du(t,o);return parseFloat(e)||0}return n},i=function(r,t){return U(t,function(t,n){var e=du(r,n),o=e===undefined?0:parseInt(e,10);return isNaN(o)?t:t+o},0)};return{set:function(t,n){if(!D(n)&&!n.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+n);var e=t.dom();uu(e)&&(e.style[o]=n+"px")},get:t,getOuter:t,aggregate:i,max:function(t,n,e){var o=i(t,e);return o<n?n-o:0}}}var ya=ba("width",function(t){return t.dom().offsetWidth}),xa=function(t){return ya.get(t)},wa=function(t){return ya.getOuter(t)},Sa=ba("height",function(t){var n=t.dom();return Jr(t)?n.getBoundingClientRect().height:n.offsetHeight}),ka=function(t){return Sa.get(t)},Ca=function(t){return Sa.getOuter(t)},Oa=oe(["x","y","width","height","maxHeight","direction","classes","label","candidateYforTest"],[]),Ea=te("position","left","top","right","bottom"),Ta=bt([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Ba=Ta.southeast,Aa=Ta.southwest,Da=Ta.northeast,_a=Ta.northwest,Ma=Ta.south,Fa=Ta.north,Ia=Ta.east,Va=Ta.west,Ra=te("point","width","height"),Ha=te("x","y","width","height"),Na=function(t,n,e,o){return{x:nt(t),y:nt(n),width:nt(e),height:nt(o),right:nt(t+e),bottom:nt(n+o)}},Pa=function(t){var n=pa(t),e=wa(t),o=Ca(t);return Na(n.left(),n.top(),e,o)},za=function(o,t){return o.view(t).fold(nt([]),function(t){var n=o.owner(t),e=za(o,n);return[t].concat(e)})},La=/* */Object.freeze({view:function(t){return(t.dom()===x.document?et.none():et.from(t.dom().defaultView.frameElement)).map(Zn.fromDom)},owner:function(t){return ve(t)}}),ja=function(o){var t,n,e,r,i=Zn.fromDom(x.document),u=va(i);return(t=o,e=(n=La).owner(t),r=za(n,e),et.some(r)).fold(w(pa,o),function(t){var n=ha(o),e=R(t,function(t,n){var e=ha(n);return{left:t.left+e.left(),top:t.top+e.top()}},{left:0,top:0});return ma(e.left+n.left()+u.left(),e.top+n.top()+u.top())})},Ua=function(){var t=x.window.innerWidth,n=x.window.innerHeight,e=Zn.fromDom(x.document),o=va(e);return Na(o.left(),o.top(),t,n)},Wa=bt([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),Ga=function(t,n,e,o,r,i){var u,a,c,s,f,l,d,m,g,p=n.x()-e,h=n.y()-o,v=r-(p+n.width()),b=i-(h+n.height()),y=et.some(p),x=et.some(h),w=et.some(v),S=et.some(b),k=et.none();return u=n.direction(),a=function(){return Ea(t,y,x,k,k)},c=function(){return Ea(t,k,x,w,k)},s=function(){return Ea(t,y,k,k,S)},f=function(){return Ea(t,k,k,w,S)},l=function(){return Ea(t,y,x,k,k)},d=function(){return Ea(t,y,k,k,S)},m=function(){return Ea(t,y,x,k,k)},g=function(){return Ea(t,k,x,w,k)},u.fold(a,c,s,f,l,d,m,g)},Xa=function(t,n){var e=w(ja,n),o=t.fold(e,e,function(){var t=va();return ja(n).translate(-t.left(),-t.top())}),r=wa(n),i=Ca(n);return Na(o.left(),o.top(),r,i)},Ya=Wa.relative,qa=Wa.fixed,Ka=te("anchorBox","origin"),Ja=bt([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),$a=function(t,H,N,P,z){var L=N.width(),j=N.height(),o=function(t,o,r,i){var n,e,u,a,c,s,f,l,d,m,g,p,h,v,b,y,x,w,S,k,C,O,E,T,B,A,D,_,M,F,I,V,R=t(H,N,P);return(e=L,u=j,a=z,d=(n=R).x(),m=n.y(),g=n.bubble().offset().left(),p=n.bubble().offset().top(),h=a.x(),v=a.y(),b=a.width(),y=a.height(),k=v<=(w=m+p),C=(S=h<=(x=d+g))&&k,O=x+e<=h+b&&w+u<=v+y,E=S?Math.min(e,h+b-x):Math.abs(h-(x+e)),T=k?Math.min(u,v+y-w):Math.abs(v-(w+u)),B=a.x()+a.width(),A=Math.max(a.x(),x),D=Math.min(A,B),M=nt((_=k?w:w+(u-T))+T-v),F=nt(v+y-_),c=n.direction(),f=s=F,l=M,I=c.fold(s,s,l,l,s,l,f,f),V=Oa({x:D,y:_,width:E,height:T,maxHeight:I,direction:n.direction(),classes:{on:n.bubble().classesOn(),off:n.bubble().classesOff()},label:n.label(),candidateYforTest:w}),C&&O?Ja.fit(V):Ja.nofit(V,E,T)).fold(Ja.fit,function(t,n,e){return i<e||r<n?Ja.nofit(t,n,e):Ja.nofit(o,r,i)})};return U(t,function(t,n){var e=w(o,n);return t.fold(Ja.fit,e)},Ja.nofit(Oa({x:H.x(),y:H.y(),width:N.width(),height:N.height(),maxHeight:N.height(),direction:Ba(),classes:[],label:"none",candidateYforTest:H.y()}),-1,-1)).fold(d,d)},Qa=function(t,n,e,o){hu(n,"max-height");var r,i={width:nt(wa(r=n)),height:nt(Ca(r))};return $a(o.preference(),t,i,e,o.bounds())},Za=function(t,n,e){var o,r,i=function(t){return t+"px"},u=(o=e.origin(),r=n,o.fold(function(){return Ea("absolute",et.some(r.x()),et.some(r.y()),et.none(),et.none())},function(t,n,e,o){return Ga("absolute",r,t,n,e,o)},function(t,n,e,o){return Ga("fixed",r,t,n,e,o)}));lu(t,{position:et.some(u.position()),left:u.left().map(i),top:u.top().map(i),right:u.right().map(i),bottom:u.bottom().map(i)})},tc=function(t,n){var e,o,r;e=t,o=Math.floor(n),r=Sa.max(e,o,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]),su(e,"max-height",r+"px")},nc=nt(function(t,n){tc(t,n),fu(t,{"overflow-x":"hidden","overflow-y":"auto"})}),ec=nt(function(t,n){tc(t,n)}),oc=oe(["bounds","origin","preference","maxHeightFunction"],[]),rc=function(t,n,e,o,r,i){var u,a,c,s,f,l=(u=i,a="maxHeightFunction",c=nc(),u[a]===undefined?c:u[a]),d=t.anchorBox(),m=t.origin(),g=oc({bounds:(s=m,f=r,f.fold(function(){return s.fold(Ua,Ua,Na)},function(t){return s.fold(t,t,Na)})),origin:m,preference:o,maxHeightFunction:l});ic(d,n,e,g)},ic=function(t,n,e,o){var r,i,u,a,c=Qa(t,n,e,o);Za(n,c,o),r=n,i=c.classes(),iu(r,i.off),ru(r,i.on),u=n,a=c,o.maxHeightFunction()(u,a.maxHeight())},uc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],ac=function(t,n,e){var r=function(t){return Et(e,t).getOr([])},o=function(t,n,e){var o=Y(uc,e);return{offset:function(){return ma(t,n)},classesOn:function(){return j(e,r)},classesOff:function(){return j(o,r)}}};return{southeast:function(){return o(-t,n,["top","alignLeft"])},southwest:function(){return o(t,n,["top","alignRight"])},south:function(){return o(-t/2,n,["top","alignCentre"])},northeast:function(){return o(-t,-n,["bottom","alignLeft"])},northwest:function(){return o(t,-n,["bottom","alignRight"])},north:function(){return o(-t/2,-n,["bottom","alignCentre"])},east:function(){return o(t,-n/2,["valignCentre","left"])},west:function(){return o(-t,-n/2,["valignCentre","right"])}}},cc=function(){return ac(0,0,{})},sc=te("x","y","bubble","direction","label"),fc=function(t){return t.x()},lc=function(t,n){return t.x()+t.width()/2-n.width()/2},dc=function(t,n){return t.x()+t.width()-n.width()},mc=function(t,n){return t.y()-n.height()},gc=function(t){return t.y()+t.height()},pc=function(t,n){return t.y()+t.height()/2-n.height()/2},hc=function(t,n,e){return sc(fc(t),gc(t),e.southeast(),Ba(),"layout-se")},vc=function(t,n,e){return sc(dc(t,n),gc(t),e.southwest(),Aa(),"layout-sw")},bc=function(t,n,e){return sc(fc(t),mc(t,n),e.northeast(),Da(),"layout-ne")},yc=function(t,n,e){return sc(dc(t,n),mc(t,n),e.northwest(),_a(),"layout-nw")},xc=function(t,n,e){return sc(lc(t,n),mc(t,n),e.north(),Fa(),"layout-n")},wc=function(t,n,e){return sc(lc(t,n),gc(t),e.south(),Ma(),"layout-s")},Sc=function(t,n,e){return sc((o=t).x()+o.width(),pc(t,n),e.east(),Ia(),"layout-e");var o},kc=function(t,n,e){return sc((o=n,t.x()-o.width()),pc(t,n),e.west(),Va(),"layout-w");var o},Cc=function(){return[hc,vc,bc,yc,wc,xc,Sc,kc]},Oc=function(){return[vc,hc,yc,bc,wc,xc,Sc,kc]},Ec=function(t){return t},Tc=function(n,e){return function(t){return"rtl"===Bc(t)?e:n}},Bc=function(t){return"rtl"===du(t,"direction")?"rtl":"ltr"},Ac=function(){return Ar("layouts",[hr("onLtr"),hr("onRtl")])},Dc=function(n,t,e,o){var r=t.layouts.map(function(t){return t.onLtr(n)}).getOr(e),i=t.layouts.map(function(t){return t.onRtl(n)}).getOr(o);return Tc(r,i)(n)},_c=[hr("hotspot"),Cr("bubble"),Dr("overrides",{}),Ac(),qu("placement",function(t,n,e){var o=n.hotspot,r=Xa(e,o.element()),i=Dc(t.element(),n,Cc(),Oc());return et.some(Ec({anchorBox:r,bubble:n.bubble.getOr(cc()),overrides:n.overrides,layouts:i,placer:et.none()}))})],Mc=[hr("x"),hr("y"),Dr("height",0),Dr("width",0),Dr("bubble",cc()),Dr("overrides",{}),Ac(),qu("placement",function(t,n,e){var o=Na(n.x,n.y,n.width,n.height),r=Dc(t.element(),n,Cc(),Oc());return et.some(Ec({anchorBox:o,bubble:n.bubble,overrides:n.overrides,layouts:r,placer:et.none()}))})],Fc=(bt([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),bt([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}])),Ic=te("start","soffset","finish","foffset"),Vc=Fc.exact,Rc=function(t,n,e,o){var r,i,u,a,c,s=(i=n,u=e,a=o,(c=ve(r=t).dom().createRange()).setStart(r.dom(),i),c.setEnd(u.dom(),a),c),f=he(t,e)&&n===o;return s.collapsed&&!f},Hc=function(t,n,e){var o,r,i=t.document.createRange();return o=i,n.fold(function(t){o.setStartBefore(t.dom())},function(t,n){o.setStart(t.dom(),n)},function(t){o.setStartAfter(t.dom())}),r=i,e.fold(function(t){r.setEndBefore(t.dom())},function(t,n){r.setEnd(t.dom(),n)},function(t){r.setEndAfter(t.dom())}),i},Nc=function(t,n,e,o,r){var i=t.document.createRange();return i.setStart(n.dom(),e),i.setEnd(o.dom(),r),i},Pc=function(t){return{left:nt(t.left),top:nt(t.top),right:nt(t.right),bottom:nt(t.bottom),width:nt(t.width),height:nt(t.height)}},zc=bt([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),Lc=function(t,n,e){return n(Zn.fromDom(e.startContainer),e.startOffset,Zn.fromDom(e.endContainer),e.endOffset)},jc=function(t,n){var r,e,o,i=(r=t,n.match({domRange:function(t){return{ltr:nt(t),rtl:et.none}},relative:function(t,n){return{ltr:tn(function(){return Hc(r,t,n)}),rtl:tn(function(){return et.some(Hc(r,n,t))})}},exact:function(t,n,e,o){return{ltr:tn(function(){return Nc(r,t,n,e,o)}),rtl:tn(function(){return et.some(Nc(r,e,o,t,n))})}}}));return(o=(e=i).ltr()).collapsed?e.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return zc.rtl(Zn.fromDom(t.endContainer),t.endOffset,Zn.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return Lc(0,zc.ltr,o)}):Lc(0,zc.ltr,o)},Uc=function $D(e,o){var r=function(t){return e(t)?et.from(t.dom().nodeValue):et.none()},t=Tn.detect().browser,n=t.isIE()&&10===t.version.major?function(t){try{return r(t)}catch(n){return et.none()}}:r;return{get:function(t){if(!e(t))throw new Error("Can only get "+o+" value of a "+o+" node");return n(t).getOr("")},getOption:n,set:function(t,n){if(!e(t))throw new Error("Can only set raw "+o+" value of a "+o+" node");t.dom().nodeValue=n}}}(He,"text"),Wc=function(t){return Uc.get(t)},Gc=(document.caretPositionFromPoint||document.caretRangeFromPoint,function(t,n){return ge(n,t)}),Xc=function(t){var n=Zn.fromDom(t.anchorNode),e=Zn.fromDom(t.focusNode);return Rc(n,t.anchorOffset,e,t.focusOffset)?et.some(Ic(n,t.anchorOffset,e,t.focusOffset)):function(t){if(0<t.rangeCount){var n=t.getRangeAt(0),e=t.getRangeAt(t.rangeCount-1);return et.some(Ic(Zn.fromDom(n.startContainer),n.startOffset,Zn.fromDom(e.endContainer),e.endOffset))}return et.none()}(t)},Yc=function(t,n){var i,e,o,r,u=jc(i=t,n).match({ltr:function(t,n,e,o){var r=i.document.createRange();return r.setStart(t.dom(),n),r.setEnd(e.dom(),o),r},rtl:function(t,n,e,o){var r=i.document.createRange();return r.setStart(e.dom(),o),r.setEnd(t.dom(),n),r}});return o=(e=u).getClientRects(),0<(r=0<o.length?o[0]:e.getBoundingClientRect()).width||0<r.height?et.some(r).map(Pc):et.none()},qc=te("element","offset"),Kc=bt([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Jc=function(t){return t.fold(function(t){return t},function(t,n,e){return t.translate(-n,-e)})},$c=function(t){return t.fold(function(t){return t},function(t,n,e){return t})},Qc=function(t){return U(t,function(t,n){return t.translate(n.left(),n.top())},ma(0,0))},Zc=function(t){var n=_(t,$c);return Qc(n)},ts=Kc.screen,ns=Kc.absolute,es=function(t,n,e){var o,r,i,u=ve(t.element()),a=va(u),c=(o=t,r=e,i=be(r.root).dom(),et.from(i.frameElement).map(Zn.fromDom).filter(function(t){var n=ve(t),e=ve(o.element());return he(n,e)}).map(pa)).getOr(a);return ns(c,a.left(),a.top())},os=function(t,n,e,o){var r=t,i=n,u=e,a=o;t<0&&(r=0,u=e+t),n<0&&(i=0,a=o+n);var c=ts(ma(r,i));return et.some(Ra(c,u,a))},rs=function(t,c,s,f,l){return t.map(function(t){var n,e,o,r=[c,t.point()],i=(n=function(){return Zc(r)},e=function(){return Zc(r)},o=function(){return t=_(r,Jc),Qc(t);var t},f.fold(n,e,o)),u=Ha(i.left(),i.top(),t.width(),t.height()),a=Dc(l,s,s.showAbove?[bc,yc,hc,vc,xc,wc]:[hc,vc,bc,yc,wc,wc],s.showAbove?[yc,bc,vc,hc,xc,wc]:[vc,hc,yc,bc,wc,xc]);return Ec({anchorBox:u,bubble:s.bubble.getOr(cc()),overrides:s.overrides,layouts:a,placer:et.none()})})},is=te("element","offset"),us=function(t,n){return He(t)?is(t,n):function(t,n){var e=we(t);if(0===e.length)return qc(t,n);if(n<e.length)return qc(e[n],0);var o=e[e.length-1],r=He(o)?Wc(o).length:we(o).length;return qc(o,r)}(t,n)},as=function(n,t){return t.getSelection.getOrThunk(function(){return function(){return t=n,et.from(t.getSelection()).filter(function(t){return 0<t.rangeCount}).bind(Xc);var t}})().map(function(t){var n=us(t.start(),t.soffset()),e=us(t.finish(),t.foffset());return Ic(n.element(),n.offset(),e.element(),e.offset())})},cs=[Cr("getSelection"),hr("root"),Cr("bubble"),Ac(),Dr("overrides",{}),Dr("showAbove",!1),qu("placement",function(t,n,e){var o=be(n.root).dom(),r=es(t,0,n),i=as(o,n).bind(function(t){var n;return Yc(o,(n=t,Fc.exact(n.start(),n.soffset(),n.finish(),n.foffset()))).orThunk(function(){var n=Zn.fromText("\ufeff");return Ce(t.start(),n),Yc(o,Vc(n,0,n,1)).map(function(t){return De(n),t})}).bind(function(t){return os(t.left(),t.top(),t.width(),t.height())})}),u=as(o,n).bind(function(t){return Re(t.start())?et.some(t.start()):ye(t.start())}).getOr(t.element());return rs(i,r,n,e,u)})],ss=[hr("node"),hr("root"),Cr("bubble"),Ac(),Dr("overrides",{}),Dr("showAbove",!1),qu("placement",function(r,i,u){var a=es(r,0,i);return i.node.bind(function(t){var n=t.dom().getBoundingClientRect(),e=os(n.left,n.top,n.width,n.height),o=i.node.getOr(r.element());return rs(e,a,i,u,o)})})],fs=function(t){return t.x()+t.width()},ls=function(t,n){return t.x()-n.width()},ds=function(t,n){return t.y()-n.height()+t.height()},ms=function(t){return t.y()},gs=function(t,n,e){return sc(fs(t),ms(t),e.southeast(),Ba(),"link-layout-se")},ps=function(t,n,e){return sc(ls(t,n),ms(t),e.southwest(),Aa(),"link-layout-sw")},hs=function(t,n,e){return sc(fs(t),ds(t,n),e.northeast(),Da(),"link-layout-ne")},vs=function(t,n,e){return sc(ls(t,n),ds(t,n),e.northwest(),_a(),"link-layout-nw")},bs=[hr("item"),Ac(),Dr("overrides",{}),qu("placement",function(t,n,e){var o=Xa(e,n.item.element()),r=Dc(t.element(),n,[gs,ps,hs,vs],[ps,gs,vs,hs]);return et.some(Ec({anchorBox:o,bubble:cc(),overrides:n.overrides,layouts:r,placer:et.none()}))})],ys=cr("anchor",{selection:cs,node:ss,hotspot:_c,submenu:bs,makeshift:Mc}),xs=function(t,n,e,o,r){var i,u=(i=e.anchorBox,Ka(i,n));rc(u,r.element(),e.bubble,e.layouts,o,e.overrides)},ws=function(n,t,e,o,r,i){var u=ur("positioning anchor.info",ys,o);su(r.element(),"position","fixed");var a=gu(r.element(),"visibility");su(r.element(),"visibility","hidden");var c,s,f,l=t.useFixed?qa(0,0,x.window.innerWidth,x.window.innerHeight):(s=pa((c=n).element()),f=c.element().dom().getBoundingClientRect(),Ya(s.left(),s.top(),f.width,f.height)),d=u.placement,m=i.map(function(t){return function(){return Pa(t)}}).or(t.getBounds);d(n,u,l).each(function(t){t.placer.getOr(xs)(n,l,t,m,r)}),a.fold(function(){hu(r.element(),"visibility")},function(t){su(r.element(),"visibility",t)}),gu(r.element(),"left").isNone()&&gu(r.element(),"top").isNone()&&gu(r.element(),"right").isNone()&&gu(r.element(),"bottom").isNone()&&gu(r.element(),"position").is("fixed")&&hu(r.element(),"position")},Ss=/* */Object.freeze({position:function(t,n,e,o,r){var i=et.none();ws(t,n,e,o,r,i)},positionWithin:ws,getMode:function(t,n,e){return n.useFixed?"fixed":"absolute"}}),ks=[Dr("useFixed",!1),Cr("getBounds")],Cs=ra({fields:ks,name:"positioning",active:la,apis:Ss}),Os=function(t){jr(t,Wn());var n=t.components();M(n,Os)},Es=function(t){var n=t.components();M(n,Es),jr(t,Un())},Ts=function(t,n){Bs(t,n,Te)},Bs=function(t,n,e){t.getSystem().addToWorld(n),e(t.element(),n.element()),Jr(t.element())&&Es(n),t.syncComponents()},As=function(t){Os(t),De(t.element()),t.getSystem().removeFromWorld(t)},Ds=function(n){var t=ye(n.element()).bind(function(t){return n.getSystem().getByDom(t).fold(et.none,et.some)});As(n),t.each(function(t){t.syncComponents()})},_s=function(t){var n=t.components();M(n,As),Ae(t.element()),t.syncComponents()},Ms=function(t,n){Fs(t,n,Te)},Fs=function(t,n,e){e(t,n.element());var o=we(n.element());M(o,function(t){n.getByDom(t).each(Es)})},Is=function(n){var t=we(n.element());M(t,function(t){n.getByDom(t).each(Os)}),De(n.element())},Vs=function(t,n,e,o){var r=function(n,t,e,o){e.get().each(function(t){_s(n)});var r=t.getAttachPoint(n);Ts(r,n);var i=n.getSystem().build(o);return Ts(n,i),e.set(i),i}(t,n,e,o);return n.onOpen(t,r),r},Rs=function(n,e,o){o.get().each(function(t){_s(n),Ds(n),e.onClose(n,t),o.clear()})},Hs=function(t,n,e){return e.isOpen()},Ns=function(t,n,e){var o,r,i,u,a=n.getAttachPoint(t);su(t.element(),"position",Cs.getMode(a)),o=t,r="visibility",i=n.cloakVisibilityAttr,u="hidden",gu(o.element(),r).fold(function(){Ue(o.element(),i)},function(t){ze(o.element(),i,t)}),su(o.element(),r,u)},Ps=function(t,n,e){var o;o=t.element(),y(["top","left","right","bottom"],function(t){return gu(o,t).isSome()})||hu(t.element(),"position"),function(t,n,e){if(je(t.element(),e)){var o=Le(t.element(),e);su(t.element(),n,o)}else hu(t.element(),n)}(t,"visibility",n.cloakVisibilityAttr)},zs=/* */Object.freeze({cloak:Ns,decloak:Ps,open:Vs,openWhileCloaked:function(t,n,e,o,r){Ns(t,n,e),Vs(t,n,e,o),r(),Ps(t,n,e)},close:Rs,isOpen:Hs,isPartOf:function(n,e,t,o){return Hs(0,0,t)&&t.get().exists(function(t){return e.isPartOf(n,t,o)})},getState:function(t,n,e){return e.get()}}),Ls=/* */Object.freeze({events:function(e,o){return oi([ai(Nn(),function(t,n){Rs(t,e,o)})])}}),js=[Wu("onOpen"),Wu("onClose"),hr("isPartOf"),hr("getAttachPoint"),Dr("cloakVisibilityAttr","data-precloak-visibility")],Us=ra({fields:js,name:"sandboxing",active:Ls,apis:zs,state:/* */Object.freeze({init:function(){var n=_t(et.none()),t=nt("not-implemented");return Pi({readState:t,isOpen:function(){return n.get().isSome()},clear:function(){n.set(et.none())},set:function(t){n.set(et.some(t))},get:function(t){return n.get()}})}})}),Ws=nt("dismiss.popups"),Gs=nt("mouse.released"),Xs=jo([Dr("isExtraPart",nt(!1)),Ar("fireEventInstead",[Dr("event",Gn())])]),Ys=function(t){var n=qs(t);return fa.config(n)},qs=function(t){var e=ur("Dismissal",Xs,t);return{channels:Tt(Ws(),{schema:jo([hr("target")]),onReceive:function(n,t){Us.isOpen(n)&&(Us.isPartOf(n,t.target)||e.isExtraPart(n,t.target)||e.fireEventInstead.fold(function(){return Us.close(n)},function(t){return jr(n,t.event)}))}})}},Ks=function(o,t){return Hr(o,{},_(t,function(t){return n=t.name(),e="Cannot configure "+t.name()+" for "+o,Ko(n,n,mo(),Lo(function(t){return ko("The field: "+n+" is forbidden. "+e)}));var n,e}).concat([Nr("dump",d)]))},Js=function(t){return t.dump},$s=function(t,n){return io({},t.dump,ea(n))},Qs={field:Ks,augment:$s,get:Js},Zs="placeholder",tf=bt([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),nf=function(t,n,e,o){return e.uiType===Zs?(i=e,u=o,(r=t).exists(function(t){return t!==i.owner})?tf.single(!0,nt(i)):Et(u,i.name).fold(function(){throw new Error("Unknown placeholder component: "+i.name+"\nKnown: ["+Z(u)+"]\nNamespace: "+r.getOr("none")+"\nSpec: "+Io(i,null,2))},function(t){return t.replace()})):tf.single(!1,nt(e));var r,i,u},ef=function(i,u,a,c){return nf(i,0,a,c).fold(function(t,n){var e=n(u,a.config,a.validated),o=Et(e,"components").getOr([]),r=j(o,function(t){return ef(i,u,t,c)});return[io({},e,{components:r})]},function(t,n){var e=n(u,a.config,a.validated);return a.validated.preprocess.getOr(d)(e)})},of=function(n,e,t,o){return j(t,function(t){return ef(n,e,t,o)})},rf=function(n,e,t,o){var r=it(o,function(t,n){return o=t,r=!1,{name:nt(e=n),required:function(){return o.fold(function(t,n){return t},function(t,n){return t})},used:function(){return r},replace:function(){if(!0===r)throw new Error("Trying to use the same placeholder more than once: "+e);return r=!0,o}};var e,o,r}),i=of(n,e,t,r);return rt(r,function(t){if(!1===t.used()&&t.required())throw new Error("Placeholder: "+t.name()+" was not found in components list\nNamespace: "+n.getOr("none")+"\nComponents: "+Io(e.components,null,2))}),i},uf=tf.single,cf=tf.multiple,sf=nt(Zs),ff=bt([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),lf=Dr("factory",{sketch:d}),mf=Dr("schema",[]),gf=hr("name"),pf=Ko("pname","pname",go(function(t){return"<alloy."+oo(t.name)+">"}),sr()),hf=Nr("schema",function(){return[Cr("preprocess")]}),vf=Dr("defaults",nt({})),yf=Dr("overrides",nt({})),xf=Uo([lf,mf,gf,pf,vf,yf]),wf=Uo([lf,mf,gf,vf,yf]),Sf=Uo([lf,mf,gf,pf,vf,yf]),kf=Uo([lf,hf,gf,hr("unit"),pf,vf,yf]),Cf=function(t){return t.fold(et.some,et.none,et.some,et.some)},Of=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},Ef=function(e,o){return function(t){var n=ur("Converting part type",o,t);return e(n)}},Tf=Ef(ff.required,xf),Bf=Ef(ff.external,wf),Af=Ef(ff.optional,Sf),Df=Ef(ff.group,kf),_f=nt("entirety"),Mf=/* */Object.freeze({required:Tf,external:Bf,optional:Af,group:Df,asNamedPart:Cf,name:Of,asCommon:function(t){return t.fold(d,d,d,d)},original:_f}),Ff=function(t,n,e,o){return wt(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},If=function(r,t){var n={};return M(t,function(t){Cf(t).each(function(e){var o=Vf(r,e.pname);n[e.name]=function(t){var n=ur("Part: "+e.name+" in "+r,Uo(e.schema),t);return io({},o,{config:t,validated:n})}})}),n},Vf=function(t,n){return{uiType:sf(),owner:t,name:n}},Rf=function(t,n,e){return{uiType:sf(),owner:t,name:n,config:e,validated:{}}},Hf=function(t){return j(t,function(t){return t.fold(et.none,et.some,et.none,et.none).map(function(t){return wr(t.name,t.schema.concat([Ku(_f())]))}).toArray()})},Nf=function(t){return _(t,Of)},Pf=function(t,n,e){return o=n,i={},r={},M(e,function(t){t.fold(function(o){i[o.pname]=uf(!0,function(t,n,e){return o.factory.sketch(Ff(t,o,n,e))})},function(t){var n=o.parts[t.name];r[t.name]=nt(t.factory.sketch(Ff(o,t,n[_f()]),n))},function(o){i[o.pname]=uf(!1,function(t,n,e){return o.factory.sketch(Ff(t,o,n,e))})},function(r){i[r.pname]=cf(!0,function(n,t,e){var o=n[r.name];return _(o,function(t){return r.factory.sketch(wt(r.defaults(n,t,e),t,r.overrides(n,t)))})})})}),{internals:nt(i),externals:nt(r)};var o,i,r},zf=function(t,n,e){return rf(et.some(t),n,n.components,e)},Lf=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOption()},jf=function(t,n,e){return Lf(t,n,e).getOrDie("Could not find part: "+e)},Uf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return M(e,function(t){o[t]=i.getByUid(r[t])}),it(o,nt)},Wf=function(t,n){var e=t.getSystem();return it(n.partUids,function(t,n){return nt(e.getByUid(t))})},Gf=function(t){return Z(t.partUids)},Xf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return M(e,function(t){o[t]=i.getByUid(r[t]).getOrDie()}),it(o,nt)},Yf=function(n,t){var e=Nf(t);return Bt(_(e,function(t){return{key:t,value:n+"-"+t}}))},qf=function(n){return Ko("partUids","partUids",po(function(t){return Yf(t.uid,n)}),sr())},Kf=/* */Object.freeze({generate:If,generateOne:Rf,schemas:Hf,names:Nf,substitutes:Pf,components:zf,defaultUids:Yf,defaultUidsSchema:qf,getAllParts:Wf,getAllPartNames:Gf,getPart:Lf,getPartOrDie:jf,getParts:Uf,getPartsOrDie:Xf}),Jf=function(t,n,e,o,r){var i,u,a=(u=r,(0<(i=o).length?[wr("parts",i)]:[]).concat([hr("uid"),Dr("dom",{}),Dr("components",[]),Ku("originalSpec"),Dr("debug.sketcher",{})]).concat(u));return ur(t+" [SpecSchema]",jo(a.concat(n)),e)},$f=function(t,n,e,o,r){var i=Qf(r),u=Hf(e),a=qf(e),c=Jf(t,n,i,u,[a]),s=Pf(0,c,e);return o(c,zf(t,c,s.internals()),i,s.externals())},Qf=function(t){return t.hasOwnProperty("uid")?t:io({},t,{uid:Bi("uid")})};function Zf(t){return t.uid!==undefined}var tl,nl,el=jo([hr("name"),hr("factory"),hr("configFields"),Dr("apis",{}),Dr("extraApis",{})]),ol=jo([hr("name"),hr("factory"),hr("configFields"),hr("partFields"),Dr("apis",{}),Dr("extraApis",{})]),rl=function(t){var i=ur("Sketcher for "+t.name,el,t),n=it(i.apis,Hi),e=it(i.extraApis,function(t,n){return Fi(t,n)});return io({name:nt(i.name),partFields:nt([]),configFields:nt(i.configFields),sketch:function(t){return n=i.name,e=i.configFields,o=i.factory,r=Qf(t),o(Jf(n,e,r,[],[]),r);var n,e,o,r}},n,e)},il=function(t){var n=ur("Sketcher for "+t.name,ol,t),e=If(n.name,n.partFields),o=it(n.apis,Hi),r=it(n.extraApis,function(t,n){return Fi(t,n)});return io({name:nt(n.name),partFields:nt(n.partFields),configFields:nt(n.configFields),sketch:function(t){return $f(n.name,n.configFields,n.partFields,n.factory,t)},parts:nt(e)},o,r)},ul=function(t){return"input"===Fe(t)&&"radio"!==Le(t,"type")||"textarea"===Fe(t)},al=/* */Object.freeze({getCurrent:function(t,n,e){return n.find(t)}}),cl=[hr("find")],sl=ra({fields:cl,name:"composing",apis:al}),fl=function(t,n,e,o){var r=t+n;return o<r?e:r<e?o:r},ll=function(t,n,e){return t<=n?n:e<=t?e:t},dl=function(e,o,t,r){var n=Gc(e.element(),"."+o.highlightClass);M(n,function(n){y(r,function(t){return t.element()===n})||(eu(n,o.highlightClass),e.getSystem().getByDom(n).each(function(t){o.onDehighlight(e,t),jr(t,$n())}))})},ml=function(t,n,e,o){dl(t,n,0,[o]),gl(t,n,e,o)||(nu(o.element(),n.highlightClass),n.onHighlight(t,o),jr(o,Jn()))},gl=function(t,n,e,o){return ou(o.element(),n.highlightClass)},pl=function(t,n,e,o){var r=Gc(t.element(),"."+n.itemClass);return et.from(r[o]).fold(function(){return vt.error("No element found with index "+o)},t.getSystem().getByDom)},hl=function(n,t,e){return Fu(n.element(),"."+t.itemClass).bind(function(t){return n.getSystem().getByDom(t).toOption()})},vl=function(n,t,e){var o=Gc(n.element(),"."+t.itemClass);return(0<o.length?et.some(o[o.length-1]):et.none()).bind(function(t){return n.getSystem().getByDom(t).toOption()})},bl=function(e,n,t,o){var r=Gc(e.element(),"."+n.itemClass);return N(r,function(t){return ou(t,n.highlightClass)}).bind(function(t){var n=fl(t,o,0,r.length-1);return e.getSystem().getByDom(r[n]).toOption()})},yl=function(n,t,e){var o=Gc(n.element(),"."+t.itemClass);return Mt(_(o,function(t){return n.getSystem().getByDom(t).toOption()}))},xl=/* */Object.freeze({dehighlightAll:function(t,n,e){return dl(t,n,0,[])},dehighlight:function(t,n,e,o){gl(t,n,e,o)&&(eu(o.element(),n.highlightClass),n.onDehighlight(t,o),jr(o,$n()))},highlight:ml,highlightFirst:function(n,e,o){hl(n,e,o).each(function(t){ml(n,e,o,t)})},highlightLast:function(n,e,o){vl(n,e,o).each(function(t){ml(n,e,o,t)})},highlightAt:function(n,e,o,t){pl(n,e,o,t).fold(function(t){throw new Error(t)},function(t){ml(n,e,o,t)})},highlightBy:function(n,e,o,t){var r=yl(n,e,o);H(r,t).each(function(t){ml(n,e,o,t)})},isHighlighted:gl,getHighlighted:function(n,t,e){return Fu(n.element(),"."+t.highlightClass).bind(function(t){return n.getSystem().getByDom(t).toOption()})},getFirst:hl,getLast:vl,getPrevious:function(t,n,e){return bl(t,n,0,-1)},getNext:function(t,n,e){return bl(t,n,0,1)},getCandidates:yl}),wl=[hr("highlightClass"),hr("itemClass"),Wu("onHighlight"),Wu("onDehighlight")],Sl=ra({fields:wl,name:"highlighting",apis:xl}),kl=function(t,n,e){var o=X(t.slice(0,n)),r=X(t.slice(n+1));return H(o.concat(r),e)},Cl=function(t,n,e){var o=X(t.slice(0,n));return H(o,e)},Ol=function(t,n,e){var o=t.slice(0,n),r=t.slice(n+1);return H(r.concat(o),e)},El=function(t,n,e){var o=t.slice(n+1);return H(o,e)},Tl=function(e){return function(t){var n=t.raw();return T(e,n.which)}},Bl=function(t){return function(n){return W(t,function(t){return t(n)})}},Al=function(t){return!0===t.raw().shiftKey},Dl=function(t){return!0===t.raw().ctrlKey},_l=S(Al),Ml=function(t,n){return{matches:t,classification:n}},Fl=function(t,n){return H(t,function(t){return t.matches(n)}).map(function(t){return t.classification})},Il=function(t){t.dom().focus()},Vl=function(t){var n=t!==undefined?t.dom():x.document;return et.from(n.activeElement).map(Zn.fromDom)},Rl=function(n){return Vl(ve(n)).filter(function(t){return n.dom().contains(t.dom())})},Hl=function(t,n,e){n.exists(function(n){return e.exists(function(t){return he(t,n)})})||Ur(t,Xn(),{prevFocus:n,newFocus:e})},Nl=function(){var r=function(t){return Rl(t.element())};return{get:r,set:function(t,n){var e=r(t);t.getSystem().triggerFocus(n,t.element());var o=r(t);Hl(t,e,o)}}},Pl=function(){var r=function(t){return Sl.getHighlighted(t).map(function(t){return t.element()})};return{get:r,set:function(n,t){var e=r(n);n.getSystem().getByDom(t).fold(tt,function(t){Sl.highlight(n,t)});var o=r(n);Hl(n,e,o)}}};(nl=tl||(tl={})).OnFocusMode="onFocus",nl.OnEnterOrSpaceMode="onEnterOrSpace",nl.OnApiMode="onApi";var zl,Ll=function(t,n,e,o,a){var c=function(n,e,t,o,r){var i=t(n,e,o,r);return Fl(i,e.event()).bind(function(t){return t(n,e,o,r)})},r={schema:function(){return t.concat([Dr("focusManager",Nl()),_r("focusInside","onFocus",nr(function(t){return T(["onFocus","onEnterOrSpace","onApi"],t)?vt.value(t):vt.error("Invalid value for focusInside")})),qu("handler",r),qu("state",n),qu("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var t=i.focusInside!==tl.OnFocusMode?et.none():a(i).map(function(e){return ai(An(),function(t,n){e(t,i,u),n.stop()})});return oi(t.toArray().concat([ai(Yt(),function(o,r){c(o,r,e,i,u).fold(function(){var n,e,t;n=o,e=r,t=Tl([32].concat([13]))(e.event()),i.focusInside===tl.OnEnterOrSpaceMode&&t&&Pr(n,e)&&a(i).each(function(t){t(n,i,u),e.stop()})},function(t){r.stop()})}),ai(qt(),function(t,n){c(t,n,o,i,u).each(function(t){n.stop()})})]))}};return r},jl=function(t){var n=[Cr("onEscape"),Cr("onEnter"),Dr("selector",'[data-alloy-tabstop="true"]'),Dr("firstTabstop",0),Dr("useTabstopAt",nt(!0)),Cr("visibilitySelector")].concat([t]),u=function(t,n){var e=t.visibilitySelector.bind(function(t){return Iu(n,t)}).getOr(n);return 0<ka(e)},e=function(n,e){var t,o,r,i;(t=n,o=e,r=Gc(t.element(),o.selector),i=V(r,function(t){return u(o,t)}),et.from(i[o.firstTabstop])).each(function(t){e.focusManager.set(n,t)})},a=function(n,t,e,o,r){return r(t,e,function(t){return u(n=o,e=t)&&n.useTabstopAt(e);var n,e}).fold(function(){return o.cyclic?et.some(!0):et.none()},function(t){return o.focusManager.set(n,t),et.some(!0)})},i=function(n,t,e,o){var r,i,u=Gc(n.element(),e.selector);return(r=n,i=e,i.focusManager.get(r).bind(function(t){return Iu(t,i.selector)})).bind(function(t){return N(u,w(he,t)).bind(function(t){return a(n,u,t,e,o)})})},o=nt([Ml(Bl([Al,Tl([9])]),function(t,n,e,o){var r=e.cyclic?kl:Cl;return i(t,0,e,r)}),Ml(Tl([9]),function(t,n,e,o){var r=e.cyclic?Ol:El;return i(t,0,e,r)}),Ml(Tl([27]),function(n,e,t,o){return t.onEscape.bind(function(t){return t(n,e)})}),Ml(Bl([_l,Tl([13])]),function(n,e,t,o){return t.onEnter.bind(function(t){return t(n,e)})})]),r=nt([]);return Ll(n,Ni.init,o,r,function(){return et.some(e)})},Ul=jl(Nr("cyclic",nt(!1))),Wl=jl(Nr("cyclic",nt(!0))),Gl=function(t,n,e){return ul(e)&&Tl([32])(n.event())?et.none():(Gr(t,e,Fn()),et.some(!0))},Xl=function(t,n){return et.some(!0)},Yl=[Dr("execute",Gl),Dr("useSpace",!1),Dr("useEnter",!0),Dr("useControlEnter",!1),Dr("useDown",!1)],ql=function(t,n,e){return e.execute(t,n,t.element())},Kl=Ll(Yl,Ni.init,function(t,n,e,o){var r=e.useSpace&&!ul(t.element())?[32]:[],i=e.useEnter?[13]:[],u=e.useDown?[40]:[],a=r.concat(i).concat(u);return[Ml(Tl(a),ql)].concat(e.useControlEnter?[Ml(Bl([Dl,Tl([13])]),ql)]:[])},function(t,n,e,o){return e.useSpace&&!ul(t.element())?[Ml(Tl([32]),Xl)]:[]},function(){return et.none()}),Jl=function(t){var e=_t(et.none());return Pi({readState:function(){return e.get().map(function(t){return{numRows:t.numRows(),numColumns:t.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,n){e.set(et.some({numRows:nt(t),numColumns:nt(n)}))},getNumRows:function(){return e.get().map(function(t){return t.numRows()})},getNumColumns:function(){return e.get().map(function(t){return t.numColumns()})}})},$l=/* */Object.freeze({flatgrid:Jl,init:function(t){return t.state(t)}}),Ql=function(i){return function(t,n,e,o){var r=i(t.element());return ed(r,t,n,e,o)}},Zl=function(t,n){var e=Tc(t,n);return Ql(e)},td=function(t,n){var e=Tc(n,t);return Ql(e)},nd=function(r){return function(t,n,e,o){return ed(r,t,n,e,o)}},ed=function(n,e,t,o,r){return o.focusManager.get(e).bind(function(t){return n(e.element(),t,o,r)}).map(function(t){return o.focusManager.set(e,t),!0})},od=nd,rd=nd,id=nd,ud=function(t){var n,e=t.dom();return!((n=e).offsetWidth<=0&&n.offsetHeight<=0)},ad=oe(["index","candidates"],[]),cd=function(t,n,e){return sd(t,n,e,ud)},sd=function(t,n,e,o){var r,i=w(he,n),u=Gc(t,e),a=V(u,ud);return N(r=a,i).map(function(t){return ad({index:t,candidates:r})})},fd=function(t,n){return N(t,function(t){return he(n,t)})},ld=function(e,t,o,n){return n(Math.floor(t/o),t%o).bind(function(t){var n=t.row()*o+t.column();return 0<=n&&n<e.length?et.some(e[n]):et.none()})},dd=function(r,t,i,u,a){return ld(r,t,u,function(t,n){var e=t===i-1?r.length-t*u:u,o=fl(n,a,0,e-1);return et.some({row:nt(t),column:nt(o)})})},md=function(i,t,u,a,c){return ld(i,t,a,function(t,n){var e=fl(t,c,0,u-1),o=e===u-1?i.length-e*a:a,r=ll(n,0,o-1);return et.some({row:nt(e),column:nt(r)})})},gd=[hr("selector"),Dr("execute",Gl),Gu("onEscape"),Dr("captureTab",!1),Ju()],pd=function(n,e,t){Fu(n.element(),e.selector).each(function(t){e.focusManager.set(n,t)})},hd=function(r){return function(t,n,e,o){return cd(t,n,e.selector).bind(function(t){return r(t.candidates(),t.index(),o.getNumRows().getOr(e.initSize.numRows),o.getNumColumns().getOr(e.initSize.numColumns))})}},vd=function(t,n,e,o){return e.captureTab?et.some(!0):et.none()},bd=hd(function(t,n,e,o){return dd(t,n,e,o,-1)}),yd=hd(function(t,n,e,o){return dd(t,n,e,o,1)}),xd=hd(function(t,n,e,o){return md(t,n,e,o,-1)}),wd=hd(function(t,n,e,o){return md(t,n,e,o,1)}),Sd=nt([Ml(Tl([37]),Zl(bd,yd)),Ml(Tl([39]),td(bd,yd)),Ml(Tl([38]),od(xd)),Ml(Tl([40]),rd(wd)),Ml(Bl([Al,Tl([9])]),vd),Ml(Bl([_l,Tl([9])]),vd),Ml(Tl([27]),function(t,n,e,o){return e.onEscape(t,n)}),Ml(Tl([32].concat([13])),function(n,e,o,t){return(r=n,i=o,i.focusManager.get(r).bind(function(t){return Iu(t,i.selector)})).bind(function(t){return o.execute(n,e,t)});var r,i})]),kd=nt([Ml(Tl([32]),Xl)]),Cd=Ll(gd,Jl,Sd,kd,function(){return et.some(pd)}),Od=function(t,n,e,i){var u=function(t,n,e){var o,r=fl(n,i,0,e.length-1);return r===t?et.none():(o=e[r],"button"===Fe(o)&&"disabled"===Le(o,"disabled")?u(t,r,e):et.from(e[r]))};return cd(t,e,n).bind(function(t){var n=t.index(),e=t.candidates();return u(n,n,e)})},Ed=[hr("selector"),Dr("getInitial",et.none),Dr("execute",Gl),Gu("onEscape"),Dr("executeOnMove",!1),Dr("allowVertical",!0)],Td=function(n,e,o){return(t=n,r=o,r.focusManager.get(t).bind(function(t){return Iu(t,r.selector)})).bind(function(t){return o.execute(n,e,t)});var t,r},Bd=function(n,e){e.getInitial(n).orThunk(function(){return Fu(n.element(),e.selector)}).each(function(t){e.focusManager.set(n,t)})},Ad=function(t,n,e){return Od(t,e.selector,n,-1)},Dd=function(t,n,e){return Od(t,e.selector,n,1)},_d=function(o){return function(t,n,e){return o(t,n,e).bind(function(){return e.executeOnMove?Td(t,n,e):et.some(!0)})}},Md=function(t,n,e,o){return e.onEscape(t,n)},Fd=nt([Ml(Tl([32]),Xl)]),Id=Ll(Ed,Ni.init,function(t,n,e,o){var r=[37].concat(e.allowVertical?[38]:[]),i=[39].concat(e.allowVertical?[40]:[]);return[Ml(Tl(r),_d(Zl(Ad,Dd))),Ml(Tl(i),_d(td(Ad,Dd))),Ml(Tl([13]),Td),Ml(Tl([32]),Td),Ml(Tl([27]),Md)]},Fd,function(){return et.some(Bd)}),Vd=oe(["rowIndex","columnIndex","cell"],[]),Rd=function(t,n,e){return et.from(t[n]).bind(function(t){return et.from(t[e]).map(function(t){return Vd({rowIndex:n,columnIndex:e,cell:t})})})},Hd=function(t,n,e,o){var r=t[n].length,i=fl(e,o,0,r-1);return Rd(t,n,i)},Nd=function(t,n,e,o){var r=fl(e,o,0,t.length-1),i=t[r].length,u=ll(n,0,i-1);return Rd(t,r,u)},Pd=function(t,n,e,o){var r=t[n].length,i=ll(e+o,0,r-1);return Rd(t,n,i)},zd=function(t,n,e,o){var r=ll(e+o,0,t.length-1),i=t[r].length,u=ll(n,0,i-1);return Rd(t,r,u)},Ld=[wr("selectors",[hr("row"),hr("cell")]),Dr("cycles",!0),Dr("previousSelector",et.none),Dr("execute",Gl)],jd=function(n,e){e.previousSelector(n).orThunk(function(){var t=e.selectors;return Fu(n.element(),t.cell)}).each(function(t){e.focusManager.set(n,t)})},Ud=function(t,n){return function(e,o,i){var u=i.cycles?t:n;return Iu(o,i.selectors.row).bind(function(t){var n=Gc(t,i.selectors.cell);return fd(n,o).bind(function(o){var r=Gc(e,i.selectors.row);return fd(r,t).bind(function(t){var n,e=(n=i,_(r,function(t){return Gc(t,n.selectors.cell)}));return u(e,t,o).map(function(t){return t.cell()})})})})}},Wd=Ud(function(t,n,e){return Hd(t,n,e,-1)},function(t,n,e){return Pd(t,n,e,-1)}),Gd=Ud(function(t,n,e){return Hd(t,n,e,1)},function(t,n,e){return Pd(t,n,e,1)}),Xd=Ud(function(t,n,e){return Nd(t,e,n,-1)},function(t,n,e){return zd(t,e,n,-1)}),Yd=Ud(function(t,n,e){return Nd(t,e,n,1)},function(t,n,e){return zd(t,e,n,1)}),qd=nt([Ml(Tl([37]),Zl(Wd,Gd)),Ml(Tl([39]),td(Wd,Gd)),Ml(Tl([38]),od(Xd)),Ml(Tl([40]),rd(Yd)),Ml(Tl([32].concat([13])),function(n,e,o){return Rl(n.element()).bind(function(t){return o.execute(n,e,t)})})]),Kd=nt([Ml(Tl([32]),Xl)]),Jd=Ll(Ld,Ni.init,qd,Kd,function(){return et.some(jd)}),$d=[hr("selector"),Dr("execute",Gl),Dr("moveOnTab",!1)],Qd=function(n,e,o){return o.focusManager.get(n).bind(function(t){return o.execute(n,e,t)})},Zd=function(n,e){Fu(n.element(),e.selector).each(function(t){e.focusManager.set(n,t)})},tm=function(t,n,e){return Od(t,e.selector,n,-1)},nm=function(t,n,e){return Od(t,e.selector,n,1)},em=nt([Ml(Tl([38]),id(tm)),Ml(Tl([40]),id(nm)),Ml(Bl([Al,Tl([9])]),function(t,n,e){return e.moveOnTab?id(tm)(t,n,e):et.none()}),Ml(Bl([_l,Tl([9])]),function(t,n,e){return e.moveOnTab?id(nm)(t,n,e):et.none()}),Ml(Tl([13]),Qd),Ml(Tl([32]),Qd)]),om=nt([Ml(Tl([32]),Xl)]),rm=Ll($d,Ni.init,em,om,function(){return et.some(Zd)}),im=[Gu("onSpace"),Gu("onEnter"),Gu("onShiftEnter"),Gu("onLeft"),Gu("onRight"),Gu("onTab"),Gu("onShiftTab"),Gu("onUp"),Gu("onDown"),Gu("onEscape"),Dr("stopSpaceKeyup",!1),Cr("focusIn")],um=Ll(im,Ni.init,function(t,n,e){return[Ml(Tl([32]),e.onSpace),Ml(Bl([_l,Tl([13])]),e.onEnter),Ml(Bl([Al,Tl([13])]),e.onShiftEnter),Ml(Bl([Al,Tl([9])]),e.onShiftTab),Ml(Bl([_l,Tl([9])]),e.onTab),Ml(Tl([38]),e.onUp),Ml(Tl([40]),e.onDown),Ml(Tl([37]),e.onLeft),Ml(Tl([39]),e.onRight),Ml(Tl([32]),e.onSpace),Ml(Tl([27]),e.onEscape)]},function(t,n,e){return e.stopSpaceKeyup?[Ml(Tl([32]),Xl)]:[]},function(t){return t.focusIn}),am=Ul.schema(),cm=Wl.schema(),sm=Id.schema(),fm=Cd.schema(),lm=Jd.schema(),dm=Kl.schema(),mm=rm.schema(),gm=um.schema(),pm=ua({branchKey:"mode",branches:/* */Object.freeze({acyclic:am,cyclic:cm,flow:sm,flatgrid:fm,matrix:lm,execution:dm,menu:mm,special:gm}),name:"keying",active:{events:function(t,n){return t.handler.toEvents(t,n)}},apis:{focusIn:function(n,e,o){e.sendFocusIn(e).fold(function(){n.getSystem().triggerFocus(n.element(),n.element())},function(t){t(n,e,o)})},setGridSize:function(t,n,e,o,r){Dt(e,"setGridSize")?e.setGridSize(o,r):x.console.error("Layout does not support setGridSize")}},state:$l}),hm=function(t,n,e,o){var r=t.getSystem().build(o);Bs(t,r,e)},vm=function(t,n,e,o){var r=bm(t,n);H(r,function(t){return he(o.element(),t.element())}).each(Ds)},bm=function(t,n){return t.components()},ym=function(n,e,t,r,o){var i=bm(n,e);return et.from(i[r]).map(function(t){return vm(n,e,0,t),o.each(function(t){hm(n,0,function(t,n){var e,o;o=n,ke(e=t,r).fold(function(){Te(e,o)},function(t){Ce(t,o)})},t)}),t})},xm=ra({fields:[],name:"replacing",apis:/* */Object.freeze({append:function(t,n,e,o){hm(t,0,Te,o)},prepend:function(t,n,e,o){hm(t,0,Ee,o)},remove:vm,replaceAt:ym,replaceBy:function(n,e,t,o,r){var i=bm(n,e);return N(i,o).bind(function(t){return ym(n,e,0,t,r)})},set:function(n,t,e,o){var r,i,u,a;_s(n),r=function(){var t=_(o,n.getSystem().build);M(t,function(t){Ts(n,t)})},i=n.element(),u=ve(i),a=Vl(u).bind(function(n){var t=function(t){return he(n,t)};return t(i)?et.some(i):ni(i,t)}),r(i),a.each(function(n){Vl(u).filter(function(t){return he(t,n)}).fold(function(){Il(n)},tt)})},contents:bm})}),wm=function(t,n,e){n.store.manager.onLoad(t,n,e)},Sm=function(t,n,e){n.store.manager.onUnload(t,n,e)},km=/* */Object.freeze({onLoad:wm,onUnload:Sm,setValue:function(t,n,e,o){n.store.manager.setValue(t,n,e,o)},getValue:function(t,n,e){return n.store.manager.getValue(t,n,e)},getState:function(t,n,e){return e}}),Cm=/* */Object.freeze({events:function(e,o){var t=e.resetOnDom?[hi(function(t,n){wm(t,e,o)}),vi(function(t,n){Sm(t,e,o)})]:[$u(e,o,wm)];return oi(t)}}),Om=function(){var t=_t(null);return Pi({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})},Em=function(){var i=_t({}),u=_t({});return Pi({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(t){return Et(i.get(),t).orThunk(function(){return Et(u.get(),t)})},update:function(t){var n=i.get(),e=u.get(),o={},r={};M(t,function(n){o[n.value]=n,Et(n,"meta").each(function(t){Et(t,"text").each(function(t){r[t]=n})})}),i.set(io({},n,o)),u.set(io({},e,r))},clear:function(){i.set({}),u.set({})}})},Tm=/* */Object.freeze({memory:Om,dataset:Em,manual:function(){return Pi({readState:function(){}})},init:function(t){return t.store.manager.state(t)}}),Bm=function(t,n,e,o){var r=n.store;e.update([o]),r.setValue(t,o),n.onSetValue(t,o)},Am=[Cr("initialValue"),hr("getFallbackEntry"),hr("getDataKey"),hr("setValue"),qu("manager",{setValue:Bm,getValue:function(t,n,e){var o=n.store,r=o.getDataKey(t);return e.lookup(r).fold(function(){return o.getFallbackEntry(r)},function(t){return t})},onLoad:function(n,e,o){e.store.initialValue.each(function(t){Bm(n,e,o,t)})},onUnload:function(t,n,e){e.clear()},state:Em})],Dm=[hr("getValue"),Dr("setValue",tt),Cr("initialValue"),qu("manager",{setValue:function(t,n,e,o){n.store.setValue(t,o),n.onSetValue(t,o)},getValue:function(t,n,e){return n.store.getValue(t)},onLoad:function(n,e,t){e.store.initialValue.each(function(t){e.store.setValue(n,t)})},onUnload:tt,state:Ni.init})],_m=[Cr("initialValue"),qu("manager",{setValue:function(t,n,e,o){e.set(o),n.onSetValue(t,o)},getValue:function(t,n,e){return e.get()},onLoad:function(t,n,e){n.store.initialValue.each(function(t){e.isNotSet()&&e.set(t)})},onUnload:function(t,n,e){e.clear()},state:Om})],Mm=[_r("store",{mode:"memory"},cr("mode",{memory:_m,manual:Dm,dataset:Am})),Wu("onSetValue"),Dr("resetOnDom",!1)],Fm=ra({fields:Mm,name:"representing",active:Cm,apis:km,extra:{setValueFrom:function(t,n){var e=Fm.getValue(n);Fm.setValue(t,e)}},state:Tm}),Im=function(t,n){n.ignore||(Il(t.element()),n.onFocus(t))},Vm=/* */Object.freeze({focus:Im,blur:function(t,n){n.ignore||t.element().dom().blur()},isFocused:function(t){return n=t.element(),e=ve(n).dom(),n.dom()===e.activeElement;var n,e}}),Rm=/* */Object.freeze({exhibit:function(t,n){var e=n.ignore?{}:{attributes:{tabindex:"-1"}};return Li(e)},events:function(e){return oi([ai(An(),function(t,n){Im(t,e),n.stop()})].concat(e.stopMousedown?[ai(zt(),function(t,n){n.event().prevent()})]:[]))}}),Hm=[Wu("onFocus"),Dr("stopMousedown",!1),Dr("ignore",!1)],Nm=ra({fields:Hm,name:"focusing",active:Rm,apis:Vm}),Pm=function(t,n,e){var o=n.aria;o.update(t,o,e.get())},zm=function(n,t,e){t.toggleClass.each(function(t){e.get()?nu(n.element(),t):eu(n.element(),t)})},Lm=function(t,n,e){Wm(t,n,e,!e.get())},jm=function(t,n,e){e.set(!0),zm(t,n,e),Pm(t,n,e)},Um=function(t,n,e){e.set(!1),zm(t,n,e),Pm(t,n,e)},Wm=function(t,n,e,o){(o?jm:Um)(t,n,e)},Gm=function(t,n,e){Wm(t,n,e,n.selected)},Xm=/* */Object.freeze({onLoad:Gm,toggle:Lm,isOn:function(t,n,e){return e.get()},on:jm,off:Um,set:Wm}),Ym=/* */Object.freeze({exhibit:function(t,n,e){return Li({})},events:function(t,n){var e,o,r,i=(e=t,o=n,r=Lm,yi(function(t){r(t,e,o)})),u=$u(t,n,Gm);return oi(L([t.toggleOnExecute?[i]:[],[u]]))}}),qm=function(t,n,e){ze(t.element(),"aria-expanded",e)},Km=[Dr("selected",!1),Cr("toggleClass"),Dr("toggleOnExecute",!0),_r("aria",{mode:"none"},cr("mode",{pressed:[Dr("syncWithExpanded",!1),qu("update",function(t,n,e){ze(t.element(),"aria-pressed",e),n.syncWithExpanded&&qm(t,n,e)})],checked:[qu("update",function(t,n,e){ze(t.element(),"aria-checked",e)})],expanded:[qu("update",qm)],selected:[qu("update",function(t,n,e){ze(t.element(),"aria-selected",e)})],none:[qu("update",tt)]}))],Jm=ra({fields:Km,name:"toggling",active:Ym,apis:Xm,state:(zl=!1,{init:function(){var n=_t(zl);return{get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(zl)},readState:function(){return n.get()}}}})}),$m="alloy.item-hover",Qm="alloy.item-focus",Zm=function(t){(Rl(t.element()).isNone()||Nm.isFocused(t))&&(Nm.isFocused(t)||Nm.focus(t),Ur(t,$m,{item:t}))},tg=function(t){Ur(t,Qm,{item:t})},ng=nt($m),eg=nt(Qm),og=function(t,n){var e,o;return{key:t,value:{config:{},me:(e=t,o=oi(n),ra({fields:[hr("enabled")],name:e,active:{events:nt(o)}})),configAsRaw:nt({}),initialConfig:{},state:Ni}}},rg=[hr("data"),hr("components"),hr("dom"),Dr("hasSubmenu",!1),Cr("toggling"),Qs.field("itemBehaviours",[Jm,Nm,pm,Fm]),Dr("ignoreFocus",!1),Dr("domModification",{}),qu("builder",function(t){return{dom:t.dom,domModification:io({},t.domModification,{attributes:io({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes,{"aria-haspopup":t.hasSubmenu},t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Qs.augment(t.itemBehaviours,[t.toggling.fold(Jm.revoke,function(t){return Jm.config(io({aria:{mode:"checked"}},t))}),Nm.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){tg(t)}}),pm.config({mode:"execution"}),Fm.config({store:{mode:"memory",initialValue:t.data}}),og("item-type-events",[ai(Rn(),Wr),mi(zt()),ai(Wt(),Zm),ai(In(),Nm.focus)])]),components:t.components,eventOrder:t.eventOrder}}),Dr("eventOrder",{})],ig=[hr("dom"),hr("components"),qu("builder",function(t){return{dom:t.dom,components:t.components,events:oi([gi(In())])}})],ug=nt([Tf({name:"widget",overrides:function(n){return{behaviours:ea([Fm.config({store:{mode:"manual",getValue:function(t){return n.data},setValue:function(){}}})])}}})]),ag=[hr("uid"),hr("data"),hr("components"),hr("dom"),Dr("autofocus",!1),Dr("ignoreFocus",!1),Qs.field("widgetBehaviours",[Fm,Nm,pm]),Dr("domModification",{}),qf(ug()),qu("builder",function(e){var t=Pf(0,e,ug()),n=zf("item-widget",e,t.internals()),o=function(t){return Lf(t,e,"widget").map(function(t){return pm.focusIn(t),t})},r=function(t,n){return ul(n.event().target())||e.autofocus&&n.setSource(t.element()),et.none()};return{dom:e.dom,components:n,domModification:e.domModification,events:oi([yi(function(t,n){o(t).each(function(t){n.stop()})}),ai(Wt(),Zm),ai(In(),function(t,n){e.autofocus?o(t):Nm.focus(t)})]),behaviours:Qs.augment(e.widgetBehaviours,[Fm.config({store:{mode:"memory",initialValue:e.data}}),Nm.config({ignore:e.ignoreFocus,onFocus:function(t){tg(t)}}),pm.config({mode:"special",focusIn:e.autofocus?function(t){o(t)}:aa(),onLeft:r,onRight:r,onEscape:function(t,n){return Nm.isFocused(t)||e.autofocus?(e.autofocus&&n.setSource(t.element()),et.none()):(Nm.focus(t),et.some(!0))}})])}})],cg=cr("type",{widget:ag,item:rg,separator:ig}),sg=nt([Df({factory:{sketch:function(t){var n=ur("menu.spec item",cg,t);return n.builder(n)}},name:"items",unit:"item",defaults:function(t,n){return n.hasOwnProperty("uid")?n:io({},n,{uid:Bi("item")})},overrides:function(t,n){return{type:n.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),fg=nt([hr("value"),hr("items"),hr("dom"),hr("components"),Dr("eventOrder",{}),Ks("menuBehaviours",[Sl,Fm,sl,pm]),_r("movement",{mode:"menu",moveOnTab:!0},cr("mode",{grid:[Ju(),qu("config",function(t,n){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:n.initSize.numColumns,numRows:n.initSize.numRows},focusManager:t.focusManager}})],matrix:[qu("config",function(t,n){return{mode:"matrix",selectors:{row:n.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}}),hr("rowSelector")],menu:[Dr("moveOnTab",!0),qu("config",function(t,n){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:n.moveOnTab,focusManager:t.focusManager}})]})),vr("markers",Pu()),Dr("fakeFocus",!1),Dr("focusManager",Nl()),Wu("onHighlight")]),lg=nt("alloy.menu-focus"),dg=il({name:"Menu",configFields:fg(),partFields:sg(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:$s(t.menuBehaviours,[Sl.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),Fm.config({store:{mode:"memory",initialValue:t.value}}),sl.config({find:et.some}),pm.config(t.movement.config(t,t.movement))]),events:oi([ai(eg(),function(n,e){var t=e.event();n.getSystem().getByDom(t.target()).each(function(t){Sl.highlight(n,t),e.stop(),Ur(n,lg(),{menu:n,item:t})})}),ai(ng(),function(t,n){var e=n.event().item();Sl.highlight(t,e)})]),components:n,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),mg=function(e,o,r,t){return Et(r,t).bind(function(t){return Et(e,t).bind(function(t){var n=mg(e,o,r,t);return et.some([t].concat(n))})}).getOr([])},gg=function(t,n){var e={};rt(t,function(t,n){M(t,function(t){e[t]=n})});var o=n,r=ut(n,function(t,n){return{k:t,v:n}}),i=it(r,function(t,n){return[n].concat(mg(e,o,r,n))});return it(e,function(t){return Et(i,t).getOr([t])})},pg=function(){var i=_t({}),u=_t({}),a=_t({}),c=_t(et.none()),s=_t({}),n=function(t){return Et(u.get(),t)};return{setMenuBuilt:function(t,n){var e;u.set(io({},u.get(),((e={})[t]={type:"prepared",menu:n},e)))},setContents:function(t,n,e,o){c.set(et.some(t)),i.set(e),u.set(n),s.set(o);var r=gg(o,e);a.set(r)},expand:function(e){return Et(i.get(),e).map(function(t){var n=Et(a.get(),e).getOr([]);return[t].concat(n)})},refresh:function(t){return Et(a.get(),t)},collapse:function(t){return Et(a.get(),t).bind(function(t){return 1<t.length?et.some(t.slice(1)):et.none()})},lookupMenu:n,otherMenus:function(t){var n=s.get();return Y(Z(n),t)},getPrimary:function(){return c.get().bind(function(t){return n(t).bind(function(t){return"prepared"===t.type?et.some(t.menu):et.none()})})},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),a.set({}),c.set(et.none())},isClear:function(){return c.get().isNone()}}},hg=nt("collapse-item"),vg=rl({name:"TieredMenu",configFields:[Yu("onExecute"),Yu("onEscape"),Xu("onOpenMenu"),Xu("onOpenSubmenu"),Wu("onCollapseMenu"),Dr("highlightImmediately",!0),wr("data",[hr("primary"),hr("menus"),hr("expansions")]),Dr("fakeFocus",!1),Wu("onHighlight"),Wu("onHover"),Lu(),hr("dom"),Dr("navigateOnHover",!0),Dr("stayInDom",!1),Ks("tmenuBehaviours",[pm,Sl,sl,xm]),Dr("eventOrder",{})],apis:{collapseMenu:function(t,n){t.collapseMenu(n)},highlightPrimary:function(t,n){t.highlightPrimary(n)}},factory:function(a,t){var c,n,i=_t(et.none()),s=pg(),e=function(t){var o,r,n,e=(o=t,r=a.data.primary,n=a.data.menus,it(n,function(t,n){var e=function(){return dg.sketch(io({dom:t.dom},t,{value:n,items:t.items,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:a.fakeFocus?Pl():Nl()}))};return n===r?{type:"prepared",menu:o.getSystem().build(e())}:{type:"notbuilt",nbMenu:e}})),i=u(t);return s.setContents(a.data.primary,e,a.data.expansions,i),s.getPrimary()},f=function(t){return Fm.getValue(t).value},u=function(t){return it(a.data.menus,function(t,n){return j(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})})},l=function(n,t){Sl.highlight(n,t),Sl.getHighlighted(t).orThunk(function(){return Sl.getFirst(t)}).each(function(t){Gr(n,t.element(),In())})},d=function(n,t){return Mt(_(t,function(t){return n.lookupMenu(t).bind(function(t){return"prepared"===t.type?et.some(t.menu):et.none()})}))},m=function(n,t,e){var o=d(t,t.otherMenus(e));M(o,function(t){iu(t.element(),[a.markers.backgroundMenu]),a.stayInDom||xm.remove(n,t)})},g=function(t,o){var r,n=(r=t,i.get().getOrThunk(function(){var e={},t=Gc(r.element(),"."+a.markers.item),n=V(t,function(t){return"true"===Le(t,"aria-haspopup")});return M(n,function(t){r.getSystem().getByDom(t).each(function(t){var n=f(t);e[n]=t})}),i.set(et.some(e)),e}));rt(n,function(t,n){var e=T(o,n);ze(t.element(),"aria-expanded",e)})},p=function(o,r,i){return et.from(i[0]).bind(function(t){return r.lookupMenu(t).bind(function(t){if("notbuilt"===t.type)return et.none();var n=t.menu,e=d(r,i.slice(1));return M(e,function(t){nu(t.element(),a.markers.backgroundMenu)}),Jr(n.element())||xm.append(o,Du(n)),iu(n.element(),[a.markers.backgroundMenu]),l(o,n),m(o,r,i),et.some(n)})})};(n=c||(c={}))[n.HighlightSubmenu=0]="HighlightSubmenu",n[n.HighlightParent=1]="HighlightParent";var h=function(r,i,u){void 0===u&&(u=c.HighlightSubmenu);var t=f(i);return s.expand(t).bind(function(o){return g(r,o),et.from(o[0]).bind(function(e){return s.lookupMenu(e).bind(function(t){var n=function(t,n,e){if("notbuilt"!==e.type)return e.menu;var o=t.getSystem().build(e.nbMenu());return s.setMenuBuilt(n,o),o}(r,e,t);return Jr(n.element())||xm.append(r,Du(n)),a.onOpenSubmenu(r,i,n),u===c.HighlightSubmenu?(Sl.highlightFirst(n),p(r,s,o)):(Sl.dehighlightAll(n),et.some(i))})})})},o=function(n,e){var t=f(e);return s.collapse(t).bind(function(t){return g(n,t),p(n,s,t).map(function(t){return a.onCollapseMenu(n,e,t),t})})},r=function(e){return function(n,t){return Iu(t.getSource(),"."+a.markers.item).bind(function(t){return n.getSystem().getByDom(t).toOption().bind(function(t){return e(n,t).map(function(){return!0})})})}},v=oi([ai(lg(),function(n,t){var e=t.event().menu();Sl.highlight(n,e);var o=f(t.event().item());s.refresh(o).each(function(t){return m(n,s,t)})}),yi(function(n,t){var e=t.event().target();n.getSystem().getByDom(e).each(function(t){0===f(t).indexOf("collapse-item")&&o(n,t),h(n,t,c.HighlightSubmenu).fold(function(){a.onExecute(n,t)},function(){})})}),hi(function(n,t){e(n).each(function(t){xm.append(n,Du(t)),a.onOpenMenu(n,t),a.highlightImmediately&&l(n,t)})})].concat(a.navigateOnHover?[ai(ng(),function(t,n){var e,o,r=n.event().item();e=t,o=f(r),s.refresh(o).bind(function(t){return g(e,t),p(e,s,t)}),h(t,r,c.HighlightParent),a.onHover(t,r)})]:[])),b={collapseMenu:function(n){Sl.getHighlighted(n).each(function(t){Sl.getHighlighted(t).each(function(t){o(n,t)})})},highlightPrimary:function(n){s.getPrimary().each(function(t){l(n,t)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:$s(a.tmenuBehaviours,[pm.config({mode:"special",onRight:r(function(t,n){return ul(n.element())?et.none():h(t,n,c.HighlightSubmenu)}),onLeft:r(function(t,n){return ul(n.element())?et.none():o(t,n)}),onEscape:r(function(t,n){return o(t,n).orThunk(function(){return a.onEscape(t,n).map(function(){return t})})}),focusIn:function(n,t){s.getPrimary().each(function(t){Gr(n,t.element(),In())})}}),Sl.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),sl.config({find:function(t){return Sl.getHighlighted(t)}}),xm.config({})]),eventOrder:a.eventOrder,apis:b,events:v}},extraApis:{tieredData:function(t,n,e){return{primary:t,menus:n,expansions:e}},singleData:function(t,n){return{primary:t,menus:Tt(t,n),expansions:{}}},collapseItem:function(t){return{value:oo(hg()),meta:{text:t}}}}}),bg=rl({name:"InlineView",configFields:[hr("lazySink"),Wu("onShow"),Wu("onHide"),Br("onEscape"),Ks("inlineBehaviours",[Us,fa]),Ar("fireDismissalEventInstead",[Dr("event",Gn())]),Dr("getRelated",et.none),Dr("eventOrder",et.none)],factory:function(s,t){var r=function(t,n,e,o){var r=s.lazySink(t).getOrDie();Us.openWhileCloaked(t,e,function(){return Cs.positionWithin(r,n,t,o)}),s.onShow(t)},n={setContent:function(t,n){Us.open(t,n)},showAt:function(t,n,e){var o=et.none();r(t,n,e,o)},showWithin:r,showMenuAt:function(t,n,e){var o,r,i,u,a,c=(o=s,r=t,i=n,u=e,a=function(){return o.lazySink(r)},vg.sketch({dom:{tag:"div"},data:u.data,markers:u.menu.markers,onEscape:function(){return Us.close(r),o.onEscape.map(function(t){return t(r)}),et.some(!0)},onExecute:function(){return et.some(!0)},onOpenMenu:function(t,n){Cs.position(a().getOrDie(),i,n)},onOpenSubmenu:function(t,n,e){var o=a().getOrDie();Cs.position(o,{anchor:"submenu",item:n},e)}}));Us.open(t,c),s.onShow(t)},hide:function(t){Us.close(t),s.onHide(t)},getContent:function(t){return Us.getState(t)},isOpen:Us.isOpen};return{uid:s.uid,dom:s.dom,behaviours:$s(s.inlineBehaviours,[Us.config({isPartOf:function(t,n,e){return Ru(n,e)||(o=t,r=e,s.getRelated(o).exists(function(t){return Ru(t,r)}));var o,r},getAttachPoint:function(t){return s.lazySink(t).getOrDie()}}),Ys(io({isExtraPart:nt(!1)},s.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))]),eventOrder:s.eventOrder,apis:n}},apis:{showAt:function(t,n,e,o){t.showAt(n,e,o)},showWithin:function(t,n,e,o,r){t.showWithin(n,e,o,r)},showMenuAt:function(t,n,e,o){t.showMenuAt(n,e,o)},hide:function(t,n){t.hide(n)},isOpen:function(t,n){return t.isOpen(n)},getContent:function(t,n){return t.getContent(n)},setContent:function(t,n,e){t.setContent(n,e)}}}),yg=function(t){var n=function(t,n){n.stop(),Wr(t)},e=Tn.detect().deviceType.isTouch()?[ai(Vn(),n)]:[ai($t(),n),ai(zt(),function(t,n){n.cut()})];return oi(L([t.map(function(e){return ai(Fn(),function(t,n){e(t),n.stop()})}).toArray(),e]))},xg=rl({name:"Button",factory:function(t){var n=yg(t.action),e=t.dom.tag,o=function(n){return Et(t.dom,"attributes").bind(function(t){return Et(t,n)})};return{uid:t.uid,dom:t.dom,components:t.components,events:n,behaviours:Qs.augment(t.buttonBehaviours,[Nm.config({}),pm.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==e)return{role:o("role").getOr("button")};var t=o("type").getOr("button"),n=o("role").map(function(t){return{role:t}}).getOr({});return io({type:t},n)}()},eventOrder:t.eventOrder}},configFields:[Dr("uid",undefined),hr("dom"),Dr("components",[]),Qs.field("buttonBehaviours",[Nm,pm]),Cr("action"),Cr("role"),Dr("eventOrder",{})]}),wg=function(t){var n=Zf(t)&&Dt(t,"uid")?t.uid:Bi("memento");return{get:function(t){return t.getSystem().getByUid(n).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(n).fold(et.none,et.some)},asSpec:function(){return io({},t,{uid:n})}}},Sg=function(t){return et.from(t()["temporary-placeholder"]).getOr("!not found!")},kg=function(t,n){return et.from(n()[t]).getOrThunk(function(){return Sg(n)})},Cg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Og=rl({name:"Notification",factory:function(n){var t,e,o=wg({dom:{tag:"p",innerHtml:n.translationProvider(n.text)},behaviours:ea([xm.config({})])}),r=function(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}},i=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}},u=wg({dom:{tag:"div",classes:n.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[r(0)]},i(0)],behaviours:ea([xm.config({})])}),a={updateProgress:function(t,n){t.getSystem().isConnected()&&u.getOpt(t).each(function(t){xm.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[r(n)]},i(n)])})},updateText:function(t,n){if(t.getSystem().isConnected()){var e=o.get(t);xm.set(e,[Eu(n)])}}},c=L([n.icon.toArray(),n.level.toArray(),n.level.bind(function(t){return et.from(Cg[t])}).toArray()]);return{uid:n.uid,dom:{tag:"div",attributes:{role:"alert"},classes:n.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]}).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:(t=c,e=n.iconProvider,Ft(t,function(t){return et.from(e()[t])}).getOrThunk(function(){return Sg(e)}))}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[o.asSpec()],behaviours:ea([xm.config({})])}].concat(n.progress?[u.asSpec()]:[]).concat(xg.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:kg("close",n.iconProvider),attributes:{"aria-label":n.translationProvider("Close")}}}],action:function(t){n.onAction(t)}})),apis:a}},configFields:[Cr("level"),hr("progress"),hr("icon"),hr("onAction"),hr("text"),hr("iconProvider"),hr("translationProvider")],apis:{updateProgress:function(t,n,e){t.updateProgress(n,e)},updateText:function(t,n,e){t.updateText(n,e)}}}),Eg=tinymce.util.Tools.resolve("tinymce.util.Delay");function Tg(r,i,u){var a=i.backstage;return{open:function(t,n){var e=function(){n(),bg.hide(r)},o=Au(Og.sketch({text:t.text,level:T(["success","error","warning","info"],t.type)?t.type:undefined,progress:!0===t.progressBar,icon:et.from(t.icon),onAction:e,iconProvider:a.shared.providers.icons,translationProvider:a.shared.providers.translate})),r=Au(bg.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:i.backstage.shared.getSink,fireDismissalEventInstead:{}}));return u.add(r),t.timeout&&Eg.setTimeout(function(){e()},t.timeout),{close:e,moveTo:function(t,n){bg.showAt(r,{anchor:"makeshift",x:t,y:n},Du(o))},moveRel:function(t,n){bg.showAt(r,i.backstage.shared.anchors.banner(),Du(o))},text:function(t){Og.updateText(o,t)},settings:t,getEl:function(){},progressBar:{value:function(t){Og.updateProgress(o,t)}}}},close:function(t){t.close()},reposition:function(t){M(t,function(t){t.moveTo(0,0)}),function(e){if(0<e.length){var t=e.slice(0,1)[0],n=(o=r).inline?o.getElement():o.getContentAreaContainer();t.moveRel(n,"tc-tc"),M(e,function(t,n){0<n&&t.moveRel(e[n-1].getEl(),"bc-tc")})}var o}(t)},getArgs:function(t){return t.settings}}}var Bg,Ag,Dg=function(e,o){var r=null;return{cancel:function(){null!==r&&(x.clearTimeout(r),r=null)},throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];null!==r&&x.clearTimeout(r),r=x.setTimeout(function(){e.apply(null,t),r=null},o)}}},_g=/[\u00a0 \t\r\n]/,Mg=function(e,t,n,o,r){return void 0===r&&(r=0),(i=e).collapsed&&3===i.startContainer.nodeType?function(t,n,e,o){var r;for(r=n-1;0<=r;r--){if(_g.test(t.charAt(r)))return et.none();if(t.charAt(r)===e)break}return-1===r||n-r<o?et.none():et.some(t.substring(r+1,n))}(n,o,t,r).map(function(t){var n=e.cloneRange();return n.setStart(e.startContainer,e.startOffset-t.length-1),n.setEnd(e.startContainer,e.startOffset),{text:t,rng:n}}):et.none();var i},Fg=function(e,t){t.on("keypress",e.onKeypress.throttle),t.on("remove",e.onKeypress.cancel);var o=function(t,n){Ur(t,Yt(),{raw:n})};t.on("keydown",function(n){var t=function(){return e.getView().bind(Sl.getHighlighted)};8===n.which&&e.onKeypress.throttle(n),e.isActive()&&(27===n.which?e.closeIfNecessary():32===n.which?e.closeIfNecessary():13===n.which?(t().each(Wr),n.preventDefault()):40===n.which?(t().fold(function(){e.getView().each(Sl.highlightFirst)},function(t){o(t,n)}),n.preventDefault()):37!==n.which&&38!==n.which&&39!==n.which||t().each(function(t){o(t,n),n.preventDefault()}))})},Ig=tinymce.util.Tools.resolve("tinymce.util.Promise"),Vg=function(t,n){return 0===t.startOffset||/\s/.test(n.charAt(t.startOffset-1))},Rg=function(t,n){var e,o,r,i=n(),u=t.selection.getRng(),a=u.startContainer.nodeValue;return(e=u,o=a,r=i,Ft(r.triggerChars,function(n){return Mg(e,n,o,e.startOffset).map(function(t){return{range:t.rng,text:t.text,triggerChar:n}})})).map(function(e){var t=V(i.lookupByChar(e.triggerChar),function(t){return e.text.length>=t.minChars&&t.matches.getOr(Vg)(e.range,a,e.text)});return{lookupData:Ig.all(_(t,function(n){return n.fetch(e.text,n.maxResults).then(function(t){return{items:t,columns:n.columns,onAction:n.onAction}})})),triggerChar:e.triggerChar,range:e.range}})},Hg=Uo([Nr("type",function(){return"autocompleteitem"}),Nr("active",function(){return!1}),Nr("disabled",function(){return!1}),Dr("meta",{}),br("value"),Tr("text"),Tr("icon")]),Ng=Uo([br("type"),br("ch"),Mr("minChars",1),Dr("columns",1),Mr("maxResults",10),Br("matches"),xr("fetch"),xr("onAction")]),Pg=function(t){var n,e,o=t.ui.registry.getAll().popups,r=it(o,function(t){return(n=t,rr("Autocompleter",Ng,n)).fold(function(t){throw new Error(ar(t))},function(t){return t});var n}),i=(n=at(r,function(t){return t.ch}),e={},M(n,function(t){e[t]={}}),Z(e)),u=st(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return V(u,function(t){return t.ch===n})}}},zg=[Vr("disabled",!1),Tr("text"),Tr("shortcut"),Ko("value","value",go(function(){return oo("menuitem-value")}),sr()),Dr("meta",{})],Lg=Uo([br("type"),Rr("onSetup",function(){return tt}),Rr("onAction",tt),Tr("icon")].concat(zg)),jg=Uo([br("type"),xr("getSubmenuItems"),Rr("onSetup",function(){return tt}),Tr("icon")].concat(zg)),Ug=Uo([br("type"),Vr("active",!1),Rr("onSetup",function(){return tt}),xr("onAction")].concat(zg)),Wg=Uo([br("type"),Vr("active",!1),Tr("icon")].concat(zg)),Gg=Uo([br("type"),Tr("text")]),Xg=Uo([br("type"),yr("fancytype",["inserttable","colorswatch"]),Rr("onAction",tt)]),Yg=function(t,o,n){var r=Gc(t.element(),"."+n);if(0<r.length){var e=N(r,function(t){var n=t.dom().getBoundingClientRect().top,e=r[0].dom().getBoundingClientRect().top;return Math.abs(n-e)>o}).getOr(r.length);return et.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return et.none()},qg=function(t,n){return ea([og(t,n)])},Kg=function(t){return qg(oo("unnamed-events"),t)},Jg=[hr("lazySink"),hr("tooltipDom"),Dr("exclusive",!0),Dr("tooltipComponents",[]),Dr("delay",300),Ir("mode","normal",["normal","follow-highlight"]),Dr("anchor",function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:nt([wc,xc,hc,bc,vc,yc]),onRtl:nt([wc,xc,hc,bc,vc,yc])}}}),Wu("onHide"),Wu("onShow")],$g=/* */Object.freeze({init:function(){var e=_t(et.none()),n=_t(et.none()),o=function(){e.get().each(function(t){x.clearTimeout(t)})},t=nt("not-implemented");return Pi({getTooltip:function(){return n.get()},isShowing:function(){return n.get().isSome()},setTooltip:function(t){n.set(et.some(t))},clearTooltip:function(){n.set(et.none())},clearTimer:o,resetTimer:function(t,n){o(),e.set(et.some(x.setTimeout(function(){t()},n)))},readState:t})}}),Qg=oo("tooltip.exclusive"),Zg=oo("tooltip.show"),tp=oo("tooltip.hide"),np=function(t,n,e){t.getSystem().broadcastOn([Qg],{})},ep=/* */Object.freeze({hideAllExclusive:np,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&xm.set(t,o)})}}),op=ra({fields:Jg,name:"tooltipping",active:/* */Object.freeze({events:function(o,r){var e=function(n){r.getTooltip().each(function(t){Ds(t),o.onHide(n,t),r.clearTooltip()}),r.clearTimer()};return oi(L([[ai(Zg,function(t){r.resetTimer(function(){!function(n){if(!r.isShowing()){np(n);var t=o.lazySink(n).getOrDie(),e=n.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:oi("normal"===o.mode?[ai(Wt(),function(t){jr(n,Zg)}),ai(jt(),function(t){jr(n,tp)})]:[]),behaviours:ea([xm.config({})])});r.setTooltip(e),Ts(t,e),o.onShow(n,e),Cs.position(t,o.anchor(n),e)}}(t)},o.delay)}),ai(tp,function(t){r.resetTimer(function(){e(t)},o.delay)}),ai(Mn(),function(t,n){T(n.channels(),Qg)&&e(t)}),vi(function(t){e(t)})],"normal"===o.mode?[ai(Gt(),function(t){jr(t,Zg)}),ai(Dn(),function(t){jr(t,tp)}),ai(Wt(),function(t){jr(t,Zg)}),ai(jt(),function(t){jr(t,tp)})]:[ai(Jn(),function(t,n){jr(t,Zg)}),ai($n(),function(t){jr(t,tp)})]]))}}),state:$g,apis:ep}),rp=function(t){var n,e,o,r=Zn.fromHtml(t),i=we(r),u=(e=(n=r).dom().attributes!==undefined?n.dom().attributes:[],U(e,function(t,n){var e;return"class"===n.name?t:io({},t,((e={})[n.name]=n.value,e))},{})),a=(o=r,Array.prototype.slice.call(o.dom().classList,0)),c=0===i.length?{}:{innerHtml:_e(r)};return io({tag:Fe(r),classes:a,attributes:u},c)},ip=tinymce.util.Tools.resolve("tinymce.util.I18n"),up="tox-menu-nav__js",ap="tox-collection__item",cp="tox-swatch",sp={normal:up,color:cp},fp="tox-collection__item--enabled",lp="tox-collection__item-icon",dp="tox-collection__item-label",mp="tox-collection__item--active",gp=function(t){return Et(sp,t).getOr(up)},pp=tinymce.util.Tools.resolve("tinymce.Env"),hp=function(t){var e=pp.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=t.split("+"),o=_(n,function(t){var n=t.toLowerCase().trim();return lt(e,n)?e[n]:t});return pp.mac?o.join(""):o.join("+")},vp=function(t){return{dom:{tag:"div",classes:[lp],innerHtml:t}}},bp=function(t){return{dom:{tag:"div",classes:[dp]},components:[Eu(ip.translate(t))]}},yp=function(t,n){return{dom:{tag:"div",classes:[dp]},components:[{dom:{tag:t.tag,attributes:{style:t.styleAttr}},components:[Eu(ip.translate(n))]}]}},xp=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:hp(t)}}},wp=function(t){return{dom:{tag:"div",classes:[lp,"tox-collection__item-checkmark"],innerHtml:kg("checkmark",t)}}},Sp=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],kp=["list-bull-circle","list-bull-default","list-bull-square"],Cp=function(t,r,n,i){void 0===i&&(i=et.none());var e,o,u,a,c,s,f,l,d,m,g,p,h,v=ip.isRtl()&&t.iconContent.exists(function(t){return T(kp,t)}),b=(e=t.iconContent,e.map(function(t){return ip.isRtl()&&T(Sp,t)?t+"-rtl":t})).map(function(t){return n=t,e=r.icons,o=i,et.from(e()[n]).or(o).getOrThunk(function(){return Sg(e)});var n,e,o}),y=et.from(t.meta).fold(function(){return bp},function(t){return lt(t,"style")?w(yp,t.style):bp});return"color"===t.presets?(l=t.ariaLabel,d=t.value,m=r,{dom:(g=cp,p=b.getOr(""),h=l.map(function(t){return' title="'+m.translate(t)+'"'}).getOr(""),rp("custom"===d?'<button class="'+g+' tox-swatches__picker-btn"'+h+">"+p+"</button>":"remove"===d?'<div class="'+g+' tox-swatch--remove"'+h+">"+p+"</div>":'<div class="'+g+'" style="background-color: '+d+'" data-mce-color="'+d+'"'+h+"></div>")),optComponents:[]}):(o=t,u=b,a=y,c=v,s=n?o.checkMark.orThunk(function(){return u.or(et.some("")).map(vp)}):et.none(),f=o.ariaLabel.map(function(t){return{attributes:{title:ip.translate(t)}}}).getOr({}),{dom:St({tag:"div",classes:[up,ap].concat(c?["tox-collection__item-icon-rtl"]:[])},f),optComponents:[s,o.textContent.map(a),o.shortcutContent.map(xp),o.caret]})},Op=["input","button","textarea"],Ep=function(t,n,e){n.disabled&&Mp(t,n,e)},Tp=function(t){return T(Op,Fe(t.element()))},Bp=function(t){ze(t.element(),"disabled","disabled")},Ap=function(t){Ue(t.element(),"disabled")},Dp=function(t){ze(t.element(),"aria-disabled","true")},_p=function(t){ze(t.element(),"aria-disabled","false")},Mp=function(n,t,e){t.disableClass.each(function(t){nu(n.element(),t)}),(Tp(n)?Bp:Dp)(n)},Fp=function(n,t,e){t.disableClass.each(function(t){eu(n.element(),t)}),(Tp(n)?Ap:_p)(n)},Ip=function(t){return Tp(t)?je(t.element(),"disabled"):"true"===Le(t.element(),"aria-disabled")},Vp=/* */Object.freeze({enable:Fp,disable:Mp,isDisabled:Ip,onLoad:Ep,set:function(t,n,e,o){(o?Mp:Fp)(t,n,e)}}),Rp=/* */Object.freeze({exhibit:function(t,n,e){return Li({classes:n.disabled?n.disableClass.map(q).getOr([]):[]})},events:function(t,n){return oi([ri(Fn(),function(t,n){return Ip(t)}),$u(t,n,Ep)])}}),Hp=[Dr("disabled",!1),Cr("disableClass")],Np=ra({fields:Hp,name:"disabling",active:Rp,apis:Vp}),Pp=function(t){return Np.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},zp=function(t){return Np.config({disabled:t})},Lp=function(t){return Np.config({disabled:t,disableClass:"tox-tbtn--disabled"})},jp=function(t,n){var e=t.getApi(n);return function(t){t(e)}},Up=function(e,o){return hi(function(t){jp(e,t)(function(t){var n=e.onSetup(t);null!==n&&n!==undefined&&o.set(n)})})},Wp=function(n,e){return vi(function(t){return jp(n,t)(e.get())})};(Ag=Bg||(Bg={}))[Ag.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Ag[Ag.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var Gp,Xp,Yp=Bg,qp={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},Kp=function(t){return j(t,function(t){return t.toArray()})},Jp=function(t,n,e){var o,r,i=_t(tt);return{type:"item",dom:n.dom,components:Kp(n.optComponents),data:t.data,eventOrder:qp,hasSubmenu:t.triggersSubmenu,itemBehaviours:ea([og("item-events",[(o=t,r=e,yi(function(t,n){jp(o,t)(o.onAction),o.triggersSubmenu||r!==Yp.CLOSE_ON_EXECUTE||(jr(t,Nn()),n.stop())})),Up(t,i),Wp(t,i)]),Pp(t.disabled),xm.config({})].concat(t.itemBehaviours))}},$p=function(t){return{value:t.value,meta:St({text:t.text.getOr("")},t.meta)}},Qp=nt(If("item-widget",ug())),Zp=oo("cell-over"),th=oo("cell-execute"),nh=function(n,e,t){var o,r=function(t){return Ur(t,th,{row:n,col:e})};return Au({dom:{tag:"div",attributes:(o={role:"button"},o["aria-labelledby"]=t,o)},behaviours:ea([og("insert-table-picker-cell",[ai(Wt(),Nm.focus),ai(Fn(),r),ai(Rn(),r)]),Jm.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Nm.config({onFocus:function(t){return Ur(t,Zp,{row:n,col:e})}})])})},eh=function(t){return{value:nt(t)}},oh=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,rh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ih=function(t){return oh.test(t)||rh.test(t)},uh=function(t){var n,e=(n=t.value().replace(oh,function(t,n,e,o){return n+n+e+e+o+o}),{value:nt(n)}),o=rh.exec(e.value());return null===o?["FFFFFF","FF","FF","FF"]:o},ah=function(t){var n=t.toString(16);return 1===n.length?"0"+n:n},ch=function(t){var n=ah(t.red())+ah(t.green())+ah(t.blue());return eh(n)},sh=Math.min,fh=Math.max,lh=Math.round,dh=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,mh=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,gh=function(t,n,e,o){return{red:nt(t),green:nt(n),blue:nt(e),alpha:nt(o)}},ph=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},hh=function(t){var n,e,o,r=(t.hue()||0)%360,i=t.saturation()/100,u=t.value()/100;if(i=fh(0,sh(i,1)),u=fh(0,sh(u,1)),0===i)return n=e=o=lh(255*u),gh(n,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:n=c,e=s,o=0;break;case 1:n=s,e=c,o=0;break;case 2:n=0,e=c,o=s;break;case 3:n=0,e=s,o=c;break;case 4:n=s,e=0,o=c;break;case 5:n=c,e=0,o=s;break;default:n=e=o=0}return n=lh(255*(n+f)),e=lh(255*(e+f)),o=lh(255*(o+f)),gh(n,e,o,1)},vh=function(t){var n=uh(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return gh(e,o,r,1)},bh=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return gh(r,i,u,a)},yh=function(t){return"rgba("+t.red()+","+t.green()+","+t.blue()+","+t.alpha()+")"},xh=nt(gh(255,0,0,1)),wh=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),Sh="tinymce-custom-colors",kh="choiceitem",Ch=[{type:kh,text:"Turquoise",value:"#18BC9B"},{type:kh,text:"Green",value:"#2FCC71"},{type:kh,text:"Blue",value:"#3598DB"},{type:kh,text:"Purple",value:"#9B59B6"},{type:kh,text:"Navy Blue",value:"#34495E"},{type:kh,text:"Dark Turquoise",value:"#18A085"},{type:kh,text:"Dark Green",value:"#27AE60"},{type:kh,text:"Medium Blue",value:"#2880B9"},{type:kh,text:"Medium Purple",value:"#8E44AD"},{type:kh,text:"Midnight Blue",value:"#2B3E50"},{type:kh,text:"Yellow",value:"#F1C40F"},{type:kh,text:"Orange",value:"#E67E23"},{type:kh,text:"Red",value:"#E74C3C"},{type:kh,text:"Light Gray",value:"#ECF0F1"},{type:kh,text:"Gray",value:"#95A5A6"},{type:kh,text:"Dark Yellow",value:"#F29D12"},{type:kh,text:"Dark Orange",value:"#D35400"},{type:kh,text:"Dark Red",value:"#C0392B"},{type:kh,text:"Medium Gray",value:"#BDC3C7"},{type:kh,text:"Dark Gray",value:"#7E8C8D"},{type:kh,text:"Black",value:"#000000"},{type:kh,text:"White",value:"#ffffff"}],Oh=function QD(n){void 0===n&&(n=10);var t,e=wh.getItem(Sh),o=k(e)?JSON.parse(e):[],r=n-(t=o).length<0?t.slice(0,n):t,i=function(t){r.splice(t,1)};return{add:function(t){b(r,t).each(i),r.unshift(t),r.length>n&&r.pop(),wh.setItem(Sh,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),Eh=function(t){var n,e=[];for(n=0;n<t.length;n+=2)e.push({text:t[n+1],value:"#"+t[n],type:"choiceitem"});return e},Th=function(t){return t.getParam("color_map")},Bh=function(t,n){return t.getParam("color_cols",n,"number")},Ah=function(t){return!1!==t.getParam("custom_colors")},Dh=function(t){var n=Th(t);return n!==undefined?Eh(n):Ch},_h=function(){return _(Oh.state(),function(t){return{type:kh,text:t,value:t}})},Mh=function(t){Oh.add(t)},Fh=function(t,e){var o;return t.dom.getParents(t.selection.getStart(),function(t){var n;(n=t.style["forecolor"===e?"color":"background-color"])&&(o=o||n)}),o},Ih=function(t){return Math.max(5,Math.ceil(Math.sqrt(t)))},Vh=function(t){var n=Dh(t),e=Ih(n.length);return Bh(t,e)},Rh=function(n,e,t,o){"custom"===t?jh(n)(function(t){t.each(function(t){Mh(t),n.execCommand("mceApplyTextcolor",e,t),o(t)})},"#000000"):"remove"===t?(o(""),n.execCommand("mceRemoveTextcolor",e)):(o(t),n.execCommand("mceApplyTextcolor",e,t))},Hh=function(t,n){return t.concat(_h().concat((o={type:e="choiceitem",text:"Remove color",icon:"color-swatch-remove-color",value:"remove"},n?[o,{type:e,text:"Custom color",icon:"color-picker",value:"custom"}]:[o])));var e,o},Nh=function(n,e){return function(t){t(Hh(n,e))}},Ph=function(t,n,e){var o,r;o="forecolor"===n?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",r=e,t.setIconFill(o,r),t.setIconStroke(o,r)},zh=function(o,e,r,t,i){o.ui.registry.addSplitButton(e,{tooltip:t,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return et.from(Fh(o,r)).bind(function(t){return function(t){if("transparent"===t)return et.some(gh(0,0,0,0));var n=dh.exec(t);if(null!==n)return et.some(bh(n[1],n[2],n[3],"1"));var e=mh.exec(t);return null!==e?et.some(bh(e[1],e[2],e[3],e[4])):et.none()}(t).map(function(t){var n=ch(t).value();return xn(e.toLowerCase(),n)})}).getOr(!1)},columns:Vh(o),fetch:Nh(Dh(o),Ah(o)),onAction:function(t){null!==i.get()&&Rh(o,r,i.get(),function(){})},onItemAction:function(n,t){Rh(o,r,t,function(t){i.set(t),Ph(n,e,t)})},onSetup:function(t){return null!==i.get()&&Ph(t,e,i.get()),function(){}}})},Lh=function(n,t,e,o){n.ui.registry.addNestedMenuItem(t,{text:o,icon:"forecolor"===t?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(t){Rh(n,e,t.value,tt)}}]}})},jh=function(i){return function(t,n){var e,o={colorpicker:n},r=(e=t,function(t){var n=t.getData();e(et.from(n.colorpicker)),t.close()});i.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(t,n){"hex-valid"===n.name&&(n.value?t.enable("ok"):t.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){t(et.none())}})}},Uh={register:function(t){var i;(i=t).addCommand("mceApplyTextcolor",function(t,n){var e,o,r;o=t,r=n,(e=i).undoManager.transact(function(){e.focus(),e.formatter.apply(o,{value:r}),e.nodeChanged()})}),i.addCommand("mceRemoveTextcolor",function(t){var n,e;e=t,(n=i).undoManager.transact(function(){n.focus(),n.formatter.remove(e,{value:null},null,!0),n.nodeChanged()})});var n=_t(null),e=_t(null);zh(t,"forecolor","forecolor","Text color",n),zh(t,"backcolor","hilitecolor","Background color",e),Lh(t,"forecolor","forecolor","Text color"),Lh(t,"backcolor","hilitecolor","Background color")},getColors:Hh,getFetch:Nh,colorPickerDialog:jh,getCurrentColor:Fh,getColorCols:Vh,calcCols:Ih},Wh=function(e,o){return function(t){var n=B(t,o);return _(n,function(t){return{dom:e,components:t}})}},Gh=function(n,i,t){return void 0===t&&(t=!0),{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===n?["tox-collection--list"]:["tox-collection--grid"])},components:[dg.parts().items({preprocess:function(t){return"auto"!==n&&1<n?Wh({tag:"div",classes:["tox-collection__group"]},n)(t):(e=function(t,n){return"separator"===i[n].type},o=[],r=[],M(t,function(t,n){e(t,n)?(0<r.length&&o.push(r),r=[],lt(t.dom,"innerHtml")&&r.push(t)):r.push(t)}),0<r.length&&o.push(r),_(o,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}}));var e,o,r}})]}},Xh=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:(n=t,"color"===n?"tox-swatches":"tox-menu"),tieredMenu:"tox-tiered-menu"};var n},Yh=function(t){var n=Xh(t);return{backgroundMenu:n.backgroundMenu,selectedMenu:n.selectedMenu,menu:n.menu,selectedItem:n.selectedItem,item:gp(t)}},qh=[dg.parts().items({})],Kh=function(t,n,e){var o=Xh(e);return{dom:{tag:"div",classes:L([[o.tieredMenu]])},markers:Yh(e)}},Jh=function(t){return t.icon!==undefined||"togglemenuitem"===t.type||"choicemenuitem"===t.type},$h=function(t){return x.console.error(ar(t)),x.console.log(t),et.none()},Qh=function(t,n,e,o,r){var i,u,a,c,s,f,l;return"color"===r?{value:t,dom:(i=o,l={dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[dg.parts().items({preprocess:"auto"!==i?Wh({tag:"div",classes:["tox-swatches__row"]},i):d})]}]}).dom,components:l.components,items:e}:"normal"===r&&"auto"===o?{value:t,dom:(l=Gh(o,e)).dom,components:l.components,items:e}:"normal"===r&&1===o?{value:t,dom:(l=Gh(1,e)).dom,components:l.components,items:e}:"normal"===r?{value:t,dom:(l=Gh(o,e)).dom,components:l.components,items:e}:"listpreview"!==r||"auto"===o?{value:t,dom:(a=n,c=o,s=r,f=Xh(s),{tag:"div",classes:L([[f.menu,"tox-menu-"+c+"-column"],a?[f.hasIcons]:[]])}),components:qh,items:e}:{value:t,dom:(u=o,l={dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[dg.parts().items({preprocess:Wh({tag:"div",classes:["tox-collection__group"]},u)})]}).dom,components:l.components,items:e}},Zh=function(t,n,e,o,r,i,u,a){var c=y(n,Jh),s=tv(n,e,o,"color"!==r?"normal":"color",i,u,a);return Qh(t,c,s,o,r)},tv=function(t,f,l,d,m,g,p){return Mt(_(t,function(s){return"choiceitem"===s.type?(t=s,rr("choicemenuitem",Wg,t)).fold($h,function(t){return et.some((n=t,e=1===l,o=d,r=f,i=g(s.value),u=m,a=p,c=Cp({presets:o,textContent:e?n.text:et.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:e?n.shortcut:et.none(),checkMark:e?et.some(wp(a.icons)):et.none(),caret:et.none(),value:n.value},a,!0),wt(Jp({data:$p(n),disabled:n.disabled,getApi:function(n){return{setActive:function(t){Jm.set(n,t)},isActive:function(){return Jm.isOn(n)},isDisabled:function(){return Np.isDisabled(n)},setDisabled:function(t){return Np.set(n,t)}}},onAction:function(t){return r(n.value)},onSetup:function(t){return t.setActive(i),function(){}},triggersSubmenu:!1,itemBehaviours:[]},c,u),{toggling:{toggleClass:fp,toggleOnExecute:!1,selected:n.active}})));var n,e,o,r,i,u,a,c}):et.none();var t}))},nv=function(t,n){var e=Yh(n);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+e.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===n?"tox-swatches__row":"tox-collection__group")}},ev={inserttable:function ZD(o){var t,n=oo("size-label"),a=function(t,n,e){for(var o=[],r=0;r<n;r++){for(var i=[],u=0;u<e;u++)i.push(nh(r,u,t));o.push(i)}return o}(n,10,10),c=wg({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:n}},components:[Eu("0x0")],behaviours:ea([xm.config({})])});return{type:"widget",data:{value:oo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Qp().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:(t=a,j(t,function(t){return _(t,Du)})).concat(c.asSpec()),behaviours:ea([og("insert-table-picker",[di(Zp,function(t,n,e){var o,r,i=e.event().row(),u=e.event().col();!function(t,n,e,o,r){for(var i=0;i<o;i++)for(var u=0;u<r;u++)Jm.set(t[i][u],i<=n&&u<=e)}(a,i,u,10,10),xm.set(c.get(t),[(o=i,r=u,Eu(r+1+"x"+(o+1)))])}),di(th,function(t,n,e){o.onAction({numRows:e.event().row()+1,numColumns:e.event().col()+1}),jr(t,Nn())})]),pm.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function t_(n,t){var e=Uh.getColors(t.colorinput.getColors(),t.colorinput.hasCustomColors()),o=t.colorinput.getColorCols(),r=Zh(oo("menu-value"),e,function(t){n.onAction({value:t})},o,"color",Yp.CLOSE_ON_EXECUTE,function(){return!1},t.shared.providers),i=wt(io({},r,{markers:Yh("color"),movement:nv(o,"color")}));return{type:"widget",data:{value:oo("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Qp().widget(dg.sketch(i))]}}},ov=function(n,t,e,o,r,i,u){void 0===u&&(u=!0);var a,c,s=Cp({presets:e,textContent:t?n.text:et.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:et.none(),checkMark:et.none(),caret:et.none(),value:n.value},i.providers,u,n.icon);return Jp({data:$p(n),disabled:n.disabled,getApi:function(){return{}},onAction:function(t){return o(n.value,n.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:(a=n.meta,c=i,ft(a,"tooltipWorker").map(function(e){return[op.config({lazySink:c.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{anchor:"submenu",item:t,overrides:{maxHeightFunction:ec}}},mode:"follow-highlight",onShow:function(n,t){e(function(t){op.setComponents(n,[Tu({element:Zn.fromDom(t)})])})}})]}).getOr([]))},s,r)},rv=function(t){var n=t.text.fold(function(){return{}},function(t){return{innerHtml:t}});return{type:"separator",dom:io({tag:"div",classes:[ap,"tox-collection__group-heading"]},n),components:[]}},iv=function(t,n,e,o){void 0===o&&(o=!0);var r=Cp({presets:"normal",iconContent:t.icon,textContent:t.text,ariaLabel:t.text,caret:et.none(),checkMark:et.none(),shortcutContent:t.shortcut},e,o);return Jp({data:$p(t),getApi:function(n){return{isDisabled:function(){return Np.isDisabled(n)},setDisabled:function(t){return Np.set(n,t)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n)},uv=function(t,n,e,o){void 0===o&&(o=!0);var r,i=(r=e.icons,{dom:{tag:"div",classes:["tox-collection__item-caret"],innerHtml:kg("chevron-right",r)}}),u=Cp({presets:"normal",iconContent:t.icon,textContent:t.text,ariaLabel:t.text,caret:et.some(i),checkMark:et.none(),shortcutContent:t.shortcut},e,o);return Jp({data:$p(t),getApi:function(n){return{isDisabled:function(){return Np.isDisabled(n)},setDisabled:function(t){return Np.set(n,t)}}},disabled:t.disabled,onAction:tt,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,n)},av=function(t,n,e){var o=Cp({iconContent:et.none(),textContent:t.text,ariaLabel:t.text,checkMark:et.some(wp(e.icons)),caret:et.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},e,!0);return wt(Jp({data:$p(t),disabled:t.disabled,getApi:function(n){return{setActive:function(t){Jm.set(n,t)},isActive:function(){return Jm.isOn(n)},isDisabled:function(){return Np.isDisabled(n)},setDisabled:function(t){return Np.set(n,t)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,n),{toggling:{toggleClass:fp,toggleOnExecute:!1,selected:t.active}})},cv=function(n,e){return(t=ev,o=n.fancytype,Object.prototype.hasOwnProperty.call(t,o)?et.some(t[o]):et.none()).map(function(t){return t(n,e)});var t,o};(Xp=Gp||(Gp={}))[Xp.ContentFocus=0]="ContentFocus",Xp[Xp.UiFocus=1]="UiFocus";var sv=function(t){return t.icon!==undefined||"togglemenuitem"===t.type||"choicemenuitem"===t.type},fv=function(t){return y(t,sv)},lv=function(t,n,e,o){void 0===o&&(o=!0);var r,i,u,a,c,s=e.shared.providers;switch(t.type){case"menuitem":return(c=t,rr("menuitem",Lg,c)).fold($h,function(t){return et.some(iv(t,n,s,o))});case"nestedmenuitem":return(a=t,rr("nestedmenuitem",jg,a)).fold($h,function(t){return et.some(uv(t,n,s,o))});case"togglemenuitem":return(u=t,rr("togglemenuitem",Ug,u)).fold($h,function(t){return et.some(av(t,n,s))});case"separator":return(i=t,rr("separatormenuitem",Gg,i)).fold($h,function(t){return et.some(rv(t))});case"fancymenuitem":return(r=t,rr("fancymenuitem",Xg,r)).fold($h,function(t){return cv(t,e)});default:return x.console.error("Unknown item in general menu",t),et.none()}},dv=function(t,e,n,o,r){var i=1===n,u=!i||fv(t);return Mt(_(t,function(t){return(n=t,rr("Autocompleter.Item",Hg,n)).fold($h,function(t){return et.some(ov(t,i,"normal",e,o,r,u))});var n}))},mv=function(t,n,e,o){var r=fv(n),i=Mt(_(n,function(t){var n=function(t){return lv(t,e,o,r)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?n(St(t,{disabled:!0})):n(t)}));return Qh(t,r,i,1,"normal")},gv=function(t){return vg.singleData(t.value,t)},pv=function(g,p){var h=Au(bg.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],lazySink:p.getSink})),t=function(){return bg.isOpen(h)},v=function(){t()&&bg.hide(h)},n=tn(function(){return Pg(g)}),e=Dg(function(t){(" "===t.key?et.none():Rg(g,n)).fold(v,function(m){m.lookupData.then(function(t){var e,n,o,r,i,u,a,c,s,f,l=(e=m.triggerChar,o=Ft(n=t,function(t){return et.from(t.columns)}).getOr(1),j(n,function(i){var t=i.items;return dv(t,function(o,r){var t=g.selection.getRng(),n=t.startContainer;Mg(t,e,n.data,t.startOffset).fold(function(){return x.console.error("Lost context. Cursor probably moved")},function(t){var n=t.rng,e={hide:v};i.onAction(e,n,o,r)})},o,Yp.BUBBLE_TO_SANDBOX,p)}));if(0<l.length){var d=Ft(t,function(t){return et.from(t.columns)}).getOr(1);bg.showAt(h,{anchor:"selection",root:Zn.fromDom(g.getBody()),getSelection:function(){return et.some({start:function(){return Zn.fromDom(m.range.startContainer)},soffset:function(){return m.range.startOffset},finish:function(){return Zn.fromDom(m.range.endContainer)},foffset:function(){return m.range.endOffset}})}},dg.sketch((r=Qh("autocompleter-value",!0,l,d,"normal"),i=d,u=Gp.ContentFocus,a="normal",c=u===Gp.ContentFocus?Pl():Nl(),s=nv(i,a),f=Yh(a),{dom:r.dom,components:r.components,items:r.items,value:r.value,markers:{selectedItem:f.selectedItem,item:f.item},movement:s,fakeFocus:u===Gp.ContentFocus,focusManager:c,menuBehaviours:Kg("auto"!==i?[]:[hi(function(o,t){Yg(o,4,f.item).each(function(t){var n=t.numColumns,e=t.numRows;pm.setGridSize(o,e,n)})})])}))),bg.getContent(h).each(Sl.highlightFirst)}else v()})})},50);Fg({onKeypress:e,closeIfNecessary:v,isActive:t,getView:function(){return bg.getContent(h)}},g)},hv=function(m,g){return function(t){if(m(t)){var n,e,o,r,i,u,a,c=Zn.fromDom(t.target),s=function(){t.stopPropagation()},f=function(){t.preventDefault()},l=p(f,s),d=(n=c,e=t.clientX,o=t.clientY,r=s,i=f,u=l,a=t,{target:nt(n),x:nt(e),y:nt(o),stop:r,prevent:i,kill:u,raw:nt(a)});g(d)}}},vv=function(t,n,e,o,r){var i=hv(e,o);return t.dom().addEventListener(n,i,r),{unbind:w(bv,t,n,i,r)}},bv=function(t,n,e,o){t.dom().removeEventListener(n,e,o)},yv=nt(!0),xv=function(t,n,e){return vv(t,n,yv,e,!1)},wv=function(t,n,e){return vv(t,n,yv,e,!0)},Sv=function(t,n,e){return Iu(t,n,e).isSome()};function kv(e,o){var r=null;return{cancel:function(){null!==r&&(x.clearTimeout(r),r=null)},schedule:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r=x.setTimeout(function(){e.apply(null,t),r=null},o)}}}var Cv=function(t){var n=t.raw();return n.touches===undefined||1!==n.touches.length?et.none():et.some(n.touches[0])},Ov=function(e){var u=_t(et.none()),o=kv(function(t){u.set(et.none()),e.triggerEvent(Hn(),t)},400),r=Bt([{key:Ht(),value:function(e){return Cv(e).each(function(t){o.cancel();var n={x:nt(t.clientX),y:nt(t.clientY),target:e.target};o.schedule(e),u.set(et.some(n))}),et.none()}},{key:Nt(),value:function(t){return o.cancel(),Cv(t).each(function(i){u.get().each(function(t){var n,e,o,r;n=i,e=t,o=Math.abs(n.clientX-e.x()),r=Math.abs(n.clientY-e.y()),(5<o||5<r)&&u.set(et.none())})}),et.none()}},{key:Pt(),value:function(n){return o.cancel(),u.get().filter(function(t){return he(t.target(),n.target())}).map(function(t){return e.triggerEvent(Vn(),n)})}}]);return{fireIfReady:function(n,t){return Et(r,t).bind(function(t){return t(n)})}}},Ev=Tn.detect().browser.isFirefox(),Tv=jo([xr("triggerEvent"),Dr("stopBackspace",!0)]),Bv=function(n,t){var e,o,r,i,u=ur("Getting GUI events settings",Tv,t),a=Tn.detect().deviceType.isTouch()?["touchstart","touchmove","touchend","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],c=Ov(u),s=_(a.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(t){return xv(n,t,function(n){c.fireIfReady(n,t).each(function(t){t&&n.kill()}),u.triggerEvent(t,n)&&n.kill()})}),f=_t(et.none()),l=xv(n,"paste",function(n){c.fireIfReady(n,"paste").each(function(t){t&&n.kill()}),u.triggerEvent("paste",n)&&n.kill(),f.set(et.some(x.setTimeout(function(){u.triggerEvent(_n(),n)},0)))}),d=xv(n,"keydown",function(t){var n;u.triggerEvent("keydown",t)?t.kill():!0!==u.stopBackspace||8!==(n=t).raw().which||T(["input","textarea"],Fe(n.target()))||Sv(n.target(),'[contenteditable="true"]')||t.prevent()}),m=(e=n,o=function(t){u.triggerEvent("focusin",t)&&t.kill()},Ev?wv(e,"focus",o):xv(e,"focusin",o)),g=_t(et.none()),p=(r=n,i=function(t){u.triggerEvent("focusout",t)&&t.kill(),g.set(et.some(x.setTimeout(function(){u.triggerEvent(Dn(),t)},0)))},Ev?wv(r,"blur",i):xv(r,"focusout",i));return{unbind:function(){M(s,function(t){t.unbind()}),d.unbind(),m.unbind(),p.unbind(),l.unbind(),f.get().each(x.clearTimeout),g.get().each(x.clearTimeout)}}},Av=function(t,n){var e=Et(t,"target").map(function(t){return t()}).getOr(n);return _t(e)},Dv=bt([{stopped:[]},{resume:["element"]},{complete:[]}]),_v=function(t,o,n,e,r,i){var u,a,c,s,f=t(o,e),l=(u=n,a=r,c=_t(!1),s=_t(!1),{stop:function(){c.set(!0)},cut:function(){s.set(!0)},isStopped:c.get,isCut:s.get,event:nt(u),setSource:a.set,getSource:a.get});return f.fold(function(){return i.logEventNoHandlers(o,e),Dv.complete()},function(n){var e=n.descHandler();return Ui(e)(l),l.isStopped()?(i.logEventStopped(o,n.element(),e.purpose()),Dv.stopped()):l.isCut()?(i.logEventCut(o,n.element(),e.purpose()),Dv.complete()):ye(n.element()).fold(function(){return i.logNoParent(o,n.element(),e.purpose()),Dv.complete()},function(t){return i.logEventResponse(o,n.element(),e.purpose()),Dv.resume(t)})})},Mv=function(n,e,o,t,r,i){return _v(n,e,o,t,r,i).fold(function(){return!0},function(t){return Mv(n,e,o,t,r,i)},function(){return!1})},Fv=function(t,n,e){var o,r,i=(o=n,r=_t(!1),{stop:function(){r.set(!0)},cut:tt,isStopped:r.get,isCut:nt(!1),event:nt(o),setSource:u("Cannot set source of a broadcasted event"),getSource:u("Cannot get source of a broadcasted event")});return M(t,function(t){var n=t.descHandler();Ui(n)(i)}),i.isStopped()},Iv=function(t,n,e,o,r){var i=Av(e,o);return Mv(t,n,e,o,i,r)},Vv=te("element","descHandler"),Rv=function(t,n){return{id:nt(t),descHandler:nt(n)}};function Hv(){var i={};return{registerId:function(o,r,t){rt(t,function(t,n){var e=i[n]!==undefined?i[n]:{};e[r]=ji(t,o),i[n]=e})},unregisterId:function(e){rt(i,function(t,n){t.hasOwnProperty(e)&&delete t[e]})},filterByType:function(t){return Et(i,t).map(function(t){return at(t,function(t,n){return Rv(n,t)})}).getOr([])},find:function(t,n,e){var r=Ct(n)(i);return ei(e,function(t){return e=r,Ti(o=t).fold(function(){return et.none()},function(t){var n=Ct(t);return e.bind(n).map(function(t){return Vv(o,t)})});var e,o},t)}}}function Nv(){var o=Hv(),r={},i=function(o){var t=o.element();return Ti(t).fold(function(){return t="uid-",n=o.element(),e=oo(Ci+t),Ei(n,e),e;var t,n,e},function(t){return t})},u=function(t){Ti(t.element()).each(function(t){delete r[t],o.unregisterId(t)})};return{find:function(t,n,e){return o.find(t,n,e)},filter:function(t){return o.filterByType(t)},register:function(t){var n=i(t);Dt(r,n)&&function(t,n){var e=r[n];if(e!==t)throw new Error('The tagId "'+n+'" is already used by: '+Xe(e.element())+"\nCannot use it for: "+Xe(t.element())+"\nThe conflicting element is"+(Jr(e.element())?" ":" not ")+"already in the DOM");u(t)}(t,n);var e=[t];o.registerId(e,n,t.events()),r[n]=t},unregister:u,getById:function(t){return Ct(t)(r)}}}var Pv,zv,Lv=rl({name:"Container",factory:function(t){var n=t.dom,e=n.attributes,o=uo(n,["attributes"]);return{uid:t.uid,dom:io({tag:"div",attributes:io({role:"presentation"},e)},o),components:t.components,behaviours:Js(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[Dr("components",[]),Ks("containerBehaviours",[]),Dr("events",{}),Dr("domModification",{}),Dr("eventOrder",{})]}),jv=function(e){var o=function(n){return ye(e.element()).fold(function(){return!0},function(t){return he(n,t)})},r=Nv(),s=function(t,n){return r.find(o,t,n)},t=Bv(e.element(),{triggerEvent:function(u,a){return Qe(u,a.target(),function(t){return n=s,e=u,r=t,i=(o=a).target(),Iv(n,e,o,i,r);var n,e,o,r,i})}}),i={debugInfo:nt("real"),triggerEvent:function(n,e,o){Qe(n,e,function(t){Iv(s,n,o,e,t)})},triggerFocus:function(a,c){Ti(a).fold(function(){Il(a)},function(t){Qe(An(),a,function(t){var n,e,o,r,i,u;n=s,e=An(),o={originator:nt(c),kill:tt,prevent:tt,target:nt(a)},i=t,u=Av(o,r=a),_v(n,e,o,r,u,i)})})},triggerEscape:function(t,n){i.triggerEvent("keydown",t.element(),n.event())},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:Au,addToGui:function(t){a(t)},removeFromGui:function(t){c(t)},addToWorld:function(t){n(t)},removeFromWorld:function(t){u(t)},broadcast:function(t){l(t)},broadcastOn:function(t,n){d(t,n)},broadcastEvent:function(t,n){m(t,n)},isConnected:nt(!0)},n=function(t){t.connect(i),He(t.element())||(r.register(t),M(t.components(),n),i.triggerEvent(zn(),t.element(),{target:nt(t.element())}))},u=function(t){He(t.element())||(M(t.components(),u),r.unregister(t)),t.disconnect()},a=function(t){Ts(e,t)},c=function(t){Ds(t)},f=function(e){var t=r.filter(Mn());M(t,function(t){var n=t.descHandler();Ui(n)(e)})},l=function(t){f({universal:nt(!0),data:nt(t)})},d=function(t,n){f({universal:nt(!1),channels:nt(t),data:nt(n)})},m=function(t,n){var e=r.filter(t);return Fv(e,n)},g=function(t){return r.getById(t).fold(function(){return vt.error(new Error('Could not find component with uid: "'+t+'" in system.'))},vt.value)},p=function(t){var n=Ti(t).getOr("not found");return g(n)};return n(e),{root:nt(e),element:e.element,destroy:function(){t.unbind(),De(e.element())},add:a,remove:c,getByUid:g,getByDom:p,addToWorld:n,removeFromWorld:u,broadcast:l,broadcastOn:d,broadcastEvent:m}},Uv=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Wv=tinymce.util.Tools.resolve("tinymce.EditorManager"),Gv=function(t){return et.from(t.settings.min_width).filter(D)},Xv=function(t){return et.from(t.settings.min_height).filter(D)},Yv=function(n){var t=Z(n.settings),e=V(t,function(t){return/^toolbar([1-9])$/.test(t)}),o=_(e,function(t){return n.getParam(t,!1,"string")}),r=V(o,function(t){return"string"==typeof t});return 0<r.length?et.some(r):et.none()};(zv=Pv||(Pv={}))["default"]="",zv.floating="floating",zv.sliding="sliding";var qv,Kv,Jv=function(t){return t.getParam("toolbar_drawer","","string")},$v=function(t){var n=t.getParam("fixed_toolbar_container","","string"),e=t.getParam("inline",!1,"boolean");return 0<n.length&&e?Fu($r(),n):et.none()},Qv=function(t){return t.getParam("inline",!1,"boolean")&&$v(t).isSome()},Zv=oo("form-component-change"),tb=oo("form-close"),nb=oo("form-cancel"),eb=oo("form-action"),ob=oo("form-submit"),rb=oo("form-block"),ib=oo("form-unblock"),ub=oo("form-tabchange"),ab=oo("form-resize"),cb=nt([Dr("prefix","form-field"),Ks("fieldBehaviours",[sl,Fm])]),sb=nt([Af({schema:[hr("dom")],name:"label"}),Af({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[hr("text")],name:"aria-descriptor"}),Tf({factory:{sketch:function(t){var n=kt(t,["factory"]);return t.factory.sketch(n)}},schema:[hr("factory")],name:"field"})]),fb=il({name:"FormField",configFields:cb(),partFields:sb(),factory:function(r,t,n,e){var o=$s(r.fieldBehaviours,[sl.config({find:function(t){return Lf(t,r,"field")}}),Fm.config({store:{mode:"manual",getValue:function(t){return sl.getCurrent(t).bind(Fm.getValue)},setValue:function(t,n){sl.getCurrent(t).each(function(t){Fm.setValue(t,n)})}}})]),i=oi([hi(function(t,n){var o=Uf(t,r,["label","field","aria-descriptor"]);o.field().each(function(e){var n=oo(r.prefix);o.label().each(function(t){ze(t.element(),"for",n),ze(e.element(),"id",n)}),o["aria-descriptor"]().each(function(t){var n=oo(r.prefix);ze(t.element(),"id",n),ze(e.element(),"aria-describedby",n)})})})]),u={getField:function(t){return Lf(t,r,"field")},getLabel:function(t){return Lf(t,r,"label")}};return{uid:r.uid,dom:r.dom,components:t,behaviours:o,events:i,apis:u}},apis:{getField:function(t,n){return t.getField(n)},getLabel:function(t,n){return t.getLabel(n)}}}),lb=/* */Object.freeze({getCoupled:function(t,n,e,o){return e.getOrCreate(t,n,o)}}),db=[vr("others",er(vt.value,sr()))],mb=ra({fields:db,name:"coupling",apis:lb,state:/* */Object.freeze({init:function(t){var i={},n=nt({});return Pi({readState:n,getOrCreate:function(e,o,r){var t=Z(o.others);if(t)return Et(i,r).getOrThunk(function(){var t=Et(o.others,r).getOrDie("No information found for coupled component: "+r)(e),n=e.getSystem().build(t);return i[r]=n});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+Io(t,null,2))}})}})}),gb=/* */Object.freeze({events:function(t,n){var e=t.stream.streams.setup(t,n);return oi([ai(t.event,e),vi(function(){return n.cancel()})].concat(t.cancelEvent.map(function(t){return[ai(t,function(){return n.cancel()})]}).getOr([])))}}),pb=function(t){var n=_t(null);return Pi({readState:function(){return{timer:null!==n.get()?"set":"unset"}},setTimer:function(t){n.set(t)},cancel:function(){var t=n.get();null!==t&&t.cancel()}})},hb=/* */Object.freeze({throttle:pb,init:function(t){return t.stream.streams.state(t)}}),vb=[vr("stream",cr("mode",{throttle:[hr("delay"),Dr("stopEvent",!0),qu("streams",{setup:function(t,n){var e=t.stream,o=Dg(t.onStream,e.delay);return n.setTimer(o),function(t,n){o.throttle(t,n),e.stopEvent&&n.stop()}},state:pb})]})),Dr("event","input"),Cr("cancelEvent"),Xu("onStream")],bb=ra({fields:vb,name:"streaming",active:gb,state:hb}),yb=function(t){var e=et.none(),n=[],o=function(t){r()?u(t):n.push(t)},r=function(){return e.isSome()},i=function(t){M(t,u)},u=function(n){e.each(function(t){x.setTimeout(function(){n(t)},0)})};return t(function(t){e=et.some(t),i(n),n=[]}),{get:o,map:function(e){return yb(function(n){o(function(t){n(e(t))})})},isReady:r}},xb={nu:yb,pure:function(n){return yb(function(t){t(n)})}},wb=function(n){var t=function(t){var o;n((o=t,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=this;x.setTimeout(function(){o.apply(e,t)},0)}))},e=function(){return xb.nu(t)};return{map:function(o){return wb(function(e){t(function(t){var n=o(t);e(n)})})},bind:function(e){return wb(function(n){t(function(t){e(t).get(n)})})},anonBind:function(e){return wb(function(n){t(function(t){e.get(n)})})},toLazy:e,toCached:function(){var n=null;return wb(function(t){null===n&&(n=e()),n.get(t)})},get:t}},Sb={nu:wb,pure:function(n){return wb(function(t){t(n)})}},kb=nt("sink"),Cb=nt(Af({name:kb(),overrides:nt({dom:{tag:"div"},behaviours:ea([Cs.config({useFixed:!0})]),events:oi([mi(Yt()),mi(zt()),mi($t())])})}));(Kv=qv||(qv={}))[Kv.HighlightFirst=0]="HighlightFirst",Kv[Kv.HighlightNone=1]="HighlightNone";var Ob=function(t,n){var e=t.getHotspot(n).getOr(n),o=t.getAnchorOverrides();return t.layouts.fold(function(){return{anchor:"hotspot",hotspot:e,overrides:o}},function(t){return{anchor:"hotspot",hotspot:e,overrides:o,layouts:t}})},Eb=function(t,n,e,o,r,i,u){var a,c,s,f,l,d,m,g,p,h,v=Ob(t,e);return(c=v,f=o,l=r,d=u,m=n,g=s=e,p=(0,(a=t).fetch)(g).map(m),h=Db(s,a),p.map(function(t){return t.bind(function(t){return et.from(vg.sketch(io({},l.menu(),{uid:Bi(""),data:t,highlightImmediately:d===qv.HighlightFirst,onOpenMenu:function(t,n){var e=h().getOrDie();Cs.position(e,c,n),Us.decloak(f)},onOpenSubmenu:function(t,n,e){var o=h().getOrDie();Cs.position(o,{anchor:"submenu",item:n},e),Us.decloak(f)},onEscape:function(){return Nm.focus(s),Us.close(f),et.some(!0)}})))})})).map(function(t){return t.fold(function(){Us.isOpen(o)&&Us.close(o)},function(t){Us.cloak(o),Us.open(o,t),i(o)}),o})},Tb=function(t,n,e,o,r,i,u){return Us.close(o),Sb.pure(o)},Bb=function(t,n,e,o,r,i){var u=mb.getCoupled(e,"sandbox");return(Us.isOpen(u)?Tb:Eb)(t,n,e,u,o,r,i)},Ab=function(t,n,e){var o,r,i=sl.getCurrent(n).getOr(n),u=xa(t.element());e?su(i.element(),"min-width",u+"px"):(o=i.element(),r=u,ya.set(o,r))},Db=function(n,t){return n.getSystem().getByUid(t.uid+"-"+kb()).map(function(t){return function(){return vt.value(t)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return vt.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(n)}})})},_b=function(o,r,i){var n,u=(n=oo("aria-owns"),{id:nt(n),link:function(t){ze(t,"aria-owns",n)},unlink:function(t){Ue(t,"aria-owns")}}),t=Db(r,o);return{dom:{tag:"div",classes:o.sandboxClasses,attributes:{id:u.id(),role:"listbox"}},behaviours:Qs.augment(o.sandboxBehaviours,[Fm.config({store:{mode:"memory",initialValue:r}}),Us.config({onOpen:function(t,n){var e=Ob(o,r);u.link(r.element()),o.matchWidth&&Ab(e.hotspot,n,o.useMinWidth),o.onOpen(e,t,n),i!==undefined&&i.onOpen!==undefined&&i.onOpen(t,n)},onClose:function(t,n){u.unlink(r.element()),i!==undefined&&i.onClose!==undefined&&i.onClose(t,n)},isPartOf:function(t,n,e){return Ru(n,e)||Ru(r,e)},getAttachPoint:function(){return t().getOrDie()}}),sl.config({find:function(t){return Us.getState(t).bind(function(t){return sl.getCurrent(t)})}}),Ys({isExtraPart:nt(!1)})])}},Mb=function(t,n,e){var o=Fm.getValue(e);Fm.setValue(n,o),Ib(n)},Fb=function(t,n){var e=t.element(),o=bu(e),r=e.dom();"number"!==Le(e,"type")&&n(r,o)},Ib=function(t){Fb(t,function(t,n){return t.setSelectionRange(n.length,n.length)})},Vb=function(t,n,o){if(t.selectsOver){var e=Fm.getValue(n),r=t.getDisplayText(e),i=Fm.getValue(o);return 0===t.getDisplayText(i).indexOf(r)?et.some(function(){var t,e;Mb(0,n,o),t=n,e=r.length,Fb(t,function(t,n){return t.setSelectionRange(e,n.length)})}):et.none()}return et.none()},Rb=nt([Cr("data"),Dr("inputAttributes",{}),Dr("inputStyles",{}),Dr("tag","input"),Dr("inputClasses",[]),Wu("onSetValue"),Dr("styles",{}),Dr("eventOrder",{}),Ks("inputBehaviours",[Fm,Nm]),Dr("selectOnFocus",!0)]),Hb=function(t){return ea([Nm.config({onFocus:!1===t.selectOnFocus?tt:function(t){var n=t.element(),e=bu(n);n.dom().setSelectionRange(0,e.length)}})])},Nb=function(t){return{tag:t.tag,attributes:io({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Pb=nt("alloy.typeahead.itemexecute"),zb=function(){return[Dr("sandboxClasses",[]),Qs.field("sandboxBehaviours",[sl,fa,Us,Fm])]},Lb=nt([Cr("lazySink"),hr("fetch"),Dr("minChars",5),Dr("responseTime",1e3),Wu("onOpen"),Dr("getHotspot",et.some),Dr("getAnchorOverrides",nt({})),Dr("layouts",et.none()),Dr("eventOrder",{}),Hr("model",{},[Dr("getDisplayText",function(t){return t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.value}),Dr("selectsOver",!0),Dr("populateFromBrowse",!0)]),Wu("onSetValue"),Gu("onExecute"),Wu("onItemExecute"),Dr("inputClasses",[]),Dr("inputAttributes",{}),Dr("inputStyles",{}),Dr("matchWidth",!0),Dr("useMinWidth",!1),Dr("dismissOnBlur",!0),ju(["openClass"]),Cr("initialData"),Ks("typeaheadBehaviours",[Nm,Fm,bb,pm,Jm,mb]),Nr("previewing",function(){return _t(!0)})].concat(Rb()).concat(zb())),jb=nt([Bf({schema:[Lu()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(n,e){o.previewing.get()?n.getSystem().getByUid(o.uid).each(function(t){Vb(o.model,t,e).fold(function(){return Sl.dehighlight(n,e)},function(t){return t()})}):n.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&Mb(o.model,t,e)}),o.previewing.set(!1)},onExecute:function(t,n){return t.getSystem().getByUid(o.uid).toOption().map(function(t){return Ur(t,Pb(),{item:n}),!0})},onHover:function(t,n){o.previewing.set(!1),t.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&Mb(o.model,t,n)})}}}})]),Ub=il({name:"Typeahead",configFields:Lb(),partFields:jb(),factory:function(r,t,n,i){var e=function(t,n,e){r.previewing.set(!1);var o=mb.getCoupled(t,"sandbox");Us.isOpen(o)?sl.getCurrent(o).each(function(t){Sl.getHighlighted(t).fold(function(){e(t)},function(){Yr(o,t.element(),"keydown",n)})}):Eb(r,u(t),t,o,i,function(t){sl.getCurrent(t).each(e)},qv.HighlightFirst).get(tt)},o=Hb(r),u=function(o){return function(t){return t.map(function(t){var n=st(t.menus),e=j(n,function(t){return V(t.items,function(t){return"item"===t.type})});return Fm.getState(o).update(_(e,function(t){return t.data})),t})}},a=[Nm.config({}),Fm.config({onSetValue:r.onSetValue,store:io({mode:"dataset",getDataKey:function(t){return bu(t.element())},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,n){yu(t.element(),r.model.getDisplayText(n))}},r.initialData.map(function(t){return Tt("initialValue",t)}).getOr({}))}),bb.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(t,n){var e=mb.getCoupled(t,"sandbox");if(Nm.isFocused(t)&&bu(t.element()).length>=r.minChars){var o=sl.getCurrent(e).bind(function(t){return Sl.getHighlighted(t).map(Fm.getValue)});r.previewing.set(!0),Eb(r,u(t),t,e,i,function(t){sl.getCurrent(e).each(function(t){o.fold(function(){r.model.selectsOver&&Sl.highlightFirst(t)},function(n){Sl.highlightBy(t,function(t){return Fm.getValue(t).value===n.value}),Sl.getHighlighted(t).orThunk(function(){return Sl.highlightFirst(t),et.none()})})})},qv.HighlightFirst).get(tt)}},cancelEvent:Pn()}),pm.config({mode:"special",onDown:function(t,n){return e(t,n,Sl.highlightFirst),et.some(!0)},onEscape:function(t){var n=mb.getCoupled(t,"sandbox");return Us.isOpen(n)?(Us.close(n),et.some(!0)):et.none()},onUp:function(t,n){return e(t,n,Sl.highlightLast),et.some(!0)},onEnter:function(n){var t=mb.getCoupled(n,"sandbox"),e=Us.isOpen(t);if(e&&!r.previewing.get())return sl.getCurrent(t).bind(function(t){return Sl.getHighlighted(t)}).map(function(t){return Ur(n,Pb(),{item:t}),!0});var o=Fm.getValue(n);return jr(n,Pn()),r.onExecute(t,n,o),e&&Us.close(t),et.some(!0)}}),Jm.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),mb.config({others:{sandbox:function(t){return _b(r,t,{onOpen:function(){return Jm.on(t)},onClose:function(){return Jm.off(t)}})}}}),og("typeaheadevents",[yi(function(t){var n=tt;Bb(r,u(t),t,i,n,qv.HighlightFirst).get(tt)}),ai(Pb(),function(t,n){var e=mb.getCoupled(t,"sandbox");Mb(r.model,t,n.event().item()),jr(t,Pn()),r.onItemExecute(t,e,n.event().item(),Fm.getValue(t)),Us.close(e),Ib(t)})].concat(r.dismissOnBlur?[ai(Dn(),function(t){var n=mb.getCoupled(t,"sandbox");Rl(n.element()).isNone()&&Us.close(n)})]:[]))];return{uid:r.uid,dom:Nb(wt(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:io({},o,$s(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),Wb=function(t,n,e){var o=Xb(t,n,e);return fb.sketch(o)},Gb=function(t,n){return Wb(t,n,[])},Xb=function(t,n,e){return{dom:Yb(e),components:t.toArray().concat([n])}},Yb=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},qb=function(t,n){return fb.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}})},Kb=function(t){return"separator"===t.type},Jb={type:"separator"},$b=function(t,e){var n=U(t,function(t,n){return k(n)?""===n?t:"|"===n?0<t.length&&!Kb(t[t.length-1])?t.concat([Jb]):t:lt(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])},[]);return 0<n.length&&Kb(n[n.length-1])&&n.pop(),n},Qb=function(t,n){return lt(t,"getSubmenuItems")?(o=n,r=(e=t).getSubmenuItems(),i=Zb(r,o),{item:e,menus:wt(i.menus,Tt(e.value,i.items)),expansions:wt(i.expansions,Tt(e.value,e.value))}):{item:t,menus:{},expansions:{}};var e,o,r,i},Zb=function(t,r){var n=$b(k(t)?t.split(" "):t,r);return R(n,function(t,n){var e=function(t){if(Kb(t))return t;var n=Et(t,"value").getOrThunk(function(){return oo("generated-menu-item")});return wt({value:n},t)}(n),o=Qb(e,r);return{menus:wt(t.menus,o.menus),items:[o.item].concat(t.items),expansions:wt(t.expansions,o.expansions)}},{menus:{},expansions:{},items:[]})},ty=function(t,e,o){var n=oo("primary-menu"),r=Zb(t,o.shared.providers.menuItems());if(0===r.items.length)return et.none();var i=mv(n,r.items,e,o),u=it(r.menus,function(t,n){return mv(n,t,e,o)}),a=wt(u,Tt(n,i));return et.from(vg.tieredData(n,a,r.expansions))},ny=rl({name:"Input",configFields:Rb(),factory:function(t,n){return{uid:t.uid,dom:Nb(t),components:[],behaviours:(e=t,io({},Hb(e),$s(e.inputBehaviours,[Fm.config({store:{mode:"manual",initialValue:e.data.getOr(undefined),getValue:function(t){return bu(t.element())},setValue:function(t,n){bu(t.element())!==n&&yu(t.element(),n)}},onSetValue:e.onSetValue})]))),eventOrder:t.eventOrder};var e}}),ey=["input","textarea"],oy=function(t){var n=Fe(t);return T(ey,n)},ry=function(t,n){var e=n.getRoot(t).getOr(t.element());eu(e,n.invalidClass),n.notify.each(function(n){oy(t.element())&&ze(t.element(),"aria-invalid",!1),n.getContainer(t).each(function(t){Me(t,n.validHtml)}),n.onValid(t)})},iy=function(n,t,e,o){var r=t.getRoot(n).getOr(n.element());nu(r,t.invalidClass),t.notify.each(function(t){oy(n.element())&&ze(n.element(),"aria-invalid",!0),t.getContainer(n).each(function(t){Me(t,o)}),t.onInvalid(n,o)})},uy=function(n,t,e){return t.validator.fold(function(){return Sb.pure(vt.value(!0))},function(t){return t.validate(n)})},ay=function(n,e,t){return e.notify.each(function(t){t.onValidate(n)}),uy(n,e).map(function(t){return n.getSystem().isConnected()?t.fold(function(t){return iy(n,e,0,t),vt.error(t)},function(t){return ry(n,e),vt.value(t)}):vt.error("No longer in system")})},cy=/* */Object.freeze({markValid:ry,markInvalid:iy,query:uy,run:ay,isInvalid:function(t,n){var e=n.getRoot(t).getOr(t.element());return ou(e,n.invalidClass)}}),sy=/* */Object.freeze({events:function(n,t){return n.validator.map(function(t){return oi([ai(t.onEvent,function(t){ay(t,n).get(d)})].concat(t.validateOnLoad?[hi(function(t){ay(t,n).get(tt)})]:[]))}).getOr({})}}),fy=[hr("invalidClass"),Dr("getRoot",et.none),Ar("notify",[Dr("aria","alert"),Dr("getContainer",et.none),Dr("validHtml",""),Wu("onValid"),Wu("onInvalid"),Wu("onValidate")]),Ar("validator",[hr("validate"),Dr("onEvent","input"),Dr("validateOnLoad",!0)])],ly=ra({fields:fy,name:"invalidating",active:sy,apis:cy,extra:{validation:function(e){return function(t){var n=Fm.getValue(t);return Sb.pure(e(n))}}}}),dy=/* */Object.freeze({exhibit:function(t,n){return Li({attributes:Bt([{key:n.tabAttr,value:"true"}])})}}),my=[Dr("tabAttr","data-alloy-tabstop")],gy=ra({fields:my,name:"tabstopping",active:dy}),py=nt([hr("dom"),hr("fetch"),Wu("onOpen"),Gu("onExecute"),Dr("getHotspot",et.some),Dr("getAnchorOverrides",nt({})),Dr("layouts",et.none()),Ks("dropdownBehaviours",[Jm,mb,pm,Nm]),hr("toggleClass"),Dr("eventOrder",{}),Cr("lazySink"),Dr("matchWidth",!1),Dr("useMinWidth",!1),Cr("role")].concat(zb())),hy=nt([Bf({schema:[Lu()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Cb()]),vy=il({name:"Dropdown",configFields:py(),partFields:hy(),factory:function(n,t,e,o){var r,i,u=function(t){Us.getState(t).each(function(t){vg.highlightPrimary(t)})},a={expand:function(t){Jm.isOn(t)||Bb(n,function(t){return t},t,o,tt,qv.HighlightNone).get(tt)},open:function(t){Jm.isOn(t)||Bb(n,function(t){return t},t,o,tt,qv.HighlightFirst).get(tt)},isOpen:Jm.isOn,close:function(t){Jm.isOn(t)&&Bb(n,function(t){return t},t,o,tt,qv.HighlightFirst).get(tt)}},c=function(t,n){return Wr(t),et.some(!0)};return{uid:n.uid,dom:n.dom,components:t,behaviours:$s(n.dropdownBehaviours,[Jm.config({toggleClass:n.toggleClass,aria:{mode:"expanded"}}),mb.config({others:{sandbox:function(t){return _b(n,t,{onOpen:function(){Jm.on(t)},onClose:function(){Jm.off(t)}})}}}),pm.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,n){if(vy.isOpen(t)){var e=mb.getCoupled(t,"sandbox");u(e)}else vy.open(t);return et.some(!0)},onEscape:function(t,n){return vy.isOpen(t)?(vy.close(t),et.some(!0)):et.none()}}),Nm.config({})]),events:yg(et.some(function(t){Bb(n,function(t){return t},t,o,u,qv.HighlightFirst).get(tt)})),eventOrder:io({},n.eventOrder,(r={},r[Fn()]=["disabling","toggling","alloy.base.behaviour"],r)),apis:a,domModification:{attributes:io({"aria-haspopup":"true"},n.role.fold(function(){return{}},function(t){return{role:t}}),"button"===n.dom.tag?{type:(i="type",Et(n.dom,"attributes").bind(function(t){return Et(t,i)})).getOr("button")}:{})}}},apis:{open:function(t,n){return t.open(n)},expand:function(t,n){return t.expand(n)},close:function(t,n){return t.close(n)},isOpen:function(t,n){return t.isOpen(n)}}}),by=ra({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(t){return oi([ri(Zt(),nt(!0))])},exhibit:function(t,n){return Li({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),yy=oo("color-input-change"),xy=oo("color-swatch-change"),wy=oo("color-picker-cancel"),Sy=function(t,n,o){var e,r,i=fb.parts().field({factory:ny,inputClasses:["tox-textfield"],onSetValue:function(t){return ly.run(t).get(function(){})},inputBehaviours:ea([gy.config({}),ly.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return ye(t.element())},notify:{onValid:function(t){var n=Fm.getValue(t);Ur(t,yy,{color:n})}},validator:{validateOnLoad:!1,validate:function(t){var n=Fm.getValue(t);if(0===n.length)return Sb.pure(vt.value(!0));var e=Zn.fromTag("span");su(e,"background-color",n);var o=gu(e,"background-color").fold(function(){return vt.error("blah")},function(t){return vt.value(n)});return Sb.pure(o)}}})]),selectOnFocus:!1}),u=t.label.map(function(t){return qb(t,n.providers)}),a=function(t,n){Ur(t,xy,{value:n})},c=wg((e={dom:{tag:"span",attributes:{"aria-label":n.providers.translate("Color swatch")}},layouts:et.some({onRtl:function(){return[hc]},onLtr:function(){return[vc]}}),components:[],fetch:Uh.getFetch(o.getColors(),o.hasCustomColors()),columns:o.getColorCols(),presets:"color",onItemAction:function(t,e){c.getOpt(t).each(function(n){"custom"===e?o.colorPicker(function(t){t.fold(function(){return jr(n,wy)},function(t){a(n,t),Mh(t)})},"#ffffff"):a(n,"remove"===e?"":e)})}},r=n,vy.sketch({dom:e.dom,components:e.components,toggleClass:"mce-active",dropdownBehaviours:ea([by.config({}),gy.config({})]),layouts:e.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:r.getSink,fetch:function(n){return Sb.nu(function(t){return e.fetch(t)}).map(function(t){return et.from(gv(wt(Zh(oo("menu-value"),t,function(t){e.onItemAction(n,t)},e.columns,e.presets,Yp.CLOSE_ON_EXECUTE,function(){return!1},r.providers),{movement:nv(e.columns,e.presets)})))})},parts:{menu:Kh(0,0,e.presets)}})));return fb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:u.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[i,c.asSpec()]}]),fieldBehaviours:ea([og("form-field-events",[ai(yy,function(t,n){c.getOpt(t).each(function(t){su(t.element(),"background-color",n.event().color())})}),ai(xy,function(n,e){fb.getField(n).each(function(t){Fm.setValue(t,e.event().value()),sl.getCurrent(n).each(Nm.focus)})}),ai(wy,function(n,t){fb.getField(n).each(function(t){sl.getCurrent(n).each(Nm.focus)})})])])})},ky=function(t,n,e){return{hue:nt(t),saturation:nt(n),value:nt(e)}},Cy=nt(oo("rgb-hex-update")),Oy=nt(oo("slider-update")),Ey=nt(oo("palette-update")),Ty=Tn.detect().deviceType.isTouch(),By=Af({schema:[hr("dom")],name:"label"}),Ay=function(t){return Af({name:t+"-edge",overrides:function(o){return o.model.manager.edgeActions[t].fold(function(){return{}},function(e){var t=oi([ci(Ht(),e,[o])]),n=oi([ci(zt(),e,[o]),ci(Lt(),function(t,n){n.mouseIsDown.get()&&e(t,n)},[o])]);return{events:Ty?t:n}})}})},Dy=Ay("top-left"),_y=Ay("top"),My=Ay("top-right"),Fy=Ay("right"),Iy=Ay("bottom-right"),Vy=Ay("bottom"),Ry=Ay("bottom-left"),Hy=[By,Ay("left"),Fy,_y,Vy,Dy,My,Ry,Iy,Tf({name:"thumb",defaults:nt({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:oi([li(Ht(),t,"spectrum"),li(Nt(),t,"spectrum"),li(Pt(),t,"spectrum"),li(zt(),t,"spectrum"),li(Lt(),t,"spectrum"),li(Ut(),t,"spectrum")])}}}),Tf({schema:[Nr("mouseIsDown",function(){return _t(!1)})],name:"spectrum",overrides:function(e){var o=e.model.manager,r=function(n,t){return o.getValueFromEvent(t).map(function(t){return o.setValueFrom(n,e,t)})},t=oi([ai(Ht(),r),ai(Nt(),r)]),n=oi([ai(zt(),r),ai(Lt(),function(t,n){e.mouseIsDown.get()&&r(t,n)})]);return{behaviours:ea(Ty?[]:[pm.config({mode:"special",onLeft:function(t){return o.onLeft(t,e)},onRight:function(t){return o.onRight(t,e)},onUp:function(t){return o.onUp(t,e)},onDown:function(t){return o.onDown(t,e)}}),Nm.config({})]),events:Ty?t:n}}})],Ny=Tn.detect().deviceType.isTouch(),Py=nt("slider.change.value"),zy=function(t){var n=t.event().raw();if(Ny){var e=n;return e.touches!==undefined&&1===e.touches.length?et.some(e.touches[0]).map(function(t){return ma(t.clientX,t.clientY)}):et.none()}var o=n;return o.clientX!==undefined?et.some(o).map(function(t){return ma(t.clientX,t.clientY)}):et.none()},Ly=function(t,n,e,o){return t<n?t:e<t?e:t===n?n-1:Math.max(n,t-o)},jy=function(t,n,e,o){return e<t?t:t<n?n:t===e?e+1:Math.min(e,t+o)},Uy=function(t,n,e){return Math.max(n,Math.min(e,t))},Wy=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,f=t.hasMaxEdge,l=t.minBound,d=t.maxBound,m=t.screenRange,g=s?n-1:n,p=f?e+1:e;if(r<l)return g;if(d<r)return p;var h,v,b,y,x,w,S,k=(x=r,w=l,S=d,Math.min(S,Math.max(x,w))-w),C=Uy(k/m*o+n,g,p);return u&&n<=C&&C<=e?(h=C,v=n,b=e,y=i,a.fold(function(){var t=h-v,n=Math.round(t/y)*y;return Uy(v+n,v-1,b+1)},function(t){var n=(h-t)%y,e=Math.round(n/y),o=Math.floor((h-t)/y),r=Math.floor((b-t)/y),i=t+Math.min(r,o+e)*y;return Math.max(t,i)})):c?Math.round(C):C},Gy=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,f=t.centerMaxEdge;return r<n?i?0:s:e<r?u?a:f:(r-n)/o*c},Xy=function(t){return t.model.minX},Yy=function(t){return t.model.minY},qy=function(t){return t.model.minX-1},Ky=function(t){return t.model.minY-1},Jy=function(t){return t.model.maxX},$y=function(t){return t.model.maxY},Qy=function(t){return t.model.maxX+1},Zy=function(t){return t.model.maxY+1},tx=function(t,n,e){return n(t)-e(t)},nx=function(t){return tx(t,Jy,Xy)},ex=function(t){return tx(t,$y,Yy)},ox=function(t){return nx(t)/2},rx=function(t){return ex(t)/2},ix=function(t){return t.stepSize},ux=function(t){return t.snapToGrid},ax=function(t){return t.snapStart},cx=function(t){return t.rounded},sx=function(t,n){return t[n+"-edge"]!==undefined},fx=function(t){return sx(t,"left")},lx=function(t){return sx(t,"right")},dx=function(t){return sx(t,"top")},mx=function(t){return sx(t,"bottom")},gx=function(t){return t.model.value.get()},px=function(t){return{x:nt(t)}},hx=function(t){return{y:nt(t)}},vx=function(t,n){return{x:nt(t),y:nt(n)}},bx=function(t,n){Ur(t,Py(),{value:n})},yx="left",xx=function(t){return t.element().dom().getBoundingClientRect()},wx=function(t,n){return t[n]},Sx=function(t){var n=xx(t);return wx(n,yx)},kx=function(t){var n=xx(t);return wx(n,"right")},Cx=function(t){var n=xx(t);return wx(n,"top")},Ox=function(t){var n=xx(t);return wx(n,"bottom")},Ex=function(t){var n=xx(t);return wx(n,"width")},Tx=function(t){var n=xx(t);return wx(n,"height")},Bx=function(t,n,e){return(t+n)/2-e},Ax=function(t,n){var e=xx(t),o=xx(n),r=wx(e,yx),i=wx(e,"right"),u=wx(o,yx);return Bx(r,i,u)},Dx=function(t,n){var e=xx(t),o=xx(n),r=wx(e,"top"),i=wx(e,"bottom"),u=wx(o,"top");return Bx(r,i,u)},_x=function(t,n){Ur(t,Py(),{value:n})},Mx=function(t){return{x:nt(t)}},Fx=function(t,n,e){var o={min:Xy(n),max:Jy(n),range:nx(n),value:e,step:ix(n),snap:ux(n),snapStart:ax(n),rounded:cx(n),hasMinEdge:fx(n),hasMaxEdge:lx(n),minBound:Sx(t),maxBound:kx(t),screenRange:Ex(t)};return Wy(o)},Ix=function(u){return function(t,n){return(e=u,o=t,r=n,i=(0<e?jy:Ly)(gx(r).x(),Xy(r),Jy(r),ix(r)),_x(o,Mx(i)),et.some(i)).map(function(){return!0});var e,o,r,i}},Vx=function(t,n,e,o,r,i){var u,a,c,s,f,l,d,m,g,p=(a=i,c=e,s=o,f=r,l=Ex(u=n),d=s.bind(function(t){return et.some(Ax(t,u))}).getOr(0),m=f.bind(function(t){return et.some(Ax(t,u))}).getOr(l),g={min:Xy(a),max:Jy(a),range:nx(a),value:c,hasMinEdge:fx(a),hasMaxEdge:lx(a),minBound:Sx(u),minOffset:0,maxBound:kx(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m},Gy(g));return Sx(n)-Sx(t)+p},Rx=Ix(-1),Hx=Ix(1),Nx=et.none,Px=et.none,zx={"top-left":et.none(),top:et.none(),"top-right":et.none(),right:et.some(function(t,n){bx(t,px(Qy(n)))}),"bottom-right":et.none(),bottom:et.none(),"bottom-left":et.none(),left:et.some(function(t,n){bx(t,px(qy(n)))})},Lx=/* */Object.freeze({setValueFrom:function(t,n,e){var o=Fx(t,n,e),r=Mx(o);return _x(t,r),o},setToMin:function(t,n){var e=Xy(n);_x(t,Mx(e))},setToMax:function(t,n){var e=Jy(n);_x(t,Mx(e))},findValueOfOffset:Fx,getValueFromEvent:function(t){return zy(t).map(function(t){return t.left()})},findPositionOfValue:Vx,setPositionFromValue:function(t,n,e,o){var r=gx(e),i=Vx(t,o.getSpectrum(t),r.x(),o.getLeftEdge(t),o.getRightEdge(t),e),u=xa(n.element())/2;su(n.element(),"left",i-u+"px")},onLeft:Rx,onRight:Hx,onUp:Nx,onDown:Px,edgeActions:zx}),jx=function(t,n){Ur(t,Py(),{value:n})},Ux=function(t){return{y:nt(t)}},Wx=function(t,n,e){var o={min:Yy(n),max:$y(n),range:ex(n),value:e,step:ix(n),snap:ux(n),snapStart:ax(n),rounded:cx(n),hasMinEdge:dx(n),hasMaxEdge:mx(n),minBound:Cx(t),maxBound:Ox(t),screenRange:Tx(t)};return Wy(o)},Gx=function(u){return function(t,n){return(e=u,o=t,r=n,i=(0<e?jy:Ly)(gx(r).y(),Yy(r),$y(r),ix(r)),jx(o,Ux(i)),et.some(i)).map(function(){return!0});var e,o,r,i}},Xx=function(t,n,e,o,r,i){var u,a,c,s,f,l,d,m,g,p=(a=i,c=e,s=o,f=r,l=Tx(u=n),d=s.bind(function(t){return et.some(Dx(t,u))}).getOr(0),m=f.bind(function(t){return et.some(Dx(t,u))}).getOr(l),g={min:Yy(a),max:$y(a),range:ex(a),value:c,hasMinEdge:dx(a),hasMaxEdge:mx(a),minBound:Cx(u),minOffset:0,maxBound:Ox(u),maxOffset:l,centerMinEdge:d,centerMaxEdge:m},Gy(g));return Cx(n)-Cx(t)+p},Yx=et.none,qx=et.none,Kx=Gx(-1),Jx=Gx(1),$x={"top-left":et.none(),top:et.some(function(t,n){bx(t,hx(Ky(n)))}),"top-right":et.none(),right:et.none(),"bottom-right":et.none(),bottom:et.some(function(t,n){bx(t,hx(Zy(n)))}),"bottom-left":et.none(),left:et.none()},Qx=/* */Object.freeze({setValueFrom:function(t,n,e){var o=Wx(t,n,e),r=Ux(o);return jx(t,r),o},setToMin:function(t,n){var e=Yy(n);jx(t,Ux(e))},setToMax:function(t,n){var e=$y(n);jx(t,Ux(e))},findValueOfOffset:Wx,getValueFromEvent:function(t){return zy(t).map(function(t){return t.top()})},findPositionOfValue:Xx,setPositionFromValue:function(t,n,e,o){var r=gx(e),i=Xx(t,o.getSpectrum(t),r.y(),o.getTopEdge(t),o.getBottomEdge(t),e),u=ka(n.element())/2;su(n.element(),"top",i-u+"px")},onLeft:Yx,onRight:qx,onUp:Kx,onDown:Jx,edgeActions:$x}),Zx=function(t,n){Ur(t,Py(),{value:n})},tw=function(t,n){return{x:nt(t),y:nt(n)}},nw=function(s,f){return function(t,n){return(e=s,o=f,r=t,i=n,u=0<e?jy:Ly,a=o?gx(i).x():u(gx(i).x(),Xy(i),Jy(i),ix(i)),c=o?u(gx(i).y(),Yy(i),$y(i),ix(i)):gx(i).y(),Zx(r,tw(a,c)),et.some(a)).map(function(){return!0});var e,o,r,i,u,a,c}},ew=nw(-1,!1),ow=nw(1,!1),rw=nw(-1,!0),iw=nw(1,!0),uw={"top-left":et.some(function(t,n){bx(t,vx(qy(n),Ky(n)))}),top:et.some(function(t,n){bx(t,vx(ox(n),Ky(n)))}),"top-right":et.some(function(t,n){bx(t,vx(Qy(n),Ky(n)))}),right:et.some(function(t,n){bx(t,vx(Qy(n),rx(n)))}),"bottom-right":et.some(function(t,n){bx(t,vx(Qy(n),Zy(n)))}),bottom:et.some(function(t,n){bx(t,vx(ox(n),Zy(n)))}),"bottom-left":et.some(function(t,n){bx(t,vx(qy(n),Zy(n)))}),left:et.some(function(t,n){bx(t,vx(qy(n),rx(n)))})},aw=/* */Object.freeze({setValueFrom:function(t,n,e){var o=Fx(t,n,e.left()),r=Wx(t,n,e.top()),i=tw(o,r);return Zx(t,i),i},setToMin:function(t,n){var e=Xy(n),o=Yy(n);Zx(t,tw(e,o))},setToMax:function(t,n){var e=Jy(n),o=$y(n);Zx(t,tw(e,o))},getValueFromEvent:function(t){return zy(t)},setPositionFromValue:function(t,n,e,o){var r=gx(e),i=Vx(t,o.getSpectrum(t),r.x(),o.getLeftEdge(t),o.getRightEdge(t),e),u=Xx(t,o.getSpectrum(t),r.y(),o.getTopEdge(t),o.getBottomEdge(t),e),a=xa(n.element())/2,c=ka(n.element())/2;su(n.element(),"left",i-a+"px"),su(n.element(),"top",u-c+"px")},onLeft:ew,onRight:ow,onUp:rw,onDown:iw,edgeActions:uw}),cw=Tn.detect().deviceType.isTouch(),sw=[Dr("stepSize",1),Dr("onChange",tt),Dr("onChoose",tt),Dr("onInit",tt),Dr("onDragStart",tt),Dr("onDragEnd",tt),Dr("snapToGrid",!1),Dr("rounded",!0),Cr("snapStart"),vr("model",cr("mode",{x:[Dr("minX",0),Dr("maxX",100),Nr("value",function(t){return _t(t.mode.minX)}),hr("getInitialValue"),qu("manager",Lx)],y:[Dr("minY",0),Dr("maxY",100),Nr("value",function(t){return _t(t.mode.minY)}),hr("getInitialValue"),qu("manager",Qx)],xy:[Dr("minX",0),Dr("maxX",100),Dr("minY",0),Dr("maxY",100),Nr("value",function(t){return _t({x:nt(t.mode.minX),y:nt(t.mode.minY)})}),hr("getInitialValue"),qu("manager",aw)]})),Ks("sliderBehaviours",[pm,Fm])].concat(cw?[]:[Nr("mouseIsDown",function(){return _t(!1)})]),fw=Tn.detect().deviceType.isTouch(),lw=il({name:"Slider",configFields:sw,partFields:Hy,factory:function(i,t,n,e){var u=function(t){return jf(t,i,"thumb")},a=function(t){return jf(t,i,"spectrum")},o=function(t){return Lf(t,i,"left-edge")},r=function(t){return Lf(t,i,"right-edge")},c=function(t){return Lf(t,i,"top-edge")},s=function(t){return Lf(t,i,"bottom-edge")},f=i.model,l=f.manager,d=function(t,n){l.setPositionFromValue(t,n,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})},m=function(t,n){f.value.set(n);var e=u(t);return d(t,e),i.onChange(t,e,n),et.some(!0)},g=[ai(Ht(),function(t,n){i.onDragStart(t,u(t))}),ai(Pt(),function(t,n){i.onDragEnd(t,u(t))})],p=[ai(zt(),function(t,n){n.stop(),i.onDragStart(t,u(t)),i.mouseIsDown.set(!0)}),ai(Ut(),function(t,n){i.onDragEnd(t,u(t))})],h=fw?g:p;return{uid:i.uid,dom:i.dom,components:t,behaviours:$s(i.sliderBehaviours,L([fw?[]:[pm.config({mode:"special",focusIn:function(t){return Lf(t,i,"spectrum").map(pm.focusIn).map(nt(!0))}})],[Fm.config({store:{mode:"manual",getValue:function(t){return f.value.get()}}}),fa.config({channels:{"mouse.released":{onReceive:function(e,t){var n=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&Lf(e,i,"thumb").each(function(t){var n=f.value.get();i.onChoose(e,t,n)})}}}})]])),events:oi([ai(Py(),function(t,n){m(t,n.event().value())}),hi(function(t,n){var e=f.getInitialValue();f.value.set(e);var o=u(t);d(t,o);var r=a(t);i.onInit(t,o,r,f.value.get())})].concat(h)),apis:{resetToMin:function(t){l.setToMin(t,i)},resetToMax:function(t){l.setToMax(t,i)},changeValue:m,refresh:d},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(t,n){t.resetToMin(n)},resetToMax:function(t,n){t.resetToMax(n)},refresh:function(t,n){t.refresh(n)}}}),dw=function(t,n){var e=lw.parts().spectrum({dom:{tag:"div",classes:[n("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=lw.parts().thumb({dom:{tag:"div",classes:[n("hue-slider-thumb")],attributes:{role:"presentation"}}});return lw.sketch({dom:{tag:"div",classes:[n("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:nt({y:nt(0)})},components:[e,o],sliderBehaviours:ea([Nm.config({})]),onChange:function(t,n,e){Ur(t,Oy(),{value:e})}})},mw=[Ks("formBehaviours",[Fm])],gw=function(t){return"<alloy.field."+t+">"},pw=function(o,t,n){return{uid:o.uid,dom:o.dom,components:t,behaviours:$s(o.formBehaviours,[Fm.config({store:{mode:"manual",getValue:function(t){var n=Wf(t,o);return it(n,function(t,n){return t().bind(function(t){var n,e=sl.getCurrent(t);return n="missing current",e.fold(function(){return vt.error(n)},vt.value)}).map(Fm.getValue)})},setValue:function(e,t){rt(t,function(n,t){Lf(e,o,t).each(function(t){sl.getCurrent(t).each(function(t){Fm.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return Lf(t,o,n).bind(sl.getCurrent)}}}},hw={getField:Hi(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),Rf("form",gw(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=_(r,function(t){return Tf({name:t,pname:gw(t)})});return $f("form",mw,i,pw,o)}},vw=oo("valid-input"),bw=oo("invalid-input"),yw=oo("validating-input"),xw="colorcustom.rgb.",ww=function(d,m,g,p){var h=function(t,n,e,o,r){var i,u,a=d(xw+"range"),c=[fb.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),fb.parts().field({data:r,factory:ny,inputAttributes:io({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:ea([(i=n,u=t,ly.config({invalidClass:m("invalid"),notify:{onValidate:function(t){Ur(t,yw,{type:i})},onValid:function(t){Ur(t,vw,{type:i,value:Fm.getValue(t)})},onInvalid:function(t){Ur(t,bw,{type:i,value:Fm.getValue(t)})}},validator:{validate:function(t){var n=Fm.getValue(t),e=u(n)?vt.value(!0):vt.error(d("aria.input.invalid"));return Sb.pure(e)},validateOnLoad:!1}})),gy.config({})]),onSetValue:function(t){ly.isInvalid(t)&&ly.run(t).get(tt)}})],s="hex"!==n?[fb.parts()["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}},v=function(t,n){var e=n.red(),o=n.green(),r=n.blue();Fm.setValue(t,{red:e,green:o,blue:r})},b=wg({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),y=function(t,n){b.getOpt(t).each(function(t){su(t.element(),"background-color","#"+n.value())})};return rl({factory:function(){var e={red:nt(_t(et.some(255))),green:nt(_t(et.some(255))),blue:nt(_t(et.some(255))),hex:nt(_t(et.some("ffffff")))},o=function(t){return e[t]().get()},i=function(t,n){e[t]().set(n)},r=function(t){var n=t.red(),e=t.green(),o=t.blue();i("red",et.some(n)),i("green",et.some(e)),i("blue",et.some(o))},n=function(t,n){var e=n.event();"hex"!==e.type()?i(e.type(),et.none()):p(t)},u=function(r,t,n){var e=parseInt(n,10);i(t,et.some(e)),o("red").bind(function(e){return o("green").bind(function(n){return o("blue").map(function(t){return gh(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=ch(t),hw.getField(n,"hex").each(function(t){Nm.isFocused(t)||Fm.setValue(n,{hex:e.value()})}),e);y(r,o)})},a=function(t,n){var e=n.event();"hex"===e.type()?function(t,n){g(t);var e=eh(n);i("hex",et.some(n));var o=vh(e);v(t,o),r(o),Ur(t,Cy(),{hex:e}),y(t,e)}(t,e.value()):u(t,e.type(),e.value())},t=function(t){return{label:d(xw+t+".label"),description:d(xw+t+".description")}},c=t("red"),s=t("green"),f=t("blue"),l=t("hex");return wt(hw.sketch(function(t){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[t.field("red",fb.sketch(h(ph,"red",c.label,c.description,255))),t.field("green",fb.sketch(h(ph,"green",s.label,s.description,255))),t.field("blue",fb.sketch(h(ph,"blue",f.label,f.description,255))),t.field("hex",fb.sketch(h(ih,"hex",l.label,l.description,"ffffff"))),b.asSpec()],formBehaviours:ea([ly.config({invalidClass:m("form-invalid")}),og("rgb-form-events",[ai(vw,a),ai(bw,n),ai(yw,n)])])}}),{apis:{updateHex:function(t,n){var e,o;Fm.setValue(t,{hex:n.value()}),e=t,o=vh(n),v(e,o),r(o),y(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},Sw=function(t,o){var r=lw.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=lw.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"<div class="+o("sv-palette-inner-thumb")+' role="presentation"></div>'}}),u=function(t,n){var e=t.width,o=t.height,r=t.getContext("2d");if(null!==r){r.fillStyle=n,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)}};return rl({factory:function(t){var n=nt({x:nt(0),y:nt(0)}),e=ea([sl.config({find:et.some}),Nm.config({})]);return lw.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:n},rounded:!1,components:[r,i],onChange:function(t,n,e){Ur(t,Ey(),{value:e})},onInit:function(t,n,e,o){u(e.element().dom(),yh(xh()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element().dom(),u(r,yh(o))}},extraApis:{}})},kw=function(c,s){return rl({name:"ColourPicker",configFields:[hr("dom"),Dr("onValidHex",tt),Dr("onInvalidHex",tt)],factory:function(t){var a,v,e=ww(c,s,t.onValidHex,t.onInvalidHex),o=Sw(c,s),b={paletteRgba:nt(_t(xh()))},n=wg(o.sketch({})),r=wg(e.sketch({})),i=function(t,e){n.getOpt(t).each(function(t){var n=vh(e);b.paletteRgba().set(n),o.setRgba(t,n)})},u=function(t,n){r.getOpt(t).each(function(t){e.updateHex(t,n)})},y=function(n,e,t){M(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[n.asSpec(),dw(c,s),r.asSpec()],behaviours:ea([og("colour-picker-events",[ai(Ey(),(v=[u],function(t,n){var e,o,r,i,u,a,c,s,f,l=n.event().value(),d=b.paletteRgba().get(),m=(i=r=0,u=(e=d).red()/255,a=e.green()/255,c=e.blue()/255,s=Math.min(u,Math.min(a,c)),f=Math.max(u,Math.max(a,c)),s===f?ky(0,0,100*(i=s)):(r=60*((r=u===s?3:c===s?1:5)-(u===s?a-c:c===s?u-a:c-u)/(f-s)),o=(f-s)/f,i=f,ky(Math.round(r),Math.round(100*o),Math.round(100*i)))),g=ky(m.hue(),l.x(),100-l.y()),p=hh(g),h=ch(p);y(t,h,v)})),ai(Oy(),(a=[i,u],function(t,n){var e,o,r,i=n.event().value(),u=(e=i.y(),o=ky((100-e)/100*360,100,100),r=hh(o),ch(r));y(t,u,a)}))]),sl.config({find:function(t){return r.getOpt(t)}}),pm.config({mode:"acyclic"})])}}})},Cw=function(){return sl.config({find:et.some})},Ow=function(t){return sl.config({find:t.getOpt})},Ew=function(t){return sl.config({find:function(n){return ke(n.element(),t).bind(function(t){return n.getSystem().getByDom(t).toOption()})}})},Tw={"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"},Bw=function(t){return Tw[t]},Aw=Uo([Dr("preprocess",d),Dr("postprocess",d)]),Dw=function(t,n,e){return Fm.config(wt({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},_w=function(t,n,e){return Dw(t,function(t){return n(t.element())},function(t,n){return e(t.element(),n)})},Mw=function(r,t){var i=ur("RepresentingConfigs.memento processors",Aw,t);return Fm.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=Fm.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);Fm.setValue(o,e)}}})},Fw=Dw,Iw=function(t){return _w(t,_e,Me)},Vw=function(t){return Fm.config({store:{mode:"memory",initialValue:t}})},Rw=function(r,n){var e=function(t,n){n.stop()},o=function(t){return function(n,e){M(t,function(t){t(n,e)})}},i=function(t,n){if(!Np.isDisabled(t)){var e=n.event().raw();a(t,e.dataTransfer.files)}},u=function(t,n){var e=n.event().raw().target.files;a(t,e)},a=function(t,n){var e,o;Fm.setValue(t,(e=n,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),V(Q(e),function(t){return o.test(t.name)}))),Ur(t,Zv,{name:r.name})},c=wg({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ea([og("input-file-events",[mi(Rn())])])}),t=r.label.map(function(t){return qb(t,n)}),s=fb.parts().field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ea([Vw([]),Cw(),Np.config({}),Jm.config({toggleClass:"dragenter",toggleOnExecute:!1}),og("dropzone-events",[ai("dragenter",o([e,Jm.toggle])),ai("dragleave",o([e,Jm.toggle])),ai("dragover",e),ai("drop",o([e,i])),ai(Jt(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:n.translate("Drop an image here")}},xg.sketch({dom:{tag:"button",innerHtml:n.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element().dom().click()},buttonBehaviours:ea([gy.config({})])})]}]}}}});return Wb(t,s,["tox-form__group--stretched"])},Hw=oo("alloy-fake-before-tabstop"),Nw=oo("alloy-fake-after-tabstop"),Pw=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:ea([Nm.config({ignore:!0}),gy.config({})])}},zw=function(t,n){Ur(t,Yt(),{raw:{which:9,shiftKey:n}})},Lw=function(t){return Sv(t,["."+Hw,"."+Nw].join(","),nt(!1))},jw=function(t,n){var e=n.element();ou(e,Hw)?zw(t,!0):ou(e,Nw)&&zw(t,!1)},Uw=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[Pw([Hw]),t,Pw([Nw])],behaviours:ea([Ew(1)])}},Ww=!(Tn.detect().browser.isIE()||Tn.detect().browser.isEdge()),Gw=function(t,n){var o,r,e=Ww&&t.sandboxed,i=io({},t.label.map(function(t){return{title:t}}).getOr({}),e?{sandbox:"allow-scripts allow-same-origin"}:{}),u=(o=e,r=_t(""),{getValue:function(t){return r.get()},setValue:function(t,n){if(o)ze(t.element(),"src","data:text/html;charset=utf-8,"+encodeURIComponent(n));else{ze(t.element(),"src","javascript:''");var e=t.element().dom().contentWindow.document;e.open(),e.write(n),e.close()}r.set(n)}}),a=t.label.map(function(t){return qb(t,n)}),c=fb.parts().field({factory:{sketch:function(t){return Uw({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:ea([gy.config({}),Nm.config({}),Fw(et.none(),u.getValue,u.setValue)])})}}});return Wb(a,c,["tox-form__group--stretched"])};function Xw(t,n){return Kw(x.document.createElement("canvas"),t,n)}function Yw(t){var n=Xw(t.width,t.height);return qw(n).drawImage(t,0,0),n}function qw(t){return t.getContext("2d")}function Kw(t,n,e){return t.width=n,t.height=e,t}var Jw={atob:function(t){return ue.getOrDie("atob")(t)},requestAnimationFrame:function(t){ue.getOrDie("requestAnimationFrame")(t)}};function $w(t){return t.naturalWidth||t.width}function Qw(t){return t.naturalHeight||t.height}var Zw=window.Promise?window.Promise:function(){var i=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(t,o(r,this),o(a,this))},t=i.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(t){x.setTimeout(t,1)};function o(t,n){return function(){return t.apply(n,arguments)}}var e=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function u(o){var r=this;null!==this._state?t(function(){var t=r._state?o.onFulfilled:o.onRejected;if(null!==t){var n;try{n=t(r._value)}catch(e){return void o.reject(e)}o.resolve(n)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void f(o(n,t),o(r,this),o(a,this))}this._state=!0,this._value=t,c.call(this)}catch(e){a.call(this,e)}}function a(t){this._state=!1,this._value=t,c.call(this)}function c(){for(var t=0,n=this._deferreds;t<n.length;t++){var e=n[t];u.call(this,e)}this._deferreds=[]}function s(t,n,e,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof n?n:null,this.resolve=e,this.reject=o}function f(t,n,e){var o=!1;try{t(function(t){o||(o=!0,n(t))},function(t){o||(o=!0,e(t))})}catch(r){if(o)return;o=!0,e(r)}}return i.prototype["catch"]=function(t){return this.then(null,t)},i.prototype.then=function(e,o){var r=this;return new i(function(t,n){u.call(r,new s(e,o,t,n))})},i.all=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var c=Array.prototype.slice.call(1===t.length&&e(t[0])?t[0]:t);return new i(function(r,i){if(0===c.length)return r([]);var u=c.length;function a(n,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void e.call(t,function(t){a(n,t)},i)}c[n]=t,0==--u&&r(c)}catch(o){i(o)}}for(var t=0;t<c.length;t++)a(t,c[t])})},i.resolve=function(n){return n&&"object"==typeof n&&n.constructor===i?n:new i(function(t){t(n)})},i.reject=function(e){return new i(function(t,n){n(e)})},i.race=function(r){return new i(function(t,n){for(var e=0,o=r;e<o.length;e++)o[e].then(t,n)})},i}();function tS(t){var n=t.split(","),e=/data:([^;]+)/.exec(n[0]);if(!e)return et.none();for(var o,r=e[1],i=n[1],u=Jw.atob(i),a=u.length,c=Math.ceil(a/1024),s=new Array(c),f=0;f<c;++f){for(var l=1024*f,d=Math.min(l+1024,a),m=new Array(d-l),g=l,p=0;g<d;++p,++g)m[p]=u[g].charCodeAt(0);s[f]=(o=m,new(ue.getOrDie("Uint8Array"))(o))}return et.some(function h(t,n){return new(ue.getOrDie("Blob"))(t,n)}(s,{type:r}))}function nS(e){return new Zw(function(t,n){tS(e).fold(function(){n("uri is not base64: "+e)},t)})}function eS(t,o,r){return o=o||"image/png",x.HTMLCanvasElement.prototype.toBlob?new Zw(function(n,e){t.toBlob(function(t){t?n(t):e()},o,r)}):nS(t.toDataURL(o,r))}function oS(t){return function n(a){return new Zw(function(t,n){var e=x.URL.createObjectURL(a),o=new x.Image,r=function(){o.removeEventListener("load",i),o.removeEventListener("error",u)};function i(){r(),t(o)}function u(){r(),n("Unable to load data of type "+a.type+": "+e)}o.addEventListener("load",i),o.addEventListener("error",u),o.src=e,o.complete&&i()})}(t).then(function(t){!function e(t){x.URL.revokeObjectURL(t.src)}(t);var n=Xw($w(t),Qw(t));return qw(n).drawImage(t,0,0),n})}function rS(o){return new Zw(function(t){var n=function e(){return new(ue.getOrDie("FileReader"))}();n.onloadend=function(){t(n.result)},n.readAsDataURL(o)})}function iS(t,n,e){var o=n.type;function r(n,e){return t.then(function(t){return function o(t,n,e){return n=n||"image/png",t.toDataURL(n,e)}(t,n,e)})}return{getType:nt(o),toBlob:function i(){return Zw.resolve(n)},toDataURL:function u(){return e},toBase64:function a(){return e.split(",")[1]},toAdjustedBlob:function c(n,e){return t.then(function(t){return eS(t,n,e)})},toAdjustedDataURL:r,toAdjustedBase64:function s(t,n){return r(t,n).then(function(t){return t.split(",")[1]})},toCanvas:function f(){return t.then(Yw)}}}function uS(n){return rS(n).then(function(t){return iS(oS(n),n,t)})}function aS(n,t){return eS(n,t).then(function(t){return iS(Zw.resolve(n),t,n.toDataURL())})}function cS(t,n,e){var o="string"==typeof t?parseFloat(t):t;return e<o?o=e:o<n&&(o=n),o}(function n_(t){return sH().then(function(t){return uS(t)})});var sS=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10];function fS(t,n){for(var e,o=[],r=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)o[u]=n[u+5*i];for(u=0;u<5;u++){for(var a=e=0;a<5;a++)e+=t[u+5*a]*o[a];r[u+5*i]=e}}return r}function lS(n,e){return n.toCanvas().then(function(t){return function i(t,n,e){var o=qw(t),r=function B(t,n){for(var e,o,r,i,u=t.data,a=n[0],c=n[1],s=n[2],f=n[3],l=n[4],d=n[5],m=n[6],g=n[7],p=n[8],h=n[9],v=n[10],b=n[11],y=n[12],x=n[13],w=n[14],S=n[15],k=n[16],C=n[17],O=n[18],E=n[19],T=0;T<u.length;T+=4)e=u[T],o=u[T+1],r=u[T+2],i=u[T+3],u[T]=e*a+o*c+r*s+i*f+l,u[T+1]=e*d+o*m+r*g+i*p+h,u[T+2]=e*v+o*b+r*y+i*x+w,u[T+3]=e*S+o*k+r*C+i*O+E;return t}(o.getImageData(0,0,t.width,t.height),e);return o.putImageData(r,0,0),aS(t,n)}(t,n.getType(),e)})}function dS(n,e){return n.toCanvas().then(function(t){return function u(t,n,e){var o=qw(t),r=o.getImageData(0,0,t.width,t.height),i=o.getImageData(0,0,t.width,t.height);return i=function S(t,n,e){function o(t,n,e){return e<t?t=e:t<n&&(t=n),t}for(var r=Math.round(Math.sqrt(e.length)),i=Math.floor(r/2),u=t.data,a=n.data,c=t.width,s=t.height,f=0;f<s;f++)for(var l=0;l<c;l++){for(var d=0,m=0,g=0,p=0;p<r;p++)for(var h=0;h<r;h++){var v=o(l+h-i,0,c-1),b=o(f+p-i,0,s-1),y=4*(b*c+v),x=e[p*r+h];d+=u[y]*x,m+=u[y+1]*x,g+=u[y+2]*x}var w=4*(f*c+l);a[w]=o(d,0,255),a[w+1]=o(m,0,255),a[w+2]=o(g,0,255)}return n}(r,i,e),o.putImageData(i,0,0),aS(t,n)}(t,n.getType(),e)})}function mS(e){return function(t,n){return lS(t,e([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n))}}var gS=function e_(n){return function(t){return lS(t,n)}}([-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1]),pS=mS(function o_(t,n){return fS(t,[1,0,0,0,n=cS(255*n,-255,255),0,1,0,0,n,0,0,1,0,n,0,0,0,1,0,0,0,0,0,1])}),hS=mS(function r_(t,n){var e;return n=cS(n,-1,1),fS(t,[(e=(n*=100)<0?127+n/100*127:127*(e=0==(e=n%1)?sS[n]:sS[Math.floor(n)]*(1-e)+sS[Math.floor(n)+1]*e)+127)/127,0,0,0,.5*(127-e),0,e/127,0,0,.5*(127-e),0,0,e/127,0,.5*(127-e),0,0,0,1,0,0,0,0,0,1])}),vS=function(t,n,e,o){return lS(t,function r(t,n,e,o){return fS(t,[n=cS(n,0,2),0,0,0,0,0,e=cS(e,0,2),0,0,0,0,0,o=cS(o,0,2),0,0,0,0,0,1,0,0,0,0,0,1])}([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],n,e,o))},bS=function i_(n){return function(t){return dS(t,n)}}([0,-1,0,-1,5,-1,0,-1,0]),yS=function u_(c){return function(n,e){return n.toCanvas().then(function(t){return function(t,n,e){for(var o=qw(t),r=new Array(256),i=0;i<r.length;i++)r[i]=c(i,e);var u=function a(t,n){for(var e=t.data,o=0;o<e.length;o+=4)e[o]=n[e[o]],e[o+1]=n[e[o+1]],e[o+2]=n[e[o+2]];return t}(o.getImageData(0,0,t.width,t.height),r);return o.putImageData(u,0,0),aS(t,n)}(t,n.getType(),e)})}}(function(t,n){return 255*Math.pow(t/255,1-n)});function xS(t,n,e){var o=$w(t),r=Qw(t),i=n/o,u=e/r,a=!1;(i<.5||2<i)&&(i=i<.5?.5:2,a=!0),(u<.5||2<u)&&(u=u<.5?.5:2,a=!0);var c=function f(a,c,s){return new Zw(function(t){var n=$w(a),e=Qw(a),o=Math.floor(n*c),r=Math.floor(e*s),i=Xw(o,r),u=qw(i);u.drawImage(a,0,0,n,e,0,0,o,r),t(i)})}(t,i,u);return a?c.then(function(t){return xS(t,n,e)}):c}function wS(n,e){return n.toCanvas().then(function(t){return function a(t,n,e){var o=Xw(t.width,t.height),r=qw(o),i=0,u=0;return 90!==(e=e<0?360+e:e)&&270!==e||Kw(o,o.height,o.width),90!==e&&180!==e||(i=o.width),270!==e&&180!==e||(u=o.height),r.translate(i,u),r.rotate(e*Math.PI/180),r.drawImage(t,0,0),aS(o,n)}(t,n.getType(),e)})}function SS(n,e){return n.toCanvas().then(function(t){return function i(t,n,e){var o=Xw(t.width,t.height),r=qw(o);return"v"===e?(r.scale(1,-1),r.drawImage(t,0,-o.height)):(r.scale(-1,1),r.drawImage(t,-o.width,0)),aS(o,n)}(t,n.getType(),e)})}function kS(n,e,o,r,i){return n.toCanvas().then(function(t){return function a(t,n,e,o,r,i){var u=Xw(r,i);return qw(u).drawImage(t,-e,-o),aS(u,n)}(t,n.getType(),e,o,r,i)})}var CS=function(t){return gS(t)},OS=function(t){return bS(t)},ES=function(t,n){return yS(t,n)},TS=function(t,n){return pS(t,n)},BS=function(t,n){return hS(t,n)},AS=function(t,n){return SS(t,n)},DS=function(t,n,e){return function r(n,e,o){return n.toCanvas().then(function(t){return xS(t,e,o).then(function(t){return aS(t,n.getType())})})}(t,n,e)},_S=function(t,n){return wS(t,n)},MS=function(t,n){return io({dom:{tag:"span",innerHtml:t,classes:["tox-icon","tox-tbtn__icon-wrap"]}},n)},FS=function(t,n){return MS(kg(t,n),{})},IS=function(t,n){return MS(kg(t,n),{behaviours:ea([xm.config({})])})},VS=function(t,n,e){return{dom:{tag:"span",innerHtml:e.translate(t),classes:[n+"__select-label"]},behaviours:ea([xm.config({})])}},RS=function(t,n,e,o,r){void 0===e&&(e=[]);var i=n.fold(function(){return{}},function(t){return{action:t}}),u=io({buttonBehaviours:ea([zp(t.disabled),gy.config({}),og("button press",[ui("click"),ui("mousedown")])].concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},i),a=wt(u,{dom:o});return wt(a,{components:r})},HS=function(t,n,e,o){void 0===o&&(o=[]);var r={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map(function(t){return{"aria-label":e.translate(t),title:e.translate(t)}}).getOr({})},i=t.icon.map(function(t){return FS(t,e.icons)}),u=Kp([i]);return RS(t,n,o,r,u)},NS=function(t,n,e,o){void 0===o&&(o=[]);var r=HS(t,et.some(n),e,o);return xg.sketch(r)},PS=function(t,n,e,o){void 0===o&&(o=[]);var r=e.translate(t.text),i=t.icon?t.icon.map(function(t){return FS(t,e.icons)}):et.none(),u=i.isSome()?Kp([i]):[],a=i.isSome()?{}:{innerHtml:r},c=(t.primary?["tox-button"]:["tox-button","tox-button--secondary"]).concat(i.isSome()?["tox-button--icon"]:[]);return function(t,n,e,o,r){void 0===e&&(e=[]);var i=RS(t,et.some(n),e,o,r);return xg.sketch(i)}(t,n,o,io({tag:"button",classes:c},a,{attributes:{title:r}}),u)},zS=function(n,e){return function(t){"custom"===e?Ur(t,eb,{name:n,value:{}}):"submit"===e?jr(t,ob):"cancel"===e?jr(t,nb):x.console.error("Unknown button type: ",e)}},LS=function(t,n,e){var o=zS(t.name,n);return PS(t,o,e,[])},jS=nt([Dr("field1Name","field1"),Dr("field2Name","field2"),Xu("onLockedChange"),ju(["lockClass"]),Dr("locked",!1),Qs.field("coupledFieldBehaviours",[sl,Fm])]),US=function(t,i){return Tf({factory:fb,name:t,overrides:function(r){return{fieldBehaviours:ea([og("coupled-input-behaviour",[ai(Kt(),function(e){var t,n,o;(t=e,n=r,o=i,Lf(t,n,o).bind(sl.getCurrent)).each(function(n){Lf(e,r,"lock").each(function(t){Jm.isOn(t)&&r.onLockedChange(e,n,t)})})})])])}}})},WS=nt([US("field1","field2"),US("field2","field1"),Tf({factory:xg,schema:[hr("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:ea([Jm.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),GS=il({name:"FormCoupledInputs",configFields:jS(),partFields:WS(),factory:function(o,t,n,e){return{uid:o.uid,dom:o.dom,components:t,behaviours:Qs.augment(o.coupledFieldBehaviours,[sl.config({find:et.some}),Fm.config({store:{mode:"manual",getValue:function(t){var n,e=Xf(t,o,["field1","field2"]);return(n={})[o.field1Name]=Fm.getValue(e.field1()),n[o.field2Name]=Fm.getValue(e.field2()),n},setValue:function(t,n){var e=Xf(t,o,["field1","field2"]);Dt(n,o.field1Name)&&Fm.setValue(e.field1(),n[o.field1Name]),Dt(n,o.field2Name)&&Fm.setValue(e.field2(),n[o.field2Name])}}})]),apis:{getField1:function(t){return Lf(t,o,"field1")},getField2:function(t){return Lf(t,o,"field2")},getLock:function(t){return Lf(t,o,"lock")}}}},apis:{getField1:function(t,n){return t.getField1(n)},getField2:function(t,n){return t.getField2(n)},getLock:function(t,n){return t.getLock(n)}}}),XS=function(t){var n=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null===n)return vt.error(t);var e=parseFloat(n[1]),o=n[2];return vt.value({value:e,unit:o})},YS=function(t,n){var e={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,"in":1},o=function(t){return Object.prototype.hasOwnProperty.call(e,t)};return t.unit===n?et.some(t.value):o(t.unit)&&o(n)?e[t.unit]===e[n]?et.some(t.value):et.some(t.value/e[t.unit]*e[n]):et.none()},qS=function(t){return et.none()},KS=function(t,n){var e=XS(t).toOption(),o=XS(n).toOption();return It([e,o],function(t,o){return YS(t,o.unit).map(function(t){return o.value/t}).map(function(t){return n=t,e=o.unit,function(t){return YS(t,e).map(function(t){return{value:t*n,unit:e}})};var n,e}).getOr(qS)}).getOr(qS)},JS=function(o,n){var a=qS,r=oo("ratio-event"),t=GS.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:n.translate(o.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:kg("lock",n.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:kg("unlock",n.icons)}}],buttonBehaviours:ea([gy.config({})])}),e=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},i=function(e){return fb.parts().field({factory:ny,inputClasses:["tox-textfield"],inputBehaviours:ea([gy.config({}),og("size-input-events",[ai(Gt(),function(t,n){Ur(t,r,{isField1:e})}),ai(Jt(),function(t,n){Ur(t,Zv,{name:o.name})})])]),selectOnFocus:!1})},u=function(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}},c=GS.parts().field1(e([fb.parts().label(u("Width")),i(!0)])),s=GS.parts().field2(e([fb.parts().label(u("Height")),i(!1)]));return GS.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,e([u("&nbsp;"),t])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,i,n){XS(Fm.getValue(t)).each(function(t){a(t).each(function(t){var n,e,o,r;Fm.setValue(i,(o={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,"in":4,"%":4},-1!==(r=(n=t).value.toFixed((e=n.unit)in o?o[e]:1)).indexOf(".")&&(r=r.replace(/\.?0*$/,"")),r+n.unit))})})},coupledFieldBehaviours:ea([Np.config({}),og("size-input-events2",[ai(r,function(t,n){var e=n.event().isField1(),o=e?GS.getField1(t):GS.getField2(t),r=e?GS.getField2(t):GS.getField1(t),i=o.map(Fm.getValue).getOr(""),u=r.map(Fm.getValue).getOr("");a=KS(i,u)})])])})},$S={undo:nt(oo("undo")),redo:nt(oo("redo")),zoom:nt(oo("zoom")),back:nt(oo("back")),apply:nt(oo("apply")),swap:nt(oo("swap")),transform:nt(oo("transform")),tempTransform:nt(oo("temp-transform")),transformApply:nt(oo("transform-apply"))},QS=nt("save-state"),ZS=nt("disable"),tk=nt("enable"),nk={formActionEvent:eb,saveState:QS,disable:ZS,enable:tk},ek=function(a,c){var t=function(t,n,e,o){return wg(PS({name:t,text:t,disabled:e,primary:o},n,c))},n=function(t,n,e,o){return wg(NS({name:t,icon:et.some(t),tooltip:et.some(n),disabled:o},e,c))},u=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(Np)&&Np.disable(n)})},s=function(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(Np)&&Np.enable(n)})},f={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},e=et.none(),o=tt,r=function(t,n,e){Ur(t,n,e)},i=function(t){return jr(t,nk.disable())},l=function(t){return jr(t,nk.enable())},d=function(t,n){i(t),r(t,$S.transform(),{transform:n}),l(t)},m=function(t){return function(){Z.getOpt(t).each(function(t){xm.set(t,[$])})}},g=function(t,n){i(t),r(t,$S.transformApply(),{transform:n,swap:m(t)}),l(t)},p=function(){return t("Back",function(t){return r(t,$S.back(),{swap:m(t)})},!1,!1)},h=function(){return wg({dom:{tag:"div",classes:["tox-spacer"]},behaviours:ea([Np.config({})])})},v=function(){return t("Apply",function(t){return r(t,$S.apply(),{swap:m(t)})},!0,!0)},b=function(){return function(t){var n,e,o,r,i,u=a.getRect();return n=t,e=u.x,o=u.y,r=u.w,i=u.h,kS(n,e,o,r,i)}},y=[p(),h(),t("Apply",function(t){var n=b();g(t,n),a.hideCrop()},!1,!0)],x=Lv.sketch({dom:f,components:y.map(function(t){return t.asSpec()}),containerBehaviours:ea([og("image-tools-crop-buttons-events",[ai(nk.disable(),function(t,n){u(y,t)}),ai(nk.enable(),function(t,n){s(y,t)})])])}),w=wg(JS({name:"size",label:e,type:"sizeinput",constrain:!0},c)),S=[p(),h(),w,h(),t("Apply",function(a){w.getOpt(a).each(function(t){var n,e,o=Fm.getValue(t),r=parseInt(o.width,10),i=parseInt(o.height,10),u=(n=r,e=i,function(t){return DS(t,n,e)});g(a,u)})},!1,!0)],k=Lv.sketch({dom:f,components:S.map(function(t){return t.asSpec()}),containerBehaviours:ea([og("image-tools-resize-buttons-events",[ai(nk.disable(),function(t,n){u(S,t)}),ai(nk.enable(),function(t,n){s(S,t)})])])}),C=function(n,e){return function(t){return n(t,e)}},O=C(AS,"h"),E=C(AS,"v"),T=C(_S,-90),B=C(_S,90),A=function(t,n){var e,o;o=n,i(e=t),r(e,$S.tempTransform(),{transform:o}),l(e)},D=[p(),h(),n("flip-horizontally","Flip horizontally",function(t){A(t,O)},!1),n("flip-vertically","Flip vertically",function(t){A(t,E)},!1),n("rotate-left","Rotate counterclockwise",function(t){A(t,T)},!1),n("rotate-right","Rotate clockwise",function(t){A(t,B)},!1),h(),v()],_=Lv.sketch({dom:f,components:D.map(function(t){return t.asSpec()}),containerBehaviours:ea([og("image-tools-fliprotate-buttons-events",[ai(nk.disable(),function(t,n){u(D,t)}),ai(nk.enable(),function(t,n){s(D,t)})])])}),M=function(t,n,e,o,r){var i=lw.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:c.translate(t)}}),u=lw.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),a=lw.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return wg(lw.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e,maxX:r,getInitialValue:nt({x:nt(o)})},components:[i,u,a],sliderBehaviours:ea([Nm.config({})]),onChoose:n}))},F=function(t,n,e,o,r){return[p(),(i=t,u=n,a=e,c=o,s=r,M(i,function(t,n,e){var o=C(u,e.x()/100);d(t,o)},a,c,s)),v()];var i,u,a,c,s},I=function(t,n,e,o,r){var i=F(t,n,e,o,r);return Lv.sketch({dom:f,components:i.map(function(t){return t.asSpec()}),containerBehaviours:ea([og("image-tools-filter-panel-buttons-events",[ai(nk.disable(),function(t,n){u(i,t)}),ai(nk.enable(),function(t,n){s(i,t)})])])})},V=[p(),h(),v()],R=Lv.sketch({dom:f,components:V.map(function(t){return t.asSpec()})}),H=I("Brightness",TS,-100,0,100),N=I("Contrast",BS,-100,0,100),P=I("Gamma",ES,-100,0,100),z=function(n,e,o){return function(t){return vS(t,n,e,o)}},L=function(t){return M(t,function(a,t,n){var e=j.getOpt(a),o=W.getOpt(a),r=U.getOpt(a);e.each(function(u){o.each(function(i){r.each(function(t){var n=Fm.getValue(u).x()/100,e=Fm.getValue(t).x()/100,o=Fm.getValue(i).x()/100,r=z(n,e,o);d(a,r)})})})},0,100,200)},j=L("R"),U=L("G"),W=L("B"),G=[p(),j,U,W,v()],X=Lv.sketch({dom:f,components:G.map(function(t){return t.asSpec()})}),Y=function(n,e,o){return function(t){r(t,$S.swap(),{transform:e,swap:function(){Z.getOpt(t).each(function(t){xm.set(t,[n]),o(t)})}})}},q=et.some(OS),K=et.some(CS),J=[n("crop","Crop",Y(x,e,function(t){a.showCrop()}),!1),n("resize","Resize",Y(k,e,function(t){w.getOpt(t).each(function(t){var n=a.getMeasurements(),e=n.width,o=n.height;Fm.setValue(t,{width:e,height:o})})}),!1),n("orientation","Orientation",Y(_,e,o),!1),n("brightness","Brightness",Y(H,e,o),!1),n("sharpen","Sharpen",Y(R,q,o),!1),n("contrast","Contrast",Y(N,e,o),!1),n("color-levels","Color levels",Y(X,e,o),!1),n("gamma","Gamma",Y(P,e,o),!1),n("invert","Invert",Y(R,K,o),!1)],$=Lv.sketch({dom:f,components:J.map(function(t){return t.asSpec()})}),Q=Lv.sketch({dom:{tag:"div"},components:[$],containerBehaviours:ea([xm.config({})])}),Z=wg(Q);return{memContainer:Z,getApplyButton:function(t){return Z.getOpt(t).map(function(t){var n=t.components()[0];return n.components()[n.components().length-1]})}}},ok=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),rk=tinymce.util.Tools.resolve("tinymce.geom.Rect"),ik=tinymce.util.Tools.resolve("tinymce.util.Observable"),uk=tinymce.util.Tools.resolve("tinymce.util.Tools"),ak=tinymce.util.Tools.resolve("tinymce.util.VK");function ck(t){var n,e;if(t.changedTouches)for(n="screenX screenY pageX pageY clientX clientY".split(" "),e=0;e<n.length;e++)t[n[e]]=t.changedTouches[0][n[e]]}function sk(t,r){var i,u,n,a,c,f,l,d=r.document||x.document;r=r||{};var m=d.getElementById(r.handle||t);n=function(t){var n,e,o=function s(t){var n,e,o,r,i,u,a,c=Math.max;return n=t.documentElement,e=t.body,o=c(n.scrollWidth,e.scrollWidth),r=c(n.clientWidth,e.clientWidth),i=c(n.offsetWidth,e.offsetWidth),u=c(n.scrollHeight,e.scrollHeight),a=c(n.clientHeight,e.clientHeight),{width:o<i?r:o,height:u<c(n.offsetHeight,e.offsetHeight)?a:u}}(d);ck(t),t.preventDefault(),u=t.button,n=m,f=t.screenX,l=t.screenY,e=x.window.getComputedStyle?x.window.getComputedStyle(n,null).getPropertyValue("cursor"):n.runtimeStyle.cursor,i=ok("<div></div>").css({position:"absolute",top:0,left:0,width:o.width,height:o.height,zIndex:2147483647,opacity:1e-4,cursor:e}).appendTo(d.body),ok(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(t)},c=function(t){if(ck(t),t.button!==u)return a(t);t.deltaX=t.screenX-f,t.deltaY=t.screenY-l,t.preventDefault(),r.drag(t)},a=function(t){ck(t),ok(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(t)},this.destroy=function(){ok(m).off()},ok(m).on("mousedown touchstart",n)}var fk,lk,dk,mk=0,gk=function(n){var f=wg({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),l=_t(1),d=_t(et.none()),m=_t({x:0,y:0,w:1,h:1}),c=_t({x:0,y:0,w:1,h:1}),s=function(t,s){g.getOpt(t).each(function(t){var e=l.get(),o=xa(t.element()),r=ka(t.element()),i=s.dom().naturalWidth*e,u=s.dom().naturalHeight*e,a=Math.max(0,o/2-i/2),c=Math.max(0,r/2-u/2),n={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};fu(s,n),f.getOpt(t).each(function(t){fu(t.element(),n)}),d.get().each(function(t){var n=m.get();t.setRect({x:n.x*e+a,y:n.y*e+c,w:n.w*e,h:n.h*e}),t.setClampRect({x:a,y:c,w:i,h:u}),t.setViewPortRect({x:0,y:0,w:o,h:r})})})},e=function(t,n){var e,a=Zn.fromTag("img");return ze(a,"src",n),(e=a.dom(),new Ig(function(t){var n=function(){e.removeEventListener("load",n),t(e)};e.complete?t(e):e.addEventListener("load",n)})).then(function(){return g.getOpt(t).map(function(t){var n=Tu({element:a});xm.replaceAt(t,1,et.some(n));var e=c.get(),o={x:0,y:0,w:a.dom().naturalWidth,h:a.dom().naturalHeight};c.set(o);var r,u,i=rk.inflate(o,-20,-20);return m.set(i),e.w===o.w&&e.h===o.h||(r=t,u=a,g.getOpt(r).each(function(t){var n=xa(t.element()),e=ka(t.element()),o=u.dom().naturalWidth,r=u.dom().naturalHeight,i=Math.min(n/o,e/r);1<=i?l.set(1):l.set(i)})),s(t,a),a})})},t=Lv.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[f.asSpec(),{dom:{tag:"img",attributes:{src:n}}},{dom:{tag:"div"},behaviours:ea([og("image-panel-crop-events",[hi(function(t){g.getOpt(t).each(function(t){var n=function S(s,e,f,o,r){var l,u,n,i,a="tox-",c="tox-crid-"+mk++;function d(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}}function m(t,n,e,o){var r,i,u,a,c;r=n.x,i=n.y,u=n.w,a=n.h,r+=e*t.deltaX,i+=o*t.deltaY,(u+=e*t.deltaW)<20&&(u=20),(a+=o*t.deltaH)<20&&(a=20),c=s=rk.clamp({x:r,y:i,w:u,h:a},f,"move"===t.name),c=d(f,c),l.fire("updateRect",{rect:c}),h(c)}function g(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),ok("#"+c+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}uk.each(u,function(t){ok("#"+c+"-"+t.name,o).css({left:n.w*t.xMul+n.x,top:n.h*t.yMul+n.y})}),t("top",{x:e.x,y:e.y,w:e.w,h:n.y-e.y}),t("right",{x:n.x+n.w,y:n.y,w:e.w-n.x-n.w+e.x,h:n.h}),t("bottom",{x:e.x,y:n.y+n.h,w:e.w,h:e.h-n.y-n.h+e.y}),t("left",{x:e.x,y:n.y,w:n.x-e.x,h:n.h}),t("move",n)}function p(t){g(s=t)}function h(t){p(function e(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}}(f,t))}return u=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],i=["top","right","bottom","left"],function v(){ok('<div id="'+c+'" class="'+a+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),uk.each(i,function(t){ok("#"+c,o).append('<div id="'+c+"-"+t+'"class="'+a+'croprect-block" style="display: none" data-mce-bogus="all">')}),uk.each(u,function(t){ok("#"+c,o).append('<div id="'+c+"-"+t.name+'" class="'+a+"croprect-handle "+a+"croprect-handle-"+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')}),n=uk.map(u,function t(n){var e;return new sk(c,{document:o.ownerDocument,handle:c+"-"+n.name,start:function(){e=s},drag:function(t){m(n,e,t.deltaX,t.deltaY)}})}),g(s),ok(o).on("focusin focusout",function(t){ok(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")}),ok(o).on("keydown",function(n){var i;function t(t,n,e,o,r){t.stopPropagation(),t.preventDefault(),m(i,e,o,r)}switch(uk.each(u,function(t){if(n.target.id===c+"-"+t.name)return i=t,!1}),n.keyCode){case ak.LEFT:t(n,0,s,-10,0);break;case ak.RIGHT:t(n,0,s,10,0);break;case ak.UP:t(n,0,s,0,-10);break;case ak.DOWN:t(n,0,s,0,10);break;case ak.ENTER:case ak.SPACEBAR:n.preventDefault(),r()}})}(),l=uk.extend({toggleVisibility:function b(t){var n;n=uk.map(u,function(t){return"#"+c+"-"+t.name}).concat(uk.map(i,function(t){return"#"+c+"-"+t})).join(","),t?ok(n,o).show():ok(n,o).hide()},setClampRect:function y(t){f=t,g(s)},setRect:p,getInnerRect:function t(){return d(f,s)},setInnerRect:h,setViewPortRect:function x(t){e=t,g(s)},destroy:function w(){uk.each(n,function(t){t.destroy()}),n=[]}},ik)}({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.element().dom(),function(){});n.toggleVisibility(!1),n.on("updateRect",function(t){var n=t.rect,e=l.get(),o={x:Math.round(n.x/e),y:Math.round(n.y/e),w:Math.round(n.w/e),h:Math.round(n.h/e)};m.set(o)}),d.set(et.some(n))})})])])}],containerBehaviours:ea([xm.config({}),og("image-panel-events",[hi(function(t){e(t,n)})])])}),g=wg(t);return{memContainer:g,updateSrc:e,zoom:function(t,n){var e=l.get(),o=0<n?Math.min(2,e+.1):Math.max(.1,e-.1);l.set(o),g.getOpt(t).each(function(t){var n=t.components()[1].element();s(t,n)})},showCrop:function(){d.get().each(function(t){t.toggleVisibility(!0)})},hideCrop:function(){d.get().each(function(t){t.toggleVisibility(!1)})},getRect:function(){return m.get()},getMeasurements:function(){var t=c.get();return{width:t.w,height:t.h}}}},pk=function(t,n,e,o,r){return NS({name:t,icon:et.some(n),disabled:e,tooltip:et.some(t)},o,r)},hk=function(t,n){n?Np.enable(t):Np.disable(t)},vk=function(t){var o=wg(pk("Undo","undo",!0,function(t){Ur(t,$S.undo(),{direction:1})},t)),r=wg(pk("Redo","redo",!0,function(t){Ur(t,$S.redo(),{direction:1})},t));return{container:Lv.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),r.asSpec(),pk("Zoom in","zoom-in",!1,function(t){Ur(t,$S.zoom(),{direction:1})},t),pk("Zoom out","zoom-out",!1,function(t){Ur(t,$S.zoom(),{direction:-1})},t)]}),updateButtonUndoStates:function(t,n,e){o.getOpt(t).each(function(t){hk(t,n)}),r.getOpt(t).each(function(t){hk(t,e)})}}},bk=function(){return ue.getOrDie("URL")},yk=function(t){return bk().createObjectURL(t)},xk=function(t){bk().revokeObjectURL(t)},wk=function(t){var n=_t(t),e=_t(et.none()),r=function s(){var e=[],o=-1;function t(){return 0<o}function n(){return-1!==o&&o<e.length-1}return{data:e,add:function r(t){var n;return n=e.splice(++o),e.push(t),{state:t,removed:n}},undo:function i(){if(t())return e[--o]},redo:function u(){if(n())return e[++o]},canUndo:t,canRedo:n}}();r.add(t);var i=function(t){n.set(t)},u=function(t){return{blob:t,url:yk(t)}},a=function(t){xk(t.url)},o=function(){e.get().each(a),e.set(et.none())},c=function(t){var n=u(t);i(n);var e,o=r.add(n).removed;return e=o,uk.each(e,a),n.url};return{getBlobState:function(){return n.get()},setBlobState:i,addBlobState:c,getTempState:function(){return e.get().fold(function(){return n.get()},function(t){return t})},updateTempState:function(t){var n=u(t);return o(),e.set(et.some(n)),n.url},addTempState:function(t){var n=u(t);return e.set(et.some(n)),n.url},applyTempState:function(n){return e.get().fold(function(){},function(t){c(t.blob),n()})},destroyTempState:o,undo:function(){var t=r.undo();return i(t),t.url},redo:function(){var t=r.redo();return i(t),t.url},getHistoryStates:function(){return{undoEnabled:r.canUndo(),redoEnabled:r.canRedo()}}}},Sk=function(t,n){var u=wk(t.currentState),a=function(t){var n=u.getHistoryStates();g.updateButtonUndoStates(t,n.undoEnabled,n.redoEnabled),Ur(t,nk.formActionEvent,{name:nk.saveState(),value:n.undoEnabled})},c=function(t){return t.toBlob()},s=function(t){Ur(t,nk.formActionEvent,{name:nk.disable(),value:{}})},f=function(t){e.getApplyButton(t).each(function(t){Np.enable(t)}),Ur(t,nk.formActionEvent,{name:nk.enable(),value:{}})},l=function(t,n){return s(t),r.updateSrc(t,n)},d=function(n,t,e,o,r){return s(n),(i=t,uS(i)).then(e).then(c).then(o).then(function(t){return l(n,t).then(function(t){return a(n),r(),f(n),t})})["catch"](function(t){return x.console.log(t),f(n),t});var i},i=function(t,n,e){var o=u.getBlobState().blob;d(t,o,n,function(t){return u.updateTempState(t)},e)},m=function(t){var n=u.getBlobState().url;return u.destroyTempState(),a(t),n},r=gk(t.currentState.url),g=vk(n),e=ek(r,n);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[e.memContainer.asSpec(),r.memContainer.asSpec(),g.container],behaviours:ea([Fm.config({store:{mode:"manual",getValue:function(){return u.getBlobState()}}}),og("image-tools-events",[ai($S.undo(),function(n,t){var e=u.undo();l(n,e).then(function(t){f(n),a(n)})}),ai($S.redo(),function(n,t){var e=u.redo();l(n,e).then(function(t){f(n),a(n)})}),ai($S.zoom(),function(t,n){var e=n.event().direction();r.zoom(t,e)}),ai($S.back(),function(t,n){var e,o;o=m(e=t),l(e,o).then(function(t){f(e)}),n.event().swap()(),r.hideCrop()}),ai($S.apply(),function(t,n){u.applyTempState(function(){m(t),n.event().swap()()})}),ai($S.transform(),function(t,n){return i(t,n.event().transform(),tt)}),ai($S.tempTransform(),function(t,n){return e=t,o=n.event().transform(),r=u.getTempState().blob,void d(e,r,o,function(t){return u.addTempState(t)},tt);var e,o,r}),ai($S.transformApply(),function(t,n){return e=t,o=n.event().transform(),r=n.event().swap(),i=u.getBlobState().blob,void d(e,i,o,function(t){var n=u.addBlobState(t);return m(e),n},r);var e,o,r,i}),ai($S.swap(),function(n,t){var e;e=n,g.updateButtonUndoStates(e,!1,!1);var o=t.event().transform(),r=t.event().swap();o.fold(function(){r()},function(t){i(n,t,r)})})]),Cw()])}},kk=rl({name:"HtmlSelect",configFields:[hr("options"),Ks("selectBehaviours",[Nm,Fm]),Dr("selectClasses",[]),Dr("selectAttributes",{}),Cr("data")],factory:function(e,t){var n=_(e.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),o=e.data.map(function(t){return Tt("initialValue",t)}).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:n,behaviours:$s(e.selectBehaviours,[Nm.config({}),Fm.config({store:io({mode:"manual",getValue:function(t){return bu(t.element())},setValue:function(t,n){H(e.options,function(t){return t.value===n}).isSome()&&yu(t.element(),n)}},o)})])}}}),Ck=function(e,n){var t=e.label.map(function(t){return qb(t,n)}),o=[pm.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:function(t){return jr(t,ob),et.some(!0)}}),og("textfield-change",[ai(Kt(),function(t,n){Ur(t,Zv,{name:e.name})}),ai(_n(),function(t,n){Ur(t,Zv,{name:e.name})})]),gy.config({})],r=e.validation.map(function(o){return ly.config({getRoot:function(t){return ye(t.element())},invalidClass:"tox-invalid",validator:{validate:function(t){var n=Fm.getValue(t),e=o.validator(n);return Sb.pure(!0===e?vt.value(n):vt.error(e))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=fb.parts().field({tag:!0===e.multiline?"textarea":"input",inputAttributes:e.placeholder.fold(function(){},function(t){return{placeholder:n.translate(t)}}),inputClasses:[e.classname],inputBehaviours:ea(L([o,r])),selectOnFocus:!1,factory:ny}),u=e.flex?["tox-form__group--stretched"]:[];return Wb(t,i,u)},Ok=function(i){return io({},i,{toCached:function(){return Ok(i.toCached())},bindFuture:function(n){return Ok(i.bind(function(t){return t.fold(function(t){return Sb.pure(vt.error(t))},function(t){return n(t)})}))},bindResult:function(n){return Ok(i.map(function(t){return t.bind(n)}))},mapResult:function(n){return Ok(i.map(function(t){return t.map(n)}))},mapError:function(n){return Ok(i.map(function(t){return t.mapError(n)}))},foldResult:function(n,e){return i.map(function(t){return t.fold(n,e)})},withTimeout:function(t,r){return Ok(Sb.nu(function(n){var e=!1,o=x.setTimeout(function(){e=!0,n(vt.error(r()))},t);i.get(function(t){e||(x.clearTimeout(o),n(t))})}))}})},Ek=function(t){return Ok(Sb.nu(t))},Tk=Ek,Bk={type:"separator"},Ak=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:function(){}}},Dk=function(t,n){return{type:"menuitem",value:n,text:t,meta:{attach:undefined},onAction:function(){}}},_k=function(t,n){return o=t,e=V(n,function(t){return t.type===o}),_(e,Ak);var e,o},Mk=function(t,n){var e=t.toLowerCase();return V(n,function(t){var n=t.meta!==undefined&&t.meta.text!==undefined?t.meta.text:t.text;return xn(n.toLowerCase(),e)||xn(t.value.toLowerCase(),e)})},Fk=function(c,t,s){var n=Fm.getValue(t),f=n.meta.text!==undefined?n.meta.text:n.value;return s.getLinkInformation().fold(function(){return[]},function(t){var n,e,o,r,i,u,a=Mk(f,(n=s.getHistory(c),_(n,function(t){return Dk(t,t)})));return"file"===c?(e=[a,Mk(f,(u=t,_k("header",u.targets))),Mk(f,L([(i=t,et.from(i.anchorTop).map(function(t){return Dk("<top>",t)}).toArray()),(r=t,_k("anchor",r.targets)),(o=t,et.from(o.anchorBottom).map(function(t){return Dk("<bottom>",t)}).toArray())]))],U(e,function(t,n){return 0===t.length||0===n.length?t.concat(n):t.concat(Bk,n)},[])):a})},Ik=oo("aria-invalid"),Vk=function(i,o,r){var t,n,e,u,a,c=o.shared.providers,s=function(t){var n=Fm.getValue(t);r.addToHistory(n.value,i.filetype)},f=fb.parts().field({factory:Ub,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":Ik},minChars:0,responseTime:0,fetch:function(t){var n=Fk(i.filetype,t,r),e=ty(n,Yp.BUBBLE_TO_SANDBOX,o);return Sb.pure(e)},getHotspot:function(t){return h.getOpt(t)},onSetValue:function(t,n){t.hasConfigured(ly)&&ly.run(t).get(tt)},typeaheadBehaviours:ea(L([r.getValidationHandler().map(function(o){return ly.config({getRoot:function(t){return ye(t.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,n){d.getOpt(t).each(function(t){ze(t.element(),"title",c.translate(n))})}},validator:{validate:function(t){var e=Fm.getValue(t);return Tk(function(n){o({type:i.filetype,url:e.value},function(t){n(("invalid"===t.status?vt.error:vt.value)(t.message))})})},validateOnLoad:!1}})}).toArray(),[gy.config({}),og("urlinput-events",L(["file"===i.filetype?[ai(Kt(),function(t){Ur(t,Zv,{name:i.name})})]:[],[ai(Jt(),function(t){Ur(t,Zv,{name:i.name}),s(t)}),ai(_n(),function(t){Ur(t,Zv,{name:i.name}),s(t)})]]))]])),eventOrder:(t={},t[Kt()]=["streaming","urlinput-events","invalidating"],t),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"dog"},lazySink:o.shared.getSink,parts:{menu:Kh(0,0,"normal")},onExecute:function(t,n,e){Ur(n,ob,{})},onItemExecute:function(t,n,e,o){s(t),Ur(t,Zv,{name:i.name})}}),l=i.label.map(function(t){return qb(t,c)}),d=wg((n="invalid",e=et.some(Ik),void 0===(u="warning")&&(u=n),void 0===a&&(a=n),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+n],innerHtml:kg(u,c.icons),attributes:io({title:c.translate(a),"aria-live":"polite"},e.fold(function(){return{}},function(t){return{id:t}}))}})),m=wg({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[d.asSpec()]}),g=r.getUrlPicker(i.filetype),p=oo("browser.url.event"),h=wg({dom:{tag:"div",classes:["tox-control-wrap"]},components:[f,m.asSpec()]});return fb.sketch({dom:Yb([]),components:l.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:L([[h.asSpec()],g.map(function(){return t=i.label,n=p,e="tox-browse-url",o="browse",r=c,xg.sketch({dom:{tag:"button",classes:["tox-tbtn",e],innerHtml:kg(o,r.icons),attributes:{title:r.translate(t.getOr(""))}},buttonBehaviours:ea([gy.config({})]),action:function(t){jr(t,n)}});var t,n,e,o,r}).toArray()])}]),fieldBehaviours:ea([og("url-input-events",[ai(p,function(o){sl.getCurrent(o).each(function(n){var e=Fm.getValue(n);g.each(function(t){t(e).get(function(t){Fm.setValue(n,t),Ur(o,Zv,{name:i.name})})})})})])])})},Rk=function(u,n){var t,e,o=u.label.map(function(t){return qb(t,n)}),r=function(e){return function(n,t){Iu(t.event().target(),"[data-collection-item-value]").each(function(t){e(n,t,Le(t,"data-collection-item-value"))})}},i=[ai(Wt(),r(function(t,n){Il(n)})),ai(Rn(),r(function(t,n,e){Ur(t,eb,{name:u.name,value:e})})),ai(Gt(),r(function(t,n,e){Fu(t.element(),"."+mp).each(function(t){eu(t,mp)}),nu(n,mp)})),ai(Xt(),r(function(t,n,e){Fu(t.element(),"."+mp).each(function(t){eu(t,mp)})})),yi(r(function(t,n,e){Ur(t,eb,{name:u.name,value:e})}))],a=fb.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==u.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:d},behaviours:ea([xm.config({}),Fm.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){var n,e,r,i;n=o,e=_(t,function(t){var n,e=1===u.columns?'<div class="tox-collection__item-label">'+t.text+"</div>":"",o='<div class="tox-collection__item-icon">'+t.icon+"</div>",r={_:" "," - ":" ","-":" "},i=t.text.replace(/\_| \- |\-/g,function(t){return r[t]});return'<div class="tox-collection__item" tabindex="-1" data-collection-item-value="'+('"'===(n=t.value)?"&quot;":n)+'" title="'+i+'" aria-label="'+i+'">'+o+e+"</div>"}),r=1<u.columns&&"auto"!==u.columns?B(e,u.columns):[e],i=_(r,function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"}),Me(n.element(),i.join("")),"auto"===u.columns&&Yg(o,5,"tox-collection__item").each(function(t){var n=t.numRows,e=t.numColumns;pm.setGridSize(o,n,e)}),jr(o,ab)}}),gy.config({}),pm.config((t=u.columns,e="normal",1===t?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===t?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===e?".tox-swatches__row":".tox-collection__group",cell:"color"===e?"."+cp:"."+ap}})),og("collection-events",i)])});return Wb(o,a,["tox-form__group--collection"])},Hk=function(r){return function(n,e,o){return Et(e,"name").fold(function(){return r(e,o)},function(t){return n.field(t,r(e,o))})}},Nk={bar:Hk(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-bar"]},components:_(e.items,o.interpreter)};var e,o}),collection:Hk(function(t,n){return Rk(t,n.shared.providers)}),alloy:Hk(d),alertbanner:Hk(function(t,n){return e=t,o=n.shared.providers,Lv.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+e.level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[xg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:kg(e.icon,o.icons),attributes:{title:o.translate(e.actionLabel)}},action:function(t){Ur(t,eb,{name:"alert-banner",value:e.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:o.translate(e.text)}}]});var e,o}),input:Hk(function(t,n){return e=t,o=n.shared.providers,Ck({name:e.name,multiline:!1,label:e.label,placeholder:e.placeholder,flex:!1,classname:"tox-textfield",validation:et.none()},o);var e,o}),textarea:Hk(function(t,n){return e=t,o=n.shared.providers,Ck({name:e.name,multiline:!0,label:e.label,placeholder:e.placeholder,flex:!0,classname:"tox-textarea",validation:et.none()},o);var e,o}),listbox:Hk(function(t,n){return e=t,o=n.shared.providers,r=qb(e.label,o),i=fb.parts().field({factory:kk,dom:{classes:["mce-select-field"]},selectBehaviours:ea([gy.config({})]),options:e.values,data:e.initialValue.getOr(undefined)}),Gb(et.some(r),i);var e,o,r,i}),label:Hk(function(t,n){return e=t,o=n.shared,r={dom:{tag:"label",innerHtml:o.providers.translate(e.label),classes:["tox-label"]}},i=_(e.items,o.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[r].concat(i),behaviours:ea([Cw(),xm.config({}),Iw(et.none()),pm.config({mode:"acyclic"})])};var e,o,r,i}),iframe:(fk=function(t,n){return Gw(t,n.shared.providers)},function(t,n,e){var o=wt(n,{source:"dynamic"});return Hk(fk)(t,o,e)}),autocomplete:Hk(function(t,n){return i=n,e=qb((r=t).label.getOr("?"),i.shared.providers),o=fb.parts().field({factory:Ub,dismissOnBlur:!1,inputClasses:["tox-textfield"],minChars:1,fetch:function(t){var n=Fm.getValue(t),e=r.getItems(n),o=ty(e,Yp.BUBBLE_TO_SANDBOX,i);return Sb.pure(o)},markers:{openClass:"dog"},lazySink:i.shared.getSink,parts:{menu:Kh(0,0,"normal")}}),Gb(et.some(e),o);var r,i,e,o}),button:Hk(function(t,n){return e=t,o=n.shared.providers,r=zS(e.name,"custom"),PS(e,r,o,[Vw(""),Cw()]);var e,o,r}),checkbox:Hk(function(t,n){return e=t,o=n.shared.providers,r=Fm.config({store:{mode:"manual",getValue:function(t){return t.element().dom().checked},setValue:function(t,n){t.element().dom().checked=n}}}),i=function(t){return t.element().dom().click(),et.some(!0)},u=fb.parts().field({factory:{sketch:d},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ea([Cw(),gy.config({}),Nm.config({}),r,pm.config({mode:"special",onEnter:i,onSpace:i,stopSpaceKeyup:!0}),og("checkbox-events",[ai(Jt(),function(t,n){Ur(t,Zv,{name:e.name})})])])}),a=fb.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:o.translate(e.label)},behaviours:ea([by.config({})])}),s=wg({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[(c=function(t){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t],innerHtml:kg("checked"===t?"selected":"unselected",o.icons)}}})("checked"),c("unchecked")]}),fb.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[u,s.asSpec(),a]});var e,o,r,i,u,a,c,s}),colorinput:Hk(function(t,n){return Sy(t,n.shared,n.colorinput)}),colorpicker:Hk(function(t){var n=function(t){return"tox-"+t},e=kw(Bw,n),r=wg(e.sketch({dom:{tag:"div",classes:[n("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){Ur(t,eb,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Ur(t,eb,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:ea([Fm.config({store:{mode:"manual",getValue:function(t){var n=r.get(t);return sl.getCurrent(n).bind(function(t){return Fm.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,n){var e=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n),o=r.get(t);sl.getCurrent(o).fold(function(){x.console.log("Can not find form")},function(t){Fm.setValue(t,{hex:et.from(e[1]).getOr("")}),hw.getField(t,"hex").each(function(t){jr(t,Kt())})})}}}),Cw()])}}),dropzone:Hk(function(t,n){return Rw(t,n.shared.providers)}),grid:Hk(function(t,n){return e=t,o=n.shared,{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+e.columns+"col"]},components:_(e.items,o.interpreter)};var e,o}),selectbox:Hk(function(t,n){return e=t,o=n.shared.providers,r=_(e.items,function(t){return{text:o.translate(t.text),value:t.value}}),i=e.label.map(function(t){return qb(t,o)}),u=fb.parts().field({dom:{},selectAttributes:{size:e.size},options:r,factory:kk,selectBehaviours:ea([gy.config({}),og("selectbox-change",[ai(Jt(),function(t,n){Ur(t,Zv,{name:e.name})})])])}),a=1<e.size?et.none():et.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:kg("chevron-down",o.icons)}}),c={dom:{tag:"div",classes:["tox-selectfield"]},components:L([[u],a.toArray()])},fb.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:L([i.toArray(),[c]])});var e,o,r,i,u,a,c}),sizeinput:Hk(function(t,n){return JS(t,n.shared.providers)}),urlinput:Hk(function(t,n){return Vk(t,n,n.urlinput)}),customeditor:Hk(function(n){var e=_t(et.none()),o=wg({dom:{tag:n.tag}}),r=_t(et.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ea([og("editor-foo-events",[hi(function(t){o.getOpt(t).each(function(t){n.init(t.element().dom()).then(function(n){r.get().each(function(t){n.setValue(t)}),r.set(et.none()),e.set(et.some(n))})})})]),Fm.config({store:{mode:"manual",getValue:function(){return e.get().fold(function(){return r.get().getOr("")},function(t){return t.getValue()})},setValue:function(t,n){e.get().fold(function(){r.set(et.some(n))},function(t){return t.setValue(n)})}}}),Cw()]),components:[o.asSpec()]}}),htmlpanel:Hk(function(t){return"presentation"===t.presets?Lv.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):Lv.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:ea([gy.config({}),Nm.config({})])})}),imagetools:Hk(function(t,n){return Sk(t,n.shared.providers)}),table:Hk(function(t,n){return e=t,o=n.shared.providers,u=function(t){return{dom:{tag:"th",innerHtml:o.translate(t)}}},a=function(t){return{dom:{tag:"td",innerHtml:o.translate(t)}}},c=function(t){return{dom:{tag:"tr"},components:_(t,a)}},{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(i=e.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:_(i,u)}]}),(r=e.cells,{dom:{tag:"tbody"},components:_(r,c)})],behaviours:ea([gy.config({}),Nm.config({})])};var e,o,r,i,u,a,c})},Pk={field:function(t,n){return n}},zk=function(n,t,e){var o=wt(e,{shared:{interpreter:function(t){return Lk(n,t,o)}}});return Lk(n,t,o)},Lk=function(n,e,o){return Et(Nk,e.type).fold(function(){return x.console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e},function(t){return t(n,e,o)})},jk=function(t){return t.y()},Uk=function(t,n,e){return sc(t.x(),jk(t),e.northeast(),Da(),"layout-ne")},Wk=function(t,n,e){return sc((r=n,(o=t).x()+o.width()-r.width()),jk(t),e.northwest(),_a(),"layout-nw");var o,r},Gk=function(t,n,e){return sc((r=n,(o=t).x()+o.width()/2-r.width()/2),jk(t),e.north(),Fa(),"layout-n");var o,r},Xk={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},Yk=function(t,n,e){var o,r,i,u,a,c,s,f,l,d,m=Qv(t),g=function(){return Zn.fromDom(t.getBody())};return{toolbar:(f=g,l=n,d=m,d?function(){return{anchor:"node",root:f(),node:et.from(f()),bubble:ac(-12,-12,Xk),layouts:{onRtl:function(){return[Uk]},onLtr:function(){return[Wk]}}}}:function(){return{anchor:"hotspot",hotspot:l(),bubble:ac(-12,12,Xk),layouts:{onRtl:function(){return[hc]},onLtr:function(){return[vc]}}}}),toolbarOverflow:(s=e,function(){return{anchor:"hotspot",hotspot:s(),layouts:{onRtl:function(){return[hc]},onLtr:function(){return[vc]}}}}),banner:(u=g,a=n,c=e,c?function(){return{anchor:"node",root:u(),node:et.from(u()),layouts:{onRtl:function(){return[Gk]},onLtr:function(){return[Gk]}}}}:function(){return{anchor:"hotspot",hotspot:a(),layouts:{onRtl:function(){return[wc]},onLtr:function(){return[wc]}}}}),cursor:(r=t,i=g,function(){return{anchor:"selection",root:i(),getSelection:function(){var t=r.selection.getRng();return et.some(Ic(Zn.fromDom(t.startContainer),t.startOffset,Zn.fromDom(t.endContainer),t.endOffset))}}}),node:(o=g,function(t){return{anchor:"node",root:o(),node:t}})}},qk=function(t){return{colorPicker:(r=t,function(t,n){Uh.colorPickerDialog(r)(t,n)}),hasCustomColors:(o=t,function(){return Ah(o)}),getColors:(e=t,function(){return Dh(e)}),getColorCols:(n=t,function(){return Uh.getColorCols(n)})};var n,e,o,r},Kk=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strike-through",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}]}],Jk=function(t){return U(t,function(t,n){if(lt(n,"items")){var e=Jk(n.items);return{customFormats:t.customFormats.concat(e.customFormats),formats:t.formats.concat([{title:n.title,items:e.formats}])}}if(lt(n,"inline")||lt(n,"block")||lt(n,"selector")){var o="custom-"+n.title.toLowerCase();return{customFormats:t.customFormats.concat([{name:o,format:n}]),formats:t.formats.concat([{title:n.title,format:o,icon:n.icon}])}}return io({},t,{formats:t.formats.concat(n)})},{customFormats:[],formats:[]})},$k=function(i){return(t=i,et.from(t.getParam("style_formats")).filter(A)).map(function(t){var n,e,o,r=(n=i,e=Jk(t),o=function(t){M(t,function(t){n.formatter.has(t.name)||n.formatter.register(t.name,t.format)})},n.formatter?o(e.customFormats):n.on("init",function(){o(e.customFormats)}),e.formats);return i.getParam("style_formats_merge",!1,"boolean")?Kk.concat(r):r}).getOr(Kk);var t},Qk=function(t,n,e){var o={type:"formatter",isSelected:n(t.format),getStylePreview:e(t.format)};return wt(t,o)},Zk=function(s,t,f,l){var d=function(t){return _(t,function(t){var n,e,o,r,i,u,a=Z(t);if(Dt(t,"items")){var c=d(t.items);return wt((i=t,u={type:"submenu",isSelected:nt(!1),getStylePreview:function(){return et.none()}},wt(i,u)),{getStyleItems:function(){return c}})}return Dt(t,"format")?Qk(t,f,l):1===a.length&&T(a,"title")?wt(t,{type:"separator"}):(e=oo((n=t).title),o={type:"formatter",format:e,isSelected:f(e),getStylePreview:l(e)},r=wt(n,o),s.formatter.register(e,r),r)})};return d(t)},tC=uk.trim,nC=function(n){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===n)return!0;if(t.getAttribute("data-mce-contenteditable")===n)return!0}return!1}},eC=nC("true"),oC=nC("false"),rC=function(t,n,e,o,r){return{type:t,title:n,url:e,level:o,attach:r}},iC=function(t){return t.innerText||t.textContent},uC=function(t){return(n=t)&&"A"===n.nodeName&&(n.id||n.name)!==undefined&&cC(t);var n},aC=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},cC=function(t){return function(t){for(;t=t.parentNode;){var n=t.contentEditable;if(n&&"inherit"!==n)return eC(t)}return!1}(t)&&!oC(t)},sC=function(t){return aC(t)&&cC(t)},fC=function(t){var n,e,o=(n=t).id?n.id:oo("h");return rC("header",iC(t),"#"+o,aC(e=t)?parseInt(e.nodeName.substr(1),10):0,function(){t.id=o})},lC=function(t){var n=t.id||t.name,e=iC(t);return rC("anchor",e||"#"+n,"#"+n,0,tt)},dC=function(t){var n,e;return n="h1,h2,h3,h4,h5,h6,a:not([href])",e=t,_(Gc(Zn.fromDom(e),n),function(t){return t.dom()})},mC=function(t){return 0<tC(t.title).length},gC=function(t){var n,e=dC(t);return V((n=e,_(V(n,sC),fC)).concat(_(V(e,uC),lC)),mC)},pC="tinymce-url-history",hC=function(t){return k(t)&&/^https?/.test(t)},vC=function(t){return C(t)&&ct(t,function(t){return!(A(n=t)&&n.length<=5&&W(n,hC));var n}).isNone()},bC=function(){var t,n=x.localStorage.getItem(pC);if(null===n)return{};try{t=JSON.parse(n)}catch(e){if(e instanceof SyntaxError)return x.console.log("Local storage "+pC+" was not valid JSON",e),{};throw e}return vC(t)?t:(x.console.log("Local storage "+pC+" was not valid format",t),{})},yC=function(t){var n=bC();return Object.prototype.hasOwnProperty.call(n,t)?n[t]:[]},xC=function(n,t){if(hC(n)){var e=bC(),o=Object.prototype.hasOwnProperty.call(e,t)?e[t]:[],r=V(o,function(t){return t!==n});e[t]=[n].concat(r).slice(0,5),function(t){if(!vC(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));x.localStorage.setItem(pC,JSON.stringify(t))}(e)}},wC=Object.prototype.hasOwnProperty,SC=function(t){return!!t},kC=function(t){return it(uk.makeMap(t,/[, ]/),SC)},CC=function(t,n,e){var o,r,i=(o=t,r=n,wC.call(o,r)?et.some(o[r]):et.none()).getOr(e);return k(i)?et.some(i):et.none()},OC=function(t){return et.some(t.file_picker_callback).filter(E)},EC=function(t,n){var e,o,r,i,u=(e=t,o=et.some(e.file_picker_types).filter(SC),r=et.some(e.file_browser_callback_types).filter(SC),i=o.or(r).map(kC),OC(e).fold(function(){return!1},function(t){return i.fold(function(){return!0},function(t){return 0<Z(t).length&&t})}));return O(u)?u?OC(t):et.none():u[n]?OC(t):et.none()},TC=function(n){return{getHistory:yC,addToHistory:xC,getLinkInformation:function(){return!1===(t=n).settings.typeahead_urls?et.none():et.some({targets:gC(t.getBody()),anchorTop:CC(t.settings,"anchor_top","#top").getOrUndefined(),anchorBottom:CC(t.settings,"anchor_bottom","#bottom").getOrUndefined()});var t},getValidationHandler:function(){return t=n.settings.filepicker_validator_handler,E(t)?et.some(t):et.none();var t},getUrlPicker:function(t){return i=t,EC((r=n).settings,i).map(function(o){return function(n){return Sb.nu(function(e){var t=uk.extend({filetype:i},et.from(n.meta).getOr({}));o.call(r,function(t,n){if(!k(t))throw new Error("Expected value to be string");if(n!==undefined&&!C(n))throw new Error("Expected meta to be a object");e({value:t,meta:n})},n.value,t)})}});var r,i}}},BC=function(t,n,e,o){var r,i,u,a,c,s,f,l,d,m={shared:{providers:{icons:function(){return n.ui.registry.getAll().icons},menuItems:function(){return n.ui.registry.getAll().menuItems},translate:ip.translate},interpreter:function(t){return Lk(Pk,t,m)},anchors:Yk(n,e,o),getSink:function(){return vt.value(t)}},urlinput:TC(n),styleselect:(r=n,i=function(t){return function(){return r.formatter.match(t)}},u=function(n){return function(){var t=r.formatter.get(n);return t!==undefined?et.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:r.formatter.getCssText(n)}):et.none()}},a=function(t){var n=t.items;return n!==undefined&&0<n.length?j(n,a):[t.format]},c=_t([]),s=_t([]),f=_t([]),l=_t([]),d=_t(!1),r.on("init",function(){var t=$k(r),n=Zk(r,t,i,u);c.set(n),s.set(j(n,a))}),r.on("addStyleModifications",function(t){var n=Zk(r,t.items,i,u);f.set(n),d.set(t.replace),l.set(j(n,a))}),{getData:function(){var t=d.get()?[]:c.get(),n=f.get();return t.concat(n)},getFlattenedKeys:function(){var t=d.get()?[]:s.get(),n=l.get();return t.concat(n)}}),colorinput:qk(n)};return m},AC=te("within","extra","withinWidth"),DC=function(t,n,o){var e,r=(e=function(t,n){var e=o(t);return et.some({element:nt(t),start:nt(n),finish:nt(n+e),width:nt(e)})},U(t,function(n,t){return e(t,n.len).fold(nt(n),function(t){return{len:t.finish(),list:n.list.concat([t])}})},{len:0,list:[]}).list),i=V(r,function(t){return t.finish()<=n}),u=R(i,function(t,n){return t+n.width()},0),a=r.slice(i.length);return{within:nt(i),extra:nt(a),withinWidth:nt(u)}},_C=function(t){return _(t,function(t){return t.element()})},MC=function(t,n,e,o){var r,i,u,a,c,s,f,l,d,m,g,p,h=(r=t,i=n,u=e,a=DC(i,r,u),0===a.extra().length?et.some(a):et.none()).getOrThunk(function(){return DC(n,t-e(o),e)}),v=h.within(),b=h.extra(),y=h.withinWidth();return 1===b.length&&b[0].width()<=e(o)?(m=b,g=y,p=_C(v.concat(m)),AC(p,[],g)):1<=b.length?(s=b,f=o,l=y,d=_C(v).concat([f]),AC(d,_C(s),l)):(c=y,AC(_C(v),[],c))},FC=function(n,t){return t.getAnimationRoot.fold(function(){return n.element()},function(t){return t(n)})},IC=function(t){return t.dimension.property},VC=function(t,n){return t.dimension.getDimension(n)},RC=function(t,n){var e=FC(t,n);iu(e,[n.shrinkingClass,n.growingClass])},HC=function(t,n){eu(t.element(),n.openClass),nu(t.element(),n.closedClass),su(t.element(),IC(n),"0px"),vu(t.element())},NC=function(t,n){eu(t.element(),n.closedClass),nu(t.element(),n.openClass),hu(t.element(),IC(n))},PC=function(t,n,e,o){e.setCollapsed(),su(t.element(),IC(n),VC(n,t.element())),vu(t.element()),RC(t,n),HC(t,n),n.onStartShrink(t),n.onShrunk(t)},zC=function(t,n,e,o){var r=o.getOrThunk(function(){return VC(n,t.element())});e.setCollapsed(),su(t.element(),IC(n),r),vu(t.element());var i=FC(t,n);eu(i,n.growingClass),nu(i,n.shrinkingClass),HC(t,n),n.onStartShrink(t)},LC=function(t,n,e){var o=VC(n,t.element());("0px"===o?PC:zC)(t,n,e,et.some(o))},jC=function(t,n,e){var o=FC(t,n),r=ou(o,n.shrinkingClass),i=VC(n,t.element());NC(t,n);var u=VC(n,t.element());(r?function(){su(t.element(),IC(n),i),vu(t.element())}:function(){HC(t,n)})(),eu(o,n.shrinkingClass),nu(o,n.growingClass),NC(t,n),su(t.element(),IC(n),u),e.setExpanded(),n.onStartGrow(t)},UC=function(t,n,e){var o=FC(t,n);return!0===ou(o,n.growingClass)},WC=function(t,n,e){var o=FC(t,n);return!0===ou(o,n.shrinkingClass)},GC=/* */Object.freeze({refresh:function(t,n,e){if(e.isExpanded()){hu(t.element(),IC(n));var o=VC(n,t.element());su(t.element(),IC(n),o)}},grow:function(t,n,e){e.isExpanded()||jC(t,n,e)},shrink:function(t,n,e){e.isExpanded()&&LC(t,n,e)},immediateShrink:function(t,n,e){e.isExpanded()&&PC(t,n,e,et.none())},hasGrown:function(t,n,e){return e.isExpanded()},hasShrunk:function(t,n,e){return e.isCollapsed()},isGrowing:UC,isShrinking:WC,isTransitioning:function(t,n,e){return!0===UC(t,n)||!0===WC(t,n)},toggleGrow:function(t,n,e){(e.isExpanded()?LC:jC)(t,n,e)},disableTransitions:RC}),XC=/* */Object.freeze({exhibit:function(t,n){var e=n.expanded;return Li(e?{classes:[n.openClass],styles:{}}:{classes:[n.closedClass],styles:Tt(n.dimension.property,"0px")})},events:function(e,o){return oi([pi(Qt(),function(t,n){n.event().raw().propertyName===e.dimension.property&&(RC(t,e),o.isExpanded()&&hu(t.element(),e.dimension.property),(o.isExpanded()?e.onGrown:e.onShrunk)(t))})])}}),YC=[hr("closedClass"),hr("openClass"),hr("shrinkingClass"),hr("growingClass"),Cr("getAnimationRoot"),Wu("onShrunk"),Wu("onStartShrink"),Wu("onGrown"),Wu("onStartGrow"),Dr("expanded",!1),vr("dimension",cr("property",{width:[qu("property","width"),qu("getDimension",function(t){return xa(t)+"px"})],height:[qu("property","height"),qu("getDimension",function(t){return ka(t)+"px"})]}))],qC=ra({fields:YC,name:"sliding",active:XC,apis:GC,state:/* */Object.freeze({init:function(t){var n=_t(t.expanded);return Pi({isExpanded:function(){return!0===n.get()},isCollapsed:function(){return!1===n.get()},setCollapsed:w(n.set,!1),setExpanded:w(n.set,!0),readState:function(){return"expanded: "+n.get()}})}})}),KC=nt([Dr("shell",!0),Ks("toolbarBehaviours",[xm])]),JC=nt([Af({name:"groups",overrides:function(t){return{behaviours:ea([xm.config({})])}}})]),$C=il({name:"Toolbar",configFields:KC(),partFields:JC(),factory:function(n,t,e,o){var r=function(t){return n.shell?et.some(t):Lf(t,n,"groups")},i=n.shell?{behaviours:[xm.config({})],components:[]}:{behaviours:[],components:t};return{uid:n.uid,dom:n.dom,components:i.components,behaviours:$s(n.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,n){r(t).fold(function(){throw x.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(t){xm.set(t,n)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)}}}),QC=nt([ju(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ks("splitToolbarBehaviours",[]),Nr("builtGroups",function(){return _t([])}),Dr("overflow",function(t){return et.none()}),Vr("floating",!1)]),ZC=[hr("dom"),Dr("overflow",function(t){return et.none()}),Vr("floating",!1)],tO=nt([Tf({factory:$C,schema:ZC,name:"primary"}),Af({factory:$C,schema:ZC,name:"overflow",overrides:function(n){return{toolbarBehaviours:ea([qC.config({dimension:{property:"height"},closedClass:n.markers.closedClass,openClass:n.markers.openClass,shrinkingClass:n.markers.shrinkingClass,growingClass:n.markers.growingClass}),pm.config({mode:"acyclic",onEscape:function(t){return Lf(t,n,"overflow-button").each(pm.focusIn),et.some(!0)}})])}}}),Bf({name:"overflow-button",overrides:function(t){return{buttonBehaviours:ea([Jm.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"}})])}}}),Bf({name:"overflow-group"})]),nO=nt([hr("items"),ju(["itemSelector"]),Ks("tgroupBehaviours",[pm])]),eO=nt([Df({name:"items",unit:"item"})]),oO=il({name:"ToolbarGroup",configFields:nO(),partFields:eO(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,behaviours:$s(t.tgroupBehaviours,[pm.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),rO=function(t,n){var e=_(n,function(t){return Du(t)});$C.setGroups(t,e)},iO=function(e,o,t,n){var r=jf(e,o,"primary"),i=Lf(e,o,"overflow").orThunk(function(){return o.overflow(e)});su(r.element(),"visibility","hidden"),i.each(function(t){$C.setGroups(t,[])});var u=o.builtGroups.get(),a=oO.sketch(io({},t["overflow-group"](),{items:[xg.sketch(io({},t["overflow-button"](),{action:function(t){!0===o.floating?jr(e,n):i.each(function(t){qC.toggleGrow(t)})}}))]})),c=e.getSystem().build(a);rO(r,u.concat([c]));var s=xa(r.element()),f=MC(s,u,function(t){return xa(t.element())},c);0===f.extra().length?(xm.remove(r,c),i.each(function(t){$C.setGroups(t,[])})):(rO(r,f.within()),i.each(function(t){rO(t,f.extra())})),hu(r.element(),"visibility"),vu(r.element()),i.each(function(n){o.floating||qC.refresh(n),Lf(e,o,"overflow-button").each(function(t){o.floating?Jm.set(t,n.getSystem().isConnected()):(Jm.set(t,qC.hasGrown(n)),pm.focusIn(n))})})},uO=il({name:"SplitToolbar",configFields:QC(),partFields:tO(),factory:function(o,t,n,r){var i="alloy.toolbar.toggle";return{uid:o.uid,dom:o.dom,components:t,behaviours:$s(o.splitToolbarBehaviours,[]),apis:{setGroups:function(t,n){var e;e=_(n,t.getSystem().build),o.builtGroups.set(e),iO(t,o,r,i)},refresh:function(t){iO(t,o,r,i)},getMoreButton:function(t){return Lf(t,o,"overflow-button")},getOverflow:function(t){return Lf(n=t,o,"overflow").orThunk(function(){return o.overflow(n)});var n}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},getMoreButton:function(t,n){return t.getMoreButton(n)},getOverflow:function(t,n){return t.getOverflow(n)}}}),aO=function(t){var n=t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}});return{dom:io({tag:"div",classes:["tox-toolbar__group"]},n),components:[oO.parts().items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:ea([gy.config({}),Nm.config({})])}},cO=function(t){return oO.sketch(aO(t))},sO=function(r,t,n){var e=hi(function(t){var n=_(r.initGroups,cO);$C.setGroups(t,n)}),o=n.fold(function(){return[e]},function(o){return[e,ai("alloy.toolbar.toggle",function(e,t){r.getSink().toOption().each(function(n){o.getOpt(n).fold(function(){var t=Au(o.asSpec());Ts(n,t),Cs.position(n,r.backstage.shared.anchors.toolbarOverflow(),t),uO.refresh(e),uO.getMoreButton(e).each(Nm.focus),pm.focusIn(t)},function(t){Ds(t)})})})]});return ea([pm.config({mode:t,onEscape:r.onEscape,selector:".tox-toolbar__group"}),og("toolbar-events",o)])},fO=function(o){var t=o.cyclicKeying?"cyclic":"acyclic",n=wg($C.sketch({dom:{tag:"div",classes:["tox-toolbar__overflow"]},toolbarBehaviours:ea([pm.config({mode:"cyclic",onEscape:function(){return jr(o.moreDrawerData.lazyToolbar(),"alloy.toolbar.toggle"),pm.focusIn(o.moreDrawerData.lazyMoreButton()),et.some(!0)}})])})),e=uO.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),r=o.moreDrawerData.floating?[e]:[e,uO.parts().overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}})];return uO.sketch({uid:o.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},floating:o.moreDrawerData.floating,overflow:function(t){return o.getSink().toOption().bind(function(e){return n.getOpt(e).bind(function(n){return uO.getMoreButton(t).bind(function(t){return n.getSystem().isConnected()?(Cs.position(e,o.backstage.shared.anchors.toolbarOverflow(),n),et.some(n)):et.none()})})})},parts:{"overflow-group":aO({title:et.none(),items:[]}),"overflow-button":HS({name:"more",icon:et.some("more-drawer"),disabled:!1,tooltip:et.some("More...")},et.none(),o.backstage.shared.providers)},components:r,markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},splitToolbarBehaviours:sO(o,t,et.some(n))})},lO=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return $C.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"]},components:[$C.parts().groups({})],toolbarBehaviours:sO(t,n,et.none())})},dO=[Vr("disabled",!1),Tr("tooltip"),Tr("icon"),Tr("text"),Rr("onSetup",function(){return tt})],mO=Uo([br("type"),xr("onAction")].concat(dO)),gO=function(t){return rr("toolbarbutton",mO,t)},pO=Uo([br("type"),Tr("tooltip"),Tr("icon"),Tr("text"),xr("fetch"),Rr("onSetup",function(){return tt})]),hO=function(t){return rr("menubutton",pO,t)},vO=Uo([br("type"),Tr("tooltip"),Tr("icon"),Tr("text"),Br("select"),xr("fetch"),Rr("onSetup",function(){return tt}),Ir("presets","normal",["normal","color","listpreview"]),Dr("columns",1),xr("onAction"),xr("onItemAction")]),bO=[Vr("active",!1)].concat(dO),yO=Uo(bO.concat([br("type"),xr("onAction")])),xO=function(t){return rr("ToggleButton",yO,t)},wO=[Rr("predicate",function(){return!1}),Ir("scope","node",["node","editor"]),Ir("position","selection",["node","selection","line"])],SO=dO.concat([Dr("type","contextformbutton"),Dr("primary",!1),xr("onAction"),Nr("original",d)]),kO=bO.concat([Dr("type","contextformbutton"),Dr("primary",!1),xr("onAction"),Nr("original",d)]),CO=dO.concat([Dr("type","contextformbutton")]),OO=bO.concat([Dr("type","contextformtogglebutton")]),EO=cr("type",{contextformbutton:SO,contextformtogglebutton:kO}),TO=Uo([Dr("type","contextform"),Rr("initValue",function(){return""}),Tr("label"),kr("commands",EO),Or("launch",cr("type",{contextformbutton:CO,contextformtogglebutton:OO}))].concat(wO)),BO=Uo([Dr("type","contexttoolbar"),br("items")].concat(wO)),AO=oo("toolbar.button.execute"),DO={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},_O=/* */Object.freeze({getState:function(t,n,e){return e}}),MO=/* */Object.freeze({events:function(r,i){var o=function(e,o){r.updateState.each(function(t){var n=t(e,o);i.set(n)}),r.renderComponents.each(function(t){var n=t(o,i.get());_s(e),M(n,function(t){Ts(e,e.getSystem().build(t))})})};return oi([ai(Mn(),function(t,n){var e=r.channel;T(n.channels(),e)&&o(t,n.data())}),hi(function(n,t){r.initialData.each(function(t){o(n,t)})})])}}),FO=/* */Object.freeze({init:function(t){var n=_t(et.none());return{readState:function(){return n.get().getOr("none")},get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(et.none())}}}}),IO=[hr("channel"),Cr("renderComponents"),Cr("updateState"),Cr("initialData")],VO=ra({fields:IO,name:"reflecting",active:MO,apis:_O,state:FO}),RO=nt([hr("toggleClass"),hr("fetch"),Xu("onExecute"),Dr("getHotspot",et.some),Dr("getAnchorOverrides",nt({})),Dr("layouts",et.none()),Xu("onItemExecute"),Cr("lazySink"),hr("dom"),Wu("onOpen"),Ks("splitDropdownBehaviours",[mb,pm,Nm]),Dr("matchWidth",!1),Dr("useMinWidth",!1),Dr("eventOrder",{}),Cr("role")].concat(zb())),HO=Tf({factory:xg,schema:[hr("dom")],name:"arrow",defaults:function(t){return{buttonBehaviours:ea([Nm.revoke()])}},overrides:function(n){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(n.uid).each(Wr)},buttonBehaviours:ea([Jm.config({toggleOnExecute:!1,toggleClass:n.toggleClass})])}}}),NO=Tf({factory:xg,schema:[hr("dom")],name:"button",defaults:function(t){return{buttonBehaviours:ea([Nm.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(e.uid).each(function(t){e.onExecute(t,n)})}}}}),PO=nt([HO,NO,Af({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[hr("text")],name:"aria-descriptor"}),Bf({schema:[Lu()],name:"menu",defaults:function(o){return{onExecute:function(n,e){n.getSystem().getByUid(o.uid).each(function(t){o.onItemExecute(t,n,e)})}}}}),Cb()]),zO=il({name:"SplitDropdown",configFields:RO(),partFields:PO(),factory:function(o,t,n,e){var r=function(t){sl.getCurrent(t).each(function(t){Sl.highlightFirst(t),pm.focusIn(t)})},i=function(t){Bb(o,function(t){return t},t,e,r,qv.HighlightFirst).get(tt)},u=function(t){var n=jf(t,o,"button");return Wr(n),et.some(!0)},a=St(oi([hi(function(e,t){Lf(e,o,"aria-descriptor").each(function(t){var n=oo("aria");ze(t.element(),"id",n),ze(e.element(),"aria-describedby",n)})})]),yg(et.some(i)));return{uid:o.uid,dom:o.dom,components:t,eventOrder:io({},o.eventOrder,{"alloy.execute":["disabling","toggling","alloy.base.behaviour"]}),events:a,behaviours:$s(o.splitDropdownBehaviours,[mb.config({others:{sandbox:function(t){var n=jf(t,o,"arrow");return _b(o,t,{onOpen:function(){Jm.on(n),Jm.on(t)},onClose:function(){Jm.off(n),Jm.off(t)}})}}}),pm.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return i(t),et.some(!0)}}),Nm.config({}),Jm.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}}}),LO=oo("update-menu-text"),jO=oo("update-menu-icon"),UO=function(t,n,o){var e=_t(tt),r=t.text.map(function(t){return wg(VS(t,n,o.providers))}),i=t.icon.map(function(t){return wg(IS(t,o.providers.icons))}),u=function(t,n){var e=Fm.getValue(t);return Nm.focus(e),Ur(e,"keydown",{raw:n.event().raw()}),vy.close(e),et.some(!0)},a=t.role.fold(function(){return{}},function(t){return{role:t}}),c=t.tooltip.fold(function(){return{}},function(t){var n=o.providers.translate(t);return{title:n,"aria-label":n}});return wg(vy.sketch(io({},a,{dom:{tag:"button",classes:[n,n+"--select"].concat(_(t.classes,function(t){return n+"--"+t})),attributes:io({},c)},components:Kp([i.map(function(t){return t.asSpec()}),r.map(function(t){return t.asSpec()}),et.some({dom:{tag:"div",classes:[n+"__select-chevron"],innerHtml:kg("chevron-down",o.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:ea(t.dropdownBehaviours.concat([zp(t.disabled),by.config({}),xm.config({}),og("dropdown-events",[Up(t,e),Wp(t,e)]),og("menubutton-update-display-text",[ai(LO,function(n,e){r.bind(function(t){return t.getOpt(n)}).each(function(t){xm.set(t,[Eu(o.providers.translate(e.event().text()))])})}),ai(jO,function(n,e){i.bind(function(t){return t.getOpt(n)}).each(function(t){xm.set(t,[IS(e.event().icon(),o.providers.icons)])})})])])),eventOrder:wt(DO,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ea([pm.config({mode:"special",onLeft:u,onRight:u})]),lazySink:o.getSink,toggleClass:n+"--active",parts:{menu:Kh(0,t.columns,t.presets)},fetch:function(){return Sb.nu(t.fetch)}}))).asSpec()},WO=function(n){return{isDisabled:function(){return Np.isDisabled(n)},setDisabled:function(t){return Np.set(n,t)}}},GO=function(n){return{setActive:function(t){Jm.set(n,t)},isActive:function(){return Jm.isOn(n)},isDisabled:function(){return Np.isDisabled(n)},setDisabled:function(t){return Np.set(n,t)}}},XO=function(e){return{isDisabled:function(){return Np.isDisabled(e)},setDisabled:function(t){return Np.set(e,t)},setActive:function(t){var n=e.element();t?(nu(n,"tox-tbtn--enabled"),ze(n,"aria-pressed",!0)):(eu(n,"tox-tbtn--enabled"),Ue(n,"aria-pressed"))},isActive:function(){return ou(e.element(),"tox-tbtn--enabled")}}},YO=function(t,n){return t.map(function(t){return{"aria-label":n.translate(t),title:n.translate(t)}}).getOr({})},qO=oo("focus-button"),KO=["checklist","ordered-list"],JO=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],$O=function(n,e,t,o,r,i){var u,a=function(t){return ip.isRtl()&&T(KO,t)?t+"-rtl":t},c=ip.isRtl()&&n.exists(function(t){return T(JO,t)});return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:YO(t,i)},components:Kp([n.map(function(t){return FS(a(t),i.icons)}),e.map(function(t){return VS(t,"tox-tbtn",i)})]),eventOrder:(u={},u[zt()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:ea([og("common-button-display-events",[ai(zt(),function(t,n){n.event().prevent(),jr(t,qO)})])].concat(o.map(function(t){return VO.config({channel:t,initialData:{icon:n,text:e},renderComponents:function(t,n){return Kp([t.icon.map(function(t){return FS(a(t),i.icons)}),t.text.map(function(t){return VS(t,"tox-tbtn",i)})])}})}).toArray()).concat(r.getOr([])))}},QO=function(t,n,e){var o,r=_t(tt),i=$O(t.icon,t.text,t.tooltip,et.none(),et.none(),e);return xg.sketch({dom:i.dom,components:i.components,eventOrder:DO,buttonBehaviours:ea([og("toolbar-button-events",[(o={onAction:t.onAction,getApi:n.getApi},yi(function(n,t){jp(o,n)(function(t){Ur(n,AO,{buttonApi:t}),o.onAction(t)})})),Up(n,r),Wp(n,r)]),zp(t.disabled)].concat(n.toolbarButtonBehaviours))})},ZO=function(t,n,e){return QO(t,{toolbarButtonBehaviours:[].concat(0<e.length?[og("toolbarButtonWith",e)]:[]),getApi:WO,onSetup:t.onSetup},n)},tE=function(t,n,e){return wt(QO(t,{toolbarButtonBehaviours:[xm.config({}),Jm.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<e.length?[og("toolbarToggleButtonWith",e)]:[]),getApi:GO,onSetup:t.onSetup},n))},nE=function(n,t){var e,o,r,i,u=oo("channel-update-split-dropdown-display"),a=function(e){return{isDisabled:function(){return Np.isDisabled(e)},setDisabled:function(t){return Np.set(e,t)},setIconFill:function(t,n){Fu(e.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){ze(t,"fill",n)})},setIconStroke:function(t,n){Fu(e.element(),'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){ze(t,"stroke",n)})},setActive:function(n){ze(e.element(),"aria-pressed",n),Fu(e.element(),"span").each(function(t){e.getSystem().getByDom(t).each(function(t){return Jm.set(t,n)})})},isActive:function(){return Fu(e.element(),"span").exists(function(t){return e.getSystem().getByDom(t).exists(Jm.isOn)})}}},c=_t(tt),s={getApi:a,onSetup:n.onSetup};return zO.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:St({"aria-pressed":!1},YO(n.tooltip,t.providers))},onExecute:function(t){n.onAction(a(t))},onItemExecute:function(t,n,e){},splitDropdownBehaviours:ea([Lp(!1),og("split-dropdown-events",[ai(qO,Nm.focus),Up(s,c),Wp(s,c)])]),eventOrder:(e={},e[Un()]=["alloy.base.behaviour","split-dropdown-events"],e),toggleClass:"tox-tbtn--enabled",lazySink:t.getSink,fetch:(o=a,r=n,i=t.providers,function(n){return Sb.nu(function(t){return r.fetch(t)}).map(function(t){return et.from(gv(wt(Zh(oo("menu-value"),t,function(t){r.onItemAction(o(n),t)},r.columns,r.presets,Yp.CLOSE_ON_EXECUTE,r.select.getOr(function(){return!1}),i),{movement:nv(r.columns,r.presets),menuBehaviours:Kg("auto"!==r.columns?[]:[hi(function(o,t){Yg(o,4,gp(r.presets)).each(function(t){var n=t.numRows,e=t.numColumns;pm.setGridSize(o,n,e)})})])})))})}),parts:{menu:Kh(0,n.columns,n.presets)},components:[zO.parts().button($O(n.icon,n.text,et.none(),et.some(u),et.some([Jm.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),t.providers)),zO.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:kg("chevron-down",t.providers.icons)}}),zO.parts()["aria-descriptor"]({text:t.providers.translate("To open the popup, press Shift+Enter")})]})},eE=function(t,n,e,o){return UO({text:t.text,icon:t.icon,tooltip:t.tooltip,role:o,fetch:function(n){t.fetch(function(t){n(ty(t,Yp.CLOSE_ON_EXECUTE,e))})},onSetup:t.onSetup,getApi:XO,columns:1,presets:"normal",classes:[],dropdownBehaviours:[]},n,e.shared)},oE=function(i,u){return ai(AO,function(t,n){var e,o=i.get(t),r=(e=o,{hide:function(){return jr(e,Nn())},getValue:function(){return Fm.getValue(e)}});u.onAction(r,n.event().buttonApi())})},rE=function(t,n,e){var o,r,i,u,a,c,s,f,l,d,m,g,p={backstage:{shared:{providers:e}}};return"contextformtogglebutton"===n.type?(s=t,l=p,(d=(f=n).original).primary,m=uo(d,["primary"]),g=ir(xO(io({},m,{type:"togglebutton",onAction:function(){}}))),tE(g,l.backstage.shared.providers,[oE(s,f)])):(o=t,i=p,(u=(r=n).original).primary,a=uo(u,["primary"]),c=ir(gO(io({},a,{type:"button",onAction:function(){}}))),ZO(c,i.backstage.shared.providers,[oE(o,r)]))},iE=function(t,n){var e,o,r,i,u=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),a=wg(ny.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:u,selectOnFocus:!0,inputBehaviours:ea([pm.config({mode:"special",onEnter:function(t){return c.findPrimary(t).map(function(t){return Wr(t),!0})},onLeft:function(t,n){return n.cut(),et.none()},onRight:function(t,n){return n.cut(),et.none()}})])})),c=(e=a,o=t.commands,r=n.shared.providers,i=_(o,function(t){return wg(rE(e,t,r))}),{asSpecs:function(){return _(i,function(t){return t.asSpec()})},findPrimary:function(e){return Ft(o,function(t,n){return t.primary?et.from(i[n]).bind(function(t){return t.getOpt(e)}).filter(S(Np.isDisabled)):et.none()})}});return lO({uid:oo("context-toolbar"),initGroups:[{title:et.none(),items:[a.asSpec()]},{title:et.none(),items:c.asSpecs()}],onEscape:et.none,cyclicKeying:!0,backstage:n,getSink:function(){return vt.error("")}})},uE=oo("forward-slide"),aE=oo("backward-slide"),cE=oo("change-slide-event"),sE="tox-pop--resizing",fE=function(n,t){return Ft(t,function(t){return t.predicate(n.dom())?et.some({toolbarApi:t,elem:n}):et.none()})},lE=function(n,e){var t=function(t){return t.dom()===e.getBody()},o=Zn.fromDom(e.selection.getNode());return fE(o,n.inNodeScope).orThunk(function(){return fE(o,n.inEditorScope).orThunk(function(){return function(t,n,e){for(var o=t.dom(),r=E(e)?e:nt(!1);o.parentNode;){o=o.parentNode;var i=Zn.fromDom(o),u=n(i);if(u.isSome())return u;if(r(i))break}return et.none()}(o,function(t){return fE(t,n.inNodeScope)},t)})})},dE=function(e,r){var t={},i=[],u=[],a={},c={},o=function(n,e){var o=ir(rr("ContextForm",TO,e));(t[n]=o).launch.map(function(t){a["form:"+n]=io({},e.launch,{type:"contextformtogglebutton"===t.type?"togglebutton":"button",onAction:function(){r(o)}})}),"editor"===o.scope?u.push(o):i.push(o),c[n]=o},s=function(n,e){var t;(t=e,rr("ContextToolbar",BO,t)).each(function(t){"editor"===e.scope?u.push(t):i.push(t),c[n]=t})},n=Z(e);return M(n,function(t){var n=e[t];"contextform"===n.type?o(t,n):"contexttoolbar"===n.type&&s(t,n)}),{forms:t,inNodeScope:i,inEditorScope:u,lookupTable:c,formNavigators:a}},mE=function(o,r){return function(n){var e=_t(et.none()),t=function(){n.setActive(o.formatter.match(r));var t=o.formatter.formatChanged(r,n.setActive).unbind;e.set(et.some(t))};return o.initialized?t():o.on("init",t),function(){return e.get().each(function(t){return t()})}}},gE=function(n){return function(t){return function(){n.undoManager.transact(function(){n.focus(),n.execCommand("mceToggleFormat",!1,t.format)})}}},pE=function(t,n,e,o){var i,u,r,a,c,s="basic"===e.type?function(){return _(e.data,function(t){return Qk(t,o.isSelectedFor,o.getPreviewFor)})}:e.getData;return{items:(i=n,u=o,r=function(t,n,e){var o=i.shared.providers.translate(t.title);if("separator"===t.type)return et.some({type:"separator",text:o});if("submenu"!==t.type)return et.some(io({type:"togglemenuitem",text:o,active:t.isSelected(),disabled:e,onAction:u.onAction(t)},t.getStylePreview().fold(function(){return{}},function(t){return{meta:{style:t}}})));var r=j(t.getStyleItems(),function(t){return a(t,n)});return 0===n&&r.length<=0?et.none():et.some({type:"nestedmenuitem",text:o,disabled:r.length<=0,getSubmenuItems:function(){return j(t.getStyleItems(),function(t){return a(t,n)})}})},a=function(t,n){var e="formatter"===t.type&&u.isInvalid(t);return 0===n?e?[]:r(t,n,!1).toArray():r(t,n,e).toArray()},c=function(t){var n=u.shouldHide?0:1;return j(t,function(t){return a(t,n)})},{validateItems:c,getFetch:function(o,r){return function(t){var n=r(),e=c(n);t(ty(e,Yp.CLOSE_ON_EXECUTE,o))}}}),getStyleItems:s}},hE=function(o,t,n,r){var e=pE(0,t,n,r),i=e.items,u=e.getStyleItems;return UO({text:r.icon.isSome()?et.none():et.some(""),icon:r.icon,tooltip:et.from(r.tooltip),role:et.none(),fetch:i.getFetch(t,u),onSetup:function(e){return r.nodeChangeHandler.map(function(t){var n=t(e.getComponent());return o.on("NodeChange",n),function(){o.off("NodeChange",n)}}).getOr(tt)},getApi:function(t){return{getComponent:function(){return t}}},columns:1,presets:"normal",classes:r.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",t.shared)};(dk=lk||(lk={}))[dk.SemiColon=0]="SemiColon",dk[dk.Space=1]="Space";var vE,bE,yE=function(t,n,e,o){var r,i,u=Et(t.settings,n).getOr(e);return{type:"basic",data:(i=u,r=o===lk.SemiColon?i.replace(/;$/,"").split(";"):i.split(" "),_(r,function(t){var n=t,e=t,o=t.split("=");return 1<o.length&&(n=o[0],e=o[1]),{title:n,format:e}}))}},xE=[{title:"Left",icon:"align-left",format:"alignleft"},{title:"Center",icon:"align-center",format:"aligncenter"},{title:"Right",icon:"align-right",format:"alignright"},{title:"Justify",icon:"align-justify",format:"alignjustify"}],wE=function(e){var t=et.some(function(n){return function(){var t=H(xE,function(t){return e.formatter.match(t.format)}).fold(function(){return"left"},function(t){return t.title.toLowerCase()});Ur(n,jO,{icon:"align-"+t})}}),n={type:"basic",data:xE};return{tooltip:"Align",icon:et.some("align-left"),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getPreviewFor:function(t){return function(){return et.none()}},onAction:gE(e),nodeChangeHandler:t,dataset:n,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}},SE=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],kE=function(r){var o=function(){var e=function(t){return t?t.split(",")[0]:""},t=r.queryCommandValue("FontName"),n=i.data,o=t?t.toLowerCase():"";return H(n,function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()}).orThunk(function(){return 0===(t=o).indexOf("-apple-system")&&(n=t.toLowerCase().split(/['"]?\s*,\s*['"]?/),W(SE,function(t){return-1<n.indexOf(t.toLowerCase())}))?et.from({title:"System Font",format:o}):et.none();var t,n})},t=et.some(function(e){return function(){var t=r.queryCommandValue("FontName"),n=o().fold(function(){return t},function(t){return t.title});Ur(e,LO,{text:n})}}),i=yE(r,"font_formats","Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",lk.SemiColon);return{tooltip:"Fonts",icon:et.none(),isSelectedFor:function(n){return function(){return o().exists(function(t){return t.format===n})}},getPreviewFor:function(t){return function(){return et.some({tag:"div",styleAttr:-1===t.indexOf("dings")?"font-family:"+t:""})}},onAction:function(t){return function(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,t.format)})}},nodeChangeHandler:t,dataset:i,shouldHide:!1,isInvalid:function(){return!1}}},CE=function(t,n){return/[0-9.]+px$/.test(t)?(e=72*parseInt(t,10)/96,o=n||0,r=Math.pow(10,o),Math.round(e*r)/r+"pt"):t;var e,o,r},OE=function(i){var u=function(){var e=et.none(),o=a.data,r=i.queryCommandValue("FontSize");if(r)for(var t=function(t){var n=CE(r,t);e=H(o,function(t){return t.format===r||t.format===n})},n=3;e.isNone()&&0<=n;n--)t(n);return{matchOpt:e,px:r}},t=et.some(function(r){return function(){var t=u(),n=t.matchOpt,e=t.px,o=n.fold(function(){return e},function(t){return t.title});Ur(r,LO,{text:o})}}),a=yE(i,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",lk.Space);return{tooltip:"Font sizes",icon:et.none(),isSelectedFor:function(n){return function(){return u().matchOpt.exists(function(t){return t.format===n})}},getPreviewFor:function(){return function(){return et.none()}},onAction:function(t){return function(){i.undoManager.transact(function(){i.focus(),i.execCommand("FontSize",!1,t.format)})}},nodeChangeHandler:t,dataset:a,shouldHide:!1,isInvalid:function(){return!1}}},EE=function(e,t,n){var o=n.parents,r=t();return Ft(o,function(n){return H(r,function(t){return e.formatter.matchNode(n,t.format)})}).orThunk(function(){return e.formatter.match("p")?et.some({title:"Paragraph",format:"p"}):et.none()})},TE=function(o){var t=et.some(function(e){return function(t){var n=EE(o,function(){return r.data},t).fold(function(){return"Paragraph"},function(t){return t.title});Ur(e,LO,{text:n})}}),r=yE(o,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",lk.SemiColon);return{tooltip:"Blocks",icon:et.none(),isSelectedFor:function(t){return function(){return o.formatter.match(t)}},getPreviewFor:function(n){return function(){var t=o.formatter.get(n);return et.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:o.formatter.getCssText(n)})}},onAction:gE(o),nodeChangeHandler:t,dataset:r,shouldHide:!1,isInvalid:function(t){return!o.formatter.canApply(t.format)}}},BE=function(i){var t=et.some(function(e){var o=function(t){var n=t.items;return n!==undefined&&0<n.length?j(n,o):[{title:t.title,format:t.format}]},r=j($k(i),o);return function(t){var n=EE(i,function(){return r},t).fold(function(){return"Paragraph"},function(t){return t.title});Ur(e,LO,{text:n})}});return{tooltip:"Formats",icon:et.none(),isSelectedFor:function(t){return function(){return i.formatter.match(t)}},getPreviewFor:function(n){return function(){var t=i.formatter.get(n);return t!==undefined?et.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styleAttr:i.formatter.getCssText(n)}):et.none()}},onAction:gE(i),nodeChangeHandler:t,shouldHide:i.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!i.formatter.canApply(t.format)}}},AE=[{name:"history",items:["undo","redo"]},{name:"styles",items:["styleselect"]},{name:"formatting",items:["bold","italic"]},{name:"alignment",items:["alignleft","aligncenter","alignright","alignjustify"]},{name:"indentation",items:["outdent","indent"]},{name:"permanent pen",items:["permanentpen"]},{name:"comments",items:["addcomment"]}],DE=function(o,r){return function(t,n){var e=o(t).mapError(function(t){return ar(t)}).getOrDie();return r(e,n)}},_E={button:DE(gO,function(t,n){return e=t,o=n.backstage.shared.providers,ZO(e,o,[]);var e,o}),togglebutton:DE(xO,function(t,n){return e=t,o=n.backstage.shared.providers,tE(e,o,[]);var e,o}),menubutton:DE(hO,function(t,n){return eE(t,"tox-tbtn",n.backstage,et.none())}),splitbutton:DE(function(t){return rr("SplitButton",vO,t)},function(t,n){return nE(t,n.backstage.shared)}),styleSelectButton:function(t,n){return e=t,o=n.backstage,r=o.styleselect,hE(e,o,r,BE(e));var e,o,r},fontsizeSelectButton:function(t,n){return e=t,o=n.backstage,r=OE(e),hE(e,o,r.dataset,r);var e,o,r},fontSelectButton:function(t,n){return e=t,o=n.backstage,r=kE(e),hE(e,o,r.dataset,r);var e,o,r},formatButton:function(t,n){return e=t,o=n.backstage,r=TE(e),hE(e,o,r.dataset,r);var e,o,r},alignMenuButton:function(t,n){return e=t,o=n.backstage,r=wE(e),hE(e,o,r.dataset,r);var e,o,r}},ME={styleselect:_E.styleSelectButton,fontsizeselect:_E.fontsizeSelectButton,fontselect:_E.fontSelectButton,formatselect:_E.formatButton,align:_E.alignMenuButton},FE=function(t){var n=t.split("|");return _(n,function(t){return{items:t.trim().split(" ")}})},IE=function(t){return!1===t.toolbar?[]:t.toolbar===undefined||!0===t.toolbar?(e=t.buttons,n=_(AE,function(t){var n=V(t.items,function(t){return lt(e,t)||lt(ME,t)});return{name:t.name,items:n}}),V(n,function(t){return 0<t.items.length})):k(t.toolbar)?FE(t.toolbar):A(t.toolbar)&&k(t.toolbar[0])?FE(t.toolbar.join(" | ")):t.toolbar;var e,n},VE=function(n,e,o,r,t){return ft(e,o.toLowerCase()).orThunk(function(){return t.bind(function(t){return Ft(t,function(t){return ft(e,t+o.toLowerCase())})})}).fold(function(){return ft(ME,o.toLowerCase()).map(function(t){return t(n,r)}).orThunk(function(){return et.none()})},function(t){return e=r,ft(_E,(n=t).type).fold(function(){return x.console.error("skipping button defined by",n),et.none()},function(t){return et.some(t(n,e))});var n,e})},RE=function(e,o,r,i){var t=IE(o),n=_(t,function(t){var n=j(t.items,function(t){return 0===t.trim().length?[]:VE(e,o.buttons,t,r,i).toArray()});return{title:et.from(e.translate(t.name)),items:n}});return V(n,function(t){return 0<t.items.length})},HE=function(i,t,u,c){var e,o,s=Au((e={sink:u,onEscape:function(){return i.focus(),et.some(!0)}},o=_t([]),bg.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){o.set([]),bg.getContent(t).each(function(t){hu(t.element(),"visibility")}),eu(t.element(),sE),hu(t.element(),"width")},inlineBehaviours:ea([og("context-toolbar-events",[pi(Qt(),function(t,n){bg.getContent(t).each(function(t){}),eu(t.element(),sE),hu(t.element(),"width")}),ai(cE,function(n,e){hu(n.element(),"width");var t=xa(n.element());bg.setContent(n,e.event().contents()),nu(n.element(),sE);var o=xa(n.element());su(n.element(),"width",t+"px"),bg.getContent(n).each(function(t){e.event().focus().bind(function(t){return Il(t),Rl(n.element())}).orThunk(function(){return pm.focusIn(t),Vl()})}),Eg.setTimeout(function(){su(n.element(),"width",o+"px")},0)}),ai(uE,function(t,n){bg.getContent(t).each(function(t){o.set(o.get().concat([{bar:t,focus:Vl()}]))}),Ur(t,cE,{contents:n.event().forwardContents(),focus:et.none()})}),ai(aE,function(n,t){$(o.get()).each(function(t){o.set(o.get().slice(0,o.get().length-1)),Ur(n,cE,{contents:Du(t.bar),focus:t.focus})})})]),pm.config({mode:"special",onEscape:function(n){return $(o.get()).fold(function(){return e.onEscape()},function(t){return jr(n,aE),et.some(!0)})}})]),lazySink:function(){return vt.value(e.sink)}}))),f=function(){return et.some(Zn.fromDom(i.contentAreaContainer))};i.on("init",function(){var t=i.getBody().ownerDocument.defaultView,n=xv(Zn.fromDom(t),"scroll",function(){l.get().each(function(t){var n=d.get().getOr(i.selection.getNode()).getBoundingClientRect(),e=i.contentAreaContainer.getBoundingClientRect(),o=n.bottom<0,r=n.top>e.height;o||r?su(s.element(),"display","none"):(hu(s.element(),"display"),Cs.positionWithin(u,t,s,f()))})});i.on("remove",function(){n.unbind()})});var l=_t(et.none()),d=_t(et.none()),n=_t(null),m=function(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:ea([pm.config({mode:"acyclic"}),og("pop-dialog-wrap-events",[hi(function(t){i.shortcuts.add("ctrl+F9","focus statusbar",function(){return pm.focusIn(t)})}),vi(function(t){i.shortcuts.remove("ctrl+F9")})])])}},a=tn(function(){return dE(t,function(t){var n=g(t);Ur(s,uE,{forwardContents:m(n)})})}),g=function(t){var n,e,o=i.ui.registry.getAll().buttons,r=a();return"contexttoolbar"===t.type?(n=St(o,r.formNavigators),e=RE(i,{buttons:n,toolbar:t.items},c,et.some(["form:"])),lO({uid:oo("context-toolbar"),initGroups:e,onEscape:et.none,cyclicKeying:!0,backstage:c.backstage,getSink:function(){return vt.error("")}})):iE(t,c.backstage)};i.on("contexttoolbar-show",function(n){var t=a();Et(t.lookupTable,n.toolbarKey).each(function(t){b(t,n.target===i?et.none():et.some(n)),bg.getContent(s).each(pm.focusIn)})});var r={valignCentre:[],alignCentre:[],alignLeft:["tox-pop--align-left"],alignRight:["tox-pop--align-right"],right:["tox-pop--right"],left:["tox-pop--left"],bottom:["tox-pop--bottom"],top:["tox-pop--top"]},p={maxHeightFunction:ec()},h={bubble:ac(12,0,r),layouts:{onLtr:function(){return[Sc]},onRtl:function(){return[kc]}},overrides:p},v={bubble:ac(0,12,r),layouts:{onLtr:function(){return[xc,wc,bc,hc,yc,vc]},onRtl:function(){return[xc,wc,yc,vc,bc,hc]}},overrides:p},b=function(t,n){x();var e,o,r,i=g(t),u=n.map(Zn.fromDom),a=(e=t.position,o=u,r="node"===e?c.backstage.shared.anchors.node(o):c.backstage.shared.anchors.cursor(),wt(r,"line"===e?h:v));l.set(et.some(a)),d.set(n),bg.showWithin(s,a,m(i),f()),hu(s.element(),"display")},y=function(){var t=a();lE(t,i).fold(function(){l.set(et.none()),bg.hide(s)},function(t){b(t.toolbarApi,et.some(t.elem.dom()))})},x=function(){var t=n.get();null!==t&&(Eg.clearTimeout(t),n.set(null))},w=function(t){x(),n.set(t)};i.on("init",function(){i.on("click keyup SetContent ObjectResized ResizeEditor",function(t){w(Eg.setEditorTimeout(i,y,0))}),i.on("focusout",function(t){Eg.setEditorTimeout(i,function(){Rl(u.element()).isNone()&&Rl(s.element()).isNone()&&(l.set(et.none()),bg.hide(s))},0)}),i.on("NodeChange",function(t){Rl(s.element()).fold(function(){w(Eg.setEditorTimeout(i,y,0))},function(t){})})})},NE=function(t,e,o){var n=xv(Zn.fromDom(x.document),"mousedown",function(n){M([e,o],function(t){t.broadcastOn([Ws()],{target:n.target()})})}),r=xv(Zn.fromDom(x.document),"touchstart",function(n){M([e,o],function(t){t.broadcastOn([Ws()],{target:n.target()})})}),i=xv(Zn.fromDom(x.document),"mouseup",function(n){0===n.raw().button&&M([e,o],function(t){t.broadcastOn([Gs()],{target:n.target()})})}),u=function(n){M([e,o],function(t){t.broadcastOn([Ws()],{target:Zn.fromDom(n.target)})})};t.on("mousedown",u),t.on("touchstart",u);var a=function(n){0===n.button&&M([e,o],function(t){t.broadcastOn([Gs()],{target:Zn.fromDom(n.target)})})};t.on("mouseup",a);var c=function(n){M([e,o],function(t){t.broadcastEvent(Ln(),n)})};t.on("ScrollWindow",c);var s=function(n){M([e,o],function(t){t.broadcastEvent(jn(),n)})};t.on("ResizeWindow",s),t.on("remove",function(){t.off("mousedown",u),t.off("touchstart",u),t.off("mouseup",a),t.off("ResizeWindow",s),t.off("ScrollWindow",c),n.unbind(),r.unbind(),i.unbind()}),t.on("detach",function(){Is(e),Is(o),e.destroy(),o.destroy()})},PE=Kf,zE=Mf,LE=rl({factory:function(n,o){var t={focus:pm.focusIn,setMenus:function(t,n){var e=_(n,function(n){var t={type:"menubutton",text:n.text,fetch:function(t){t(n.getItems())}},e=hO(t).mapError(function(t){return ar(t)}).getOrDie();return eE(e,"tox-mbtn",o.backstage,et.some("menuitem"))});xm.set(t,e)}};return{uid:n.uid,dom:n.dom,components:[],behaviours:ea([xm.config({}),og("menubar-events",[hi(function(t){n.onSetup(t)}),ai(Wt(),function(e,t){Fu(e.element(),".tox-mbtn--active").each(function(n){Iu(t.event().target(),".tox-mbtn").each(function(t){he(n,t)||e.getSystem().getByDom(n).each(function(n){e.getSystem().getByDom(t).each(function(t){vy.expand(t),vy.close(n),Nm.focus(t)})})})})}),ai(Xn(),function(e,t){t.event().prevFocus().bind(function(t){return e.getSystem().getByDom(t).toOption()}).each(function(n){t.event().newFocus().bind(function(t){return e.getSystem().getByDom(t).toOption()}).each(function(t){vy.isOpen(n)&&(vy.expand(t),vy.close(n))})})})]),pm.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return n.onEscape(t),et.some(!0)}}),gy.config({})]),apis:t,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[hr("dom"),hr("uid"),hr("onEscape"),hr("backstage"),Dr("onSetup",tt)],apis:{focus:function(t,n){t.focus(n)},setMenus:function(t,n,e){t.setMenus(n,e)}}}),jE="container",UE=[Ks("slotBehaviours",[])],WE=function(t){return"<alloy.field."+t+">"},GE=function(r,t,n){var e,o=function(t){return Gf(r)},i=function(e,o){return void 0===o&&(o=undefined),function(t,n){return Lf(t,r,n).map(function(t){return e(t,n)}).getOr(o)}},u=function(t,n){return"true"!==Le(t.element(),"aria-hidden")},a=i(u,!1),c=i(function(t,n){if(u(t)){var e=t.element();su(e,"display","none"),ze(e,"aria-hidden","true"),Ur(t,Yn(),{name:n,visible:!1})}}),s=(e=c,function(n,t){M(t,function(t){return e(n,t)})}),f=i(function(t,n){if(!u(t)){var e=t.element();hu(e,"display"),Ue(e,"aria-hidden"),Ur(t,Yn(),{name:n,visible:!0})}}),l={getSlotNames:o,getSlot:function(t,n){return Lf(t,r,n)},isShowing:a,hideSlot:c,hideAllSlots:function(t){return s(t,o())},showSlot:f};return{uid:r.uid,dom:r.dom,components:t,behaviours:Js(r.slotBehaviours),apis:l}},XE=it({getSlotNames:function(t,n){return t.getSlotNames(n)},getSlot:function(t,n,e){return t.getSlot(n,e)},isShowing:function(t,n,e){return t.isShowing(n,e)},hideSlot:function(t,n,e){return t.hideSlot(n,e)},hideAllSlots:function(t,n){return t.hideAllSlots(n)},showSlot:function(t,n,e){return t.showSlot(n,e)}},Hi),YE=io({},XE,{sketch:function(t){var e,n=(e=[],{slot:function(t,n){return e.push(t),Rf(jE,WE(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=_(r,function(t){return Tf({name:t,pname:WE(t)})});return $f(jE,UE,i,GE,o)}}),qE=Uo([Tr("icon"),Tr("tooltip"),Rr("onShow",tt),Rr("onHide",tt),Rr("onSetup",function(){return tt})]),KE=function(t){return{element:function(){return t.element().dom()}}},JE=function(e,o){var r=_(Z(o),function(t){var n=o[t],e=ir(rr("sidebar",qE,n));return{name:t,getApi:KE,onSetup:e.onSetup,onShow:e.onShow,onHide:e.onHide}});return _(r,function(t){var n=_t(tt);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Kg([Up(t,n),Wp(t,n),ai(Yn(),function(n,t){var e=t.event();H(r,function(t){return t.name===e.name()}).each(function(t){(e.visible()?t.onShow:t.onHide)(t.getApi(n))})})])})})},$E=function(t,e){sl.getCurrent(t).each(function(t){return xm.set(t,[(n=e,YE.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:JE(t,n),slotBehaviours:Kg([hi(function(t){return YE.hideAllSlots(t)})])}}))]);var n})},QE=function(t){return sl.getCurrent(t).bind(function(t){return qC.isGrowing(t)||qC.hasGrown(t)?sl.getCurrent(t).bind(function(n){return H(YE.getSlotNames(n),function(t){return YE.isShowing(n,t)})}):et.none()})},ZE=oo("FixSizeEvent"),tT=oo("AutoSizeEvent"),nT=function(t,n,e){var o,r=t.element();!0===n?(xm.set(t,[(o=e,{dom:{tag:"div",attributes:{"aria-label":o.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:rp('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:ea([pm.config({mode:"special",onTab:function(){return et.some(!0)},onShiftTab:function(){return et.some(!0)}}),Nm.config({})])})]),hu(r,"display"),Ue(r,"aria-hidden")):(xm.set(t,[]),su(r,"display","none"),ze(r,"aria-hidden","true"))},eT=zE.optional({factory:LE,name:"menubar",schema:[hr("backstage")]}),oT=zE.optional({factory:{sketch:function(t){return(t.split===Pv.sliding||t.split===Pv.floating?fO:lO)({uid:t.uid,onEscape:function(){return t.onEscape(),et.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,backstage:t.backstage,moreDrawerData:{floating:t.split===Pv.floating,lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton}})}},name:"toolbar",schema:[hr("dom"),hr("onEscape"),hr("getSink")]}),rT=zE.optional({name:"socket",schema:[hr("dom")]}),iT=zE.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:ea([gy.config({}),Nm.config({}),qC.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){sl.getCurrent(t).each(YE.hideAllSlots),jr(t,tT)},onGrown:function(t){jr(t,tT)},onStartGrow:function(t){Ur(t,ZE,{width:gu(t.element(),"width").getOr("")})},onStartShrink:function(t){Ur(t,ZE,{width:xa(t.element())+"px"})}}),xm.config({}),sl.config({find:function(t){var n=xm.contents(t);return J(n)}})])}],behaviours:ea([Ew(0),og("sidebar-sliding-events",[ai(ZE,function(t,n){su(t.element(),"width",n.event().width())}),ai(tT,function(t,n){hu(t.element(),"width")})])])}}},name:"sidebar",schema:[hr("dom")]}),uT=zE.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:ea([xm.config({})]),components:[]}}},name:"throbber",schema:[hr("dom")]}),aT=il({name:"OuterContainer",factory:function(e,t,n){var o={getSocket:function(t){return PE.getPart(t,e,"socket")},setSidebar:function(t,n){PE.getPart(t,e,"sidebar").each(function(t){return $E(t,n)})},toggleSidebar:function(t,o){PE.getPart(t,e,"sidebar").each(function(t){return n=t,e=o,void sl.getCurrent(n).each(function(n){sl.getCurrent(n).each(function(t){qC.hasGrown(n)?YE.isShowing(t,e)?qC.shrink(n):(YE.hideAllSlots(t),YE.showSlot(t,e)):(YE.hideAllSlots(t),YE.showSlot(t,e),qC.grow(n))})});var n,e})},whichSidebar:function(t){return PE.getPart(t,e,"sidebar").bind(QE).getOrNull()},getToolbar:function(t){return PE.getPart(t,e,"toolbar")},setToolbar:function(t,n){PE.getPart(t,e,"toolbar").each(function(t){$C.setGroups(t,n)})},getMoreButton:function(t){return PE.getPart(t,e,"toolbar").bind(function(t){return uO.getMoreButton(t)})},getThrobber:function(t){return PE.getPart(t,e,"throbber")},focusToolbar:function(t){PE.getPart(t,e,"toolbar").each(function(t){pm.focusIn(t)})},setMenubar:function(t,n){PE.getPart(t,e,"menubar").each(function(t){LE.setMenus(t,n)})},focusMenubar:function(t){PE.getPart(t,e,"menubar").each(function(t){LE.focus(t)})}};return{uid:e.uid,dom:e.dom,components:t,apis:o,behaviours:e.behaviours}},configFields:[hr("dom"),hr("behaviours")],partFields:[eT,oT,rT,iT,uT],apis:{getSocket:function(t,n){return t.getSocket(n)},setSidebar:function(t,n,e){t.setSidebar(n,e)},toggleSidebar:function(t,n,e){t.toggleSidebar(n,e)},whichSidebar:function(t,n){return t.whichSidebar(n)},getToolbar:function(t,n){return t.getToolbar(n)},setToolbar:function(t,n,e){var o=_(e,function(t){return cO(t)});t.setToolbar(n,o)},getMoreButton:function(t,n){return t.getMoreButton(n)},getThrobber:function(t,n){return t.getThrobber(n)},setMenubar:function(t,n,e){t.setMenubar(n,e)},focusMenubar:function(t,n){t.focusMenubar(n)},focusToolbar:function(t,n){t.focusToolbar(n)}}}),cT={file:{title:"File",items:"newdocument restoredraft | preview | print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align | forecolor backcolor | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code wordcount"},table:{title:"Table",items:"inserttable tableprops deletetable row column cell"},help:{title:"Help",items:"help"}},sT=function(t){return"string"==typeof t?t.split(" "):t},fT=function(u,a){var c=St(cT,a.menus),n=0<Z(a.menus).length,t=a.menubar===undefined||!0===a.menubar?sT("file edit view insert format tools table help"):sT(!1===a.menubar?"":a.menubar),e=V(t,function(t){return n&&a.menus.hasOwnProperty(t)&&a.menus[t].hasOwnProperty("items")||cT.hasOwnProperty(t)}),o=_(e,function(t){var n,e,o,r,i=c[t];return n={title:i.title,items:sT(i.items)},e=a,r=(o=u,o.getParam("removed_menuitems","")).split(/[ ,]/),{text:n.title,getItems:function(){return j(n.items,function(t){var n=t.toLowerCase();return 0===n.trim().length?[]:y(r,function(t){return t===n})?[]:"separator"===n||"|"===n?[{type:"separator"}]:e.menuItems[n]?[e.menuItems[n]]:[]})}}});return V(o,function(t){return 0<t.getItems().length&&y(t.getItems(),function(t){return"separator"!==t.type})})},lT=function(t){return t.fire("SkinLoaded")},dT=function(t){return t.fire("ResizeEditor")},mT=function(t){return t.fire("ResizeContent")},gT=function(t){var n=function(){t._skinLoaded=!0,lT(t)};return function(){t.initialized?n():t.on("init",n)}},pT=function(t,n){var e,o=function(t){var n=t.settings,e=n.skin,o=n.skin_url;if(!1!==e){var r=e||"oxide";o=o?t.documentBaseURI.toAbsolute(o):Wv.baseURL+"/skins/ui/"+r}return o}(n);o&&(e=o+"/skin.min.css",n.contentCSS.push(o+(t?"/content.inline":"/content")+".min.css")),0==(!1===n.getParam("skin"))&&e?Uv.DOM.styleSheetLoader.load(e,gT(n)):gT(n)()},hT=w(pT,!1),vT=w(pT,!0),bT=Uv.DOM,yT=function(t){return function(n){var e=t.outerContainer;ge("*",e.element()).forEach(function(t){e.getSystem().getByDom(t).each(function(t){t.hasConfigured(Np)&&("readonly"===n.mode?Np.disable(t):Np.enable(t))})})}},xT={render:function(e,o,t,n,r){var i,u;hT(e),i=Zn.fromDom(r.targetNode),u=o.mothership,Fs(i,u,Oe),Ms($r(),o.uiMothership),e.on("init",function(){aT.setToolbar(o.outerContainer,RE(e,t,{backstage:n},et.none())),aT.setMenubar(o.outerContainer,fT(e,t)),aT.setSidebar(o.outerContainer,t.sidebar),e.readonly&&yT(o)({mode:"readonly"}),function(o){var r=o.getWin(),t=o.getDoc().documentElement,i=_t(ma(r.innerWidth,r.innerHeight)),u=_t(ma(t.offsetWidth,t.offsetHeight)),n=function(){var t=o.getDoc().documentElement,n=i.get(),e=u.get();n.left()!==r.innerWidth||n.top()!==r.innerHeight?(i.set(ma(r.innerWidth,r.innerHeight)),mT(o)):e.left()===t.offsetWidth&&e.top()===t.offsetHeight||(u.set(ma(t.offsetWidth,t.offsetHeight)),mT(o))};bT.bind(r,"resize",n);var e=wv(Zn.fromDom(o.getBody()),"load",n);o.on("remove",function(){e.unbind(),bT.unbind(r,"resize",n)})}(e)});var a=aT.getSocket(o.outerContainer).getOrDie("Could not find expected socket element");e.on("SwitchMode",yT(o)),e.getParam("readonly",!1,"boolean")&&e.setMode("readonly"),e.addCommand("ToggleSidebar",function(t,n){aT.toggleSidebar(o.outerContainer,n),e.fire("ToggleSidebar")}),e.addQueryValueHandler("ToggleSidebar",function(){return aT.whichSidebar(o.outerContainer)});var c=Jv(e);return c!==Pv.sliding&&c!==Pv.floating||e.on("ResizeContent",function(){aT.getToolbar(o.outerContainer).each(uO.refresh)}),{iframeContainer:a.element().dom(),editorContainer:o.outerContainer.element().dom()}},getBehaviours:function(t){return[]}},wT=function(e,n){return xe(e).orThunk(function(){var t=Zn.fromTag("span");Ce(e,t);var n=xe(t);return De(t),n}).map(function(t){return pa(t).translate(-n.left(),-n.top())}).getOrThunk(function(){return ma(0,0)})},ST=bt([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),kT=function(n){return function(t){return t.translate(-n.left(),-n.top())}},CT=function(n){return function(t){return t.translate(n.left(),n.top())}},OT=function(e){return function(t,n){return U(e,function(t,n){return n(t)},ma(t,n))}},ET=function(t,n,e){return t.fold(OT([CT(e),kT(n)]),OT([kT(n)]),OT([]))},TT=function(t,n,e){return t.fold(OT([CT(e)]),OT([]),OT([CT(n)]))},BT=function(t,n,e){return t.fold(OT([]),OT([kT(e)]),OT([CT(n),kT(e)]))},AT=function(t,n,e){return t.fold(function(t,n){return{position:"absolute",left:t+"px",top:n+"px"}},function(t,n){return{position:"absolute",left:t-e.left()+"px",top:n-e.top()+"px"}},function(t,n){return{position:"fixed",left:t+"px",top:n+"px"}})},DT=ST.offset,_T=ST.absolute,MT=ST.fixed,FT=function(t,n){nu(t.element(),n.transitionClass),eu(t.element(),n.fadeOutClass),nu(t.element(),n.fadeInClass)},IT=function(t,n){nu(t.element(),n.transitionClass),eu(t.element(),n.fadeInClass),nu(t.element(),n.fadeOutClass)},VT=function(t,n){return t.y()>=n.y()&&t.bottom()<=n.bottom()},RT=function(t,n){return je(t,n)?et.some(parseInt(Le(t,n),10)):et.none()},HT=function(o,r,i){return(u=o,t=r,n=u.element(),RT(n,t.leftAttr).bind(function(o){return RT(n,t.topAttr).map(function(t){var n=xa(u.element()),e=ka(u.element());return Na(o,t,n,e)})})).bind(function(t){return VT(t,i)?(n=r,e=o.element(),Ue(e,n.leftAttr),Ue(e,n.topAttr),et.some(_T(t.x(),t.y()))):et.none();var n,e});var u,t,n},NT=function(t,n,e,o,r){var i=pa(t.element()),u=Na(i.left(),i.top(),xa(t.element()),ka(t.element()));if(VT(u,e))return et.none();a=t,c=n,s=i.left(),f=i.top(),l=a.element(),ze(l,c.leftAttr,s),ze(l,c.topAttr,f);var a,c,s,f,l,d=_T(i.left(),i.top()),m=ET(d,o,r),g=_T(e.x(),e.y()),p=ET(g,o,r),h=u.y()<=e.y()?p.top():p.top()+e.height()-u.height();return et.some(MT(m.left(),h))},PT=function(i,t,n){var u=t.lazyViewport(i);t.contextual.each(function(r){r.lazyContext(i).each(function(t){var n,e,o=Pa(t);e=u,((n=o).y()<e.bottom()&&n.bottom()>e.y()?FT:IT)(i,r)})});var e,o,r,a,c,s=ve(i.element()),f=va(s),l=wT(i.element(),f);(e=i,o=t,r=u,a=f,c=l,gu(e.element(),"position").is("fixed")?HT(e,o,r):NT(e,o,r,a,c)).each(function(t){var n=AT(t,0,l);fu(i.element(),n)})},zT=/* */Object.freeze({refresh:PT}),LT=/* */Object.freeze({events:function(o,t){return oi([ai(Qt(),function(n,e){o.contextual.each(function(t){he(n.element(),e.event().target())&&(eu(n.element(),t.transitionClass),e.stop())})}),ai(Ln(),function(t,n){PT(t,o)})])}}),jT=[Ar("contextual",[hr("fadeInClass"),hr("fadeOutClass"),hr("transitionClass"),hr("lazyContext")]),Dr("lazyViewport",function(t){var n=va();return Na(n.left(),n.top(),x.window.innerWidth,x.window.innerHeight)}),hr("leftAttr"),hr("topAttr")],UT=ra({fields:jT,name:"docking",active:LT,apis:zT}),WT={render:function(e,n,o,r,t){var i,u=Uv.DOM,a=Qv(e),c=Jv(e),s=c===Pv.sliding||c===Pv.floating,f=c===Pv.floating;vT(e);var l=function(t){var n=s?t.fold(function(){return 0},function(t){return 1<t.components().length?ka(t.components()[1].element()):0}):0;fu(i.element(),function(t){void 0===t&&(t=0);var n=pa(Zn.fromDom(e.getBody()));return{top:Math.round(n.top()-ka(i.element()))+t+"px",left:Math.round(n.left())+"px"}}(n)),UT.refresh(i)},d=function(){var t=aT.getToolbar(n.outerContainer);s&&t.each(uO.refresh),a||l(t)},m=function(){su(n.outerContainer.element(),"display","flex"),u.addClass(e.getBody(),"mce-edit-focus"),d(),f&&aT.getToolbar(n.outerContainer).each(function(t){uO.getOverflow(t).each(function(t){eu(t.element(),"tox-toolbar__overflow--closed")})})},g=function(){n.outerContainer&&(su(n.outerContainer.element(),"display","none"),u.removeClass(e.getBody(),"mce-edit-focus"),f&&aT.getToolbar(n.outerContainer).each(function(t){uO.getOverflow(t).each(function(t){nu(t.element(),"tox-toolbar__overflow--closed")})}))},p=function(){if(i)m();else{i=n.outerContainer;var t=$v(e).getOr($r());Ms(t,n.mothership),Ms(t,n.uiMothership),aT.setToolbar(n.outerContainer,RE(e,o,{backstage:r},et.none())),aT.setMenubar(n.outerContainer,fT(e,o)),a||su(i.element(),"position","absolute"),d(),m(),e.on("NodeChange ResizeWindow",d),e.on("activate",m),e.on("deactivate",g),e.nodeChanged()}};return e.on("focus",p),e.on("blur hide",g),e.on("init",function(){e.hasFocus()&&p()}),{editorContainer:n.outerContainer.element().dom()}},getBehaviours:function(n){return Qv(n)?[]:[UT.config({leftAttr:"data-dock-left",topAttr:"data-dock-top",contextual:{lazyContext:function(t){return et.from(n).map(function(t){return Zn.fromDom(t.getBody())})},fadeInClass:"tox-toolbar-dock-fadein",fadeOutClass:"tox-toolbar-dock-fadeout",transitionClass:"tox-toolbar-dock-transition"}}),Nm.config({})]}},GT=function(t,n){return{anchor:"makeshift",x:t,y:n}},XT=function(t,n){var e,o,r,i=Uv.DOM.getPos(t);return e=n,o=i.x,r=i.y,GT(e.x+o,e.y+r)},YT=function(t,n){return"contextmenu"===n.type?t.inline?GT((o=n).pageX,o.pageY):XT(t.getContentAreaContainer(),GT((e=n).clientX,e.clientY)):qT(t);var e,o},qT=function(t){return{anchor:"selection",root:Zn.fromDom(t.selection.getNode())}},KT=function(t){return"string"==typeof t?t.split(/[ ,]/):t},JT=function(t){return t.settings.contextmenu_never_use_native||!1},$T=function(t){return e="contextmenu",o="link linkchecker image imagetools table spellchecker configurepermanentpen",r=(n=t).ui.registry.getAll().contextMenus,ft(n.settings,e).map(KT).getOrThunk(function(){return V(KT(o),function(t){return lt(r,t)})});var n,e,o,r},QT=function(t){return k(t)?"|"===t:"separator"===t.type},ZT={type:"separator"},tB=function(n){if(k(n))return n;switch(n.type){case"separator":return ZT;case"submenu":return{type:"nestedmenuitem",text:n.text,icon:n.icon,getSubmenuItems:function(){var t=n.getSubmenuItems();return k(t)?t:_(t,tB)}};default:return{type:"menuitem",text:n.text,icon:n.icon,onAction:t(n.onAction)}}},nB=function(t,n){if(0===n.length)return t;var e=$(t).filter(function(t){return!QT(t)}).fold(function(){return[]},function(t){return[ZT]});return t.concat(e).concat(n).concat([ZT])},eB=function(d,t,m){var g=Au(bg.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return d.focus()},fireDismissalEventInstead:{},inlineBehaviours:ea([og("dismissContextMenu",[ai(Gn(),function(t,n){Us.close(t),d.focus()})])])}));d.on("init",function(){d.on("contextmenu",function(n){if(t=d,!n.ctrlKey||JT(t)){var t,e,r,i,o,u=2!==n.button||n.target===d.getBody(),a=u?(e=d,{anchor:"node",node:et.some(Zn.fromDom(e.selection.getNode())),root:Zn.fromDom(e.getBody())}):YT(d,n),c=d.ui.registry.getAll(),s=$T(d),f=u?d.selection.getStart(!0):n.target,l=(r=c.contextMenus,i=f,0<(o=U(s,function(t,n){if(lt(r,n)){var e=r[n].update(i);if(k(e))return nB(t,e.split(" "));if(0<e.length){var o=_(e,tB);return nB(t,o)}return t}return t.concat([n])},[])).length&&QT(o[o.length-1])&&o.pop(),o);ty(l,Yp.CLOSE_ON_EXECUTE,m).map(function(t){n.preventDefault(),bg.showMenuAt(g,a,{menu:{markers:Yh("normal")},data:t})})}})})},oB=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?et.some(parseInt(t,10)):et.none()},rB=function(t){return D(t)?t+"px":t},iB="data-initial-z-index",uB=function(t,n){var e;t.getSystem().addToGui(n),ye((e=n).element()).each(function(n){gu(n,"z-index").each(function(t){ze(n,iB,t)}),su(n,"z-index",du(e.element(),"z-index"))})},aB=function(t){ye(t.element()).each(function(t){var n=Le(t,iB);je(t,iB)?su(t,"z-index",n):hu(t,"z-index"),Ue(t,iB)}),t.getSystem().removeFromGui(t)},cB=function(t,n,e,o){return(r=t,i=n,u=r.element(),a=parseInt(Le(u,i.leftAttr),10),c=parseInt(Le(u,i.topAttr),10),isNaN(a)||isNaN(c)?et.none():et.some(ma(a,c))).fold(function(){return e},function(t){return MT(t.left()+o.left(),t.top()+o.top())});var r,i,u,a,c},sB=function(t,n,e,o,r,i){var u,a,c,s=cB(t,n,e,o),f=lB(t,n,s,r,i),l=ET(s,r,i);return u=n,a=l,c=t.element(),ze(c,u.leftAttr,a.left()+"px"),ze(c,u.topAttr,a.top()+"px"),f.fold(function(){return{coord:MT(l.left(),l.top()),extra:et.none()}},function(t){return{coord:t.output(),extra:t.extra()}})},fB=function(t,n){var e,o;e=n,o=t.element(),Ue(o,e.leftAttr),Ue(o,e.topAttr)},lB=function(t,n,p,h,v){var e=n.getSnapPoints(t);return Ft(e,function(t){var n,e,o,r,i,u,a,c,s,f,l,d,m,g=t.sensor();return n=p,e=g,o=t.range().left(),r=t.range().top(),a=TT(n,i=h,u=v),c=TT(e,i,u),Math.abs(a.left()-c.left())<=o&&Math.abs(a.top()-c.top())<=r?et.some({output:nt((s=t.output(),f=p,l=h,d=v,m=function(o,r){return function(t,n){var e=o(f,l,d);return r(t.getOr(e.left()),n.getOr(e.top()))}},s.fold(m(BT,ST.offset),m(TT,ST.absolute),m(ET,ST.fixed)))),extra:t.extra}):et.none()})},dB=function(e,t,i,u,a,c){return t.fold(function(){var t,e,o,n=(t=i,e=c.left(),o=c.top(),t.fold(function(t,n){return ST.offset(t+e,n+o)},function(t,n){return ST.absolute(t+e,n+o)},function(t,n){return ST.fixed(t+e,n+o)})),r=ET(n,u,a);return MT(r.left(),r.top())},function(n){var t=sB(e,n,i,c,u,a);return t.extra.each(function(t){n.onSensor(e,t)}),t.coord})},mB=function(t,n,e){var o,r=n.getTarget(t.element());if(n.repositionTarget){var i=ve(t.element()),u=va(i),a=wT(r,u),c=gu(o=r,"left").bind(function(e){return gu(o,"top").bind(function(n){return gu(o,"position").map(function(t){return("fixed"===t?MT:DT)(parseInt(e,10),parseInt(n,10))})})}).getOrThunk(function(){var t=pa(o);return _T(t.left(),t.top())}),s=dB(t,n.snaps,c,u,a,e),f=AT(s,0,a);fu(r,f)}n.onDrag(t,r,e)},gB=Ar("snaps",[hr("getSnapPoints"),Wu("onSensor"),hr("leftAttr"),hr("topAttr"),Dr("lazyViewport",function(){var t=va();return{x:t.left,y:t.top,width:nt(x.window.innerWidth),height:nt(x.window.innerHeight),bottom:nt(t.top()+x.window.innerHeight),right:nt(t.left()+x.window.innerWidth)}})]),pB=/* */Object.freeze({getData:function(t){return et.from(ma(t.x(),t.y()))},getDelta:function(t,n){return ma(n.left()-t.left(),n.top()-t.top())}}),hB=[Dr("useFixed",!1),hr("blockerClass"),Dr("getTarget",d),Dr("onDrag",tt),Dr("repositionTarget",!0),Wu("onDrop"),gB,qu("dragger",{handlers:function(a,c){return oi([ai(zt(),function(n,t){if(0===t.event().raw().button){t.stop();var e,o={drop:function(){i()},delayDrop:function(){u.schedule()},forceDrop:function(){i()},move:function(t){u.cancel(),c.update(pB,t).each(function(t){mB(n,a,t)})}},r=n.getSystem().build(Lv.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[a.blockerClass]},events:(e=o,oi([ai(zt(),e.forceDrop),ai(Ut(),e.drop),ai(Lt(),function(t,n){e.move(n.event())}),ai(jt(),e.delayDrop)]))})),i=function(){aB(r),a.snaps.each(function(t){fB(n,t)});var t=a.getTarget(n.element());a.onDrop(n,t)},u=kv(i,200);c.reset(),uB(n,r)}})])}})],vB=/* */Object.freeze({getData:function(t){var n,e=t.raw().touches;return 1===e.length?(n=e[0],et.some(ma(n.clientX,n.clientY))):et.none()},getDelta:function(t,n){return ma(n.left()-t.left(),n.top()-t.top())}}),bB=hB,yB=[Dr("useFixed",!1),Dr("getTarget",d),Dr("onDrag",tt),Dr("repositionTarget",!0),Dr("onDrop",tt),gB,qu("dragger",{handlers:function(o,r){return oi([gi(Ht()),ai(Nt(),function(n,t){t.stop(),r.update(vB,t.event()).each(function(t){mB(n,o,t)})}),ai(Pt(),function(n,t){o.snaps.each(function(t){fB(n,t)});var e=o.getTarget(n.element());r.reset(),o.onDrop(n,e)})])}})],xB=/* */Object.freeze({mouse:bB,touch:yB}),wB=/* */Object.freeze({init:function(){var i=et.none(),t=nt({});return Pi({readState:t,reset:function(){i=et.none()},update:function(r,t){return r.getData(t).bind(function(t){return n=r,e=t,o=i.map(function(t){return n.getDelta(t,e)}),i=et.some(e),o;var n,e,o})}})}}),SB=ua({branchKey:"mode",branches:xB,name:"dragging",active:{events:function(t,n){return t.dragger.handlers(t,n)}},extra:{snap:oe(["sensor","range","output"],["extra"])},state:wB});(bE=vE||(vE={}))[bE.None=0]="None",bE[bE.Both=1]="Both",bE[bE.Vertical=2]="Vertical";var kB,CB,OB,EB,TB,BB,AB=function(t,n,e,o){var r=t+n,i=e.filter(function(t){return r<t}),u=o.filter(function(t){return t<r});return i.or(u).getOr(r)},DB=function(t,n,e,o,r){var i,u,a={};return a.height=AB(o,n.top(),Xv(t),(i=t,et.from(i.getParam("max_height")).filter(D))),e===vE.Both&&(a.width=AB(r,n.left(),Gv(t),(u=t,et.from(u.getParam("max_width")).filter(D)))),a},_B=function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1},MB=function(i,u){return u.delimiter||(u.delimiter="\xbb"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ea([pm.config({mode:"flow",selector:"div[role=button]"}),gy.config({}),xm.config({}),og("elementPathEvents",[hi(function(r,t){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return pm.focusIn(r)}),i.on("NodeChange",function(t){var n,o,e=function(t){for(var n=[],e=t.length;0<e--;){var o=t[e];if(1===o.nodeType&&!_B(o)){var r=i.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||n.push({name:r.name,element:o}),r.isPropagationStopped())break}}return n}(t.parents);0<e.length&&xm.set(r,(n=_(e||[],function(n,t){return xg.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":t,"tab-index":-1,"aria-level":t+1},innerHtml:n.name},action:function(t){i.focus(),i.selection.select(n.element),i.nodeChanged()}})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+u.delimiter+" "}},U(n.slice(1),function(t,n){var e=t;return e.push(o),e.push(n),e},[n[0]])))})})])]),components:[]}},FB=function(s,t){var n,e,o,r,i,u,a,c,f,l,d,m=function(c){return{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize")},innerHtml:kg("resize-handle",t.icons)},behaviours:ea([SB.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,n,e){var o,r,i,u,a;o=s,r=e,i=c,u=Zn.fromDom(o.getContainer()),a=DB(o,r,i,ka(u),xa(u)),rt(a,function(t,n){return su(u,n,rB(t))}),dT(o)},blockerClass:"tox-blocker"})])}};return{dom:{tag:"div",classes:["tox-statusbar"]},components:(d=[],s.getParam("elementpath",!0,"boolean")&&d.push(MB(s,{})),xn(s.settings.plugins,"wordcount")&&d.push((u=s,a=t,f=function(t,n,e){return xm.set(t,[Eu(a.translate(["{0} "+e,n[e]]))])},xg.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:ea([gy.config({}),xm.config({}),Fm.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),og("wordcount-events",[ai(Rn(),function(t){var n=Fm.getValue(t),e="words"===n.mode?"characters":"words";Fm.setValue(t,{mode:e,count:n.count}),f(t,n.count,e)}),hi(function(e){u.on("wordCountUpdate",function(t){var n=Fm.getValue(e).mode;Fm.setValue(e,{mode:n,count:t.wordCount}),f(e,t.wordCount,n)})})])]),eventOrder:(c={},c[Rn()]=["wordcount-events","alloy.base.behaviour"],c)}))),s.getParam("branding",!0,"boolean")&&d.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(l=ip.translate(["Powered by {0}","Tiny"]))+'">'+l+"</a>"}}),r=0<d.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:d}]:[],e=!xn((n=s).settings.plugins,"autoresize"),i=!1===(o=n.getParam("resize",e))?vE.None:"both"===o?vE.Both:vE.Vertical,i!==vE.None&&r.push(m(i)),r)}},IB=function(b){var t,n,e=b.getParam("inline",!1,"boolean"),y=e?WT:xT,o=et.none(),r=ip.isRtl()?{attributes:{dir:"rtl"}}:{},x=Au({dom:io({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"]},r),behaviours:ea([Cs.config({useFixed:!1})])}),i=wg({dom:{tag:"div",classes:["tox-anchorbar"]}}),u=function(){return o.bind(function(t){return aT.getMoreButton(t)}).getOrDie("Could not find more button element")},w=function(){return o.bind(function(t){return aT.getThrobber(t)}).getOrDie("Could not find throbber element")},S=BC(x,b,function(){return o.bind(function(t){return i.getOpt(t)}).getOrDie("Could not find a anchor bar element")},u),k=function(){return vt.value(x)},a=aT.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:S,onEscape:function(){b.focus()}}),c=aT.parts().toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:k,backstage:S,onEscape:function(){b.focus()},split:Jv(b),lazyToolbar:function(){return o.bind(function(t){return aT.getToolbar(t)}).getOrDie("Could not find more toolbar element")},lazyMoreButton:u}),s=aT.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),f=aT.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),l=aT.parts().throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:S}),d=b.getParam("statusbar",!0,"boolean")&&!e?et.some(FB(b,S.shared.providers)):et.none(),m={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[s,f]},g=(n=(t=b).getParam("toolbar"),(A(n)?0<n.length:!1!==t.getParam("toolbar",!0,"boolean"))||Yv(b).isSome()),p=!1!==b.getParam("menubar",!0,"boolean"),h=L([p?[a]:[],g?[c]:[],Qv(b)?[]:[i.asSpec()],e?[]:[m]]),v=L([[{dom:{tag:"div",classes:["tox-editor-container"]},components:h}],e?[]:d.toArray(),[l]]),C=io({role:"application"},ip.isRtl()?{dir:"rtl"}:{}),O=Au(aT.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(e?["tox-tinymce-inline"]:[]),styles:{visibility:"hidden"},attributes:C},components:v,behaviours:ea(y.getBehaviours(b).concat([pm.config({mode:"cyclic",selector:".tox-menubar, .tox-toolbar, .tox-toolbar__primary, .tox-toolbar__overflow--open, .tox-sidebar__overflow--open, .tox-statusbar__path, .tox-statusbar__wordcount, .tox-statusbar__branding a"})]))}));o=et.some(O),b.shortcuts.add("alt+F9","focus menubar",function(){aT.focusMenubar(O)}),b.shortcuts.add("alt+F10","focus toolbar",function(){aT.focusToolbar(O)});var E=jv(O),T=jv(x);NE(b,E,T);var B=function(t){var n,e=Uv.DOM,o=b.getParam("width",e.getStyle(t,"width")),r=(n=b).getParam("height",Math.max(n.getElement().offsetHeight,200)),i=Gv(b),u=Xv(b),a=oB(o).bind(function(n){return rB(i.map(function(t){return Math.max(n,t)}))}).getOr(rB(o)),c=oB(r).bind(function(n){return u.map(function(t){return Math.max(n,t)})}).getOr(r),s=rB(a);if(pu("div","width",s)&&su(O.element(),"width",s),!b.inline){var f=rB(c);pu("div","height",f)?su(O.element(),"height",f):su(O.element(),"height","200px")}return c};return{mothership:E,uiMothership:T,backstage:S,renderUI:function(){var o,r,e,n,i,u,a,c;eB(b,k,S),r=(o=b).ui.registry.getAll().sidebars,M(Z(r),function(n){var t=r[n],e=function(){return et.from(o.queryCommandValue("ToggleSidebar")).is(n)};o.ui.registry.addToggleButton(n,{icon:t.icon,tooltip:t.tooltip,onAction:function(t){o.execCommand("ToggleSidebar",!1,n),t.setActive(e())},onSetup:function(t){var n=function(){return t.setActive(e())};return o.on("ToggleSidebar",n),function(){o.off("ToggleSidebar",n)}}})}),e=b,n=w,i=S.shared,u=_t(!1),a=_t(et.none()),c=function(t){t!==u.get()&&(nT(n(),t,i.providers),u.set(t))},e.on("ProgressState",function(t){if(a.get().each(Eg.clearTimeout),D(t.time)){var n=Eg.setEditorTimeout(e,function(){return c(t.state)},t.time);a.set(et.some(n))}else c(t.state),a.set(et.none())});var t=b.ui.registry.getAll(),s=t.buttons,f=t.menuItems,l=t.contextToolbars,d=t.sidebars,m={menuItems:f,buttons:s,menus:b.settings.menu?it(b.settings.menu,function(t){return St(t,{items:t.items})}):{},menubar:b.settings.menubar,toolbar:Yv(b).getOr(b.getParam("toolbar",!0)),sidebar:d};HE(b,l,x,{backstage:S});var g=b.getElement(),p=B(g),h={mothership:E,uiMothership:T,outerContainer:O},v={targetNode:g,height:p};return y.render(b,h,m,S,v)},getUi:function(){return{channels:{broadcastAll:T.broadcast,broadcastOn:T.broadcastOn,register:function(){}}}}}},VB=function(n){uk.each([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],function(t){n.ui.registry.addToggleButton(t.name,{tooltip:t.text,onAction:function(){return n.execCommand(t.cmd)},icon:t.icon,onSetup:mE(n,t.name)})});var t="alignnone",e="No alignment",o="JustifyNone",r="align-none";n.ui.registry.addButton(t,{tooltip:e,onAction:function(){return n.execCommand(o)},icon:r})},RB=function(t,n){return function(){t.execCommand("mceToggleFormat",!1,n)}},HB=function(t){var n,e;!function(e){uk.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(t,n){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:mE(e,t.name),onAction:RB(e,t.name)})});for(var t=1;t<=6;t++){var n="h"+t;e.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+t,onSetup:mE(e,n),onAction:RB(e,n)})}}(t),n=t,uk.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],function(t){n.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return n.execCommand(t.action)}})}),e=t,uk.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:function(){return e.execCommand(t.action)},onSetup:mE(e,t.name)})})},NB=function(t){var n;HB(t),n=t,uk.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],function(t){n.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:function(){return n.execCommand(t.action)}})}),n.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:RB(n,"code")})},PB=function(t,n,e){var o=function(){return!!n.undoManager&&n.undoManager[e]()},r=function(){t.setDisabled(n.readonly||!o())};return t.setDisabled(!o()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r),function(){return n.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r)}},zB=function(t){var n,e;(n=t).ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(t){return PB(t,n,"hasUndo")},onAction:function(){return n.execCommand("undo")}}),n.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(t){return PB(t,n,"hasRedo")},onAction:function(){return n.execCommand("redo")}}),(e=t).ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(t){return PB(t,e,"hasUndo")},onAction:function(){return e.execCommand("undo")}}),e.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(t){return PB(t,e,"hasRedo")},onAction:function(){return e.execCommand("redo")}})},LB=function(t){var n,e;(n=t).ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return n.execCommand("mceToggleVisualAid")}}),(e=t).ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(t){return function(n,t){n.setActive(t.hasVisual);var e=function(t){n.setActive(t.hasVisual)};return t.on("VisualAid",e),function(){return t.off("VisualAid",e)}}(t,e)},onAction:function(){e.execCommand("mceToggleVisualAid")}})},jB=function(t){var n;(n=t).ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(t){return function(t,n){t.setDisabled(!n.queryCommandState("outdent"));var e=function(){t.setDisabled(!n.queryCommandState("outdent"))};return n.on("NodeChange",e),function(){return n.off("NodeChange",e)}}(t,n)},onAction:function(){return n.execCommand("outdent")}}),n.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return n.execCommand("indent")}})},UB=function(t,n){var e,o,r,i,u,a,c,s,f,l,d,m,g,p,h,v,b,y,x,w;o=n,r=wE(e=t),i=pE(0,o,r.dataset,r),e.ui.registry.addNestedMenuItem("align",{text:o.shared.providers.translate("Align"),getSubmenuItems:function(){return i.items.validateItems(i.getStyleItems())}}),a=n,c=kE(u=t),s=pE(0,a,c.dataset,c),u.ui.registry.addNestedMenuItem("fontformats",{text:a.shared.providers.translate("Fonts"),getSubmenuItems:function(){return s.items.validateItems(s.getStyleItems())}}),f=t,d=(l=n).styleselect,m=pE(0,l,d,BE(f)),f.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return m.items.validateItems(m.getStyleItems())}}),p=n,h=TE(g=t),v=pE(0,p,h.dataset,h),g.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return v.items.validateItems(v.getStyleItems())}}),y=n,x=OE(b=t),w=pE(0,y,x.dataset,x),b.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return w.items.validateItems(w.getStyleItems())}})},WB=function(t,n){VB(t),NB(t),UB(t,n),zB(t),Uh.register(t),LB(t),jB(t)},GB=function(t,n){var e=et.from(Le(t,"id")).fold(function(){var t=oo("dialog-label");return ze(n,"id",t),t},d);ze(t,"aria-labelledby",e)},XB=nt([hr("lazySink"),Cr("dragBlockClass"),Dr("useTabstopAt",nt(!0)),Dr("eventOrder",{}),Ks("modalBehaviours",[pm]),Gu("onExecute"),Yu("onEscape")]),YB={sketch:d},qB=nt([Af({name:"draghandle",overrides:function(t,n){return{behaviours:ea([SB.config({mode:"mouse",getTarget:function(t){return Mu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+Io(n,null,2)).message)})])}}}),Tf({schema:[hr("dom")],name:"title"}),Tf({factory:YB,schema:[hr("dom")],name:"close"}),Tf({factory:YB,schema:[hr("dom")],name:"body"}),Af({factory:YB,schema:[hr("dom")],name:"footer"}),Bf({factory:{sketch:function(t,n){return io({},t,{dom:n.dom,components:n.components})}},schema:[Dr("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Dr("components",[])],name:"blocker"})]),KB=il({name:"ModalDialog",configFields:XB(),partFields:qB(),factory:function(r,t,n,o){var a=oo("alloy.dialog.busy"),c=oo("alloy.dialog.idle"),s=ea([pm.config({mode:"special",onTab:function(){return et.some(!0)},onShiftTab:function(){return et.some(!0)}}),Nm.config({})]),e=oo("modal-events"),i=io({},r.eventOrder,{"alloy.system.attached":[e].concat(r.eventOrder["alloy.system.attached"]||[])});return{uid:r.uid,dom:r.dom,components:t,apis:{show:function(i){var t=r.lazySink(i).getOrDie(),u=_t(et.none()),n=o.blocker(),e=t.getSystem().build(io({},n,{components:n.components.concat([Du(i)]),behaviours:ea([og("dialog-blocker-events",[ai(c,function(t,n){je(i.element(),"aria-busy")&&(Ue(i.element(),"aria-busy"),u.get().each(function(t){return xm.remove(i,t)}))}),ai(a,function(t,n){ze(i.element(),"aria-busy","true");var e=n.event().getBusySpec();u.get().each(function(t){xm.remove(i,t)});var o=e(i,s),r=t.getSystem().build(o);u.set(et.some(r)),xm.append(i,Du(r)),r.hasConfigured(pm)&&pm.focusIn(r)})])])}));Ts(t,e),pm.focusIn(i)},hide:function(n){ye(n.element()).each(function(t){n.getSystem().getByDom(t).each(function(t){Ds(t)})})},getBody:function(t){return jf(t,r,"body")},getFooter:function(t){return jf(t,r,"footer")},setIdle:function(t){jr(t,c)},setBusy:function(t,n){Ur(t,a,{getBusySpec:n})}},eventOrder:i,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:$s(r.modalBehaviours,[xm.config({}),pm.config({mode:"cyclic",onEnter:r.onExecute,onEscape:r.onEscape,useTabstopAt:r.useTabstopAt}),og(e,[hi(function(t){var n,e,o;GB(t.element(),jf(t,r,"title").element()),n=t.element(),e=jf(t,r,"body").element(),o=et.from(Le(n,"id")).fold(function(){var t=oo("dialog-describe");return ze(e,"id",t),t},d),ze(n,"aria-describedby",o)})])])}},apis:{show:function(t,n){t.show(n)},hide:function(t,n){t.hide(n)},getBody:function(t,n){return t.getBody(n)},getFooter:function(t,n){return t.getFooter(n)},setBusy:function(t,n,e){t.setBusy(n,e)},setIdle:function(t,n){t.setIdle(n)}}}),JB=[br("type"),br("text"),yr("level",["info","warn","error","success"]),br("icon"),Dr("url","")],$B=[br("type"),br("text"),Vr("primary",!1),Ko("name","name",go(function(){return oo("button-name")}),dr),Tr("icon")],QB=[br("type"),br("name"),br("label")],ZB=mr,tA=[br("type"),br("name"),Tr("label")],nA=tA,eA=dr,oA=tA,rA=dr,iA=tA,uA=tr(),aA=tA.concat([Vr("sandboxed",!0)]),cA=dr,sA=tA.concat([Tr("placeholder")]),fA=dr,lA=tA.concat([Sr("items",[br("text"),br("value")]),Mr("size",1)]),dA=dr,mA=tA.concat([Vr("constrain",!0)]),gA=Uo([br("width"),br("height")]),pA=tA.concat([Tr("placeholder")]),hA=dr,vA=tA.concat([Ir("filetype","file",["image","media","file"])]),bA=Uo([br("value"),Dr("meta",{})]),yA=tA.concat([br("type"),Fr("tag","textarea"),xr("init")]),xA=dr,wA=[br("type"),br("html"),Ir("presets","presentation",["presentation","document"])],SA=tA.concat([vr("currentState",Uo([hr("blob"),br("url")]))]),kA=tA.concat([Dr("columns","auto")]),CA=Zo([br("value"),br("text"),br("icon")]),OA=[br("type"),kr("header",dr),kr("cells",Wo(dr))],EA=function(n){return Ko("items","items",lo(),Wo(nr(function(t){return rr("Checking item of "+n,TA,t).fold(function(t){return vt.error(ar(t))},function(t){return vt.value(t)})})))},TA=cr("type",{alertbanner:JB,bar:(EB=EA("bar"),[br("type"),EB]),button:$B,checkbox:QB,colorinput:nA,colorpicker:oA,dropzone:iA,grid:(CB=EA("grid"),[br("type"),(OB="columns",vr(OB,lr)),CB]),iframe:aA,input:sA,selectbox:lA,sizeinput:mA,textarea:pA,urlinput:vA,customeditor:yA,htmlpanel:wA,imagetools:SA,collection:kA,label:(kB=EA("label"),[br("type"),br("label"),kB]),table:OA}),BA=[br("type"),kr("items",TA)],AA=[br("title"),kr("items",TA)],DA=[br("type"),Sr("tabs",AA)],_A=[Ko("name","name",go(function(){return oo("button-name")}),dr),br("text"),Tr("icon"),Ir("align","end",["start","end"]),Vr("primary",!1),Vr("disabled",!1)],MA=Uo([yr("type",["submit","cancel","custom"])].concat(_A)),FA=Uo([br("title"),vr("body",cr("type",{panel:BA,tabpanel:DA})),Fr("size","normal"),kr("buttons",MA),Dr("initialData",{}),Rr("onAction",tt),Rr("onChange",tt),Rr("onSubmit",tt),Rr("onClose",tt),Rr("onCancel",tt),Dr("onTabChange",tt)]),IA=function(t){return C(t)?[t].concat(j(st(t),IA)):A(t)?j(t,IA):[]},VA=function(t){return k(t.type)&&k(t.name)},RA={checkbox:ZB,colorinput:eA,colorpicker:rA,dropzone:uA,input:fA,iframe:cA,sizeinput:gA,selectbox:dA,size:gA,textarea:hA,urlinput:bA,customeditor:xA,collection:CA},HA=function(t){var n=j(V(IA(t),VA),function(n){return(t=n,et.from(RA[t.type])).fold(function(){return[]},function(t){return[vr(n.name,t)]});var t});return Uo(n)},NA=Uo([yr("type",["cancel","custom"])].concat(_A)),PA=Uo([br("title"),br("url"),Er("height"),Er("width"),(TB="buttons",BB=NA,Or(TB,Wo(BB))),Rr("onAction",tt),Rr("onCancel",tt),Rr("onClose",tt),Rr("onMessage",tt)]),zA=function(t){return{internalDialog:ir(rr("dialog",FA,t)),dataValidator:HA(t),initialData:t.initialData}},LA={open:function(t,n){var e=zA(n);return t(e.internalDialog,e.initialData,e.dataValidator)},openUrl:function(t,n){return t(ir(rr("dialog",PA,n)))},redial:function(t){return zA(t)}},jA=function(t){var e=[],o={};return rt(t,function(t,n){t.fold(function(){e.push(n)},function(t){o[n]=t})}),0<e.length?vt.error(e):vt.value(o)},UA=rl({name:"TabButton",configFields:[Dr("uid",undefined),hr("value"),Ko("dom","dom",po(function(t){return{attributes:{role:"tab",id:oo("aria"),"aria-selected":"false"}}}),sr()),Cr("action"),Dr("domModification",{}),Ks("tabButtonBehaviours",[Nm,pm,Fm]),hr("view")],factory:function(t,n){return{uid:t.uid,dom:t.dom,components:t.components,events:yg(t.action),behaviours:$s(t.tabButtonBehaviours,[Nm.config({}),pm.config({mode:"execution",useSpace:!0,useEnter:!0}),Fm.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),WA=nt([hr("tabs"),hr("dom"),Dr("clickToDismiss",!1),Ks("tabbarBehaviours",[Sl,pm]),ju(["tabClass","selectedClass"])]),GA=Df({factory:UA,name:"tabs",unit:"tab",overrides:function(o,t){var r=function(t,n){Sl.dehighlight(t,n),Ur(t,Kn(),{tabbar:t,button:n})},i=function(t,n){Sl.highlight(t,n),Ur(t,qn(),{tabbar:t,button:n})};return{action:function(t){var n=t.getSystem().getByUid(o.uid).getOrDie(),e=Sl.isHighlighted(n,t);(e&&o.clickToDismiss?r:e?tt:i)(n,t)},domModification:{classes:[o.markers.tabClass]}}}}),XA=nt([GA]),YA=il({name:"Tabbar",configFields:WA(),partFields:XA(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:$s(t.tabbarBehaviours,[Sl.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,n){ze(n.element(),"aria-selected","true")},onDehighlight:function(t,n){ze(n.element(),"aria-selected","false")}}),pm.config({mode:"flow",getInitial:function(t){return Sl.getHighlighted(t).map(function(t){return t.element()})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),qA=rl({name:"Tabview",configFields:[Ks("tabviewBehaviours",[xm])],factory:function(t,n){return{uid:t.uid,dom:t.dom,behaviours:$s(t.tabviewBehaviours,[xm.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),KA=nt([Dr("selectFirst",!0),Wu("onChangeTab"),Wu("onDismissTab"),Dr("tabs",[]),Ks("tabSectionBehaviours",[])]),JA=Tf({factory:YA,schema:[hr("dom"),wr("markers",[hr("tabClass"),hr("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),$A=Tf({factory:qA,name:"tabview"}),QA=nt([JA,$A]),ZA=il({name:"TabSection",configFields:KA(),partFields:QA(),factory:function(i,t,n,e){var o=function(t,n){Lf(t,i,"tabbar").each(function(t){n(t).each(Wr)})};return{uid:i.uid,dom:i.dom,components:t,behaviours:Js(i.tabSectionBehaviours),events:oi(L([i.selectFirst?[hi(function(t,n){o(t,Sl.getFirst)})]:[],[ai(qn(),function(t,n){var o,r,e=n.event().button();o=e,r=Fm.getValue(o),Lf(o,i,"tabview").each(function(e){H(i.tabs,function(t){return t.value===r}).each(function(t){var n=t.view();ze(e.element(),"aria-labelledby",Le(o.element(),"id")),xm.set(e,n),i.onChangeTab(e,o,n)})})}),ai(Kn(),function(t,n){var e=n.event().button();i.onDismissTab(t,e)})]])),apis:{getViewItems:function(t){return Lf(t,i,"tabview").map(function(t){return xm.contents(t)}).getOr([])},showTab:function(t,e){o(t,function(n){var t=Sl.getCandidates(n);return H(t,function(t){return Fm.getValue(t)===e}).filter(function(t){return!Sl.isHighlighted(n,t)})})}}}},apis:{getViewItems:function(t,n){return t.getViewItems(n)},showTab:function(t,n,e){t.showTab(n,e)}}}),tD=function(i,u,t){Mu(i,'[role="dialog"]').each(function(r){t.get().map(function(t){return su(u,"height","0"),Math.min(t,(e=i,o=Mu(n=r,".tox-dialog-wrap").getOr(n),("fixed"===du(o,"position")?Math.max(x.document.documentElement.clientHeight,x.window.innerHeight):Math.max(x.document.documentElement.offsetHeight,x.document.documentElement.scrollHeight))-(n.dom().getBoundingClientRect().height-e.dom().getBoundingClientRect().height)));var n,e,o}).each(function(t){su(u,"height",t+"px")})})},nD=function(a){var c;return{smartTabHeight:(c=_t(et.none()),{extraEvents:[hi(function(t){Fu(t.element(),'[role="tabpanel"]').each(function(u){var n;su(u,"visibility","hidden"),t.getSystem().getByDom(u).toOption().each(function(t){var o,r,i,n=(r=u,i=t,_(o=a,function(t,n){xm.set(i,o[n].view());var e=r.dom().getBoundingClientRect();return xm.set(i,[]),e.height})),e=J(K(n,function(t,n){return n<t?-1:t<n?1:0}));c.set(e)}),tD(t.element(),u,c),hu(u,"visibility"),n=t,J(a).each(function(t){return ZA.showTab(n,t.value)}),Eg.requestAnimationFrame(function(){tD(t.element(),u,c)})})}),ai(jn(),function(n){Fu(n.element(),'[role="tabpanel"]').each(function(t){tD(n.element(),t,c)})}),ai(ab,function(r,t){Fu(r.element(),'[role="tabpanel"]').each(function(n){var t=Vl();su(n,"visibility","hidden");var e=gu(n,"height").map(function(t){return parseInt(t,10)});hu(n,"height");var o=n.dom().getBoundingClientRect().height;e.forall(function(t){return t<o})?(c.set(et.from(o)),tD(r.element(),n,c)):e.each(function(t){su(n,"height",t+"px")}),hu(n,"visibility"),t.each(Il)})})],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}},eD="send-data-to-section",oD="send-data-to-view",rD=oo("update-dialog"),iD=oo("update-title"),uD=oo("update-body"),aD=oo("update-footer"),cD=oo("body-send-message"),sD=function(t,n,d,e){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:io({},n.map(function(t){return{id:t}}).getOr({}),e?{"aria-live":"polite"}:{})},components:[],behaviours:ea([Ew(0),VO.config({channel:uD,updateState:function(t,n){return et.some({isTabPanel:function(){return"tabpanel"===n.body.type}})},renderComponents:function(t){switch(t.body.type){case"tabpanel":return[(r={tabs:t.body.tabs},i=d,u=_t({}),a=function(t){var n=Fm.getValue(t),e=jA(n).getOr({}),o=u.get(),r=wt(o,e);u.set(r)},c=function(t){var n=u.get();Fm.setValue(t,n)},s=_t(null),f=_(r.tabs,function(t){return{value:t.title,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:i.shared.providers.translate(t.title)},view:function(){return[hw.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"]},components:_(t.items,function(t){return zk(n,t,i)}),formBehaviours:ea([pm.config({mode:"acyclic",useTabstopAt:S(Lw)}),og("TabView.form.events",[hi(c),vi(a)]),fa.config({channels:Bt([{key:eD,value:{onReceive:a}},{key:oD,value:{onReceive:c}}])})])}})]}}}),l=nD(f).smartTabHeight,ZA.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,n,e){var o=Fm.getValue(n);Ur(t,ub,{title:o,oldTitle:s.get()}),s.set(o)},tabs:f,components:[ZA.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[YA.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ea([gy.config({})])}),ZA.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:l.selectFirst,tabSectionBehaviours:ea([og("tabpanel",l.extraEvents),pm.config({mode:"acyclic"}),sl.config({find:function(t){return J(ZA.getViewItems(t))}}),Fm.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([eD],{}),u.get()},setValue:function(t,n){u.set(n),t.getSystem().broadcastOn([oD],{})}}})])}))];default:return[(e={items:t.body.items},o=d,n=wg(hw.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"]},components:_(e.items,function(t){return zk(n,t,o)})}})),{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[n.asSpec()]}],behaviours:ea([pm.config({mode:"acyclic",useTabstopAt:S(Lw)}),Ow(n),Mw(n,{postprocess:function(t){return jA(t).fold(function(t){return x.console.error(t),{}},function(t){return t})}})])})]}var e,o,n,r,i,u,a,c,s,f,l},initialData:t})])}},fD=function(t,e){return[di(Gt(),jw),t(tb,function(t,n){e.onClose(),n.onClose()}),t(nb,function(t,n,e,o){n.onCancel(t),jr(o,tb)}),ai(ib,function(t,n){return e.onUnblock()}),ai(rb,function(t,n){return e.onBlock(n.event())})]},lD=function(i,t){var n=function(t,r){return ai(t,function(e,o){u(e,function(t,n){r(i(),t,o.event(),e)})})},u=function(n,e){VO.getState(n).get().each(function(t){e(t,n)})};return fD(n,t).concat([n(eb,function(t,n,e){n.onAction(t,{name:e.name()})})])},dD=function(i,t){var n=function(t,r){return ai(t,function(e,o){u(e,function(t,n){r(i(),t,o.event(),e)})})},u=function(n,e){VO.getState(n).get().each(function(t){e(t.internalDialog,n)})};return fD(n,t).concat([n(ob,function(t,n){return n.onSubmit(t)}),n(Zv,function(t,n,e){n.onChange(t,{name:e.name()})}),n(eb,function(t,n,e){n.onAction(t,{name:e.name(),value:e.value()})}),n(ub,function(t,n,e){n.onTabChange(t,e.title())}),vi(function(t){var n=i();Fm.setValue(t,n.getData())})])},mD=function(t,n){var e=n.map(function(t){return t.footerButtons}).getOr([]),o=I(e,function(t){return"start"===t.align}),r=function(t,n){return Lv.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:_(n,function(t){return t.memento.asSpec()})})};return[r("start",o.pass),r("end",o.fail)]},gD=function(t,i){return{dom:rp('<div class="tox-dialog__footer"></div>'),components:[],behaviours:ea([VO.config({channel:aD,initialData:t,updateState:function(t,n){var r=_(n.buttons,function(t){var n,e,o=wg((e=i,LS(n=t,n.type,e)));return{name:t.name,align:t.align,memento:o}});return et.some({lookupByName:function(t,n){return e=t,o=n,H(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(e)});var e,o},footerButtons:r})},renderComponents:mD})])}},pD=function(t,n){return KB.parts().footer(gD(t,n))},hD=function(n,e){if(n.getRoot().getSystem().isConnected()){var o=sl.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return hw.getField(o,e).fold(function(){var t=n.getFooter();return VO.getState(t).get().bind(function(t){return t.lookupByName(o,e)})},function(t){return et.some(t)})}return et.none()},vD=function(c,o){var t=function(t){var n=c.getRoot();n.getSystem().isConnected()&&t(n)},s={getData:function(){var t=c.getRoot(),n=t.getSystem().isConnected()?c.getFormWrapper():t;return Fm.getValue(n)},setData:function(a){t(function(t){var n,e,o=s.getData(),r=St(o,a),i=(n=r,e=c.getRoot(),VO.getState(e).get().map(function(t){return ir(rr("data",t.dataValidator,n))}).getOr(n)),u=c.getFormWrapper();Fm.setValue(u,i)})},disable:function(t){hD(c,t).each(Np.disable)},enable:function(t){hD(c,t).each(Np.enable)},focus:function(t){hD(c,t).each(Nm.focus)},block:function(n){if(!k(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){Ur(t,rb,{message:n})})},unblock:function(){t(function(t){jr(t,ib)})},showTab:function(e){t(function(t){var n=c.getBody();VO.getState(n).get().exists(function(t){return t.isTabPanel()})&&sl.getCurrent(n).each(function(t){ZA.showTab(t,e)})})},redial:function(e){t(function(t){var n=o(e);t.getSystem().broadcastOn([rD],n),t.getSystem().broadcastOn([iD],n.internalDialog),t.getSystem().broadcastOn([uD],n.internalDialog),t.getSystem().broadcastOn([aD],n.internalDialog),s.setData(n.initialData)})},close:function(){t(function(t){jr(t,tb)})}};return s},bD=function(t){return xg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:'<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><path d="M17.953 7.453L13.422 12l4.531 4.547-1.406 1.406L12 13.422l-4.547 4.531-1.406-1.406L10.578 12 6.047 7.453l1.406-1.406L12 10.578l4.547-4.531z" fill-rule="evenodd"></path></svg>'}}],action:function(t){jr(t,nb)}})},yD=function(t,n,e){var o=function(t){return[Eu(e.translate(t.title))]};return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:io({},n.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:ea([VO.config({channel:iD,renderComponents:o})])}},xD=function(t,n){return e={title:n.shared.providers.translate(t),draggable:!0},o=n.shared.providers,r=KB.parts().title(yD(e,et.none(),o)),i=KB.parts().draghandle({dom:rp('<div class="tox-dialog__draghandle"></div>')}),u=KB.parts().close(bD(o)),a=[r].concat(e.draggable?[i]:[]).concat([u]),Lv.sketch({dom:rp('<div class="tox-dialog__header"></div>'),components:a});var e,o,r,i,u,a},wD=function(t,n){return{onClose:function(){return n.closeWindow()},onBlock:function(e){KB.setBusy(t(),function(t,n){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:n,components:[{dom:rp('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})},onUnblock:function(){KB.setIdle(t())}}},SD=function(t,n,e,o){var r;return Au(KB.sketch({lazySink:o.shared.getSink,onEscape:function(t){return jr(t,nb),et.some(!0)},useTabstopAt:function(t){return!Lw(t)&&("button"!==Fe(t)||"disabled"!==Le(t,"disabled"))},modalBehaviours:ea([VO.config({channel:rD,updateState:function(t,n){return et.some(n)},initialData:n}),Vw({}),Nm.config({}),og("execute-on-form",e.concat([pi(Gt(),function(t,n){pm.focusIn(t)})])),og("scroll-lock",[hi(function(){nu($r(),"tox-dialog__disable-scroll")}),vi(function(){eu($r(),"tox-dialog__disable-scroll")})])].concat(t.extraBehaviours)),eventOrder:(r={},r[Fn()]=["execute-on-form"],r[Mn()]=["reflecting","receiving"],r[Un()]=["scroll-lock","reflecting","messages","execute-on-form","alloy.base.behaviour"],r[Wn()]=["alloy.base.behaviour","execute-on-form","messages","reflecting","scroll-lock"],r),dom:{tag:"div",classes:["tox-dialog"].concat(t.extraClasses),styles:io({position:"relative"},t.extraStyles)},components:[t.header,t.body].concat(t.footer.toArray()),dragBlockClass:"tox-dialog-wrap",parts:{blocker:{dom:rp('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}}}))},kD=function(t,n,e){var o,r,i,u=xD(t.internalDialog.title,e),a=(o={body:t.internalDialog.body},r=e,i=sD(o,et.none(),r,!1),KB.parts().body(i)),c=pD({buttons:t.internalDialog.buttons},e.shared.providers),s=dD(function(){return m},wD(function(){return d},n)),f="normal"!==t.internalDialog.size?"large"===t.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],l={header:u,body:a,footer:et.some(c),extraClasses:f,extraBehaviours:[],extraStyles:{}},d=SD(l,t,s,e),m=vD({getRoot:function(){return d},getBody:function(){return KB.getBody(d)},getFooter:function(){return KB.getFooter(d)},getFormWrapper:function(){var t=KB.getBody(d);return sl.getCurrent(t).getOr(t)}},n.redial);return{dialog:d,instanceApi:m}},CD=tinymce.util.Tools.resolve("tinymce.util.URI"),OD=["insertContent","setContent","execCommand","close","block","unblock"],ED=function(t){return C(t)&&-1!==OD.indexOf(t.mceAction)},TD=function(o,t,r,n){var e,i,u,a,c=xD(o.title,n),s=(i={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[Uw({dom:{tag:"iframe",attributes:{src:o.url}},behaviours:ea([gy.config({}),Nm.config({})])})]}],behaviours:ea([pm.config({mode:"acyclic",useTabstopAt:S(Lw)})])},KB.parts().body(i)),f=o.buttons.bind(function(t){return 0===t.length?et.none():et.some(pD({buttons:t},n.shared.providers))}),l=lD(function(){return y},wD(function(){return b},t)),d=io({},o.height.fold(function(){return{}},function(t){return{height:t+"px","max-height":t+"px"}}),o.width.fold(function(){return{}},function(t){return{width:t+"px","max-width":t+"px"}})),m=o.width.isNone()&&o.height.isNone()?["tox-dialog--width-lg"]:[],g=new CD(o.url,{base_uri:new CD(x.window.location.href)}),p=g.protocol+"://"+g.host+(g.port?":"+g.port:""),h=_t(et.none()),v=[og("messages",[hi(function(){var t=xv(Zn.fromDom(x.window),"message",function(t){if(g.isSameOrigin(new CD(t.raw().origin))){var n=t.raw().data;ED(n)?function(t,n,e){switch(e.mceAction){case"insertContent":t.insertContent(e.content);break;case"setContent":t.setContent(e.content);break;case"execCommand":var o=!!O(e.ui)&&e.ui;t.execCommand(e.cmd,o,e.value);break;case"close":n.close();break;case"block":n.block(e.message);break;case"unblock":n.unblock()}}(r,y,n):!ED(e=n)&&C(e)&&lt(e,"mceAction")&&o.onMessage(y,n)}var e});h.set(et.some(t))}),vi(function(){h.get().each(function(t){return t.unbind()})})]),fa.config({channels:(e={},e[cD]={onReceive:function(t,n){Fu(t.element(),"iframe").each(function(t){t.dom().contentWindow.postMessage(n,p)})}},e)})],b=SD({header:c,body:s,footer:f,extraClasses:m,extraBehaviours:v,extraStyles:d},o,l,n),y=(u=b,a=function(t){u.getSystem().isConnected()&&t(u)},{block:function(n){if(!k(n))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");a(function(t){Ur(t,rb,{message:n})})},unblock:function(){a(function(t){jr(t,ib)})},close:function(){a(function(t){jr(t,tb)})},sendMessage:function(n){a(function(t){t.getSystem().broadcastOn([cD],n)})}});return{dialog:b,instanceApi:y}},BD=function(t,n,e,o){var r,i,u,a,c,s,f,l,d,m,g,p=oo("dialog-label"),h=oo("dialog-content"),v=wg((u={title:t.internalDialog.title,draggable:!0},a=p,c=e.shared.providers,Lv.sketch({dom:rp('<div class="tox-dialog__header"></div>'),components:[yD(u,et.some(a),c),bD(c)],containerBehaviours:ea([SB.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Iu(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),b=wg((s={body:t.internalDialog.body},f=h,l=e,d=o,sD(s,et.some(f),l,d))),y=wg((m={buttons:t.internalDialog.buttons},g=e.shared.providers,gD(m,g))),x=dD(function(){return S},{onBlock:function(){},onUnblock:function(){},onClose:function(){return n.closeWindow()}}),w=Au({dom:{tag:"div",classes:["tox-dialog"],attributes:(r={role:"dialog"},r["aria-labelledby"]=p,r["aria-describedby"]=""+h,r)},eventOrder:(i={},i[Mn()]=[VO.name(),fa.name()],i[Fn()]=["execute-on-form"],i[Un()]=["reflecting","execute-on-form"],i),behaviours:ea([pm.config({mode:"cyclic",onEscape:function(t){return jr(t,tb),et.some(!0)},useTabstopAt:function(t){return!Lw(t)&&("button"!==Fe(t)||"disabled"!==Le(t,"disabled"))}}),VO.config({channel:rD,updateState:function(t,n){return et.some(n)},initialData:t}),og("execute-on-form",x),Vw({})]),components:[v.asSpec(),b.asSpec(),y.asSpec()]}),S=vD({getRoot:function(){return w},getFooter:function(){return y.get(w)},getBody:function(){return b.get(w)},getFormWrapper:function(){var t=b.get(w);return sl.getCurrent(t).getOr(t)}},n.redial);return{dialog:w,instanceApi:S}},AD=function(t,n){return KB.parts().close(xg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close")}},action:t,buttonBehaviours:ea([gy.config({})])}))},DD=function(){return KB.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},_D=function(t,n){return KB.parts().body({dom:{tag:"div",classes:["tox-dialog__body","todo-tox-fit"]},components:[{dom:rp("<p>"+n.translate(t)+"</p>")}]})},MD=function(t){return KB.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},FD=function(t,n){return[Lv.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),Lv.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]},ID=function(e){return KB.sketch({lazySink:e.lazySink,onEscape:function(){return e.onCancel(),et.some(!0)},dom:{tag:"div",classes:["tox-dialog"].concat(e.extraClasses)},components:[{dom:{tag:"div",classes:["tox-dialog__header"]},components:[e.partSpecs.title,e.partSpecs.close]},e.partSpecs.body,e.partSpecs.footer],parts:{blocker:{dom:rp('<div class="tox-dialog-wrap"></div>'),components:[{dom:{tag:"div",classes:["tox-dialog-wrap__backdrop"]}}]}},modalBehaviours:ea([og("basic-dialog-events",[ai(nb,function(t,n){e.onCancel()}),ai(ob,function(t,n){e.onSubmit()})])])})},VD=function(s){var u,a,e=(u=s.backstage.shared,{open:function(t,n){var e=function(){KB.hide(r),n()},o=wg(LS({name:"close-alert",text:"OK",primary:!0,icon:et.none()},"cancel",u.providers)),r=Au(ID({lazySink:function(){return u.getSink()},partSpecs:{title:DD(),close:AD(function(){e()},u.providers),body:_D(t,u.providers),footer:MD(FD([],[o.asSpec()]))},onCancel:function(){return e()},onSubmit:tt,extraClasses:["tox-alert-dialog"]}));KB.show(r);var i=o.get(r);Nm.focus(i)}}),o=(a=s.backstage.shared,{open:function(t,n){var e=function(t){KB.hide(i),n(t)},o=wg(LS({name:"yes",text:"Yes",primary:!0,icon:et.none()},"submit",a.providers)),r=LS({name:"no",text:"No",primary:!0,icon:et.none()},"cancel",a.providers),i=Au(ID({lazySink:function(){return a.getSink()},partSpecs:{title:DD(),close:AD(function(){e(!1)},a.providers),body:_D(t,a.providers),footer:MD(FD([],[r,o.asSpec()]))},onCancel:function(){return e(!1)},onSubmit:function(){return e(!0)},extraClasses:["tox-confirm-dialog"]}));KB.show(i);var u=o.get(i);Nm.focus(u)}}),r=function(t,e){return LA.openUrl(function(t){var n=TD(t,{closeWindow:function(){KB.hide(n.dialog),e(n.instanceApi)}},s.editor,s.backstage);return KB.show(n.dialog),n.instanceApi},t)},i=function(t,i){return LA.open(function(t,n,e){var o=n,r=kD({dataValidator:e,initialData:o,internalDialog:t},{redial:LA.redial,closeWindow:function(){KB.hide(r.dialog),i(r.instanceApi)}},s.backstage);return KB.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},t)},c=function(t,u,a,c){return LA.open(function(t,n,e){var o=ir(rr("data",e,n)),r=BD({dataValidator:e,initialData:o,internalDialog:t},{redial:LA.redial,closeWindow:function(){bg.hide(i),a(r.instanceApi)}},s.backstage,c),i=Au(bg.sketch({lazySink:s.backstage.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},inlineBehaviours:ea([og("window-manager-inline-events",[ai(Gn(),function(t,n){jr(r.dialog,nb)})])])}));return bg.showAt(i,u,Du(r.dialog)),r.instanceApi.setData(o),pm.focusIn(r.dialog),r.instanceApi},t)};return{open:function(t,n,e){return n!==undefined&&"toolbar"===n.inline?c(t,s.backstage.shared.anchors.toolbar(),e,n.ariaAttrs):n!==undefined&&"cursor"===n.inline?c(t,s.backstage.shared.anchors.cursor(),e,n.ariaAttrs):i(t,e)},openUrl:function(t,n){return r(t,n)},alert:function(t,n){e.open(t,function(){n()})},close:function(t){t.close()},confirm:function(t,n){o.open(t,function(t){n(t)})}}};ro.add("silver",function(t){var n=IB(t),e=n.mothership,o=n.uiMothership,r=n.backstage,i=n.renderUI,u=n.getUi;WB(t,r),to(oo("silver-demo"),e),to(oo("silver-ui-demo"),o),pv(t,r.shared);var a=VD({editor:t,backstage:r});return{renderUI:i,getWindowManagerImpl:nt(a),getNotificationManagerImpl:function(){return Tg(t,{backstage:r},o)},ui:u()}}),function a_(){}}(window);