agenda-libre-ruby/public/assets/tinymce/themes/silver/theme-74965ba198307e513a8b8ab9c75bf7afceab2aab3db185c520de06bae6e0bc24.js
2020-01-07 21:44:24 +01:00

10 lines
396 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.1.4 (2019-12-11)
*/
!function(v){"use strict";function Z(){}function i(e,o){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e(o.apply(null,n))}}function l(n){return n}var nn=function(n){return function(){return n}};function d(o){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var e=r.concat(n);return o.apply(null,e)}}function b(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return!e.apply(null,n)}}function r(n){return function(){throw new Error(n)}}var u=nn(!1),a=nn(!0),n=tinymce.util.Tools.resolve("tinymce.ThemeManager"),N=function(){return(N=Object.assign||function(n){for(var t,e=1,o=arguments.length;e<o;e++)for(var r in t=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}).apply(this,arguments)};function c(n,t){var e={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&t.indexOf(o)<0&&(e[o]=n[o]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(n);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(n,o[r])&&(e[o[r]]=n[o[r]])}return e}function g(){for(var n=0,t=0,e=arguments.length;t<e;t++)n+=arguments[t].length;var o=Array(n),r=0;for(t=0;t<e;t++)for(var i=arguments[t],u=0,a=i.length;u<a;u++,r++)o[r]=i[u];return o}function t(){return s}var e,s=(e={fold:function(n,t){return n()},is:u,isSome:u,isNone:a,getOr:m,getOrThunk:f,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:nn(null),getOrUndefined:nn(undefined),or:m,orThunk:f,map:t,each:Z,bind:t,exists:u,forall:a,filter:t,equals:o,equals_:o,toArray:function(){return[]},toString:nn("none()")},Object.freeze&&Object.freeze(e),e);function o(n){return n.isNone()}function f(n){return n()}function m(n){return n}function p(t){return function(n){return function(n){if(null===n)return"null";var t=typeof n;return"object"==t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t}(n)===t}}function h(n,t){if(fn(n)){for(var e=0,o=n.length;e<o;++e)if(!0!==t(n[e]))return!1;return!0}return!1}function y(n,t){return pn.call(n,t)}function x(n,t){for(var e=0,o=n.length;e<o;e++){if(t(n[e],e))return!0}return!1}function w(n,t){for(var e=[],o=0;o<n.length;o+=t){var r=gn.call(n,o,o+t);e.push(r)}return e}function S(n,t){for(var e=n.length,o=new Array(e),r=0;r<e;r++){var i=n[r];o[r]=t(i,r)}return o}function C(n,t){for(var e=[],o=0,r=n.length;o<r;o++){var i=n[o];t(i,o)&&e.push(i)}return e}function k(n,t,e){return function(n,t){for(var e=n.length-1;0<=e;e--){t(n[e],e)}}(n,function(n){e=t(e,n)}),e}function O(n,t,e){return bn(n,function(n){e=t(e,n)}),e}function T(n,t){for(var e=0,o=n.length;e<o;e++){var r=n[e];if(t(r,e))return on.some(r)}return on.none()}function E(n,t){for(var e=0,o=n.length;e<o;e++){if(t(n[e],e))return on.some(e)}return on.none()}function H(n){for(var t=[],e=0,o=n.length;e<o;++e){if(!fn(n[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+n);hn.apply(t,n[e])}return t}function D(n,t){var e=S(n,t);return H(e)}function B(n,t){for(var e=0,o=n.length;e<o;++e){if(!0!==t(n[e],e))return!1}return!0}function A(n){var t=gn.call(n,0);return t.reverse(),t}function _(n,t){return C(n,function(n){return!vn(t,n)})}function M(n){return[n]}function F(n){return 0===n.length?on.none():on.some(n[n.length-1])}function P(n,e){return kn(n,function(n,t){return{k:t,v:e(n,t)}})}function I(n,t){for(var e=wn(n),o=0,r=e.length;o<r;o++){var i=e[o],u=n[i];if(t(u,i,n))return on.some(u)}return on.none()}function R(n){return On(n,function(n){return n})}function V(n,t){return Tn(n,t)?on.from(n[t]):on.none()}function z(u){return function(){for(var n=new Array(arguments.length),t=0;t<n.length;t++)n[t]=arguments[t];if(0===n.length)throw new Error("Can't merge zero objects");for(var e={},o=0;o<n.length;o++){var r=n[o];for(var i in r)Dn.call(r,i)&&(e[i]=u(e[i],r[i]))}return e}}function L(e){var o,r=!1;return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return r||(r=!0,o=e.apply(null,n)),o}}function j(n){return _n.defaultedThunk(nn(n))}function U(t){return function(n){return Tn(n,t)?on.from(n[t]):on.none()}}function W(n,t){return U(t)(n)}function G(n,t){var e={};return e[n]=t,e}function X(n,t){return function(n,e){var o={};return Cn(n,function(n,t){vn(e,t)||(o[t]=n)}),o}(n,t)}function Y(n,t){return function(t,e){return function(n){return Tn(n,t)?n[t]:e}}(n,t)}function q(n,t){return G(n,t)}function K(n){return function(n){var t={};return bn(n,function(n){t[n.key]=n.value}),t}(n)}function J(n,t){var e=function(n){var t=[],e=[];return bn(n,function(n){n.fold(function(n){t.push(n)},function(n){e.push(n)})}),{errors:t,values:e}}(n);return 0<e.errors.length?function(n){return an.error(H(n))}(e.errors):function(n,t){return 0===n.length?an.value(t):an.value(Bn(t,An.apply(undefined,n)))}(e.values,t)}function $(n,t){return function(n,t){return Tn(n,t)&&n[t]!==undefined&&null!==n[t]}(n,t)}var Q,tn,en=function(e){function n(){return r}function t(n){return n(e)}var o=nn(e),r={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:a,isNone:u,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:n,orThunk:n,map:function(n){return en(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?r:s},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(u,function(n){return t(e,n)})}};return r},on={some:en,none:t,from:function(n){return null===n||n===undefined?s:en(n)}},rn=function(e){return{is:function(n){return e===n},isValue:a,isError:u,getOr:nn(e),getOrThunk:nn(e),getOrDie:nn(e),or:function(n){return rn(e)},orThunk:function(n){return rn(e)},fold:function(n,t){return t(e)},map:function(n){return rn(n(e))},mapError:function(n){return rn(e)},each:function(n){n(e)},bind:function(n){return n(e)},exists:function(n){return n(e)},forall:function(n){return n(e)},toOption:function(){return on.some(e)}}},un=function(e){return{is:u,isValue:u,isError:a,getOr:l,getOrThunk:function(n){return n()},getOrDie:function(){return r(String(e))()},or:function(n){return n},orThunk:function(n){return n()},fold:function(n,t){return n(e)},map:function(n){return un(e)},mapError:function(n){return un(n(e))},each:Z,bind:function(n){return un(e)},exists:u,forall:a,toOption:on.none}},an={value:rn,error:un,fromOption:function(n,t){return n.fold(function(){return un(t)},rn)}},cn=p("string"),sn=p("object"),fn=p("array"),ln=p("boolean"),dn=p("function"),mn=p("number"),gn=Array.prototype.slice,pn=Array.prototype.indexOf,hn=Array.prototype.push,vn=function(n,t){return-1<y(n,t)},bn=function(n,t){for(var e=0,o=n.length;e<o;e++){t(n[e],e)}},yn=function(n){return 0===n.length?on.none():on.some(n[0])},xn=dn(Array.from)?Array.from:function(n){return gn.call(n)},wn=Object.keys,Sn=Object.hasOwnProperty,Cn=function(n,t){for(var e=wn(n),o=0,r=e.length;o<r;o++){var i=e[o];t(n[i],i)}},kn=function(n,o){var r={};return Cn(n,function(n,t){var e=o(n,t);r[e.k]=e.v}),r},On=function(n,e){var o=[];return Cn(n,function(n,t){o.push(e(n,t))}),o},Tn=function(n,t){return Sn.call(n,t)},En=function(u){if(!fn(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 bn(u,function(n,o){var t=wn(n);if(1!==t.length)throw new Error("one and only one name per case");var r=t[0],i=n[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(!fn(i))throw new Error("case arguments must be an array");a.push(r),e[r]=function(){var n=arguments.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+n);for(var e=new Array(n),t=0;t<e.length;t++)e[t]=arguments[t];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(n){var t=wn(n);if(a.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+t.join(","));if(!B(a,function(n){return vn(t,n)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+a.join(", "));return n[r].apply(null,e)},log:function(n){v.console.log(n,{constructors:a,constructor:r,params:e})}}}}),e},Dn=Object.prototype.hasOwnProperty,Bn=z(function(n,t){return sn(n)&&sn(t)?Bn(n,t):t}),An=z(function(n,t){return t}),_n=En([{strict:[]},{defaultedThunk:["fallbackThunk"]},{asOption:[]},{asDefaultedOptionThunk:["fallbackThunk"]},{mergeWithThunk:["baseThunk"]}]),Mn=_n.strict,Fn=_n.asOption,In=_n.defaultedThunk,Rn=_n.mergeWithThunk,Vn=(En([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]),function(n){return U(n)}),Nn=function(n,t){return W(n,t)};(tn=Q=Q||{})[tn.Error=0]="Error",tn[tn.Value=1]="Value";function Hn(n,t,e){return n.stype===Q.Error?t(n.serror):e(n.svalue)}function Pn(n){return{stype:Q.Value,svalue:n}}function zn(n){return{stype:Q.Error,serror:n}}function Ln(n){return i(ee,H)(n)}function jn(n){return sn(n)&&100<wn(n).length?" removed due to size":JSON.stringify(n,null,2)}function Un(n,t){return ee([{path:n,getErrorInfo:t}])}function Wn(n,t,e){return W(t,e).fold(function(){return function(n,t,e){return Un(n,function(){return'Could not find valid *strict* value for "'+t+'" in '+jn(e)})}(n,e,t)},ne)}function Gn(n,t,e){var o=W(n,t).fold(function(){return e(n)},l);return ne(o)}function Xn(u,a,n,c){return n.fold(function(o,e,n,r){function i(n){var t=r.extract(u.concat([o]),c,n);return ie(t,function(n){return G(e,c(n))})}function t(n){return n.fold(function(){var n=G(e,c(on.none()));return ne(n)},function(n){var t=r.extract(u.concat([o]),c,n);return ie(t,function(n){return G(e,c(on.some(n)))})})}return n.fold(function(){return oe(Wn(u,a,o),i)},function(n){return oe(Gn(a,o,n),i)},function(){return oe(function(n,t){return ne(W(n,t))}(a,o),t)},function(n){return oe(function(t,n,e){var o=W(t,n).map(function(n){return!0===n?e(t):n});return ne(o)}(a,o,n),t)},function(n){var t=n(a),e=ie(Gn(a,o,nn({})),function(n){return Bn(t,n)});return oe(e,i)})},function(n,t){var e=t(a);return ne(G(n,c(e)))})}function Yn(o){return{extract:function(t,n,e){return re(o(e,n),function(n){return function(n,t){return Un(n,function(){return t})}(t,n)})},toString:function(){return"val"},toDsl:function(){return se.itemOf(o)}}}function qn(n){var i=de(n),u=k(n,function(t,n){return n.fold(function(n){return Bn(t,q(n,!0))},nn(t))},{});return{extract:function(n,t,e){var o=ln(e)?[]:function(t){var n=wn(t);return C(n,function(n){return $(t,n)})}(e),r=C(o,function(n){return!$(u,n)});return 0===r.length?i.extract(n,t,e):function(n,t){return Un(n,function(){return"There are unsupported fields: ["+t.join(", ")+"] specified"})}(n,r)},toString:i.toString,toDsl:i.toDsl}}function Kn(r){return{extract:function(e,o,n){var t=S(n,function(n,t){return r.extract(e.concat(["["+t+"]"]),o,n)});return ce(t)},toString:function(){return"array("+r.toString()+")"},toDsl:function(){return se.arrOf(r)}}}function Jn(i,u){return{extract:function(e,o,r){var n=wn(r),t=function(n,t){return Kn(Yn(i)).extract(n,l,t)}(e,n);return oe(t,function(n){var t=S(n,function(n){return le.field(n,n,Mn(),u)});return de(t).extract(e,o,r)})},toString:function(){return"setOf("+u.toString()+")"},toDsl:function(){return se.setOf(i,u)}}}function $n(t,e,o,n,r){return Nn(n,r).fold(function(){return function(n,t,e){return Un(n,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+jn(t)})}(t,n,r)},function(n){return n.extract(t.concat(["branch: "+r]),e,o)})}function Qn(n,r){return{extract:function(t,e,o){return Nn(o,n).fold(function(){return function(n,t){return Un(n,function(){return'Choice schema did not contain choice key: "'+t+'"'})}(t,n)},function(n){return $n(t,e,o,r,n)})},toString:function(){return"chooseOn("+n+"). Possible values: "+wn(r)},toDsl:function(){return se.choiceOf(n,r)}}}function Zn(t){return Yn(function(n){return t(n).fold(ee,ne)})}function nt(t,n){return Jn(function(n){return Qt(t(n))},n)}function tt(n,t,e){return Zt(function(n,t,e,o){var r=t.extract([n],e,o);return ue(r,function(n){return{input:o,errors:n}})}(n,t,l,e))}function et(n){return n.fold(function(n){throw new Error(ye(n))},l)}function ot(n,t,e){return et(tt(n,t,e))}function rt(n,t){return Qn(n,t)}function it(n,t){return Qn(n,P(t,de))}function ut(e,o){return Yn(function(n){var t=typeof n;return e(n)?ne(n):ee("Expected type: "+o+" but got: "+t)})}function at(t){return Zn(function(n){return vn(t,n)?an.value(n):an.error('Unsupported value: "'+n+'", choose one of "'+t.join(", ")+'".')})}function ct(n){return he(n,n,Mn(),me())}function st(n,t){return he(n,n,Mn(),t)}function ft(n){return st(n,Se)}function lt(n,t){return he(n,n,Mn(),at(t))}function dt(n){return st(n,ke)}function mt(n,t){return he(n,n,Mn(),de(t))}function gt(n,t){return he(n,n,Mn(),ge(t))}function pt(n,t){return he(n,n,Mn(),Kn(t))}function ht(n){return he(n,n,Fn(),me())}function vt(n,t){return he(n,n,Fn(),t)}function bt(n){return vt(n,we)}function yt(n){return vt(n,Se)}function xt(n){return vt(n,ke)}function wt(n,t){return vt(n,de(t))}function St(n,t){return he(n,n,j(t),me())}function Ct(n,t,e){return he(n,n,j(t),e)}function kt(n,t){return Ct(n,t,we)}function Ot(n,t){return Ct(n,t,Se)}function Tt(n,t,e){return Ct(n,t,at(e))}function Et(n,t){return Ct(n,t,Ce)}function Dt(n,t){return Ct(n,t,ke)}function Bt(n,t,e){return Ct(n,t,de(e))}function At(n,t){return pe(n,t)}function _t(n,t,e){return 0!=(n.compareDocumentPosition(t)&e)}function Mt(n,t){var e=function(n,t){for(var e=0;e<n.length;e++){var o=n[e];if(o.test(t))return o}return undefined}(n,t);if(!e)return{major:0,minor:0};function o(n){return Number(t.replace(e,"$"+n))}return Me(o(1),o(2))}function Ft(n,t){return function(){return t===n}}function It(n,t){return function(){return t===n}}function Rt(n,t){var e=String(t).toLowerCase();return T(n,function(n){return n.search(e)})}function Vt(n,t){return-1!==n.indexOf(t)}function Nt(t){return function(n){return Vt(n,t)}}function Ht(){return Ke.get()}function Pt(n,t){var e=n.dom();if(e.nodeType!==Ze)return!1;var o=e;if(o.matches!==undefined)return o.matches(t);if(o.msMatchesSelector!==undefined)return o.msMatchesSelector(t);if(o.webkitMatchesSelector!==undefined)return o.webkitMatchesSelector(t);if(o.mozMatchesSelector!==undefined)return o.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")}function zt(n){return n.nodeType!==Ze&&n.nodeType!==no||0===n.childElementCount}function Lt(n,t){var e=t===undefined?v.document:t.dom();return zt(e)?[]:S(e.querySelectorAll(n),Be.fromDom)}function jt(n,t){return n.dom()===t.dom()}function Ut(n,t){return jt(n.element(),t.event().target())}function Wt(n){if(!$(n,"can")&&!$(n,"abort")&&!$(n,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(n,null,2)+" does not have can, abort, or run!");return ot("Extracting event.handler",qn([St("can",nn(!0)),St("abort",nn(!1)),St("run",Z)]),n)}function Gt(e){var n=function(t,o){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return O(t,function(n,t){return n&&o(t).apply(undefined,e)},!0)}}(e,function(n){return n.can}),t=function(t,o){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return O(t,function(n,t){return n||o(t).apply(undefined,e)},!1)}}(e,function(n){return n.abort});return Wt({can:n,abort:t,run:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];bn(e,function(n){n.run.apply(undefined,t)})}})}function Xt(){return Ht().deviceType.isTouch()?wo.tap():bo()}function Yt(n,t){Yo(n,n.element(),t,{})}function qt(n,t,e){Yo(n,n.element(),t,e)}function Kt(n){Yt(n,To())}function Jt(n,t,e){Yo(n,t,e,{})}function $t(n,t,e,o){n.getSystem().triggerEvent(e,t,o.event())}var Qt=function(n){return n.fold(zn,Pn)},Zt=function(n){return Hn(n,an.error,an.value)},ne=Pn,te=function(n){var t=[],e=[];return bn(n,function(n){Hn(n,function(n){return e.push(n)},function(n){return t.push(n)})}),{values:t,errors:e}},ee=zn,oe=function(n,t){return n.stype===Q.Value?t(n.svalue):n},re=function(n,t){return n.stype===Q.Error?t(n.serror):n},ie=function(n,t){return n.stype===Q.Value?{stype:Q.Value,svalue:t(n.svalue)}:n},ue=function(n,t){return n.stype===Q.Error?{stype:Q.Error,serror:t(n.serror)}:n},ae=function(n,t){var e=te(n);return 0<e.errors.length?Ln(e.errors):function(n,t){return 0<n.length?ne(Bn(t,An.apply(undefined,n))):ne(t)}(e.values,t)},ce=function(n){var t=te(n);return 0<t.errors.length?Ln(t.errors):ne(t.values)},se=En([{setOf:["validator","valueType"]},{arrOf:["valueType"]},{objOf:["fields"]},{itemOf:["validator"]},{choiceOf:["key","branches"]},{thunk:["description"]},{func:["args","outputSchema"]}]),fe=En([{field:["name","presence","type"]},{state:["name"]}]),le=En([{field:["key","okey","presence","prop"]},{state:["okey","instantiator"]}]),de=function(o){return{extract:function(n,t,e){return function(t,e,n,o){var r=S(n,function(n){return Xn(t,e,n,o)});return ae(r,{})}(n,e,o,t)},toString:function(){return"obj{\n"+S(o,function(n){return n.fold(function(n,t,e,o){return n+" -> "+o.toString()},function(n,t){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return se.objOf(S(o,function(n){return n.fold(function(n,t,e,o){return fe.field(n,e,o)},function(n,t){return fe.state(n)})}))}}},me=nn(Yn(ne)),ge=i(Kn,de),pe=le.state,he=le.field,ve=Yn(ne),be=function(o){return{extract:function(n,t,e){return o().extract(n,t,e)},toString:function(){return o().toString()},toDsl:function(){return o().toDsl()}}},ye=function(n){return"Errors: \n"+function(n){var t=10<n.length?n.slice(0,10).concat([{path:[],getErrorInfo:function(){return"... (only showing first ten failures)"}}]):n;return S(t,function(n){return"Failed path: ("+n.path.join(" > ")+")\n"+n.getErrorInfo()})}(n.errors)+"\n\nInput object: "+jn(n.input)},xe=nn(ve),we=ut(mn,"number"),Se=ut(cn,"string"),Ce=ut(ln,"boolean"),ke=ut(dn,"function"),Oe=function(t){function n(n,t){for(var e=n.next();!e.done;){if(!t(e.value))return!1;e=n.next()}return!0}if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every(function(n){return Oe(t[n])});case"Map":return n(t.keys(),Oe)&&n(t.values(),Oe);case"Set":return n(t.keys(),Oe);default:return!1}},Te=Yn(function(n){return Oe(n)?ne(n):ee("Expected value to be acceptable for sending via postMessage")}),Ee=function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return Ee(t())}}},De=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:nn(n)}},Be={fromHtml:function(n,t){var e=(t||v.document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw v.console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return De(e.childNodes[0])},fromTag:function(n,t){var e=(t||v.document).createElement(n);return De(e)},fromText:function(n,t){var e=(t||v.document).createTextNode(n);return De(e)},fromDom:De,fromPoint:function(n,t,e){var o=n.dom();return on.from(o.elementFromPoint(t,e)).map(De)}},Ae=function(n,t){return _t(n,t,v.Node.DOCUMENT_POSITION_CONTAINED_BY)},_e=function(){return Me(0,0)},Me=function(n,t){return{major:n,minor:t}},Fe={nu:Me,detect:function(n,t){var e=String(t).toLowerCase();return 0===n.length?_e():Mt(n,e)},unknown:_e},Ie="Firefox",Re=function(n){var t=n.current;return{current:t,version:n.version,isEdge:Ft("Edge",t),isChrome:Ft("Chrome",t),isIE:Ft("IE",t),isOpera:Ft("Opera",t),isFirefox:Ft(Ie,t),isSafari:Ft("Safari",t)}},Ve={unknown:function(){return Re({current:undefined,version:Fe.unknown()})},nu:Re,edge:nn("Edge"),chrome:nn("Chrome"),ie:nn("IE"),opera:nn("Opera"),firefox:nn(Ie),safari:nn("Safari")},Ne="Windows",He="Android",Pe="Solaris",ze="FreeBSD",Le=function(n){var t=n.current;return{current:t,version:n.version,isWindows:It(Ne,t),isiOS:It("iOS",t),isAndroid:It(He,t),isOSX:It("OSX",t),isLinux:It("Linux",t),isSolaris:It(Pe,t),isFreeBSD:It(ze,t)}},je={unknown:function(){return Le({current:undefined,version:Fe.unknown()})},nu:Le,windows:nn(Ne),ios:nn("iOS"),android:nn(He),linux:nn("Linux"),osx:nn("OSX"),solaris:nn(Pe),freebsd:nn(ze)},Ue=function(n,e){return Rt(n,e).map(function(n){var t=Fe.detect(n.versionRegexes,e);return{current:n.name,version:t}})},We=function(n,e){return Rt(n,e).map(function(n){var t=Fe.detect(n.versionRegexes,e);return{current:n.name,version:t}})},Ge=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Xe=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(n){return Vt(n,"edge/")&&Vt(n,"chrome")&&Vt(n,"safari")&&Vt(n,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ge],search:function(n){return Vt(n,"chrome")&&!Vt(n,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(n){return Vt(n,"msie")||Vt(n,"trident")}},{name:"Opera",versionRegexes:[Ge,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Nt("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Nt("firefox")},{name:"Safari",versionRegexes:[Ge,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(n){return(Vt(n,"safari")||Vt(n,"mobile/"))&&Vt(n,"applewebkit")}}],Ye=[{name:"Windows",search:Nt("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(n){return Vt(n,"iphone")||Vt(n,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Nt("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Nt("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Nt("linux"),versionRegexes:[]},{name:"Solaris",search:Nt("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Nt("freebsd"),versionRegexes:[]}],qe={browsers:nn(Xe),oses:nn(Ye)},Ke=Ee(function(n,t){var e=qe.browsers(),o=qe.oses(),r=Ue(e,n).fold(Ve.unknown,Ve.nu),i=We(o,n).fold(je.unknown,je.nu);return{browser:r,os:i,deviceType:function(n,t,e,o){var r=n.isiOS()&&!0===/ipad/i.test(e),i=n.isiOS()&&!r,u=n.isiOS()||n.isAndroid(),a=u||o("(pointer:coarse)"),c=r||!i&&u&&o("(min-device-width:768px)"),s=i||u&&!c,f=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(e),l=!s&&!c&&!f;return{isiPad:nn(r),isiPhone:nn(i),isTablet:nn(c),isPhone:nn(s),isTouch:nn(a),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:nn(f),isDesktop:nn(l)}}(i,r,n,t)}}(v.navigator.userAgent,function(n){return v.window.matchMedia(n).matches})),Je=(v.Node.ATTRIBUTE_NODE,v.Node.CDATA_SECTION_NODE,v.Node.COMMENT_NODE,v.Node.DOCUMENT_NODE),$e=(v.Node.DOCUMENT_TYPE_NODE,v.Node.DOCUMENT_FRAGMENT_NODE,v.Node.ELEMENT_NODE),Qe=v.Node.TEXT_NODE,Ze=(v.Node.PROCESSING_INSTRUCTION_NODE,v.Node.ENTITY_REFERENCE_NODE,v.Node.ENTITY_NODE,v.Node.NOTATION_NODE,$e),no=Je,to=Ht().browser.isIE()?function(n,t){return Ae(n.dom(),t.dom())}:function(n,t){var e=n.dom(),o=t.dom();return e!==o&&e.contains(o)},eo=nn("touchstart"),oo=nn("touchmove"),ro=nn("touchend"),io=nn("touchcancel"),uo=nn("mousedown"),ao=nn("mousemove"),co=nn("mouseout"),so=nn("mouseup"),fo=nn("mouseover"),lo=nn("focusin"),mo=nn("focusout"),go=nn("keydown"),po=nn("keyup"),ho=nn("input"),vo=nn("change"),bo=nn("click"),yo=nn("transitionend"),xo=nn("selectstart"),wo={tap:nn("alloy.tap")},So=nn("alloy.focus"),Co=nn("alloy.blur.post"),ko=nn("alloy.paste.post"),Oo=nn("alloy.receive"),To=nn("alloy.execute"),Eo=nn("alloy.focus.item"),Do=wo.tap,Bo=nn("alloy.longpress"),Ao=nn("alloy.sandbox.close"),_o=nn("alloy.typeahead.cancel"),Mo=nn("alloy.system.init"),Fo=nn("alloy.system.touchmove"),Io=nn("alloy.system.touchend"),Ro=nn("alloy.system.scroll"),Vo=nn("alloy.system.resize"),No=nn("alloy.system.attached"),Ho=nn("alloy.system.detached"),Po=nn("alloy.system.dismissRequested"),zo=nn("alloy.system.repositionRequested"),Lo=nn("alloy.focusmanager.shifted"),jo=nn("alloy.slotcontainer.visibility"),Uo=nn("alloy.change.tab"),Wo=nn("alloy.dismiss.tab"),Go=nn("alloy.highlight"),Xo=nn("alloy.dehighlight"),Yo=function(n,t,e,o){var r=N({target:t},o);n.getSystem().triggerEvent(e,t,P(r,nn))};function qo(n,t,e,o,r){return n(e,o)?on.some(e):dn(r)&&r(e)?on.none():t(e,o,r)}function Ko(n){return n.dom().nodeName.toLowerCase()}function Jo(t){return function(n){return function(n){return n.dom().nodeType}(n)===t}}"undefined"!=typeof v.window?v.window:Function("return this;")();function $o(n){var t=_i(n)?n.dom().parentNode:n.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}function Qo(n,t,e){for(var o=n.dom(),r=dn(e)?e:nn(!1);o.parentNode;){o=o.parentNode;var i=Be.fromDom(o);if(t(i))return on.some(i);if(r(i))break}return on.none()}function Zo(n,t,e){return qo(function(n,t){return t(n)},Qo,n,t,e)}function nr(n,r){var i=function(n){for(var t=0;t<n.childNodes.length;t++){var e=Be.fromDom(n.childNodes[t]);if(r(e))return on.some(e);var o=i(n.childNodes[t]);if(o.isSome())return o}return on.none()};return i(n.dom())}function tr(n){return K(n)}function er(n,t){return{key:n,value:Wt({abort:t})}}function or(n){return{key:n,value:Wt({run:function(n,t){t.event().prevent()}})}}function rr(n,t){return{key:n,value:Wt({run:t})}}function ir(n,t,e){return{key:n,value:Wt({run:function(n){t.apply(undefined,[n].concat(e))}})}}function ur(n){return function(e){return{key:n,value:Wt({run:function(n,t){Ut(n,t)&&e(n,t)}})}}}function ar(n,t,e){return function(e,o){return rr(e,function(n,t){n.getSystem().getByUid(o).each(function(n){$t(n,n.element(),e,t)})})}(n,t.partUids[e])}function cr(n,r){return rr(n,function(t,n){var e=n.event(),o=t.getSystem().getByDom(e.target()).fold(function(){return Ii(e.target(),function(n){return t.getSystem().getByDom(n).toOption()},nn(!1)).getOr(t)},function(n){return n});r(t,o,n)})}function sr(n){return rr(n,function(n,t){t.cut()})}function fr(n,t){return ur(n)(t)}function lr(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(t.length!==e.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+e.length+" arguments");var o={};return bn(t,function(n,t){o[n]=nn(e[t])}),o}}function dr(n){return n.slice(0).sort()}function mr(t,n){if(!fn(n))throw new Error("The "+t+" fields must be an array. Was: "+n+".");bn(n,function(n){if(!cn(n))throw new Error("The value "+n+" in the "+t+" fields was not a string.")})}function gr(r,i){var u=r.concat(i);if(0===u.length)throw new Error("You must specify at least one required or optional field.");return mr("required",r),mr("optional",i),function(n){var e=dr(n);T(e,function(n,t){return t<e.length-1&&n===e[t+1]}).each(function(n){throw new Error("The field: "+n+" occurs more than once in the combined fields: ["+e.join(", ")+"].")})}(u),function(t){var e=wn(t);B(r,function(n){return vn(e,n)})||function(n,t){throw new Error("All required keys ("+dr(n).join(", ")+") were not specified. Specified keys were: "+dr(t).join(", ")+".")}(r,e);var n=C(e,function(n){return!vn(u,n)});0<n.length&&function(n){throw new Error("Unsupported keys for object: "+dr(n).join(", "))}(n);var o={};return bn(r,function(n){o[n]=nn(t[n])}),bn(i,function(n){o[n]=nn(Object.prototype.hasOwnProperty.call(t,n)?on.some(t[n]):on.none())}),o}}function pr(n){return Be.fromDom(n.dom().ownerDocument)}function hr(n){return Be.fromDom(n.dom().ownerDocument.documentElement)}function vr(n){return Be.fromDom(n.dom().ownerDocument.defaultView)}function br(n){return on.from(n.dom().parentNode).map(Be.fromDom)}function yr(n){return on.from(n.dom().offsetParent).map(Be.fromDom)}function xr(n){return S(n.dom().childNodes,Be.fromDom)}function wr(n,t){var e=n.dom().childNodes;return on.from(e[t]).map(Be.fromDom)}function Sr(t,e){br(t).each(function(n){n.dom().insertBefore(e.dom(),t.dom())})}function Cr(n,t){(function(n){return on.from(n.dom().nextSibling).map(Be.fromDom)})(n).fold(function(){br(n).each(function(n){Pi(n,t)})},function(n){Sr(n,t)})}function kr(t,e){(function(n){return wr(n,0)})(t).fold(function(){Pi(t,e)},function(n){t.dom().insertBefore(e.dom(),n.dom())})}function Or(t,n){bn(n,function(n){Pi(t,n)})}function Tr(n){n.dom().textContent="",bn(xr(n),function(n){zi(n)})}function Er(n){var t=xr(n);0<t.length&&function(t,n){bn(n,function(n){Sr(t,n)})}(n,t),zi(n)}function Dr(n){return n.dom().innerHTML}function Br(n,t){var e=pr(n).dom(),o=Be.fromDom(e.createDocumentFragment()),r=function(n,t){var e=(t||v.document).createElement("div");return e.innerHTML=n,xr(Be.fromDom(e))}(t,e);Or(o,r),Tr(n),Pi(n,o)}function Ar(n,t,e){if(!(cn(e)||ln(e)||mn(e)))throw v.console.error("Invalid call to Attr.set. Key ",t,":: Value ",e,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(t,e+"")}function _r(n,t,e){Ar(n.dom(),t,e)}function Mr(n,t){var e=n.dom().getAttribute(t);return null===e?undefined:e}function Fr(n,t){var e=n.dom();return!(!e||!e.hasAttribute)&&e.hasAttribute(t)}function Ir(n,t){n.dom().removeAttribute(t)}function Rr(n){return function(n,t){return Be.fromDom(n.dom().cloneNode(t))}(n,!1)}function Vr(n){return function(n){var t=Be.fromTag("div"),e=Be.fromDom(n.dom().cloneNode(!0));return Pi(t,e),Dr(t)}(Rr(n))}function Nr(n){return Vr(n)}function Hr(n){var t=(new Date).getTime();return n+"_"+Math.floor(1e9*Math.random())+ ++Ui+String(t)}function Pr(n){return Hr(n)}function zr(t){function n(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+Nr(t().element())+" is not in context.")}}return{debugInfo:nn("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),isConnected:nn(!1)}}function Lr(n,t){var e=n.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:t,parameters:Qi(i)}},n}function jr(n){return q(Zi,n)}function Ur(o){return function(n,t){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Qi(i.slice(1))}},n}(function(n){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return o.apply(undefined,[n.getApis()].concat([n].concat(t)))},o)}function Wr(n,r){var i={};return Cn(n,function(n,o){Cn(n,function(n,t){var e=Y(t,[])(i);i[t]=e.concat([r(o,n)])})}),i}function Gr(n){return{classes:n.classes!==undefined?n.classes:[],attributes:n.attributes!==undefined?n.attributes:{},styles:n.styles!==undefined?n.styles:{}}}function Xr(n){return n.cHandler}function Yr(n,t){return{name:nn(n),handler:nn(t)}}function qr(n,t,e){var o=N(N({},e),function(n,t){var e={};return bn(n,function(n){e[n.name()]=n.handlers(t)}),e}(t,n));return Wr(o,Yr)}function Kr(n){var i=function(n){return dn(n)?{can:nn(!0),abort:nn(!1),run:n}:n}(n);return function(n,t){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var r=[n,t].concat(e);i.abort.apply(undefined,r)?t.stop():i.can.apply(undefined,r)&&i.run.apply(undefined,r)}}function Jr(n,t,e){var o=t[e];return o?function(u,a,n,c){var t=n.slice(0);try{var e=t.sort(function(n,t){var e=n[a](),o=t[a](),r=c.indexOf(e),i=c.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+e+".\nOrder specified: "+JSON.stringify(c,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(c,null,2));return r<i?-1:i<r?1:0});return an.value(e)}catch(o){return an.error([o])}}("Event: "+e,"name",n,o).map(function(n){var t=S(n,function(n){return n.handler()});return Gt(t)}):function(n,t){return an.error(["The event ("+n+') has more than one behaviour that listens to it.\nWhen this occurs, you must specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that can trigger it are: '+JSON.stringify(S(t,function(n){return n.name()}),null,2)])}(e,n)}function $r(n){return tt("custom.definition",de([he("dom","dom",Mn(),de([ct("tag"),St("styles",{}),St("classes",[]),St("attributes",{}),ht("value"),ht("innerHtml")])),ct("components"),ct("uid"),St("events",{}),St("apis",{}),he("eventOrder","eventOrder",function(n){return _n.mergeWithThunk(nn(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"],touchstart:["focusing","alloy.base.behaviour","item-type-events"],mouseover:["item-type-events","tooltipping"]}),xe()),ht("domModification")]),n)}function Qr(n,t){var e=Mr(n,t);return e===undefined||""===e?[]:e.split(" ")}function Zr(n){return n.dom().classList!==undefined}function ni(n,t){return function(n,t,e){var o=Qr(n,t).concat([e]);return _r(n,t,o.join(" ")),!0}(n,"class",t)}function ti(n,t){return function(n,t,e){var o=C(Qr(n,t),function(n){return n!==e});return 0<o.length?_r(n,t,o.join(" ")):Ir(n,t),!1}(n,"class",t)}function ei(n,t){Zr(n)?n.dom().classList.add(t):ni(n,t)}function oi(n){0===(Zr(n)?n.dom().classList:function(n){return Qr(n,"class")}(n)).length&&Ir(n,"class")}function ri(n,t){Zr(n)?n.dom().classList.remove(t):ti(n,t),oi(n)}function ii(n,t){return Zr(n)&&n.dom().classList.contains(t)}function ui(t,n){bn(n,function(n){ei(t,n)})}function ai(t,n){bn(n,function(n){ri(t,n)})}function ci(n){return n.style!==undefined&&dn(n.style.getPropertyValue)}function si(n,t,e){if(!cn(e))throw v.console.error("Invalid call to CSS.set. Property ",t,":: Value ",e,":: Element ",n),new Error("CSS value must be a string: "+e);ci(n)&&n.style.setProperty(t,e)}function fi(n,t){ci(n)&&n.style.removeProperty(t)}function li(n,t,e){var o=n.dom();si(o,t,e)}function di(n,t){var e=n.dom();Cn(t,function(n,t){si(e,t,n)})}function mi(n,t){var e=n.dom(),o=v.window.getComputedStyle(e).getPropertyValue(t),r=""!==o||$o(n)?o:ru(e,t);return null===r?undefined:r}function gi(n,t){var e=n.dom(),o=ru(e,t);return on.from(o).filter(function(n){return 0<n.length})}function pi(n,t,e){var o=Be.fromTag(n);return li(o,t,e),gi(o,t).isSome()}function hi(n,t){var e=n.dom();fi(e,t),Fr(n,"style")&&""===function(n){return n.replace(/^\s+|\s+$/g,"")}(Mr(n,"style"))&&Ir(n,"style")}function vi(n){return n.dom().offsetWidth}function bi(n){return n.dom().value}function yi(n,t){if(t===undefined)throw new Error("Value.set was undefined");n.dom().value=t}function xi(n){var t=Be.fromTag(n.tag);!function(n,t){var e=n.dom();Cn(t,function(n,t){Ar(e,t,n)})}(t,n.attributes),ui(t,n.classes),di(t,n.styles),n.innerHtml.each(function(n){return Br(t,n)});var e=n.domChildren;return Or(t,e),n.value.each(function(n){yi(t,n)}),n.uid,qi(t,n.uid),t}function wi(n,t){return function(t,n){var e=S(n,function(n){return wt(n.name(),[ct("config"),St("state",nu)])}),o=tt("component.behaviours",de(e),t.behaviours).fold(function(n){throw new Error(ye(n)+"\nComplete spec:\n"+JSON.stringify(t,null,2))},function(n){return n});return{list:n,data:P(o,function(n){var t=n.map(function(n){return{config:n.config,state:n.state.init(n.config)}});return function(){return t}})}}(n,t)}function Si(n){var t=function(n){var t=Y("behaviours",{})(n),e=C(wn(t),function(n){return t[n]!==undefined});return S(e,function(n){return t[n].me})}(n);return wi(n,t)}function Ci(n,t,e){var o=function(n){return N(N({},n.dom),{uid:n.uid,domChildren:S(n.components,function(n){return n.element()})})}(n),r=function(n){return n.domModification.fold(function(){return Gr({})},Gr)}(n),i={"alloy.base.modification":r};return function(n,t){return N(N({},n),{attributes:N(N({},n.attributes),t.attributes),styles:N(N({},n.styles),t.styles),classes:n.classes.concat(t.classes)})}(o,0<t.length?function(t,n,e,o){var r=N({},n);bn(e,function(n){r[n.name()]=n.exhibit(t,o)});function i(n){return k(n,function(n,t){return N(N({},t.modification),n)},{})}var u=Wr(r,function(n,t){return{name:n,modification:t}}),a=k(u.classes,function(n,t){return t.modification.concat(n)},[]),c=i(u.attributes),s=i(u.styles);return Gr({classes:a,attributes:c,styles:s})}(e,i,t,o):r)}function ki(n,t,e){var o={"alloy.base.behaviour":function(n){return n.events}(n)};return function(n,t,e,o){var r=qr(n,e,o);return ou(r,t)}(e,n.eventOrder,t,o).getOrDie()}function Oi(n){var t=Ji(n),e=t.events,o=c(t,["events"]),r=function(n){var t=Y("components",[])(n);return S(t,au)}(o),i=N(N({},o),{events:N(N({},ji),e),components:r});return an.value(function(e){function n(){return l}var o=Ee($i),t=et($r(e)),r=Si(e),i=function(n){return n.list}(r),u=function(n){return n.data}(r),a=Ci(t,i,u),c=xi(a),s=ki(t,i,u),f=Ee(t.components),l={getSystem:o.get,config:function(n){var t=u;return(dn(t[n.name()])?t[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:function(n){return dn(u[n.name()])},spec:nn(e),readState:function(n){return u[n]().map(function(n){return n.state.readState()}).getOr("not enabled")},getApis:function(){return t.apis},connect:function(n){o.set(n)},disconnect:function(){o.set(zr(n))},element:nn(c),syncComponents:function(){var n=xr(c),t=D(n,function(n){return o.get().getByDom(n).fold(function(){return[]},function(n){return[n]})});f.set(t)},components:f.get,events:nn(s)};return l}(i))}function Ti(n){var t=Be.fromText(n);return iu({element:t})}var Ei,Di,Bi,Ai=Jo($e),_i=Jo(Qe),Mi=L(function(){return Fi(Be.fromDom(v.document))}),Fi=function(n){var t=n.dom().body;if(null===t||t===undefined)throw new Error("Body is not available yet");return Be.fromDom(t)},Ii=function(n,t,e){return Zo(n,function(n){return t(n).isSome()},e).bind(t)},Ri=ur(No()),Vi=ur(Ho()),Ni=ur(Mo()),Hi=(Ei=To(),function(n){return rr(Ei,n)}),Pi=(lr("element","offset"),function(n,t){n.dom().appendChild(t.dom())}),zi=function(n){var t=n.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Li=tr([(Di=So(),Bi=function(n,t){var e=t.event().originator(),o=t.event().target();return!function(n,t,e){return jt(t,n.element())&&!jt(t,e)}(n,e,o)||(v.console.warn(So()+" did not get interpreted by the desired target. \nOriginator: "+Nr(e)+"\nTarget: "+Nr(o)+"\nCheck the "+So()+" event handlers"),!1)},{key:Di,value:Wt({can:Bi})})]),ji=/* */Object.freeze({events:Li}),Ui=0,Wi=nn("alloy-id-"),Gi=nn("data-alloy-id"),Xi=Wi(),Yi=Gi(),qi=function(n,t){Object.defineProperty(n.dom(),Yi,{value:t,writable:!0})},Ki=function(n){var t=Ai(n)?n.dom()[Yi]:null;return on.from(t)},Ji=l,$i=zr(),Qi=function(n){return S(n,function(n){return function(n,t){return function(n,t,e){return""===t||!(n.length<t.length)&&n.substr(e,e+t.length)===t}(n,t,n.length-t.length)}(n,"/*")?n.substring(0,n.length-"/*".length):n})},Zi=Hr("alloy-premade"),nu={init:function(){return tu({readState:function(){return"No State required"}})}},tu=function(n){return n},eu=function(n,t){return function(n,t){return{cHandler:n,purpose:nn(t)}}(d.apply(undefined,[n.handler].concat(t)),n.purpose())},ou=function(n,i){var t=On(n,function(o,r){return(1===o.length?an.value(o[0].handler()):Jr(o,i,r)).map(function(n){var t=Kr(n),e=1<o.length?C(i[r],function(t){return x(o,function(n){return n.name()===t})}).join(" > "):o[0].name();return q(r,function(n,t){return{handler:n,purpose:nn(t)}}(t,e))})});return J(t,{})},ru=function(n,t){return ci(n)?n.style.getPropertyValue(t):""},iu=function(n){var t=ot("external.component",qn([ct("element"),ht("uid")]),n),e=Ee(zr());t.uid.each(function(n){qi(t.element,n)});var o={getSystem:e.get,config:on.none,hasConfigured:nn(!1),connect:function(n){e.set(n)},disconnect:function(){e.set(zr(function(){return o}))},getApis:function(){return{}},element:nn(t.element),spec:nn(n),readState:nn("No state"),syncComponents:Z,components:nn([]),events:nn({})};return jr(o)},uu=Pr,au=function(t){return function(n){return Nn(n,Zi)}(t).fold(function(){var n=t.hasOwnProperty("uid")?t:N({uid:uu("")},t);return Oi(n).getOrDie()},function(n){return n})},cu=jr;function su(o,r){function n(n){var t=r(n);if(t<=0||null===t){var e=mi(n,o);return parseFloat(e)||0}return t}function i(r,n){return O(n,function(n,t){var e=mi(r,t),o=e===undefined?0:parseInt(e,10);return isNaN(o)?n:n+o},0)}return{set:function(n,t){if(!mn(t)&&!t.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+t);var e=n.dom();ci(e)&&(e.style[o]=t+"px")},get:n,getOuter:n,aggregate:i,max:function(n,t,e){var o=i(n,e);return o<t?t-o:0}}}function fu(n){return Fu.get(n)}function lu(n){return Fu.getOuter(n)}function du(n,t){return n!==undefined?n:t!==undefined?t:0}function mu(n){var t=n.dom().ownerDocument,e=t.body,o=t.defaultView,r=t.documentElement;if(e===n.dom())return Ru(e.offsetLeft,e.offsetTop);var i=du(o.pageYOffset,r.scrollTop),u=du(o.pageXOffset,r.scrollLeft),a=du(r.clientTop,e.clientTop),c=du(r.clientLeft,e.clientLeft);return Vu(n).translate(u-c,i-a)}function gu(n){return Nu.get(n)}function pu(n){return Nu.getOuter(n)}function hu(n){var t=n!==undefined?n.dom():v.document,e=t.body.scrollLeft||t.documentElement.scrollLeft,o=t.body.scrollTop||t.documentElement.scrollTop;return Ru(e,o)}function vu(n,t,e,o){return{x:nn(n),y:nn(t),width:nn(e),height:nn(o),right:nn(n+e),bottom:nn(t+o)}}function bu(n){var t=n===undefined?v.window:n,e=t.document,o=hu(Be.fromDom(e)),r=t.visualViewport;if(r!==undefined)return vu(Math.max(r.pageLeft,o.left()),Math.max(r.pageTop,o.top()),r.width,r.height);var i=e.documentElement,u=i.clientWidth,a=i.clientHeight;return vu(o.left(),o.top(),u,a)}function yu(o){var n=Be.fromDom(v.document),r=hu(n);return function(n,t){var e=t.owner(n),o=Hu(t,e);return on.some(o)}(o,Pu).fold(d(mu,o),function(n){var t=Vu(o),e=k(n,function(n,t){var e=Vu(t);return{left:n.left+e.left(),top:n.top+e.top()}},{left:0,top:0});return Ru(e.left+t.left()+r.left(),e.top+t.top()+r.top())})}function xu(n,t,e,o){return{x:nn(n),y:nn(t),width:nn(e),height:nn(o),right:nn(n+e),bottom:nn(t+o)}}function wu(n){var t=mu(n),e=pu(n),o=lu(n);return xu(t.left(),t.top(),e,o)}function Su(n){var t=yu(n),e=pu(n),o=lu(n);return xu(t.left(),t.top(),e,o)}function Cu(){return bu(v.window)}function ku(n,t,e){return Qo(n,function(n){return Pt(n,t)},e)}function Ou(n,t){return function(n,t){var e=t===undefined?v.document:t.dom();return zt(e)?on.none():on.from(e.querySelector(n)).map(Be.fromDom)}(t,n)}function Tu(n,t,e){return qo(Pt,ku,n,t,e)}function Eu(){var t=Hr("aria-owns");return{id:nn(t),link:function(n){_r(n,"aria-owns",t)},unlink:function(n){Ir(n,"aria-owns")}}}function Du(t,n){return function(n){return Zo(n,function(n){if(!Ai(n))return!1;var t=Mr(n,"id");return t!==undefined&&-1<t.indexOf("aria-owns")}).bind(function(n){var t=Mr(n,"id"),e=pr(n);return Ou(e,'[aria-owns="'+t+'"]')})}(n).exists(function(n){return ju(t,n)})}function Bu(n){for(var t=[],e=function(n){t.push(n)},o=0;o<n.length;o++)n[o].each(e);return t}function Au(n,t){for(var e=0;e<n.length;e++){var o=t(n[e],e);if(o.isSome())return o}return on.none()}var _u,Mu,Fu=su("height",function(n){var t=n.dom();return $o(n)?t.getBoundingClientRect().height:t.offsetHeight}),Iu=function(e,o){return{left:nn(e),top:nn(o),translate:function(n,t){return Iu(e+n,o+t)}}},Ru=Iu,Vu=function(n){var t=n.dom(),e=t.ownerDocument.body;return e===t?Ru(e.offsetLeft,e.offsetTop):$o(n)?function(n){var t=n.getBoundingClientRect();return Ru(t.left,t.top)}(t):Ru(0,0)},Nu=su("width",function(n){return n.dom().offsetWidth}),Hu=(Ht().browser.isSafari(),function(o,n){return o.view(n).fold(nn([]),function(n){var t=o.owner(n),e=Hu(o,t);return[n].concat(e)})}),Pu=/* */Object.freeze({view:function(n){return(n.dom()===v.document?on.none():on.from(n.dom().defaultView.frameElement)).map(Be.fromDom)},owner:function(n){return pr(n)}}),zu=lr("point","width","height"),Lu=lr("x","y","width","height"),ju=function(t,n){return function(n,t,e){return Zo(n,t,e).isSome()}(n,function(n){return jt(n,t.element())},nn(!1))||Du(t,n)},Uu="unknown";(Mu=_u=_u||{})[Mu.STOP=0]="STOP",Mu[Mu.NORMAL=1]="NORMAL",Mu[Mu.LOGGING=2]="LOGGING";function Wu(t,n,e){switch(Nn(za.get(),t).orThunk(function(){var n=wn(za.get());return Au(n,function(n){return-1<t.indexOf(n)?on.some(za.get()[n]):on.none()})}).getOr(_u.NORMAL)){case _u.NORMAL:return e(ja());case _u.LOGGING:var o=function(t,e){var o=[],r=(new Date).getTime();return{logEventCut:function(n,t,e){o.push({outcome:"cut",target:t,purpose:e})},logEventStopped:function(n,t,e){o.push({outcome:"stopped",target:t,purpose:e})},logNoParent:function(n,t,e){o.push({outcome:"no-parent",target:t,purpose:e})},logEventNoHandlers:function(n,t){o.push({outcome:"no-handlers-left",target:t})},logEventResponse:function(n,t,e){o.push({outcome:"response",purpose:e,target:t})},write:function(){var n=(new Date).getTime();vn(["mousemove","mouseover","mouseout",Mo()],t)||v.console.log(t,{event:t,time:n-r,target:e.dom(),sequence:S(o,function(n){return vn(["cut","stopped","response"],n.outcome)?"{"+n.purpose+"} "+n.outcome+" at ("+Nr(n.target)+")":n.outcome})})}}}(t,n),r=e(o);return o.write(),r;case _u.STOP:return!0}}function Gu(n,t,e){return Wu(n,t,e)}function Xu(){return mt("markers",[ct("backgroundMenu")].concat(Ua()).concat(Wa()))}function Yu(n){return mt("markers",S(n,ct))}function qu(n,t,e){return function(){var n=new Error;if(n.stack===undefined)return;var t=n.stack.split("\n");T(t,function(t){return 0<t.indexOf("alloy")&&!x(La,function(n){return-1<t.indexOf(n)})}).getOr(Uu)}(),he(t,t,e,Zn(function(e){return an.value(function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];return e.apply(undefined,n)})}))}function Ku(n){return qu(0,n,j(Z))}function Ju(n){return qu(0,n,j(on.none))}function $u(n){return qu(0,n,Mn())}function Qu(n){return qu(0,n,Mn())}function Zu(n,t){return At(n,nn(t))}function na(n){return At(n,l)}function ta(n){return n.x()}function ea(n,t){return n.x()+n.width()/2-t.width()/2}function oa(n,t){return n.x()+n.width()-t.width()}function ra(n,t){return n.y()-t.height()}function ia(n){return n.y()+n.height()}function ua(n,t){return n.y()+n.height()/2-t.height()/2}function aa(n,t,e){return qa(ta(n),ia(n),e.southeast(),Ja(),"layout-se")}function ca(n,t,e){return qa(oa(n,t),ia(n),e.southwest(),$a(),"layout-sw")}function sa(n,t,e){return qa(ta(n),ra(n,t),e.northeast(),Qa(),"layout-ne")}function fa(n,t,e){return qa(oa(n,t),ra(n,t),e.northwest(),Za(),"layout-nw")}function la(n,t,e){return qa(function(n){return n.x()+n.width()}(n),ua(n,t),e.east(),ec(),"layout-e")}function da(n,t,e){return qa(function(n,t){return n.x()-t.width()}(n,t),ua(n,t),e.west(),oc(),"layout-w")}function ma(){return[aa,ca,sa,fa,ic,rc]}function ga(){return[ca,aa,fa,sa,ic,rc]}function pa(e,o,r){return Ni(function(n,t){r(n,e,o)})}function ha(n,t,e,o,r,i){var u=qn(n),a=wt(t,[function(n,t){return vt(n,qn(t))}("config",n)]);return uc(u,a,t,e,o,r,i)}function va(r,i,u){return function(n,t,e){var o=e.toString(),r=o.indexOf(")")+1,i=o.indexOf("("),u=o.substring(i+1,r-1).split(/,\s*/);return n.toFunctionAnnotation=function(){return{name:t,parameters:Qi(u.slice(0,1).concat(u.slice(3)))}},n}(function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var o=[e].concat(n);return e.config({name:nn(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(n){var t=Array.prototype.slice.call(o,1);return i.apply(undefined,[e,n.config,n.state].concat(t))})},u,i)}function ba(n){return{key:n,value:undefined}}function ya(n){return K(n)}function xa(n){var t=ot("Creating behaviour: "+n.name,ac,n);return ha(t.fields,t.name,t.active,t.apis,t.extra,t.state)}function wa(n){var t=ot("Creating behaviour: "+n.name,cc,n);return function(n,t,e,o,r,i){var u=n,a=wt(t,[vt("config",n)]);return uc(u,a,t,e,o,r,i)}(it(t.branchKey,t.branches),t.name,t.active,t.apis,t.extra,t.state)}function Sa(n){n.dom().focus()}function Ca(n){var t=n!==undefined?n.dom():v.document;return on.from(t.activeElement).map(Be.fromDom)}function ka(t){return Ca(pr(t)).filter(function(n){return t.dom().contains(n.dom())})}function Oa(n,e){var o=pr(e),t=Ca(o).bind(function(t){function n(n){return jt(t,n)}return n(e)?on.some(e):nr(e,n)}),r=n(e);return t.each(function(t){Ca(o).filter(function(n){return jt(n,t)}).fold(function(){Sa(t)},Z)}),r}function Ta(n,t,e){function r(n){return Nn(e,n).getOr([])}function o(n,t,e){var o=_(gc,e);return{offset:function(){return Ru(n,t)},classesOn:function(){return D(e,r)},classesOff:function(){return D(o,r)}}}return{southeast:function(){return o(-n,t,["top","alignLeft"])},southwest:function(){return o(n,t,["top","alignRight"])},south:function(){return o(-n/2,t,["top","alignCentre"])},northeast:function(){return o(-n,-t,["bottom","alignLeft"])},northwest:function(){return o(n,-t,["bottom","alignRight"])},north:function(){return o(-n/2,-t,["bottom","alignCentre"])},east:function(){return o(n,-t/2,["valignCentre","left"])},west:function(){return o(-n,-t/2,["valignCentre","right"])},innerNorthwest:function(){return o(-n,t,["top","alignRight"])},innerNortheast:function(){return o(n,t,["top","alignLeft"])},innerNorth:function(){return o(-n/2,t,["top","alignCentre"])},innerSouthwest:function(){return o(-n,-t,["bottom","alignRight"])},innerSoutheast:function(){return o(n,-t,["bottom","alignLeft"])},innerSouth:function(){return o(-n/2,-t,["bottom","alignCentre"])},innerWest:function(){return o(n,-t/2,["valignCentre","right"])},innerEast:function(){return o(-n,-t/2,["valignCentre","left"])}}}function Ea(){return Ta(0,0,{})}function Da(n,t,e,o,r,i){var u=t.x()-e,a=t.y()-o,c=r-(u+t.width()),s=i-(a+t.height()),f=on.some(u),l=on.some(a),d=on.some(c),m=on.some(s),g=on.none();return function(n,t,e,o,r,i,u,a,c){return n.fold(t,e,o,r,i,u,a,c)}(t.direction(),function(){return hc(n,f,l,g,g)},function(){return hc(n,g,l,d,g)},function(){return hc(n,f,g,g,m)},function(){return hc(n,g,g,d,m)},function(){return hc(n,f,l,g,g)},function(){return hc(n,f,g,g,m)},function(){return hc(n,f,l,g,g)},function(){return hc(n,g,l,d,g)})}function Ba(n,t){var e=d(yu,t),o=n.fold(e,e,function(){var n=hu();return yu(t).translate(-n.left(),-n.top())}),r=pu(t),i=lu(t);return xu(o.left(),o.top(),r,i)}function Aa(n){return n}function _a(t,e){return function(n){return"rtl"===wc(n)?e:t}}function Ma(){return wt("layouts",[ct("onLtr"),ct("onRtl")])}function Fa(t,n,e,o){var r=n.layouts.map(function(n){return n.onLtr(t)}).getOr(e),i=n.layouts.map(function(n){return n.onRtl(t)}).getOr(o);return _a(r,i)(t)}function Ia(n,t,e){var o=n.document.createRange();return function(e,n){n.fold(function(n){e.setStartBefore(n.dom())},function(n,t){e.setStart(n.dom(),t)},function(n){e.setStartAfter(n.dom())})}(o,t),function(e,n){n.fold(function(n){e.setEndBefore(n.dom())},function(n,t){e.setEnd(n.dom(),t)},function(n){e.setEndAfter(n.dom())})}(o,e),o}function Ra(n,t,e,o,r){var i=n.document.createRange();return i.setStart(t.dom(),e),i.setEnd(o.dom(),r),i}function Va(n){return{left:nn(n.left),top:nn(n.top),right:nn(n.right),bottom:nn(n.bottom),width:nn(n.width),height:nn(n.height)}}function Na(n,t,e){return t(Be.fromDom(e.startContainer),e.startOffset,Be.fromDom(e.endContainer),e.endOffset)}function Ha(n,t){return function(n,t){var e=t.ltr();return e.collapsed?t.rtl().filter(function(n){return!1===n.collapsed}).map(function(n){return Bc.rtl(Be.fromDom(n.endContainer),n.endOffset,Be.fromDom(n.startContainer),n.startOffset)}).getOrThunk(function(){return Na(0,Bc.ltr,e)}):Na(0,Bc.ltr,e)}(0,function(r,n){return n.match({domRange:function(n){return{ltr:nn(n),rtl:on.none}},relative:function(n,t){return{ltr:L(function(){return Ia(r,n,t)}),rtl:L(function(){return on.some(Ia(r,t,n))})}},exact:function(n,t,e,o){return{ltr:L(function(){return Ra(r,n,t,e,o)}),rtl:L(function(){return on.some(Ra(r,e,o,n,t))})}}})}(n,t))}function Pa(n,t,e){return t>=n.left&&t<=n.right&&e>=n.top&&e<=n.bottom}var za=Ee({}),La=["alloy/data/Fields","alloy/debugging/Debugging"],ja=nn({logEventCut:Z,logEventStopped:Z,logNoParent:Z,logEventNoHandlers:Z,logEventResponse:Z,write:Z}),Ua=nn([ct("menu"),ct("selectedMenu")]),Wa=nn([ct("item"),ct("selectedItem")]),Ga=(nn(de(Wa().concat(Ua()))),nn(de(Wa()))),Xa=mt("initSize",[ct("numColumns"),ct("numRows")]),Ya=nn(Xa),qa=lr("x","y","bubble","direction","label"),Ka=En([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Ja=Ka.southeast,$a=Ka.southwest,Qa=Ka.northeast,Za=Ka.northwest,nc=Ka.south,tc=Ka.north,ec=Ka.east,oc=Ka.west,rc=function(n,t,e){return qa(ea(n,t),ra(n,t),e.north(),tc(),"layout-n")},ic=function(n,t,e){return qa(ea(n,t),ia(n),e.south(),nc(),"layout-s")},uc=function(e,n,o,r,t,i,u){function a(n){return $(n,o)?n[o]():on.none()}var c=P(t,function(n,t){return va(o,n,t)}),s=P(i,function(n,t){return Lr(n,t)}),f=N(N(N({},s),c),{revoke:d(ba,o),config:function(n){var t=ot(o+"-config",e,n);return{key:o,value:{config:t,me:f,configAsRaw:L(function(){return ot(o+"-config",e,n)}),initialConfig:n,state:u}}},schema:function(){return n},exhibit:function(n,e){return a(n).bind(function(t){return Nn(r,"exhibit").map(function(n){return n(e,t.config,t.state)})}).getOr(Gr({}))},name:function(){return o},handlers:function(n){return a(n).map(function(n){return Y("events",function(n,t){return{}})(r)(n.config,n.state)}).getOr({})}});return f},ac=qn([ct("fields"),ct("name"),St("active",{}),St("apis",{}),St("state",nu),St("extra",{})]),cc=qn([ct("branchKey"),ct("branches"),ct("name"),St("active",{}),St("apis",{}),St("state",nu),St("extra",{})]),sc=nn(undefined),fc=/* */Object.freeze({events:function(t){return tr([rr(Oo(),function(r,i){var u=t.channels,n=function(n,t){return t.universal()?n:C(n,function(n){return vn(t.channels(),n)})}(wn(u),i);bn(n,function(n){var t=u[n],e=t.schema,o=ot("channel["+n+"] data\nReceiver: "+Nr(r.element()),e,i.data());t.onReceive(r,o)})})])}}),lc=[st("channels",nt(an.value,qn([$u("onReceive"),St("schema",xe())])))],dc=xa({fields:lc,name:"receiving",active:fc}),mc=/* */Object.freeze({exhibit:function(n,t){return Gr({classes:[],styles:t.useFixed()?{}:{position:"relative"}})}}),gc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right"],pc=gr(["x","y","width","height","maxHeight","maxWidth","direction","classes","label","candidateYforTest"],[]),hc=lr("position","left","top","right","bottom"),vc=En([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),bc=function(n,t,e){var o=Ru(t,e);return n.fold(nn(o),nn(o),function(){var n=hu();return o.translate(-n.left(),-n.top())})},yc=vc.relative,xc=vc.fixed,wc=function(n){return"rtl"===mi(n,"direction")?"rtl":"ltr"},Sc=[ct("hotspot"),ht("bubble"),St("overrides",{}),Ma(),Zu("placement",function(n,t,e){var o=t.hotspot,r=Ba(e,o.element()),i=Fa(n.element(),t,ma(),ga());return on.some(Aa({anchorBox:r,bubble:t.bubble.getOr(Ea()),overrides:t.overrides,layouts:i,placer:on.none()}))})],Cc=[ct("x"),ct("y"),St("height",0),St("width",0),St("bubble",Ea()),St("overrides",{}),Ma(),Zu("placement",function(n,t,e){var o=bc(e,t.x,t.y),r=xu(o.left(),o.top(),t.width,t.height),i=Fa(n.element(),t,[aa,ca,sa,fa,ic,rc,la,da],[ca,aa,fa,sa,ic,rc,la,da]);return on.some(Aa({anchorBox:r,bubble:t.bubble,overrides:t.overrides,layouts:i,placer:on.none()}))})],kc={create:lr("start","soffset","finish","foffset")},Oc=En([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Tc=(Oc.before,Oc.on,Oc.after,function(n){return n.fold(l,l,l)}),Ec=En([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Dc={domRange:Ec.domRange,relative:Ec.relative,exact:Ec.exact,exactFromRange:function(n){return Ec.exact(n.start(),n.soffset(),n.finish(),n.foffset())},getWin:function(n){var t=function(n){return n.match({domRange:function(n){return Be.fromDom(n.startContainer)},relative:function(n,t){return Tc(n)},exact:function(n,t,e,o){return n}})}(n);return vr(t)},range:kc.create},Bc=En([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);function Ac(n){return uf.get(n)}function _c(n){return uf.getOption(n)}function Mc(e,o,n,t,r){function i(n){var t=e.dom().createRange();return t.setStart(o.dom(),n),t.collapse(!0),t}var u=Ac(o).length,a=function(n,t,e,o,r){if(0===r)return 0;if(t===o)return r-1;for(var i=o,u=1;u<r;u++){var a=n(u),c=Math.abs(t-a.left);if(e<=a.bottom){if(e<a.top||i<c)return u-1;i=c}}return 0}(function(n){return i(n).getBoundingClientRect()},n,t,r.right,u);return i(a)}function Fc(n){return function(n){return _c(n).filter(function(n){return 0!==n.trim().length||-1<n.indexOf("\xa0")}).isSome()}(n)||vn(cf,Ko(n))}function Ic(n){return nr(n,Fc)}function Rc(n){return sf(n,Fc)}function Vc(n,t){return t-n.left<n.right-t}function Nc(n,t,e){var o=n.dom().createRange();return o.selectNode(t.dom()),o.collapse(e),o}function Hc(t,n,e){var o=t.dom().createRange();o.selectNode(n.dom());var r=o.getBoundingClientRect(),i=Vc(r,e);return(!0===i?Ic:Rc)(n).map(function(n){return Nc(t,n,i)})}function Pc(n,t,e){var o=t.dom().getBoundingClientRect(),r=Vc(o,e);return on.some(Nc(n,t,r))}function zc(n,t,e,o){var r=n.dom().createRange();r.selectNode(t.dom());var i=r.getBoundingClientRect();return function(n,t,e,o){var r=n.dom().createRange();r.selectNode(t.dom());var i=r.getBoundingClientRect(),u=Math.max(i.left,Math.min(i.right,e)),a=Math.max(i.top,Math.min(i.bottom,o));return af(n,t,u,a)}(n,t,Math.max(i.left,Math.min(i.right,e)),Math.max(i.top,Math.min(i.bottom,o)))}function Lc(n,t){return Lt(t,n)}function jc(n,t,e,o){var r=function(n,t,e,o){var r=pr(n).dom().createRange();return r.setStart(n.dom(),t),r.setEnd(e.dom(),o),r}(n,t,e,o),i=jt(n,e)&&t===o;return r.collapsed&&!i}function Uc(n){var t=Be.fromDom(n.anchorNode),e=Be.fromDom(n.focusNode);return jc(t,n.anchorOffset,e,n.focusOffset)?on.some(kc.create(t,n.anchorOffset,e,n.focusOffset)):function(n){if(0<n.rangeCount){var t=n.getRangeAt(0),e=n.getRangeAt(n.rangeCount-1);return on.some(kc.create(Be.fromDom(t.startContainer),t.startOffset,Be.fromDom(e.endContainer),e.endOffset))}return on.none()}(n)}function Wc(n,t){return function(n){var t=n.getClientRects(),e=0<t.length?t[0]:n.getBoundingClientRect();return 0<e.width||0<e.height?on.some(e).map(Va):on.none()}(function(i,n){return Ha(i,n).match({ltr:function(n,t,e,o){var r=i.document.createRange();return r.setStart(n.dom(),t),r.setEnd(e.dom(),o),r},rtl:function(n,t,e,o){var r=i.document.createRange();return r.setStart(e.dom(),o),r.setEnd(n.dom(),t),r}})}(n,t))}function Gc(n){return n.fold(function(n){return n},function(n,t,e){return n.translate(-t,-e)})}function Xc(n){return n.fold(function(n){return n},function(n,t,e){return n})}function Yc(n){return O(n,function(n,t){return n.translate(t.left(),t.top())},Ru(0,0))}function qc(n){var t=S(n,Xc);return Yc(t)}function Kc(n,t,e){var o=pr(n.element()),r=hu(o),i=function(o,n,t){var e=vr(t.root).dom();return on.from(e.frameElement).map(Be.fromDom).filter(function(n){var t=pr(n),e=pr(o.element());return jt(t,e)}).map(mu)}(n,0,e).getOr(r);return mf(i,r.left(),r.top())}function Jc(n,t){return _i(n)?hf(n,t):function(n,t){var e=xr(n);if(0===e.length)return ff(n,t);if(t<e.length)return ff(e[t],0);var o=e[e.length-1],r=_i(o)?Ac(o).length:xr(o).length;return ff(o,r)}(n,t)}function $c(n,t){return t.getSelection.getOrThunk(function(){return function(){return function(n){return on.from(n.getSelection()).filter(function(n){return 0<n.rangeCount}).bind(Uc)}(n)}})().map(function(n){var t=Jc(n.start(),n.soffset()),e=Jc(n.finish(),n.foffset());return Dc.range(t.element(),t.offset(),e.element(),e.offset())})}function Qc(n){return n.x()+n.width()}function Zc(n,t){return n.x()-t.width()}function ns(n,t){return n.y()-t.height()+n.height()}function ts(n){return n.y()}function es(n,t,e){return qa(Qc(n),ts(n),e.southeast(),Ja(),"link-layout-se")}function os(n,t,e){return qa(Zc(n,t),ts(n),e.southwest(),$a(),"link-layout-sw")}function rs(n,t,e){return qa(Qc(n),ns(n,t),e.northeast(),Qa(),"link-layout-ne")}function is(n,t,e){return qa(Zc(n,t),ns(n,t),e.northwest(),Za(),"link-layout-nw")}function us(n,t,e,o){var r=n+t;return o<r?e:r<e?o:r}function as(n,t,e){return n<=t?t:e<=n?e:n}function cs(n,t,e,o){var r=n.x(),i=n.y(),u=n.bubble().offset().left(),a=n.bubble().offset().top(),c=o.y(),s=o.bottom(),f=o.x(),l=o.right(),d=i+a,m=function(n,t,e,o,r){var i=r.x(),u=r.y(),a=r.width(),c=r.height(),s=i<=n,f=u<=t,l=s&&f,d=n+e<=i+a&&t+o<=u+c,m=Math.abs(Math.min(e,s?i+a-n:i-(n+e))),g=Math.abs(Math.min(o,f?u+c-t:u-(t+o)));return{originInBounds:l,sizeInBounds:d,limitX:as(n,r.x(),r.right()),limitY:as(t,r.y(),r.bottom()),deltaW:m,deltaH:g}}(r+u,d,t,e,o),g=m.originInBounds,p=m.sizeInBounds,h=m.limitX,v=m.limitY,b=m.deltaW,y=m.deltaH,x=nn(v+y-c),w=nn(s-v),S=function(n,t,e,o){return n.fold(t,t,o,o,t,o,e,e)}(n.direction(),w,w,x),C=nn(h+b-f),k=nn(l-h),O=function(n,t,e,o){return n.fold(t,o,t,o,e,e,t,o)}(n.direction(),k,k,C),T=pc({x:h,y:v,width:b,height:y,maxHeight:S,maxWidth:O,direction:n.direction(),classes:{on:n.bubble().classesOn(),off:n.bubble().classesOff()},label:n.label(),candidateYforTest:d});return g&&p?Sf.fit(T):Sf.nofit(T,b,y)}function ss(n,t,e,o){hi(t,"max-height"),hi(t,"max-width");var r=function(n){return{width:nn(pu(n)),height:nn(lu(n))}}(t);return function(n,e,u,a,c){function o(n,o,r,i){var t=n(e,u,a);return cs(t,s,f,c).fold(Sf.fit,function(n,t,e){return i<e||r<t?Sf.nofit(n,t,e):Sf.nofit(o,r,i)})}var s=u.width(),f=u.height();return O(n,function(n,t){var e=d(o,t);return n.fold(Sf.fit,e)},Sf.nofit(pc({x:e.x(),y:e.y(),width:u.width(),height:u.height(),maxHeight:u.height(),maxWidth:u.width(),direction:Ja(),classes:{on:[],off:[]},label:"none",candidateYforTest:e.y()}),-1,-1)).fold(l,l)}(o.preference(),n,r,e,o.bounds())}function fs(n,t,e){function o(n){return n+"px"}var r=function(n,r){return n.fold(function(){return hc("absolute",on.some(r.x()),on.some(r.y()),on.none(),on.none())},function(n,t,e,o){return Da("absolute",r,n,t,e,o)},function(n,t,e,o){return Da("fixed",r,n,t,e,o)})}(e.origin(),t);!function(n,t){var e=n.dom();Cn(t,function(n,t){n.fold(function(){fi(e,t)},function(n){si(e,t,n)})})}(n,{position:on.some(r.position()),left:r.left().map(o),top:r.top().map(o),right:r.right().map(o),bottom:r.bottom().map(o)})}function ls(n,t){!function(n,t){var e=Fu.max(n,t,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);li(n,"max-height",e+"px")}(n,Math.floor(t))}function ds(n,t,e){return n[t]===undefined?e:n[t]}function ms(n,t,e,o,r,i){var u=ds(i,"maxHeightFunction",Cf()),a=ds(i,"maxWidthFunction",Z),c=n.anchorBox(),s=n.origin(),f=Of({bounds:function(o,n){return n.fold(function(){return o.fold(Cu,Cu,xu)},function(e){return o.fold(e,e,function(){var n=e(),t=bc(o,n.x(),n.y());return xu(t.left(),t.top(),n.width(),n.height())})})}(s,r),origin:s,preference:o,maxHeightFunction:u,maxWidthFunction:a});Tf(c,t,e,f)}function gs(n,t,e,o,r){var i=function(n,t){return wf(n,t)}(e.anchorBox,t);ms(i,r.element(),e.bubble,e.layouts,o,e.overrides)}function ps(n,t){Pi(n.element(),t.element())}function hs(t,n){var e=t.components();!function(n){bn(n.components(),function(n){return zi(n.element())}),Tr(n.element()),n.syncComponents()}(t);var o=_(e,n);bn(o,function(n){Mf(n),t.getSystem().removeFromWorld(n)}),bn(n,function(n){n.getSystem().isConnected()?ps(t,n):(t.getSystem().addToWorld(n),ps(t,n),$o(t.element())&&Ff(n)),t.syncComponents()})}function vs(n,t){If(n,t,Pi)}function bs(n){Mf(n),zi(n.element()),n.getSystem().removeFromWorld(n)}function ys(t){var n=br(t.element()).bind(function(n){return t.getSystem().getByDom(n).toOption()});bs(t),n.each(function(n){n.syncComponents()})}function xs(n){var t=n.components();bn(t,bs),Tr(n.element()),n.syncComponents()}function ws(n,t){Rf(n,t,Pi)}function Ss(t){var n=xr(t.element());bn(n,function(n){t.getByDom(n).each(Mf)}),zi(t.element())}function Cs(t,n,e,o){e.get().each(function(n){xs(t)});var r=n.getAttachPoint(t);vs(r,t);var i=t.getSystem().build(o);return vs(t,i),e.set(i),i}function ks(n,t,e,o){var r=Cs(n,t,e,o);return t.onOpen(n,r),r}function Os(t,e,o){o.get().each(function(n){xs(t),ys(t),e.onClose(t,n),o.clear()})}function Ts(n,t,e){return e.isOpen()}function Es(n){var t,e=ot("Dismissal",Gf,n);return(t={})[jf()]={schema:qn([ct("target")]),onReceive:function(t,n){Lf.isOpen(t)&&(Lf.isPartOf(t,n.target)||e.isExtraPart(t,n.target)||e.fireEventInstead.fold(function(){return Lf.close(t)},function(n){return Yt(t,n.event)}))}},t}function Ds(n){var t,e=ot("Reposition",Xf,n);return(t={})[Uf()]={onReceive:function(t){Lf.isOpen(t)&&e.fireEventInstead.fold(function(){return e.doReposition(t)},function(n){return Yt(t,n.event)})}},t}function Bs(n,t,e){t.store.manager.onLoad(n,t,e)}function As(n,t,e){t.store.manager.onUnload(n,t,e)}function _s(){var n=Ee(null);return tu({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})}function Ms(){var i=Ee({}),u=Ee({});return tu({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return Nn(i.get(),n).orThunk(function(){return Nn(u.get(),n)})},update:function(n){var t=i.get(),e=u.get(),o={},r={};bn(n,function(t){o[t.value]=t,Nn(t,"meta").each(function(n){Nn(n,"text").each(function(n){r[n]=t})})}),i.set(N(N({},t),o)),u.set(N(N({},e),r))},clear:function(){i.set({}),u.set({})}})}function Fs(n,t,e,o){var r=t.store;e.update([o]),r.setValue(n,o),t.onSetValue(n,o)}function Is(t,n){return Bt(t,{},S(n,function(n){return function(t,e){return he(t,t,Fn(),Yn(function(n){return ee("The field: "+t+" is forbidden. "+e)}))}(n.name(),"Cannot configure "+n.name()+" for "+t)}).concat([At("dump",l)]))}function Rs(n){return n.dump}function Vs(n,t){return N(N({},n.dump),ya(t))}function Ns(n,t,e,o){return e.uiType===ol?function(n,t,e,o){return n.exists(function(n){return n!==e.owner})?rl.single(!0,nn(e)):Nn(o,e.name).fold(function(){throw new Error("Unknown placeholder component: "+e.name+"\nKnown: ["+wn(o)+"]\nNamespace: "+n.getOr("none")+"\nSpec: "+JSON.stringify(e,null,2))},function(n){return n.replace()})}(n,0,e,o):rl.single(!1,nn(e))}function Hs(t,e,n,o){var r=P(o,function(n,t){return function(n,t){var e=!1;return{name:nn(n),required:function(){return t.fold(function(n,t){return n},function(n,t){return n})},used:function(){return e},replace:function(){if(!0===e)throw new Error("Trying to use the same placeholder more than once: "+n);return e=!0,t}}}(t,n)}),i=function(t,e,n,o){return D(n,function(n){return il(t,e,n,o)})}(t,e,n,r);return Cn(r,function(n){if(!1===n.used()&&n.required())throw new Error("Placeholder: "+n.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(e.components,null,2))}),i}function Ps(n){return n.fold(on.some,on.none,on.some,on.some)}function zs(n){function t(n){return n.name}return n.fold(t,t,t,t)}function Ls(e,o){return function(n){var t=ot("Converting part type",o,n);return e(t)}}function js(n,t,e,o){return Bn(t.defaults(n,e,o),e,{uid:n.partUids[t.name]},t.overrides(n,e,o))}function Us(r,n){var t={};return bn(n,function(n){Ps(n).each(function(e){var o=El(r,e.pname);t[e.name]=function(n){var t=ot("Part: "+e.name+" in "+r,de(e.schema),n);return N(N({},o),{config:n,validated:t})}})}),t}function Ws(n,t,e){return{uiType:cl(),owner:n,name:t,config:e,validated:{}}}function Gs(n){return D(n,function(n){return n.fold(on.none,on.some,on.none,on.none).map(function(n){return mt(n.name,n.schema.concat([na(Ol())]))}).toArray()})}function Xs(n){return S(n,zs)}function Ys(n,t,e){return function(n,e,t){var i={},o={};return bn(t,function(n){n.fold(function(o){i[o.pname]=ul(!0,function(n,t,e){return o.factory.sketch(js(n,o,t,e))})},function(n){var t=e.parts[n.name];o[n.name]=nn(n.factory.sketch(js(e,n,t[Ol()]),t))},function(o){i[o.pname]=ul(!1,function(n,t,e){return o.factory.sketch(js(n,o,t,e))})},function(r){i[r.pname]=al(!0,function(t,n,e){var o=t[r.name];return S(o,function(n){return r.factory.sketch(Bn(r.defaults(t,n,e),n,r.overrides(t,n)))})})})}),{internals:nn(i),externals:nn(o)}}(0,t,e)}function qs(n,t,e){return Hs(on.some(n),t,t.components,e)}function Ks(n,t,e){var o=t.partUids[e];return n.getSystem().getByUid(o).toOption()}function Js(n,t,e){return Ks(n,t,e).getOrDie("Could not find part: "+e)}function $s(n,t,e){var o={},r=t.partUids,i=n.getSystem();return bn(e,function(n){o[n]=nn(i.getByUid(r[n]))}),o}function Qs(n,t){var e=n.getSystem();return P(t.partUids,function(n,t){return nn(e.getByUid(n))})}function Zs(n){return wn(n.partUids)}function nf(n,t,e){var o={},r=t.partUids,i=n.getSystem();return bn(e,function(n){o[n]=nn(i.getByUid(r[n]).getOrDie())}),o}function tf(t,n){var e=Xs(n);return K(S(e,function(n){return{key:n,value:t+"-"+n}}))}function ef(t){return he("partUids","partUids",Rn(function(n){return tf(n.uid,t)}),xe())}function of(n,t,e,o,r){var i=function(n,t){return(0<n.length?[mt("parts",n)]:[]).concat([ct("uid"),St("dom",{}),St("components",[]),na("originalSpec"),St("debug.sketcher",{})]).concat(t)}(o,r);return ot(n+" [SpecSchema]",qn(i.concat(t)),e)}function rf(n,t,e,o,r){var i=Bl(r),u=Gs(e),a=ef(e),c=of(n,t,i,u,[a]),s=Ys(0,c,e);return o(c,qs(n,c,s.internals()),i,s.externals())}var uf=function iI(e,o){var t=function(n){return e(n)?on.from(n.dom().nodeValue):on.none()};return{get:function(n){if(!e(n))throw new Error("Can only get "+o+" value of a "+o+" node");return t(n).getOr("")},getOption:t,set:function(n,t){if(!e(n))throw new Error("Can only set raw "+o+" value of a "+o+" node");n.dom().nodeValue=t}}}(_i,"text"),af=function(n,t,e,o){return _i(t)?function(t,e,o,r){var n=t.dom().createRange();n.selectNode(e.dom());var i=n.getClientRects();return Au(i,function(n){return Pa(n,o,r)?on.some(n):on.none()}).map(function(n){return Mc(t,e,o,r,n)})}(n,t,e,o):function(t,n,e,o){var r=t.dom().createRange(),i=xr(n);return Au(i,function(n){return r.selectNode(n.dom()),Pa(r.getBoundingClientRect(),e,o)?af(t,n,e,o):on.none()})}(n,t,e,o)},cf=["img","br"],sf=function(n,i){var u=function(n){for(var t=xr(n),e=t.length-1;0<=e;e--){var o=t[e];if(i(o))return on.some(o);var r=u(o);if(r.isSome())return r}return on.none()};return u(n)},ff=(document.caretPositionFromPoint||document.caretRangeFromPoint,lr("element","offset")),lf=En([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),df=lf.screen,mf=lf.absolute,gf=function(n,t,e,o){var r=n,i=t,u=e,a=o;n<0&&(r=0,u=e+n),t<0&&(i=0,a=o+t);var c=df(Ru(r,i));return on.some(zu(c,u,a))},pf=function(n,i,u,a,c){return n.map(function(n){var t=[i,n.point()],e=function(n,t,e,o){return n.fold(t,e,o)}(a,function(){return qc(t)},function(){return qc(t)},function(){return function(n){var t=S(n,Gc);return Yc(t)}(t)}),o=Lu(e.left(),e.top(),n.width(),n.height()),r=Fa(c,u,u.showAbove?[sa,fa,aa,ca,rc,ic]:[aa,ca,sa,fa,ic,ic],u.showAbove?[fa,sa,ca,aa,rc,ic]:[ca,aa,fa,sa,ic,rc]);return Aa({anchorBox:o,bubble:u.bubble.getOr(Ea()),overrides:u.overrides,layouts:r,placer:on.none()})})},hf=lr("element","offset"),vf=[ht("getSelection"),ct("root"),ht("bubble"),Ma(),St("overrides",{}),St("showAbove",!1),Zu("placement",function(n,t,e){var o=vr(t.root).dom(),r=Kc(n,0,t),i=$c(o,t).bind(function(n){return Wc(o,Dc.exactFromRange(n)).orThunk(function(){var t=Be.fromText("\ufeff");return Sr(n.start(),t),Wc(o,Dc.exact(t,0,t,1)).map(function(n){return zi(t),n})}).bind(function(n){return gf(n.left(),n.top(),n.width(),n.height())})}),u=$c(o,t).bind(function(n){return Ai(n.start())?on.some(n.start()):br(n.start())}).getOr(n.element());return pf(i,r,t,e,u)})],bf=[ct("node"),ct("root"),ht("bubble"),Ma(),St("overrides",{}),St("showAbove",!1),Zu("placement",function(r,i,u){var a=Kc(r,0,i);return i.node.bind(function(n){var t=n.dom().getBoundingClientRect(),e=gf(t.left,t.top,t.width,t.height),o=i.node.getOr(r.element());return pf(e,a,i,u,o)})})],yf=[ct("item"),Ma(),St("overrides",{}),Zu("placement",function(n,t,e){var o=Ba(e,t.item.element()),r=Fa(n.element(),t,[es,os,rs,is],[os,es,is,rs]);return on.some(Aa({anchorBox:o,bubble:Ea(),overrides:t.overrides,layouts:r,placer:on.none()}))})],xf=it("anchor",{selection:vf,node:bf,hotspot:Sc,submenu:yf,makeshift:Cc}),wf=lr("anchorBox","origin"),Sf=En([{fit:["reposition"]},{nofit:["reposition","deltaW","deltaH"]}]),Cf=nn(function(n,t){ls(n,t),di(n,{"overflow-x":"hidden","overflow-y":"auto"})}),kf=nn(function(n,t){ls(n,t)}),Of=gr(["bounds","origin","preference","maxHeightFunction","maxWidthFunction"],[]),Tf=function(n,t,e,o){var r=ss(n,t,e,o);fs(t,r,o),function(n,t){var e=t.classes();ai(n,e.off),ui(n,e.on)}(t,r),function(n,t,e){e.maxHeightFunction()(n,t.maxHeight())}(t,r,o),function(n,t,e){e.maxWidthFunction()(n,t.maxWidth())}(t,r,o)},Ef=function(n,t,e,o,r,i){var u=i.map(wu);return Df(n,t,e,o,r,u)},Df=function(r,i,n,t,u,a){var c=ot("positioning anchor.info",xf,t);Oa(function(){li(u.element(),"position","fixed");var n=gi(u.element(),"visibility");li(u.element(),"visibility","hidden");var t=i.useFixed()?function(){var n=v.document.documentElement;return xc(0,0,n.clientWidth,n.clientHeight)}():function(n){var t=mu(n.element()),e=n.element().dom().getBoundingClientRect();return yc(t.left(),t.top(),e.width,e.height)}(r),e=c.placement,o=a.map(nn).or(i.getBounds);e(r,c,t).each(function(n){n.placer.getOr(gs)(r,t,n,o,u)}),n.fold(function(){hi(u.element(),"visibility")},function(n){li(u.element(),"visibility",n)}),gi(u.element(),"left").isNone()&&gi(u.element(),"top").isNone()&&gi(u.element(),"right").isNone()&&gi(u.element(),"bottom").isNone()&&gi(u.element(),"position").is("fixed")&&hi(u.element(),"position")},u.element())},Bf=/* */Object.freeze({position:function(n,t,e,o,r){Ef(n,t,e,o,r,on.none())},positionWithin:Ef,positionWithinBounds:Df,getMode:function(n,t,e){return t.useFixed()?"fixed":"absolute"}}),Af=[St("useFixed",u),ht("getBounds")],_f=xa({fields:Af,name:"positioning",active:mc,apis:Bf}),Mf=function(n){Yt(n,Ho());var t=n.components();bn(t,Mf)},Ff=function(n){var t=n.components();bn(t,Ff),Yt(n,No())},If=function(n,t,e){n.getSystem().addToWorld(t),e(n.element(),t.element()),$o(n.element())&&Ff(t),n.syncComponents()},Rf=function(n,t,e){e(n,t.element());var o=xr(t.element());bn(o,function(n){t.getByDom(n).each(Ff)})},Vf=function(n,t,e){var o=t.getAttachPoint(n);li(n.element(),"position",_f.getMode(o)),function(t,n,e,o){gi(t.element(),n).fold(function(){Ir(t.element(),e)},function(n){_r(t.element(),e,n)}),li(t.element(),n,o)}(n,"visibility",t.cloakVisibilityAttr,"hidden")},Nf=function(n,t,e){!function(t){return x(["top","left","right","bottom"],function(n){return gi(t,n).isSome()})}(n.element())&&hi(n.element(),"position"),function(n,t,e){if(Fr(n.element(),e)){var o=Mr(n.element(),e);li(n.element(),t,o)}else hi(n.element(),t)}(n,"visibility",t.cloakVisibilityAttr)},Hf=/* */Object.freeze({cloak:Vf,decloak:Nf,open:ks,openWhileCloaked:function(n,t,e,o,r){Vf(n,t),ks(n,t,e,o),r(),Nf(n,t)},close:Os,isOpen:Ts,isPartOf:function(t,e,n,o){return Ts(0,0,n)&&n.get().exists(function(n){return e.isPartOf(t,n,o)})},getState:function(n,t,e){return e.get()},setContent:function(n,t,e,o){return e.get().map(function(){return Cs(n,t,e,o)})}}),Pf=/* */Object.freeze({events:function(e,o){return tr([rr(Ao(),function(n,t){Os(n,e,o)})])}}),zf=[Ku("onOpen"),Ku("onClose"),ct("isPartOf"),ct("getAttachPoint"),St("cloakVisibilityAttr","data-precloak-visibility")],Lf=xa({fields:zf,name:"sandboxing",active:Pf,apis:Hf,state:/* */Object.freeze({init:function(){var t=Ee(on.none()),n=nn("not-implemented");return tu({readState:n,isOpen:function(){return t.get().isSome()},clear:function(){t.set(on.none())},set:function(n){t.set(on.some(n))},get:function(n){return t.get()}})}})}),jf=nn("dismiss.popups"),Uf=nn("reposition.popups"),Wf=nn("mouse.released"),Gf=qn([St("isExtraPart",nn(!1)),wt("fireEventInstead",[St("event",Po())])]),Xf=qn([St("isExtraPart",nn(!1)),wt("fireEventInstead",[St("event",zo())]),dt("doReposition")]),Yf=/* */Object.freeze({onLoad:Bs,onUnload:As,setValue:function(n,t,e,o){t.store.manager.setValue(n,t,e,o)},getValue:function(n,t,e){return t.store.manager.getValue(n,t,e)},getState:function(n,t,e){return e}}),qf=/* */Object.freeze({events:function(e,o){var n=e.resetOnDom?[Ri(function(n,t){Bs(n,e,o)}),Vi(function(n,t){As(n,e,o)})]:[pa(e,o,Bs)];return tr(n)}}),Kf=/* */Object.freeze({memory:_s,dataset:Ms,manual:function(){return tu({readState:function(){}})},init:function(n){return n.store.manager.state(n)}}),Jf=[ht("initialValue"),ct("getFallbackEntry"),ct("getDataKey"),ct("setValue"),Zu("manager",{setValue:Fs,getValue:function(n,t,e){var o=t.store,r=o.getDataKey(n);return e.lookup(r).fold(function(){return o.getFallbackEntry(r)},function(n){return n})},onLoad:function(t,e,o){e.store.initialValue.each(function(n){Fs(t,e,o,n)})},onUnload:function(n,t,e){e.clear()},state:Ms})],$f=[ct("getValue"),St("setValue",Z),ht("initialValue"),Zu("manager",{setValue:function(n,t,e,o){t.store.setValue(n,o),t.onSetValue(n,o)},getValue:function(n,t,e){return t.store.getValue(n)},onLoad:function(t,e,n){e.store.initialValue.each(function(n){e.store.setValue(t,n)})},onUnload:Z,state:nu.init})],Qf=[ht("initialValue"),Zu("manager",{setValue:function(n,t,e,o){e.set(o),t.onSetValue(n,o)},getValue:function(n,t,e){return e.get()},onLoad:function(n,t,e){t.store.initialValue.each(function(n){e.isNotSet()&&e.set(n)})},onUnload:function(n,t,e){e.clear()},state:_s})],Zf=[Ct("store",{mode:"memory"},it("mode",{memory:Qf,manual:$f,dataset:Jf})),Ku("onSetValue"),St("resetOnDom",!1)],nl=xa({fields:Zf,name:"representing",active:qf,apis:Yf,extra:{setValueFrom:function(n,t){var e=nl.getValue(t);nl.setValue(n,e)}},state:Kf}),tl=Is,el=Vs,ol="placeholder",rl=En([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),il=function(i,u,a,c){return Ns(i,0,a,c).fold(function(n,t){var e=t(u,a.config,a.validated),o=Nn(e,"components").getOr([]),r=D(o,function(n){return il(i,u,n,c)});return[N(N({},e),{components:r})]},function(n,t){var e=t(u,a.config,a.validated);return a.validated.preprocess.getOr(l)(e)})},ul=rl.single,al=rl.multiple,cl=nn(ol),sl=En([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),fl=St("factory",{sketch:l}),ll=St("schema",[]),dl=ct("name"),ml=he("pname","pname",In(function(n){return"<alloy."+Hr(n.name)+">"}),xe()),gl=At("schema",function(){return[ht("preprocess")]}),pl=St("defaults",nn({})),hl=St("overrides",nn({})),vl=de([fl,ll,dl,ml,pl,hl]),bl=de([fl,ll,dl,pl,hl]),yl=de([fl,ll,dl,ml,pl,hl]),xl=de([fl,gl,dl,ct("unit"),ml,pl,hl]),wl=Ls(sl.required,vl),Sl=Ls(sl.external,bl),Cl=Ls(sl.optional,yl),kl=Ls(sl.group,xl),Ol=nn("entirety"),Tl=/* */Object.freeze({required:wl,external:Sl,optional:Cl,group:kl,asNamedPart:Ps,name:zs,asCommon:function(n){return n.fold(l,l,l,l)},original:Ol}),El=function(n,t){return{uiType:cl(),owner:n,name:t}},Dl=/* */Object.freeze({generate:Us,generateOne:Ws,schemas:Gs,names:Xs,substitutes:Ys,components:qs,defaultUids:tf,defaultUidsSchema:ef,getAllParts:Qs,getAllPartNames:Zs,getPart:Ks,getPartOrDie:Js,getParts:$s,getPartsOrDie:nf}),Bl=function(n){return n.hasOwnProperty("uid")?n:N(N({},n),{uid:Pr("uid")})};function Al(n){var t=ot("Sketcher for "+n.name,Jl,n),e=P(t.apis,Ur),o=P(t.extraApis,function(n,t){return Lr(n,t)});return N(N({name:nn(t.name),partFields:nn([]),configFields:nn(t.configFields),sketch:function(n){return function(n,t,e,o){var r=Bl(o);return e(of(n,t,r,[],[]),r)}(t.name,t.configFields,t.factory,n)}},e),o)}function _l(n){var t=ot("Sketcher for "+n.name,$l,n),e=Us(t.name,t.partFields),o=P(t.apis,Ur),r=P(t.extraApis,function(n,t){return Lr(n,t)});return N(N({name:nn(t.name),partFields:nn(t.partFields),configFields:nn(t.configFields),sketch:function(n){return rf(t.name,t.configFields,t.partFields,t.factory,n)},parts:nn(e)},o),r)}function Ml(n){return"input"===Ko(n)&&"radio"!==Mr(n,"type")||"textarea"===Ko(n)}function Fl(e,o,n,r){var t=Lc(e.element(),"."+o.highlightClass);bn(t,function(t){x(r,function(n){return n.element()===t})||(ri(t,o.highlightClass),e.getSystem().getByDom(t).each(function(n){o.onDehighlight(e,n),Yt(n,Xo())}))})}function Il(n,t,e,o){Fl(n,t,0,[o]),td(n,t,e,o)||(ei(o.element(),t.highlightClass),t.onHighlight(n,o),Yt(o,Go()))}function Rl(e,t,n,o){var r=Lc(e.element(),"."+t.itemClass);return E(r,function(n){return ii(n,t.highlightClass)}).bind(function(n){var t=us(n,o,0,r.length-1);return e.getSystem().getByDom(r[t]).toOption()})}function Vl(n,t,e){var o=A(n.slice(0,t)),r=A(n.slice(t+1));return T(o.concat(r),e)}function Nl(n,t,e){var o=A(n.slice(0,t));return T(o,e)}function Hl(n,t,e){var o=n.slice(0,t),r=n.slice(t+1);return T(r.concat(o),e)}function Pl(n,t,e){var o=n.slice(t+1);return T(o,e)}function zl(e){return function(n){var t=n.raw();return vn(e,t.which)}}function Ll(n){return function(t){return B(n,function(n){return n(t)})}}function jl(n){return!0===n.raw().shiftKey}function Ul(n){return!0===n.raw().ctrlKey}function Wl(n,t){return{matches:n,classification:t}}function Gl(n,t,e){t.exists(function(t){return e.exists(function(n){return jt(n,t)})})||qt(n,Lo(),{prevFocus:t,newFocus:e})}function Xl(){function r(n){return ka(n.element())}return{get:r,set:function(n,t){var e=r(n);n.getSystem().triggerFocus(t,n.element());var o=r(n);Gl(n,e,o)}}}function Yl(){function r(n){return cd.getHighlighted(n).map(function(n){return n.element()})}return{get:r,set:function(t,n){var e=r(t);t.getSystem().getByDom(n).fold(Z,function(n){cd.highlight(t,n)});var o=r(t);Gl(t,e,o)}}}var ql,Kl,Jl=qn([ct("name"),ct("factory"),ct("configFields"),St("apis",{}),St("extraApis",{})]),$l=qn([ct("name"),ct("factory"),ct("configFields"),ct("partFields"),St("apis",{}),St("extraApis",{})]),Ql=/* */Object.freeze({getCurrent:function(n,t,e){return t.find(n)}}),Zl=[ct("find")],nd=xa({fields:Zl,name:"composing",apis:Ql}),td=function(n,t,e,o){return ii(o.element(),t.highlightClass)},ed=function(n,t,e,o){var r=Lc(n.element(),"."+t.itemClass);return on.from(r[o]).fold(function(){return an.error("No element found with index "+o)},n.getSystem().getByDom)},od=function(t,n,e){return Ou(t.element(),"."+n.itemClass).bind(function(n){return t.getSystem().getByDom(n).toOption()})},rd=function(t,n,e){var o=Lc(t.element(),"."+n.itemClass);return(0<o.length?on.some(o[o.length-1]):on.none()).bind(function(n){return t.getSystem().getByDom(n).toOption()})},id=function(t,n,e){var o=Lc(t.element(),"."+n.itemClass);return Bu(S(o,function(n){return t.getSystem().getByDom(n).toOption()}))},ud=/* */Object.freeze({dehighlightAll:function(n,t,e){return Fl(n,t,0,[])},dehighlight:function(n,t,e,o){td(n,t,e,o)&&(ri(o.element(),t.highlightClass),t.onDehighlight(n,o),Yt(o,Xo()))},highlight:Il,highlightFirst:function(t,e,o){od(t,e).each(function(n){Il(t,e,o,n)})},highlightLast:function(t,e,o){rd(t,e).each(function(n){Il(t,e,o,n)})},highlightAt:function(t,e,o,n){ed(t,e,o,n).fold(function(n){throw new Error(n)},function(n){Il(t,e,o,n)})},highlightBy:function(t,e,o,n){var r=id(t,e);T(r,n).each(function(n){Il(t,e,o,n)})},isHighlighted:td,getHighlighted:function(t,n,e){return Ou(t.element(),"."+n.highlightClass).bind(function(n){return t.getSystem().getByDom(n).toOption()})},getFirst:od,getLast:rd,getPrevious:function(n,t,e){return Rl(n,t,0,-1)},getNext:function(n,t,e){return Rl(n,t,0,1)},getCandidates:id}),ad=[ct("highlightClass"),ct("itemClass"),Ku("onHighlight"),Ku("onDehighlight")],cd=xa({fields:ad,name:"highlighting",apis:ud}),sd=b(jl);(Kl=ql=ql||{}).OnFocusMode="onFocus",Kl.OnEnterOrSpaceMode="onEnterOrSpace",Kl.OnApiMode="onApi";function fd(n,t,e,i,u){function a(t,e,n,o,r){return function(n,t){return T(n,function(n){return n.matches(t)}).map(function(n){return n.classification})}(n(t,e,o,r),e.event()).bind(function(n){return n(t,e,o,r)})}var o={schema:function(){return n.concat([St("focusManager",Xl()),Ct("focusInside","onFocus",Zn(function(n){return vn(["onFocus","onEnterOrSpace","onApi"],n)?an.value(n):an.error("Invalid value for focusInside")})),Zu("handler",o),Zu("state",t),Zu("sendFocusIn",u)])},processKey:a,toEvents:function(o,r){var n=o.focusInside!==ql.OnFocusMode?on.none():u(o).map(function(e){return rr(So(),function(n,t){e(n,o,r),t.stop()})});return tr(n.toArray().concat([rr(go(),function(n,t){a(n,t,e,o,r).fold(function(){!function(t,e){var n=zl([32].concat([13]))(e.event());o.focusInside===ql.OnEnterOrSpaceMode&&n&&Ut(t,e)&&u(o).each(function(n){n(t,o,r),e.stop()})}(n,t)},function(n){t.stop()})}),rr(po(),function(n,t){a(n,t,i,o,r).each(function(n){t.stop()})})]))}};return o}function ld(n){function i(n,t){var e=n.visibilitySelector.bind(function(n){return Tu(t,n)}).getOr(t);return 0<fu(e)}function t(t,e){(function(n,t){var e=Lc(n.element(),t.selector),o=C(e,function(n){return i(t,n)});return on.from(o[t.firstTabstop])})(t,e).each(function(n){e.focusManager.set(t,n)})}function u(t,n,e,o,r){return r(n,e,function(n){return function(n,t){return i(n,t)&&n.useTabstopAt(t)}(o,n)}).fold(function(){return o.cyclic?on.some(!0):on.none()},function(n){return o.focusManager.set(t,n),on.some(!0)})}function a(t,n,e,o){var r=Lc(t.element(),e.selector);return function(n,t){return t.focusManager.get(n).bind(function(n){return Tu(n,t.selector)})}(t,e).bind(function(n){return E(r,d(jt,n)).bind(function(n){return u(t,r,n,e,o)})})}var e=[ht("onEscape"),ht("onEnter"),St("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),St("firstTabstop",0),St("useTabstopAt",nn(!0)),ht("visibilitySelector")].concat([n]),o=nn([Wl(Ll([jl,zl([9])]),function(n,t,e,o){var r=e.cyclic?Vl:Nl;return a(n,0,e,r)}),Wl(zl([9]),function(n,t,e,o){var r=e.cyclic?Hl:Pl;return a(n,0,e,r)}),Wl(zl([27]),function(t,e,n,o){return n.onEscape.bind(function(n){return n(t,e)})}),Wl(Ll([sd,zl([13])]),function(t,e,n,o){return n.onEnter.bind(function(n){return n(t,e)})})]),r=nn([]);return fd(e,nu.init,o,r,function(){return on.some(t)})}function dd(n,t,e){return Ml(e)&&zl([32])(t.event())?on.none():function(n,t,e){return Jt(n,e,To()),on.some(!0)}(n,0,e)}function md(n,t){return on.some(!0)}function gd(n,t,e){return e.execute(n,t,n.element())}function pd(n){var e=Ee(on.none());return tu({readState:function(){return e.get().map(function(n){return{numRows:n.numRows(),numColumns:n.numColumns()}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(n,t){e.set(on.some({numRows:nn(n),numColumns:nn(t)}))},getNumRows:function(){return e.get().map(function(n){return n.numRows()})},getNumColumns:function(){return e.get().map(function(n){return n.numColumns()})}})}function hd(i){return function(n,t,e,o){var r=i(n.element());return Em(r,n,t,e,o)}}function vd(n,t){var e=_a(n,t);return hd(e)}function bd(n,t){var e=_a(t,n);return hd(e)}function yd(r){return function(n,t,e,o){return Em(r,n,t,e,o)}}function xd(n){return!function(n){return n.offsetWidth<=0&&n.offsetHeight<=0}(n.dom())}function wd(n,t,e){var o=d(jt,t),r=Lc(n,e);return function(t,n){return E(t,n).map(function(n){return _m({index:n,candidates:t})})}(C(r,xd),o)}function Sd(n,t){return E(n,function(n){return jt(t,n)})}function Cd(e,n,o,t){return t(Math.floor(n/o),n%o).bind(function(n){var t=n.row()*o+n.column();return 0<=t&&t<e.length?on.some(e[t]):on.none()})}function kd(r,n,i,u,a){return Cd(r,n,u,function(n,t){var e=n===i-1?r.length-n*u:u,o=us(t,a,0,e-1);return on.some({row:nn(n),column:nn(o)})})}function Od(i,n,u,a,c){return Cd(i,n,a,function(n,t){var e=us(n,c,0,u-1),o=e===u-1?i.length-e*a:a,r=as(t,0,o-1);return on.some({row:nn(e),column:nn(r)})})}function Td(t,e,n){Ou(t.element(),e.selector).each(function(n){e.focusManager.set(t,n)})}function Ed(r){return function(n,t,e,o){return wd(n,t,e.selector).bind(function(n){return r(n.candidates(),n.index(),o.getNumRows().getOr(e.initSize.numRows),o.getNumColumns().getOr(e.initSize.numColumns))})}}function Dd(n,t,e,o){return e.captureTab?on.some(!0):on.none()}function Bd(n,t,e,r){var i=function(n,t,e){var o=us(t,r,0,e.length-1);return o===n?on.none():function(n){return"button"===Ko(n)&&"disabled"===Mr(n,"disabled")}(e[o])?i(n,o,e):on.from(e[o])};return wd(n,e,t).bind(function(n){var t=n.index(),e=n.candidates();return i(t,t,e)})}function Ad(t,e,o){return function(n,t){return t.focusManager.get(n).bind(function(n){return Tu(n,t.selector)})}(t,o).bind(function(n){return o.execute(t,e,n)})}function _d(t,e){e.getInitial(t).orThunk(function(){return Ou(t.element(),e.selector)}).each(function(n){e.focusManager.set(t,n)})}function Md(n,t,e){return Bd(n,e.selector,t,-1)}function Fd(n,t,e){return Bd(n,e.selector,t,1)}function Id(o){return function(n,t,e){return o(n,t,e).bind(function(){return e.executeOnMove?Ad(n,t,e):on.some(!0)})}}function Rd(n,t,e,o){return e.onEscape(n,t)}function Vd(n,t,e){return on.from(n[t]).bind(function(n){return on.from(n[e]).map(function(n){return Um({rowIndex:t,columnIndex:e,cell:n})})})}function Nd(n,t,e,o){var r=n[t].length,i=us(e,o,0,r-1);return Vd(n,t,i)}function Hd(n,t,e,o){var r=us(e,o,0,n.length-1),i=n[r].length,u=as(t,0,i-1);return Vd(n,r,u)}function Pd(n,t,e,o){var r=n[t].length,i=as(e+o,0,r-1);return Vd(n,t,i)}function zd(n,t,e,o){var r=as(e+o,0,n.length-1),i=n[r].length,u=as(t,0,i-1);return Vd(n,r,u)}function Ld(t,e){e.previousSelector(t).orThunk(function(){var n=e.selectors;return Ou(t.element(),n.cell)}).each(function(n){e.focusManager.set(t,n)})}function jd(n,t){return function(r,e,i){var u=i.cycles?n:t;return Tu(e,i.selectors.row).bind(function(n){var t=Lc(n,i.selectors.cell);return Sd(t,e).bind(function(e){var o=Lc(r,i.selectors.row);return Sd(o,n).bind(function(n){var t=function(n,t){return S(n,function(n){return Lc(n,t.selectors.cell)})}(o,i);return u(t,n,e).map(function(n){return n.cell()})})})})}}function Ud(t,e,o){return o.focusManager.get(t).bind(function(n){return o.execute(t,e,n)})}function Wd(t,e){Ou(t.element(),e.selector).each(function(n){e.focusManager.set(t,n)})}function Gd(n,t,e){return Bd(n,e.selector,t,-1)}function Xd(n,t,e){return Bd(n,e.selector,t,1)}function Yd(n,t,e,o){var r=n.getSystem().build(o);If(n,r,e)}function qd(n,t,e,o){var r=mg(n);T(r,function(n){return jt(o.element(),n.element())}).each(ys)}function Kd(t,n,e,o,r){var i=mg(t);return on.from(i[o]).map(function(n){return qd(t,0,0,n),r.each(function(n){Yd(t,0,function(n,t){!function(n,t,e){wr(n,e).fold(function(){Pi(n,t)},function(n){Sr(n,t)})}(n,t,o)},n)}),n})}function Jd(n,t){return{key:n,value:{config:{},me:function(n,t){var e=tr(t);return xa({fields:[ct("enabled")],name:n,active:{events:nn(e)}})}(n,t),configAsRaw:nn({}),initialConfig:{},state:nu}}}function $d(n,t){t.ignore||(Sa(n.element()),t.onFocus(n))}function Qd(n,t,e){var o=t.aria;o.update(n,o,e.get())}function Zd(t,n,e){n.toggleClass.each(function(n){e.get()?ei(t.element(),n):ri(t.element(),n)})}function nm(n,t,e){yg(n,t,e,!e.get())}function tm(n,t,e){e.set(!0),Zd(n,t,e),Qd(n,t,e)}function em(n,t,e){e.set(!1),Zd(n,t,e),Qd(n,t,e)}function om(n,t,e){yg(n,t,e,t.selected)}function rm(){return[rr(Xt(),function(n,t){t.stop(),Kt(n)}),sr(Ht().deviceType.isTouch()?eo():uo())]}function im(n){return tr(H([n.map(function(e){return Hi(function(n,t){e(n),t.stop()})}).toArray(),rm()]))}function um(n){(ka(n.element()).isNone()||bg.isFocused(n))&&(bg.isFocused(n)||bg.focus(n),qt(n,Og,{item:n}))}function am(n){qt(n,Tg,{item:n})}function cm(n,t){var e={};Cn(n,function(n,t){bn(n,function(n){e[n]=t})});var o=t,r=function(n){return kn(n,function(n,t){return{k:n,v:t}})}(t),i=P(r,function(n,t){return[t].concat(Hg(e,o,r,t))});return P(e,function(n){return Nn(i,n).getOr([n])})}function sm(n){return n.x()}function fm(n,t){return n.x()+n.width()/2-t.width()/2}function lm(n,t){return n.x()+n.width()-t.width()}function dm(n){return n.y()}function mm(n,t){return n.y()+n.height()-t.height()}function gm(n,t,e){return qa(sm(n),mm(n,t),e.innerSoutheast(),Ja(),"layout-se")}function pm(n,t,e){return qa(lm(n,t),mm(n,t),e.innerSouthwest(),$a(),"layout-sw")}function hm(n,t,e){return qa(sm(n),dm(n),e.innerNortheast(),Qa(),"layout-ne")}function vm(n,t,e){return qa(lm(n,t),dm(n),e.innerNorthwest(),Za(),"layout-nw")}function bm(n){var t=function e(n){return n.uid!==undefined}(n)&&$(n,"uid")?n.uid:Pr("memento");return{get:function(n){return n.getSystem().getByUid(t).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(t).toOption()},asSpec:function(){return N(N({},n),{uid:t})}}}function ym(n){return on.from(n()["temporary-placeholder"]).getOr("!not found!")}function xm(n,t){return on.from(t()[n]).getOrThunk(function(){return ym(t)})}var wm,Sm=ld(At("cyclic",nn(!1))),Cm=ld(At("cyclic",nn(!0))),km=[St("execute",dd),St("useSpace",!1),St("useEnter",!0),St("useControlEnter",!1),St("useDown",!1)],Om=fd(km,nu.init,function(n,t,e,o){var r=e.useSpace&&!Ml(n.element())?[32]:[],i=e.useEnter?[13]:[],u=e.useDown?[40]:[],a=r.concat(i).concat(u);return[Wl(zl(a),gd)].concat(e.useControlEnter?[Wl(Ll([Ul,zl([13])]),gd)]:[])},function(n,t,e,o){return e.useSpace&&!Ml(n.element())?[Wl(zl([32]),md)]:[]},function(){return on.none()}),Tm=/* */Object.freeze({flatgrid:pd,init:function(n){return n.state(n)}}),Em=function(t,e,n,o,r){return o.focusManager.get(e).bind(function(n){return t(e.element(),n,o,r)}).map(function(n){return o.focusManager.set(e,n),!0})},Dm=yd,Bm=yd,Am=yd,_m=gr(["index","candidates"],[]),Mm=[ct("selector"),St("execute",dd),Ju("onEscape"),St("captureTab",!1),Ya()],Fm=Ed(function(n,t,e,o){return kd(n,t,e,o,-1)}),Im=Ed(function(n,t,e,o){return kd(n,t,e,o,1)}),Rm=Ed(function(n,t,e,o){return Od(n,t,e,o,-1)}),Vm=Ed(function(n,t,e,o){return Od(n,t,e,o,1)}),Nm=nn([Wl(zl([37]),vd(Fm,Im)),Wl(zl([39]),bd(Fm,Im)),Wl(zl([38]),Dm(Rm)),Wl(zl([40]),Bm(Vm)),Wl(Ll([jl,zl([9])]),Dd),Wl(Ll([sd,zl([9])]),Dd),Wl(zl([27]),function(n,t,e,o){return e.onEscape(n,t)}),Wl(zl([32].concat([13])),function(t,e,o,n){return function(n,t){return t.focusManager.get(n).bind(function(n){return Tu(n,t.selector)})}(t,o).bind(function(n){return o.execute(t,e,n)})})]),Hm=nn([Wl(zl([32]),md)]),Pm=fd(Mm,pd,Nm,Hm,function(){return on.some(Td)}),zm=[ct("selector"),St("getInitial",on.none),St("execute",dd),Ju("onEscape"),St("executeOnMove",!1),St("allowVertical",!0)],Lm=nn([Wl(zl([32]),md)]),jm=fd(zm,nu.init,function(n,t,e,o){var r=[37].concat(e.allowVertical?[38]:[]),i=[39].concat(e.allowVertical?[40]:[]);return[Wl(zl(r),Id(vd(Md,Fd))),Wl(zl(i),Id(bd(Md,Fd))),Wl(zl([13]),Ad),Wl(zl([32]),Ad),Wl(zl([27]),Rd)]},Lm,function(){return on.some(_d)}),Um=gr(["rowIndex","columnIndex","cell"],[]),Wm=[mt("selectors",[ct("row"),ct("cell")]),St("cycles",!0),St("previousSelector",on.none),St("execute",dd)],Gm=jd(function(n,t,e){return Nd(n,t,e,-1)},function(n,t,e){return Pd(n,t,e,-1)}),Xm=jd(function(n,t,e){return Nd(n,t,e,1)},function(n,t,e){return Pd(n,t,e,1)}),Ym=jd(function(n,t,e){return Hd(n,e,t,-1)},function(n,t,e){return zd(n,e,t,-1)}),qm=jd(function(n,t,e){return Hd(n,e,t,1)},function(n,t,e){return zd(n,e,t,1)}),Km=nn([Wl(zl([37]),vd(Gm,Xm)),Wl(zl([39]),bd(Gm,Xm)),Wl(zl([38]),Dm(Ym)),Wl(zl([40]),Bm(qm)),Wl(zl([32].concat([13])),function(t,e,o){return ka(t.element()).bind(function(n){return o.execute(t,e,n)})})]),Jm=nn([Wl(zl([32]),md)]),$m=fd(Wm,nu.init,Km,Jm,function(){return on.some(Ld)}),Qm=[ct("selector"),St("execute",dd),St("moveOnTab",!1)],Zm=nn([Wl(zl([38]),Am(Gd)),Wl(zl([40]),Am(Xd)),Wl(Ll([jl,zl([9])]),function(n,t,e){return e.moveOnTab?Am(Gd)(n,t,e):on.none()}),Wl(Ll([sd,zl([9])]),function(n,t,e){return e.moveOnTab?Am(Xd)(n,t,e):on.none()}),Wl(zl([13]),Ud),Wl(zl([32]),Ud)]),ng=nn([Wl(zl([32]),md)]),tg=fd(Qm,nu.init,Zm,ng,function(){return on.some(Wd)}),eg=[Ju("onSpace"),Ju("onEnter"),Ju("onShiftEnter"),Ju("onLeft"),Ju("onRight"),Ju("onTab"),Ju("onShiftTab"),Ju("onUp"),Ju("onDown"),Ju("onEscape"),St("stopSpaceKeyup",!1),ht("focusIn")],og=fd(eg,nu.init,function(n,t,e){return[Wl(zl([32]),e.onSpace),Wl(Ll([sd,zl([13])]),e.onEnter),Wl(Ll([jl,zl([13])]),e.onShiftEnter),Wl(Ll([jl,zl([9])]),e.onShiftTab),Wl(Ll([sd,zl([9])]),e.onTab),Wl(zl([38]),e.onUp),Wl(zl([40]),e.onDown),Wl(zl([37]),e.onLeft),Wl(zl([39]),e.onRight),Wl(zl([32]),e.onSpace),Wl(zl([27]),e.onEscape)]},function(n,t,e){return e.stopSpaceKeyup?[Wl(zl([32]),md)]:[]},function(n){return n.focusIn}),rg=Sm.schema(),ig=Cm.schema(),ug=jm.schema(),ag=Pm.schema(),cg=$m.schema(),sg=Om.schema(),fg=tg.schema(),lg=og.schema(),dg=wa({branchKey:"mode",branches:/* */Object.freeze({acyclic:rg,cyclic:ig,flow:ug,flatgrid:ag,matrix:cg,execution:sg,menu:fg,special:lg}),name:"keying",active:{events:function(n,t){return n.handler.toEvents(n,t)}},apis:{focusIn:function(t,e,o){e.sendFocusIn(e).fold(function(){t.getSystem().triggerFocus(t.element(),t.element())},function(n){n(t,e,o)})},setGridSize:function(n,t,e,o,r){$(e,"setGridSize")?e.setGridSize(o,r):v.console.error("Layout does not support setGridSize")}},state:Tm}),mg=function(n,t){return n.components()},gg=xa({fields:[],name:"replacing",apis:/* */Object.freeze({append:function(n,t,e,o){Yd(n,0,Pi,o)},prepend:function(n,t,e,o){Yd(n,0,kr,o)},remove:qd,replaceAt:Kd,replaceBy:function(t,n,e,o,r){var i=mg(t);return E(i,o).bind(function(n){return Kd(t,0,0,n,r)})},set:function(t,n,e,o){Oa(function(){var n=S(o,t.getSystem().build);hs(t,n)},t.element())},contents:mg})}),pg=/* */Object.freeze({focus:$d,blur:function(n,t){t.ignore||function(n){n.dom().blur()}(n.element())},isFocused:function(n){return function(n){var t=pr(n).dom();return n.dom()===t.activeElement}(n.element())}}),hg=/* */Object.freeze({exhibit:function(n,t){var e=t.ignore?{}:{attributes:{tabindex:"-1"}};return Gr(e)},events:function(e){return tr([rr(So(),function(n,t){$d(n,e),t.stop()})].concat(e.stopMousedown?[rr(uo(),function(n,t){t.event().prevent()})]:[]))}}),vg=[Ku("onFocus"),St("stopMousedown",!1),St("ignore",!1)],bg=xa({fields:vg,name:"focusing",active:hg,apis:pg}),yg=function(n,t,e,o){(o?tm:em)(n,t,e)},xg=/* */Object.freeze({onLoad:om,toggle:nm,isOn:function(n,t,e){return e.get()},on:tm,off:em,set:yg}),wg=/* */Object.freeze({exhibit:function(n,t,e){return Gr({})},events:function(n,t){var e=function(t,e,o){return Hi(function(n){o(n,t,e)})}(n,t,nm),o=pa(n,t,om);return tr(H([n.toggleOnExecute?[e]:[],[o]]))}}),Sg=function(n,t,e){_r(n.element(),"aria-expanded",e)},Cg=[St("selected",!1),ht("toggleClass"),St("toggleOnExecute",!0),Ct("aria",{mode:"none"},it("mode",{pressed:[St("syncWithExpanded",!1),Zu("update",function(n,t,e){_r(n.element(),"aria-pressed",e),t.syncWithExpanded&&Sg(n,t,e)})],checked:[Zu("update",function(n,t,e){_r(n.element(),"aria-checked",e)})],expanded:[Zu("update",Sg)],selected:[Zu("update",function(n,t,e){_r(n.element(),"aria-selected",e)})],none:[Zu("update",Z)]}))],kg=xa({fields:Cg,name:"toggling",active:wg,apis:xg,state:(wm=!1,{init:function(){var t=Ee(wm);return{get:function(){return t.get()},set:function(n){return t.set(n)},clear:function(){return t.set(wm)},readState:function(){return t.get()}}}})}),Og="alloy.item-hover",Tg="alloy.item-focus",Eg=nn(Og),Dg=nn(Tg),Bg=[ct("data"),ct("components"),ct("dom"),St("hasSubmenu",!1),ht("toggling"),tl("itemBehaviours",[kg,bg,dg,nl]),St("ignoreFocus",!1),St("domModification",{}),Zu("builder",function(n){return{dom:n.dom,domModification:N(N({},n.domModification),{attributes:N(N(N({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes),{"aria-haspopup":n.hasSubmenu}),n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:el(n.itemBehaviours,[n.toggling.fold(kg.revoke,function(n){return kg.config(N({aria:{mode:"checked"}},n))}),bg.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){am(n)}}),dg.config({mode:"execution"}),nl.config({store:{mode:"memory",initialValue:n.data}}),Jd("item-type-events",g(rm(),[rr(fo(),um),rr(Eo(),bg.focus)]))]),components:n.components,eventOrder:n.eventOrder}}),St("eventOrder",{})],Ag=[ct("dom"),ct("components"),Zu("builder",function(n){return{dom:n.dom,components:n.components,events:tr([function(n){return rr(n,function(n,t){t.stop()})}(Eo())])}})],_g=nn([wl({name:"widget",overrides:function(t){return{behaviours:ya([nl.config({store:{mode:"manual",getValue:function(n){return t.data},setValue:function(){}}})])}}})]),Mg=[ct("uid"),ct("data"),ct("components"),ct("dom"),St("autofocus",!1),St("ignoreFocus",!1),tl("widgetBehaviours",[nl,bg,dg]),St("domModification",{}),ef(_g()),Zu("builder",function(e){function o(n){return Ks(n,e,"widget").map(function(n){return dg.focusIn(n),n})}function n(n,t){return Ml(t.event().target())||e.autofocus&&t.setSource(n.element()),on.none()}var t=Ys(0,e,_g()),r=qs("item-widget",e,t.internals());return{dom:e.dom,components:r,domModification:e.domModification,events:tr([Hi(function(n,t){o(n).each(function(n){t.stop()})}),rr(fo(),um),rr(Eo(),function(n,t){e.autofocus?o(n):bg.focus(n)})]),behaviours:el(e.widgetBehaviours,[nl.config({store:{mode:"memory",initialValue:e.data}}),bg.config({ignore:e.ignoreFocus,onFocus:function(n){am(n)}}),dg.config({mode:"special",focusIn:e.autofocus?function(n){o(n)}:sc(),onLeft:n,onRight:n,onEscape:function(n,t){return bg.isFocused(n)||e.autofocus?(e.autofocus&&t.setSource(n.element()),on.none()):(bg.focus(n),on.some(!0))}})])}})],Fg=it("type",{widget:Mg,item:Bg,separator:Ag}),Ig=nn([kl({factory:{sketch:function(n){var t=ot("menu.spec item",Fg,n);return t.builder(t)}},name:"items",unit:"item",defaults:function(n,t){return t.hasOwnProperty("uid")?t:N(N({},t),{uid:Pr("item")})},overrides:function(n,t){return{type:t.type,ignoreFocus:n.fakeFocus,domModification:{classes:[n.markers.item]}}}})]),Rg=nn([ct("value"),ct("items"),ct("dom"),ct("components"),St("eventOrder",{}),Is("menuBehaviours",[cd,nl,nd,dg]),Ct("movement",{mode:"menu",moveOnTab:!0},it("mode",{grid:[Ya(),Zu("config",function(n,t){return{mode:"flatgrid",selector:"."+n.markers.item,initSize:{numColumns:t.initSize.numColumns,numRows:t.initSize.numRows},focusManager:n.focusManager}})],matrix:[Zu("config",function(n,t){return{mode:"matrix",selectors:{row:t.rowSelector,cell:"."+n.markers.item},focusManager:n.focusManager}}),ct("rowSelector")],menu:[St("moveOnTab",!0),Zu("config",function(n,t){return{mode:"menu",selector:"."+n.markers.item,moveOnTab:t.moveOnTab,focusManager:n.focusManager}})]})),st("markers",Ga()),St("fakeFocus",!1),St("focusManager",Xl()),Ku("onHighlight")]),Vg=nn("alloy.menu-focus"),Ng=_l({name:"Menu",configFields:Rg(),partFields:Ig(),factory:function(n,t,e,o){return{uid:n.uid,dom:n.dom,markers:n.markers,behaviours:Vs(n.menuBehaviours,[cd.config({highlightClass:n.markers.selectedItem,itemClass:n.markers.item,onHighlight:n.onHighlight}),nl.config({store:{mode:"memory",initialValue:n.value}}),nd.config({find:on.some}),dg.config(n.movement.config(n,n.movement))]),events:tr([rr(Dg(),function(t,e){var n=e.event();t.getSystem().getByDom(n.target()).each(function(n){cd.highlight(t,n),e.stop(),qt(t,Vg(),{menu:t,item:n})})}),rr(Eg(),function(n,t){var e=t.event().item();cd.highlight(n,e)})]),components:t,eventOrder:n.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Hg=function(e,o,r,n){return Nn(r,n).bind(function(n){return Nn(e,n).bind(function(n){var t=Hg(e,o,r,n);return on.some([n].concat(t))})}).getOr([])},Pg=function(n){return"prepared"===n.type?on.some(n.menu):on.none()},zg={init:function(){function r(n,e,o){return f(n).bind(function(t){return function(e){return I(i.get(),function(n,t){return n===e})}(n).bind(function(n){return e(n).map(function(n){return{triggeredMenu:t,triggeringItem:n,triggeringPath:o}})})})}var i=Ee({}),u=Ee({}),a=Ee({}),c=Ee(on.none()),s=Ee({}),f=function(n){return t(n).bind(Pg)},t=function(n){return Nn(u.get(),n)},e=function(n){return Nn(i.get(),n)};return{setMenuBuilt:function(n,t){var e;u.set(N(N({},u.get()),((e={})[n]={type:"prepared",menu:t},e)))},setContents:function(n,t,e,o){c.set(on.some(n)),i.set(e),u.set(t),s.set(o);var r=cm(o,e);a.set(r)},expand:function(e){return Nn(i.get(),e).map(function(n){var t=Nn(a.get(),e).getOr([]);return[n].concat(t)})},refresh:function(n){return Nn(a.get(),n)},collapse:function(n){return Nn(a.get(),n).bind(function(n){return 1<n.length?on.some(n.slice(1)):on.none()})},lookupMenu:t,lookupItem:e,otherMenus:function(n){var t=s.get();return _(wn(t),n)},getPrimary:function(){return c.get().bind(f)},getMenus:function(){return u.get()},clear:function(){i.set({}),u.set({}),a.set({}),c.set(on.none())},isClear:function(){return c.get().isNone()},getTriggeringPath:function(n,o){var t=C(e(n).toArray(),function(n){return f(n).isSome()});return Nn(a.get(),n).bind(function(n){var e=A(t.concat(n));return function(n){for(var t=[],e=0;e<n.length;e++){var o=n[e];if(!o.isSome())return on.none();t.push(o.getOrDie())}return on.some(t)}(D(e,function(n,t){return r(n,o,e.slice(0,t+1)).fold(function(){return c.get().is(n)?[]:[on.none()]},function(n){return[on.some(n)]})}))})}}},extractPreparedMenu:Pg},Lg=nn("collapse-item"),jg=Al({name:"TieredMenu",configFields:[Qu("onExecute"),Qu("onEscape"),$u("onOpenMenu"),$u("onOpenSubmenu"),$u("onRepositionMenu"),Ku("onCollapseMenu"),St("highlightImmediately",!0),mt("data",[ct("primary"),ct("menus"),ct("expansions")]),St("fakeFocus",!1),Ku("onHighlight"),Ku("onHover"),Xu(),ct("dom"),St("navigateOnHover",!0),St("stayInDom",!1),Is("tmenuBehaviours",[dg,cd,nd,gg]),St("eventOrder",{})],apis:{collapseMenu:function(n,t){n.collapseMenu(t)},highlightPrimary:function(n,t){n.highlightPrimary(t)},repositionMenus:function(n,t){n.repositionMenus(t)}},factory:function(a,n){function e(n){var t=function(o,r,n){return P(n,function(n,t){function e(){return Ng.sketch(N(N({dom:n.dom},n),{value:t,items:n.items,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:a.fakeFocus?Yl():Xl()}))}return t===r?{type:"prepared",menu:o.getSystem().build(e())}:{type:"notbuilt",nbMenu:e}})}(n,a.data.primary,a.data.menus),e=o();return g.setContents(a.data.primary,t,a.data.expansions,e),g.getPrimary()}function c(n){return nl.getValue(n).value}function u(t,n){cd.highlight(t,n),cd.getHighlighted(n).orThunk(function(){return cd.getFirst(n)}).each(function(n){Jt(t,n.element(),Eo())})}function s(t,n){return Bu(S(n,function(n){return t.lookupMenu(n).bind(function(n){return"prepared"===n.type?on.some(n.menu):on.none()})}))}function f(t,n,e){var o=s(n,n.otherMenus(e));bn(o,function(n){ai(n.element(),[a.markers.backgroundMenu]),a.stayInDom||gg.remove(t,n)})}function l(n,o){var t=function(o){return r.get().getOrThunk(function(){var e={},n=Lc(o.element(),"."+a.markers.item),t=C(n,function(n){return"true"===Mr(n,"aria-haspopup")});return bn(t,function(n){o.getSystem().getByDom(n).each(function(n){var t=c(n);e[t]=n})}),r.set(on.some(e)),e})}(n);Cn(t,function(n,t){var e=vn(o,t);_r(n.element(),"aria-expanded",e)})}function d(o,r,i){return on.from(i[0]).bind(function(n){return r.lookupMenu(n).bind(function(n){if("notbuilt"===n.type)return on.none();var t=n.menu,e=s(r,i.slice(1));return bn(e,function(n){ei(n.element(),a.markers.backgroundMenu)}),$o(t.element())||gg.append(o,cu(t)),ai(t.element(),[a.markers.backgroundMenu]),u(o,t),f(o,r,i),on.some(t)})})}var m,t,r=Ee(on.none()),g=zg.init(),o=function(n){return P(a.data.menus,function(n,t){return D(n.items,function(n){return"separator"===n.type?[]:[n.data.value]})})};(t=m=m||{})[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent";function i(r,i,u){void 0===u&&(u=m.HighlightSubmenu);var n=c(i);return g.expand(n).bind(function(o){return l(r,o),on.from(o[0]).bind(function(e){return g.lookupMenu(e).bind(function(n){var t=function(n,t,e){if("notbuilt"!==e.type)return e.menu;var o=n.getSystem().build(e.nbMenu());return g.setMenuBuilt(t,o),o}(r,e,n);return $o(t.element())||gg.append(r,cu(t)),a.onOpenSubmenu(r,i,t,A(o)),u===m.HighlightSubmenu?(cd.highlightFirst(t),d(r,g,o)):(cd.dehighlightAll(t),on.some(i))})})})}function p(t,e){var n=c(e);return g.collapse(n).bind(function(n){return l(t,n),d(t,g,n).map(function(n){return a.onCollapseMenu(t,e,n),n})})}function h(e){return function(t,n){return Tu(n.getSource(),"."+a.markers.item).bind(function(n){return t.getSystem().getByDom(n).toOption().bind(function(n){return e(t,n).map(function(){return!0})})})}}function v(n){return cd.getHighlighted(n).bind(cd.getHighlighted)}var b=tr([rr(Vg(),function(e,o){var n=o.event().item();g.lookupItem(c(n)).each(function(){var n=o.event().menu();cd.highlight(e,n);var t=c(o.event().item());g.refresh(t).each(function(n){return f(e,g,n)})})}),Hi(function(t,n){var e=n.event().target();t.getSystem().getByDom(e).each(function(n){0===c(n).indexOf("collapse-item")&&p(t,n),i(t,n,m.HighlightSubmenu).fold(function(){a.onExecute(t,n)},function(){})})}),Ri(function(t,n){e(t).each(function(n){gg.append(t,cu(n)),a.onOpenMenu(t,n),a.highlightImmediately&&u(t,n)})})].concat(a.navigateOnHover?[rr(Eg(),function(n,t){var e=t.event().item();!function(t,n){var e=c(n);g.refresh(e).bind(function(n){return l(t,n),d(t,g,n)})}(n,e),i(n,e,m.HighlightParent),a.onHover(n,e)})]:[])),y={collapseMenu:function(t){v(t).each(function(n){p(t,n)})},highlightPrimary:function(t){g.getPrimary().each(function(n){u(t,n)})},repositionMenus:function(o){g.getPrimary().bind(function(t){return v(o).bind(function(n){var t=c(n),e=R(g.getMenus()),o=Bu(S(e,zg.extractPreparedMenu));return g.getTriggeringPath(t,function(n){return function(n,t,e){return Au(t,function(n){if(!n.getSystem().isConnected())return on.none();var t=cd.getCandidates(n);return T(t,function(n){return c(n)===e})})}(0,o,n)})}).map(function(n){return{primary:t,triggeringPath:n}})}).fold(function(){(function(n){return on.from(n.components()[0]).filter(function(n){return"menu"===Mr(n.element(),"role")})})(o).each(function(n){a.onRepositionMenu(o,n,[])})},function(n){var t=n.primary,e=n.triggeringPath;a.onRepositionMenu(o,t,e)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:Vs(a.tmenuBehaviours,[dg.config({mode:"special",onRight:h(function(n,t){return Ml(t.element())?on.none():i(n,t,m.HighlightSubmenu)}),onLeft:h(function(n,t){return Ml(t.element())?on.none():p(n,t)}),onEscape:h(function(n,t){return p(n,t).orThunk(function(){return a.onEscape(n,t).map(function(){return n})})}),focusIn:function(t,n){g.getPrimary().each(function(n){Jt(t,n.element(),Eo())})}}),cd.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),nd.config({find:function(n){return cd.getHighlighted(n)}}),gg.config({})]),eventOrder:a.eventOrder,apis:y,events:b}},extraApis:{tieredData:function(n,t,e){return{primary:n,menus:t,expansions:e}},singleData:function(n,t){return{primary:n,menus:q(n,t),expansions:{}}},collapseItem:function(n){return{value:Hr(Lg()),meta:{text:n}}}}}),Ug=Al({name:"InlineView",configFields:[ct("lazySink"),Ku("onShow"),Ku("onHide"),xt("onEscape"),Is("inlineBehaviours",[Lf,nl,dc]),wt("fireDismissalEventInstead",[St("event",Po())]),wt("fireRepositionEventInstead",[St("event",zo())]),St("getRelated",on.none),St("eventOrder",on.none)],factory:function(i,n){function t(e){Lf.isOpen(e)&&nl.getValue(e).each(function(n){switch(n.mode){case"menu":Lf.getState(e).each(function(n){jg.repositionMenus(n)});break;case"position":var t=i.lazySink(e).getOrDie();_f.positionWithinBounds(t,n.anchor,e,n.getBounds())}})}var o=function(n,t,e,o){r(n,t,e,function(){return o.map(function(n){return wu(n)})})},r=function(n,t,e,o){var r=i.lazySink(n).getOrDie();Lf.openWhileCloaked(n,e,function(){return _f.positionWithinBounds(r,t,n,o())}),nl.setValue(n,on.some({mode:"position",anchor:t,getBounds:o}))},u=function(n,t,e,o){var r=function(n,t,r,e,i){function u(){return n.lazySink(t)}function a(n){return function(n){return 2===n.length}(n)?o:{}}var o="horizontal"===e.type?{layouts:{onLtr:function(){return ma()},onRtl:function(){return ga()}}}:{};return jg.sketch({dom:{tag:"div"},data:e.data,markers:e.menu.markers,onEscape:function(){return Lf.close(t),n.onEscape.map(function(n){return n(t)}),on.some(!0)},onExecute:function(){return on.some(!0)},onOpenMenu:function(n,t){_f.positionWithinBounds(u().getOrDie(),r,t,i())},onOpenSubmenu:function(n,t,e,o){var r=u().getOrDie();_f.position(r,N({anchor:"submenu",item:t},a(o)),e)},onRepositionMenu:function(n,t,e){var o=u().getOrDie();_f.positionWithinBounds(o,r,t,i()),bn(e,function(n){var t=a(n.triggeringPath);_f.position(o,N({anchor:"submenu",item:n.triggeringItem},t),n.triggeredMenu)})}})}(i,n,t,e,o);Lf.open(n,r),nl.setValue(n,on.some({mode:"menu",menu:r}))},e={setContent:function(n,t){Lf.setContent(n,t)},showAt:function(n,t,e){o(n,t,e,on.none())},showWithin:o,showWithinBounds:r,showMenuAt:function(n,t,e){u(n,t,e,function(){return on.none()})},showMenuWithinBounds:u,hide:function(n){nl.setValue(n,on.none()),Lf.close(n)},getContent:function(n){return Lf.getState(n)},reposition:t,isOpen:Lf.isOpen};return{uid:i.uid,dom:i.dom,behaviours:Vs(i.inlineBehaviours,[Lf.config({isPartOf:function(n,t,e){return ju(t,e)||function(n,t){return i.getRelated(n).exists(function(n){return ju(n,t)})}(n,e)},getAttachPoint:function(n){return i.lazySink(n).getOrDie()},onOpen:function(n){i.onShow(n)},onClose:function(n){i.onHide(n)}}),nl.config({store:{mode:"memory",initialValue:on.none()}}),dc.config({channels:N(N({},Es(N({isExtraPart:nn(!1)},i.fireDismissalEventInstead.map(function(n){return{fireEventInstead:{event:n.event}}}).getOr({})))),Ds(N(N({isExtraPart:nn(!1)},i.fireRepositionEventInstead.map(function(n){return{fireEventInstead:{event:n.event}}}).getOr({})),{doReposition:t})))})]),eventOrder:i.eventOrder,apis:e}},apis:{showAt:function(n,t,e,o){n.showAt(t,e,o)},showWithin:function(n,t,e,o,r){n.showWithin(t,e,o,r)},showWithinBounds:function(n,t,e,o,r){n.showWithinBounds(t,e,o,r)},showMenuAt:function(n,t,e,o){n.showMenuAt(t,e,o)},showMenuWithinBounds:function(n,t,e,o,r){n.showMenuWithinBounds(t,e,o,r)},hide:function(n,t){n.hide(t)},isOpen:function(n,t){return n.isOpen(t)},getContent:function(n,t){return n.getContent(t)},setContent:function(n,t,e){n.setContent(t,e)},reposition:function(n,t){n.reposition(t)}}}),Wg=function(n,t,e){return qa(fm(n,t),dm(n),e.innerNorth(),tc(),"layout-n")},Gg=function(n,t,e){return qa(fm(n,t),mm(n,t),e.innerSouth(),nc(),"layout-s")},Xg=Al({name:"Button",factory:function(n){function e(t){return Nn(n.dom,"attributes").bind(function(n){return Nn(n,t)})}var t=im(n.action),o=n.dom.tag;return{uid:n.uid,dom:n.dom,components:n.components,events:t,behaviours:el(n.buttonBehaviours,[bg.config({}),dg.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==o)return{role:e("role").getOr("button")};var n=e("type").getOr("button"),t=e("role").map(function(n){return{role:n}}).getOr({});return N({type:n},t)}()},eventOrder:n.eventOrder}},configFields:[St("uid",undefined),ct("dom"),St("components",[]),tl("buttonBehaviours",[bg,dg]),ht("action"),ht("role"),St("eventOrder",{})]}),Yg={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},qg=Al({name:"Notification",factory:function(t){function e(n){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+n+"%"}}}}function o(n){return{dom:{tag:"div",classes:["tox-text"],innerHtml:n+"%"}}}var r=bm({dom:{tag:"p",innerHtml:t.translationProvider(t.text)},behaviours:ya([gg.config({})])}),i=bm({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[e(0)]},o(0)],behaviours:ya([gg.config({})])}),n={updateProgress:function(n,t){n.getSystem().isConnected()&&i.getOpt(n).each(function(n){gg.set(n,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[e(t)]},o(t)])})},updateText:function(n,t){if(n.getSystem().isConnected()){var e=r.get(n);gg.set(e,[Ti(t)])}}},u=H([t.icon.toArray(),t.level.toArray(),t.level.bind(function(n){return on.from(Yg[n])}).toArray()]);return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert"},classes:t.level.map(function(n){return["tox-notification","tox-notification--in","tox-notification--"+n]}).getOr(["tox-notification","tox-notification--in"])},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:function(n,t){return Au(n,function(n){return on.from(t()[n])}).getOrThunk(function(){return ym(t)})}(u,t.iconProvider)}},{dom:{tag:"div",classes:["tox-notification__body"]},components:[r.asSpec()],behaviours:ya([gg.config({})])}].concat(t.progress?[i.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:xm("close",t.iconProvider),attributes:{"aria-label":t.translationProvider("Close")}}}],action:function(n){t.onAction(n)}})),apis:n}},configFields:[ht("level"),ct("progress"),ct("icon"),ct("onAction"),ct("text"),ct("iconProvider"),ct("translationProvider")],apis:{updateProgress:function(n,t,e){n.updateProgress(t,e)},updateText:function(n,t,e){n.updateText(t,e)}}}),Kg=tinymce.util.Tools.resolve("tinymce.util.Delay");function Jg(n,u,o){var a=u.backstage;return{open:function(n,t){function e(){t(),Ug.hide(i)}var r=au(qg.sketch({text:n.text,level:vn(["success","error","warning","warn","info"],n.type)?n.type:undefined,progress:!0===n.progressBar,icon:on.from(n.icon),onAction:e,iconProvider:a.shared.providers.icons,translationProvider:a.shared.providers.translate})),i=au(Ug.sketch({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:u.backstage.shared.getSink,fireDismissalEventInstead:{}}));return o.add(i),0<n.timeout&&Kg.setTimeout(function(){e()},n.timeout),{close:e,moveTo:function(n,t){Ug.showAt(i,{anchor:"makeshift",x:n,y:t},cu(r))},moveRel:function(n,t){if("banner"!==t){var e=function(n){switch(n){case"bc-bc":return Gg;case"tc-tc":return Wg;case"tc-bc":return rc;case"bc-tc":default:return ic}}(t),o={anchor:"node",root:Mi(),node:on.some(Be.fromDom(n)),layouts:{onRtl:function(){return[e]},onLtr:function(){return[e]}}};Ug.showAt(i,o,cu(r))}else Ug.showAt(i,u.backstage.shared.anchors.banner(),cu(r))},text:function(n){qg.updateText(r,n)},settings:n,getEl:function(){return r.element().dom()},progressBar:{value:function(n){qg.updateProgress(r,n)}}}},close:function(n){n.close()},reposition:function(n){!function(n){bn(n,function(n){return n.moveTo(0,0)})}(n),function(e){0<e.length&&(yn(e).each(function(n){return n.moveRel(null,"banner")}),bn(e,function(n,t){0<t&&n.moveRel(e[t-1].getEl(),"bc-tc")}))}(n)},getArgs:function(n){return n.settings}}}function $g(e,o){var r=null;return{cancel:function(){null!==r&&(v.clearTimeout(r),r=null)},throttle:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];null!==r&&v.clearTimeout(r),r=v.setTimeout(function(){e.apply(null,n),r=null},o)}}}function Qg(n,t,e,o,r){var i=new _p(t,r||n.getRoot());return Ip(n,t,on.some(e),o,i.prev,on.none())}function Zg(t,e){return Rp(Be.fromDom(t.selection.getNode())).getOrThunk(function(){var n=Be.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',t.getDoc());return Pi(n,Be.fromDom(e.extractContents())),e.insertNode(n.dom()),br(n).each(function(n){return n.dom().normalize()}),Rc(n).map(function(n){t.selection.setCursorLocation(n.dom(),function(n){return"img"===Ko(n)?1:_c(n).fold(function(){return xr(n).length},function(n){return n.length})}(n))}),n})}function np(n,t){return n.toString().substring(t.length).replace(/\u00A0/g," ").replace(/\uFEFF/g,"")}function tp(n,u,a,c){return void 0===c&&(c=0),function(n){return n.collapsed&&3===n.startContainer.nodeType}(u)?Qg(n,u.startContainer,u.startOffset,function(e,o,r,n){var i=n.getOr(r.length);return function(n,t,e,o){var r;for(r=t-1;0<=r;r--){var i=n.charAt(r);if(Vp.test(i))return on.none();if(i===e)break}return-1===r||t-r<o?on.none():on.some(n.substring(r+1,t))}(r,i,a,1).fold(function(){return r.match(Vp)?e.abort():e.kontinue()},function(n){var t=u.cloneRange();return t.setStart(o,i-n.length-1),t.setEnd(u.endContainer,u.endOffset),r.length<c?e.abort():e.finish({text:np(t,a),range:t,triggerChar:a})})}).fold(on.none,on.none,on.some):on.none()}function ep(e,n,o,t){return void 0===t&&(t=0),Rp(Be.fromDom(n.startContainer)).fold(function(){return tp(e,n,o,t)},function(n){var t=e.createRng();return t.selectNode(n.dom()),on.some({range:t,text:np(t,o),triggerChar:o})})}function op(n,t){return{element:n,offset:t}}function rp(t,e){var n=e(),o=t.selection.getRng();return function(t,e,n){return Au(n.triggerChars,function(n){return ep(t,e,n)})}(t.dom,o,n).bind(function(n){return Lp(t,e,n)})}function ip(n){var t=n.ui.registry.getAll().popups,e=P(t,function(n){return function(n){return tt("Autocompleter",Wp,n)}(n).fold(function(n){throw new Error(ye(n))},function(n){return n})}),o=function(n){var t={};return bn(n,function(n){t[n]={}}),wn(t)}(On(e,function(n){return n.ch})),r=R(e);return{dataset:e,triggerChars:o,lookupByChar:function(t){return C(r,function(n){return n.ch===t})}}}function up(n,o,t){var r=Lc(n.element(),"."+t);if(0<r.length){var e=E(r,function(n){var t=n.dom().getBoundingClientRect().top,e=r[0].dom().getBoundingClientRect().top;return Math.abs(t-e)>o}).getOr(r.length);return on.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return on.none()}function ap(n,t){return ya([Jd(n,t)])}function cp(n,t,e){n.getSystem().broadcastOn([nh],{})}function sp(n){var t=Be.fromHtml(n),e=xr(t),o=function(n){var t=n.dom().attributes!==undefined?n.dom().attributes:[];return O(t,function(n,t){var e;return"class"===t.name?n:N(N({},n),((e={})[t.name]=t.value,e))},{})}(t),r=function(n){return Array.prototype.slice.call(n.dom().classList,0)}(t),i=0===e.length?{}:{innerHtml:Dr(t)};return N({tag:Ko(t),classes:r,attributes:o},i)}function fp(n){return Nn(sh,n).getOr(uh)}function lp(n){return{dom:{tag:"div",classes:[lh],innerHtml:n}}}function dp(n){return{dom:{tag:"div",classes:[dh]},components:[Ti(ih.translate(n))]}}function mp(n,t){return{dom:{tag:"div",classes:[dh]},components:[{dom:{tag:n.tag,attributes:{style:n.styleAttr}},components:[Ti(ih.translate(t))]}]}}function gp(n){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:hh(n)}}}function pp(n){return{dom:{tag:"div",classes:[lh,"tox-collection__item-checkmark"],innerHtml:xm("checkmark",n)}}}function hp(n,t,e,o,r){var i=e?n.checkMark.orThunk(function(){return t.or(on.some("")).map(lp)}):on.none(),u=n.ariaLabel.map(function(n){return{attributes:{title:ih.translate(n)}}}).getOr({});return{dom:An({tag:"div",classes:[uh,ah].concat(r?["tox-collection__item-icon-rtl"]:[])},u),optComponents:[i,n.htmlContent.fold(function(){return n.textContent.map(o)},function(n){return on.some(function(n){return{dom:{tag:"div",classes:[dh],innerHtml:n}}}(n))}),n.shortcutContent.map(gp),n.caret]}}function vp(n,t,e,o){void 0===o&&(o=on.none());var r=ih.isRtl()&&n.iconContent.exists(function(n){return vn(bh,n)}),i=n.iconContent.map(function(n){return ih.isRtl()&&vn(vh,n)?n+"-rtl":n}).map(function(n){return function(n,t,e){return on.from(t()[n]).or(e).getOrThunk(function(){return ym(t)})}(n,t.icons,o)}),u=on.from(n.meta).fold(function(){return dp},function(n){return Tn(n,"style")?d(mp,n.style):dp});return"color"===n.presets?function(n,t,e,o){var r,i,u;return{dom:(r=ch,i=e.getOr(""),u=n.map(function(n){return' title="'+o.translate(n)+'"'}).getOr(""),sp("custom"===t?'<button class="'+r+' tox-swatches__picker-btn"'+u+">"+i+"</button>":"remove"===t?'<div class="'+r+' tox-swatch--remove"'+u+">"+i+"</div>":'<div class="'+r+'" style="background-color: '+t+'" data-mce-color="'+t+'"'+u+"></div>")),optComponents:[]}}(n.ariaLabel,n.value,i,t):hp(n,i,e,u,r)}function bp(n,t,e){t.disabled&&xh(n,t)}function yp(n,t){return!0===t.useNative&&vn(yh,Ko(n.element()))}function xp(n){_r(n.element(),"disabled","disabled")}function wp(n){Ir(n.element(),"disabled")}function Sp(n){_r(n.element(),"aria-disabled","true")}function Cp(n){_r(n.element(),"aria-disabled","false")}function kp(t,n,e){n.disableClass.each(function(n){ri(t.element(),n)}),(yp(t,n)?wp:Cp)(t),n.onEnabled(t)}function Op(n,t){return yp(n,t)?function(n){return Fr(n.element(),"disabled")}(n):function(n){return"true"===Mr(n.element(),"aria-disabled")}(n)}function Tp(n,t){var e=n.getApi(t);return function(n){n(e)}}function Ep(e,o){return Ri(function(n){Tp(e,n)(function(n){var t=e.onSetup(n);null!==t&&t!==undefined&&o.set(t)})})}function Dp(t,e){return Vi(function(n){return Tp(t,n)(e.get())})}var Bp,Ap,_p=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),Mp=En([{aborted:[]},{edge:["element"]},{success:["info"]}]),Fp=En([{abort:[]},{kontinue:[]},{finish:["info"]}]),Ip=function(t,e,n,o,r,i){function u(){return i.fold(Mp.aborted,Mp.edge)}function a(){var n=r();return n?Ip(t,n,on.none(),o,r,on.some(e)):u()}if(function(n,t){return n.isBlock(t)||vn(["BR","IMG","HR","INPUT"],t.nodeName)||"false"===n.getContentEditable(t)}(t,e))return u();if(function(n){return n.nodeType===v.Node.TEXT_NODE}(e)){var c=e.textContent;return o(Fp,e,c,n).fold(Mp.aborted,function(){return a()},Mp.success)}return a()},Rp=function(n){return Tu(n,"[data-mce-autocompleter]")},Vp=/[\u00a0 \t\r\n]/,Np=function(e,n){n.on("keypress compositionend",e.onKeypress.throttle),n.on("remove",e.onKeypress.cancel);function o(n,t){qt(n,go(),{raw:t})}n.on("keydown",function(t){function n(){return e.getView().bind(cd.getHighlighted)}8===t.which&&e.onKeypress.throttle(t),e.isActive()&&(27===t.which&&e.cancelIfNecessary(),e.isMenuOpen()?13===t.which?(n().each(Kt),t.preventDefault()):40===t.which?(n().fold(function(){e.getView().each(cd.highlightFirst)},function(n){o(n,t)}),t.preventDefault(),t.stopImmediatePropagation()):37!==t.which&&38!==t.which&&39!==t.which||n().each(function(n){o(n,t),t.preventDefault(),t.stopImmediatePropagation()}):13!==t.which&&38!==t.which&&40!==t.which||e.cancelIfNecessary())}),n.on("NodeChange",function(n){e.isActive()&&!e.isProcessingAction()&&Rp(Be.fromDom(n.element)).isNone()&&e.cancelIfNecessary()})},Hp=tinymce.util.Tools.resolve("tinymce.util.Promise"),Pp=function(n){if(function(n){return n.nodeType===v.Node.TEXT_NODE}(n))return op(n,n.data.length);var t=n.childNodes;return 0<t.length?Pp(t[t.length-1]):op(n,t.length)},zp=function(n,t){var e=n.childNodes;return 0<e.length&&t<e.length?zp(e[t],0):0<e.length&&function(n){return n.nodeType===v.Node.ELEMENT_NODE}(n)&&e.length===t?Pp(e[e.length-1]):op(n,t)},Lp=function(t,n,e,o){void 0===o&&(o={});var r=n(),i=t.selection.getRng().startContainer.nodeValue,u=C(r.lookupByChar(e.triggerChar),function(n){return e.text.length>=n.minChars&&n.matches.getOrThunk(function(){return function(e){function o(n,t,e,o){var r=o.getOr(e.length);return 0===r?n.kontinue():n.finish(/\s/.test(e.charAt(r-1)))}return function(n){var t=zp(n.startContainer,n.startOffset);return Qg(e,t.element,t.offset,o).fold(nn(!0),nn(!0),l)}}(t.dom)})(e.range,i,e.text)});if(0===u.length)return on.none();var a=Hp.all(S(u,function(t){return t.fetch(e.text,t.maxResults,o).then(function(n){return{matchText:e.text,items:n,columns:t.columns,onAction:t.onAction}})}));return on.some({lookupData:a,context:e})},jp=de([ft("type"),yt("text")]),Up=de([At("type",function(){return"autocompleteitem"}),At("active",function(){return!1}),At("disabled",function(){return!1}),St("meta",{}),ft("value"),yt("text"),yt("icon")]),Wp=de([ft("type"),ft("ch"),kt("minChars",1),St("columns",1),kt("maxResults",10),xt("matches"),dt("fetch"),dt("onAction")]),Gp=[Et("disabled",!1),yt("text"),yt("shortcut"),he("value","value",In(function(){return Hr("menuitem-value")}),xe()),St("meta",{})],Xp=de([ft("type"),Dt("onSetup",function(){return Z}),Dt("onAction",Z),yt("icon")].concat(Gp)),Yp=de([ft("type"),dt("getSubmenuItems"),Dt("onSetup",function(){return Z}),yt("icon")].concat(Gp)),qp=de([ft("type"),Et("active",!1),Dt("onSetup",function(){return Z}),dt("onAction")].concat(Gp)),Kp=de([ft("type"),Et("active",!1),yt("icon")].concat(Gp)),Jp=de([ft("type"),lt("fancytype",["inserttable","colorswatch"]),Dt("onAction",Z)]),$p=function(n){return ap(Hr("unnamed-events"),n)},Qp=[ct("lazySink"),ct("tooltipDom"),St("exclusive",!0),St("tooltipComponents",[]),St("delay",300),Tt("mode","normal",["normal","follow-highlight"]),St("anchor",function(n){return{anchor:"hotspot",hotspot:n,layouts:{onLtr:nn([ic,rc,aa,sa,ca,fa]),onRtl:nn([ic,rc,aa,sa,ca,fa])}}}),Ku("onHide"),Ku("onShow")],Zp=/* */Object.freeze({init:function(){function e(){o.get().each(function(n){v.clearTimeout(n)})}var o=Ee(on.none()),t=Ee(on.none()),n=nn("not-implemented");return tu({getTooltip:function(){return t.get()},isShowing:function(){return t.get().isSome()},setTooltip:function(n){t.set(on.some(n))},clearTooltip:function(){t.set(on.none())},clearTimer:e,resetTimer:function(n,t){e(),o.set(on.some(v.setTimeout(function(){n()},t)))},readState:n})}}),nh=Hr("tooltip.exclusive"),th=Hr("tooltip.show"),eh=Hr("tooltip.hide"),oh=/* */Object.freeze({hideAllExclusive:cp,setComponents:function(n,t,e,o){e.getTooltip().each(function(n){n.getSystem().isConnected()&&gg.set(n,o)})}}),rh=xa({fields:Qp,name:"tooltipping",active:/* */Object.freeze({events:function(o,r){function e(t){r.getTooltip().each(function(n){ys(n),o.onHide(t,n),r.clearTooltip()}),r.clearTimer()}return tr(H([[rr(th,function(n){r.resetTimer(function(){!function(t){if(!r.isShowing()){cp(t);var n=o.lazySink(t).getOrDie(),e=t.getSystem().build({dom:o.tooltipDom,components:o.tooltipComponents,events:tr("normal"===o.mode?[rr(fo(),function(n){Yt(t,th)}),rr(co(),function(n){Yt(t,eh)})]:[]),behaviours:ya([gg.config({})])});r.setTooltip(e),vs(n,e),o.onShow(t,e),_f.position(n,o.anchor(t),e)}}(n)},o.delay)}),rr(eh,function(n){r.resetTimer(function(){e(n)},o.delay)}),rr(Oo(),function(n,t){vn(t.channels(),nh)&&e(n)}),Vi(function(n){e(n)})],"normal"===o.mode?[rr(lo(),function(n){Yt(n,th)}),rr(Co(),function(n){Yt(n,eh)}),rr(fo(),function(n){Yt(n,th)}),rr(co(),function(n){Yt(n,eh)})]:[rr(Go(),function(n,t){Yt(n,th)}),rr(Xo(),function(n){Yt(n,eh)})]]))}}),state:Zp,apis:oh}),ih=tinymce.util.Tools.resolve("tinymce.util.I18n"),uh="tox-menu-nav__js",ah="tox-collection__item",ch="tox-swatch",sh={normal:uh,color:ch},fh="tox-collection__item--enabled",lh="tox-collection__item-icon",dh="tox-collection__item-label",mh="tox-collection__item-caret",gh="tox-collection__item--active",ph=tinymce.util.Tools.resolve("tinymce.Env"),hh=function(n){var e=ph.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},t=n.split("+"),o=S(t,function(n){var t=n.toLowerCase().trim();return Tn(e,t)?e[t]:n});return ph.mac?o.join(""):o.join("+")},vh=["list-num-default","list-num-lower-alpha","list-num-lower-greek","list-num-lower-roman","list-num-upper-alpha","list-num-upper-roman"],bh=["list-bull-circle","list-bull-default","list-bull-square"],yh=["input","button","textarea","select"],xh=function(t,n,e){n.disableClass.each(function(n){ei(t.element(),n)}),(yp(t,n)?xp:Sp)(t),n.onDisabled(t)},wh=/* */Object.freeze({enable:kp,disable:xh,isDisabled:Op,onLoad:bp,set:function(n,t,e,o){(o?xh:kp)(n,t,e)}}),Sh=/* */Object.freeze({exhibit:function(n,t,e){return Gr({classes:t.disabled?t.disableClass.map(M).getOr([]):[]})},events:function(e,n){return tr([er(To(),function(n,t){return Op(n,e)}),pa(e,n,bp)])}}),Ch=[St("disabled",!1),St("useNative",!0),ht("disableClass"),Ku("onDisabled"),Ku("onEnabled")],kh=xa({fields:Ch,name:"disabling",active:Sh,apis:wh}),Oh=function(n){return kh.config({disabled:n,disableClass:"tox-collection__item--state-disabled"})},Th=function(n){return kh.config({disabled:n})},Eh=function(n){return kh.config({disabled:n,disableClass:"tox-tbtn--disabled"})},Dh=function(n){return kh.config({disabled:n,disableClass:"tox-tbtn--disabled",useNative:!1})};(Ap=Bp=Bp||{})[Ap.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",Ap[Ap.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";function Bh(n){return D(n,function(n){return n.toArray()})}function Ah(n,t,e){var o=Ee(Z);return{type:"item",dom:t.dom,components:Bh(t.optComponents),data:n.data,eventOrder:Rh,hasSubmenu:n.triggersSubmenu,itemBehaviours:ya([Jd("item-events",[function(e,o){return Hi(function(n,t){Tp(e,n)(e.onAction),e.triggersSubmenu||o!==Ih.CLOSE_ON_EXECUTE||(Yt(n,Ao()),t.stop())})}(n,e),Ep(n,o),Dp(n,o)]),Oh(n.disabled),gg.config({})].concat(n.itemBehaviours))}}function _h(n){return{value:n.value,meta:An({text:n.text.getOr("")},n.meta)}}function Mh(n,t){var e=function(n){return Vh.DOM.encode(n)}(ih.translate(n));if(0<t.length){var o=new RegExp(function(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(t),"gi");return e.replace(o,function(n){return'<span class="tox-autocompleter-highlight">'+n+"</span>"})}return e}function Fh(t,e,n){function o(n){return qt(n,Ph,{row:t,col:e})}var r;return au({dom:{tag:"div",attributes:(r={role:"button"},r["aria-labelledby"]=n,r)},behaviours:ya([Jd("insert-table-picker-cell",[rr(fo(),bg.focus),rr(To(),o),rr(Xt(),function(n,t){t.stop(),o(n)})]),kg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),bg.config({onFocus:function(n){return qt(n,Hh,{row:t,col:e})}})])})}var Ih=Bp,Rh={"alloy.execute":["disabling","alloy.base.behaviour","toggling","item-events"]},Vh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Nh=nn(Us("item-widget",_g())),Hh=Hr("cell-over"),Ph=Hr("cell-execute");function zh(n){return{value:nn(n)}}function Lh(n){return $h.test(n)||Qh.test(n)}function jh(n){var t=function(n){var t=n.value().replace($h,function(n,t,e,o){return t+t+e+e+o+o});return{value:nn(t)}}(n),e=Qh.exec(t.value());return null===e?["FFFFFF","FF","FF","FF"]:e}function Uh(n){var t=n.toString(16);return 1===t.length?"0"+t:t}function Wh(n){var t=Uh(n.red())+Uh(n.green())+Uh(n.blue());return zh(t)}function Gh(n,t,e,o){return{red:nn(n),green:nn(t),blue:nn(e),alpha:nn(o)}}function Xh(n){var t=parseInt(n,10);return t.toString()===n&&0<=t&&t<=255}function Yh(n){var t,e,o,r=(n.hue()||0)%360,i=n.saturation()/100,u=n.value()/100;if(i=nv(0,Zh(i,1)),u=nv(0,Zh(u,1)),0===i)return t=e=o=tv(255*u),Gh(t,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),f=u-c;switch(Math.floor(a)){case 0:t=c,e=s,o=0;break;case 1:t=s,e=c,o=0;break;case 2:t=0,e=c,o=s;break;case 3:t=0,e=s,o=c;break;case 4:t=s,e=0,o=c;break;case 5:t=c,e=0,o=s;break;default:t=e=o=0}return t=tv(255*(t+f)),e=tv(255*(e+f)),o=tv(255*(o+f)),Gh(t,e,o,1)}function qh(n){var t=jh(n),e=parseInt(t[1],16),o=parseInt(t[2],16),r=parseInt(t[3],16);return Gh(e,o,r,1)}function Kh(n,t,e,o){var r=parseInt(n,10),i=parseInt(t,10),u=parseInt(e,10),a=parseFloat(o);return Gh(r,i,u,a)}function Jh(n){return"rgba("+n.red()+","+n.green()+","+n.blue()+","+n.alpha()+")"}var $h=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Qh=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Zh=Math.min,nv=Math.max,tv=Math.round,ev=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,ov=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,rv=nn(Gh(255,0,0,1)),iv=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),uv="tinymce-custom-colors";function av(n){var t=[],u=v.document.createElement("canvas");u.height=1,u.width=1;for(var a=u.getContext("2d"),c=function(n,t){var e=t/255;return("0"+Math.round(n*e+255*(1-e)).toString(16)).slice(-2).toUpperCase()},e=function(n){if(/^[0-9A-Fa-f]{6}$/.test(n))return"#"+n.toUpperCase();a.clearRect(0,0,u.width,u.height),a.fillStyle="#FFFFFF",a.fillStyle=n,a.fillRect(0,0,1,1);var t=a.getImageData(0,0,1,1).data,e=t[0],o=t[1],r=t[2],i=t[3];return"#"+c(e,i)+c(o,i)+c(r,i)},o=0;o<n.length;o+=2)t.push({text:n[o+1],value:e(n[o]),type:"choiceitem"});return t}function cv(n){return n.getParam("color_map")}function sv(n,e){var o;return n.dom.getParents(n.selection.getStart(),function(n){var t;(t=n.style["forecolor"===e?"color":"background-color"])&&(o=o||t)}),o}function fv(n){return Math.max(5,Math.ceil(Math.sqrt(n)))}function lv(n){var t=Rv(n),e=fv(t.length);return Fv(n,e)}function dv(t,e,n,o){"custom"===n?Uv(t)(function(n){n.each(function(n){Nv(n),t.execCommand("mceApplyTextcolor",e,n),o(n)})},"#000000"):"remove"===n?(o(""),t.execCommand("mceRemoveTextcolor",e)):(o(n),t.execCommand("mceApplyTextcolor",e,n))}function mv(n,t){return n.concat(Vv().concat(function(n){var t="choiceitem",e={type:t,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return n?[e,{type:t,text:"Custom color",icon:"color-picker",value:"custom"}]:[e]}(t)))}function gv(t,e){return function(n){n(mv(t,e))}}function pv(n,t,e){var o,r;o="forecolor"===t?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",r=e,n.setIconFill(o,r),n.setIconStroke(o,r)}function hv(o,e,r,n,i){o.ui.registry.addSplitButton(e,{tooltip:n,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){return on.from(sv(o,r)).bind(function(n){return function(n){if("transparent"===n)return on.some(Gh(0,0,0,0));var t=ev.exec(n);if(null!==t)return on.some(Kh(t[1],t[2],t[3],"1"));var e=ov.exec(n);return null!==e?on.some(Kh(e[1],e[2],e[3],e[4])):on.none()}(n).map(function(n){var t=Wh(n).value();return Vt(e.toLowerCase(),t)})}).getOr(!1)},columns:lv(o),fetch:gv(Rv(o),Iv(o)),onAction:function(n){null!==i.get()&&dv(o,r,i.get(),function(){})},onItemAction:function(n,t){dv(o,r,t,function(n){i.set(n),jv(o,{name:e,color:n})})},onSetup:function(t){null!==i.get()&&pv(t,e,i.get());function n(n){n.name===e&&pv(t,n.name,n.color)}return o.on("TextColorChange",n),function(){o.off("TextColorChange",n)}}})}function vv(t,n,e,o){t.ui.registry.addNestedMenuItem(n,{text:o,icon:"forecolor"===n?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(n){dv(t,e,n.value,Z)}}]}})}function bv(e,o){return function(n){var t=w(n,o);return S(t,function(n){return{dom:e,components:n}})}}function yv(n,e){var o=[],r=[];return bn(n,function(n,t){e(n,t)?(0<r.length&&o.push(r),r=[],Tn(n.dom,"innerHtml")&&r.push(n)):r.push(n)}),0<r.length&&o.push(r),S(o,function(n){return{dom:{tag:"div",classes:["tox-collection__group"]},components:n}})}function xv(t,e,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[Ng.parts().items({preprocess:function(n){return"auto"!==t&&1<t?bv({tag:"div",classes:["tox-collection__group"]},t)(n):yv(n,function(n,t){return"separator"===e[t].type})}})]}}function wv(n){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:function(n){return"color"===n?"tox-swatches":"tox-menu"}(n),tieredMenu:"tox-tiered-menu"}}function Sv(n){var t=wv(n);return{backgroundMenu:t.backgroundMenu,selectedMenu:t.selectedMenu,menu:t.menu,selectedItem:t.selectedItem,item:fp(n)}}function Cv(n,t,e){var o=wv(e);return{dom:{tag:"div",classes:H([[o.tieredMenu]])},markers:Sv(e)}}function kv(n){return n.icon!==undefined||"togglemenuitem"===n.type||"choicemenuitem"===n.type}function Ov(n){return v.console.error(ye(n)),v.console.log(n),on.none()}function Tv(n,t,e,o,r){var i=function(e){return{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[Ng.parts().items({preprocess:function(n){return yv(n,function(n,t){return"separator"===e[t].type})}})]}}(e);return{value:n,dom:i.dom,components:i.components,items:e}}function Ev(n,t,e,o,r){var i;return"color"===r?{value:n,dom:(i=function(n){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[Ng.parts().items({preprocess:"auto"!==n?bv({tag:"div",classes:["tox-swatches__row"]},n):l})]}]}}(o)).dom,components:i.components,items:e}:"normal"===r&&"auto"===o?{value:n,dom:(i=xv(o,e)).dom,components:i.components,items:e}:"normal"===r&&1===o?{value:n,dom:(i=xv(1,e)).dom,components:i.components,items:e}:"normal"===r?{value:n,dom:(i=xv(o,e)).dom,components:i.components,items:e}:"listpreview"!==r||"auto"===o?{value:n,dom:function(n,t,e){var o=wv(e);return{tag:"div",classes:H([[o.menu,"tox-menu-"+t+"-column"],n?[o.hasIcons]:[]])}}(t,o,r),components:Gv,items:e}:{value:n,dom:(i=function(n){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[Ng.parts().items({preprocess:bv({tag:"div",classes:["tox-collection__group"]},n)})]}}(o)).dom,components:i.components,items:e}}function Dv(n,t,e,o,r,i,u,a){var c=function(n){return x(n,kv)}(t),s=Xv(t,e,o,"color"!==r?"normal":"color",i,u,a);return Ev(n,c,s,o,r)}function Bv(n,t){var e=Sv(t);return 1===n?{mode:"menu",moveOnTab:!0}:"auto"===n?{mode:"grid",selector:"."+e.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===t?"tox-swatches__row":"tox-collection__group")}}var Av="choiceitem",_v=[{type:Av,text:"Light Green",value:"#BFEDD2"},{type:Av,text:"Light Yellow",value:"#FBEEB8"},{type:Av,text:"Light Red",value:"#F8CAC6"},{type:Av,text:"Light Purple",value:"#ECCAFA"},{type:Av,text:"Light Blue",value:"#C2E0F4"},{type:Av,text:"Green",value:"#2DC26B"},{type:Av,text:"Yellow",value:"#F1C40F"},{type:Av,text:"Red",value:"#E03E2D"},{type:Av,text:"Purple",value:"#B96AD9"},{type:Av,text:"Blue",value:"#3598DB"},{type:Av,text:"Dark Turquoise",value:"#169179"},{type:Av,text:"Orange",value:"#E67E23"},{type:Av,text:"Dark Red",value:"#BA372A"},{type:Av,text:"Dark Purple",value:"#843FA1"},{type:Av,text:"Dark Blue",value:"#236FA1"},{type:Av,text:"Light Gray",value:"#ECF0F1"},{type:Av,text:"Medium Gray",value:"#CED4D9"},{type:Av,text:"Gray",value:"#95A5A6"},{type:Av,text:"Dark Gray",value:"#7E8C8D"},{type:Av,text:"Navy Blue",value:"#34495E"},{type:Av,text:"Black",value:"#000000"},{type:Av,text:"White",value:"#ffffff"}],Mv=function uI(t){void 0===t&&(t=10);var n,e=iv.getItem(uv),o=cn(e)?JSON.parse(e):[],r=t-(n=o).length<0?n.slice(0,t):n,i=function(n){r.splice(n,1)};return{add:function(n){(function(n,t){var e=y(n,t);return-1===e?on.none():on.some(e)})(r,n).each(i),r.unshift(n),r.length>t&&r.pop(),iv.setItem(uv,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),Fv=function(n,t){return n.getParam("color_cols",t,"number")},Iv=function(n){return!1!==n.getParam("custom_colors")},Rv=function(n){var t=cv(n);return t!==undefined?av(t):_v},Vv=function(){return S(Mv.state(),function(n){return{type:Av,text:n,value:n}})},Nv=function(n){Mv.add(n)},Hv=function(n){return n.fire("SkinLoaded")},Pv=function(n){return n.fire("ResizeEditor")},zv=function(n,t){return n.fire("ScrollContent",t)},Lv=function(n,t){return n.fire("ResizeContent",t)},jv=function(n,t){return n.fire("TextColorChange",t)},Uv=function(i){return function(n,t){var e,o={colorpicker:t},r=(e=n,function(n){var t=n.getData();e(on.from(t.colorpicker)),n.close()});i.windowManager.open({title:"Color Picker",size:"normal",body:{type:"panel",items:[{type:"colorpicker",name:"colorpicker",label:"Color"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:o,onAction:function(n,t){"hex-valid"===t.name&&(t.value?n.enable("ok"):n.disable("ok"))},onSubmit:r,onClose:function(){},onCancel:function(){n(on.none())}})}},Wv={register:function(n){!function(e){e.addCommand("mceApplyTextcolor",function(n,t){!function(n,t,e){n.undoManager.transact(function(){n.focus(),n.formatter.apply(t,{value:e}),n.nodeChanged()})}(e,n,t)}),e.addCommand("mceRemoveTextcolor",function(n){!function(n,t){n.undoManager.transact(function(){n.focus(),n.formatter.remove(t,{value:null},null,!0),n.nodeChanged()})}(e,n)})}(n);var t=Ee(null),e=Ee(null);hv(n,"forecolor","forecolor","Text color",t),hv(n,"backcolor","hilitecolor","Background color",e),vv(n,"forecolor","forecolor","Text color"),vv(n,"backcolor","hilitecolor","Background color")},getColors:mv,getFetch:gv,colorPickerDialog:Uv,getCurrentColor:sv,getColorCols:lv,calcCols:fv},Gv=[Ng.parts().items({})],Xv=function(n,e,o,r,i,u,a){return Bu(S(n,function(t){return"choiceitem"===t.type?function(n){return tt("choicemenuitem",Kp,n)}(t).fold(Ov,function(n){return on.some(function(t,n,e,o,r,i,u){var a=vp({presets:e,textContent:n?t.text:on.none(),htmlContent:on.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:n?t.shortcut:on.none(),checkMark:n?on.some(pp(u.icons)):on.none(),caret:on.none(),value:t.value},u,!0);return Bn(Ah({data:_h(t),disabled:t.disabled,getApi:function(t){return{setActive:function(n){kg.set(t,n)},isActive:function(){return kg.isOn(t)},isDisabled:function(){return kh.isDisabled(t)},setDisabled:function(n){return kh.set(t,n)}}},onAction:function(n){return o(t.value)},onSetup:function(n){return n.setActive(r),function(){}},triggersSubmenu:!1,itemBehaviours:[]},a,i),{toggling:{toggleClass:fh,toggleOnExecute:!1,selected:t.active}})}(n,1===o,r,e,u(t.value),i,a))}):on.none()}))};var Yv,qv,Kv={inserttable:function aI(o){var n=Hr("size-label"),i=function(n,t,e){for(var o=[],r=0;r<t;r++){for(var i=[],u=0;u<e;u++)i.push(Fh(r,u,n));o.push(i)}return o}(n,10,10),u=bm({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:n}},components:[Ti("0x0")],behaviours:ya([gg.config({})])});return{type:"widget",data:{value:Hr("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Nh().widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:function(n){return D(n,function(n){return S(n,cu)})}(i).concat(u.asSpec()),behaviours:ya([Jd("insert-table-picker",[cr(Hh,function(n,t,e){var o=e.event().row(),r=e.event().col();!function(n,t,e,o,r){for(var i=0;i<o;i++)for(var u=0;u<r;u++)kg.set(n[i][u],i<=t&&u<=e)}(i,o,r,10,10),gg.set(u.get(n),[function(n,t){return Ti(t+1+"x"+(n+1))}(o,r)])}),cr(Ph,function(n,t,e){o.onAction({numRows:e.event().row()+1,numColumns:e.event().col()+1}),Yt(n,Ao())})]),dg.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function cI(t,n){var e=Wv.getColors(n.colorinput.getColors(),n.colorinput.hasCustomColors()),o=n.colorinput.getColorCols(),r=Dv(Hr("menu-value"),e,function(n){t.onAction({value:n})},o,"color",Ih.CLOSE_ON_EXECUTE,function(){return!1},n.shared.providers),i=Bn(N(N({},r),{markers:Sv("color"),movement:Bv(o,"color")}));return{type:"widget",data:{value:Hr("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[Nh().widget(Ng.sketch(i))]}}},Jv=function(t,e,n,o,r,i,u,a){void 0===a&&(a=!0);var c=vp({presets:o,textContent:on.none(),htmlContent:n?t.text.map(function(n){return Mh(n,e)}):on.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:on.none(),checkMark:on.none(),caret:on.none(),value:t.value},u.providers,a,t.icon);return Ah({data:_h(t),disabled:t.disabled,getApi:function(){return{}},onAction:function(n){return r(t.value,t.meta)},onSetup:function(){return function(){}},triggersSubmenu:!1,itemBehaviours:function(n,t){return V(n,"tooltipWorker").map(function(e){return[rh.config({lazySink:t.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(n){return{anchor:"submenu",item:n,overrides:{maxHeightFunction:kf}}},mode:"follow-highlight",onShow:function(t,n){e(function(n){rh.setComponents(t,[iu({element:Be.fromDom(n)})])})}})]}).getOr([])}(t.meta,u)},c,i)},$v=function(n){var t=n.text.fold(function(){return{}},function(n){return{innerHtml:n}});return{type:"separator",dom:N({tag:"div",classes:[ah,"tox-collection__group-heading"]},t),components:[]}},Qv=function(n,t,e,o){void 0===o&&(o=!0);var r=vp({presets:"normal",iconContent:n.icon,textContent:n.text,htmlContent:on.none(),ariaLabel:n.text,caret:on.none(),checkMark:on.none(),shortcutContent:n.shortcut},e,o);return Ah({data:_h(n),getApi:function(t){return{isDisabled:function(){return kh.isDisabled(t)},setDisabled:function(n){return kh.set(t,n)}}},disabled:n.disabled,onAction:n.onAction,onSetup:n.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,t)},Zv=function(n,t,e,o,r){void 0===o&&(o=!0),void 0===r&&(r=!1);var i=r?function(n){return{dom:{tag:"div",classes:[mh],innerHtml:xm("chevron-down",n)}}}(e.icons):function(n){return{dom:{tag:"div",classes:[mh],innerHtml:xm("chevron-right",n)}}}(e.icons),u=vp({presets:"normal",iconContent:n.icon,textContent:n.text,htmlContent:on.none(),ariaLabel:n.text,caret:on.some(i),checkMark:on.none(),shortcutContent:n.shortcut},e,o);return Ah({data:_h(n),getApi:function(t){return{isDisabled:function(){return kh.isDisabled(t)},setDisabled:function(n){return kh.set(t,n)}}},disabled:n.disabled,onAction:Z,onSetup:n.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,t)},nb=function(n,t,e){var o=vp({iconContent:on.none(),textContent:n.text,htmlContent:on.none(),ariaLabel:n.text,checkMark:on.some(pp(e.icons)),caret:on.none(),shortcutContent:n.shortcut,presets:"normal",meta:n.meta},e,!0);return Bn(Ah({data:_h(n),disabled:n.disabled,getApi:function(t){return{setActive:function(n){kg.set(t,n)},isActive:function(){return kg.isOn(t)},isDisabled:function(){return kh.isDisabled(t)},setDisabled:function(n){return kh.set(t,n)}}},onAction:n.onAction,onSetup:n.onSetup,triggersSubmenu:!1,itemBehaviours:[]},o,t),{toggling:{toggleClass:fh,toggleOnExecute:!1,selected:n.active}})},tb=function(t,e){return function(n,t){return Object.prototype.hasOwnProperty.call(n,t)?on.some(n[t]):on.none()}(Kv,t.fancytype).map(function(n){return n(t,e)})};(qv=Yv=Yv||{})[qv.ContentFocus=0]="ContentFocus",qv[qv.UiFocus=1]="UiFocus";function eb(n){return n.icon!==undefined||"togglemenuitem"===n.type||"choicemenuitem"===n.type}function ob(n){return x(n,eb)}function rb(n,t,e,o,r){function i(n){return r?N(N({},n),{shortcut:on.none(),icon:n.text.isSome()?on.none():n.icon}):n}var u=e.shared.providers;switch(n.type){case"menuitem":return function(n){return tt("menuitem",Xp,n)}(n).fold(Ov,function(n){return on.some(Qv(i(n),t,u,o))});case"nestedmenuitem":return function(n){return tt("nestedmenuitem",Yp,n)}(n).fold(Ov,function(n){return on.some(Zv(i(n),t,u,o,r))});case"togglemenuitem":return function(n){return tt("togglemenuitem",qp,n)}(n).fold(Ov,function(n){return on.some(nb(i(n),t,u))});case"separator":return function(n){return tt("separatormenuitem",jp,n)}(n).fold(Ov,function(n){return on.some($v(n))});case"fancymenuitem":return function(n){return tt("fancymenuitem",Jp,n)}(n).fold(Ov,function(n){return tb(i(n),e)});default:return v.console.error("Unknown item in general menu",n),on.none()}}function ib(n,t,e,o,r,i){var u=1===o,a=!u||ob(n);return Bu(S(n,function(n){return"separator"===n.type?function(n){return tt("Autocompleter.Separator",jp,n)}(n).fold(Ov,function(n){return on.some($v(n))}):function(n){return tt("Autocompleter.Item",Up,n)}(n).fold(Ov,function(n){return on.some(Jv(n,t,u,"normal",e,r,i,a))})}))}function ub(n,t,e,o,r){var i=ob(t),u=Bu(S(t,function(n){function t(n){return rb(n,e,o,function(n){return r?!n.hasOwnProperty("text"):i}(n),r)}return"nestedmenuitem"===n.type&&n.getSubmenuItems().length<=0?t(An(n,{disabled:!0})):t(n)}));return(r?Tv:Ev)(n,i,u,1,"normal")}function ab(n){return jg.singleData(n.value,n)}function cb(n){function t(){n.stopPropagation()}function e(){n.preventDefault()}var o=Be.fromDom(n.target),r=i(e,t);return function(n,t,e,o,r,i,u){return{target:nn(n),x:nn(t),y:nn(e),stop:o,prevent:r,kill:i,raw:nn(u)}}(o,n.clientX,n.clientY,t,e,r,n)}function sb(n,t,e,o,r){var i=function(t,e){return function(n){t(n)&&e(cb(n))}}(e,o);return n.dom().addEventListener(t,i,r),{unbind:d(gb,n,t,i,r)}}function fb(n,t,e){return function(n,t,e,o){return sb(n,t,e,o,!1)}(n,t,pb,e)}function lb(n,t,e){return function(n,t,e,o){return sb(n,t,e,o,!0)}(n,t,pb,e)}function db(n,t,e){return Tu(n,t,e).isSome()}var mb=function(u,a){function e(){return s.get().isSome()}function c(){e()&&Ug.hide(l)}function i(n,t,e,o){n.matchLength=t.text.length;var r=Au(e,function(n){return on.from(n.columns)}).getOr(1);Ug.showAt(l,{anchor:"node",root:Be.fromDom(u.getBody()),node:on.from(n.element)},Ng.sketch(function(n,t,e,o){var r=e===Yv.ContentFocus?Yl():Xl(),i=Bv(t,o),u=Sv(o);return{dom:n.dom,components:n.components,items:n.items,value:n.value,markers:{selectedItem:u.selectedItem,item:u.item},movement:i,fakeFocus:e===Yv.ContentFocus,focusManager:r,menuBehaviours:$p("auto"!==t?[]:[Ri(function(o,n){up(o,4,u.item).each(function(n){var t=n.numColumns,e=n.numRows;dg.setGridSize(o,e,t)})})])}}(Ev("autocompleter-value",!0,o,r,"normal"),r,Yv.ContentFocus,"normal"))),Ug.getContent(l).each(cd.highlightFirst)}var s=Ee(on.none()),f=Ee(!1),l=au(Ug.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:ya([Jd("dismissAutocompleter",[rr(Po(),function(){return d()})])]),lazySink:a.getSink})),d=function(){if(e()){var n=s.get().map(function(n){return n.element});Rp(n.getOr(Be.fromDom(u.selection.getNode()))).each(Er),c(),s.set(on.none()),f.set(!1)}},o=L(function(){return ip(u)}),m=function(n){(function(t){return s.get().map(function(n){return ep(u.dom,u.selection.getRng(),n.triggerChar).bind(function(n){return Lp(u,o,n,t)})}).getOrThunk(function(){return rp(u,o)})})(n).fold(d,function(r){!function(n){if(!e()){var t=Zg(u,n.range);s.set(on.some({triggerChar:n.triggerChar,element:t,matchLength:n.text.length})),f.set(!1)}}(r.context),r.lookupData.then(function(o){s.get().map(function(n){var t=r.context;if(n.triggerChar===t.triggerChar){var e=function(t,n){var e=Au(n,function(n){return on.from(n.columns)}).getOr(1);return D(n,function(i){var n=i.items;return ib(n,i.matchText,function(o,r){var n=u.selection.getRng();ep(u.dom,n,t).fold(function(){return v.console.error("Lost context. Cursor probably moved")},function(n){var t=n.range,e={hide:function(){d()},reload:function(n){c(),m(n)}};f.set(!0),i.onAction(e,t,o,r),f.set(!1)})},e,Ih.BUBBLE_TO_SANDBOX,a)})}(t.triggerChar,o);0<e.length?i(n,t,o,e):10<=t.text.length-n.matchLength?d():c()}})})})},n={onKeypress:$g(function(n){27!==n.which&&m()},50),cancelIfNecessary:d,isMenuOpen:function(){return Ug.isOpen(l)},isActive:e,isProcessingAction:f.get,getView:function(){return Ug.getContent(l)}};Np(n,u)},gb=function(n,t,e,o){n.dom().removeEventListener(t,e,o)},pb=nn(!0),hb=cb;function vb(e,o){var r=null;return{cancel:function(){null!==r&&(v.clearTimeout(r),r=null)},schedule:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];r=v.setTimeout(function(){e.apply(null,n),r=null},o)}}}function bb(n){var t=n.raw();return t.touches===undefined||1!==t.touches.length?on.none():on.some(t.touches[0])}function yb(e){var o=Ee(on.none()),r=Ee(!1),i=vb(function(n){e.triggerEvent(Bo(),n),r.set(!0)},400),u=K([{key:eo(),value:function(e){return bb(e).each(function(n){i.cancel();var t={x:nn(n.clientX),y:nn(n.clientY),target:e.target};i.schedule(e),r.set(!1),o.set(on.some(t))}),on.none()}},{key:oo(),value:function(n){return i.cancel(),bb(n).each(function(t){o.get().each(function(n){!function(n,t){var e=Math.abs(n.clientX-t.x()),o=Math.abs(n.clientY-t.y());return 5<e||5<o}(t,n)||o.set(on.none())})}),on.none()}},{key:ro(),value:function(t){i.cancel();return o.get().filter(function(n){return jt(n.target(),t.target())}).map(function(n){return r.get()?(t.prevent(),!1):e.triggerEvent(Do(),t)})}}]);return{fireIfReady:function(t,n){return Nn(u,n).bind(function(n){return n(t)})}}}function xb(t,n){var e=ot("Getting GUI events settings",Ob,n),o=Ht().deviceType.isTouch()?["touchstart","touchmove","touchend","touchcancel","gesturestart"]:["mousedown","mouseup","mouseover","mousemove","mouseout","click"],r=yb(e),i=S(o.concat(["selectstart","input","contextmenu","change","transitionend","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(n){return fb(t,n,function(t){r.fireIfReady(t,n).each(function(n){n&&t.kill()}),e.triggerEvent(n,t)&&t.kill()})}),u=Ee(on.none()),a=fb(t,"paste",function(t){r.fireIfReady(t,"paste").each(function(n){n&&t.kill()}),e.triggerEvent("paste",t)&&t.kill(),u.set(on.some(v.setTimeout(function(){e.triggerEvent(ko(),t)},0)))}),c=fb(t,"keydown",function(n){e.triggerEvent("keydown",n)?n.kill():!0===e.stopBackspace&&function(n){return 8===n.raw().which&&!vn(["input","textarea"],Ko(n.target()))&&!db(n.target(),'[contenteditable="true"]')}(n)&&n.prevent()}),s=function(n,t){return kb?lb(n,"focus",t):fb(n,"focusin",t)}(t,function(n){e.triggerEvent("focusin",n)&&n.kill()}),f=Ee(on.none()),l=function(n,t){return kb?lb(n,"blur",t):fb(n,"focusout",t)}(t,function(n){e.triggerEvent("focusout",n)&&n.kill(),f.set(on.some(v.setTimeout(function(){e.triggerEvent(Co(),n)},0)))});return{unbind:function(){bn(i,function(n){n.unbind()}),c.unbind(),s.unbind(),l.unbind(),a.unbind(),u.get().each(v.clearTimeout),f.get().each(v.clearTimeout)}}}function wb(n,t){var e=Nn(n,"target").map(function(n){return n()}).getOr(t);return Ee(e)}function Sb(n,o,t,e,r,i){var u=n(o,e),a=function(n,t){var e=Ee(!1),o=Ee(!1);return{stop:function(){e.set(!0)},cut:function(){o.set(!0)},isStopped:e.get,isCut:o.get,event:nn(n),setSource:t.set,getSource:t.get}}(t,r);return u.fold(function(){return i.logEventNoHandlers(o,e),Tb.complete()},function(t){var e=t.descHandler();return Xr(e)(a),a.isStopped()?(i.logEventStopped(o,t.element(),e.purpose()),Tb.stopped()):a.isCut()?(i.logEventCut(o,t.element(),e.purpose()),Tb.complete()):br(t.element()).fold(function(){return i.logNoParent(o,t.element(),e.purpose()),Tb.complete()},function(n){return i.logEventResponse(o,t.element(),e.purpose()),Tb.resume(n)})})}function Cb(n,t,e){var o=function(n){var t=Ee(!1);return{stop:function(){t.set(!0)},cut:Z,isStopped:t.get,isCut:nn(!1),event:nn(n),setSource:r("Cannot set source of a broadcasted event"),getSource:r("Cannot get source of a broadcasted event")}}(t);return bn(n,function(n){var t=n.descHandler();Xr(t)(o)}),o.isStopped()}var kb=Ht().browser.isFirefox(),Ob=qn([dt("triggerEvent"),St("stopBackspace",!0)]),Tb=En([{stopped:[]},{resume:["element"]},{complete:[]}]),Eb=function(t,e,o,n,r,i){return Sb(t,e,o,n,r,i).fold(function(){return!0},function(n){return Eb(t,e,o,n,r,i)},function(){return!1})},Db=function(n,t,e,o,r){var i=wb(e,o);return Eb(n,t,e,o,i,r)},Bb=lr("element","descHandler"),Ab=function(n,t){return{id:nn(n),descHandler:nn(t)}};function _b(){var i={};return{registerId:function(o,r,n){Cn(n,function(n,t){var e=i[t]!==undefined?i[t]:{};e[r]=eu(n,o),i[t]=e})},unregisterId:function(e){Cn(i,function(n,t){n.hasOwnProperty(e)&&delete n[e]})},filterByType:function(n){return Nn(i,n).map(function(n){return On(n,function(n,t){return Ab(t,n)})}).getOr([])},find:function(n,t,e){var o=Vn(t)(i);return Ii(e,function(n){return function(e,o){return Ki(o).fold(function(){return on.none()},function(n){var t=Vn(n);return e.bind(t).map(function(n){return Bb(o,n)})})}(o,n)},n)}}}function Mb(){function o(n){var t=n.element();return Ki(t).fold(function(){return function(n,t){var e=Hr(Xi+n);return qi(t,e),e}("uid-",n.element())},function(n){return n})}var r=_b(),i={},u=function(n){Ki(n.element()).each(function(n){delete i[n],r.unregisterId(n)})};return{find:function(n,t,e){return r.find(n,t,e)},filter:function(n){return r.filterByType(n)},register:function(n){var t=o(n);$(i,t)&&function(n,t){var e=i[t];if(e!==n)throw new Error('The tagId "'+t+'" is already used by: '+Nr(e.element())+"\nCannot use it for: "+Nr(n.element())+"\nThe conflicting element is"+($o(e.element())?" ":" not ")+"already in the DOM");u(n)}(n,t);var e=[n];r.registerId(e,t,n.events()),i[t]=n},unregister:u,getById:function(n){return Vn(n)(i)}}}function Fb(e){function o(t){return br(e.element()).fold(function(){return!0},function(n){return jt(t,n)})}function r(n,t){return u.find(o,n,t)}function i(e){var n=u.filter(Oo());bn(n,function(n){var t=n.descHandler();Xr(t)(e)})}var u=Mb(),n=xb(e.element(),{triggerEvent:function(t,e){return Gu(t,e.target(),function(n){return function(n,t,e,o){var r=e.target();return Db(n,t,e,r,o)}(r,t,e,n)})}}),a={debugInfo:nn("real"),triggerEvent:function(t,e,o){Gu(t,e,function(n){Db(r,t,o,e,n)})},triggerFocus:function(t,e){Ki(t).fold(function(){Sa(t)},function(n){Gu(So(),t,function(n){!function(n,t,e,o,r){var i=wb(e,o);Sb(n,t,e,o,i,r)}(r,So(),{originator:nn(e),kill:Z,prevent:Z,target:nn(t)},t,n)})})},triggerEscape:function(n,t){a.triggerEvent("keydown",n.element(),t.event())},getByUid:function(n){return g(n)},getByDom:function(n){return p(n)},build:au,addToGui:function(n){s(n)},removeFromGui:function(n){f(n)},addToWorld:function(n){t(n)},removeFromWorld:function(n){c(n)},broadcast:function(n){l(n)},broadcastOn:function(n,t){d(n,t)},broadcastEvent:function(n,t){m(n,t)},isConnected:nn(!0)},t=function(n){n.connect(a),_i(n.element())||(u.register(n),bn(n.components(),t),a.triggerEvent(Mo(),n.element(),{target:nn(n.element())}))},c=function(n){_i(n.element())||(bn(n.components(),c),u.unregister(n)),n.disconnect()},s=function(n){vs(e,n)},f=function(n){ys(n)},l=function(n){i({universal:nn(!0),data:nn(n)})},d=function(n,t){i({universal:nn(!1),channels:nn(n),data:nn(t)})},m=function(n,t){var e=u.filter(n);return Cb(e,t)},g=function(n){return u.getById(n).fold(function(){return an.error(new Error('Could not find component with uid: "'+n+'" in system.'))},an.value)},p=function(n){var t=Ki(n).getOr("not found");return g(t)};return t(e),{root:nn(e),element:e.element,destroy:function(){n.unbind(),zi(e.element())},add:s,remove:f,getByUid:g,getByDom:p,addToWorld:t,removeFromWorld:c,broadcast:l,broadcastOn:d,broadcastEvent:m}}function Ib(n){return n.getParam("height",Math.max(n.getElement().offsetHeight,200))}function Rb(n){return n.getParam("width",Vh.DOM.getStyle(n.getElement(),"width"))}function Vb(n){return on.from(n.settings.min_width).filter(mn)}function Nb(n){return on.from(n.settings.min_height).filter(mn)}function Hb(n){return on.from(n.getParam("max_width")).filter(mn)}function Pb(n){return on.from(n.getParam("max_height")).filter(mn)}function zb(n){return!1!==n.getParam("menubar",!0,"boolean")}function Lb(n){var t=n.getParam("toolbar",!0),e=!0===t,o=cn(t),r=fn(t)&&0<t.length;return!Yb(n)&&(r||o||e)}function jb(t){var n=wn(t.settings),e=C(n,function(n){return/^toolbar([1-9])$/.test(n)}),o=S(e,function(n){return t.getParam(n,!1,"string")}),r=C(o,function(n){return"string"==typeof n});return 0<r.length?on.some(r):on.none()}var Ub,Wb,Gb=Al({name:"Container",factory:function(n){var t=n.dom,e=t.attributes,o=c(t,["attributes"]);return{uid:n.uid,dom:N({tag:"div",attributes:N({role:"presentation"},e)},o),components:n.components,behaviours:Rs(n.containerBehaviours),events:n.events,domModification:n.domModification,eventOrder:n.eventOrder}},configFields:[St("components",[]),Is("containerBehaviours",[]),St("events",{}),St("domModification",{}),St("eventOrder",{})]}),Xb=tinymce.util.Tools.resolve("tinymce.EditorManager"),Yb=function(n){return jb(n).fold(function(){return 0<n.getParam("toolbar",[],"string[]").length},function(){return!0})};(Wb=Ub=Ub||{})["default"]="",Wb.floating="floating",Wb.sliding="sliding",Wb.scrolling="scrolling";function qb(n){return n.getParam("toolbar_drawer","","string")}function Kb(n){var t=function(n){return n.getParam("fixed_toolbar_container","","string")}(n);return 0<t.length&&n.inline?Ou(Mi(),t):on.none()}function Jb(n){return n.inline&&Kb(n).isSome()}function $b(n){return n.inline&&!zb(n)&&!Lb(n)&&!Yb(n)}function Qb(n){return(n.getParam("toolbar_sticky",!1,"boolean")||n.inline)&&!Jb(n)&&!$b(n)}function Zb(n){return n.touches===undefined||1!==n.touches.length?on.none():on.some(n.touches[0])}function ny(n){return ya([bg.config({onFocus:!1===n.selectOnFocus?Z:function(n){var t=n.element(),e=bi(t);t.dom().setSelectionRange(0,e.length)}})])}function ty(n){return{tag:n.tag,attributes:N({type:"text"},n.inputAttributes),styles:n.inputStyles,classes:n.inputClasses}}var ey,oy,ry,iy,uy=function(e){var o=Ee(on.none()),r=Ee(!1),i=$g(function(n){e.fire("longpress",N(N({},n),{type:"longpress"})),r.set(!0)},400);e.on("touchstart",function(e){Zb(e).each(function(n){i.cancel();var t={x:nn(n.clientX),y:nn(n.clientY),target:nn(e.target)};i.throttle(e),r.set(!1),o.set(on.some(t))})},!0),e.on("touchmove",function(n){i.cancel(),Zb(n).each(function(t){o.get().each(function(n){!function(n,t){var e=Math.abs(n.clientX-t.x()),o=Math.abs(n.clientY-t.y());return 5<e||5<o}(t,n)||(o.set(on.none()),r.set(!1),e.fire("longpresscancel"))})})},!0),e.on("touchend touchcancel",function(t){i.cancel(),"touchcancel"!==t.type&&o.get().filter(function(n){return n.target().isEqualNode(t.target)}).each(function(){r.get()?t.preventDefault():e.fire("tap").isDefaultPrevented()&&t.preventDefault()})},!0)},ay=Hr("form-component-change"),cy=Hr("form-close"),sy=Hr("form-cancel"),fy=Hr("form-action"),ly=Hr("form-submit"),dy=Hr("form-block"),my=Hr("form-unblock"),gy=Hr("form-tabchange"),py=Hr("form-resize"),hy=nn([St("prefix","form-field"),Is("fieldBehaviours",[nd,nl])]),vy=nn([Cl({schema:[ct("dom")],name:"label"}),Cl({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:n.text}}}},schema:[ct("text")],name:"aria-descriptor"}),wl({factory:{sketch:function(n){var t=X(n,["factory"]);return n.factory.sketch(t)}},schema:[ct("factory")],name:"field"})]),by=_l({name:"FormField",configFields:hy(),partFields:vy(),factory:function(r,n,t,e){var o=Vs(r.fieldBehaviours,[nd.config({find:function(n){return Ks(n,r,"field")}}),nl.config({store:{mode:"manual",getValue:function(n){return nd.getCurrent(n).bind(nl.getValue)},setValue:function(n,t){nd.getCurrent(n).each(function(n){nl.setValue(n,t)})}}})]),i=tr([Ri(function(n,t){var o=$s(n,r,["label","field","aria-descriptor"]);o.field().each(function(e){var t=Hr(r.prefix);o.label().each(function(n){_r(n.element(),"for",t),_r(e.element(),"id",t)}),o["aria-descriptor"]().each(function(n){var t=Hr(r.prefix);_r(n.element(),"id",t),_r(e.element(),"aria-describedby",t)})})})]),u={getField:function(n){return Ks(n,r,"field")},getLabel:function(n){return Ks(n,r,"label")}};return{uid:r.uid,dom:r.dom,components:n,behaviours:o,events:i,apis:u}},apis:{getField:function(n,t){return n.getField(t)},getLabel:function(n,t){return n.getLabel(t)}}}),yy=nn([ht("data"),St("inputAttributes",{}),St("inputStyles",{}),St("tag","input"),St("inputClasses",[]),Ku("onSetValue"),St("styles",{}),St("eventOrder",{}),Is("inputBehaviours",[nl,bg]),St("selectOnFocus",!0)]),xy=Al({name:"Input",configFields:yy(),factory:function(n,t){return{uid:n.uid,dom:ty(n),components:[],behaviours:function(n){return N(N({},ny(n)),Vs(n.inputBehaviours,[nl.config({store:{mode:"manual",initialValue:n.data.getOr(undefined),getValue:function(n){return bi(n.element())},setValue:function(n,t){bi(n.element())!==t&&yi(n.element(),t)}},onSetValue:n.onSetValue})]))}(n),eventOrder:n.eventOrder}}}),wy={},Sy={exports:wy};ey=undefined,oy=wy,ry=Sy,iy=undefined,function(n){"object"==typeof oy&&void 0!==ry?ry.exports=n():"function"==typeof ey&&ey.amd?ey([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function f(i,u,a){function c(t,n){if(!u[t]){if(!i[t]){var e="function"==typeof iy&&iy;if(!n&&e)return e(t,!0);if(s)return s(t,!0);var o=new Error("Cannot find module '"+t+"'");throw o.code="MODULE_NOT_FOUND",o}var r=u[t]={exports:{}};i[t][0].call(r.exports,function(n){return c(i[t][1][n]||n)},r,r.exports,f,i,u,a)}return u[t].exports}for(var s="function"==typeof iy&&iy,n=0;n<a.length;n++)c(a[n]);return c}({1:[function(n,t,e){var o,r,i=t.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(n){if(o===setTimeout)return setTimeout(n,0);if((o===u||!o)&&setTimeout)return o=setTimeout,setTimeout(n,0);try{return o(n,0)}catch(t){try{return o.call(null,n,0)}catch(t){return o.call(this,n,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:u}catch(n){o=u}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(n){r=a}}();var s,f=[],l=!1,d=-1;function m(){l&&s&&(l=!1,s.length?f=s.concat(f):d=-1,f.length&&g())}function g(){if(!l){var n=c(m);l=!0;for(var t=f.length;t;){for(s=f,f=[];++d<t;)s&&s[d].run();d=-1,t=f.length}s=null,l=!1,function e(n){if(r===clearTimeout)return clearTimeout(n);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(n);try{return r(n)}catch(t){try{return r.call(null,n)}catch(t){return r.call(this,n)}}}(n)}}function p(n,t){this.fun=n,this.array=t}function h(){}i.nextTick=function(n){var t=new Array(arguments.length-1);if(1<arguments.length)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];f.push(new p(n,t)),1!==f.length||l||c(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(n){return[]},i.binding=function(n){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(n){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(n,l,t){(function(t){function o(){}function i(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],f(n,this)}function r(o,r){for(;3===o._state;)o=o._value;0!==o._state?(o._handled=!0,i._immediateFn(function(){var n=1===o._state?r.onFulfilled:r.onRejected;if(null!==n){var t;try{t=n(o._value)}catch(e){return void a(r.promise,e)}u(r.promise,t)}else(1===o._state?u:a)(r.promise,o._value)})):o._deferreds.push(r)}function u(n,t){try{if(t===n)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if(t instanceof i)return n._state=3,n._value=t,void c(n);if("function"==typeof e)return void f(function o(n,t){return function(){n.apply(t,arguments)}}(e,t),n)}n._state=1,n._value=t,c(n)}catch(r){a(n,r)}}function a(n,t){n._state=2,n._value=t,c(n)}function c(n){2===n._state&&0===n._deferreds.length&&i._immediateFn(function(){n._handled||i._unhandledRejectionFn(n._value)});for(var t=0,e=n._deferreds.length;t<e;t++)r(n,n._deferreds[t]);n._deferreds=null}function s(n,t,e){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.promise=e}function f(n,t){var e=!1;try{n(function(n){e||(e=!0,u(t,n))},function(n){e||(e=!0,a(t,n))})}catch(o){if(e)return;e=!0,a(t,o)}}var n,e;n=this,e=setTimeout,i.prototype["catch"]=function(n){return this.then(null,n)},i.prototype.then=function(n,t){var e=new this.constructor(o);return r(this,new s(n,t,e)),e},i.all=function(n){var c=Array.prototype.slice.call(n);return new i(function(r,i){if(0===c.length)return r([]);var u=c.length;function a(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void e.call(n,function(n){a(t,n)},i)}c[t]=n,0==--u&&r(c)}catch(o){i(o)}}for(var n=0;n<c.length;n++)a(n,c[n])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(n){n(t)})},i.reject=function(e){return new i(function(n,t){t(e)})},i.race=function(r){return new i(function(n,t){for(var e=0,o=r.length;e<o;e++)r[e].then(n,t)})},i._immediateFn="function"==typeof t?function(n){t(n)}:function(n){e(n,0)},i._unhandledRejectionFn=function(n){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",n)},i._setImmediateFn=function(n){i._immediateFn=n},i._setUnhandledRejectionFn=function(n){i._unhandledRejectionFn=n},void 0!==l&&l.exports?l.exports=i:n.Promise||(n.Promise=i)}).call(this,n("timers").setImmediate)},{timers:3}],3:[function(c,n,s){(function(n,t){var o=c("process/browser.js").nextTick,e=Function.prototype.apply,r=Array.prototype.slice,i={},u=0;function a(n,t){this._id=n,this._clearFn=t}s.setTimeout=function(){return new a(e.call(setTimeout,window,arguments),clearTimeout)},s.setInterval=function(){return new a(e.call(setInterval,window,arguments),clearInterval)},s.clearTimeout=s.clearInterval=function(n){n.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},s.enroll=function(n,t){clearTimeout(n._idleTimeoutId),n._idleTimeout=t},s.unenroll=function(n){clearTimeout(n._idleTimeoutId),n._idleTimeout=-1},s._unrefActive=s.active=function(n){clearTimeout(n._idleTimeoutId);var t=n._idleTimeout;0<=t&&(n._idleTimeoutId=setTimeout(function(){n._onTimeout&&n._onTimeout()},t))},s.setImmediate="function"==typeof n?n:function(n){var t=u++,e=!(arguments.length<2)&&r.call(arguments,1);return i[t]=!0,o(function(){i[t]&&(e?n.apply(null,e):n.call(null),s.clearImmediate(t))}),t},s.clearImmediate="function"==typeof t?t:function(n){delete i[n]}}).call(this,c("timers").setImmediate,c("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(n,t,e){var o=n("promise-polyfill"),r="undefined"!=typeof window?window:Function("return this;")();t.exports={boltExport:r.Promise||o}},{"promise-polyfill":2}]},{},[4])(4)});function Cy(n){v.setTimeout(function(){throw n},0)}function ky(n){var t=Ko(n);return vn(Py,t)}function Oy(n,t){var e=t.getRoot(n).getOr(n.element());ri(e,t.invalidClass),t.notify.each(function(t){ky(n.element())&&_r(n.element(),"aria-invalid",!1),t.getContainer(n).each(function(n){Br(n,t.validHtml)}),t.onValid(n)})}function Ty(t,n,e,o){var r=n.getRoot(t).getOr(t.element());ei(r,n.invalidClass),n.notify.each(function(n){ky(t.element())&&_r(t.element(),"aria-invalid",!0),n.getContainer(t).each(function(n){Br(n,o)}),n.onInvalid(t,o)})}function Ey(t,n,e){return n.validator.fold(function(){return Hy(an.value(!0))},function(n){return n.validate(t)})}function Dy(t,e,n){return e.notify.each(function(n){n.onValidate(t)}),Ey(t,e).map(function(n){return t.getSystem().isConnected()?n.fold(function(n){return Ty(t,e,0,n),an.error(n)},function(n){return Oy(t,e),an.value(n)}):an.error("No longer in system")})}function By(n,t,e,o){var r=Yy(n,t,e,o);return by.sketch(r)}function Ay(n,t){return by.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(n)}})}var _y,My,Fy=Sy.exports.boltExport,Iy=function(n){var e=on.none(),t=[],o=function(n){r()?u(n):t.push(n)},r=function(){return e.isSome()},i=function(n){bn(n,u)},u=function(t){e.each(function(n){v.setTimeout(function(){t(n)},0)})};return n(function(n){e=on.some(n),i(t),t=[]}),{get:o,map:function(e){return Iy(function(t){o(function(n){t(e(n))})})},isReady:r}},Ry={nu:Iy,pure:function(t){return Iy(function(n){n(t)})}},Vy=function(e){function n(n){e().then(n,Cy)}return{map:function(n){return Vy(function(){return e().then(n)})},bind:function(t){return Vy(function(){return e().then(function(n){return t(n).toPromise()})})},anonBind:function(n){return Vy(function(){return e().then(function(){return n.toPromise()})})},toLazy:function(){return Ry.nu(n)},toCached:function(){var n=null;return Vy(function(){return null===n&&(n=e()),n})},toPromise:e,get:n}},Ny=function(n){return Vy(function(){return new Fy(n)})},Hy=function(n){return Vy(function(){return Fy.resolve(n)})},Py=["input","textarea"],zy=/* */Object.freeze({markValid:Oy,markInvalid:Ty,query:Ey,run:Dy,isInvalid:function(n,t){var e=t.getRoot(n).getOr(n.element());return ii(e,t.invalidClass)}}),Ly=/* */Object.freeze({events:function(t,n){return t.validator.map(function(n){return tr([rr(n.onEvent,function(n){Dy(n,t).get(l)})].concat(n.validateOnLoad?[Ri(function(n){Dy(n,t).get(Z)})]:[]))}).getOr({})}}),jy=[ct("invalidClass"),St("getRoot",on.none),wt("notify",[St("aria","alert"),St("getContainer",on.none),St("validHtml",""),Ku("onValid"),Ku("onInvalid"),Ku("onValidate")]),wt("validator",[ct("validate"),St("onEvent","input"),St("validateOnLoad",!0)])],Uy=xa({fields:jy,name:"invalidating",active:Ly,apis:zy,extra:{validation:function(e){return function(n){var t=nl.getValue(n);return Hy(e(t))}}}}),Wy=/* */Object.freeze({exhibit:function(n,t){return Gr({attributes:K([{key:t.tabAttr,value:"true"}])})}}),Gy=[St("tabAttr","data-alloy-tabstop")],Xy=xa({fields:Gy,name:"tabstopping",active:Wy}),Yy=function(n,t,e,o){return{dom:qy(e),components:n.toArray().concat([t]),fieldBehaviours:ya(o)}},qy=function(n){return{tag:"div",classes:["tox-form__group"].concat(n)}},Ky=/* */Object.freeze({getCoupled:function(n,t,e,o){return e.getOrCreate(n,t,o)}}),Jy=[st("others",nt(an.value,xe()))],$y=xa({fields:Jy,name:"coupling",apis:Ky,state:/* */Object.freeze({init:function(n){var i={},t=nn({});return tu({readState:t,getOrCreate:function(e,o,r){var n=wn(o.others);if(n)return Nn(i,r).getOrThunk(function(){var n=Nn(o.others,r).getOrDie("No information found for coupled component: "+r)(e),t=e.getSystem().build(n);return i[r]=t});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(n,null,2))}})}})}),Qy=nn("sink"),Zy=nn(Cl({name:Qy(),overrides:nn({dom:{tag:"div"},behaviours:ya([_f.config({useFixed:a})]),events:tr([sr(go()),sr(uo()),sr(bo())])})}));(My=_y=_y||{})[My.HighlightFirst=0]="HighlightFirst",My[My.HighlightNone=1]="HighlightNone";function nx(n,t){var e=n.getHotspot(t).getOr(t),o=n.getAnchorOverrides();return n.layouts.fold(function(){return{anchor:"hotspot",hotspot:e,overrides:o}},function(n){return{anchor:"hotspot",hotspot:e,overrides:o,layouts:n}})}function tx(n,t,e,o,r,i,u){return function(n,t,r,e,i,o,u){var a=function(n,t,e){return(0,n.fetch)(e).map(t)}(n,t,e),c=Cw(e,n);return a.map(function(n){return n.bind(function(n){return on.from(jg.sketch(N(N({},o.menu()),{uid:Pr(""),data:n,highlightImmediately:u===_y.HighlightFirst,onOpenMenu:function(n,t){var e=c().getOrDie();_f.position(e,r,t),Lf.decloak(i)},onOpenSubmenu:function(n,t,e){var o=c().getOrDie();_f.position(o,{anchor:"submenu",item:t},e),Lf.decloak(i)},onRepositionMenu:function(n,t,e){var o=c().getOrDie();_f.position(o,r,t),bn(e,function(n){_f.position(o,{anchor:"submenu",item:n.triggeringItem},n.triggeredMenu)})},onEscape:function(){return bg.focus(e),Lf.close(i),on.some(!0)}})))})})}(n,t,nx(n,e),e,o,r,u).map(function(n){return n.fold(function(){Lf.isOpen(o)&&Lf.close(o)},function(n){Lf.cloak(o),Lf.open(o,n),i(o)}),o})}function ex(n,t,e,o,r,i,u){return Lf.close(o),Hy(o)}function ox(n,t,e,o,r,i){var u=$y.getCoupled(e,"sandbox");return(Lf.isOpen(u)?ex:tx)(n,t,e,u,o,r,i)}function rx(n,t,e){var o=nd.getCurrent(t).getOr(t),r=gu(n.element());e?li(o.element(),"min-width",r+"px"):function(n,t){Nu.set(n,t)}(o.element(),r)}function ix(n){Lf.getState(n).each(function(n){jg.repositionMenus(n)})}function ux(o,r,i){var u=Eu(),n=Cw(r,o);return{dom:{tag:"div",classes:o.sandboxClasses,attributes:{id:u.id(),role:"listbox"}},behaviours:el(o.sandboxBehaviours,[nl.config({store:{mode:"memory",initialValue:r}}),Lf.config({onOpen:function(n,t){var e=nx(o,r);u.link(r.element()),o.matchWidth&&rx(e.hotspot,t,o.useMinWidth),o.onOpen(e,n,t),i!==undefined&&i.onOpen!==undefined&&i.onOpen(n,t)},onClose:function(n,t){u.unlink(r.element()),i!==undefined&&i.onClose!==undefined&&i.onClose(n,t)},isPartOf:function(n,t,e){return ju(t,e)||ju(r,e)},getAttachPoint:function(){return n().getOrDie()}}),nd.config({find:function(n){return Lf.getState(n).bind(function(n){return nd.getCurrent(n)})}}),dc.config({channels:N(N({},Es({isExtraPart:nn(!1)})),Ds({isExtraPart:nn(!1),doReposition:ix}))})])}}function ax(n){var t=$y.getCoupled(n,"sandbox");ix(t)}function cx(){return[St("sandboxClasses",[]),tl("sandboxBehaviours",[nd,dc,Lf,nl])]}function sx(e,t,o){function r(n,t){qt(n,Bw,{value:t})}var n=by.parts().field({factory:xy,inputClasses:["tox-textfield"],onSetValue:function(n){return Uy.run(n).get(function(){})},inputBehaviours:ya([Xy.config({}),Uy.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(n){return br(n.element())},notify:{onValid:function(n){var t=nl.getValue(n);qt(n,Dw,{color:t})}},validator:{validateOnLoad:!1,validate:function(n){var t=nl.getValue(n);if(0===t.length)return Hy(an.value(!0));var e=Be.fromTag("span");li(e,"background-color",t);var o=gi(e,"background-color").fold(function(){return an.error("blah")},function(n){return an.value(t)});return Hy(o)}}})]),selectOnFocus:!1}),i=e.label.map(function(n){return Ay(n,t.providers)}),u=bm(function(e,o){return Tw.sketch({dom:e.dom,components:e.components,toggleClass:"mce-active",dropdownBehaviours:ya([Ew.config({}),Xy.config({})]),layouts:e.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:o.getSink,fetch:function(t){return Ny(function(n){return e.fetch(n)}).map(function(n){return on.from(ab(Bn(Dv(Hr("menu-value"),n,function(n){e.onItemAction(t,n)},e.columns,e.presets,Ih.CLOSE_ON_EXECUTE,function(){return!1},o.providers),{movement:Bv(e.columns,e.presets)})))})},parts:{menu:Cv(0,0,e.presets)}})}({dom:{tag:"span",attributes:{"aria-label":t.providers.translate("Color swatch")}},layouts:on.some({onRtl:function(){return[aa]},onLtr:function(){return[ca]}}),components:[],fetch:Wv.getFetch(o.getColors(),o.hasCustomColors()),columns:o.getColorCols(),presets:"color",onItemAction:function(n,e){u.getOpt(n).each(function(t){"custom"===e?o.colorPicker(function(n){n.fold(function(){return Yt(t,Aw)},function(n){r(t,n),Nv(n)})},"#ffffff"):r(t,"remove"===e?"":e)})}},t));return by.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:i.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[n,u.asSpec()]}]),fieldBehaviours:ya([Jd("form-field-events",[rr(Dw,function(n,t){u.getOpt(n).each(function(n){li(n.element(),"background-color",t.event().color())}),qt(n,ay,{name:e.name})}),rr(Bw,function(t,e){by.getField(t).each(function(n){nl.setValue(n,e.event().value()),nd.getCurrent(t).each(bg.focus)})}),rr(Aw,function(t,n){by.getField(t).each(function(n){nd.getCurrent(t).each(bg.focus)})})])])})}function fx(n,t,e){return{hue:nn(n),saturation:nn(t),value:nn(e)}}function lx(n){return Cl({name:n+"-edge",overrides:function(o){return o.model.manager.edgeActions[n].fold(function(){return{}},function(e){var n=tr([ir(eo(),e,[o])]),t=tr([ir(uo(),e,[o]),ir(ao(),function(n,t){t.mouseIsDown.get()&&e(n,t)},[o])]);return{events:Iw?n:t}})}})}function dx(n){var t=n.event().raw();if(Ww){var e=t;return e.touches!==undefined&&1===e.touches.length?on.some(e.touches[0]).map(function(n){return Ru(n.clientX,n.clientY)}):on.none()}var o=t;return o.clientX!==undefined?on.some(o).map(function(n){return Ru(n.clientX,n.clientY)}):on.none()}function mx(n){return n.model.minX}function gx(n){return n.model.minY}function px(n){return n.model.minX-1}function hx(n){return n.model.minY-1}function vx(n){return n.model.maxX}function bx(n){return n.model.maxY}function yx(n){return n.model.maxX+1}function xx(n){return n.model.maxY+1}function wx(n,t,e){return t(n)-e(n)}function Sx(n){return wx(n,vx,mx)}function Cx(n){return wx(n,bx,gx)}function kx(n){return Sx(n)/2}function Ox(n){return Cx(n)/2}function Tx(n){return n.stepSize}function Ex(n){return n.snapToGrid}function Dx(n){return n.snapStart}function Bx(n){return n.rounded}function Ax(n,t){return n[t+"-edge"]!==undefined}function _x(n){return Ax(n,"left")}function Mx(n){return Ax(n,"right")}function Fx(n){return Ax(n,"top")}function Ix(n){return Ax(n,"bottom")}function Rx(n){return n.model.value.get()}function Vx(n){return{x:nn(n)}}function Nx(n){return{y:nn(n)}}function Hx(n,t){return{x:nn(n),y:nn(t)}}function Px(n,t){qt(n,Gw(),{value:t})}function zx(n,t,e,o){return n<t?n:e<n?e:n===t?t-1:Math.max(t,n-o)}function Lx(n,t,e,o){return e<n?n:n<t?t:n===e?e+1:Math.min(e,n+o)}function jx(n,t,e){return Math.max(t,Math.min(e,n))}function Ux(n){var t=n.min,e=n.max,o=n.range,r=n.value,i=n.step,u=n.snap,a=n.snapStart,c=n.rounded,s=n.hasMinEdge,f=n.hasMaxEdge,l=n.minBound,d=n.maxBound,m=n.screenRange,g=s?t-1:t,p=f?e+1:e;if(r<l)return g;if(d<r)return p;var h=function(n,t,e){return Math.min(e,Math.max(n,t))-t}(r,l,d),v=jx(h/m*o+t,g,p);return u&&t<=v&&v<=e?function(u,e,a,c,n){return n.fold(function(){var n=u-e,t=Math.round(n/c)*c;return jx(e+t,e-1,a+1)},function(n){var t=(u-n)%c,e=Math.round(t/c),o=Math.floor((u-n)/c),r=Math.floor((a-n)/c),i=n+Math.min(r,o+e)*c;return Math.max(n,i)})}(v,t,e,i,a):c?Math.round(v):v}function Wx(n){var t=n.min,e=n.max,o=n.range,r=n.value,i=n.hasMinEdge,u=n.hasMaxEdge,a=n.maxBound,c=n.maxOffset,s=n.centerMinEdge,f=n.centerMaxEdge;return r<t?i?0:s:e<r?u?a:f:(r-t)/o*c}function Gx(n){return n.element().dom().getBoundingClientRect()}function Xx(n,t){return n[t]}function Yx(n){var t=Gx(n);return Xx(t,Xw)}function qx(n){var t=Gx(n);return Xx(t,"right")}function Kx(n){var t=Gx(n);return Xx(t,"top")}function Jx(n){var t=Gx(n);return Xx(t,"bottom")}function $x(n){var t=Gx(n);return Xx(t,"width")}function Qx(n){var t=Gx(n);return Xx(t,"height")}function Zx(n,t,e){return(n+t)/2-e}function nw(n,t){var e=Gx(n),o=Gx(t),r=Xx(e,Xw),i=Xx(e,"right"),u=Xx(o,Xw);return Zx(r,i,u)}function tw(n,t){var e=Gx(n),o=Gx(t),r=Xx(e,"top"),i=Xx(e,"bottom"),u=Xx(o,"top");return Zx(r,i,u)}function ew(n,t){qt(n,Gw(),{value:t})}function ow(n){return{x:nn(n)}}function rw(n,t,e){var o={min:mx(t),max:vx(t),range:Sx(t),value:e,step:Tx(t),snap:Ex(t),snapStart:Dx(t),rounded:Bx(t),hasMinEdge:_x(t),hasMaxEdge:Mx(t),minBound:Yx(n),maxBound:qx(n),screenRange:$x(n)};return Ux(o)}function iw(e){return function(n,t){return function(n,t,e){var o=(0<n?Lx:zx)(Rx(e).x(),mx(e),vx(e),Tx(e));return ew(t,ow(o)),on.some(o)}(e,n,t).map(function(){return!0})}}function uw(n,t,e,o,r,i){var u=function(t,n,e,o,r){var i=$x(t),u=o.bind(function(n){return on.some(nw(n,t))}).getOr(0),a=r.bind(function(n){return on.some(nw(n,t))}).getOr(i),c={min:mx(n),max:vx(n),range:Sx(n),value:e,hasMinEdge:_x(n),hasMaxEdge:Mx(n),minBound:Yx(t),minOffset:0,maxBound:qx(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Wx(c)}(t,i,e,o,r);return Yx(t)-Yx(n)+u}function aw(n,t){qt(n,Gw(),{value:t})}function cw(n){return{y:nn(n)}}function sw(n,t,e){var o={min:gx(t),max:bx(t),range:Cx(t),value:e,step:Tx(t),snap:Ex(t),snapStart:Dx(t),rounded:Bx(t),hasMinEdge:Fx(t),hasMaxEdge:Ix(t),minBound:Kx(n),maxBound:Jx(n),screenRange:Qx(n)};return Ux(o)}function fw(e){return function(n,t){return function(n,t,e){var o=(0<n?Lx:zx)(Rx(e).y(),gx(e),bx(e),Tx(e));return aw(t,cw(o)),on.some(o)}(e,n,t).map(function(){return!0})}}function lw(n,t,e,o,r,i){var u=function(t,n,e,o,r){var i=Qx(t),u=o.bind(function(n){return on.some(tw(n,t))}).getOr(0),a=r.bind(function(n){return on.some(tw(n,t))}).getOr(i),c={min:gx(n),max:bx(n),range:Cx(n),value:e,hasMinEdge:Fx(n),hasMaxEdge:Ix(n),minBound:Kx(t),minOffset:0,maxBound:Jx(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return Wx(c)}(t,i,e,o,r);return Kx(t)-Kx(n)+u}function dw(n,t){qt(n,Gw(),{value:t})}function mw(n,t){return{x:nn(n),y:nn(t)}}function gw(e,o){return function(n,t){return function(n,t,e,o){var r=0<n?Lx:zx,i=t?Rx(o).x():r(Rx(o).x(),mx(o),vx(o),Tx(o)),u=t?r(Rx(o).y(),gx(o),bx(o),Tx(o)):Rx(o).y();return dw(e,mw(i,u)),on.some(i)}(e,o,n,t).map(function(){return!0})}}function pw(n){return"<alloy.field."+n+">"}function hw(n){return function(n){return BS[n]}(n)}function vw(n,t,e){return nl.config(Bn({store:{mode:"manual",getValue:t,setValue:e}},n.map(function(n){return{store:{initialValue:n}}}).getOr({})))}function bw(n,t,e){return vw(n,function(n){return t(n.element())},function(n,t){return e(n.element(),t)})}function yw(e,t){function o(n,t){t.stop()}function r(n){return function(t,e){bn(n,function(n){n(t,e)})}}function i(n,t){if(!kh.isDisabled(n)){var e=t.event().raw();a(n,e.dataTransfer.files)}}function u(n,t){var e=t.event().raw().target.files;a(n,e)}var a=function(n,t){nl.setValue(n,function(n){var t=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i");return C(xn(n),function(n){return t.test(n.name)})}(t)),qt(n,ay,{name:e.name})},c=bm({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:ya([Jd("input-file-events",[sr(Xt())])])}),n=e.label.map(function(n){return Ay(n,t)}),s=by.parts().field({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:ya([RS([]),TS(),kh.config({}),kg.config({toggleClass:"dragenter",toggleOnExecute:!1}),Jd("dropzone-events",[rr("dragenter",r([o,kg.toggle])),rr("dragleave",r([o,kg.toggle])),rr("dragover",o),rr("drop",r([o,i])),rr(vo(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:t.translate("Drop an image here")}},Xg.sketch({dom:{tag:"button",innerHtml:t.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(n){c.get(n).element().dom().click()},buttonBehaviours:ya([Xy.config({})])})]}]}}}});return By(n,s,["tox-form__group--stretched"],[])}function xw(n){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:n},behaviours:ya([bg.config({ignore:!0}),Xy.config({})])}}function ww(n,t){qt(n,go(),{raw:{which:9,shiftKey:t}})}function Sw(n,t){var e=LS&&n.sandboxed,o=N(N({},n.label.map(function(n){return{title:n}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),r=function(o){var r=Ee("");return{getValue:function(n){return r.get()},setValue:function(n,t){if(o)_r(n.element(),"srcdoc",t);else{_r(n.element(),"src","javascript:''");var e=n.element().dom().contentWindow.document;e.open(),e.write(t),e.close()}r.set(t)}}}(e),i=n.label.map(function(n){return Ay(n,t)}),u=by.parts().field({factory:{sketch:function(n){return zS({uid:n.uid,dom:{tag:"iframe",attributes:o},behaviours:ya([Xy.config({}),bg.config({}),FS(on.none(),r.getValue,r.setValue)])})}}});return By(i,u,["tox-form__group--stretched"],[])}var Cw=function(t,n){return t.getSystem().getByUid(n.uid+"-"+Qy()).map(function(n){return function(){return an.value(n)}}).getOrThunk(function(){return n.lazySink.fold(function(){return function(){return an.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(n){return function(){return n(t)}})})},kw=nn([ct("dom"),ct("fetch"),Ku("onOpen"),Ju("onExecute"),St("getHotspot",on.some),St("getAnchorOverrides",nn({})),St("layouts",on.none()),Is("dropdownBehaviours",[kg,$y,dg,bg]),ct("toggleClass"),St("eventOrder",{}),ht("lazySink"),St("matchWidth",!1),St("useMinWidth",!1),ht("role")].concat(cx())),Ow=nn([Sl({schema:[Xu()],name:"menu",defaults:function(n){return{onExecute:n.onExecute}}}),Zy()]),Tw=_l({name:"Dropdown",configFields:kw(),partFields:Ow(),factory:function(t,n,e,o){function r(n){Lf.getState(n).each(function(n){jg.highlightPrimary(n)})}function i(n,t){return Kt(n),on.some(!0)}var u,a,c={expand:function(n){kg.isOn(n)||ox(t,function(n){return n},n,o,Z,_y.HighlightNone).get(Z)},open:function(n){kg.isOn(n)||ox(t,function(n){return n},n,o,Z,_y.HighlightFirst).get(Z)},isOpen:kg.isOn,close:function(n){kg.isOn(n)&&ox(t,function(n){return n},n,o,Z,_y.HighlightFirst).get(Z)},repositionMenus:function(n){kg.isOn(n)&&ax(n)}};return{uid:t.uid,dom:t.dom,components:n,behaviours:Vs(t.dropdownBehaviours,[kg.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),$y.config({others:{sandbox:function(n){return ux(t,n,{onOpen:function(){kg.on(n)},onClose:function(){kg.off(n)}})}}}),dg.config({mode:"special",onSpace:i,onEnter:i,onDown:function(n,t){if(Tw.isOpen(n)){var e=$y.getCoupled(n,"sandbox");r(e)}else Tw.open(n);return on.some(!0)},onEscape:function(n,t){return Tw.isOpen(n)?(Tw.close(n),on.some(!0)):on.none()}}),bg.config({})]),events:im(on.some(function(n){ox(t,function(n){return n},n,o,r,_y.HighlightFirst).get(Z)})),eventOrder:N(N({},t.eventOrder),(u={},u[To()]=["disabling","toggling","alloy.base.behaviour"],u)),apis:c,domModification:{attributes:N(N({"aria-haspopup":"true"},t.role.fold(function(){return{}},function(n){return{role:n}})),"button"===t.dom.tag?{type:(a="type",Nn(t.dom,"attributes").bind(function(n){return Nn(n,a)})).getOr("button")}:{})}}},apis:{open:function(n,t){return n.open(t)},expand:function(n,t){return n.expand(t)},close:function(n,t){return n.close(t)},isOpen:function(n,t){return n.isOpen(t)},repositionMenus:function(n,t){return n.repositionMenus(t)}}}),Ew=xa({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(n){return tr([er(xo(),nn(!0))])},exhibit:function(n,t){return Gr({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),Dw=Hr("color-input-change"),Bw=Hr("color-swatch-change"),Aw=Hr("color-picker-cancel"),_w=nn(Hr("rgb-hex-update")),Mw=nn(Hr("slider-update")),Fw=nn(Hr("palette-update")),Iw=Ht().deviceType.isTouch(),Rw=Cl({schema:[ct("dom")],name:"label"}),Vw=lx("top-left"),Nw=lx("top"),Hw=lx("top-right"),Pw=lx("right"),zw=lx("bottom-right"),Lw=lx("bottom"),jw=lx("bottom-left"),Uw=[Rw,lx("left"),Pw,Nw,Lw,Vw,Hw,jw,zw,wl({name:"thumb",defaults:nn({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:tr([ar(eo(),n,"spectrum"),ar(oo(),n,"spectrum"),ar(ro(),n,"spectrum"),ar(uo(),n,"spectrum"),ar(ao(),n,"spectrum"),ar(so(),n,"spectrum")])}}}),wl({schema:[At("mouseIsDown",function(){return Ee(!1)})],name:"spectrum",overrides:function(e){function o(t,n){return r.getValueFromEvent(n).map(function(n){return r.setValueFrom(t,e,n)})}var r=e.model.manager,n=tr([rr(eo(),o),rr(oo(),o)]),t=tr([rr(uo(),o),rr(ao(),function(n,t){e.mouseIsDown.get()&&o(n,t)})]);return{behaviours:ya(Iw?[]:[dg.config({mode:"special",onLeft:function(n){return r.onLeft(n,e)},onRight:function(n){return r.onRight(n,e)},onUp:function(n){return r.onUp(n,e)},onDown:function(n){return r.onDown(n,e)}}),bg.config({})]),events:Iw?n:t}}})],Ww=Ht().deviceType.isTouch(),Gw=nn("slider.change.value"),Xw="left",Yw=iw(-1),qw=iw(1),Kw=on.none,Jw=on.none,$w={"top-left":on.none(),top:on.none(),"top-right":on.none(),right:on.some(function(n,t){Px(n,Vx(yx(t)))}),"bottom-right":on.none(),bottom:on.none(),"bottom-left":on.none(),left:on.some(function(n,t){Px(n,Vx(px(t)))})},Qw=/* */Object.freeze({setValueFrom:function(n,t,e){var o=rw(n,t,e),r=ow(o);return ew(n,r),o},setToMin:function(n,t){var e=mx(t);ew(n,ow(e))},setToMax:function(n,t){var e=vx(t);ew(n,ow(e))},findValueOfOffset:rw,getValueFromEvent:function(n){return dx(n).map(function(n){return n.left()})},findPositionOfValue:uw,setPositionFromValue:function(n,t,e,o){var r=Rx(e),i=uw(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=gu(t.element())/2;li(t.element(),"left",i-u+"px")},onLeft:Yw,onRight:qw,onUp:Kw,onDown:Jw,edgeActions:$w}),Zw=on.none,nS=on.none,tS=fw(-1),eS=fw(1),oS={"top-left":on.none(),top:on.some(function(n,t){Px(n,Nx(hx(t)))}),"top-right":on.none(),right:on.none(),"bottom-right":on.none(),bottom:on.some(function(n,t){Px(n,Nx(xx(t)))}),"bottom-left":on.none(),left:on.none()},rS=/* */Object.freeze({setValueFrom:function(n,t,e){var o=sw(n,t,e),r=cw(o);return aw(n,r),o},setToMin:function(n,t){var e=gx(t);aw(n,cw(e))},setToMax:function(n,t){var e=bx(t);aw(n,cw(e))},findValueOfOffset:sw,getValueFromEvent:function(n){return dx(n).map(function(n){return n.top()})},findPositionOfValue:lw,setPositionFromValue:function(n,t,e,o){var r=Rx(e),i=lw(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),u=fu(t.element())/2;li(t.element(),"top",i-u+"px")},onLeft:Zw,onRight:nS,onUp:tS,onDown:eS,edgeActions:oS}),iS=gw(-1,!1),uS=gw(1,!1),aS=gw(-1,!0),cS=gw(1,!0),sS={"top-left":on.some(function(n,t){Px(n,Hx(px(t),hx(t)))}),top:on.some(function(n,t){Px(n,Hx(kx(t),hx(t)))}),"top-right":on.some(function(n,t){Px(n,Hx(yx(t),hx(t)))}),right:on.some(function(n,t){Px(n,Hx(yx(t),Ox(t)))}),"bottom-right":on.some(function(n,t){Px(n,Hx(yx(t),xx(t)))}),bottom:on.some(function(n,t){Px(n,Hx(kx(t),xx(t)))}),"bottom-left":on.some(function(n,t){Px(n,Hx(px(t),xx(t)))}),left:on.some(function(n,t){Px(n,Hx(px(t),Ox(t)))})},fS=/* */Object.freeze({setValueFrom:function(n,t,e){var o=rw(n,t,e.left()),r=sw(n,t,e.top()),i=mw(o,r);return dw(n,i),i},setToMin:function(n,t){var e=mx(t),o=gx(t);dw(n,mw(e,o))},setToMax:function(n,t){var e=vx(t),o=bx(t);dw(n,mw(e,o))},getValueFromEvent:function(n){return dx(n)},setPositionFromValue:function(n,t,e,o){var r=Rx(e),i=uw(n,o.getSpectrum(n),r.x(),o.getLeftEdge(n),o.getRightEdge(n),e),u=lw(n,o.getSpectrum(n),r.y(),o.getTopEdge(n),o.getBottomEdge(n),e),a=gu(t.element())/2,c=fu(t.element())/2;li(t.element(),"left",i-a+"px"),li(t.element(),"top",u-c+"px")},onLeft:iS,onRight:uS,onUp:aS,onDown:cS,edgeActions:sS}),lS=Ht().deviceType.isTouch(),dS=[St("stepSize",1),St("onChange",Z),St("onChoose",Z),St("onInit",Z),St("onDragStart",Z),St("onDragEnd",Z),St("snapToGrid",!1),St("rounded",!0),ht("snapStart"),st("model",it("mode",{x:[St("minX",0),St("maxX",100),At("value",function(n){return Ee(n.mode.minX)}),ct("getInitialValue"),Zu("manager",Qw)],y:[St("minY",0),St("maxY",100),At("value",function(n){return Ee(n.mode.minY)}),ct("getInitialValue"),Zu("manager",rS)],xy:[St("minX",0),St("maxX",100),St("minY",0),St("maxY",100),At("value",function(n){return Ee({x:nn(n.mode.minX),y:nn(n.mode.minY)})}),ct("getInitialValue"),Zu("manager",fS)]})),Is("sliderBehaviours",[dg,nl])].concat(lS?[]:[At("mouseIsDown",function(){return Ee(!1)})]),mS=Ht().deviceType.isTouch(),gS=_l({name:"Slider",configFields:dS,partFields:Uw,factory:function(i,n,t,e){function u(n){return Js(n,i,"thumb")}function a(n){return Js(n,i,"spectrum")}function o(n){return Ks(n,i,"left-edge")}function r(n){return Ks(n,i,"right-edge")}function c(n){return Ks(n,i,"top-edge")}function s(n){return Ks(n,i,"bottom-edge")}function f(n,t){m.setPositionFromValue(n,t,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})}function l(n,t){d.value.set(t);var e=u(n);return f(n,e),i.onChange(n,e,t),on.some(!0)}var d=i.model,m=d.manager,g=[rr(eo(),function(n,t){i.onDragStart(n,u(n))}),rr(ro(),function(n,t){i.onDragEnd(n,u(n))})],p=[rr(uo(),function(n,t){t.stop(),i.onDragStart(n,u(n)),i.mouseIsDown.set(!0)}),rr(so(),function(n,t){i.onDragEnd(n,u(n))})],h=mS?g:p;return{uid:i.uid,dom:i.dom,components:n,behaviours:Vs(i.sliderBehaviours,H([mS?[]:[dg.config({mode:"special",focusIn:function(n){return Ks(n,i,"spectrum").map(dg.focusIn).map(nn(!0))}})],[nl.config({store:{mode:"manual",getValue:function(n){return d.value.get()}}}),dc.config({channels:{"mouse.released":{onReceive:function(e,n){function t(){Ks(e,i,"thumb").each(function(n){var t=d.value.get();i.onChoose(e,n,t)})}if(mS)t();else{var o=i.mouseIsDown.get();i.mouseIsDown.set(!1),o&&t()}}}}})]])),events:tr([rr(Gw(),function(n,t){l(n,t.event().value())}),Ri(function(n,t){var e=d.getInitialValue();d.value.set(e);var o=u(n);f(n,o);var r=a(n);i.onInit(n,o,r,d.value.get())})].concat(h)),apis:{resetToMin:function(n){m.setToMin(n,i)},resetToMax:function(n){m.setToMax(n,i)},changeValue:l,refresh:f},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,t){n.resetToMin(t)},resetToMax:function(n,t){n.resetToMax(t)},refresh:function(n,t){n.refresh(t)}}}),pS=function(n,t){var e=gS.parts().spectrum({dom:{tag:"div",classes:[t("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=gS.parts().thumb({dom:{tag:"div",classes:[t("hue-slider-thumb")],attributes:{role:"presentation"}}});return gS.sketch({dom:{tag:"div",classes:[t("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:nn({y:nn(0)})},components:[e,o],sliderBehaviours:ya([bg.config({})]),onChange:function(n,t,e){qt(n,Mw(),{value:e})}})},hS=[Is("formBehaviours",[nl])],vS=function(o,n,t){return{uid:o.uid,dom:o.dom,components:n,behaviours:Vs(o.formBehaviours,[nl.config({store:{mode:"manual",getValue:function(n){var t=Qs(n,o);return P(t,function(n,t){return n().bind(function(n){return function(n,t){return n.fold(function(){return an.error(t)},an.value)}(nd.getCurrent(n),"missing current")}).map(nl.getValue)})},setValue:function(e,n){Cn(n,function(t,n){Ks(e,o,n).each(function(n){nd.getCurrent(n).each(function(n){nl.setValue(n,t)})})})}}})]),apis:{getField:function(n,t){return Ks(n,o,t).bind(nd.getCurrent)}}}},bS={getField:Ur(function(n,t,e){return n.getField(t,e)}),sketch:function(n){var e,t=(e=[],{field:function(n,t){return e.push(n),Ws("form",pw(n),t)},record:function(){return e}}),o=n(t),r=t.record(),i=S(r,function(n){return wl({name:n,pname:pw(n)})});return rf("form",hS,i,vS,o)}},yS=Hr("valid-input"),xS=Hr("invalid-input"),wS=Hr("validating-input"),SS="colorcustom.rgb.",CS=function(d,m,g,p){function h(n,t,e,o,r){var i=d(SS+"range"),u=[by.parts().label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),by.parts().field({data:r,factory:xy,inputAttributes:N({type:"text"},"hex"===t?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:ya([function(t,o){return Uy.config({invalidClass:m("invalid"),notify:{onValidate:function(n){qt(n,wS,{type:t})},onValid:function(n){qt(n,yS,{type:t,value:nl.getValue(n)})},onInvalid:function(n){qt(n,xS,{type:t,value:nl.getValue(n)})}},validator:{validate:function(n){var t=nl.getValue(n),e=o(t)?an.value(!0):an.error(d("aria.input.invalid"));return Hy(e)},validateOnLoad:!1}})}(t,n),Xy.config({})]),onSetValue:function(n){Uy.isInvalid(n)&&Uy.run(n).get(Z)}})],a="hex"!==t?[by.parts()["aria-descriptor"]({text:i})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:u.concat(a)}}function v(n,t){var e=t.red(),o=t.green(),r=t.blue();nl.setValue(n,{red:e,green:o,blue:r})}function b(n,t){y.getOpt(n).each(function(n){li(n.element(),"background-color","#"+t.value())})}var y=bm({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});return Al({factory:function(){function r(n){return u[n]().get()}function i(n,t){u[n]().set(t)}function t(n,t){var e=t.event();"hex"!==e.type()?i(e.type(),on.none()):p(n)}function o(e,n,t){var o=parseInt(t,10);i(n,on.some(o)),r("red").bind(function(e){return r("green").bind(function(t){return r("blue").map(function(n){return Gh(e,t,n,1)})})}).each(function(n){var t=function(t,n){var e=Wh(n);return bS.getField(t,"hex").each(function(n){bg.isFocused(n)||nl.setValue(t,{hex:e.value()})}),e}(e,n);b(e,t)})}function e(n,t){var e=t.event();!function(n){return"hex"===n.type()}(e)?o(n,e.type(),e.value()):function(n,t){g(n);var e=zh(t);i("hex",on.some(t));var o=qh(e);v(n,o),a(o),qt(n,_w(),{hex:e}),b(n,e)}(n,e.value())}function n(n){return{label:d(SS+n+".label"),description:d(SS+n+".description")}}var u={red:nn(Ee(on.some(255))),green:nn(Ee(on.some(255))),blue:nn(Ee(on.some(255))),hex:nn(Ee(on.some("ffffff")))},a=function(n){var t=n.red(),e=n.green(),o=n.blue();i("red",on.some(t)),i("green",on.some(e)),i("blue",on.some(o))},c=n("red"),s=n("green"),f=n("blue"),l=n("hex");return Bn(bS.sketch(function(n){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[n.field("red",by.sketch(h(Xh,"red",c.label,c.description,255))),n.field("green",by.sketch(h(Xh,"green",s.label,s.description,255))),n.field("blue",by.sketch(h(Xh,"blue",f.label,f.description,255))),n.field("hex",by.sketch(h(Lh,"hex",l.label,l.description,"ffffff"))),y.asSpec()],formBehaviours:ya([Uy.config({invalidClass:m("form-invalid")}),Jd("rgb-form-events",[rr(yS,e),rr(xS,t),rr(wS,t)])])}}),{apis:{updateHex:function(n,t){nl.setValue(n,{hex:t.value()}),function(n,t){var e=qh(t);v(n,e),a(e)}(n,t),b(n,t)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(n,t,e){n.updateHex(t,e)}},extraApis:{}})},kS=function(n,o){function r(n,t){var e=n.width,o=n.height,r=n.getContext("2d");if(null!==r){r.fillStyle=t,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)}}var i=gS.parts().spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),u=gS.parts().thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"<div class="+o("sv-palette-inner-thumb")+' role="presentation"></div>'}});return Al({factory:function(n){var t=nn({x:nn(0),y:nn(0)}),e=ya([nd.config({find:on.some}),bg.config({})]);return gS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:t},rounded:!1,components:[i,u],onChange:function(n,t,e){qt(n,Fw(),{value:e})},onInit:function(n,t,e,o){r(e.element().dom(),Jh(rv()))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(n,t,e){!function(n,t){var e=n.components()[0].element().dom();r(e,Jh(t))}(t,e)}},extraApis:{}})},OS=function(l,d){return Al({name:"ColourPicker",configFields:[ct("dom"),St("onValidHex",Z),St("onInvalidHex",Z)],factory:function(n){function t(n,e){u.getOpt(n).each(function(n){var t=qh(e);s.paletteRgba().set(t),i.setRgba(n,t)})}function e(n,t){f.getOpt(n).each(function(n){r.updateHex(n,t)})}function a(t,e,n){bn(n,function(n){n(t,e)})}var o,c,r=CS(l,d,n.onValidHex,n.onInvalidHex),i=kS(l,d),s={paletteRgba:nn(Ee(rv()))},u=bm(i.sketch({})),f=bm(r.sketch({}));return{uid:n.uid,dom:n.dom,components:[u.asSpec(),pS(l,d),f.asSpec()],behaviours:ya([Jd("colour-picker-events",[rr(Fw(),(c=[e],function(n,t){var e=t.event().value(),o=function(n){var t,e=0,o=0,r=n.red()/255,i=n.green()/255,u=n.blue()/255,a=Math.min(r,Math.min(i,u)),c=Math.max(r,Math.max(i,u));return a===c?fx(0,0,100*(o=a)):(e=60*((e=r===a?3:u===a?1:5)-(r===a?i-u:u===a?r-i:u-r)/(c-a)),t=(c-a)/c,o=c,fx(Math.round(e),Math.round(100*t),Math.round(100*o)))}(s.paletteRgba().get()),r=fx(o.hue(),e.x(),100-e.y()),i=Yh(r),u=Wh(i);a(n,u,c)})),rr(Mw(),(o=[t,e],function(n,t){var e=function(n){var t=fx((100-n)/100*360,100,100),e=Yh(t);return Wh(e)}(t.event().value().y());a(n,e,o)}))]),nd.config({find:function(n){return f.getOpt(n)}}),dg.config({mode:"acyclic"})])}}})},TS=function(){return nd.config({find:on.some})},ES=function(n){return nd.config({find:n.getOpt})},DS=function(n){return nd.config({find:function(t){return wr(t.element(),n).bind(function(n){return t.getSystem().getByDom(n).toOption()})}})},BS={"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"},AS=tinymce.util.Tools.resolve("tinymce.Resource"),_S=de([St("preprocess",l),St("postprocess",l)]),MS=function(r,n){var i=ot("RepresentingConfigs.memento processors",_S,n);return nl.config({store:{mode:"manual",getValue:function(n){var t=r.get(n),e=nl.getValue(t);return i.postprocess(e)},setValue:function(n,t){var e=i.preprocess(t),o=r.get(n);nl.setValue(o,e)}}})},FS=vw,IS=function(n){return bw(n,Dr,Br)},RS=function(n){return nl.config({store:{mode:"memory",initialValue:n}})},VS=Hr("alloy-fake-before-tabstop"),NS=Hr("alloy-fake-after-tabstop"),HS=function(n){return db(n,["."+VS,"."+NS].join(","),nn(!1))},PS=function(n,t){var e=t.element();ii(e,VS)?ww(n,!0):ii(e,NS)&&ww(n,!1)},zS=function(n){return{dom:{tag:"div",classes:["tox-navobj"]},components:[xw([VS]),n,xw([NS])],behaviours:ya([DS(1)])}},LS=!(Ht().browser.isIE()||Ht().browser.isEdge());function jS(n,t){return GS(v.document.createElement("canvas"),n,t)}function US(n){var t=jS(n.width,n.height);return WS(t).drawImage(n,0,0),t}function WS(n){return n.getContext("2d")}function GS(n,t,e){return n.width=t,n.height=e,n}function XS(n){return n.naturalWidth||n.width}function YS(n){return n.naturalHeight||n.height}var qS,KS,JS=window.Promise?window.Promise:(qS=$S.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){v.setTimeout(n,1)},KS=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},$S.prototype["catch"]=function(n){return this.then(null,n)},$S.prototype.then=function(e,o){var r=this;return new $S(function(n,t){ZS.call(r,new oC(e,o,n,t))})},$S.all=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var c=Array.prototype.slice.call(1===n.length&&KS(n[0])?n[0]:n);return new $S(function(r,i){if(0===c.length)return r([]);var u=c.length;function a(t,n){try{if(n&&("object"==typeof n||"function"==typeof n)){var e=n.then;if("function"==typeof e)return void e.call(n,function(n){a(t,n)},i)}c[t]=n,0==--u&&r(c)}catch(o){i(o)}}for(var n=0;n<c.length;n++)a(n,c[n])})},$S.resolve=function(t){return t&&"object"==typeof t&&t.constructor===$S?t:new $S(function(n){n(t)})},$S.reject=function(e){return new $S(function(n,t){t(e)})},$S.race=function(r){return new $S(function(n,t){for(var e=0,o=r;e<o.length;e++)o[e].then(n,t)})},$S);function $S(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],rC(n,QS(nC,this),QS(tC,this))}function QS(n,t){return function(){return n.apply(t,arguments)}}function ZS(o){var r=this;null!==this._state?qS(function(){var n=r._state?o.onFulfilled:o.onRejected;if(null!==n){var t;try{t=n(r._value)}catch(e){return void o.reject(e)}o.resolve(t)}else(r._state?o.resolve:o.reject)(r._value)}):this._deferreds.push(o)}function nC(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void rC(QS(t,n),QS(nC,this),QS(tC,this))}this._state=!0,this._value=n,eC.call(this)}catch(e){tC.call(this,e)}}function tC(n){this._state=!1,this._value=n,eC.call(this)}function eC(){for(var n=0,t=this._deferreds;n<t.length;n++){var e=t[n];ZS.call(this,e)}this._deferreds=[]}function oC(n,t,e,o){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.resolve=e,this.reject=o}function rC(n,t,e){var o=!1;try{n(function(n){o||(o=!0,t(n))},function(n){o||(o=!0,e(n))})}catch(r){if(o)return;o=!0,e(r)}}function iC(e){return new JS(function(n,t){(function p(n){var t=n.split(","),e=/data:([^;]+)/.exec(t[0]);if(!e)return on.none();for(var o=e[1],r=t[1],i=v.atob(r),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var f=1024*s,l=Math.min(1024+f,u),d=new Array(l-f),m=f,g=0;m<l;++g,++m)d[g]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return on.some(new v.Blob(c,{type:o}))})(e).fold(function(){t("uri is not base64: "+e)},n)})}function uC(n,o,r){return o=o||"image/png",v.HTMLCanvasElement.prototype.toBlob?new JS(function(t,e){n.toBlob(function(n){n?t(n):e()},o,r)}):iC(n.toDataURL(o,r))}function aC(n){return function t(a){return new JS(function(n,t){var e=v.URL.createObjectURL(a),o=new v.Image,r=function(){o.removeEventListener("load",i),o.removeEventListener("error",u)};function i(){r(),n(o)}function u(){r(),t("Unable to load data of type "+a.type+": "+e)}o.addEventListener("load",i),o.addEventListener("error",u),o.src=e,o.complete&&i()})}(n).then(function(n){!function e(n){v.URL.revokeObjectURL(n.src)}(n);var t=jS(XS(n),YS(n));return WS(t).drawImage(n,0,0),t})}function cC(n,t,e){var o=t.type;function r(t,e){return n.then(function(n){return function o(n,t,e){return t=t||"image/png",n.toDataURL(t,e)}(n,t,e)})}return{getType:nn(o),toBlob:function i(){return JS.resolve(t)},toDataURL:function u(){return e},toBase64:function a(){return e.split(",")[1]},toAdjustedBlob:function c(t,e){return n.then(function(n){return uC(n,t,e)})},toAdjustedDataURL:r,toAdjustedBase64:function s(n,t){return r(n,t).then(function(n){return n.split(",")[1]})},toCanvas:function f(){return n.then(US)}}}function sC(t){return function n(e){return new JS(function(n){var t=new v.FileReader;t.onloadend=function(){n(t.result)},t.readAsDataURL(e)})}(t).then(function(n){return cC(aC(t),t,n)})}function fC(t,n){return uC(t,n).then(function(n){return cC(JS.resolve(t),n,t.toDataURL())})}function lC(n,t,e){var o="string"==typeof n?parseFloat(n):n;return e<o?o=e:o<t&&(o=t),o}var dC=[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 mC(n,t){for(var e,o=[],r=new Array(25),i=0;i<5;i++){for(var u=0;u<5;u++)o[u]=t[u+5*i];for(u=0;u<5;u++){for(var a=e=0;a<5;a++)e+=n[u+5*a]*o[a];r[u+5*i]=e}}return r}function gC(t,e){return t.toCanvas().then(function(n){return function i(n,t,e){var o=WS(n);var r=function D(n,t){for(var e,o,r,i,u=n.data,a=t[0],c=t[1],s=t[2],f=t[3],l=t[4],d=t[5],m=t[6],g=t[7],p=t[8],h=t[9],v=t[10],b=t[11],y=t[12],x=t[13],w=t[14],S=t[15],C=t[16],k=t[17],O=t[18],T=t[19],E=0;E<u.length;E+=4)e=u[E],o=u[E+1],r=u[E+2],i=u[E+3],u[E]=e*a+o*c+r*s+i*f+l,u[E+1]=e*d+o*m+r*g+i*p+h,u[E+2]=e*v+o*b+r*y+i*x+w,u[E+3]=e*S+o*C+r*k+i*O+T;return n}(o.getImageData(0,0,n.width,n.height),e);return o.putImageData(r,0,0),fC(n,t)}(n,t.getType(),e)})}function pC(t,e){return t.toCanvas().then(function(n){return function u(n,t,e){var o=WS(n);var r=o.getImageData(0,0,n.width,n.height),i=o.getImageData(0,0,n.width,n.height);return i=function w(n,t,e){function o(n,t,e){return e<n?n=e:n<t&&(n=t),n}for(var r=Math.round(Math.sqrt(e.length)),i=Math.floor(r/2),u=n.data,a=t.data,c=n.width,s=n.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=4*(o(f+p-i,0,s-1)*c+v),y=e[p*r+h];d+=u[b]*y,m+=u[1+b]*y,g+=u[2+b]*y}var x=4*(f*c+l);a[x]=o(d,0,255),a[1+x]=o(m,0,255),a[2+x]=o(g,0,255)}return t}(r,i,e),o.putImageData(i,0,0),fC(n,t)}(n,t.getType(),e)})}function hC(e){return function(n,t){return gC(n,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],t))}}function vC(n,t,e,o){return gC(n,function r(n,t,e,o){return mC(n,[t=lC(t,0,2),0,0,0,0,0,e=lC(e,0,2),0,0,0,0,0,o=lC(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],t,e,o))}var bC=function sI(t){return function(n){return gC(n,t)}}([-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]),yC=hC(function fI(n,t){return mC(n,[1,0,0,0,t=lC(255*t,-255,255),0,1,0,0,t,0,0,1,0,t,0,0,0,1,0,0,0,0,0,1])}),xC=hC(function lI(n,t){var e;return t=lC(t,-1,1),mC(n,[(e=(t*=100)<0?127+t/100*127:127*(e=0===(e=t%1)?dC[t]:dC[Math.floor(t)]*(1-e)+dC[Math.floor(t)+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])}),wC=function dI(t){return function(n){return pC(n,t)}}([0,-1,0,-1,5,-1,0,-1,0]),SC=function mI(c){return function(t,e){return t.toCanvas().then(function(n){return function(n,t,e){var o=WS(n),r=new Array(256);for(var i=0;i<r.length;i++)r[i]=c(i,e);var u=function a(n,t){for(var e=n.data,o=0;o<e.length;o+=4)e[o]=t[e[o]],e[o+1]=t[e[o+1]],e[o+2]=t[e[o+2]];return n}(o.getImageData(0,0,n.width,n.height),r);return o.putImageData(u,0,0),fC(n,t)}(n,t.getType(),e)})}}(function(n,t){return 255*Math.pow(n/255,1-t)});function CC(n,t,e){var o=XS(n),r=YS(n),i=t/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 s(u,a,c){return new JS(function(n){var t=XS(u),e=YS(u),o=Math.floor(t*a),r=Math.floor(e*c),i=jS(o,r);WS(i).drawImage(u,0,0,t,e,0,0,o,r),n(i)})}(n,i,u);return a?c.then(function(n){return CC(n,t,e)}):c}function kC(t,e){return t.toCanvas().then(function(n){return function a(n,t,e){var o=jS(n.width,n.height),r=WS(o),i=0,u=0;90!==(e=e<0?360+e:e)&&270!==e||GS(o,o.height,o.width);90!==e&&180!==e||(i=o.width);270!==e&&180!==e||(u=o.height);return r.translate(i,u),r.rotate(e*Math.PI/180),r.drawImage(n,0,0),fC(o,t)}(n,t.getType(),e)})}function OC(t,e){return t.toCanvas().then(function(n){return function i(n,t,e){var o=jS(n.width,n.height),r=WS(o);"v"===e?(r.scale(1,-1),r.drawImage(n,0,-o.height)):(r.scale(-1,1),r.drawImage(n,-o.width,0));return fC(o,t)}(n,t.getType(),e)})}function TC(t,e,o,r,i){return t.toCanvas().then(function(n){return function a(n,t,e,o,r,i){var u=jS(r,i);return WS(u).drawImage(n,-e,-o),fC(u,t)}(n,t.getType(),e,o,r,i)})}function EC(n){return bC(n)}function DC(n){return wC(n)}function BC(n,t){return SC(n,t)}function AC(n,t){return yC(n,t)}function _C(n,t){return xC(n,t)}function MC(n,t){return OC(n,t)}function FC(n,t,e){return function r(t,e,o){return t.toCanvas().then(function(n){return CC(n,e,o).then(function(n){return fC(n,t.getType())})})}(n,t,e)}function IC(n,t){return kC(n,t)}function RC(n,t){return N({dom:{tag:"span",innerHtml:n,classes:["tox-icon","tox-tbtn__icon-wrap"]}},t)}function VC(n,t){return RC(xm(n,t),{})}function NC(n,t){return RC(xm(n,t),{behaviours:ya([gg.config({})])})}function HC(n,t,e){return{dom:{tag:"span",innerHtml:e.translate(n),classes:[t+"__select-label"]},behaviours:ya([gg.config({})])}}function PC(n,t,o){function e(n,t){var e=nl.getValue(n);return bg.focus(e),qt(e,"keydown",{raw:t.event().raw()}),Tw.close(e),on.some(!0)}var r=Ee(Z),i=n.text.map(function(n){return bm(HC(n,t,o.providers))}),u=n.icon.map(function(n){return bm(NC(n,o.providers.icons))}),a=n.role.fold(function(){return{}},function(n){return{role:n}}),c=n.tooltip.fold(function(){return{}},function(n){var t=o.providers.translate(n);return{title:t,"aria-label":t}});return bm(Tw.sketch(N(N({},a),{dom:{tag:"button",classes:[t,t+"--select"].concat(S(n.classes,function(n){return t+"--"+n})),attributes:N({},c)},components:Bh([u.map(function(n){return n.asSpec()}),i.map(function(n){return n.asSpec()}),on.some({dom:{tag:"div",classes:[t+"__select-chevron"],innerHtml:xm("chevron-down",o.providers.icons)}})]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:ya(g(n.dropdownBehaviours,[Th(n.disabled),Ew.config({}),gg.config({}),Jd("dropdown-events",[Ep(n,r),Dp(n,r)]),Jd("menubutton-update-display-text",[rr(fk,function(t,e){i.bind(function(n){return n.getOpt(t)}).each(function(n){gg.set(n,[Ti(o.providers.translate(e.event().text()))])})}),rr(lk,function(t,e){u.bind(function(n){return n.getOpt(t)}).each(function(n){gg.set(n,[NC(e.event().icon(),o.providers.icons)])})})])])),eventOrder:Bn(sk,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:ya([dg.config({mode:"special",onLeft:e,onRight:e})]),lazySink:o.getSink,toggleClass:t+"--active",parts:{menu:Cv(0,n.columns,n.presets)},fetch:function(){return Ny(n.fetch)}}))).asSpec()}function zC(n){return"separator"===n.type}function LC(n,e){var t=O(n,function(n,t){return function(n){return cn(n)}(t)?""===t?n:"|"===t?0<n.length&&!zC(n[n.length-1])?n.concat([dk]):n:Tn(e,t.toLowerCase())?n.concat([e[t.toLowerCase()]]):n:n.concat([t])},[]);return 0<t.length&&zC(t[t.length-1])&&t.pop(),t}function jC(n,t){return function(n){return Tn(n,"getSubmenuItems")}(n)?function(n,t){var e=n.getSubmenuItems(),o=mk(e,t);return{item:n,menus:Bn(o.menus,q(n.value,o.items)),expansions:Bn(o.expansions,q(n.value,n.value))}}(n,t):{item:n,menus:{},expansions:{}}}function UC(n,e,o,t){var r=Hr("primary-menu"),i=mk(n,o.shared.providers.menuItems());if(0===i.items.length)return on.none();var u=ub(r,i.items,e,o,t),a=P(i.menus,function(n,t){return ub(t,n,e,o,!1)}),c=Bn(a,q(r,u));return on.from(jg.tieredData(r,c,i.expansions))}function WC(e){return{isDisabled:function(){return kh.isDisabled(e)},setDisabled:function(n){return kh.set(e,n)},setActive:function(n){var t=e.element();n?(ei(t,"tox-tbtn--enabled"),_r(t,"aria-pressed",!0)):(ri(t,"tox-tbtn--enabled"),Ir(t,"aria-pressed"))},isActive:function(){return ii(e.element(),"tox-tbtn--enabled")}}}function GC(n,t,e,o){return PC({text:n.text,icon:n.icon,tooltip:n.tooltip,role:o,fetch:function(t){n.fetch(function(n){t(UC(n,Ih.CLOSE_ON_EXECUTE,e,!1))})},onSetup:n.onSetup,getApi:WC,columns:1,presets:"normal",classes:[],dropdownBehaviours:[Xy.config({})]},t,e.shared)}function XC(t,o,r){return function(n){n(S(t,function(n){var t=n.text.fold(function(){return{}},function(n){return{text:n}});return N(N({type:n.type},t),{onAction:function(e){return function(n){var t=!n.isActive();n.setActive(t),e.storage.set(t),r.shared.getSink().each(function(n){o().getOpt(n).each(function(n){Sa(n.element()),qt(n,fy,{name:e.name,value:e.storage.get()})})})}}(n),onSetup:function(t){return function(n){n.setActive(t.storage.get())}}(n)})}))}}function YC(n,t,e,o,r){void 0===e&&(e=[]);var i=t.fold(function(){return{}},function(n){return{action:n}}),u=N({buttonBehaviours:ya([Th(n.disabled),Xy.config({}),Jd("button press",[or("click"),or("mousedown")])].concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},i),a=Bn(u,{dom:o});return Bn(a,{components:r})}function qC(n,t,e,o){void 0===o&&(o=[]);var r={tag:"button",classes:["tox-tbtn"],attributes:n.tooltip.map(function(n){return{"aria-label":e.translate(n),title:e.translate(n)}}).getOr({})},i=n.icon.map(function(n){return VC(n,e.icons)}),u=Bh([i]);return YC(n,t,o,r,u)}function KC(n,t,e,o){void 0===o&&(o=[]);var r=qC(n,on.some(t),e,o);return Xg.sketch(r)}function JC(n,t,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=e.translate(n.text),u=n.icon?n.icon.map(function(n){return VC(n,e.icons)}):on.none(),a=u.isSome()?Bh([u]):[],c=u.isSome()?{}:{innerHtml:i},s=g(n.primary||n.borderless?["tox-button"]:["tox-button","tox-button--secondary"],u.isSome()?["tox-button--icon"]:[],n.borderless?["tox-button--naked"]:[],r),f=N(N({tag:"button",classes:s},c),{attributes:{title:i}});return YC(n,t,o,f,a)}function $C(n,t,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=JC(n,on.some(t),e,o,r);return Xg.sketch(i)}function QC(t,e){return function(n){"custom"===e?qt(n,fy,{name:t,value:{}}):"submit"===e?Yt(n,ly):"cancel"===e?Yt(n,sy):v.console.error("Unknown button type: ",e)}}function ZC(n,t,e){if(function(n,t){return"menu"===t}(0,t)){var o=n,r=N(N({},n),{fetch:XC(o.items,function(){return i},e)}),i=bm(GC(r,"tox-tbtn",e,on.none()));return i.asSpec()}if(function(n,t){return"custom"===t||"cancel"===t||"submit"===t}(0,t)){var u=QC(n.name,t),a=N(N({},n),{borderless:!1});return $C(a,u,e.shared.providers,[])}v.console.error("Unknown footer button type: ",t)}function nk(n,t){var e=QC(n.name,"custom");return function(n,t){return By(n,t,[],[])}(on.none(),by.parts().field(N({factory:Xg},JC(n,on.some(e),t,[RS(""),TS()]))))}function tk(n,t){return wl({factory:by,name:n,overrides:function(o){return{fieldBehaviours:ya([Jd("coupled-input-behaviour",[rr(ho(),function(e){(function(n,t,e){return Ks(n,t,e).bind(nd.getCurrent)})(e,o,t).each(function(t){Ks(e,o,"lock").each(function(n){kg.isOn(n)&&o.onLockedChange(e,t,n)})})})])])}}})}function ek(n){var t=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(n);if(null===t)return an.error(n);var e=parseFloat(t[1]),o=t[2];return an.value({value:e,unit:o})}function ok(n,t){function e(n){return Object.prototype.hasOwnProperty.call(o,n)}var o={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,"in":1};return n.unit===t?on.some(n.value):e(n.unit)&&e(t)?o[n.unit]===o[t]?on.some(n.value):on.some(n.value/o[n.unit]*o[t]):on.none()}function rk(n){return on.none()}function ik(n,t){return function(n,t,e){return n.isSome()&&t.isSome()?on.some(e(n.getOrDie(),t.getOrDie())):on.none()}(ek(n).toOption(),ek(t).toOption(),function(n,t){return ok(n,t.unit).map(function(n){return t.value/n}).map(function(n){return function(t,e){return function(n){return ok(n,e).map(function(n){return{value:n*t,unit:e}})}}(n,t.unit)}).getOr(rk)}).getOr(rk)}function uk(o,t){function n(n){return{dom:{tag:"div",classes:["tox-form__group"]},components:n}}function e(e){return by.parts().field({factory:xy,inputClasses:["tox-textfield"],inputBehaviours:ya([kh.config({disabled:o.disabled}),Xy.config({}),Jd("size-input-events",[rr(lo(),function(n,t){qt(n,i,{isField1:e})}),rr(vo(),function(n,t){qt(n,ay,{name:o.name})})])]),selectOnFocus:!1})}function r(n){return{dom:{tag:"label",classes:["tox-label"],innerHtml:t.translate(n)}}}var a=rk,i=Hr("ratio-event"),u=hk.parts().lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:t.translate(o.label.getOr("Constrain proportions"))}},components:[{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__lock"],innerHtml:xm("lock",t.icons)}},{dom:{tag:"span",classes:["tox-icon","tox-lock-icon__unlock"],innerHtml:xm("unlock",t.icons)}}],buttonBehaviours:ya([Th(o.disabled),Xy.config({})])}),c=hk.parts().field1(n([by.parts().label(r("Width")),e(!0)])),s=hk.parts().field2(n([by.parts().label(r("Height")),e(!1)]));return hk.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,n([r("&nbsp;"),u])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(n,t,e){ek(nl.getValue(n)).each(function(n){a(n).each(function(n){nl.setValue(t,function(n){var t,e={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,"in":4,"%":4},o=n.value.toFixed((t=n.unit)in e?e[t]:1);return-1!==o.indexOf(".")&&(o=o.replace(/\.?0*$/,"")),o+n.unit}(n))})})},coupledFieldBehaviours:ya([kh.config({disabled:o.disabled,onDisabled:function(n){hk.getField1(n).bind(by.getField).each(kh.disable),hk.getField2(n).bind(by.getField).each(kh.disable),hk.getLock(n).each(kh.disable)},onEnabled:function(n){hk.getField1(n).bind(by.getField).each(kh.enable),hk.getField2(n).bind(by.getField).each(kh.enable),hk.getLock(n).each(kh.enable)}}),Jd("size-input-events2",[rr(i,function(n,t){var e=t.event().isField1(),o=e?hk.getField1(n):hk.getField2(n),r=e?hk.getField2(n):hk.getField1(n),i=o.map(nl.getValue).getOr(""),u=r.map(nl.getValue).getOr("");a=ik(i,u)})])])})}function ak(r,c){function n(n,t,e,o){return bm($C({name:n,text:n,disabled:e,primary:o,icon:on.none(),borderless:!1},t,c))}function t(n,t,e,o){return bm(KC({name:n,icon:on.some(n),tooltip:on.some(t),disabled:o,primary:!1,borderless:!1},e,c))}function u(n,e){n.map(function(n){var t=n.get(e);t.hasConfigured(kh)&&kh.disable(t)})}function a(n,e){n.map(function(n){var t=n.get(e);t.hasConfigured(kh)&&kh.enable(t)})}function i(n,t,e){qt(n,t,e)}function e(n){return Yt(n,wk.disable())}function o(n){return Yt(n,wk.enable())}function s(n,t){e(n),i(n,vk.transform(),{transform:t}),o(n)}function f(n){return function(){Q.getOpt(n).each(function(n){gg.set(n,[J])})}}function l(n,t){e(n),i(n,vk.transformApply(),{transform:t,swap:f(n)}),o(n)}function d(){return n("Back",function(n){return i(n,vk.back(),{swap:f(n)})},!1,!1)}function m(){return bm({dom:{tag:"div",classes:["tox-spacer"]},behaviours:ya([kh.config({})])})}function g(){return n("Apply",function(n){return i(n,vk.apply(),{swap:f(n)})},!0,!0)}function p(){return function(n){var t=r.getRect();return function(n,t,e,o,r){return TC(n,t,e,o,r)}(n,t.x,t.y,t.w,t.h)}}function h(t,e){return function(n){return t(n,e)}}function v(n,t){!function(n,t){e(n),i(n,vk.tempTransform(),{transform:t}),o(n)}(n,t)}function b(n,t,e,o,r){var i=gS.parts().label({dom:{tag:"label",classes:["tox-label"],innerHtml:c.translate(n)}}),u=gS.parts().spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),a=gS.parts().thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return bm(gS.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e,maxX:r,getInitialValue:nn({x:nn(o)})},components:[i,u,a],sliderBehaviours:ya([bg.config({})]),onChoose:t}))}function y(n,t,e,o,r){return[d(),function(n,r,t,e,o){return b(n,function(n,t,e){var o=h(r,e.x()/100);s(n,o)},t,e,o)}(n,t,e,o,r),g()]}function x(n,t,e,o,r){var i=y(n,t,e,o,r);return Gb.sketch({dom:k,components:i.map(function(n){return n.asSpec()}),containerBehaviours:ya([Jd("image-tools-filter-panel-buttons-events",[rr(wk.disable(),function(n,t){u(i,n)}),rr(wk.enable(),function(n,t){a(i,n)})])])})}function w(t,e,o){return function(n){return function(n,t,e,o){return vC(n,t,e,o)}(n,t,e,o)}}function S(n){return b(n,function(a,n,t){var e=j.getOpt(a),o=W.getOpt(a),r=U.getOpt(a);e.each(function(u){o.each(function(i){r.each(function(n){var t=nl.getValue(u).x()/100,e=nl.getValue(n).x()/100,o=nl.getValue(i).x()/100,r=w(t,e,o);s(a,r)})})})},0,100,200)}function C(t,e,o){return function(n){i(n,vk.swap(),{transform:e,swap:function(){Q.getOpt(n).each(function(n){gg.set(n,[t]),o(n)})}})}}var k={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},O=Z,T=[d(),m(),n("Apply",function(n){var t=p();l(n,t),r.hideCrop()},!1,!0)],E=Gb.sketch({dom:k,components:T.map(function(n){return n.asSpec()}),containerBehaviours:ya([Jd("image-tools-crop-buttons-events",[rr(wk.disable(),function(n,t){u(T,n)}),rr(wk.enable(),function(n,t){a(T,n)})])])}),D=bm(uk({name:"size",label:on.none(),constrain:!0,disabled:!1},c)),B=[d(),m(),D,m(),n("Apply",function(o){D.getOpt(o).each(function(n){var t=nl.getValue(n),e=function(t,e){return function(n){return FC(n,t,e)}}(parseInt(t.width,10),parseInt(t.height,10));l(o,e)})},!1,!0)],A=Gb.sketch({dom:k,components:B.map(function(n){return n.asSpec()}),containerBehaviours:ya([Jd("image-tools-resize-buttons-events",[rr(wk.disable(),function(n,t){u(B,n)}),rr(wk.enable(),function(n,t){a(B,n)})])])}),_=h(MC,"h"),M=h(MC,"v"),F=h(IC,-90),I=h(IC,90),R=[d(),m(),t("flip-horizontally","Flip horizontally",function(n){v(n,_)},!1),t("flip-vertically","Flip vertically",function(n){v(n,M)},!1),t("rotate-left","Rotate counterclockwise",function(n){v(n,F)},!1),t("rotate-right","Rotate clockwise",function(n){v(n,I)},!1),m(),g()],V=Gb.sketch({dom:k,components:R.map(function(n){return n.asSpec()}),containerBehaviours:ya([Jd("image-tools-fliprotate-buttons-events",[rr(wk.disable(),function(n,t){u(R,n)}),rr(wk.enable(),function(n,t){a(R,n)})])])}),N=[d(),m(),g()],H=Gb.sketch({dom:k,components:N.map(function(n){return n.asSpec()})}),P=x("Brightness",AC,-100,0,100),z=x("Contrast",_C,-100,0,100),L=x("Gamma",BC,-100,0,100),j=S("R"),U=S("G"),W=S("B"),G=[d(),j,U,W,g()],X=Gb.sketch({dom:k,components:G.map(function(n){return n.asSpec()})}),Y=on.some(DC),q=on.some(EC),K=[t("crop","Crop",C(E,on.none(),function(n){r.showCrop()}),!1),t("resize","Resize",C(A,on.none(),function(n){D.getOpt(n).each(function(n){var t=r.getMeasurements(),e=t.width,o=t.height;nl.setValue(n,{width:e,height:o})})}),!1),t("orientation","Orientation",C(V,on.none(),O),!1),t("brightness","Brightness",C(P,on.none(),O),!1),t("sharpen","Sharpen",C(H,Y,O),!1),t("contrast","Contrast",C(z,on.none(),O),!1),t("color-levels","Color levels",C(X,on.none(),O),!1),t("gamma","Gamma",C(L,on.none(),O),!1),t("invert","Invert",C(H,q,O),!1)],J=Gb.sketch({dom:k,components:K.map(function(n){return n.asSpec()})}),$=Gb.sketch({dom:{tag:"div"},components:[J],containerBehaviours:ya([gg.config({})])}),Q=bm($);return{memContainer:Q,getApplyButton:function(n){return Q.getOpt(n).map(function(n){var t=n.components()[0];return t.components()[t.components().length-1]})}}}var ck=Hr("toolbar.button.execute"),sk={"alloy.execute":["disabling","alloy.base.behaviour","toggling","toolbar-button-events"]},fk=Hr("update-menu-text"),lk=Hr("update-menu-icon"),dk={type:"separator"},mk=function(n,r){var t=LC(cn(n)?n.split(" "):n,r);return k(t,function(n,t){var e=function(n){if(zC(n))return n;var t=Nn(n,"value").getOrThunk(function(){return Hr("generated-menu-item")});return Bn({value:t},n)}(t),o=jC(e,r);return{menus:Bn(n.menus,o.menus),items:[o.item].concat(n.items),expansions:Bn(n.expansions,o.expansions)}},{menus:{},expansions:{},items:[]})},gk=nn([St("field1Name","field1"),St("field2Name","field2"),$u("onLockedChange"),Yu(["lockClass"]),St("locked",!1),tl("coupledFieldBehaviours",[nd,nl])]),pk=nn([tk("field1","field2"),tk("field2","field1"),wl({factory:Xg,schema:[ct("dom")],name:"lock",overrides:function(n){return{buttonBehaviours:ya([kg.config({selected:n.locked,toggleClass:n.markers.lockClass,aria:{mode:"pressed"}})])}}})]),hk=_l({name:"FormCoupledInputs",configFields:gk(),partFields:pk(),factory:function(o,n,t,e){return{uid:o.uid,dom:o.dom,components:n,behaviours:el(o.coupledFieldBehaviours,[nd.config({find:on.some}),nl.config({store:{mode:"manual",getValue:function(n){var t,e=nf(n,o,["field1","field2"]);return(t={})[o.field1Name]=nl.getValue(e.field1()),t[o.field2Name]=nl.getValue(e.field2()),t},setValue:function(n,t){var e=nf(n,o,["field1","field2"]);$(t,o.field1Name)&&nl.setValue(e.field1(),t[o.field1Name]),$(t,o.field2Name)&&nl.setValue(e.field2(),t[o.field2Name])}}})]),apis:{getField1:function(n){return Ks(n,o,"field1")},getField2:function(n){return Ks(n,o,"field2")},getLock:function(n){return Ks(n,o,"lock")}}}},apis:{getField1:function(n,t){return n.getField1(t)},getField2:function(n,t){return n.getField2(t)},getLock:function(n,t){return n.getLock(t)}}}),vk={undo:nn(Hr("undo")),redo:nn(Hr("redo")),zoom:nn(Hr("zoom")),back:nn(Hr("back")),apply:nn(Hr("apply")),swap:nn(Hr("swap")),transform:nn(Hr("transform")),tempTransform:nn(Hr("temp-transform")),transformApply:nn(Hr("transform-apply"))},bk=nn("save-state"),yk=nn("disable"),xk=nn("enable"),wk={formActionEvent:fy,saveState:bk,disable:yk,enable:xk},Sk=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Ck=tinymce.util.Tools.resolve("tinymce.geom.Rect"),kk=tinymce.util.Tools.resolve("tinymce.util.Observable"),Ok=tinymce.util.Tools.resolve("tinymce.util.Tools"),Tk=tinymce.util.Tools.resolve("tinymce.util.VK");function Ek(n){var t,e;if(n.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),e=0;e<t.length;e++)n[t[e]]=n.changedTouches[0][t[e]]}function Dk(n,r){var i,u,t,a,c,f,l,d=r.document||v.document;r=r||{};var m=d.getElementById(r.handle||n);t=function(n){var t,e,o=function s(n){var t,e,o,r,i,u,a,c=Math.max;return t=n.documentElement,e=n.body,o=c(t.scrollWidth,e.scrollWidth),r=c(t.clientWidth,e.clientWidth),i=c(t.offsetWidth,e.offsetWidth),u=c(t.scrollHeight,e.scrollHeight),a=c(t.clientHeight,e.clientHeight),{width:o<i?r:o,height:u<c(t.offsetHeight,e.offsetHeight)?a:u}}(d);Ek(n),n.preventDefault(),u=n.button,t=m,f=n.screenX,l=n.screenY,e=v.window.getComputedStyle?v.window.getComputedStyle(t,null).getPropertyValue("cursor"):t.runtimeStyle.cursor,i=Sk("<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),Sk(d).on("mousemove touchmove",c).on("mouseup touchend",a),r.start(n)},c=function(n){if(Ek(n),n.button!==u)return a(n);n.deltaX=n.screenX-f,n.deltaY=n.screenY-l,n.preventDefault(),r.drag(n)},a=function(n){Ek(n),Sk(d).off("mousemove touchmove",c).off("mouseup touchend",a),i.remove(),r.stop&&r.stop(n)},this.destroy=function(){Sk(m).off()},Sk(m).on("mousedown touchstart",t)}function Bk(t){function u(n,s){c.getOpt(n).each(function(n){var e=l.get(),o=gu(n.element()),r=fu(n.element()),i=s.dom().naturalWidth*e,u=s.dom().naturalHeight*e,a=Math.max(0,o/2-i/2),c=Math.max(0,r/2-u/2),t={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};di(s,t),f.getOpt(n).each(function(n){di(n.element(),t)}),d.get().each(function(n){var t=m.get();n.setRect({x:t.x*e+a,y:t.y*e+c,w:t.w*e,h:t.h*e}),n.setClampRect({x:a,y:c,w:i,h:u}),n.setViewPortRect({x:0,y:0,w:o,h:r})})})}function e(n,t){var i=Be.fromTag("img");return _r(i,"src",t),function(e){return new Hp(function(n){var t=function(){e.removeEventListener("load",t),n(e)};e.complete?n(e):e.addEventListener("load",t)})}(i.dom()).then(function(){return c.getOpt(n).map(function(n){var t=iu({element:i});gg.replaceAt(n,1,on.some(t));var e=a.get(),o={x:0,y:0,w:i.dom().naturalWidth,h:i.dom().naturalHeight};a.set(o);var r=Ck.inflate(o,-20,-20);return m.set(r),e.w===o.w&&e.h===o.h||function(n,u){c.getOpt(n).each(function(n){var t=gu(n.element()),e=fu(n.element()),o=u.dom().naturalWidth,r=u.dom().naturalHeight,i=Math.min(t/o,e/r);1<=i?l.set(1):l.set(i)})}(n,i),u(n,i),i})})}var f=bm({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),l=Ee(1),d=Ee(on.none()),m=Ee({x:0,y:0,w:1,h:1}),a=Ee({x:0,y:0,w:1,h:1}),n=Gb.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[f.asSpec(),{dom:{tag:"img",attributes:{src:t}}},{dom:{tag:"div"},behaviours:ya([Jd("image-panel-crop-events",[Ri(function(n){c.getOpt(n).each(function(n){var t=n.element().dom(),e=Fk({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},t,function(){});e.toggleVisibility(!1),e.on("updateRect",function(n){var t=n.rect,e=l.get(),o={x:Math.round(t.x/e),y:Math.round(t.y/e),w:Math.round(t.w/e),h:Math.round(t.h/e)};m.set(o)}),d.set(on.some(e))})})])])}],containerBehaviours:ya([gg.config({}),Jd("image-panel-events",[Ri(function(n){e(n,t)})])])}),c=bm(n);return{memContainer:c,updateSrc:e,zoom:function(n,t){var e=l.get(),o=0<t?Math.min(2,e+.1):Math.max(.1,e-.1);l.set(o),c.getOpt(n).each(function(n){var t=n.components()[1].element();u(n,t)})},showCrop:function(){d.get().each(function(n){n.toggleVisibility(!0)})},hideCrop:function(){d.get().each(function(n){n.toggleVisibility(!1)})},getRect:function(){return m.get()},getMeasurements:function(){var n=a.get();return{width:n.w,height:n.h}}}}function Ak(n,t,e,o,r){return KC({name:n,icon:on.some(t),disabled:e,tooltip:on.some(n),primary:!1,borderless:!1},o,r)}function _k(n,t){t?kh.enable(n):kh.disable(n)}var Mk=0,Fk=function(s,e,f,o,r){var l,t,i,u="tox-",a="tox-crid-"+Mk++,c=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}];i=["top","right","bottom","left"];var d=function(n,t){return{x:t.x+n.x,y:t.y+n.y,w:t.w,h:t.h}},m=function(n,t){return{x:t.x-n.x,y:t.y-n.y,w:t.w,h:t.h}};function g(n,t,e,o){var r,i,u,a,c;r=t.x,i=t.y,u=t.w,a=t.h,r+=e*n.deltaX,i+=o*n.deltaY,(u+=e*n.deltaW)<20&&(u=20),(a+=o*n.deltaH)<20&&(a=20),c=s=Ck.clamp({x:r,y:i,w:u,h:a},f,"move"===n.name),c=m(f,c),l.fire("updateRect",{rect:c}),v(c)}function p(t){function n(n,t){t.h<0&&(t.h=0),t.w<0&&(t.w=0),Sk("#"+a+"-"+n,o).css({left:t.x,top:t.y,width:t.w,height:t.h})}Ok.each(c,function(n){Sk("#"+a+"-"+n.name,o).css({left:t.w*n.xMul+t.x,top:t.h*n.yMul+t.y})}),n("top",{x:e.x,y:e.y,w:e.w,h:t.y-e.y}),n("right",{x:t.x+t.w,y:t.y,w:e.w-t.x-t.w+e.x,h:t.h}),n("bottom",{x:e.x,y:t.y+t.h,w:e.w,h:e.h-t.y-t.h+e.y}),n("left",{x:e.x,y:t.y,w:t.x-e.x,h:t.h}),n("move",t)}function h(n){p(s=n)}function v(n){h(d(f,n))}return function b(){Sk('<div id="'+a+'" class="'+u+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),Ok.each(i,function(n){Sk("#"+a,o).append('<div id="'+a+"-"+n+'"class="'+u+'croprect-block" style="display: none" data-mce-bogus="all">')}),Ok.each(c,function(n){Sk("#"+a,o).append('<div id="'+a+"-"+n.name+'" class="'+u+"croprect-handle "+u+"croprect-handle-"+n.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+n.label+'" aria-grabbed="false" title="'+n.label+'">')}),t=Ok.map(c,function n(t){var e;return new Dk(a,{document:o.ownerDocument,handle:a+"-"+t.name,start:function(){e=s},drag:function(n){g(t,e,n.deltaX,n.deltaY)}})}),p(s),Sk(o).on("focusin focusout",function(n){Sk(n.target).attr("aria-grabbed","focus"===n.type?"true":"false")}),Sk(o).on("keydown",function(t){var i;function n(n,t,e,o,r){n.stopPropagation(),n.preventDefault(),g(i,e,o,r)}switch(Ok.each(c,function(n){if(t.target.id===a+"-"+n.name)return i=n,!1}),t.keyCode){case Tk.LEFT:n(t,0,s,-10,0);break;case Tk.RIGHT:n(t,0,s,10,0);break;case Tk.UP:n(t,0,s,0,-10);break;case Tk.DOWN:n(t,0,s,0,10);break;case Tk.ENTER:case Tk.SPACEBAR:t.preventDefault(),r()}})}(),l=Ok.extend({toggleVisibility:function y(n){var t;t=Ok.map(c,function(n){return"#"+a+"-"+n.name}).concat(Ok.map(i,function(n){return"#"+a+"-"+n})).join(","),n?Sk(t,o).show():Sk(t,o).hide()},setClampRect:function x(n){f=n,p(s)},setRect:h,getInnerRect:function(){return m(f,s)},setInnerRect:v,setViewPortRect:function w(n){e=n,p(s)},destroy:function n(){Ok.each(t,function(n){n.destroy()}),t=[]}},kk)};function Ik(n){var t=Ee(n),e=Ee(on.none()),o=function s(){var e=[],o=-1;function n(){return 0<o}function t(){return-1!==o&&o<e.length-1}return{data:e,add:function r(n){var t;return t=e.splice(++o),e.push(n),{state:n,removed:t}},undo:function i(){if(n())return e[--o]},redo:function u(){if(t())return e[++o]},canUndo:n,canRedo:t}}();function r(n){t.set(n)}function i(n){v.URL.revokeObjectURL(n.url)}function u(n){var t=a(n);return r(t),function(n){Ok.each(n,i)}(o.add(t).removed),t.url}o.add(n);var a=function(n){return{blob:n,url:v.URL.createObjectURL(n)}},c=function(){e.get().each(i),e.set(on.none())};return{getBlobState:function(){return t.get()},setBlobState:r,addBlobState:u,getTempState:function(){return e.get().fold(function(){return t.get()},function(n){return n})},updateTempState:function(n){var t=a(n);return c(),e.set(on.some(t)),t.url},addTempState:function(n){var t=a(n);return e.set(on.some(t)),t.url},applyTempState:function(t){return e.get().fold(function(){},function(n){u(n.blob),t()})},destroyTempState:c,undo:function(){var n=o.undo();return r(n),n.url},redo:function(){var n=o.redo();return r(n),n.url},getHistoryStates:function(){return{undoEnabled:o.canUndo(),redoEnabled:o.canRedo()}}}}function Rk(n,t){function i(n){var t=s.getHistoryStates();m.updateButtonUndoStates(n,t.undoEnabled,t.redoEnabled),qt(n,wk.formActionEvent,{name:wk.saveState(),value:t.undoEnabled})}function u(n){return n.toBlob()}function a(n){qt(n,wk.formActionEvent,{name:wk.disable(),value:{}})}function r(t,n,e,o,r){return a(t),function(n){return sC(n)}(n).then(e).then(u).then(o).then(function(n){return l(t,n).then(function(n){return i(t),r(),f(t),n})})["catch"](function(n){return v.console.log(n),f(t),n})}function c(n,t,e){var o=s.getBlobState().blob;r(n,o,t,function(n){return s.updateTempState(n)},e)}var s=Ik(n.currentState),f=function(n){e.getApplyButton(n).each(function(n){kh.enable(n)}),qt(n,wk.formActionEvent,{name:wk.enable(),value:{}})},l=function(n,t){return a(n),o.updateSrc(n,t)},d=function(n){var t=s.getBlobState().url;return s.destroyTempState(),i(n),t},o=Bk(n.currentState.url),m=function(n){var o=bm(Ak("Undo","undo",!0,function(n){qt(n,vk.undo(),{direction:1})},n)),r=bm(Ak("Redo","redo",!0,function(n){qt(n,vk.redo(),{direction:1})},n));return{container:Gb.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),r.asSpec(),Ak("Zoom in","zoom-in",!1,function(n){qt(n,vk.zoom(),{direction:1})},n),Ak("Zoom out","zoom-out",!1,function(n){qt(n,vk.zoom(),{direction:-1})},n)]}),updateButtonUndoStates:function(n,t,e){o.getOpt(n).each(function(n){_k(n,t)}),r.getOpt(n).each(function(n){_k(n,e)})}}}(t),e=ak(o,t);return{dom:{tag:"div",attributes:{role:"presentation"}},components:[e.memContainer.asSpec(),o.memContainer.asSpec(),m.container],behaviours:ya([nl.config({store:{mode:"manual",getValue:function(){return s.getBlobState()}}}),Jd("image-tools-events",[rr(vk.undo(),function(t,n){var e=s.undo();l(t,e).then(function(n){f(t),i(t)})}),rr(vk.redo(),function(t,n){var e=s.redo();l(t,e).then(function(n){f(t),i(t)})}),rr(vk.zoom(),function(n,t){var e=t.event().direction();o.zoom(n,e)}),rr(vk.back(),function(n,t){!function(t){var n=d(t);l(t,n).then(function(n){f(t)})}(n),t.event().swap()(),o.hideCrop()}),rr(vk.apply(),function(n,t){s.applyTempState(function(){d(n),t.event().swap()()})}),rr(vk.transform(),function(n,t){return c(n,t.event().transform(),Z)}),rr(vk.tempTransform(),function(n,t){return function(n,t){var e=s.getTempState().blob;r(n,e,t,function(n){return s.addTempState(n)},Z)}(n,t.event().transform())}),rr(vk.transformApply(),function(n,t){return function(e,n,t){var o=s.getBlobState().blob;r(e,o,n,function(n){var t=s.addBlobState(n);return d(e),t},t)}(n,t.event().transform(),t.event().swap())}),rr(vk.swap(),function(t,n){!function(n){m.updateButtonUndoStates(n,!1,!1)}(t);var e=n.event().transform(),o=n.event().swap();e.fold(function(){o()},function(n){c(t,n,o)})})]),TS()])}}function Vk(e,t){var n=e.label.map(function(n){return Ay(n,t)}),o=[kh.config({disabled:e.disabled}),dg.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:function(n){return Yt(n,ly),on.some(!0)}}),Jd("textfield-change",[rr(ho(),function(n,t){qt(n,ay,{name:e.name})}),rr(ko(),function(n,t){qt(n,ay,{name:e.name})})]),Xy.config({})],r=e.validation.map(function(o){return Uy.config({getRoot:function(n){return br(n.element())},invalidClass:"tox-invalid",validator:{validate:function(n){var t=nl.getValue(n),e=o.validator(t);return Hy(!0===e?an.value(t):an.error(e))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=e.placeholder.fold(nn({}),function(n){return{placeholder:t.translate(n)}}),u=e.inputMode.fold(nn({}),function(n){return{inputmode:n}}),a=N(N({},i),u),c=by.parts().field({tag:!0===e.multiline?"textarea":"input",inputAttributes:a,inputClasses:[e.classname],inputBehaviours:ya(H([o,r])),selectOnFocus:!1,factory:xy}),s=(e.flex?["tox-form__group--stretched"]:[]).concat(e.maximized?["tox-form-group--maximize"]:[]),f=[kh.config({disabled:e.disabled,onDisabled:function(n){by.getField(n).each(kh.disable)},onEnabled:function(n){by.getField(n).each(kh.enable)}})];return By(n,c,s,f)}function Nk(n){var t=Ee(null);return tu({readState:function(){return{timer:null!==t.get()?"set":"unset"}},setTimer:function(n){t.set(n)},cancel:function(){var n=t.get();null!==n&&n.cancel()}})}function Hk(n,t,e){var o=nl.getValue(e);nl.setValue(t,o),BT(t)}function Pk(n,t){var e=n.element(),o=bi(e),r=e.dom();"number"!==Mr(e,"type")&&t(r,o)}function zk(n,t,e){if(n.selectsOver){var o=nl.getValue(t),r=n.getDisplayText(o),i=nl.getValue(e);return 0===n.getDisplayText(i).indexOf(r)?on.some(function(){Hk(0,t,e),function(n,e){Pk(n,function(n,t){return n.setSelectionRange(e,t.length)})}(t,r.length)}):on.none()}return on.none()}function Lk(n){return IT(Ny(n))}function jk(n){return{type:"menuitem",value:n.url,text:n.title,meta:{attach:n.attach},onAction:function(){}}}function Uk(n,t){return{type:"menuitem",value:t,text:n,meta:{attach:undefined},onAction:function(){}}}function Wk(n,t){return function(n){return S(n,jk)}(function(t,n){return C(n,function(n){return n.type===t})}(n,t))}function Gk(n,t){var e=n.toLowerCase();return C(t,function(n){var t=n.meta!==undefined&&n.meta.text!==undefined?n.meta.text:n.text;return Vt(t.toLowerCase(),e)||Vt(n.value.toLowerCase(),e)})}function Xk(e,n,o){var t=nl.getValue(n),r=t.meta.text!==undefined?t.meta.text:t.value;return o.getLinkInformation().fold(function(){return[]},function(n){var t=Gk(r,function(n){return S(n,function(n){return Uk(n,n)})}(o.getHistory(e)));return"file"===e?function(n){return O(n,function(n,t){return 0===n.length||0===t.length?n.concat(t):n.concat(VT,t)},[])}([t,Gk(r,function(n){return Wk("header",n.targets)}(n)),Gk(r,H([function(n){return on.from(n.anchorTop).map(function(n){return Uk("<top>",n)}).toArray()}(n),function(n){return Wk("anchor",n.targets)}(n),function(n){return on.from(n.anchorBottom).map(function(n){return Uk("<bottom>",n)}).toArray()}(n)]))]):t})}function Yk(r,o,i){function u(n){var t=nl.getValue(n);i.addToHistory(t.value,r.filetype)}var n,t,e,a,c,s=o.shared.providers,f=by.parts().field({factory:FT,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":NT,type:"url"},minChars:0,responseTime:0,fetch:function(n){var t=Xk(r.filetype,n,i),e=UC(t,Ih.BUBBLE_TO_SANDBOX,o,!1);return Hy(e)},getHotspot:function(n){return h.getOpt(n)},onSetValue:function(n,t){n.hasConfigured(Uy)&&Uy.run(n).get(Z)},typeaheadBehaviours:ya(H([i.getValidationHandler().map(function(e){return Uy.config({getRoot:function(n){return br(n.element())},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(n,t){d.getOpt(n).each(function(n){_r(n.element(),"title",s.translate(t))})}},validator:{validate:function(n){var t=nl.getValue(n);return RT(function(o){e({type:r.filetype,url:t.value},function(n){if("invalid"===n.status){var t=an.error(n.message);o(t)}else{var e=an.value(n.message);o(e)}})})},validateOnLoad:!1}})}).toArray(),[kh.config({disabled:r.disabled}),Xy.config({}),Jd("urlinput-events",H(["file"===r.filetype?[rr(ho(),function(n){qt(n,ay,{name:r.name})})]:[],[rr(vo(),function(n){qt(n,ay,{name:r.name}),u(n)}),rr(ko(),function(n){qt(n,ay,{name:r.name}),u(n)})]]))]])),eventOrder:(n={},n[ho()]=["streaming","urlinput-events","invalidating"],n),model:{getDisplayText:function(n){return n.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:o.shared.getSink,parts:{menu:Cv(0,0,"normal")},onExecute:function(n,t,e){qt(t,ly,{})},onItemExecute:function(n,t,e,o){u(n),qt(n,ay,{name:r.name})}}),l=r.label.map(function(n){return Ay(n,s)}),d=bm((t="invalid",e=on.some(NT),void 0===(a="warning")&&(a=t),void 0===c&&(c=t),{dom:{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],innerHtml:xm(a,s.icons),attributes:N({title:s.translate(c),"aria-live":"polite"},e.fold(function(){return{}},function(n){return{id:n}}))}})),m=bm({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[d.asSpec()]}),g=i.getUrlPicker(r.filetype),p=Hr("browser.url.event"),h=bm({dom:{tag:"div",classes:["tox-control-wrap"]},components:[f,m.asSpec()],behaviours:ya([kh.config({disabled:r.disabled})])}),v=bm($C({name:r.name,icon:on.some("browse"),text:r.label.getOr(""),disabled:r.disabled,primary:!1,borderless:!0},function(n){return Yt(n,p)},s,[],["tox-browse-url"]));return by.sketch({dom:qy([]),components:l.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:H([[h.asSpec()],g.map(function(){return v.asSpec()}).toArray()])}]),fieldBehaviours:ya([kh.config({disabled:r.disabled,onDisabled:function(n){by.getField(n).each(kh.disable),v.getOpt(n).each(kh.disable)},onEnabled:function(n){by.getField(n).each(kh.enable),v.getOpt(n).each(kh.enable)}}),Jd("url-input-events",[rr(p,function(o){nd.getCurrent(o).each(function(t){var e=nl.getValue(t);g.each(function(n){n(e).get(function(n){nl.setValue(t,n),qt(o,ay,{name:r.name})})})})})])])})}function qk(u,t){function n(o){return function(t,e){Tu(e.event().target(),"[data-collection-item-value]").each(function(n){o(t,e,n,Mr(n,"data-collection-item-value"))})}}var e=u.label.map(function(n){return Ay(n,t)}),o=[rr(fo(),n(function(n,t,e){Sa(e)})),rr(Xt(),n(function(n,t,e,o){t.stop(),qt(n,fy,{name:u.name,value:o})})),rr(lo(),n(function(n,t,e){Ou(n.element(),"."+gh).each(function(n){ri(n,gh)}),ei(e,gh)})),rr(mo(),n(function(n){Ou(n.element(),"."+gh).each(function(n){ri(n,gh)})})),Hi(n(function(n,t,e,o){qt(n,fy,{name:u.name,value:o})}))],r=by.parts().field({dom:{tag:"div",classes:["tox-collection"].concat(1!==u.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:l},behaviours:ya([gg.config({}),nl.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,n){!function(n,t){var e=S(t,function(n){var t=ih.translate(n.text),e=1===u.columns?'<div class="tox-collection__item-label">'+t+"</div>":"",o='<div class="tox-collection__item-icon">'+n.icon+"</div>",r={_:" "," - ":" ","-":" "},i=t.replace(/\_| \- |\-/g,function(n){return r[n]});return'<div class="tox-collection__item" tabindex="-1" data-collection-item-value="'+function(n){return'"'===n?"&quot;":n}(n.value)+'" title="'+i+'" aria-label="'+i+'">'+o+e+"</div>"}),o=1<u.columns&&"auto"!==u.columns?w(e,u.columns):[e],r=S(o,function(n){return'<div class="tox-collection__group">'+n.join("")+"</div>"});Br(n.element(),r.join(""))}(o,n),"auto"===u.columns&&up(o,5,"tox-collection__item").each(function(n){var t=n.numRows,e=n.numColumns;dg.setGridSize(o,t,e)}),Yt(o,py)}}),Xy.config({}),dg.config(function(n,t){return 1===n?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===n?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===t?".tox-swatches__row":".tox-collection__group",cell:"color"===t?"."+ch:"."+ah}}}(u.columns,"normal")),Jd("collection-events",o)])});return By(e,r,["tox-form__group--collection"],[])}function Kk(r){return function(t,e,o){return Nn(e,"name").fold(function(){return r(e,o)},function(n){return t.field(n,r(e,o))})}}function Jk(t,n,e){var o=Bn(e,{shared:{interpreter:function(n){return zT(t,n,o)}}});return zT(t,n,o)}function $k(n){return{colorPicker:function(e){return function(n,t){Wv.colorPickerDialog(e)(n,t)}}(n),hasCustomColors:function(n){return function(){return Iv(n)}}(n),getColors:function(n){return function(){return Rv(n)}}(n),getColorCols:function(n){return function(){return Wv.getColorCols(n)}}(n)}}function Qk(e){return function(n){return on.from(n.getParam("style_formats")).filter(fn)}(e).map(function(n){var t=function(t,n){function e(n){bn(n,function(n){t.formatter.has(n.name)||t.formatter.register(n.name,n.format)})}var o=GT(n);return t.formatter?e(o.customFormats):t.on("init",function(){e(o.customFormats)}),o.formats}(e,n);return function(n){return n.getParam("style_formats_merge",!1,"boolean")}(e)?WT.concat(t):t}).getOr(WT)}function Zk(n,t,e){var o={type:"formatter",isSelected:t(n.format),getStylePreview:e(n.format)};return Bn(n,o)}function nO(r,n,i,u){var o=function(n){return S(n,function(n){var t=wn(n);if($(n,"items")){var e=o(n.items);return Bn(function(n){var t={type:"submenu",isSelected:nn(!1),getStylePreview:function(){return on.none()}};return Bn(n,t)}(n),{getStyleItems:function(){return e}})}return $(n,"format")?function(n){return Zk(n,i,u)}(n):1===t.length&&vn(t,"title")?Bn(n,{type:"separator"}):function(n){var t=Hr(n.title),e={type:"formatter",format:t,isSelected:i(t),getStylePreview:u(t)},o=Bn(n,e);return r.formatter.register(t,o),o}(n)})};return o(n)}function tO(t){return function(n){if(n&&1===n.nodeType){if(n.contentEditable===t)return!0;if(n.getAttribute("data-mce-contenteditable")===t)return!0}return!1}}function eO(n,t,e,o,r){return{type:n,title:t,url:e,level:o,attach:r}}function oO(n){return n.innerText||n.textContent}function rO(n){return function(n){return n&&"A"===n.nodeName&&(n.id||n.name)!==undefined}(n)&&KT(n)}function iO(n){return n&&/^(H[1-6])$/.test(n.nodeName)}function uO(n){return iO(n)&&KT(n)}function aO(n){var t=function(n){return n.id?n.id:Hr("h")}(n);return eO("header",oO(n),"#"+t,function(n){return iO(n)?parseInt(n.nodeName.substr(1),10):0}(n),function(){n.id=t})}function cO(n){var t=n.id||n.name,e=oO(n);return eO("anchor",e||"#"+t,"#"+t,0,Z)}function sO(n){return function(n,t){return S(Lc(Be.fromDom(t),n),function(n){return n.dom()})}("h1,h2,h3,h4,h5,h6,a:not([href])",n)}function fO(n){return 0<XT(n.title).length}function lO(n){return cn(n)&&/^https?/.test(n)}function dO(n){return sn(n)&&I(n,function(n){return!function(n){return fn(n)&&n.length<=5&&B(n,lO)}(n)}).isNone()}function mO(){var n,t=v.localStorage.getItem($T);if(null===t)return{};try{n=JSON.parse(t)}catch(e){if(e instanceof SyntaxError)return v.console.log("Local storage "+$T+" was not valid JSON",e),{};throw e}return dO(n)?n:(v.console.log("Local storage "+$T+" was not valid format",n),{})}function gO(n){var t=mO();return Object.prototype.hasOwnProperty.call(t,n)?t[n]:[]}function pO(t,n){if(lO(t)){var e=mO(),o=Object.prototype.hasOwnProperty.call(e,n)?e[n]:[],r=C(o,function(n){return n!==t});e[n]=[t].concat(r).slice(0,5),function(n){if(!dO(n))throw new Error("Bad format for history:\n"+JSON.stringify(n));v.localStorage.setItem($T,JSON.stringify(n))}(e)}}function hO(n){return!!n}function vO(n){return P(Ok.makeMap(n,/[, ]/),hO)}function bO(n,t,e){var o=function(n,t){return QT.call(n,t)?on.some(n[t]):on.none()}(n,t).getOr(e);return cn(o)?on.some(o):on.none()}function yO(n){return on.some(n.file_picker_callback).filter(dn)}function xO(n,t){var e=function(n){var t=on.some(n.file_picker_types).filter(hO),e=on.some(n.file_browser_callback_types).filter(hO),o=t.or(e).map(vO);return yO(n).fold(function(){return!1},function(n){return o.fold(function(){return!0},function(n){return 0<wn(n).length&&n})})}(n);return ln(e)?e?yO(n):on.none():e[t]?yO(n):on.none()}function wO(t){return{getHistory:gO,addToHistory:pO,getLinkInformation:function(){return function(n){return!1===n.settings.typeahead_urls?on.none():on.some({targets:JT(n.getBody()),anchorTop:bO(n.settings,"anchor_top","#top").getOrUndefined(),anchorBottom:bO(n.settings,"anchor_bottom","#bottom").getOrUndefined()})}(t)},getValidationHandler:function(){return function(n){return on.from(n.settings.file_picker_validator_handler).filter(dn).orThunk(function(){return on.from(n.settings.filepicker_validator_handler).filter(dn)})}(t)},getUrlPicker:function(n){return function(r,i){return xO(r.settings,i).map(function(o){return function(t){return Ny(function(e){var n=Ok.extend({filetype:i},on.from(t.meta).getOr({}));o.call(r,function(n,t){if(!cn(n))throw new Error("Expected value to be string");if(t!==undefined&&!sn(t))throw new Error("Expected meta to be a object");e({value:n,meta:t})},t.value,n)})}})}(t,n)}}}function SO(n,t,e,o){var r=Ee(!1),i={shared:{providers:{icons:function(){return t.ui.registry.getAll().icons},menuItems:function(){return t.ui.registry.getAll().menuItems},translate:ih.translate},interpreter:function(n){return function(n,t){return zT(PT,n,t)}(n,i)},anchors:UT(t,e,o),getSink:function(){return an.value(n)}},urlinput:wO(t),styleselect:function(e){function o(n){return function(){return e.formatter.match(n)}}function r(t){return function(){var n=e.formatter.get(t);return n!==undefined?on.some({tag:0<n.length&&(n[0].inline||n[0].block)||"div",styleAttr:e.formatter.getCssText(t)}):on.none()}}var i=function(n){var t=n.items;return t!==undefined&&0<t.length?D(t,i):[n.format]},u=Ee([]),a=Ee([]),c=Ee([]),s=Ee([]),f=Ee(!1);e.on("init",function(){var n=Qk(e),t=nO(e,n,o,r);u.set(t),a.set(D(t,i))}),e.on("addStyleModifications",function(n){var t=nO(e,n.items,o,r);c.set(t),f.set(n.replace),s.set(D(t,i))});return{getData:function(){var n=f.get()?[]:u.get(),t=c.get();return n.concat(t)},getFlattenedKeys:function(){var n=f.get()?[]:a.get(),t=s.get();return n.concat(t)}}}(t),colorinput:$k(t),dialog:function(n){return{isDraggableModal:function(n){return function(){return function(n){return n.getParam("draggable_modal",!1,"boolean")}(n)}}(n)}}(t),isContextMenuOpen:function(){return r.get()},setContextMenuState:function(n){return r.set(n)}};return i}function CO(n,t,o){var e=function(n,e){return O(n,function(t,n){return e(n,t.len).fold(nn(t),function(n){return{len:n.finish(),list:t.list.concat([n])}})},{len:0,list:[]}).list}(n,function(n,t){var e=o(n);return on.some({element:nn(n),start:nn(t),finish:nn(t+e),width:nn(e)})}),r=C(e,function(n){return n.finish()<=t}),i=k(r,function(n,t){return n+t.width()},0),u=e.slice(r.length);return{within:nn(r),extra:nn(u),withinWidth:nn(i)}}function kO(n){return S(n,function(n){return n.element()})}function OO(n,t,e,o){var r=function(n,t,e){var o=CO(t,n,e);return 0===o.extra().length?on.some(o):on.none()}(n,t,e).getOrThunk(function(){return CO(t,n-e(o),e)}),i=r.within(),u=r.extra(),a=r.withinWidth();return 1===u.length&&u[0].width()<=e(o)?function(n,t,e){var o=kO(n.concat(t));return oE(o,[],e)}(i,u,a):1<=u.length?function(n,t,e,o){var r=kO(n).concat([e]);return oE(r,kO(t),o)}(i,u,o,a):function(n,t,e){return oE(kO(n),[],e)}(i,0,a)}function TO(n,t){var e=S(t,function(n){return cu(n)});eE.setGroups(n,e)}function EO(n,t,e,o){var r=Js(n,t,"primary"),i=Ks(n,t,"overflow-button"),u=$y.getCoupled(n,"overflowGroup");li(r.element(),"visibility","hidden");var a=function(n,t){return n.bind(function(t){return ka(t.element()).bind(function(n){return t.getSystem().getByDom(n).toOption()})}).orThunk(function(){return t.filter(bg.isFocused)})}(e,i);e.each(function(n){eE.setGroups(n,[])});var c=t.builtGroups.get();TO(r,c.concat([u]));var s=gu(r.element()),f=OO(s,c,function(n){return gu(n.element())},u);0===f.extra().length?(gg.remove(r,u),e.each(function(n){eE.setGroups(n,[])})):(TO(r,f.within()),e.each(function(n){TO(n,f.extra())})),hi(r.element(),"visibility"),vi(r.element()),e.each(function(t){i.each(function(n){return kg.set(n,o(t))}),a.each(bg.focus)})}function DO(o,n,t,e,r){var i="alloy.toolbar.toggle";return{uid:o.uid,dom:o.dom,components:n,behaviours:Vs(o.splitToolbarBehaviours,[$y.config({others:N(N({},r.coupling),{overflowGroup:function(t){return uE.sketch(N(N({},e["overflow-group"]()),{items:[Xg.sketch(N(N({},e["overflow-button"]()),{action:function(n){Yt(t,i)}}))]}))}})}),Jd("toolbar-toggle-events",[rr(i,function(n){r.apis.toggle(n)})])]),apis:N({setGroups:function(n,t){!function(n,t){var e=S(t,n.getSystem().build);o.builtGroups.set(e)}(n,t),r.apis.refresh(n)},getMoreButton:function(n){return function(n){return Ks(n,o,"overflow-button")}(n)}},r.apis),domModification:{attributes:{role:"group"}}}}function BO(n){return n.getSystem().isConnected()}function AO(n,t,e){var o=t.lazySink(n).getOrDie(),r=t.getAnchor(n),i=t.getOverflowBounds.map(function(n){return n()});_f.positionWithinBounds(o,r,e,i)}function _O(t,e){var n=Lf.getState($y.getCoupled(t,"sandbox"));EO(t,e,n,BO),n.each(function(n){return AO(t,e,n)})}function MO(t,e){Lf.getState($y.getCoupled(t,"sandbox")).each(function(n){return AO(t,e,n)})}function FO(t,n){return n.getAnimationRoot.fold(function(){return t.element()},function(n){return n(t)})}function IO(n){return n.dimension.property}function RO(n,t){return n.dimension.getDimension(t)}function VO(n,t){var e=FO(n,t);ai(e,[t.shrinkingClass,t.growingClass])}function NO(n,t){ri(n.element(),t.openClass),ei(n.element(),t.closedClass),li(n.element(),IO(t),"0px"),vi(n.element())}function HO(n,t){ri(n.element(),t.closedClass),ei(n.element(),t.openClass),hi(n.element(),IO(t))}function PO(n,t,e,o){e.setCollapsed(),li(n.element(),IO(t),RO(t,n.element())),vi(n.element()),VO(n,t),NO(n,t),t.onStartShrink(n),t.onShrunk(n)}function zO(n,t,e,o){var r=o.getOrThunk(function(){return RO(t,n.element())});e.setCollapsed(),li(n.element(),IO(t),r),vi(n.element());var i=FO(n,t);ri(i,t.growingClass),ei(i,t.shrinkingClass),NO(n,t),t.onStartShrink(n)}function LO(n,t,e){var o=RO(t,n.element());("0px"===o?PO:zO)(n,t,e,on.some(o))}function jO(n,t,e){var o=FO(n,t),r=ii(o,t.shrinkingClass),i=RO(t,n.element());HO(n,t);var u=RO(t,n.element());(r?function(){li(n.element(),IO(t),i),vi(n.element())}:function(){NO(n,t)})(),ri(o,t.shrinkingClass),ei(o,t.growingClass),HO(n,t),li(n.element(),IO(t),u),e.setExpanded(),t.onStartGrow(n)}function UO(n,t,e){var o=FO(n,t);return!0===ii(o,t.growingClass)}function WO(n,t,e){var o=FO(n,t);return!0===ii(o,t.shrinkingClass)}function GO(n){return gE.hasGrown(n)}function XO(n,t){var e=n.outerContainer;!function(n,t){var e=n.outerContainer.element();t&&(n.mothership.broadcastOn([jf()],{target:e}),n.uiMothership.broadcastOn([jf()],{target:e})),n.mothership.broadcastOn([xE],{readonly:t}),n.uiMothership.broadcastOn([xE],{readonly:t})}(n,t),Lt("*",e.element()).forEach(function(n){e.getSystem().getByDom(n).each(function(n){n.hasConfigured(kh)&&kh.set(n,t)})})}function YO(n,t){n.on("init",function(){n.readonly&&XO(t,!0)}),n.on("SwitchMode",function(){return XO(t,n.readonly)}),function(n){return n.getParam("readonly",!1,"boolean")}(n)&&n.setMode("readonly")}function qO(e){var n;return dc.config({channels:(n={},n[xE]={schema:wE,onReceive:function(n,t){e(n).each(function(n){!function(t,e){Lt("*",t.element()).forEach(function(n){t.getSystem().getByDom(n).each(function(n){n.hasConfigured(kh)&&kh.set(n,e)})})}(n,t.readonly)})}},n)})}function KO(n){var t=n.title.fold(function(){return{}},function(n){return{attributes:{title:n}}});return{dom:N({tag:"div",classes:["tox-toolbar__group"]},t),components:[uE.parts().items({})],items:n.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:ya([Xy.config({}),bg.config({})])}}function JO(n){return uE.sketch(KO(n))}function $O(e,n,t){var o=Ri(function(n){var t=S(e.initGroups,JO);eE.setGroups(n,t)});return ya([dg.config({mode:n,onEscape:e.onEscape,selector:".tox-toolbar__group"}),Jd("toolbar-events",[o]),qO(t)])}function QO(n,t){var e=n.cyclicKeying?"cyclic":"acyclic";return{uid:n.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":KO({title:on.none(),items:[]}),"overflow-button":qC({name:"more",icon:on.some("more-drawer"),disabled:!1,tooltip:on.some("More..."),primary:!1,borderless:!1},on.none(),n.backstage.shared.providers)},splitToolbarBehaviours:$O(n,e,t)}}function ZO(r){var n=QO(r,fE.getOverflow),t=fE.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return fE.sketch(N(N({},n),{lazySink:r.getSink,getAnchor:function(){return r.backstage.shared.anchors.toolbarOverflow()},getOverflowBounds:function(){var n=r.moreDrawerData.lazyHeader().element(),t=Su(n),e=hr(n),o=Su(e);return xu(t.x()+4,o.y(),t.width()-8,o.height())},parts:N(N({},n.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"]}}}),components:[t],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))}function nT(n){var t=bE.parts().primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),e=bE.parts().overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=QO(n,bE.getOverflow);return bE.sketch(N(N({},o),{components:[t,e],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(n){n.getSystem().broadcastOn([yE()],{type:"opened"})},onClosed:function(n){n.getSystem().broadcastOn([yE()],{type:"closed"})}}))}function tT(n){var t=n.cyclicKeying?"cyclic":"acyclic";return eE.sketch({uid:n.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(n.type===Ub.scrolling?["tox-toolbar--scrolling"]:[])},components:[eE.parts().groups({})],toolbarBehaviours:$O(n,t,nn(on.none()))})}function eT(n){return tt("toolbarbutton",CE,n)}function oT(n){return tt("menubutton",OE,n)}function rT(n){return tt("ToggleButton",DE,n)}function iT(t){return{isDisabled:function(){return kh.isDisabled(t)},setDisabled:function(n){return kh.set(t,n)}}}function uT(t){return{setActive:function(n){kg.set(t,n)},isActive:function(){return kg.isOn(t)},isDisabled:function(){return kh.isDisabled(t)},setDisabled:function(n){return kh.set(t,n)}}}function aT(n,t){return n.map(function(n){return{"aria-label":t.translate(n),title:t.translate(n)}}).getOr({})}function cT(t,e,n,o,r,i){function u(n){return ih.isRtl()&&vn(qE,n)?n+"-rtl":n}var a,c=ih.isRtl()&&t.exists(function(n){return vn(KE,n)});return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]).concat(c?["tox-tbtn__icon-rtl"]:[]),attributes:aT(n,i)},components:Bh([t.map(function(n){return VC(u(n),i.icons)}),e.map(function(n){return HC(n,"tox-tbtn",i)})]),eventOrder:(a={},a[uo()]=["focusing","alloy.base.behaviour","common-button-display-events"],a),buttonBehaviours:ya([Jd("common-button-display-events",[rr(uo(),function(n,t){t.event().prevent(),Yt(n,YE)})])].concat(o.map(function(n){return LE.config({channel:n,initialData:{icon:t,text:e},renderComponents:function(n,t){return Bh([n.icon.map(function(n){return VC(u(n),i.icons)}),n.text.map(function(n){return HC(n,"tox-tbtn",i)})])}})}).toArray()).concat(r.getOr([])))}}function sT(n,t,e){var o=Ee(Z),r=cT(n.icon,n.text,n.tooltip,on.none(),on.none(),e);return Xg.sketch({dom:r.dom,components:r.components,eventOrder:sk,buttonBehaviours:ya([Jd("toolbar-button-events",[function(e){return Hi(function(t,n){Tp(e,t)(function(n){qt(t,ck,{buttonApi:n}),e.onAction(n)})})}({onAction:n.onAction,getApi:t.getApi}),Ep(t,o),Dp(t,o)]),Dh(n.disabled)].concat(t.toolbarButtonBehaviours))})}function fT(t,n){function e(e){return{isDisabled:function(){return kh.isDisabled(e)},setDisabled:function(n){return kh.set(e,n)},setIconFill:function(n,t){Ou(e.element(),'svg path[id="'+n+'"], rect[id="'+n+'"]').each(function(n){_r(n,"fill",t)})},setIconStroke:function(n,t){Ou(e.element(),'svg path[id="'+n+'"], rect[id="'+n+'"]').each(function(n){_r(n,"stroke",t)})},setActive:function(t){_r(e.element(),"aria-pressed",t),Ou(e.element(),"span").each(function(n){e.getSystem().getByDom(n).each(function(n){return kg.set(n,t)})})},isActive:function(){return Ou(e.element(),"span").exists(function(n){return e.getSystem().getByDom(n).exists(kg.isOn)})}}}var o,r=Hr("channel-update-split-dropdown-display"),i=Ee(Z),u={getApi:e,onSetup:t.onSetup};return XE.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:An({"aria-pressed":!1},aT(t.tooltip,n.providers))},onExecute:function(n){t.onAction(e(n))},onItemExecute:function(n,t,e){},splitDropdownBehaviours:ya([Eh(!1),Jd("split-dropdown-events",[rr(YE,bg.focus),Ep(u,i),Dp(u,i)]),Ew.config({})]),eventOrder:(o={},o[No()]=["alloy.base.behaviour","split-dropdown-events"],o),toggleClass:"tox-tbtn--enabled",lazySink:n.getSink,fetch:function(e,r,o){return function(t){return Ny(function(n){return r.fetch(n)}).map(function(n){return on.from(ab(Bn(Dv(Hr("menu-value"),n,function(n){r.onItemAction(e(t),n)},r.columns,r.presets,Ih.CLOSE_ON_EXECUTE,r.select.getOr(function(){return!1}),o),{movement:Bv(r.columns,r.presets),menuBehaviours:$p("auto"!==r.columns?[]:[Ri(function(o,n){up(o,4,fp(r.presets)).each(function(n){var t=n.numRows,e=n.numColumns;dg.setGridSize(o,t,e)})})])})))})}}(e,t,n.providers),parts:{menu:Cv(0,t.columns,t.presets)},components:[XE.parts().button(cT(t.icon,t.text,on.none(),on.some(r),on.some([kg.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),n.providers)),XE.parts().arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:xm("chevron-down",n.providers.icons)}}),XE.parts()["aria-descriptor"]({text:n.providers.translate("To open the popup, press Shift+Enter")})]})}function lT(o,r){return rr(ck,function(n,t){var e=function(n){return{hide:function(){return Yt(n,Ao())},getValue:function(){return nl.getValue(n)}}}(o.get(n));r.onAction(e,t.event().buttonApi())})}function dT(n,t,e){var o={backstage:{shared:{providers:e}}};return"contextformtogglebutton"===t.type?function(n,t,e){var o=t.original,r=(o.primary,c(o,["primary"])),i=et(rT(N(N({},r),{type:"togglebutton",onAction:function(){}})));return $E(i,e.backstage.shared.providers,[lT(n,t)])}(n,t,o):function(n,t,e){var o=t.original,r=(o.primary,c(o,["primary"])),i=et(eT(N(N({},r),{type:"button",onAction:function(){}})));return JE(i,e.backstage.shared.providers,[lT(n,t)])}(n,t,o)}function mT(n,t){var e=Math.max(t.x(),n.x()),o=n.right()-e,r=t.width()-(e-t.x());return{x:e,width:Math.min(o,r)}}function gT(n){var t=zb(n)||Lb(n)||Yb(n),e=bu(v.window),o=wu(Be.fromDom(n.getContentAreaContainer()));return n.inline&&!t?function(n,t,e){var o=mT(t,e),r=o.x,i=o.width;return xu(r,e.y(),i,e.height())}(0,o,e):n.inline?function(n,t,e){var o=mT(t,e),r=o.x,i=o.width,u=Be.fromDom(n.getContainer()),a=Ou(u,".tox-editor-header").getOr(u),c=wu(a),s=e.height(),f=e.y();if(c.y()>=t.bottom()){var l=Math.min(s+f,c.y());return xu(r,f,i,l-f)}var d=Math.max(f,c.bottom());return xu(r,d,i,s-(d-f))}(n,o,e):function(n,t,e){var o=mT(t,e),r=o.x,i=o.width,u=Be.fromDom(n.getContainer()),a=Ou(u,".tox-editor-header").getOr(u),c=wu(u),s=wu(a),f=Math.max(e.y(),t.y(),s.bottom()),l=c.bottom()-f,d=e.height()-(f-e.y()),m=Math.min(l,d);return xu(r,f,i,m)}(n,o,e)}function pT(t,n){return Au(n,function(n){return n.predicate(t.dom())?on.some({toolbarApi:n,elem:t}):on.none()})}function hT(o,r){return function(t){function n(){t.setActive(o.formatter.match(r));var n=o.formatter.formatChanged(r,t.setActive).unbind;e.set(on.some(n))}var e=Ee(on.none());return o.initialized?n():o.on("init",n),function(){return e.get().each(function(n){return n()})}}}function vT(t){return function(n){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("mceToggleFormat",!1,n.format)})}}}function bT(n,t,e){var o=e.dataset,r="basic"===o.type?function(){return S(o.data,function(n){return Zk(n,e.isSelectedFor,e.getPreviewFor)})}:o.getData;return{items:function(n,u,a){function r(n,t,e,o){var r=u.shared.providers.translate(n.title);if("separator"===n.type)return on.some({type:"separator",text:r});if("submenu"!==n.type)return on.some(N({type:"togglemenuitem",text:r,active:n.isSelected(o),disabled:e,onAction:a.onAction(n)},n.getStylePreview().fold(function(){return{}},function(n){return{meta:{style:n}}})));var i=D(n.getStyleItems(),function(n){return c(n,t,o)});return 0===t&&i.length<=0?on.none():on.some({type:"nestedmenuitem",text:r,disabled:i.length<=0,getSubmenuItems:function(){return D(n.getStyleItems(),function(n){return c(n,t,o)})}})}function i(n){var t=a.getCurrentValue(),e=a.shouldHide?0:1;return D(n,function(n){return c(n,e,t)})}var c=function(n,t,e){var o="formatter"===n.type&&a.isInvalid(n);return 0===t?o?[]:r(n,t,!1,e).toArray():r(n,t,o,e).toArray()};return{validateItems:i,getFetch:function(o,r){return function(n){var t=r(),e=i(t);n(UC(e,Ih.CLOSE_ON_EXECUTE,o,!1))}}}}(0,t,e),getStyleItems:r}}function yT(o,n,t){var e=bT(0,n,t),r=e.items,i=e.getStyleItems;return PC({text:t.icon.isSome()?on.none():on.some(""),icon:t.icon,tooltip:on.from(t.tooltip),role:on.none(),fetch:r.getFetch(n,i),onSetup:function(e){return t.setInitialValue.each(function(n){return n(e.getComponent())}),t.nodeChangeHandler.map(function(n){var t=n(e.getComponent());return o.on("NodeChange",t),function(){o.off("NodeChange",t)}}).getOr(Z)},getApi:function(n){return{getComponent:function(){return n}}},columns:1,presets:"normal",classes:t.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",n.shared)}var xT,wT,ST,CT,kT=Al({name:"HtmlSelect",configFields:[ct("options"),Is("selectBehaviours",[bg,nl]),St("selectClasses",[]),St("selectAttributes",{}),ht("data")],factory:function(e,n){var t=S(e.options,function(n){return{dom:{tag:"option",value:n.value,innerHtml:n.text}}}),o=e.data.map(function(n){return q("initialValue",n)}).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:t,behaviours:Vs(e.selectBehaviours,[bg.config({}),nl.config({store:N({mode:"manual",getValue:function(n){return bi(n.element())},setValue:function(n,t){T(e.options,function(n){return n.value===t}).isSome()&&yi(n.element(),t)}},o)})])}}}),OT=/* */Object.freeze({events:function(n,t){var e=n.stream.streams.setup(n,t);return tr([rr(n.event,e),Vi(function(){return t.cancel()})].concat(n.cancelEvent.map(function(n){return[rr(n,function(){return t.cancel()})]}).getOr([])))}}),TT=/* */Object.freeze({throttle:Nk,init:function(n){return n.stream.streams.state(n)}}),ET=[st("stream",it("mode",{throttle:[ct("delay"),St("stopEvent",!0),Zu("streams",{setup:function(n,t){var e=n.stream,o=$g(n.onStream,e.delay);return t.setTimer(o),function(n,t){o.throttle(n,t),e.stopEvent&&t.stop()}},state:Nk})]})),St("event","input"),ht("cancelEvent"),$u("onStream")],DT=xa({fields:ET,name:"streaming",active:OT,state:TT}),BT=function(n){Pk(n,function(n,t){return n.setSelectionRange(t.length,t.length)})},AT=nn("alloy.typeahead.itemexecute"),_T=nn([ht("lazySink"),ct("fetch"),St("minChars",5),St("responseTime",1e3),Ku("onOpen"),St("getHotspot",on.some),St("getAnchorOverrides",nn({})),St("layouts",on.none()),St("eventOrder",{}),Bt("model",{},[St("getDisplayText",function(n){return n.meta!==undefined&&n.meta.text!==undefined?n.meta.text:n.value}),St("selectsOver",!0),St("populateFromBrowse",!0)]),Ku("onSetValue"),Ju("onExecute"),Ku("onItemExecute"),St("inputClasses",[]),St("inputAttributes",{}),St("inputStyles",{}),St("matchWidth",!0),St("useMinWidth",!1),St("dismissOnBlur",!0),Yu(["openClass"]),ht("initialData"),Is("typeaheadBehaviours",[bg,nl,DT,dg,kg,$y]),At("previewing",function(){return Ee(!0)})].concat(yy()).concat(cx())),MT=nn([Sl({schema:[Xu()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(t,e){o.previewing.get()?t.getSystem().getByUid(o.uid).each(function(n){zk(o.model,n,e).fold(function(){return cd.dehighlight(t,e)},function(n){return n()})}):t.getSystem().getByUid(o.uid).each(function(n){o.model.populateFromBrowse&&Hk(o.model,n,e)}),o.previewing.set(!1)},onExecute:function(n,t){return n.getSystem().getByUid(o.uid).toOption().map(function(n){return qt(n,AT(),{item:t}),!0})},onHover:function(n,t){o.previewing.set(!1),n.getSystem().getByUid(o.uid).each(function(n){o.model.populateFromBrowse&&Hk(o.model,n,t)})}}}})]),FT=_l({name:"Typeahead",configFields:_T(),partFields:MT(),factory:function(r,n,t,i){function e(n,t,e){r.previewing.set(!1);var o=$y.getCoupled(n,"sandbox");if(Lf.isOpen(o))nd.getCurrent(o).each(function(n){cd.getHighlighted(n).fold(function(){e(n)},function(){$t(o,n.element(),"keydown",t)})});else{tx(r,u(n),n,o,i,function(n){nd.getCurrent(n).each(e)},_y.HighlightFirst).get(Z)}}var o=ny(r),u=function(o){return function(n){return n.map(function(n){var t=R(n.menus),e=D(t,function(n){return C(n.items,function(n){return"item"===n.type})});return nl.getState(o).update(S(e,function(n){return n.data})),n})}},a=[bg.config({}),nl.config({onSetValue:r.onSetValue,store:N({mode:"dataset",getDataKey:function(n){return bi(n.element())},getFallbackEntry:function(n){return{value:n,meta:{}}},setValue:function(n,t){yi(n.element(),r.model.getDisplayText(t))}},r.initialData.map(function(n){return q("initialValue",n)}).getOr({}))}),DT.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(n,t){var e=$y.getCoupled(n,"sandbox");if(bg.isFocused(n)&&bi(n.element()).length>=r.minChars){var o=nd.getCurrent(e).bind(function(n){return cd.getHighlighted(n).map(nl.getValue)});r.previewing.set(!0);tx(r,u(n),n,e,i,function(n){nd.getCurrent(e).each(function(n){o.fold(function(){r.model.selectsOver&&cd.highlightFirst(n)},function(t){cd.highlightBy(n,function(n){return nl.getValue(n).value===t.value}),cd.getHighlighted(n).orThunk(function(){return cd.highlightFirst(n),on.none()})})})},_y.HighlightFirst).get(Z)}},cancelEvent:_o()}),dg.config({mode:"special",onDown:function(n,t){return e(n,t,cd.highlightFirst),on.some(!0)},onEscape:function(n){var t=$y.getCoupled(n,"sandbox");return Lf.isOpen(t)?(Lf.close(t),on.some(!0)):on.none()},onUp:function(n,t){return e(n,t,cd.highlightLast),on.some(!0)},onEnter:function(t){var n=$y.getCoupled(t,"sandbox"),e=Lf.isOpen(n);if(e&&!r.previewing.get())return nd.getCurrent(n).bind(function(n){return cd.getHighlighted(n)}).map(function(n){return qt(t,AT(),{item:n}),!0});var o=nl.getValue(t);return Yt(t,_o()),r.onExecute(n,t,o),e&&Lf.close(n),on.some(!0)}}),kg.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),$y.config({others:{sandbox:function(n){return ux(r,n,{onOpen:function(){return kg.on(n)},onClose:function(){return kg.off(n)}})}}}),Jd("typeaheadevents",[Hi(function(n){var t=Z;ox(r,u(n),n,i,t,_y.HighlightFirst).get(Z)}),rr(AT(),function(n,t){var e=$y.getCoupled(n,"sandbox");Hk(r.model,n,t.event().item()),Yt(n,_o()),r.onItemExecute(n,e,t.event().item(),nl.getValue(n)),Lf.close(e),BT(n)})].concat(r.dismissOnBlur?[rr(Co(),function(n){var t=$y.getCoupled(n,"sandbox");ka(t.element()).isNone()&&Lf.close(t)})]:[]))];return{uid:r.uid,dom:ty(Bn(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:N(N({},o),Vs(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),IT=function(i){return N(N({},i),{toCached:function(){return IT(i.toCached())},bindFuture:function(t){return IT(i.bind(function(n){return n.fold(function(n){return Hy(an.error(n))},function(n){return t(n)})}))},bindResult:function(t){return IT(i.map(function(n){return n.bind(t)}))},mapResult:function(t){return IT(i.map(function(n){return n.map(t)}))},mapError:function(t){return IT(i.map(function(n){return n.mapError(t)}))},foldResult:function(t,e){return i.map(function(n){return n.fold(t,e)})},withTimeout:function(n,r){return IT(Ny(function(t){var e=!1,o=v.setTimeout(function(){e=!0,t(an.error(r()))},n);i.get(function(n){e||(v.clearTimeout(o),t(n))})}))}})},RT=Lk,VT={type:"separator"},NT=Hr("aria-invalid"),HT={bar:Kk(function(n,t){return function(n,t){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:S(n.items,t.interpreter)}}(n,t.shared)}),collection:Kk(function(n,t){return qk(n,t.shared.providers)}),alertbanner:Kk(function(n,t){return function(t,n){return Gb.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+t.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:xm(t.icon,n.icons),attributes:{title:n.translate(t.iconTooltip)}},action:function(n){qt(n,fy,{name:"alert-banner",value:t.url})}})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:n.translate(t.text)}}]})}(n,t.shared.providers)}),input:Kk(function(n,t){return function(n,t){return Vk({name:n.name,multiline:!1,label:n.label,inputMode:n.inputMode,placeholder:n.placeholder,flex:!1,disabled:n.disabled,classname:"tox-textfield",validation:on.none(),maximized:n.maximized},t)}(n,t.shared.providers)}),textarea:Kk(function(n,t){return function(n,t){return Vk({name:n.name,multiline:!0,label:n.label,inputMode:on.none(),placeholder:n.placeholder,flex:!0,disabled:n.disabled,classname:"tox-textarea",validation:on.none(),maximized:n.maximized},t)}(n,t.shared.providers)}),label:Kk(function(n,t){return function(n,t){var e={dom:{tag:"label",innerHtml:t.providers.translate(n.label),classes:["tox-label"]}},o=S(n.items,t.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[e].concat(o),behaviours:ya([TS(),gg.config({}),IS(on.none()),dg.config({mode:"acyclic"})])}}(n,t.shared)}),iframe:(xT=function(n,t){return Sw(n,t.shared.providers)},function(n,t,e){var o=Bn(t,{source:"dynamic"});return Kk(xT)(n,o,e)}),button:Kk(function(n,t){return nk(n,t.shared.providers)}),checkbox:Kk(function(n,t){return function(e,t){function n(n){return n.element().dom().click(),on.some(!0)}function o(n){return{dom:{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+n],innerHtml:xm("checked"===n?"selected":"unselected",t.icons)}}}var r=nl.config({store:{mode:"manual",getValue:function(n){return n.element().dom().checked},setValue:function(n,t){n.element().dom().checked=t}}}),i=by.parts().field({factory:{sketch:l},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:ya([TS(),kh.config({disabled:e.disabled}),Xy.config({}),bg.config({}),r,dg.config({mode:"special",onEnter:n,onSpace:n,stopSpaceKeyup:!0}),Jd("checkbox-events",[rr(vo(),function(n,t){qt(n,ay,{name:e.name})})])])}),u=by.parts().label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:t.translate(e.label)},behaviours:ya([Ew.config({})])}),a=bm({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[o("checked"),o("unchecked")]});return by.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[i,a.asSpec(),u],fieldBehaviours:ya([kh.config({disabled:e.disabled,disableClass:"tox-checkbox--disabled",onDisabled:function(n){by.getField(n).each(kh.disable)},onEnabled:function(n){by.getField(n).each(kh.enable)}})])})}(n,t.shared.providers)}),colorinput:Kk(function(n,t){return sx(n,t.shared,t.colorinput)}),colorpicker:Kk(function(n){function t(n){return"tox-"+n}var e=OS(hw,t),r=bm(e.sketch({dom:{tag:"div",classes:[t("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(n){qt(n,fy,{name:"hex-valid",value:!0})},onInvalidHex:function(n){qt(n,fy,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:ya([nl.config({store:{mode:"manual",getValue:function(n){var t=r.get(n);return nd.getCurrent(t).bind(function(n){return nl.getValue(n).hex}).map(function(n){return"#"+n}).getOr("")},setValue:function(n,t){var e=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(t),o=r.get(n);nd.getCurrent(o).fold(function(){v.console.log("Can not find form")},function(n){nl.setValue(n,{hex:on.from(e[1]).getOr("")}),bS.getField(n,"hex").each(function(n){Yt(n,ho())})})}}}),TS()])}}),dropzone:Kk(function(n,t){return yw(n,t.shared.providers)}),grid:Kk(function(n,t){return function(n,t){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+n.columns+"col"]},components:S(n.items,t.interpreter)}}(n,t.shared)}),selectbox:Kk(function(n,t){return function(e,t){var n=S(e.items,function(n){return{text:t.translate(n.text),value:n.value}}),o=e.label.map(function(n){return Ay(n,t)}),r=by.parts().field({dom:{},selectAttributes:{size:e.size},options:n,factory:kT,selectBehaviours:ya([kh.config({disabled:e.disabled}),Xy.config({}),Jd("selectbox-change",[rr(vo(),function(n,t){qt(n,ay,{name:e.name})})])])}),i=1<e.size?on.none():on.some({dom:{tag:"div",classes:["tox-selectfield__icon-js"],innerHtml:xm("chevron-down",t.icons)}}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:H([[r],i.toArray()])};return by.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:H([o.toArray(),[u]]),fieldBehaviours:ya([kh.config({disabled:e.disabled,onDisabled:function(n){by.getField(n).each(kh.disable)},onEnabled:function(n){by.getField(n).each(kh.enable)}})])})}(n,t.shared.providers)}),sizeinput:Kk(function(n,t){return uk(n,t.shared.providers)}),urlinput:Kk(function(n,t){return Yk(n,t,t.urlinput)}),customeditor:Kk(function(e){var o=Ee(on.none()),t=bm({dom:{tag:e.tag}}),r=Ee(on.none());return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:ya([Jd("editor-foo-events",[Ri(function(n){t.getOpt(n).each(function(t){(!function(n){return Object.prototype.hasOwnProperty.call(n,"init")}(e)?AS.load(e.scriptId,e.scriptUrl).then(function(n){return n(t.element().dom(),e.settings)}):e.init(t.element().dom())).then(function(t){r.get().each(function(n){t.setValue(n)}),r.set(on.none()),o.set(on.some(t))})})})]),nl.config({store:{mode:"manual",getValue:function(){return o.get().fold(function(){return r.get().getOr("")},function(n){return n.getValue()})},setValue:function(n,t){o.get().fold(function(){r.set(on.some(t))},function(n){return n.setValue(t)})}}}),TS()]),components:[t.asSpec()]}}),htmlpanel:Kk(function(n){return"presentation"===n.presets?Gb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:n.html}}):Gb.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:n.html,attributes:{role:"document"}},containerBehaviours:ya([Xy.config({}),bg.config({})])})}),imagetools:Kk(function(n,t){return Rk(n,t.shared.providers)}),table:Kk(function(n,t){return function(n,t){function e(n){return{dom:{tag:"th",innerHtml:t.translate(n)}}}function o(n){return{dom:{tag:"td",innerHtml:t.translate(n)}}}function r(n){return{dom:{tag:"tr"},components:S(n,o)}}var i,u;return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(u=n.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:S(u,e)}]}),(i=n.cells,{dom:{tag:"tbody"},components:S(i,r)})],behaviours:ya([Xy.config({}),bg.config({})])}}(n,t.shared.providers)}),panel:Kk(function(n,t){return function(n,t){return{dom:{tag:"div",classes:n.classes},components:S(n.items,t.shared.interpreter)}}(n,t)})},PT={field:function(n,t){return t}},zT=function(t,e,o){return Nn(HT,e.type).fold(function(){return v.console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e},function(n){return n(t,e,o)})},LT=nn(function(n,t){!function(n,t){var e=Nu.max(n,t,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);li(n,"max-width",e+"px")}(n,Math.floor(t))}),jT={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},UT=function(n,t,e){function o(){return Be.fromDom(n.getBody())}var r=Jb(n);return{toolbar:function(n,t,e){return e?function(){return{anchor:"node",root:n(),node:on.from(n()),bubble:Ta(-12,-12,jT),layouts:{onRtl:function(){return[hm]},onLtr:function(){return[vm]}},overrides:{maxHeightFunction:kf()}}}:function(){return{anchor:"hotspot",hotspot:t(),bubble:Ta(-12,12,jT),layouts:{onRtl:function(){return[aa]},onLtr:function(){return[ca]}},overrides:{maxHeightFunction:kf()}}}}(o,t,r),toolbarOverflow:function(n){return function(){return{anchor:"hotspot",hotspot:n(),overrides:{maxWidthFunction:LT()},layouts:{onRtl:function(){return[aa,ca]},onLtr:function(){return[ca,aa]}}}}}(e),banner:function(n,t,e){return e?function(){return{anchor:"node",root:n(),node:on.from(n()),layouts:{onRtl:function(){return[Wg]},onLtr:function(){return[Wg]}}}}:function(){return{anchor:"hotspot",hotspot:t(),layouts:{onRtl:function(){return[ic]},onLtr:function(){return[ic]}}}}}(o,t,r),cursor:function(t,n){return function(){return{anchor:"selection",root:n(),getSelection:function(){var n=t.selection.getRng();return on.some(Dc.range(Be.fromDom(n.startContainer),n.startOffset,Be.fromDom(n.endContainer),n.endOffset))}}}}(n,o),node:function(t){return function(n){return{anchor:"node",root:t(),node:n}}}(o)}},WT=[{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"}]}],GT=function(n){return O(n,function(n,t){if(function(n){return Tn(n,"items")}(t)){var e=GT(t.items);return{customFormats:n.customFormats.concat(e.customFormats),formats:n.formats.concat([{title:t.title,items:e.formats}])}}if(function(n){return Tn(n,"inline")}(t)||function(n){return Tn(n,"block")}(t)||function(n){return Tn(n,"selector")}(t)){var o="custom-"+t.title.toLowerCase();return{customFormats:n.customFormats.concat([{name:o,format:t}]),formats:n.formats.concat([{title:t.title,format:o,icon:t.icon}])}}return N(N({},n),{formats:n.formats.concat(t)})},{customFormats:[],formats:[]})},XT=Ok.trim,YT=tO("true"),qT=tO("false"),KT=function(n){return function(n){for(;n=n.parentNode;){var t=n.contentEditable;if(t&&"inherit"!==t)return YT(n)}return!1}(n)&&!qT(n)},JT=function(n){var t=sO(n);return C(function(n){return S(C(n,uO),aO)}(t).concat(function(n){return S(C(n,rO),cO)}(t)),fO)},$T="tinymce-url-history",QT=Object.prototype.hasOwnProperty,ZT="contexttoolbar-hide",nE=nn([ct("dom"),St("shell",!0),Is("toolbarBehaviours",[gg])]),tE=nn([Cl({name:"groups",overrides:function(n){return{behaviours:ya([gg.config({})])}}})]),eE=_l({name:"Toolbar",configFields:nE(),partFields:tE(),factory:function(t,n,e,o){var r=function(n){return t.shell?on.some(n):Ks(n,t,"groups")},i=t.shell?{behaviours:[gg.config({})],components:[]}:{behaviours:[],components:n};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:Vs(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(n,t){r(n).fold(function(){throw v.console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(n){gg.set(n,t)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(n,t,e){n.setGroups(t,e)}}}),oE=lr("within","extra","withinWidth"),rE=nn([ct("items"),Yu(["itemSelector"]),Is("tgroupBehaviours",[dg])]),iE=nn([kl({name:"items",unit:"item"})]),uE=_l({name:"ToolbarGroup",configFields:rE(),partFields:iE(),factory:function(n,t,e,o){return{uid:n.uid,dom:n.dom,components:t,behaviours:Vs(n.tgroupBehaviours,[dg.config({mode:"flow",selector:n.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),aE=nn([Is("splitToolbarBehaviours",[$y]),At("builtGroups",function(){return Ee([])})]),cE=nn([Yu(["overflowToggledClass"]),ct("getAnchor"),xt("getOverflowBounds"),ct("lazySink")].concat(aE())),sE=nn([wl({factory:eE,schema:nE(),name:"primary"}),Sl({factory:eE,schema:nE(),name:"overflow",overrides:function(t){return{toolbarBehaviours:ya([dg.config({mode:"cyclic",onEscape:function(n){return Ks(n,t,"overflow-button").each(bg.focus),on.none()}})])}}}),Sl({name:"overflow-button",overrides:function(n){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:ya([kg.config({toggleClass:n.markers.overflowToggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Sl({name:"overflow-group"})]),fE=_l({name:"SplitFloatingToolbar",configFields:cE(),partFields:sE(),factory:function(t,n,e,o){return DO(t,n,0,o,{coupling:{sandbox:function(n){return function(o,e){var r=Eu();return{dom:{tag:"div",attributes:{id:r.id()}},behaviours:ya([dg.config({mode:"special",onEscape:function(n){return Lf.close(n),on.some(!0)}}),Lf.config({onOpen:function(n,t){_O(o,e),Ks(o,e,"overflow-button").each(function(n){kg.on(n),r.link(n.element())}),dg.focusIn(t)},onClose:function(){Ks(o,e,"overflow-button").each(function(n){kg.off(n),bg.focus(n),r.unlink(n.element())})},isPartOf:function(n,t,e){return ju(t,e)||ju(o,e)},getAttachPoint:function(){return e.lazySink(o).getOrDie()}}),dc.config({channels:N({},Ds({isExtraPart:nn(!1),doReposition:function(){return MO(o,e)}}))})])}}(n,t)}},apis:{refresh:function(n){return _O(n,t)},toggle:function(n){return function(n,t,e){var o=$y.getCoupled(n,"sandbox");Lf.isOpen(o)?Lf.close(o):Lf.open(o,e.overflow())}(n,0,o)},getOverflow:function(n){return Lf.getState($y.getCoupled(n,"sandbox"))},reposition:function(n){return MO(n,t)}}})},apis:{setGroups:function(n,t,e){n.setGroups(t,e)},refresh:function(n,t){n.refresh(t)},reposition:function(n,t){n.reposition(t)},getMoreButton:function(n,t){return n.getMoreButton(t)},getOverflow:function(n,t){return n.getOverflow(t)},toggle:function(n,t){n.toggle(t)}}}),lE=/* */Object.freeze({refresh:function(n,t,e){if(e.isExpanded()){hi(n.element(),IO(t));var o=RO(t,n.element());li(n.element(),IO(t),o)}},grow:function(n,t,e){e.isExpanded()||jO(n,t,e)},shrink:function(n,t,e){e.isExpanded()&&LO(n,t,e)},immediateShrink:function(n,t,e){e.isExpanded()&&PO(n,t,e)},hasGrown:function(n,t,e){return e.isExpanded()},hasShrunk:function(n,t,e){return e.isCollapsed()},isGrowing:UO,isShrinking:WO,isTransitioning:function(n,t,e){return!0===UO(n,t)||!0===WO(n,t)},toggleGrow:function(n,t,e){(e.isExpanded()?LO:jO)(n,t,e)},disableTransitions:VO}),dE=/* */Object.freeze({exhibit:function(n,t){var e=t.expanded;return Gr(e?{classes:[t.openClass],styles:{}}:{classes:[t.closedClass],styles:q(t.dimension.property,"0px")})},events:function(e,o){return tr([fr(yo(),function(n,t){t.event().raw().propertyName===e.dimension.property&&(VO(n,e),o.isExpanded()&&hi(n.element(),e.dimension.property),(o.isExpanded()?e.onGrown:e.onShrunk)(n))})])}}),mE=[ct("closedClass"),ct("openClass"),ct("shrinkingClass"),ct("growingClass"),ht("getAnimationRoot"),Ku("onShrunk"),Ku("onStartShrink"),Ku("onGrown"),Ku("onStartGrow"),St("expanded",!1),st("dimension",it("property",{width:[Zu("property","width"),Zu("getDimension",function(n){return gu(n)+"px"})],height:[Zu("property","height"),Zu("getDimension",function(n){return fu(n)+"px"})]}))],gE=xa({fields:mE,name:"sliding",active:dE,apis:lE,state:/* */Object.freeze({init:function(n){var t=Ee(n.expanded);return tu({isExpanded:function(){return!0===t.get()},isCollapsed:function(){return!1===t.get()},setCollapsed:d(t.set,!1),setExpanded:d(t.set,!0),readState:function(){return"expanded: "+t.get()}})}})}),pE=nn([Yu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ku("onOpened"),Ku("onClosed")].concat(aE())),hE=nn([wl({factory:eE,schema:nE(),name:"primary"}),wl({factory:eE,schema:nE(),name:"overflow",overrides:function(t){return{toolbarBehaviours:ya([gE.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(n){Ks(n,t,"overflow-button").each(function(n){kg.off(n),bg.focus(n)}),t.onClosed(n)},onGrown:function(n){dg.focusIn(n),t.onOpened(n)},onStartGrow:function(n){Ks(n,t,"overflow-button").each(kg.on)}}),dg.config({mode:"acyclic",onEscape:function(n){return Ks(n,t,"overflow-button").each(bg.focus),on.some(!0)}})])}}}),Sl({name:"overflow-button",overrides:function(n){return{buttonBehaviours:ya([kg.config({toggleClass:n.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),Sl({name:"overflow-group"})]),vE=function(n,t){var e=Ks(n,t,"overflow");EO(n,t,e,GO),e.each(gE.refresh)},bE=_l({name:"SplitSlidingToolbar",configFields:pE(),partFields:hE(),factory:function(t,n,e,o){return DO(t,n,0,o,{coupling:{},apis:{refresh:function(n){return vE(n,t)},toggle:function(n){return function(t,e){Ks(t,e,"overflow").each(function(n){vE(t,e),gE.toggleGrow(n)})}(n,t)},getOverflow:function(n){return Ks(n,t,"overflow")}}})},apis:{setGroups:function(n,t,e){n.setGroups(t,e)},refresh:function(n,t){n.refresh(t)},getMoreButton:function(n,t){return n.getMoreButton(t)},getOverflow:function(n,t){return n.getOverflow(t)},toggle:function(n,t){n.toggle(t)}}}),yE=nn(Hr("toolbar-height-change")),xE="silver.readonly",wE=de([(wT="readonly",st(wT,Ce))]),SE=[Et("disabled",!1),yt("tooltip"),yt("icon"),yt("text"),Dt("onSetup",function(){return Z})],CE=de([ft("type"),dt("onAction")].concat(SE)),kE=[yt("text"),yt("tooltip"),yt("icon"),dt("fetch"),Dt("onSetup",function(){return Z})],OE=de(g([ft("type")],kE)),TE=de([ft("type"),yt("tooltip"),yt("icon"),yt("text"),xt("select"),dt("fetch"),Dt("onSetup",function(){return Z}),Tt("presets","normal",["normal","color","listpreview"]),St("columns",1),dt("onAction"),dt("onItemAction")]),EE=[Et("active",!1)].concat(SE),DE=de(EE.concat([ft("type"),dt("onAction")])),BE=[Dt("predicate",function(){return!1}),Tt("scope","node",["node","editor"]),Tt("position","selection",["node","selection","line"])],AE=SE.concat([St("type","contextformbutton"),St("primary",!1),dt("onAction"),At("original",l)]),_E=EE.concat([St("type","contextformbutton"),St("primary",!1),dt("onAction"),At("original",l)]),ME=SE.concat([St("type","contextformbutton")]),FE=EE.concat([St("type","contextformtogglebutton")]),IE=it("type",{contextformbutton:AE,contextformtogglebutton:_E}),RE=de([St("type","contextform"),Dt("initValue",function(){return""}),yt("label"),pt("commands",IE),vt("launch",it("type",{contextformbutton:ME,contextformtogglebutton:FE}))].concat(BE)),VE=de([St("type","contexttoolbar"),ft("items")].concat(BE)),NE=/* */Object.freeze({getState:function(n,t,e){return e}}),HE=/* */Object.freeze({events:function(i,u){function o(o,r){i.updateState.each(function(n){var t=n(o,r);u.set(t)}),i.renderComponents.each(function(n){var t=n(r,u.get()),e=S(t,o.getSystem().build);hs(o,e)})}return tr([rr(Oo(),function(n,t){var e=i.channel;vn(t.channels(),e)&&o(n,t.data())}),Ri(function(t,n){i.initialData.each(function(n){o(t,n)})})])}}),PE=/* */Object.freeze({init:function(n){var t=Ee(on.none());return{readState:function(){return t.get().fold(function(){return"none"},function(n){return n})},get:function(){return t.get()},set:function(n){return t.set(n)},clear:function(){return t.set(on.none())}}}}),zE=[ct("channel"),ht("renderComponents"),ht("updateState"),ht("initialData")],LE=xa({fields:zE,name:"reflecting",active:HE,apis:NE,state:PE}),jE=nn([ct("toggleClass"),ct("fetch"),$u("onExecute"),St("getHotspot",on.some),St("getAnchorOverrides",nn({})),St("layouts",on.none()),$u("onItemExecute"),ht("lazySink"),ct("dom"),Ku("onOpen"),Is("splitDropdownBehaviours",[$y,dg,bg]),St("matchWidth",!1),St("useMinWidth",!1),St("eventOrder",{}),ht("role")].concat(cx())),UE=wl({factory:Xg,schema:[ct("dom")],name:"arrow",defaults:function(n){return{buttonBehaviours:ya([bg.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(t.uid).each(Kt)},buttonBehaviours:ya([kg.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),WE=wl({factory:Xg,schema:[ct("dom")],name:"button",defaults:function(n){return{buttonBehaviours:ya([bg.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(e.uid).each(function(n){e.onExecute(n,t)})}}}}),GE=nn([UE,WE,Cl({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:n.text}}}},schema:[ct("text")],name:"aria-descriptor"}),Sl({schema:[Xu()],name:"menu",defaults:function(o){return{onExecute:function(t,e){t.getSystem().getByUid(o.uid).each(function(n){o.onItemExecute(n,t,e)})}}}}),Zy()]),XE=_l({name:"SplitDropdown",configFields:jE(),partFields:GE(),factory:function(o,n,t,e){function r(n){nd.getCurrent(n).each(function(n){cd.highlightFirst(n),dg.focusIn(n)})}function i(n){ox(o,function(n){return n},n,e,r,_y.HighlightFirst).get(Z)}function u(n){var t=Js(n,o,"button");return Kt(t),on.some(!0)}var a=An(tr([Ri(function(e,n){Ks(e,o,"aria-descriptor").each(function(n){var t=Hr("aria");_r(n.element(),"id",t),_r(e.element(),"aria-describedby",t)})})]),im(on.some(i))),c={repositionMenus:function(n){kg.isOn(n)&&ax(n)}};return{uid:o.uid,dom:o.dom,components:n,apis:c,eventOrder:N(N({},o.eventOrder),{"alloy.execute":["disabling","toggling","alloy.base.behaviour"]}),events:a,behaviours:Vs(o.splitDropdownBehaviours,[$y.config({others:{sandbox:function(n){var t=Js(n,o,"arrow");return ux(o,n,{onOpen:function(){kg.on(t),kg.on(n)},onClose:function(){kg.off(t),kg.off(n)}})}}}),dg.config({mode:"special",onSpace:u,onEnter:u,onDown:function(n){return i(n),on.some(!0)}}),bg.config({}),kg.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(n,t){return n.repositionMenus(t)}}}),YE=Hr("focus-button"),qE=["checklist","ordered-list"],KE=["indent","outdent","table-insert-column-after","table-insert-column-before","unordered-list"],JE=function(n,t,e){return sT(n,{toolbarButtonBehaviours:[].concat(0<e.length?[Jd("toolbarButtonWith",e)]:[]),getApi:iT,onSetup:n.onSetup},t)},$E=function(n,t,e){return Bn(sT(n,{toolbarButtonBehaviours:[gg.config({}),kg.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<e.length?[Jd("toolbarToggleButtonWith",e)]:[]),getApi:uT,onSetup:n.onSetup},t))},QE=function(n,t,e){var o=t.label.fold(function(){return{}},function(n){return{"aria-label":n}}),r=bm(xy.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:o,selectOnFocus:!0,inputBehaviours:ya([dg.config({mode:"special",onEnter:function(n){return i.findPrimary(n).map(function(n){return Kt(n),!0})},onLeft:function(n,t){return t.cut(),on.none()},onRight:function(n,t){return t.cut(),on.none()}})])})),i=function(t,n,e){var o=S(n,function(n){return bm(dT(t,n,e))});return{asSpecs:function(){return S(o,function(n){return n.asSpec()})},findPrimary:function(e){return Au(n,function(n,t){return n.primary?on.from(o[t]).bind(function(n){return n.getOpt(e)}).filter(b(kh.isDisabled)):on.none()})}}}(r,t.commands,e.shared.providers);return tT({type:n,uid:Hr("context-toolbar"),initGroups:[{title:on.none(),items:[r.asSpec()]},{title:on.none(),items:i.asSpecs()}],onEscape:on.none,cyclicKeying:!0,backstage:e,getSink:function(){return an.error("")}})},ZE=function(t,e){function n(n){return n.dom()===e.getBody()}var o=Be.fromDom(e.selection.getNode());return pT(o,t.inNodeScope).orThunk(function(){return pT(o,t.inEditorScope).orThunk(function(){return function(n,t,e){for(var o=n.dom(),r=dn(e)?e:nn(!1);o.parentNode;){o=o.parentNode;var i=Be.fromDom(o),u=t(i);if(u.isSome())return u;if(r(i))break}return on.none()}(o,function(n){return pT(n,t.inNodeScope)},n)})})},nD=function(e,r){function o(t,e){var o=et(function(n){return tt("ContextForm",RE,n)}(e));(n[t]=o).launch.map(function(n){c["form:"+t]=N(N({},e.launch),{type:"contextformtogglebutton"===n.type?"togglebutton":"button",onAction:function(){r(o)}})}),"editor"===o.scope?a.push(o):u.push(o),s[t]=o}function i(t,e){(function(n){return tt("ContextToolbar",VE,n)})(e).each(function(n){"editor"===e.scope?a.push(n):u.push(n),s[t]=n})}var n={},u=[],a=[],c={},s={},t=wn(e);return bn(t,function(n){var t=e[n];"contextform"===t.type?o(n,t):"contexttoolbar"===t.type&&i(n,t)}),{forms:n,inNodeScope:u,inEditorScope:a,lookupTable:s,formNavigators:c}},tD=Hr("forward-slide"),eD=Hr("backward-slide"),oD=Hr("change-slide-event"),rD="tox-pop--resizing";(CT=ST=ST||{})[CT.SemiColon=0]="SemiColon",CT[CT.Space=1]="Space";function iD(n,t,e,o){return{type:"basic",data:function(n){return S(n,function(n){var t=n,e=n,o=n.split("=");return 1<o.length&&(t=o[0],e=o[1]),{title:t,format:e}})}(function(n,t){return t===ST.SemiColon?n.replace(/;$/,"").split(";"):n.split(" ")}(Nn(n.settings,t).getOr(e),o))}}function uD(e){function t(n){var t=T(HB,function(n){return e.formatter.match(n.format)}).fold(function(){return"left"},function(n){return n.title.toLowerCase()});qt(n,lk,{icon:"align-"+t})}var n=on.some(function(n){return function(){return t(n)}}),o=on.some(function(n){return t(n)}),r=function(n){return{type:"basic",data:n}}(HB);return{tooltip:"Align",icon:on.some("align-left"),isSelectedFor:function(n){return function(){return e.formatter.match(n)}},getCurrentValue:nn(on.none()),getPreviewFor:function(n){return function(){return on.none()}},onAction:vT(e),setInitialValue:o,nodeChangeHandler:n,dataset:r,shouldHide:!1,isInvalid:function(n){return!e.formatter.canApply(n.format)}}}function aD(n){var t=n.split(/\s*,\s*/);return S(t,function(n){return n.replace(/^['"]+|['"]+$/g,"")})}function cD(r){function i(){function e(n){return n?aD(n)[0]:""}var n=r.queryCommandValue("FontName"),t=u.data,o=n?n.toLowerCase():"";return{matchOpt:T(t,function(n){var t=n.format;return t.toLowerCase()===o||e(t).toLowerCase()===e(o).toLowerCase()}).orThunk(function(){return function(n){var t;return 0===n.indexOf("-apple-system")&&(t=aD(n.toLowerCase()),B(PB,function(n){return-1<t.indexOf(n.toLowerCase())}))}(o)?on.from({title:"System Font",format:o}):on.none()}),font:n}}function t(n){var t=i(),e=t.matchOpt,o=t.font,r=e.fold(function(){return o},function(n){return n.title});qt(n,fk,{text:r})}var n=on.some(function(n){return function(){return t(n)}}),e=on.some(function(n){return t(n)}),u=iD(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",ST.SemiColon);return{tooltip:"Fonts",icon:on.none(),isSelectedFor:function(t){return function(n){return n.exists(function(n){return n.format===t})}},getCurrentValue:function(){return i().matchOpt},getPreviewFor:function(n){return function(){return on.some({tag:"div",styleAttr:-1===n.indexOf("dings")?"font-family:"+n:""})}},onAction:function(n){return function(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,n.format)})}},setInitialValue:e,nodeChangeHandler:n,dataset:u,shouldHide:!1,isInvalid:function(){return!1}}}function sD(n,t){return/[0-9.]+px$/.test(n)?function(n,t){var e=Math.pow(10,t);return Math.round(n*e)/e}(72*parseInt(n,10)/96,t||0)+"pt":n}function fD(e){function i(){var o=on.none(),r=u.data,i=e.queryCommandValue("FontSize");if(i)for(var n=function(n){var t=sD(i,n),e=function(n){return V(zB,n).getOr("")}(t);o=T(r,function(n){return n.format===i||n.format===t||n.format===e})},t=3;o.isNone()&&0<=t;t--)n(t);return{matchOpt:o,px:i}}function t(n){var t=i(),e=t.matchOpt,o=t.px,r=e.fold(function(){return o},function(n){return n.title});qt(n,fk,{text:r})}var n=nn(nn(on.none())),o=on.some(function(n){return function(){return t(n)}}),r=on.some(function(n){return t(n)}),u=iD(e,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",ST.Space);return{tooltip:"Font sizes",icon:on.none(),isSelectedFor:function(t){return function(n){return n.exists(function(n){return n.format===t})}},getPreviewFor:n,getCurrentValue:function(){return i().matchOpt},onAction:function(n){return function(){e.undoManager.transact(function(){e.focus(),e.execCommand("FontSize",!1,n.format)})}},setInitialValue:r,nodeChangeHandler:o,dataset:u,shouldHide:!1,isInvalid:function(){return!1}}}function lD(e,n,t){var o=n();return Au(t,function(t){return T(o,function(n){return e.formatter.matchNode(t,n.format)})}).orThunk(function(){return e.formatter.match("p")?on.some({title:"Paragraph",format:"p"}):on.none()})}function dD(n){var t=n.selection.getStart(!0)||n.getBody();return n.dom.getParents(t,function(){return!0},n.getBody())}function mD(o){function e(n,t){var e=function(n){return lD(o,function(){return r.data},n)}(n).fold(function(){return"Paragraph"},function(n){return n.title});qt(t,fk,{text:e})}var n=on.some(function(t){return function(n){return e(n.parents,t)}}),t=on.some(function(n){var t=dD(o);e(t,n)}),r=iD(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",ST.SemiColon);return{tooltip:"Blocks",icon:on.none(),isSelectedFor:function(n){return function(){return o.formatter.match(n)}},getCurrentValue:nn(on.none()),getPreviewFor:function(t){return function(){var n=o.formatter.get(t);return on.some({tag:0<n.length&&(n[0].inline||n[0].block)||"div",styleAttr:o.formatter.getCssText(t)})}},onAction:vT(o),setInitialValue:t,nodeChangeHandler:n,dataset:r,shouldHide:!1,isInvalid:function(n){return!o.formatter.canApply(n.format)}}}function gD(i,n){function e(n,t){var e=function(n){var t=n.items;return t!==undefined&&0<t.length?D(t,e):[{title:n.title,format:n.format}]},o=D(Qk(i),e),r=lD(i,function(){return o},n).fold(function(){return"Paragraph"},function(n){return n.title});qt(t,fk,{text:r})}var t=on.some(function(t){return function(n){return e(n.parents,t)}}),o=on.some(function(n){var t=dD(i);e(t,n)});return{tooltip:"Formats",icon:on.none(),isSelectedFor:function(n){return function(){return i.formatter.match(n)}},getCurrentValue:nn(on.none()),getPreviewFor:function(t){return function(){var n=i.formatter.get(t);return n!==undefined?on.some({tag:0<n.length&&(n[0].inline||n[0].block)||"div",styleAttr:i.formatter.getCssText(t)}):on.none()}},onAction:vT(i),setInitialValue:o,nodeChangeHandler:t,shouldHide:i.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(n){return!i.formatter.canApply(n.format)},dataset:n}}function pD(o,r){return function(n,t){var e=o(n).mapError(function(n){return ye(n)}).getOrDie();return r(e,t)}}function hD(n){var t=n.toolbar,e=n.buttons;return!1===t?[]:t===undefined||!0===t?function(e){var n=S(LB,function(n){var t=C(n.items,function(n){return Tn(e,n)||Tn(UB,n)});return{name:n.name,items:t}});return C(n,function(n){return 0<n.items.length})}(e):cn(t)?function(n){var t=n.split("|");return S(t,function(n){return{items:n.trim().split(" ")}})}(t):function(n){return h(n,function(n){return Tn(n,"name")&&Tn(n,"items")})}(t)?t:(v.console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])}function vD(t,e,o,r,n){return V(e,o.toLowerCase()).orThunk(function(){return n.bind(function(n){return Au(n,function(n){return V(e,n+o.toLowerCase())})})}).fold(function(){return V(UB,o.toLowerCase()).map(function(n){return n(t,r)}).orThunk(function(){return on.none()})},function(n){return function(t,e){return V(jB,t.type).fold(function(){return v.console.error("skipping button defined by",t),on.none()},function(n){return on.some(n(t,e))})}(n,r)})}function bD(e,o,r,i){var n=hD(o),t=S(n,function(n){var t=D(n.items,function(n){return 0===n.trim().length?[]:vD(e,o.buttons,n,r,i).toArray()});return{title:on.from(e.translate(n.name)),items:t}});return C(t,function(n){return 0<n.items.length})}function yD(e){return(gi(e,"position").is("fixed")?on.none():yr(e)).orThunk(function(){var n=Be.fromTag("span");Sr(e,n);var t=yr(n);return zi(n),t}).map(mu).getOrThunk(function(){return Ru(0,0)})}function xD(t){return function(n){return n.translate(-t.left(),-t.top())}}function wD(t){return function(n){return n.translate(t.left(),t.top())}}function SD(e){return function(n,t){return O(e,function(n,t){return t(n)},Ru(n,t))}}function CD(n,t,e){return n.fold(SD([wD(e),xD(t)]),SD([xD(t)]),SD([]))}function kD(n,t,e){return n.fold(SD([wD(e)]),SD([]),SD([wD(t)]))}function OD(n,t,e){return n.fold(SD([]),SD([xD(e)]),SD([wD(t),xD(e)]))}function TD(n,t,e){return n.fold(function(n,t){return{position:"absolute",left:n+"px",top:t+"px"}},function(n,t){return{position:"absolute",left:n-e.left()+"px",top:t-e.top()+"px"}},function(n,t){return{position:"fixed",left:n+"px",top:t+"px"}})}function ED(n,i,u,a){function t(o,r){return function(n,t){var e=o(i,u,a);return r(n.getOr(e.left()),t.getOr(e.top()))}}return n.fold(t(OD,eA.offset),t(kD,eA.absolute),t(CD,eA.fixed))}function DD(n,t){var e=n.element();ei(e,t.transitionClass),ri(e,t.fadeOutClass),ei(e,t.fadeInClass),t.onShow(n)}function BD(n,t){var e=n.element();ei(e,t.transitionClass),ri(e,t.fadeInClass),ei(e,t.fadeOutClass),t.onHide(n)}function AD(n,t,e){return B(n,function(n){switch(n){case"bottom":return function(n,t){return n.bottom()<=t.bottom()}(t,e);case"top":return function(n,t){return n.y()>=t.y()}(t,e)}})}function _D(n,t){return Fr(n,t)?on.some(parseInt(Mr(n,t),10)):on.none()}function MD(r,n){return _D(r,n.leftAttr).bind(function(o){return _D(r,n.topAttr).map(function(n){var t=gu(r),e=fu(r);return xu(o,n,t,e)})})}function FD(n,t,e){var o=Mr(n,t.positionAttr);switch(function(n,t){Ir(n,t.leftAttr),Ir(n,t.topAttr),Ir(n,t.positionAttr)}(n,t),o){case"static":return on.some(uA["static"]());case"absolute":return on.some(uA.absolute(e.x(),e.y()));default:return on.none()}}function ID(n,t,e,o,r){var i=wu(n);if(AD(t.modes,i,e))return on.none();var u=r(),a=mi(n,"position");!function(n,t,e,o,r){_r(n,t.leftAttr,e),_r(n,t.topAttr,o),_r(n,t.positionAttr,r)}(n,t,i.x(),i.y(),a);var c=rA(i.x(),i.y()),s=CD(c,o,u),f=rA(e.x(),e.y()),l=CD(f,o,u),d=i.y()<=e.y()?l.top():l.top()+e.height()-i.height();return on.some(uA.fixed(s.left(),d))}function RD(n,t,e,o,r){var i=n.element();return gi(i,"position").is("fixed")?function(t,e,o){return MD(t,e).filter(function(n){return AD(e.modes,n,o)}).bind(function(n){return FD(t,e,n)})}(i,t,e):ID(i,t,e,o,r)}function VD(t,n){bn(["left","top","position"],function(n){return hi(t.element(),n)}),n.onUndocked(t)}function ND(n,t,e,o,r){var i=TD(r,0,o);di(n.element(),i),("fixed"===i.position?t.onDocked:t.onUndocked)(n)}function HD(o,n,r,i,u){void 0===u&&(u=!1),n.contextual.each(function(e){e.lazyContext(o).each(function(n){var t=function(n,t){return n.y()<t.bottom()&&n.bottom()>t.y()}(n,i);t!==r.isVisible()&&(r.setVisible(t),u&&!t?(ui(o.element(),[e.fadeOutClass]),e.onHide(o)):(t?DD:BD)(o,e))})})}function PD(r,i,n){var u=r.element();n.setDocked(!1),function(n,t){var e=n.element();return MD(e,t).bind(function(n){return FD(e,t,n)})}(r,i).each(function(n){n.fold(function(){return VD(r,i)},function(n,t){var e=pr(u),o=(hu(e),yD(u));ND(r,i,0,o,rA(n,t))},Z)}),n.setVisible(!0),i.contextual.each(function(n){ai(u,[n.fadeInClass,n.fadeOutClass,n.transitionClass]),n.onShow(r)}),aA(r,i,n)}function zD(n,t,e){e.isDocked()&&PD(n,t,e)}function LD(o){var r=o.element();br(r).each(function(n){if(lA.isDocked(o)){var t=gu(n);li(r,"width",t+"px");var e=lu(r);li(n,"padding-top",e+"px")}else hi(r,"width"),hi(n,"padding-top")})}function jD(n,t){t?(ri(n,dA.fadeOutClass),ui(n,[dA.transitionClass,dA.fadeInClass])):(ri(n,dA.fadeInClass),ui(n,[dA.fadeOutClass,dA.transitionClass]))}function UD(n,t){var e=Be.fromDom(n.getContainer());t?(ei(e,mA),ri(e,gA)):(ei(e,gA),ri(e,mA))}function WD(i,e){function o(t){e().each(function(n){return t(n.element())})}function n(n){i.inline||LD(n),UD(i,lA.isDocked(n)),n.getSystem().broadcastOn([Uf()],{}),e().each(function(n){return n.getSystem().broadcastOn([Uf()],{})})}var r=Ee(on.none()),t=i.inline?[]:function(){var n;return[dc.config({channels:(n={},n[yE()]={onReceive:LD},n)})]}();return g([bg.config({}),lA.config({leftAttr:"data-dock-left",topAttr:"data-dock-top",positionAttr:"data-dock-pos",contextual:N({lazyContext:function(n){var t=lu(n.element()),e=i.inline?i.getContentAreaContainer():i.getContainer(),o=wu(Be.fromDom(e)),r=o.height()-t;return on.some(xu(o.x(),o.y(),o.width(),r))},onShow:function(){o(function(n){return jD(n,!0)})},onShown:function(t){o(function(n){return ai(n,[dA.transitionClass,dA.fadeInClass])}),r.get().each(function(n){!function(t,e){var o=pr(e);Ca(o).filter(function(n){return!jt(e,n)}).filter(function(n){return jt(n,Be.fromDom(o.dom().body))||to(t,n)}).each(function(){return Sa(e)})}(t.element(),n),r.set(on.none())})},onHide:function(n){r.set(function(n,t){return ka(n).orThunk(function(){return t().toOption().bind(function(n){return ka(n.element())})})}(n.element(),e)),o(function(n){return jD(n,!1)})},onHidden:function(){o(function(n){return ai(n,[dA.transitionClass])})}},dA),modes:["top"],onDocked:n,onUndocked:n})],t)}function GD(n){return"<alloy.field."+n+">"}function XD(n){return{element:function(){return n.element().dom()}}}function YD(e,o){var r=S(wn(o),function(n){var t=o[n],e=et(function(n){return tt("sidebar",TA,n)}(t));return{name:n,getApi:XD,onSetup:e.onSetup,onShow:e.onShow,onHide:e.onHide}});return S(r,function(n){var t=Ee(Z);return e.slot(n.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:$p([Ep(n,t),Dp(n,t),rr(jo(),function(t,n){var e=n.event();T(r,function(n){return n.name===e.name()}).each(function(n){(e.visible()?n.onShow:n.onHide)(n.getApi(t))})})])})})}function qD(n,t){nd.getCurrent(n).each(function(n){return gg.set(n,[function(t){return OA.sketch(function(n){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:YD(n,t),slotBehaviours:$p([Ri(function(n){return OA.hideAllSlots(n)})])}})}(t)])})}function KD(n){return nd.getCurrent(n).bind(function(n){return gE.isGrowing(n)||gE.hasGrown(n)?nd.getCurrent(n).bind(function(t){return T(OA.getSlotNames(t),function(n){return OA.isShowing(t,n)})}):on.none()})}function JD(n,t,e){var o=n.element();!0===t?(gg.set(n,[function(n){return{dom:{tag:"div",attributes:{"aria-label":n.translate("Loading...")},classes:["tox-throbber__busy-spinner"]},components:[{dom:sp('<div class="tox-spinner"><div></div><div></div><div></div></div>')}],behaviours:ya([dg.config({mode:"special",onTab:function(){return on.some(!0)},onShiftTab:function(){return on.some(!0)}}),bg.config({})])}}(e)]),hi(o,"display"),Ir(o,"aria-hidden")):(gg.set(n,[]),li(o,"display","none"),_r(o,"aria-hidden","true"))}function $D(n){return"string"==typeof n?n.split(" "):n}function QD(e,o){var r=An(NA,o.menus),t=0<wn(o.menus).length,n=o.menubar===undefined||!0===o.menubar?$D("file edit view insert format tools table help"):$D(!1===o.menubar?"":o.menubar),i=C(n,function(n){return t&&o.menus.hasOwnProperty(n)&&o.menus[n].hasOwnProperty("items")||NA.hasOwnProperty(n)}),u=S(i,function(n){var t=r[n];return function(n,e,t){var o=function(n){return n.getParam("removed_menuitems","")}(t).split(/[ ,]/);return{text:n.title,getItems:function(){return D(n.items,function(n){var t=n.toLowerCase();return 0===t.trim().length?[]:x(o,function(n){return n===t})?[]:"separator"===t||"|"===t?[{type:"separator"}]:e.menuItems[t]?[e.menuItems[t]]:[]})}}}({title:t.title,items:$D(t.items)},o,e)});return C(u,function(n){return 0<n.getItems().length&&x(n.getItems(),function(n){return"separator"!==n.type})})}function ZD(n,t){var e,o=function(n){var t=n.settings,e=t.skin,o=t.skin_url;if(!1!==e){var r=e||"oxide";o=o?n.documentBaseURI.toAbsolute(o):Xb.baseURL+"/skins/ui/"+r}return o}(t);o&&(e=o+"/skin.min.css",t.contentCSS.push(o+(n?"/content.inline":"/content")+".min.css")),!1===function(n){return!1===n.getParam("skin")}(t)&&e?Vh.DOM.styleSheetLoader.load(e,HA(t)):HA(t)()}function nB(t,n,e,o){var r=n.outerContainer,i=e.toolbar,u=e.buttons;if(h(i,cn)){var a=i.map(function(n){return bD(t,{toolbar:n,buttons:u},{backstage:o},on.none())});VA.setToolbars(r,a)}else VA.setToolbar(r,bD(t,e,{backstage:o},on.none()))}function tB(n){return function(n){var t=Ib(n),e=Nb(n),o=Pb(n);return XA(t).map(function(n){return GA(n,e,o)})}(n).getOr(Ib(n))}function eB(n){var t=Rb(n),e=Vb(n),o=Hb(n);return XA(t).map(function(n){return GA(n,e,o)})}function oB(n,t){return function(){n.execCommand("mceToggleFormat",!1,t)}}function rB(n){!function(e){Ok.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(n,t){e.ui.registry.addToggleButton(n.name,{tooltip:n.text,icon:n.icon,onSetup:hT(e,n.name),onAction:oB(e,n.name)})});for(var n=1;n<=6;n++){var t="h"+n;e.ui.registry.addToggleButton(t,{text:t.toUpperCase(),tooltip:"Heading "+n,onSetup:hT(e,t),onAction:oB(e,t)})}}(n),function(t){Ok.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(n){t.ui.registry.addButton(n.name,{tooltip:n.text,icon:n.icon,onAction:function(){return t.execCommand(n.action)}})})}(n),function(t){Ok.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(n){t.ui.registry.addToggleButton(n.name,{tooltip:n.text,icon:n.icon,onAction:function(){return t.execCommand(n.action)},onSetup:hT(t,n.name)})})}(n)}function iB(n,t,e){function o(){return!!t.undoManager&&t.undoManager[e]()}function r(){n.setDisabled(t.readonly||!o())}return n.setDisabled(!o()),t.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r),function(){return t.off("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",r)}}function uB(n,t){return{anchor:"makeshift",x:n,y:t}}function aB(n){return"longpress"===n.type||0===n.type.indexOf("touch")}function cB(n,t){var e=Vh.DOM.getPos(n);return function(n,t,e){return uB(n.x+t,n.y+e)}(t,e.x,e.y)}function sB(n,t){return"contextmenu"===t.type?n.inline?function(n){if(aB(n)){var t=n.touches[0];return uB(t.pageX,t.pageY)}return uB(n.pageX,n.pageY)}(t):cB(n.getContentAreaContainer(),function(n){if(aB(n)){var t=n.touches[0];return uB(t.clientX,t.clientY)}return uB(n.clientX,n.clientY)}(t)):e_(n)}function fB(n){return{anchor:"node",node:on.some(Be.fromDom(n.selection.getNode())),root:Be.fromDom(n.getBody())}}function lB(n,t,e,o,r,i){var u=e(),a=function(n,t,e){return e?fB(n):sB(n,t)}(n,t,i);UC(u,Ih.CLOSE_ON_EXECUTE,o,!1).map(function(n){t.preventDefault(),Ug.showMenuAt(r,a,{menu:{markers:Sv("normal")},data:n})})}function dB(t,e,n,o,r,i){var u=function(n,t){var e=t?fB(n):e_(n);return N({bubble:Ta(0,12,r_),layouts:o_,overrides:{maxWidthFunction:LT(),maxHeightFunction:kf()}},e)}(t,i);UC(n,Ih.CLOSE_ON_EXECUTE,o,!0).map(function(n){e.preventDefault(),Ug.showMenuWithinBounds(r,u,{menu:{markers:Sv("normal")},data:n,type:"horizontal"},function(){return on.some(gT(t))}),t.fire(ZT)})}function mB(t,e,o,r,i,u){function n(){var n=o();dB(t,e,n,r,i,u)}var a=Ht(),c=a.os.isiOS(),s=a.os.isOSX(),f=a.os.isAndroid();if(!s&&!c||u)f&&!u&&t.selection.setCursorLocation(e.target,0),n();else{var l=function(){!function(n){function t(){Kg.setEditorTimeout(n,function(){n.selection.setRng(e)},10),i()}var e=n.selection.getRng();n.once("touchend",t);function o(n){n.preventDefault(),n.stopImmediatePropagation()}n.on("mousedown",o,!0);function r(){return i()}n.once("longpresscancel",r);var i=function(){n.off("touchend",t),n.off("longpresscancel",r),n.off("mousedown",o)}}(t),n()};!function(n,t){var e=n.selection;if(e.isCollapsed()||t.touches.length<1)return!1;var o=t.touches[0],r=e.getRng();return Wc(n.getWin(),Dc.domRange(r)).exists(function(n){return n.left()<=o.clientX&&n.right()>=o.clientX&&n.top()<=o.clientY&&n.bottom()>=o.clientY})}(t,e)?(t.once("selectionchange",l),t.once("touchend",function(){return t.off("selectionchange",l)})):l()}}function gB(n){return"string"==typeof n?n.split(/[ ,]/):n}function pB(n){return cn(n)?"|"===n:"separator"===n.type}function hB(n,t){if(0===t.length)return n;var e=F(n).filter(function(n){return!pB(n)}).fold(function(){return[]},function(n){return[c_]});return n.concat(e).concat(t).concat([c_])}function vB(i,n,t){function e(n){return Ug.hide(a)}function o(o){var n="longpress"===o.type;if(i_(i)&&o.preventDefault(),!function(n,t){return t.ctrlKey&&!i_(n)}(i,o)&&!a_(i)){var r=!n&&(2!==o.button||o.target===i.getBody());(u()?mB:lB)(i,o,function(){var n=r?i.selection.getStart(!0):o.target,t=i.ui.registry.getAll(),e=u_(i);return function(r,n,i){var t=O(n,function(n,t){if(Tn(r,t)){var e=r[t].update(i);if(cn(e))return hB(n,e.split(" "));if(0<e.length){var o=S(e,s_);return hB(n,o)}return n}return n.concat([t])},[]);return 0<t.length&&pB(t[t.length-1])&&t.pop(),t}(t.contextMenus,e,n)},t,a,r)}}var u=Ht().deviceType.isTouch,a=au(Ug.sketch({dom:{tag:"div"},lazySink:n,onEscape:function(){return i.focus()},onShow:function(){return t.setContextMenuState(!0)},onHide:function(){return t.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:ya([Jd("dismissContextMenu",[rr(Po(),function(n,t){Lf.close(n),i.focus()})])])}));i.on("init",function(){var n="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(u()?"":" ResizeWindow");i.on(n,e),i.on(u()?"longpress":"longpress contextmenu",o)})}function bB(n,t){n.getSystem().addToGui(t),function(n){br(n.element()).filter(Ai).each(function(t){gi(t,"z-index").each(function(n){_r(t,f_,n)}),li(t,"z-index",mi(n.element(),"z-index"))})}(t)}function yB(n){!function(n){br(n.element()).filter(Ai).each(function(n){var t=Mr(n,f_);Fr(n,f_)?li(n,"z-index",t):hi(n,"z-index"),Ir(n,f_)})}(n),n.getSystem().removeFromGui(n)}function xB(n,t,e){return n.getSystem().build(Gb.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[t]},events:e}))}function wB(n,t,e,o){return function(n,t){var e=n.element(),o=parseInt(Mr(e,t.leftAttr),10),r=parseInt(Mr(e,t.topAttr),10);return isNaN(o)||isNaN(r)?on.none():on.some(Ru(o,r))}(n,t).fold(function(){return e},function(n){return iA(n.left()+o.left(),n.top()+o.top())})}function SB(n,t,e,o,r,i){var u=wB(n,t,e,o),a=t.mustSnap?l_(n,t,u,r,i):d_(n,t,u,r,i),c=CD(u,r,i);return function(n,t,e){var o=n.element();_r(o,t.leftAttr,e.left()+"px"),_r(o,t.topAttr,e.top()+"px")}(n,t,c),a.fold(function(){return{coord:iA(c.left(),c.top()),extra:on.none()}},function(n){return{coord:n.output(),extra:n.extra()}})}function CB(n,t){!function(n,t){var e=n.element();Ir(e,t.leftAttr),Ir(e,t.topAttr)}(n,t)}function kB(n,e,o,r){return Au(n,function(n){var t=n.sensor();return function(n,t,e,o,r,i){var u=kD(n,r,i),a=kD(t,r,i);return Math.abs(u.left()-a.left())<=e&&Math.abs(u.top()-a.top())<=o}(e,t,n.range().left(),n.range().top(),o,r)?on.some({output:nn(ED(n.output(),e,o,r)),extra:n.extra}):on.none()})}function OB(t){return function(n,t,e,o){return n.isSome()&&t.isSome()&&e.isSome()?on.some(o(n.getOrDie(),t.getOrDie(),e.getOrDie())):on.none()}(gi(t,"left"),gi(t,"top"),gi(t,"position"),function(n,t,e){return("fixed"===e?iA:oA)(parseInt(n,10),parseInt(t,10))}).getOrThunk(function(){var n=mu(t);return rA(n.left(),n.top())})}function TB(e,n,o,r,i,u,t){return function(n,t,e,o,r){var i=r.bounds,u=kD(t,e,o),a=as(u.left(),i.x(),i.x()+i.width()-r.width),c=as(u.top(),i.y(),i.y()+i.height()-r.height),s=rA(a,c);return t.fold(function(){var n=OD(s,e,o);return oA(n.left(),n.top())},function(){return s},function(){var n=CD(s,e,o);return iA(n.left(),n.top())})}(0,n.fold(function(){var n=function(n,e,o){return n.fold(function(n,t){return eA.offset(n+e,t+o)},function(n,t){return eA.absolute(n+e,t+o)},function(n,t){return eA.fixed(n+e,t+o)})}(o,u.left(),u.top()),t=CD(n,r,i);return iA(t.left(),t.top())},function(t){var n=SB(e,t,o,u,r,i);return n.extra.each(function(n){t.onSensor(e,n)}),n.coord}),r,i,t)}function EB(n,t){return{bounds:n.getBounds(),height:lu(t.element()),width:pu(t.element())}}function DB(t,e,n,o,r){var i=n.update(o,r),u=n.getStartData().getOrThunk(function(){return EB(e,t)});i.each(function(n){!function(n,t,e,o){var r=t.getTarget(n.element());if(t.repositionTarget){var i=pr(n.element()),u=hu(i),a=yD(r),c=OB(r),s=TB(n,t.snaps,c,u,a,o,e),f=TD(s,0,a);di(r,f)}t.onDrag(n,r,o)}(t,e,u,n)})}function BB(t,n,e,o){n.each(yB),e.snaps.each(function(n){CB(t,n)});var r=e.getTarget(t.element());o.reset(),e.onDrop(t,r)}function AB(n,r,i,u,t,e){return n.fold(function(){return S_.snap({sensor:rA(i-20,u-20),range:Ru(t,e),output:rA(on.some(i),on.some(u)),extra:{td:r}})},function(n){var t=i-20,e=u-20,o=n.element().dom().getBoundingClientRect();return S_.snap({sensor:rA(t,e),range:Ru(40,40),output:rA(on.some(i-o.width/2),on.some(u-o.height/2)),extra:{td:r}})})}function _B(n,o,r){return{getSnapPoints:n,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(n,t){var e=t.td;!function(n,t){return n.exists(function(n){return jt(n,t)})}(o.get(),e)&&(o.set(on.some(e)),r(e))},mustSnap:!0}}function MB(n){return bm(Xg.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:ya([S_.config({mode:C_.deviceType.isTouch()?"touch":"mouse",blockerClass:"blocker",snaps:n}),Ew.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))}var FB,IB,RB,VB,NB,HB=[{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"}],PB=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],zB={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},LB=[{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"]}],jB={button:pD(eT,function(n,t){return function(n,t){return JE(n,t,[])}(n,t.backstage.shared.providers)}),togglebutton:pD(rT,function(n,t){return function(n,t){return $E(n,t,[])}(n,t.backstage.shared.providers)}),menubutton:pD(oT,function(n,t){return GC(n,"tox-tbtn",t.backstage,on.none())}),splitbutton:pD(function(n){return tt("SplitButton",TE,n)},function(n,t){return fT(n,t.backstage.shared)}),styleSelectButton:function(n,t){return function(n,t){var e=N({type:"advanced"},t.styleselect);return yT(n,t,gD(n,e))}(n,t.backstage)},fontsizeSelectButton:function(n,t){return function(n,t){return yT(n,t,fD(n))}(n,t.backstage)},fontSelectButton:function(n,t){return function(n,t){return yT(n,t,cD(n))}(n,t.backstage)},formatButton:function(n,t){return function(n,t){return yT(n,t,mD(n))}(n,t.backstage)},alignMenuButton:function(n,t){return function(n,t){return yT(n,t,uD(n))}(n,t.backstage)}},UB={styleselect:jB.styleSelectButton,fontsizeselect:jB.fontsizeSelectButton,fontselect:jB.fontSelectButton,formatselect:jB.formatButton,align:jB.alignMenuButton},WB={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"]},GB={maxHeightFunction:kf(),maxWidthFunction:LT()},XB={onLtr:function(){return[rc,ic,sa,aa,fa,ca,Wg,Gg,hm,gm,vm,pm]},onRtl:function(){return[rc,ic,fa,ca,sa,aa,Wg,Gg,vm,pm,hm,gm]}},YB={onLtr:function(){return[ic,aa,ca,sa,fa,rc,Wg,Gg,hm,gm,vm,pm]},onRtl:function(){return[ic,ca,aa,fa,sa,rc,Wg,Gg,vm,pm,hm,gm]}},qB=function(u,n,e,a){function c(){return gT(u)}function s(){if(l()&&a.backstage.isContextMenuOpen())return!0;var n=function(){var n=g.get().map(function(n){return n.getBoundingClientRect()}).getOrThunk(function(){return u.selection.getRng().getBoundingClientRect()}),t=u.inline?hu().top():Su(Be.fromDom(u.getBody())).y();return{y:n.top+t,bottom:n.bottom+t}}(),t=c();return!function(n,t,e,o){return Math.max(n,e)<=Math.min(t,o)}(n.y,n.bottom,t.y(),t.bottom())}function t(){Ug.hide(d)}function o(){m.get().each(function(n){var t=d.element();hi(t,"display"),s()?li(t,"display","none"):_f.positionWithinBounds(e,n,d,on.some(c()))})}function f(n){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[n],behaviours:ya([dg.config({mode:"acyclic"}),Jd("pop-dialog-wrap-events",[Ri(function(n){u.shortcuts.add("ctrl+F9","focus statusbar",function(){return dg.focusIn(n)})}),Vi(function(n){u.shortcuts.remove("ctrl+F9")})])])}}var l=Ht().deviceType.isTouch,d=au(function(n){var e=Ee([]);return Ug.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(n){e.set([]),Ug.getContent(n).each(function(n){hi(n.element(),"visibility")}),ri(n.element(),rD),hi(n.element(),"width")},inlineBehaviours:ya([Jd("context-toolbar-events",[fr(yo(),function(n,t){Ug.getContent(n).each(function(n){}),ri(n.element(),rD),hi(n.element(),"width")}),rr(oD,function(t,e){hi(t.element(),"width");var n=gu(t.element());Ug.setContent(t,e.event().contents()),ei(t.element(),rD);var o=gu(t.element());li(t.element(),"width",n+"px"),Ug.getContent(t).each(function(n){e.event().focus().bind(function(n){return Sa(n),ka(t.element())}).orThunk(function(){return dg.focusIn(n),Ca()})}),Kg.setTimeout(function(){li(t.element(),"width",o+"px")},0)}),rr(tD,function(n,t){Ug.getContent(n).each(function(n){e.set(e.get().concat([{bar:n,focus:Ca()}]))}),qt(n,oD,{contents:t.event().forwardContents(),focus:on.none()})}),rr(eD,function(t,n){F(e.get()).each(function(n){e.set(e.get().slice(0,e.get().length-1)),qt(t,oD,{contents:cu(n.bar),focus:n.focus})})})]),dg.config({mode:"special",onEscape:function(t){return F(e.get()).fold(function(){return n.onEscape()},function(n){return Yt(t,eD),on.some(!0)})}})]),lazySink:function(){return an.value(n.sink)}})}({sink:e,onEscape:function(){return u.focus(),on.some(!0)}})),m=Ee(on.none()),g=Ee(on.none()),r=Ee(null),p=L(function(){return nD(n,function(n){var t=h(n);qt(d,tD,{forwardContents:f(t)})})}),h=function(n){var t,e,o=u.ui.registry.getAll().buttons,r=qb(u)===Ub.scrolling?Ub.scrolling:Ub["default"],i=p();return"contexttoolbar"===n.type?(t=An(o,i.formNavigators),e=bD(u,{buttons:t,toolbar:n.items},a,on.some(["form:"])),tT({type:r,uid:Hr("context-toolbar"),initGroups:e,onEscape:on.none,cyclicKeying:!0,backstage:a.backstage,getSink:function(){return an.error("")}})):QE(r,n,a.backstage)};u.on("contexttoolbar-show",function(t){var n=p();Nn(n.lookupTable,t.toolbarKey).each(function(n){y(n,t.target===u?on.none():on.some(t)),Ug.getContent(d).each(dg.focusIn)})});function v(n,t){var e="node"===n?a.backstage.shared.anchors.node(t):a.backstage.shared.anchors.cursor();return Bn(e,function(n,t){return"line"===n?{bubble:Ta(12,0,WB),layouts:{onLtr:function(){return[la]},onRtl:function(){return[da]}},overrides:GB}:{bubble:Ta(0,12,WB),layouts:t?YB:XB,overrides:GB}}(n,l()))}function i(){var n=p();ZE(n,u).fold(function(){m.set(on.none()),Ug.hide(d)},function(n){y(n.toolbarApi,on.some(n.elem.dom()))})}function b(n){x(),r.set(n)}var y=function(n,t){if(x(),!l()||!a.backstage.isContextMenuOpen()){var e=h(n),o=t.map(Be.fromDom),r=v(n.position,o);m.set(on.some(r)),g.set(t);var i=d.element();hi(i,"display"),Ug.showWithinBounds(d,r,f(e),function(){return on.some(c())}),s()&&li(i,"display","none")}},x=function(){var n=r.get();null!==n&&(Kg.clearTimeout(n),r.set(null))};u.on("init",function(){u.on(ZT,t),u.on("ScrollContent ScrollWindow longpress",o),u.on("click keyup SetContent ObjectResized ResizeEditor",function(n){b(Kg.setEditorTimeout(u,i,0))}),u.on("focusout",function(n){Kg.setEditorTimeout(u,function(){ka(e.element()).isNone()&&ka(d.element()).isNone()&&(m.set(on.none()),Ug.hide(d))},0)}),u.on("SwitchMode",function(){u.readonly&&(m.set(on.none()),Ug.hide(d))}),u.on("NodeChange",function(n){ka(d.element()).fold(function(){b(Kg.setEditorTimeout(u,i,0))},function(n){})})})},KB=function(n,o,r){function t(t,e){bn([o,r],function(n){n.broadcastEvent(t,e)})}function e(t,e){bn([o,r],function(n){n.broadcastOn([t],e)})}function i(n){return e(jf(),{target:n.target()})}function u(n){return e(jf(),{target:Be.fromDom(n.target)})}function a(n){0===n.button&&e(Wf(),{target:Be.fromDom(n.target)})}function c(n){return t(Ro(),hb(n))}function s(n){e(Uf(),{}),t(Vo(),hb(n))}function f(){return e(Uf(),{})}var l=fb(Be.fromDom(v.document),"touchstart",i),d=fb(Be.fromDom(v.document),"touchmove",function(n){return t(Fo(),n)}),m=fb(Be.fromDom(v.document),"touchend",function(n){return t(Io(),n)}),g=fb(Be.fromDom(v.document),"mousedown",i),p=fb(Be.fromDom(v.document),"mouseup",function(n){0===n.raw().button&&e(Wf(),{target:n.target()})});n.on("PostRender",function(){n.on("click",u),n.on("tap",u),n.on("mouseup",a),n.on("ScrollWindow",c),n.on("ResizeWindow",s),n.on("ResizeEditor",f)}),n.on("remove",function(){n.off("click",u),n.off("tap",u),n.off("mouseup",a),n.off("ScrollWindow",c),n.off("ResizeWindow",s),n.off("ResizeEditor",f),g.unbind(),l.unbind(),d.unbind(),m.unbind(),p.unbind()}),n.on("detach",function(){Ss(o),Ss(r),o.destroy(),r.destroy()})},JB=Dl,$B=Tl,QB=nn([St("shell",!1),ct("makeItem"),St("setupItem",Z),tl("listBehaviours",[gg])]),ZB=Cl({name:"items",overrides:function(n){return{behaviours:ya([gg.config({})])}}}),nA=nn([ZB]),tA=_l({name:nn("CustomList")(),configFields:QB(),partFields:nA(),factory:function(s,n,t,e){var o=s.shell?{behaviours:[gg.config({})],components:[]}:{behaviours:[],components:n},r=function(n){return s.shell?on.some(n):Ks(n,s,"items")};return{uid:s.uid,dom:s.dom,components:o.components,behaviours:Vs(s.listBehaviours,o.behaviours),apis:{setItems:function(a,c){r(a).fold(function(){throw v.console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},function(t){var n=gg.contents(t),e=c.length,o=e-n.length,r=0<o?function(n,t){for(var e=[],o=0;o<n;o++)e.push(t(o));return e}(o,function(){return s.makeItem()}):[],i=n.slice(e);bn(i,function(n){return gg.remove(t,n)}),bn(r,function(n){return gg.append(t,n)});var u=gg.contents(t);bn(u,function(n,t){s.setupItem(a,n,c[t],t)})})}}}},apis:{setItems:function(n,t,e){n.setItems(t,e)}}}),eA=En([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),oA=eA.offset,rA=eA.absolute,iA=eA.fixed,uA=En([{"static":[]},{absolute:["x","y"]},{fixed:["x","y"]}]),aA=function(n,t,e){n.getSystem().isConnected()&&function(e,o,r){var i=o.lazyViewport(e),n=e.element(),t=pr(n),u=hu(t),a=L(function(){return yD(n)}),c=r.isDocked();c&&HD(e,o,r,i),RD(e,o,i,u,a).each(function(n){r.setDocked(!c),n.fold(function(){return VD(e,o)},function(n,t){return ND(e,o,0,a(),rA(n,t))},function(n,t){HD(e,o,r,i,!0),ND(e,o,0,a(),iA(n,t))})})}(n,t,e)},cA=/* */Object.freeze({refresh:aA,reset:zD,isDocked:function(n,t,e){return e.isDocked()}}),sA=/* */Object.freeze({events:function(o,r){return tr([fr(yo(),function(t,e){o.contextual.each(function(n){ii(t.element(),n.transitionClass)&&(ai(t.element(),[n.transitionClass,n.fadeInClass]),(r.isVisible()?n.onShown:n.onHidden)(t));e.stop()})}),rr(Ro(),function(n,t){aA(n,o,r)}),rr(Vo(),function(n,t){zD(n,o,r)})])}}),fA=[wt("contextual",[ft("fadeInClass"),ft("fadeOutClass"),ft("transitionClass"),dt("lazyContext"),Ku("onShow"),Ku("onShown"),Ku("onHide"),Ku("onHidden")]),Dt("lazyViewport",Cu),ft("leftAttr"),ft("topAttr"),ft("positionAttr"),(FB="modes",IB=["top","bottom"],RB=Se,Ct(FB,IB,Kn(RB))),Ku("onDocked"),Ku("onUndocked")],lA=xa({fields:fA,name:"docking",active:sA,apis:cA,state:/* */Object.freeze({init:function(){var t=Ee(!1),e=Ee(!0);return tu({isDocked:function(){return t.get()},setDocked:function(n){return t.set(n)},isVisible:function(){return e.get()},setVisible:function(n){return e.set(n)},readState:function(){return"docked: "+t.get()+", visible: "+e.get()}})}})}),dA={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},mA="tox-tinymce--toolbar-sticky-on",gA="tox-tinymce--toolbar-sticky-off",pA=/* */Object.freeze({setup:function(n,t){n.inline||(n.on("ResizeWindow ResizeEditor ResizeContent",function(){t().each(LD)}),n.on("SkinLoaded",function(){t().each(lA.reset)}),n.on("FullscreenStateChanged",function(){t().each(lA.refresh)})),n.on("PostRender",function(){UD(n,!1)})},isDocked:function(n){return n().map(lA.isDocked).getOr(!1)},getBehaviours:WD}),hA=Z,vA=u,bA=nn([]),yA=/* */Object.freeze({setup:hA,isDocked:vA,getBehaviours:bA}),xA=Al({factory:function(t,o){var n={focus:dg.focusIn,setMenus:function(n,t){var e=S(t,function(t){var n={type:"menubutton",text:t.text,fetch:function(n){n(t.getItems())}},e=oT(n).mapError(function(n){return ye(n)}).getOrDie();return GC(e,"tox-mbtn",o.backstage,on.some("menuitem"))});gg.set(n,e)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:ya([gg.config({}),Jd("menubar-events",[Ri(function(n){t.onSetup(n)}),rr(fo(),function(e,n){Ou(e.element(),".tox-mbtn--active").each(function(t){Tu(n.event().target(),".tox-mbtn").each(function(n){jt(t,n)||e.getSystem().getByDom(t).each(function(t){e.getSystem().getByDom(n).each(function(n){Tw.expand(n),Tw.close(t),bg.focus(n)})})})})}),rr(Lo(),function(e,n){n.event().prevFocus().bind(function(n){return e.getSystem().getByDom(n).toOption()}).each(function(t){n.event().newFocus().bind(function(n){return e.getSystem().getByDom(n).toOption()}).each(function(n){Tw.isOpen(t)&&(Tw.expand(n),Tw.close(t))})})})]),dg.config({mode:"flow",selector:".tox-mbtn",onEscape:function(n){return t.onEscape(n),on.some(!0)}}),Xy.config({})]),apis:n,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[ct("dom"),ct("uid"),ct("onEscape"),ct("backstage"),St("onSetup",Z)],apis:{focus:function(n,t){n.focus(t)},setMenus:function(n,t,e){n.setMenus(t,e)}}}),wA="container",SA=[Is("slotBehaviours",[])],CA=function(r,n,t){function e(n){return Zs(r)}function o(e,o){return void 0===o&&(o=undefined),function(n,t){return Ks(n,r,t).map(function(n){return e(n,t)}).getOr(o)}}function i(n,t){return"true"!==Mr(n.element(),"aria-hidden")}var u,a=o(i,!1),c=o(function(n,t){if(i(n)){var e=n.element();li(e,"display","none"),_r(e,"aria-hidden","true"),qt(n,jo(),{name:t,visible:!1})}}),s=(u=c,function(t,n){bn(n,function(n){return u(t,n)})}),f=o(function(n,t){if(!i(n)){var e=n.element();hi(e,"display"),Ir(e,"aria-hidden"),qt(n,jo(),{name:t,visible:!0})}}),l={getSlotNames:e,getSlot:function(n,t){return Ks(n,r,t)},isShowing:a,hideSlot:c,hideAllSlots:function(n){return s(n,e())},showSlot:f};return{uid:r.uid,dom:r.dom,components:n,behaviours:Rs(r.slotBehaviours),apis:l}},kA=P({getSlotNames:function(n,t){return n.getSlotNames(t)},getSlot:function(n,t,e){return n.getSlot(t,e)},isShowing:function(n,t,e){return n.isShowing(t,e)},hideSlot:function(n,t,e){return n.hideSlot(t,e)},hideAllSlots:function(n,t){return n.hideAllSlots(t)},showSlot:function(n,t,e){return n.showSlot(t,e)}},Ur),OA=N(N({},kA),{sketch:function(n){var e,t=(e=[],{slot:function(n,t){return e.push(n),Ws(wA,GD(n),t)},record:function(){return e}}),o=n(t),r=t.record(),i=S(r,function(n){return wl({name:n,pname:GD(n)})});return rf(wA,SA,i,CA,o)}}),TA=de([yt("icon"),yt("tooltip"),Dt("onShow",Z),Dt("onHide",Z),Dt("onSetup",function(){return Z})]),EA=Hr("FixSizeEvent"),DA=Hr("AutoSizeEvent"),BA=$B.optional({factory:xA,name:"menubar",schema:[ct("backstage")]}),AA=$B.optional({factory:{sketch:function(n){return tA.sketch({uid:n.uid,dom:n.dom,listBehaviours:ya([dg.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return tT({type:n.split,uid:Hr("multiple-toolbar-item"),backstage:n.backstage,cyclicKeying:!1,getSink:n.getSink,initGroups:[],onEscape:function(){return on.none()}})},setupItem:function(n,t,e,o){eE.setGroups(t,e)},shell:!0})}},name:"multiple-toolbar",schema:[ct("dom"),ct("onEscape")]}),_A=$B.optional({factory:{sketch:function(n){return function(n){return n.split===Ub.sliding?nT:n.split===Ub.floating?ZO:tT}(n)({type:n.split,uid:n.uid,onEscape:function(){return n.onEscape(),on.some(!0)},cyclicKeying:!1,initGroups:[],getSink:n.getSink,backstage:n.backstage,moreDrawerData:{lazyToolbar:n.lazyToolbar,lazyMoreButton:n.lazyMoreButton,lazyHeader:n.lazyHeader}})}},name:"toolbar",schema:[ct("dom"),ct("onEscape"),ct("getSink")]}),MA=$B.optional({factory:{sketch:function(n){var t=n.editor,e=n.sticky?WD:bA;return{uid:n.uid,dom:n.dom,components:n.components,behaviours:ya(e(t,n.getSink))}}},name:"header",schema:[ct("dom")]}),FA=$B.optional({name:"socket",schema:[ct("dom")]}),IA=$B.optional({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:ya([Xy.config({}),bg.config({}),gE.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(n){nd.getCurrent(n).each(OA.hideAllSlots),Yt(n,DA)},onGrown:function(n){Yt(n,DA)},onStartGrow:function(n){qt(n,EA,{width:gi(n.element(),"width").getOr("")})},onStartShrink:function(n){qt(n,EA,{width:gu(n.element())+"px"})}}),gg.config({}),nd.config({find:function(n){var t=gg.contents(n);return yn(t)}})])}],behaviours:ya([DS(0),Jd("sidebar-sliding-events",[rr(EA,function(n,t){li(n.element(),"width",t.event().width())}),rr(DA,function(n,t){hi(n.element(),"width")})])])}}},name:"sidebar",schema:[ct("dom")]}),RA=$B.optional({factory:{sketch:function(n){return{uid:n.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:ya([gg.config({})]),components:[]}}},name:"throbber",schema:[ct("dom")]}),VA=_l({name:"OuterContainer",factory:function(e,n,t){var o={getSocket:function(n){return JB.getPart(n,e,"socket")},setSidebar:function(n,t){JB.getPart(n,e,"sidebar").each(function(n){return qD(n,t)})},toggleSidebar:function(n,t){JB.getPart(n,e,"sidebar").each(function(n){return function(n,e){nd.getCurrent(n).each(function(t){nd.getCurrent(t).each(function(n){gE.hasGrown(t)?OA.isShowing(n,e)?gE.shrink(t):(OA.hideAllSlots(n),OA.showSlot(n,e)):(OA.hideAllSlots(n),OA.showSlot(n,e),gE.grow(t))})})}(n,t)})},whichSidebar:function(n){return JB.getPart(n,e,"sidebar").bind(KD).getOrNull()},getHeader:function(n){return JB.getPart(n,e,"header")},getToolbar:function(n){return JB.getPart(n,e,"toolbar")},setToolbar:function(n,t){JB.getPart(n,e,"toolbar").each(function(n){n.getApis().setGroups(n,t)})},setToolbars:function(n,t){JB.getPart(n,e,"multiple-toolbar").each(function(n){tA.setItems(n,t)})},refreshToolbar:function(n){JB.getPart(n,e,"toolbar").each(function(n){return n.getApis().refresh(n)})},getMoreButton:function(n){return JB.getPart(n,e,"toolbar").bind(function(n){return n.getApis().getMoreButton(n)})},getThrobber:function(n){return JB.getPart(n,e,"throbber")},focusToolbar:function(n){JB.getPart(n,e,"toolbar").orThunk(function(){return JB.getPart(n,e,"multiple-toolbar")}).each(function(n){dg.focusIn(n)})},setMenubar:function(n,t){JB.getPart(n,e,"menubar").each(function(n){xA.setMenus(n,t)})},focusMenubar:function(n){JB.getPart(n,e,"menubar").each(function(n){xA.focus(n)})}};return{uid:e.uid,dom:e.dom,components:n,apis:o,behaviours:e.behaviours}},configFields:[ct("dom"),ct("behaviours")],partFields:[MA,BA,_A,AA,FA,IA,RA],apis:{getSocket:function(n,t){return n.getSocket(t)},setSidebar:function(n,t,e){n.setSidebar(t,e)},toggleSidebar:function(n,t,e){n.toggleSidebar(t,e)},whichSidebar:function(n,t){return n.whichSidebar(t)},getHeader:function(n,t){return n.getHeader(t)},getToolbar:function(n,t){return n.getToolbar(t)},setToolbar:function(n,t,e){var o=S(e,function(n){return JO(n)});n.setToolbar(t,o)},setToolbars:function(n,t,e){var o=S(e,function(n){return S(n,JO)});n.setToolbars(t,o)},getMoreButton:function(n,t){return n.getMoreButton(t)},refreshToolbar:function(n,t){return n.refreshToolbar(t)},getThrobber:function(n,t){return n.getThrobber(t)},setMenubar:function(n,t,e){n.setMenubar(t,e)},focusMenubar:function(n,t){n.focusMenubar(t)},focusToolbar:function(n,t){n.focusToolbar(t)}}}),NA={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 | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},HA=function(n){function t(){n._skinLoaded=!0,Hv(n)}return function(){n.initialized?t():n.on("init",t)}},PA=d(ZD,!1),zA=d(ZD,!0),LA=Vh.DOM,jA=Ht(),UA=jA.os.isiOS()&&jA.os.version.major<=12,WA={render:function(e,o,n,t,r){var i=Ee(0);PA(e),function(n,t){Rf(n,t,Cr)}(Be.fromDom(r.targetNode),o.mothership),ws(Mi(),o.uiMothership),e.on("PostRender",function(){nB(e,o,n,t),i.set(e.getWin().innerWidth),VA.setMenubar(o.outerContainer,QD(e,n)),VA.setSidebar(o.outerContainer,n.sidebar),function(r){function n(n){var t=r.getDoc().documentElement,e=u.get(),o=a.get();e.left()!==i.innerWidth||e.top()!==i.innerHeight?(u.set(Ru(i.innerWidth,i.innerHeight)),Lv(r,n)):o.left()===t.offsetWidth&&o.top()===t.offsetHeight||(a.set(Ru(t.offsetWidth,t.offsetHeight)),Lv(r,n))}function t(n){return zv(r,n)}var i=r.getWin(),e=r.getDoc().documentElement,u=Ee(Ru(i.innerWidth,i.innerHeight)),a=Ee(Ru(e.offsetWidth,e.offsetHeight));LA.bind(i,"resize",n),LA.bind(i,"scroll",t);var o=lb(Be.fromDom(r.getBody()),"load",n);r.on("remove",function(){o.unbind(),LA.unbind(i,"resize",n),LA.unbind(i,"scroll",t)})}(e)});var u=VA.getSocket(o.outerContainer).getOrDie("Could not find expected socket element");if(!0===UA){di(u.element(),{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var a=function(e,o){var r=null;return{cancel:function(){null!==r&&(v.clearTimeout(r),r=null)},throttle:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];null===r&&(r=v.setTimeout(function(){e.apply(null,n),r=null},o))}}}(function(){e.fire("ScrollContent")},20);fb(u.element(),"scroll",a.throttle)}YO(e,o),e.addCommand("ToggleSidebar",function(n,t){VA.toggleSidebar(o.outerContainer,t),e.fire("ToggleSidebar")}),e.addQueryValueHandler("ToggleSidebar",function(){return VA.whichSidebar(o.outerContainer)});var c=qb(e);return c!==Ub.sliding&&c!==Ub.floating||e.on("ResizeWindow ResizeEditor ResizeContent",function(){var n=e.getWin().innerWidth;n!==i.get()&&(VA.refreshToolbar(o.outerContainer),i.set(n))}),{iframeContainer:u.element().dom(),editorContainer:o.outerContainer.element().dom()}}},GA=function(t,n,e){var o=n.filter(function(n){return t<n}),r=e.filter(function(n){return n<t});return o.or(r).getOr(t)},XA=function(n){return/^[0-9\.]+(|px)$/i.test(""+n)?on.some(parseInt(""+n,10)):on.none()},YA=function(n){return mn(n)?n+"px":n},qA={render:function(t,i,e,o,n){var u,r=Vh.DOM,a=Jb(t),c=Qb(t),s=Be.fromDom(n.targetNode),f=Hb(t).or(eB(t)),l=qb(t),d=l===Ub.sliding||l===Ub.floating;zA(t);function m(n){void 0===n&&(n=!1),d&&VA.refreshToolbar(i.outerContainer),a||function(n){var t=d?n.fold(function(){return 0},function(n){return 1<n.components().length?fu(n.components()[1].element()):0}):0,e=mu(s),o=e.top()-fu(u.element())+t;di(i.outerContainer.element(),{position:"absolute",top:Math.round(o)+"px",left:Math.round(e.left())+"px"});var r=f.getOrThunk(function(){var n=XA(mi(Mi(),"margin-left")).getOr(0);return gu(Mi())-e.left()+n});li(u.element(),"max-width",r+"px")}(VA.getToolbar(i.outerContainer)),c&&(n?lA.reset(u):lA.refresh(u))}function g(){li(i.outerContainer.element(),"display","flex"),r.addClass(t.getBody(),"mce-edit-focus"),hi(i.uiMothership.element(),"display"),m()}function p(){i.outerContainer&&(li(i.outerContainer.element(),"display","none"),r.removeClass(t.getBody(),"mce-edit-focus")),li(i.uiMothership.element(),"display","none")}function h(){if(u)g();else{u=VA.getHeader(i.outerContainer).getOrDie();var n=function(n){return Kb(n).getOr(Mi())}(t);ws(n,i.mothership),ws(n,i.uiMothership),nB(t,i,e,o),VA.setMenubar(i.outerContainer,QD(t,e)),g(),t.on("activate",g),t.on("deactivate",p),t.on("NodeChange SkinLoaded ResizeWindow",function(){t.hidden||m(!0)}),t.nodeChanged()}}return t.on("focus",h),t.on("blur hide",p),t.on("init",function(){t.hasFocus()&&h()}),YO(t,i),{editorContainer:i.outerContainer.element().dom()}}},KA=function(t){Ok.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(n){t.ui.registry.addToggleButton(n.name,{tooltip:n.text,onAction:function(){return t.execCommand(n.cmd)},icon:n.icon,onSetup:hT(t,n.name)})});var n="alignnone",e="No alignment",o="JustifyNone",r="align-none";t.ui.registry.addButton(n,{tooltip:e,onAction:function(){return t.execCommand(o)},icon:r})},JA=function(n){rB(n),function(t){Ok.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(n){t.ui.registry.addMenuItem(n.name,{text:n.text,icon:n.icon,shortcut:n.shortcut,onAction:function(){return t.execCommand(n.action)}})}),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:oB(t,"code")})}(n)},$A=function(n){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:function(n){return iB(n,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:function(n){return iB(n,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(n),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",onSetup:function(n){return iB(n,t,"hasUndo")},onAction:function(){return t.execCommand("undo")}}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",onSetup:function(n){return iB(n,t,"hasRedo")},onAction:function(){return t.execCommand("redo")}})}(n)},QA=function(n){!function(n){n.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:function(){return n.execCommand("mceToggleVisualAid")}})}(n),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:function(n){return function(t,n){t.setActive(n.hasVisual);function e(n){t.setActive(n.hasVisual)}return n.on("VisualAid",e),function(){return n.off("VisualAid",e)}}(n,t)},onAction:function(){t.execCommand("mceToggleVisualAid")}})}(n)},ZA=function(n){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:function(n){return function(n,t){n.setDisabled(!t.queryCommandState("outdent"));function e(){n.setDisabled(!t.queryCommandState("outdent"))}return t.on("NodeChange",e),function(){return t.off("NodeChange",e)}}(n,t)},onAction:function(){return t.execCommand("outdent")}}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:function(){return t.execCommand("indent")}})}(n)},n_=function(n,t){!function(n,t){var e=bT(0,t,uD(n));n.ui.registry.addNestedMenuItem("align",{text:t.shared.providers.translate("Align"),getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(n,t),function(n,t){var e=bT(0,t,cD(n));n.ui.registry.addNestedMenuItem("fontformats",{text:t.shared.providers.translate("Fonts"),getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(n,t),function(n,t){var e=N({type:"advanced"},t.styleselect),o=bT(0,t,gD(n,e));n.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}})}(n,t),function(n,t){var e=bT(0,t,mD(n));n.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(n,t),function(n,t){var e=bT(0,t,fD(n));n.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(n,t)},t_=function(n,t){KA(n),JA(n),n_(n,t),$A(n),Wv.register(n),QA(n),ZA(n)},e_=function(n){return{anchor:"selection",root:Be.fromDom(n.selection.getNode())}},o_={onLtr:function(){return[ic,aa,ca,sa,fa,rc,Wg,Gg,hm,gm,vm,pm]},onRtl:function(){return[ic,ca,aa,fa,sa,rc,Wg,Gg,vm,pm,hm,gm]}},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"]},i_=function(n){return n.settings.contextmenu_never_use_native||!1},u_=function(n){return function(n,t,e){var o=n.ui.registry.getAll().contextMenus;return V(n.settings,t).map(gB).getOrThunk(function(){return C(gB(e),function(n){return Tn(o,n)})})}(n,"contextmenu","link linkchecker image imagetools table spellchecker configurepermanentpen")},a_=function(n){return!1===n.getParam("contextmenu")},c_={type:"separator"},s_=function(t){if(cn(t))return t;switch(t.type){case"separator":return c_;case"submenu":return{type:"nestedmenuitem",text:t.text,icon:t.icon,getSubmenuItems:function(){var n=t.getSubmenuItems();return cn(n)?n:S(n,s_)}};default:return{type:"menuitem",text:t.text,icon:t.icon,onAction:function(n){return function(){return n()}}(t.onAction)}}},f_="data-initial-z-index",l_=function(n,t,r,i,u){var e=t.getSnapPoints(n);return kB(e,r,i,u).orThunk(function(){return O(e,function(t,e){var n=e.sensor(),o=function(n,t,e,o,r,i){var u=kD(n,r,i),a=kD(t,r,i),c=Math.abs(u.left()-a.left()),s=Math.abs(u.top()-a.top());return Ru(c,s)}(r,n,e.range().left(),e.range().top(),i,u);return t.deltas.fold(function(){return{deltas:on.some(o),snap:on.some(e)}},function(n){return(o.left()+o.top())/2<=(n.left()+n.top())/2?{deltas:on.some(o),snap:on.some(e)}:t})},{deltas:on.none(),snap:on.none()}).snap.map(function(n){return{output:nn(ED(n.output(),r,i,u)),extra:n.extra}})})},d_=function(n,t,e,o,r){var i=t.getSnapPoints(n);return kB(i,e,o,r)},m_=wt("snaps",[ct("getSnapPoints"),Ku("onSensor"),ct("leftAttr"),ct("topAttr"),St("lazyViewport",Cu),St("mustSnap",!1)]),g_=/* */Object.freeze({getData:function(n){return on.from(Ru(n.x(),n.y()))},getDelta:function(n,t){return Ru(t.left()-n.left(),t.top()-n.top())}}),p_=[St("useFixed",u),ct("blockerClass"),St("getTarget",l),St("onDrag",Z),St("repositionTarget",!0),Ku("onDrop"),Dt("getBounds",Cu),m_,Zu("dragger",{handlers:function(u,a){function c(n){a.setStartData(EB(u,n))}return tr([rr(Ro(),function(n){a.getStartData().each(function(){return c(n)})}),rr(uo(),function(t,n){if(0===n.event().raw().button){n.stop();var e=function(){return BB(t,on.some(i),u,a)},o=vb(e,200),r={drop:e,delayDrop:o.schedule,forceDrop:e,move:function(n){o.cancel(),DB(t,u,a,g_,n)}},i=xB(t,u.blockerClass,function(e){return tr([rr(uo(),e.forceDrop),rr(so(),e.drop),rr(ao(),function(n,t){e.move(t.event())}),rr(co(),e.delayDrop)])}(r));c(t),bB(t,i)}})])}})],h_=/* */Object.freeze({getData:function(n){var t=n.raw().touches;return 1===t.length?function(n){var t=n[0];return on.some(Ru(t.clientX,t.clientY))}(t):on.none()},getDelta:function(n,t){return Ru(t.left()-n.left(),t.top()-n.top())}}),v_=p_,b_=[St("useFixed",u),ct("blockerClass"),St("getTarget",l),St("onDrag",Z),St("repositionTarget",!0),St("onDrop",Z),Dt("getBounds",Cu),m_,Zu("dragger",{handlers:function(i,u){function a(n){u.setStartData(EB(i,n))}var c=Ee(on.none());return tr([rr(Ro(),function(n){u.getStartData().each(function(){return a(n)})}),rr(eo(),function(t,n){n.stop();function e(){BB(t,c.get(),i,u),c.set(on.none())}var o={drop:e,delayDrop:function(){},forceDrop:e,move:function(n){DB(t,i,u,h_,n)}},r=xB(t,i.blockerClass,function(e){return tr([rr(eo(),e.forceDrop),rr(ro(),e.drop),rr(io(),e.drop),rr(oo(),function(n,t){e.move(t.event())})])}(o));c.set(on.some(r));a(t),bB(t,r)}),rr(oo(),function(n,t){t.stop(),DB(n,i,u,h_,t.event())}),rr(ro(),function(n){BB(n,c.get(),i,u),c.set(on.none())}),rr(io(),function(n){BB(n,c.get(),i,u),c.set(on.none())})])}})],y_=/* */Object.freeze({mouse:v_,touch:b_}),x_=/* */Object.freeze({init:function(){var o=on.none(),t=on.none(),n=nn({});return tu({readState:n,reset:function(){o=on.none(),t=on.none()},update:function(t,n){return t.getData(n).bind(function(n){return function(t,e){var n=o.map(function(n){return t.getDelta(n,e)});return o=on.some(e),n}(t,n)})},getStartData:function(){return t},setStartData:function(n){t=on.some(n)}})}}),w_=/* */Object.freeze({snapTo:function(n,t,e,o){var r=t.getTarget(n.element());if(t.repositionTarget){var i=pr(n.element()),u=hu(i),a=yD(r),c=function(n,t,e){return{coord:ED(n.output(),n.output(),t,e),extra:n.extra()}}(o,u,a),s=TD(c.coord,0,a);di(r,s)}}}),S_=wa({branchKey:"mode",branches:y_,name:"dragging",active:{events:function(n,t){return n.dragger.handlers(n,t)}},extra:{snap:gr(["sensor","range","output"],["extra"])},state:x_,apis:w_}),C_=Ht(),k_=function(c,e){function t(n){var t=Su(n);return AB(g.getOpt(e),n,t.x(),t.y(),t.width(),t.height())}function o(n){var t=Su(n);return AB(p.getOpt(e),n,t.right(),t.bottom(),t.width(),t.height())}function r(n,t,e,o){var r=e(t);S_.snapTo(n,r),function(n,t,e,o){var r=t.dom().getBoundingClientRect();hi(n.element(),"display");var i=vr(Be.fromDom(c.getBody())).dom().innerHeight,u=e(r),a=o(r,i);(u||a)&&li(n.element(),"display","none")}(n,t,function(n){return n[o]<0},function(n,t){return n[o]>t})}function i(n){return r(h,n,t,"top")}function u(n){return r(v,n,o,"bottom")}var a=Ee([]),s=Ee([]),n=Ee(!1),f=Ee(on.none()),l=Ee(on.none()),d=_B(function(){return S(a.get(),function(n){return t(n)})},f,function(t){l.get().each(function(n){c.fire("TableSelectorChange",{start:t,finish:n})})}),m=_B(function(){return S(s.get(),function(n){return o(n)})},l,function(t){f.get().each(function(n){c.fire("TableSelectorChange",{start:n,finish:t})})}),g=MB(d),p=MB(m),h=au(g.asSpec()),v=au(p.asSpec());C_.deviceType.isTouch()&&(c.on("TableSelectionChange",function(t){n.get()||(vs(e,h),vs(e,v),n.set(!0)),f.set(on.some(t.start)),l.set(on.some(t.finish)),t.otherCells.each(function(n){a.set(n.upOrLeftCells),s.set(n.downOrRightCells),i(t.start),u(t.finish)})}),c.on("resize ScrollContent",function(){f.get().each(i),l.get().each(u)}),c.on("TableSelectionClear",function(){n.get()&&(ys(h),ys(v),n.set(!1)),f.set(on.none()),l.set(on.none())}))};(NB=VB=VB||{})[NB.None=0]="None",NB[NB.Both=1]="Both",NB[NB.Vertical=2]="Vertical";function O_(n,t,e){var o=Be.fromDom(n.getContainer()),r=function(n,t,e,o,r){var i={};return i.height=GA(o+t.top(),Nb(n),Pb(n)),e===VB.Both&&(i.width=GA(r+t.left(),Vb(n),Hb(n))),i}(n,t,e,fu(o),gu(o));Cn(r,function(n,t){return li(o,t,YA(n))}),Pv(n)}function T_(n){if(1===n.nodeType){if("BR"===n.nodeName||n.getAttribute("data-mce-bogus"))return!0;if("bookmark"===n.getAttribute("data-mce-type"))return!0}return!1}function E_(o,t){var r,n,e;return{dom:{tag:"div",classes:["tox-statusbar"]},components:(n=function(){var n=[];return o.getParam("elementpath",!0,"boolean")&&n.push(hM(o,{})),Vt(o.settings.plugins,"wordcount")&&n.push(function(n,o){function r(n,t,e){return gg.set(n,[Ti(o.translate(["{0} "+e,t[e]]))])}var t;return Xg.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:ya([Xy.config({}),gg.config({}),nl.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Jd("wordcount-events",[rr(Xt(),function(n){var t=nl.getValue(n),e="words"===t.mode?"characters":"words";nl.setValue(n,{mode:e,count:t.count}),r(n,t.count,e)}),Ri(function(e){n.on("wordCountUpdate",function(n){var t=nl.getValue(e).mode;nl.setValue(e,{mode:t,count:n.wordCount}),r(e,n.wordCount,t)})})])]),eventOrder:(t={},t[Xt()]=["wordcount-events","alloy.base.behaviour"],t)})}(o,t)),o.getParam("branding",!0,"boolean")&&n.push(function(){var n=ih.translate(["Powered by {0}","Tiny"]);return{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="'+n+'">'+n+"</a>"}}}()),0<n.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:n}]:[]}(),e=function(n){var t=!Vt(n.settings.plugins,"autoresize"),e=n.getParam("resize",t);return!1===e?VB.None:"both"===e?VB.Both:VB.Vertical}(o),e!==VB.None&&n.push((r=e,{dom:{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:t.translate("Resize")},innerHtml:xm("resize-handle",t.icons)},behaviours:ya([S_.config({mode:"mouse",repositionTarget:!1,onDrag:function(n,t,e){O_(o,e,r)},blockerClass:"tox-blocker"})])})),n)}}function D_(n){return[ft("type"),function(n){return st(n,we)}("columns"),n]}function B_(t){return he("items","items",Mn(),Kn(Zn(function(n){return tt("Checking item of "+t,pF,n).fold(function(n){return an.error(ye(n))},function(n){return an.value(n)})})))}function A_(n){return cn(n.type)&&cn(n.name)}function __(n){var t=function(n){return C(AF(n),A_)}(n),e=D(t,function(t){return function(n){return on.from(_F[n.type])}(t).fold(function(){return[]},function(n){return[st(t.name,n)]})});return de(e)}function M_(n){return{internalDialog:et(function(n){return tt("dialog",BF,n)}(n)),dataValidator:__(n),initialData:n.initialData}}function F_(n){var e=[],o={};return Cn(n,function(n,t){n.fold(function(){e.push(t)},function(n){o[t]=n})}),0<e.length?an.error(e):an.value(o)}function I_(n){return yn(function(n,t){var e=gn.call(n,0);return e.sort(t),e}(n,function(n,t){return t<n?-1:n<t?1:0}))}function R_(n,t){li(n,"height",t+"px"),Ht().browser.isIE()?hi(n,"flex-basis"):li(n,"flex-basis",t+"px")}function V_(n,o,r){ku(n,'[role="dialog"]').each(function(e){Ou(e,'[role="tablist"]').each(function(t){r.get().map(function(n){return li(o,"height","0"),li(o,"flex-basis","0"),Math.min(n,function(n,t,e){var o,r=hr(n).dom(),i=ku(n,".tox-dialog-wrap").getOr(n);o="fixed"===mi(i,"position")?Math.max(r.clientHeight,v.window.innerHeight):Math.max(r.offsetHeight,r.scrollHeight);var u=fu(t),a=t.dom().offsetLeft>=e.dom().offsetLeft+gu(e)?Math.max(fu(e),u):u,c=parseInt(mi(n,"margin-top"),10)||0,s=parseInt(mi(n,"margin-bottom"),10)||0;return o-(fu(n)+c+s-a)}(e,o,t))}).each(function(n){R_(o,n)})})})}function N_(n){return Ou(n,'[role="tabpanel"]')}function H_(r){var i;return{smartTabHeight:(i=Ee(on.none()),{extraEvents:[Ri(function(n){var t=n.element();N_(t).each(function(o){li(o,"visibility","hidden"),n.getSystem().getByDom(o).toOption().each(function(n){var t=function(o,r,i){return S(o,function(n,t){gg.set(i,o[t].view());var e=r.dom().getBoundingClientRect();return gg.set(i,[]),e.height})}(r,o,n),e=I_(t);i.set(e)}),V_(t,o,i),hi(o,"visibility"),function(n,t){yn(n).each(function(n){return GF.showTab(t,n.value)})}(r,n),Kg.requestAnimationFrame(function(){V_(t,o,i)})})}),rr(Vo(),function(n){var t=n.element();N_(t).each(function(n){V_(t,n,i)})}),rr(py,function(n,t){var r=n.element();N_(r).each(function(t){var n=Ca();li(t,"visibility","hidden");var e=gi(t,"height").map(function(n){return parseInt(n,10)});hi(t,"height"),hi(t,"flex-basis");var o=t.dom().getBoundingClientRect().height;e.forall(function(n){return n<o})?(i.set(on.from(o)),V_(r,t,i)):e.each(function(n){R_(t,n)}),hi(t,"visibility"),n.each(Sa)})})],selectFirst:!1}),naiveTabHeight:{extraEvents:[],selectFirst:!0}}}function P_(n,t,e,o){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:N(N({},t.map(function(n){return{id:n}}).getOr({})),o?{"aria-live":"polite"}:{})},components:[],behaviours:ya([DS(0),LE.config({channel:JF,updateState:function(n,t){return on.some({isTabPanel:function(){return"tabpanel"===t.body.type}})},renderComponents:function(n){switch(n.body.type){case"tabpanel":return[function(n,e){function o(n){var t=nl.getValue(n),e=F_(t).getOr({}),o=i.get(),r=Bn(o,e);i.set(r)}function r(n){var t=i.get();nl.setValue(n,t)}var i=Ee({}),u=Ee(null),t=S(n.tabs,function(n){return{value:n.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(n.title)},view:function(){return[bS.sketch(function(t){return{dom:{tag:"div",classes:["tox-form"]},components:S(n.items,function(n){return Jk(t,n,e)}),formBehaviours:ya([dg.config({mode:"acyclic",useTabstopAt:b(HS)}),Jd("TabView.form.events",[Ri(r),Vi(o)]),dc.config({channels:K([{key:XF,value:{onReceive:o}},{key:YF,value:{onReceive:r}}])})])}})]}}}),a=H_(t).smartTabHeight;return GF.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(n,t,e){var o=nl.getValue(t);qt(n,gy,{name:o,oldName:u.get()}),u.set(o)},tabs:t,components:[GF.parts().tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[PF.parts().tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:ya([Xy.config({})])}),GF.parts().tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:a.selectFirst,tabSectionBehaviours:ya([Jd("tabpanel",a.extraEvents),dg.config({mode:"acyclic"}),nd.config({find:function(n){return yn(GF.getViewItems(n))}}),nl.config({store:{mode:"manual",getValue:function(n){return n.getSystem().broadcastOn([XF],{}),i.get()},setValue:function(n,t){i.set(t),n.getSystem().broadcastOn([YF],{})}}})])})}(n.body,e)];default:return[function(n,e){var t=bm(bS.sketch(function(t){return{dom:{tag:"div",classes:["tox-form"].concat(n.classes)},components:S(n.items,function(n){return Jk(t,n,e)})}}));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[t.asSpec()]}],behaviours:ya([dg.config({mode:"acyclic",useTabstopAt:b(HS)}),ES(t),MS(t,{postprocess:function(n){return F_(n).fold(function(n){return v.console.error(n),{}},function(n){return n})}})])}}(n.body,e)]}},initialData:n})])}}function z_(n,e){return[cr(lo(),PS),n(cy,function(n,t){e.onClose(),t.onClose()}),n(sy,function(n,t,e,o){t.onCancel(n),Yt(o,cy)}),rr(my,function(n,t){return e.onUnblock()}),rr(dy,function(n,t){return e.onBlock(t.event())})]}function L_(n,t){function e(n,t){return Gb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+n]},components:S(t,function(n){return n.memento.asSpec()})})}var o=function(n,t){for(var e=[],o=[],r=0,i=n.length;r<i;r++){var u=n[r];(t(u,r)?e:o).push(u)}return{pass:e,fail:o}}(t.map(function(n){return n.footerButtons}).getOr([]),function(n){return"start"===n.align});return[e("start",o.pass),e("end",o.fail)]}function j_(n,o){return{dom:sp('<div class="tox-dialog__footer"></div>'),components:[],behaviours:ya([LE.config({channel:$F,initialData:n,updateState:function(n,t){var e=S(t.buttons,function(n){var t=bm(function(n,t){return ZC(n,n.type,t)}(n,o));return{name:n.name,align:n.align,memento:t}});return on.some({lookupByName:function(n,t){return function(t,n,e){return T(n,function(n){return n.name===e}).bind(function(n){return n.memento.getOpt(t)})}(n,e,t)},footerButtons:e})},renderComponents:L_})])}}function U_(n,t){return SM.parts().footer(j_(n,t))}function W_(t,e){if(t.getRoot().getSystem().isConnected()){var o=nd.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return bS.getField(o,e).fold(function(){var n=t.getFooter();return LE.getState(n).get().bind(function(n){return n.lookupByName(o,e)})},function(n){return on.some(n)})}return on.none()}function G_(u,o,a){function n(n){var t=u.getRoot();t.getSystem().isConnected()&&n(t)}var c={getData:function(){var n=u.getRoot(),t=n.getSystem().isConnected()?u.getFormWrapper():n,e=nl.getValue(t),o=P(a,function(n){return n.get()});return N(N({},e),o)},setData:function(i){n(function(n){var t=c.getData(),e=An(t,i),o=function(n,t){var e=n.getRoot();return LE.getState(e).get().map(function(n){return et(tt("data",n.dataValidator,t))}).getOr(t)}(u,e),r=u.getFormWrapper();nl.setValue(r,o),Cn(a,function(n,t){Tn(e,t)&&n.set(e[t])})})},disable:function(n){W_(u,n).each(kh.disable)},enable:function(n){W_(u,n).each(kh.enable)},focus:function(n){W_(u,n).each(bg.focus)},block:function(t){if(!cn(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){qt(n,dy,{message:t})})},unblock:function(){n(function(n){Yt(n,my)})},showTab:function(e){n(function(n){var t=u.getBody();LE.getState(t).get().exists(function(n){return n.isTabPanel()})&&nd.getCurrent(t).each(function(n){GF.showTab(n,e)})})},redial:function(e){n(function(n){var t=o(e);n.getSystem().broadcastOn([qF],t),n.getSystem().broadcastOn([KF],t.internalDialog),n.getSystem().broadcastOn([JF],t.internalDialog),n.getSystem().broadcastOn([$F],t.internalDialog),c.setData(t.initialData)})},close:function(){n(function(n){Yt(n,cy)})}};return c}function X_(n,t){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[n,t]}}function Y_(n,t){return SM.parts().close(Xg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close")}},action:n,buttonBehaviours:ya([Xy.config({})])}))}function q_(){return SM.parts().title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})}function K_(n,t){return SM.parts().body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:sp("<p>"+t.translate(n)+"</p>")}]}]})}function J_(n){return SM.parts().footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:n})}function $_(n,t){return[Gb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:n}),Gb.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:t})]}function Q_(t){var n,e="tox-dialog",o=e+"-wrap",r=o+"__backdrop",i=e+"__disable-scroll";return SM.sketch({lazySink:t.lazySink,onEscape:function(n){return t.onEscape(n),on.some(!0)},useTabstopAt:function(n){return!HS(n)},dom:{tag:"div",classes:[e].concat(t.extraClasses),styles:N({position:"relative"},t.extraStyles)},components:g([t.header,t.body],t.footer.toArray()),parts:{blocker:{dom:sp('<div class="'+o+'"></div>'),components:[{dom:{tag:"div",classes:tI?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:ya(g([bg.config({}),Jd("dialog-events",t.dialogEvents.concat([fr(lo(),function(n,t){dg.focusIn(n)})])),Jd("scroll-lock",[Ri(function(){ei(Mi(),i)}),Vi(function(){ri(Mi(),i)})])],t.extraBehaviours)),eventOrder:N((n={},n[To()]=["dialog-events"],n[No()]=["scroll-lock","dialog-events","alloy.base.behaviour"],n[Ho()]=["alloy.base.behaviour","dialog-events","scroll-lock"],n),t.eventOrder)})}function Z_(n){return Xg.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close"),title:n.translate("Close")}},components:[{dom:{tag:"div",classes:["tox-icon"],innerHtml:'<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(n){Yt(n,sy)}})}function nM(n,t,e){function o(n){return[Ti(e.translate(n.title))]}return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:N({},t.map(function(n){return{id:n}}).getOr({}))},components:o(n),behaviours:ya([LE.config({channel:KF,renderComponents:o})])}}function tM(){return{dom:sp('<div class="tox-dialog__draghandle"></div>')}}function eM(n,t){return function(n,t){var e=SM.parts().title(nM(n,on.none(),t)),o=SM.parts().draghandle(tM()),r=SM.parts().close(Z_(t)),i=[e].concat(n.draggable?[o]:[]).concat([r]);return Gb.sketch({dom:sp('<div class="tox-dialog__header"></div>'),components:i})}({title:t.shared.providers.translate(n),draggable:t.dialog.isDraggableModal()},t.shared.providers)}function oM(n,t){return{onClose:function(){return t.closeWindow()},onBlock:function(e){SM.setBusy(n(),function(n,t){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.message()},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:t,components:[{dom:sp('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})},onUnblock:function(){SM.setIdle(n())}}}function rM(n,t,e,o){var r;return au(Q_(N(N({},n),{lazySink:o.shared.getSink,extraBehaviours:g([LE.config({channel:qF,updateState:function(n,t){return on.some(t)},initialData:t}),RS({})],n.extraBehaviours),onEscape:function(n){Yt(n,sy)},dialogEvents:e,eventOrder:(r={},r[Oo()]=["reflecting","receiving"],r[No()]=["scroll-lock","reflecting","messages","dialog-events","alloy.base.behaviour"],r[Ho()]=["alloy.base.behaviour","dialog-events","messages","reflecting","scroll-lock"],r)})))}function iM(n){return S(n,function(n){return"menu"===n.type?function(n){var t=S(n.items,function(n){var t=Ee(!1);return N(N({},n),{storage:t})});return N(N({},n),{items:t})}(n):n})}function uM(n){return O(n,function(n,t){return"menu"!==t.type?n:O(t.items,function(n,t){return n[t.name]=t.storage,n},n)},{})}function aM(n,t,e){var o=eM(n.internalDialog.title,e),r=function(n,t){var e=P_(n,on.none(),t,!1);return SM.parts().body(e)}({body:n.internalDialog.body},e),i=iM(n.internalDialog.buttons),u=uM(i),a=U_({buttons:i},e),c=nI(function(){return d},oM(function(){return l},t)),s="normal"!==n.internalDialog.size?"large"===n.internalDialog.size?["tox-dialog--width-lg"]:["tox-dialog--width-md"]:[],f={header:o,body:r,footer:on.some(a),extraClasses:s,extraBehaviours:[],extraStyles:{}},l=rM(f,n,c,e),d=G_({getRoot:function(){return l},getBody:function(){return SM.getBody(l)},getFooter:function(){return SM.getFooter(l)},getFormWrapper:function(){var n=SM.getBody(l);return nd.getCurrent(n).getOr(n)}},t.redial,u);return{dialog:l,instanceApi:d}}function cM(n,t,e,o){var r,i,u=Hr("dialog-label"),a=Hr("dialog-content"),c=bm(function(n,t,e){return Gb.sketch({dom:sp('<div class="tox-dialog__header"></div>'),components:[nM(n,on.some(t),e),tM(),Z_(e)],containerBehaviours:ya([S_.config({mode:"mouse",blockerClass:"blocker",getTarget:function(n){return Tu(n,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})}({title:n.internalDialog.title,draggable:!0},u,e.shared.providers)),s=bm(function(n,t,e,o){return P_(n,on.some(t),e,o)}({body:n.internalDialog.body},a,e,o)),f=iM(n.internalDialog.buttons),l=uM(f),d=bm(function(n,t){return j_(n,t)}({buttons:f},e)),m=nI(function(){return p},{onBlock:function(){},onUnblock:function(){},onClose:function(){return t.closeWindow()}}),g=au({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:(r={role:"dialog"},r["aria-labelledby"]=u,r["aria-describedby"]=""+a,r)},eventOrder:(i={},i[Oo()]=[LE.name(),dc.name()],i[To()]=["execute-on-form"],i[No()]=["reflecting","execute-on-form"],i),behaviours:ya([dg.config({mode:"cyclic",onEscape:function(n){return Yt(n,cy),on.some(!0)},useTabstopAt:function(n){return!HS(n)&&("button"!==Ko(n)||"disabled"!==Mr(n,"disabled"))}}),LE.config({channel:qF,updateState:function(n,t){return on.some(t)},initialData:n}),bg.config({}),Jd("execute-on-form",m.concat([fr(lo(),function(n,t){dg.focusIn(n)})])),RS({})]),components:[c.asSpec(),s.asSpec(),d.asSpec()]}),p=G_({getRoot:function(){return g},getFooter:function(){return d.get(g)},getBody:function(){return s.get(g)},getFormWrapper:function(){var n=s.get(g);return nd.getCurrent(n).getOr(n)}},t.redial,l);return{dialog:g,instanceApi:p}}function sM(n){return sn(n)&&-1!==oI.indexOf(n.mceAction)}function fM(e,n,o,t){var r,i=eM(e.title,t),u=function(n){var t={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[zS({dom:{tag:"iframe",attributes:{src:n.url}},behaviours:ya([Xy.config({}),bg.config({})])})]}],behaviours:ya([dg.config({mode:"acyclic",useTabstopAt:b(HS)})])};return SM.parts().body(t)}(e),a=e.buttons.bind(function(n){return 0===n.length?on.none():on.some(U_({buttons:n},t))}),c=ZF(function(){return h},oM(function(){return p},n)),s=N(N({},e.height.fold(function(){return{}},function(n){return{height:n+"px","max-height":n+"px"}})),e.width.fold(function(){return{}},function(n){return{width:n+"px","max-width":n+"px"}})),f=e.width.isNone()&&e.height.isNone()?["tox-dialog--width-lg"]:[],l=new eI(e.url,{base_uri:new eI(v.window.location.href)}),d=l.protocol+"://"+l.host+(l.port?":"+l.port:""),m=Ee(on.none()),g=[Jd("messages",[Ri(function(){var n=fb(Be.fromDom(v.window),"message",function(n){if(l.isSameOrigin(new eI(n.raw().origin))){var t=n.raw().data;sM(t)?function(n,t,e){switch(e.mceAction){case"insertContent":n.insertContent(e.content);break;case"setContent":n.setContent(e.content);break;case"execCommand":var o=!!ln(e.ui)&&e.ui;n.execCommand(e.cmd,o,e.value);break;case"close":t.close();break;case"block":t.block(e.message);break;case"unblock":t.unblock()}}(o,h,t):function(n){return!sM(n)&&sn(n)&&Tn(n,"mceAction")}(t)&&e.onMessage(h,t)}});m.set(on.some(n))}),Vi(function(){m.get().each(function(n){return n.unbind()})})]),dc.config({channels:(r={},r[QF]={onReceive:function(n,t){Ou(n.element(),"iframe").each(function(n){n.dom().contentWindow.postMessage(t,d)})}},r)})],p=rM({header:i,body:u,footer:a,extraClasses:f,extraBehaviours:g,extraStyles:s},e,c,t),h=function(t){function n(n){t.getSystem().isConnected()&&n(t)}return{block:function(t){if(!cn(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");n(function(n){qt(n,dy,{message:t})})},unblock:function(){n(function(n){Yt(n,my)})},close:function(){n(function(n){Yt(n,cy)})},sendMessage:function(t){n(function(n){n.getSystem().broadcastOn([QF],t)})}}}(p);return{dialog:p,instanceApi:h}}var lM,dM,mM,gM,pM,hM=function(i,r){r.delimiter||(r.delimiter="\xbb");return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:ya([dg.config({mode:"flow",selector:"div[role=button]"}),Xy.config({}),gg.config({}),Jd("elementPathEvents",[Ri(function(e,n){i.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return dg.focusIn(e)}),i.on("NodeChange",function(n){var t=function(n){for(var t=[],e=n.length;0<e--;){var o=n[e];if(1===o.nodeType&&!T_(o)){var r=i.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||t.push({name:r.name,element:o}),r.isPropagationStopped())break}}return t}(n.parents);0<t.length&&gg.set(e,function(n){var t=S(n||[],function(t,n){return Xg.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":n,"tab-index":-1,"aria-level":n+1},innerHtml:t.name},action:function(n){i.focus(),i.selection.select(t.element),i.nodeChanged()}})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+r.delimiter+" "}};return O(t.slice(1),function(n,t){var e=n;return e.push(o),e.push(t),e},[t[0]])}(t))})})])]),components:[]}},vM=function(l){function d(){return e.bind(VA.getHeader)}function m(){return an.value(v)}function n(){return e.bind(function(n){return VA.getMoreButton(n)}).getOrDie("Could not find more button element")}function g(){return e.bind(function(n){return VA.getThrobber(n)}).getOrDie("Could not find throbber element")}var t=l.inline,p=t?qA:WA,h=Qb(l)?pA:yA,e=on.none(),o=Ht(),r=o.browser.isIE()?["tox-platform-ie"]:[],i=o.deviceType.isTouch()?["tox-platform-touch"]:[],u=ih.isRtl()?{attributes:{dir:"rtl"}}:{},v=au({dom:N({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(r).concat(i)},u),behaviours:ya([_f.config({useFixed:function(){return h.isDocked(d)}})])}),a=bm({dom:{tag:"div",classes:["tox-anchorbar"]}}),b=SO(v,l,function(){return e.bind(function(n){return a.getOpt(n)}).getOrDie("Could not find a anchor bar element")},n),c=VA.parts().menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:b,onEscape:function(){l.focus()}}),s=qb(l),f=VA.parts().toolbar({dom:{tag:"div",classes:["tox-toolbar"]},getSink:m,backstage:b,onEscape:function(){l.focus()},split:s,lazyToolbar:function(){return e.bind(function(n){return VA.getToolbar(n)}).getOrDie("Could not find more toolbar element")},lazyMoreButton:n,lazyHeader:function(){return d().getOrDie("Could not find header element")}}),y=VA.parts()["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},onEscape:function(){},split:s}),x=VA.parts().socket({dom:{tag:"div",classes:["tox-edit-area"]}}),w=VA.parts().sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),S=VA.parts().throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:b}),C=l.getParam("statusbar",!0,"boolean")&&!t?on.some(E_(l,b.shared.providers)):on.none(),k={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[x,w]},O=Yb(l),T=Lb(l),E=zb(l),D=VA.parts().header({dom:{tag:"div",classes:["tox-editor-header"]},components:H([E?[c]:[],O?[y]:T?[f]:[],Jb(l)?[]:[a.asSpec()]]),sticky:Qb(l),editor:l,getSink:m}),B=H([[D],t?[]:[k]]),A=H([[{dom:{tag:"div",classes:["tox-editor-container"]},components:B}],t?[]:C.toArray(),[S]]),_=$b(l),M=N(N({role:"application"},ih.isRtl()?{dir:"rtl"}:{}),_?{"aria-hidden":"true"}:{}),F=au(VA.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(t?["tox-tinymce-inline"]:[]).concat(i).concat(r),styles:N({visibility:"hidden"},_?{opacity:"0",border:"0"}:{}),attributes:M},components:A,behaviours:ya([dg.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"})])}));e=on.some(F),l.shortcuts.add("alt+F9","focus menubar",function(){VA.focusMenubar(F)}),l.shortcuts.add("alt+F10","focus toolbar",function(){VA.focusToolbar(F)});var I=Fb(F),R=Fb(v);KB(l,I,R),uy(l);function V(){var n=YA(tB(l)),t=YA(function(n){return eB(n).getOr(Rb(n))}(l));return l.inline||(pi("div","width",t)&&li(F.element(),"width",t),pi("div","height",n)?li(F.element(),"height",n):li(F.element(),"height","200px")),n}return{mothership:I,uiMothership:R,backstage:b,renderUI:function(){h.setup(l,d),t_(l,b),vB(l,m,b),function(o){var r=o.ui.registry.getAll().sidebars;bn(wn(r),function(t){function e(){return on.from(o.queryCommandValue("ToggleSidebar")).is(t)}var n=r[t];o.ui.registry.addToggleButton(t,{icon:n.icon,tooltip:n.tooltip,onAction:function(n){o.execCommand("ToggleSidebar",!1,t),n.setActive(e())},onSetup:function(n){function t(){return n.setActive(e())}return o.on("ToggleSidebar",t),function(){o.off("ToggleSidebar",t)}}})})}(l),function(e,t,o){function r(n){n!==i.get()&&(JD(t(),n,o.providers),i.set(n))}var i=Ee(!1),u=Ee(on.none());e.on("ProgressState",function(n){if(u.get().each(Kg.clearTimeout),mn(n.time)){var t=Kg.setEditorTimeout(e,function(){return r(n.state)},n.time);u.set(on.some(t))}else r(n.state),u.set(on.none())})}(l,g,b.shared);var n=l.ui.registry.getAll(),t=n.buttons,e=n.menuItems,o=n.contextToolbars,r=n.sidebars,i=jb(l),u={menuItems:e,menus:l.settings.menu?P(l.settings.menu,function(n){return An(n,{items:n.items})}):{},menubar:l.settings.menubar,toolbar:i.getOrThunk(function(){return l.getParam("toolbar",!0)}),buttons:t,sidebar:r};qB(l,o,v,{backstage:b}),k_(l,v);var a=l.getElement(),c=V(),s={mothership:I,uiMothership:R,outerContainer:F},f={targetNode:a,height:c};return p.render(l,s,u,b,f)},getUi:function(){return{channels:{broadcastAll:R.broadcast,broadcastOn:R.broadcastOn,register:function(){}}}}}},bM=function(n,t){var e=on.from(Mr(n,"id")).fold(function(){var n=Hr("dialog-label");return _r(t,"id",n),n},l);_r(n,"aria-labelledby",e)},yM=nn([ct("lazySink"),ht("dragBlockClass"),Dt("getBounds",Cu),St("useTabstopAt",nn(!0)),St("eventOrder",{}),Is("modalBehaviours",[dg]),Ju("onExecute"),Qu("onEscape")]),xM={sketch:l},wM=nn([Cl({name:"draghandle",overrides:function(n,t){return{behaviours:ya([S_.config({mode:"mouse",getTarget:function(n){return ku(n,'[role="dialog"]').getOr(n)},blockerClass:n.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(t,null,2)).message),getBounds:n.getDragBounds})])}}}),wl({schema:[ct("dom")],name:"title"}),wl({factory:xM,schema:[ct("dom")],name:"close"}),wl({factory:xM,schema:[ct("dom")],name:"body"}),Cl({factory:xM,schema:[ct("dom")],name:"footer"}),Sl({factory:{sketch:function(n,t){return N(N({},n),{dom:t.dom,components:t.components})}},schema:[St("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),St("components",[])],name:"blocker"})]),SM=_l({name:"ModalDialog",configFields:yM(),partFields:wM(),factory:function(o,n,t,r){var a=Hr("alloy.dialog.busy"),c=Hr("alloy.dialog.idle"),s=ya([dg.config({mode:"special",onTab:function(){return on.some(!0)},onShiftTab:function(){return on.some(!0)}}),bg.config({})]),e=Hr("modal-events"),i=N(N({},o.eventOrder),{"alloy.system.attached":[e].concat(o.eventOrder["alloy.system.attached"]||[])});return{uid:o.uid,dom:o.dom,components:n,apis:{show:function(i){var n=o.lazySink(i).getOrDie(),u=Ee(on.none()),t=r.blocker(),e=n.getSystem().build(N(N({},t),{components:t.components.concat([cu(i)]),behaviours:ya([bg.config({}),Jd("dialog-blocker-events",[fr(lo(),function(){dg.focusIn(i)}),rr(c,function(n,t){Fr(i.element(),"aria-busy")&&(Ir(i.element(),"aria-busy"),u.get().each(function(n){return gg.remove(i,n)}))}),rr(a,function(n,t){_r(i.element(),"aria-busy","true");var e=t.event().getBusySpec();u.get().each(function(n){gg.remove(i,n)});var o=e(i,s),r=n.getSystem().build(o);u.set(on.some(r)),gg.append(i,cu(r)),r.hasConfigured(dg)&&dg.focusIn(r)})])])}));vs(n,e),dg.focusIn(i)},hide:function(t){br(t.element()).each(function(n){t.getSystem().getByDom(n).each(function(n){ys(n)})})},getBody:function(n){return Js(n,o,"body")},getFooter:function(n){return Js(n,o,"footer")},setIdle:function(n){Yt(n,c)},setBusy:function(n,t){qt(n,a,{getBusySpec:t})}},eventOrder:i,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Vs(o.modalBehaviours,[gg.config({}),dg.config({mode:"cyclic",onEnter:o.onExecute,onEscape:o.onEscape,useTabstopAt:o.useTabstopAt}),Jd(e,[Ri(function(n){bM(n.element(),Js(n,o,"title").element()),function(n,t){var e=on.from(Mr(n,"id")).fold(function(){var n=Hr("dialog-describe");return _r(t,"id",n),n},l);_r(n,"aria-describedby",e)}(n.element(),Js(n,o,"body").element())})])])}},apis:{show:function(n,t){n.show(t)},hide:function(n,t){n.hide(t)},getBody:function(n,t){return n.getBody(t)},getFooter:function(n,t){return n.getFooter(t)},setBusy:function(n,t,e){n.setBusy(t,e)},setIdle:function(n,t){n.setIdle(t)}}}),CM=[ft("type"),ft("text"),lt("level",["info","warn","error","success"]),ft("icon"),St("url","")],kM=de(CM),OM=[ft("type"),ft("text"),Et("disabled",!1),Et("primary",!1),he("name","name",In(function(){return Hr("button-name")}),Se),yt("icon"),Et("borderless",!1)],TM=de(OM),EM=[ft("type"),ft("name"),ft("label"),Et("disabled",!1)],DM=de(EM),BM=Ce,AM=[ft("type"),ft("name")],_M=AM.concat([yt("label")]),MM=de(_M),FM=Se,IM=de(_M),RM=Se,VM=de(_M),NM=Kn(ve),HM=_M.concat([Et("sandboxed",!0)]),PM=de(HM),zM=Se,LM=_M.concat([yt("inputMode"),yt("placeholder"),Et("maximized",!1),Et("disabled",!1)]),jM=de(LM),UM=Se,WM=_M.concat([gt("items",[ft("text"),ft("value")]),kt("size",1),Et("disabled",!1)]),GM=de(WM),XM=Se,YM=_M.concat([Et("constrain",!0),Et("disabled",!1)]),qM=de(YM),KM=de([ft("width"),ft("height")]),JM=_M.concat([yt("placeholder"),Et("maximized",!1),Et("disabled",!1)]),$M=de(JM),QM=Se,ZM=_M.concat([Tt("filetype","file",["image","media","file"]),St("disabled",!1)]),nF=de(ZM),tF=de([ft("value"),St("meta",{})]),eF=AM.concat([Ot("tag","textarea"),ft("scriptId"),ft("scriptUrl"),(lM="settings",dM=undefined,Ct(lM,dM,Te))]),oF=AM.concat([Ot("tag","textarea"),dt("init")]),rF=Zn(function(n){return tt("customeditor.old",qn(oF),n).orThunk(function(){return tt("customeditor.new",qn(eF),n)})}),iF=Se,uF=[ft("type"),ft("html"),Tt("presets","presentation",["presentation","document"])],aF=de(uF),cF=_M.concat([st("currentState",de([ct("blob"),ft("url")]))]),sF=de(cF),fF=_M.concat([St("columns","auto")]),lF=de(fF),dF=(mM=[ft("value"),ft("text"),ft("icon")],ge(mM)),mF=[ft("type"),pt("header",Se),pt("cells",Kn(Se))],gF=de(mF),pF=be(function(){return rt("type",{alertbanner:kM,bar:de(function(n){return[ft("type"),n]}(B_("bar"))),button:TM,checkbox:DM,colorinput:MM,colorpicker:IM,dropzone:VM,grid:de(D_(B_("grid"))),iframe:PM,input:jM,selectbox:GM,sizeinput:qM,textarea:$M,urlinput:nF,customeditor:rF,htmlpanel:aF,imagetools:sF,collection:lF,label:de(function(n){return[ft("type"),ft("label"),n]}(B_("label"))),table:gF,panel:vF})}),hF=[ft("type"),St("classes",[]),pt("items",pF)],vF=de(hF),bF=[he("name","name",In(function(){return Hr("tab-name")}),Se),ft("title"),pt("items",pF)],yF=[ft("type"),gt("tabs",bF)],xF=de(yF),wF=de([ft("type"),ft("name"),Et("active",!1)].concat(Gp)),SF=Ce,CF=[he("name","name",In(function(){return Hr("button-name")}),Se),yt("icon"),Tt("align","end",["start","end"]),Et("primary",!1),Et("disabled",!1)],kF=g(CF,[ft("text")]),OF=g([lt("type",["submit","cancel","custom"])],kF),TF=g([lt("type",["menu"]),yt("text"),yt("tooltip"),yt("icon"),pt("items",wF),Dt("onSetup",function(){return Z})],CF),EF=kF,DF=it("type",{submit:OF,cancel:OF,custom:OF,menu:TF}),BF=de([ft("title"),st("body",rt("type",{panel:vF,tabpanel:xF})),Ot("size","normal"),pt("buttons",DF),St("initialData",{}),Dt("onAction",Z),Dt("onChange",Z),Dt("onSubmit",Z),Dt("onClose",Z),Dt("onCancel",Z),St("onTabChange",Z)]),AF=function(n){return sn(n)?[n].concat(D(R(n),AF)):fn(n)?D(n,AF):[]},_F={checkbox:BM,colorinput:FM,colorpicker:RM,dropzone:NM,input:UM,iframe:zM,sizeinput:KM,selectbox:XM,size:KM,textarea:QM,urlinput:tF,customeditor:iF,collection:dF,togglemenuitem:SF},MF=de(g([lt("type",["cancel","custom"])],EF)),FF=de([ft("title"),ft("url"),bt("height"),bt("width"),(gM="buttons",pM=MF,vt(gM,Kn(pM))),Dt("onAction",Z),Dt("onCancel",Z),Dt("onClose",Z),Dt("onMessage",Z)]),IF={open:function(n,t){var e=M_(t);return n(e.internalDialog,e.initialData,e.dataValidator)},openUrl:function(n,t){return n(et(function(n){return tt("dialog",FF,n)}(t)))},redial:function(n){return M_(n)}},RF=Al({name:"TabButton",configFields:[St("uid",undefined),ct("value"),he("dom","dom",Rn(function(n){return{attributes:{role:"tab",id:Hr("aria"),"aria-selected":"false"}}}),xe()),ht("action"),St("domModification",{}),Is("tabButtonBehaviours",[bg,dg,nl]),ct("view")],factory:function(n,t){return{uid:n.uid,dom:n.dom,components:n.components,events:im(n.action),behaviours:Vs(n.tabButtonBehaviours,[bg.config({}),dg.config({mode:"execution",useSpace:!0,useEnter:!0}),nl.config({store:{mode:"memory",initialValue:n.value}})]),domModification:n.domModification}}}),VF=nn([ct("tabs"),ct("dom"),St("clickToDismiss",!1),Is("tabbarBehaviours",[cd,dg]),Yu(["tabClass","selectedClass"])]),NF=kl({factory:RF,name:"tabs",unit:"tab",overrides:function(o,n){function r(n,t){cd.dehighlight(n,t),qt(n,Wo(),{tabbar:n,button:t})}function i(n,t){cd.highlight(n,t),qt(n,Uo(),{tabbar:n,button:t})}return{action:function(n){var t=n.getSystem().getByUid(o.uid).getOrDie(),e=cd.isHighlighted(t,n);(e&&o.clickToDismiss?r:e?Z:i)(t,n)},domModification:{classes:[o.markers.tabClass]}}}}),HF=nn([NF]),PF=_l({name:"Tabbar",configFields:VF(),partFields:HF(),factory:function(n,t,e,o){return{uid:n.uid,dom:n.dom,components:t,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Vs(n.tabbarBehaviours,[cd.config({highlightClass:n.markers.selectedClass,itemClass:n.markers.tabClass,onHighlight:function(n,t){_r(t.element(),"aria-selected","true")},onDehighlight:function(n,t){_r(t.element(),"aria-selected","false")}}),dg.config({mode:"flow",getInitial:function(n){return cd.getHighlighted(n).map(function(n){return n.element()})},selector:"."+n.markers.tabClass,executeOnMove:!0})])}}}),zF=Al({name:"Tabview",configFields:[Is("tabviewBehaviours",[gg])],factory:function(n,t){return{uid:n.uid,dom:n.dom,behaviours:Vs(n.tabviewBehaviours,[gg.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),LF=nn([St("selectFirst",!0),Ku("onChangeTab"),Ku("onDismissTab"),St("tabs",[]),Is("tabSectionBehaviours",[])]),jF=wl({factory:PF,schema:[ct("dom"),mt("markers",[ct("tabClass"),ct("selectedClass")])],name:"tabbar",defaults:function(n){return{tabs:n.tabs}}}),UF=wl({factory:zF,name:"tabview"}),WF=nn([jF,UF]),GF=_l({name:"TabSection",configFields:LF(),partFields:WF(),factory:function(r,n,t,e){function o(n,t){Ks(n,r,"tabbar").each(function(n){t(n).each(Kt)})}return{uid:r.uid,dom:r.dom,components:n,behaviours:Rs(r.tabSectionBehaviours),events:tr(H([r.selectFirst?[Ri(function(n,t){o(n,cd.getFirst)})]:[],[rr(Uo(),function(n,t){!function(o){var t=nl.getValue(o);Ks(o,r,"tabview").each(function(e){T(r.tabs,function(n){return n.value===t}).each(function(n){var t=n.view();_r(e.element(),"aria-labelledby",Mr(o.element(),"id")),gg.set(e,t),r.onChangeTab(e,o,t)})})}(t.event().button())}),rr(Wo(),function(n,t){var e=t.event().button();r.onDismissTab(n,e)})]])),apis:{getViewItems:function(n){return Ks(n,r,"tabview").map(function(n){return gg.contents(n)}).getOr([])},showTab:function(n,e){o(n,function(t){var n=cd.getCandidates(t);return T(n,function(n){return nl.getValue(n)===e}).filter(function(n){return!cd.isHighlighted(t,n)})})}}}},apis:{getViewItems:function(n,t){return n.getViewItems(t)},showTab:function(n,t,e){n.showTab(t,e)}}}),XF="send-data-to-section",YF="send-data-to-view",qF=Hr("update-dialog"),KF=Hr("update-title"),JF=Hr("update-body"),$F=Hr("update-footer"),QF=Hr("body-send-message"),ZF=function(i,n){function t(n,r){return rr(n,function(e,o){u(e,function(n,t){r(i(),n,o.event(),e)})})}var u=function(t,e){LE.getState(t).get().each(function(n){e(n,t)})};return g(z_(t,n),[t(fy,function(n,t,e){t.onAction(n,{name:e.name()})})])},nI=function(i,n){function t(n,r){return rr(n,function(e,o){u(e,function(n,t){r(i(),n,o.event(),e)})})}var u=function(t,e){LE.getState(t).get().each(function(n){e(n.internalDialog,t)})};return g(z_(t,n),[t(ly,function(n,t){return t.onSubmit(n)}),t(ay,function(n,t,e){t.onChange(n,{name:e.name()})}),t(fy,function(n,t,e,o){function r(){return dg.focusIn(o)}var i=Ca();t.onAction(n,{name:e.name(),value:e.value()}),Ca().fold(function(){r()},function(n){!to(o.element(),n)||Fr(n,"disabled")?r():to(n,i.getOrNull())&&Fr(i.getOrDie(),"disabled")&&r()})}),t(gy,function(n,t,e){t.onTabChange(n,{newTabName:e.name(),oldTabName:e.oldName()})}),Vi(function(n){var t=i();nl.setValue(n,t.getData())})])},tI=ph.deviceType.isTouch(),eI=tinymce.util.Tools.resolve("tinymce.util.URI"),oI=["insertContent","setContent","execCommand","close","block","unblock"],rI=function(n){var l=n.backstage,d=n.editor,m=Qb(d),e=function(c){var s=c.backstage.shared;return{open:function(n,t){function e(){SM.hide(u),t()}var o=bm(ZC({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:on.none()},"cancel",c.backstage)),r=q_(),i=Y_(e,s.providers),u=au(Q_({lazySink:function(){return s.getSink()},header:X_(r,i),body:K_(n,s.providers),footer:on.some(J_($_([],[o.asSpec()]))),onEscape:e,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[rr(sy,e)],eventOrder:{}}));SM.show(u);var a=o.get(u);bg.focus(a)}}}(n),o=function(s){var f=s.backstage.shared;return{open:function(n,t){function e(n){SM.hide(a),t(n)}var o=bm(ZC({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:on.none()},"submit",s.backstage)),r=ZC({name:"no",text:"No",primary:!0,align:"end",disabled:!1,icon:on.none()},"cancel",s.backstage),i=q_(),u=Y_(function(){return e(!1)},f.providers),a=au(Q_({lazySink:function(){return f.getSink()},header:X_(i,u),body:K_(n,f.providers),footer:on.some(J_($_([],[r,o.asSpec()]))),onEscape:function(){return e(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[rr(sy,function(){return e(!1)}),rr(ly,function(){return e(!0)})],eventOrder:{}}));SM.show(a);var c=o.get(a);bg.focus(c)}}}(n),r=function(n,e){return IF.openUrl(function(n){var t=fM(n,{closeWindow:function(){SM.hide(t.dialog),e(t.instanceApi)}},d,l);return SM.show(t.dialog),t.instanceApi},n)},i=function(n,i){return IF.open(function(n,t,e){var o=t,r=aM({dataValidator:e,initialData:o,internalDialog:n},{redial:IF.redial,closeWindow:function(){SM.hide(r.dialog),i(r.instanceApi)}},l);return SM.show(r.dialog),r.instanceApi.setData(o),r.instanceApi},n)},u=function(n,c,s,f){return IF.open(function(n,t,e){function o(){return i.on(function(n){lA.refresh(n)})}var r=function(n,t){return et(tt("data",t,n))}(t,e),i=function(){var t=Ee(on.none());return{clear:function(){t.set(on.none())},set:function(n){t.set(on.some(n))},isSet:function(){return t.get().isSome()},on:function(n){t.get().each(n)}}}(),u=cM({dataValidator:e,initialData:r,internalDialog:n},{redial:IF.redial,closeWindow:function(){i.on(Ug.hide),d.off("ResizeEditor",o),i.clear(),s(u.instanceApi)}},l,f),a=au(Ug.sketch({lazySink:l.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{},inlineBehaviours:ya(g([Jd("window-manager-inline-events",[rr(Po(),function(n,t){Yt(u.dialog,sy)})])],function(n,t){return t?[]:[lA.config({contextual:{lazyContext:function(){return on.some(wu(Be.fromDom(n.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},leftAttr:"data-dock-left",topAttr:"data-dock-top",positionAttr:"data-dock-pos",modes:["top"]})]}(d,m)))}));return i.set(a),Ug.showWithin(a,c,cu(u.dialog),on.some(Mi())),m||(lA.refresh(a),d.on("ResizeEditor",o)),u.instanceApi.setData(r),dg.focusIn(u.dialog),u.instanceApi},n)};return{open:function(n,t,e){return t!==undefined&&"toolbar"===t.inline?u(n,l.shared.anchors.toolbar(),e,t.ariaAttrs):t!==undefined&&"cursor"===t.inline?u(n,l.shared.anchors.cursor(),e,t.ariaAttrs):i(n,e)},openUrl:function(n,t){return r(n,t)},alert:function(n,t){e.open(n,function(){t()})},close:function(n){n.close()},confirm:function(n,t){o.open(n,function(n){t(n)})}}};!function gI(){n.add("silver",function(n){var t=vM(n),e=t.uiMothership,o=t.backstage,r=t.renderUI,i=t.getUi;mb(n,o.shared);var u=rI({editor:n,backstage:o});return{renderUI:r,getWindowManagerImpl:nn(u),getNotificationManagerImpl:function(){return Jg(0,{backstage:o},e)},ui:i()}})}()}(window);