merchant-web/public/plugins/tinymce/themes/silver/theme.min.js

9 lines
399 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.9.2 (2021-09-08)
*/
!function(){"use strict";function t(o){return function(t){return e=typeof(n=t),(null===n?"null":"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e)===o;var n,e}}function n(n){return function(t){return typeof t===n}}function e(n){return function(t){return n===t}}function g(t){return null==t}function f(t){return!g(t)}function d(t,n){if(c(t)){for(var e=0,o=t.length;e<o;++e)if(!n(t[e]))return;return 1}}function ct(){}function r(e,o){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e(o.apply(null,t))}}function tt(t){return function(){return t}}function h(t){return t}function v(t,n){return t===n}var y=t("string"),x=t("object"),c=t("array"),b=e(null),w=n("boolean"),E=e(void 0),m=n("function"),u=n("number");function S(o){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var e=r.concat(t);return o.apply(null,e)}}function k(n){return function(t){return!n(t)}}function C(t){return function(){throw new Error(t)}}var O=tt(!1),_=tt(!0),o=tinymce.util.Tools.resolve("tinymce.ThemeManager"),st=function(){return(st=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}).apply(this,arguments)};function s(t,n){var e={};for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(e[r[o]]=t[r[o]]);return e}function H(t,n,e){if(e||2===arguments.length)for(var o,r=0,i=n.length;r<i;r++)!o&&r in n||((o=o||Array.prototype.slice.call(n,0,r))[r]=n[r]);return t.concat(o||Array.prototype.slice.call(n))}function i(){return a}var a={fold:function(t,n){return t()},isSome:O,isNone:_,getOr:h,getOrThunk:l,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:tt(null),getOrUndefined:tt(void 0),or:h,orThunk:l,map:i,each:ct,bind:i,exists:O,forall:_,filter:function(){return a},toArray:function(){return[]},toString:tt("none()")};function l(t){return t()}function p(t,n){return Z.call(t,n)}function T(t,n){for(var e=0,o=t.length;e<o;e++)if(n(t[e],e))return!0;return!1}function D(t,n){for(var e=[],o=0;o<t;o++)e.push(n(o));return e}function B(t,n){for(var e=[],o=0;o<t.length;o+=n){var r=Q.call(t,o,o+n);e.push(r)}return e}function A(t,n){for(var e=t.length,o=new Array(e),r=0;r<e;r++){var i=t[r];o[r]=n(i,r)}return o}function M(t,n){for(var e=[],o=[],r=0,i=t.length;r<i;r++){var u=t[r];(n(u,r)?e:o).push(u)}return{pass:e,fail:o}}function F(t,n){for(var e=[],o=0,r=t.length;o<r;o++){var i=t[o];n(i,o)&&e.push(i)}return e}function I(t,o,r){return function(t){for(var n,e=t.length-1;0<=e;e--)n=t[e],r=o(r,n,e)}(t),r}function R(t,e,o){return dt(t,function(t,n){o=e(o,t,n)}),o}function V(t,n){return function(t,n,e){for(var o=0,r=t.length;o<r;o++){var i=t[o];if(n(i,o))return ft.some(i);if(e(i,o))break}return ft.none()}(t,n,O)}function P(t,n){for(var e=0,o=t.length;e<o;e++)if(n(t[e],e))return ft.some(e);return ft.none()}function lt(t){for(var n=[],e=0,o=t.length;e<o;++e){if(!c(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);nt.apply(n,t[e])}return n}function z(t,n){return lt(A(t,n))}function N(t,n){for(var e=0,o=t.length;e<o;++e)if(!0!==n(t[e],e))return!1;return!0}function L(t){var n=Q.call(t,0);return n.reverse(),n}function j(t,n){return F(t,function(t){return!et(n,t)})}function W(t,n){for(var e={},o=0,r=t.length;o<r;o++){var i=t[o];e[String(i)]=n(i,o)}return e}function U(t){return[t]}function G(t,n){var e=Q.call(t,0);return e.sort(n),e}function X(t,n){return 0<=n&&n<t.length?ft.some(t[n]):ft.none()}function Y(t){return X(t,t.length-1)}function q(t,n){for(var e=0;e<t.length;e++){var o=n(t[e],e);if(o.isSome())return o}return ft.none()}var K,J,$=function(e){function t(){return r}function n(t){return t(e)}var o=tt(e),r={fold:function(t,n){return n(e)},isSome:_,isNone:O,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:t,orThunk:t,map:function(t){return $(t(e))},each:function(t){t(e)},bind:n,exists:n,forall:n,filter:function(t){return t(e)?r:a},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return r},ft={some:$,none:i,from:function(t){return null==t?a:$(t)}},Q=Array.prototype.slice,Z=Array.prototype.indexOf,nt=Array.prototype.push,et=function(t,n){return-1<p(t,n)},dt=function(t,n){for(var e=0,o=t.length;e<o;e++)n(t[e],e)},ot=function(t){return X(t,0)},rt=m(Array.from)?Array.from:function(t){return Q.call(t)},it=function(e){return{isValue:_,isError:O,getOr:tt(e),getOrThunk:tt(e),getOrDie:tt(e),or:function(t){return it(e)},orThunk:function(t){return it(e)},fold:function(t,n){return n(e)},map:function(t){return it(t(e))},mapError:function(t){return it(e)},each:function(t){t(e)},bind:function(t){return t(e)},exists:function(t){return t(e)},forall:function(t){return t(e)},toOptional:function(){return ft.some(e)}}},ut=function(e){return{isValue:O,isError:_,getOr:h,getOrThunk:function(t){return t()},getOrDie:function(){return C(String(e))()},or:h,orThunk:function(t){return t()},fold:function(t,n){return t(e)},map:function(t){return ut(e)},mapError:function(t){return ut(t(e))},each:ct,bind:function(t){return ut(e)},exists:O,forall:_,toOptional:ft.none}},mt={value:it,error:ut,fromOption:function(t,n){return t.fold(function(){return ut(n)},it)}};function at(t,n,e){return t.stype===K.Error?n(t.serror):e(t.svalue)}function gt(t){return{stype:K.Value,svalue:t}}function pt(t){return{stype:K.Error,serror:t}}function ht(t,n,e,o){return{tag:"field",key:t,newKey:n,presence:e,prop:o}}function vt(t,n,e){switch(t.tag){case"field":return n(t.key,t.newKey,t.presence,t.prop);case"custom":return e(t.newKey,t.instantiator)}}function bt(t,n){for(var e=Xn(t),o=0,r=e.length;o<r;o++){var i=e[o];n(t[i],i)}}function yt(t,e){return qn(t,function(t,n){return{k:n,v:e(t,n)}})}function xt(t,e){var o=[];return bt(t,function(t,n){o.push(e(t,n))}),o}function wt(t,n){for(var e=Xn(t),o=0,r=e.length;o<r;o++){var i=e[o],u=t[i];if(n(u,i,t))return ft.some(u)}return ft.none()}function St(t){return xt(t,h)}function kt(t,n){return Kn(t,n)?ft.from(t[n]):ft.none()}function Ct(t,n){return Kn(t,n)&&void 0!==t[n]&&null!==t[n]}function Ot(u){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Can't merge zero objects");for(var e={},o=0;o<t.length;o++){var r,i=t[o];for(r in i)Kn(i,r)&&(e[r]=u(e[r],i[r]))}return e}}function _t(e){var o,r=!1;return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r||(r=!0,o=e.apply(null,t)),o}}function Tt(){return{tag:"required",process:{}}}function Et(t){return{tag:"defaultedThunk",process:t}}function Dt(t){return Et(tt(t))}function Bt(){return{tag:"option",process:{}}}function At(t){return{tag:"mergeWithThunk",process:t}}function Mt(t){return x(t)&&100<Xn(t).length?" removed due to size":JSON.stringify(t,null,2)}function Ft(t,n){return Nn([{path:t,getErrorInfo:n}])}function It(e){return{extract:function(n,t){return jn(e(t),function(t){return Ft(n,tt(t))})},toString:tt("val")}}function Rt(t,n,e,o){return o(kt(t,n).getOrThunk(function(){return e(t)}))}function Vt(n,e,o,r,i){function u(t){return i.extract(e.concat([r]),t)}function t(t){return t.fold(function(){return zn(ft.none())},function(t){var n=i.extract(e.concat([r]),t);return Wn(n,ft.some)})}var a,c,s,l,f,d;switch(n.tag){case"required":return s=e,d=u,kt(l=o,f=r).fold(function(){return t=f,n=l,Ft(s,function(){return'Could not find valid *required* value for "'+t+'" in '+Mt(n)});var t,n},d);case"defaultedThunk":return Rt(o,r,n.process,u);case"option":return t(kt(o,r));case"defaultedOptionThunk":return c=n.process,t(kt(a=o,r).map(function(t){return!0===t?c(a):t}));case"mergeWithThunk":return Rt(o,r,tt({}),function(t){return u(Jn(n.process(o),t))})}}function Pt(e){return{extract:function(t,n){return e().extract(t,n)},toString:function(){return e().toString()}}}function Ht(t){var s=te(t),l=I(t,function(e,t){return vt(t,function(t){var n;return Jn(e,((n={})[t]=!0,n))},tt(e))},{});return{extract:function(t,n){var e,o,r,i,u,a,c=F(w(n)?[]:Xn((r=f,i=o={},u=function(t,n){i[n]=t},a=ct,bt(n,function(t,n){(r(t,n)?u:a)(t,n)}),o)),function(t){return!Ct(l,t)});return 0===c.length?s.extract(t,n):(e=c,Ft(t,function(){return"There are unsupported fields: ["+e.join(", ")+"] specified"}))},toString:s.toString}}function zt(o){return{extract:function(e,t){var n=A(t,function(t,n){return o.extract(e.concat(["["+n+"]"]),t)});return Qn(n)},toString:function(){return"array("+o.toString()+")"}}}function Nt(u){return{extract:function(t,n){for(var e=[],o=0,r=u;o<r.length;o++){var i=r[o].extract(t,n);if(i.stype===K.Value)return i;e.push(i)}return Qn(e)},toString:function(){return"oneOf("+A(u,function(t){return t.toString()}).join(", ")+")"}}}function Lt(e,o){return It(function(t){var n=typeof t;return e(t)?zn(t):Nn("Expected type: "+o+" but got: "+n)})}function jt(n,a){return{extract:function(i,u){return kt(u,n).fold(function(){return t=n,Ft(i,function(){return'Choice schema did not contain choice key: "'+t+'"'});var t},function(t){return e=i,n=u,kt(o=a,r=t).fold(function(){return t=o,n=r,Ft(e,function(){return'The chosen schema: "'+n+'" did not exist in branches: '+Mt(t)});var t,n},function(t){return t.extract(e.concat(["branch: "+r]),n)});var e,n,o,r})},toString:function(){return"chooseOn("+n+"). Possible values: "+Xn(a)}}}function Wt(n){return It(function(t){return n(t).fold(Nn,zn)})}function Ut(n,t){return r=function(t){return n(t).fold(pt,gt)},i=t,{extract:function(e,o){var t=Xn(o),n=zt(It(r)).extract(e,t);return Ln(n,function(t){var n=A(t,function(t){return ht(t,t,Tt(),i)});return te(n).extract(e,o)})},toString:function(){return"setOf("+i.toString()+")"}};var r,i}function Gt(t,n,e){return Hn((r=n.extract([t],o=e),Un(r,function(t){return{input:o,errors:t}})));var o,r}function Xt(t){return t.fold(function(t){throw new Error(se(t))},h)}function Yt(t,n,e){return Xt(Gt(t,n,e))}function qt(t,n){return jt(t,yt(n,te))}function Kt(n){return Wt(function(t){return et(n,t)?mt.value(t):mt.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})}function Jt(t){return le(t,t,Tt(),ee())}function $t(t,n){return le(t,t,Tt(),n)}function Qt(t){return $t(t,re)}function Zt(t,n){return le(t,t,Tt(),Kt(n))}function tn(t){return $t(t,ue)}function nn(t,n){return le(t,t,Tt(),te(n))}function en(t,n){return le(t,t,Tt(),ne(n))}function on(t,n){return le(t,t,Tt(),zt(n))}function rn(t){return le(t,t,Bt(),ee())}function un(t,n){return le(t,t,Bt(),n)}function an(t){return un(t,oe)}function cn(t){return un(t,re)}function sn(t){return un(t,ue)}function ln(t,n){return un(t,zt(n))}function fn(t,n){return un(t,te(n))}function dn(t,n){return le(t,t,Dt(n),ee())}function mn(t,n,e){return le(t,t,Dt(n),e)}function gn(t,n){return mn(t,n,oe)}function pn(t,n){return mn(t,n,re)}function hn(t,n,e){return mn(t,n,Kt(e))}function vn(t,n){return mn(t,n,ie)}function bn(t,n){return mn(t,n,ue)}function yn(t,n,e){return mn(t,n,zt(e))}function xn(t,n,e){return mn(t,n,te(e))}function wn(t){var n=t;return{get:function(){return n},set:function(t){n=t}}}function Sn(t,n){var e=String(n).toLowerCase();return V(t,function(t){return t.search(e)})}function kn(t,n,e){return""===n||t.length>=n.length&&t.substr(e,e+n.length)===n}function Cn(t,n){return-1!==t.indexOf(n)}function On(t){return 0<t.length}function _n(n){return function(t){return Cn(t,n)}}function Tn(t){return window.matchMedia(t).matches}function En(t,n){var e=t.dom;if(1!==e.nodeType)return!1;var o=e;if(void 0!==o.matches)return o.matches(n);if(void 0!==o.msMatchesSelector)return o.msMatchesSelector(n);if(void 0!==o.webkitMatchesSelector)return o.webkitMatchesSelector(n);if(void 0!==o.mozMatchesSelector)return o.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}function Dn(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount}function Bn(t,n){return t.dom===n.dom}function An(t,n){return Be().browser.isIE()?(e=t.dom,o=n.dom,r=Node.DOCUMENT_POSITION_CONTAINED_BY,0!=(e.compareDocumentPosition(o)&r)):(i=t.dom)!==(u=n.dom)&&i.contains(u);var e,o,r,i,u}(J=K={})[J.Error=0]="Error",J[J.Value=1]="Value";function Mn(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}}function Fn(){return me(0,0)}function In(t){function n(t){return function(){return e===t}}var e=t.current,o=t.version;return{current:e,version:o,isEdge:n("Edge"),isChrome:n("Chrome"),isIE:n("IE"),isOpera:n("Opera"),isFirefox:n(xe),isSafari:n("Safari")}}function Rn(t){function n(t){return function(){return e===t}}var e=t.current,o=t.version;return{current:e,version:o,isWindows:n(ke),isiOS:n("iOS"),isAndroid:n(Ce),isOSX:n("OSX"),isLinux:n("Linux"),isSolaris:n(Oe),isFreeBSD:n(_e),isChromeOS:n(Te)}}function Vn(u){if(!c(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 dt(u,function(t,o){var n=Xn(t);if(1!==n.length)throw new Error("one and only one name per case");var r=n[0],i=t[r];if(void 0!==e[r])throw new Error("duplicate key detected:"+r);if("cata"===r)throw new Error("cannot have a case named cata (sorry)");if(!c(i))throw new Error("case arguments must be an array");a.push(r),e[r]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length;if(n!==i.length)throw new Error("Wrong number of arguments to case "+r+". Expected "+i.length+" ("+i+"), got "+n);return{fold:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length!==u.length)throw new Error("Wrong number of arguments to fold. Expected "+u.length+", got "+t.length);return t[o].apply(null,e)},match:function(t){var n=Xn(t);if(a.length!==n.length)throw new Error("Wrong number of arguments to match. Expected: "+a.join(",")+"\nActual: "+n.join(","));if(!N(a,function(t){return et(n,t)}))throw new Error("Not all branches were specified when using match. Specified: "+n.join(", ")+"\nRequired: "+a.join(", "));return t[r].apply(null,e)},log:function(t){console.log(t,{constructors:a,constructor:r,params:e})}}}}),e}var Pn,Hn=function(t){return at(t,mt.error,mt.value)},zn=gt,Nn=pt,Ln=function(t,n){return t.stype===K.Value?n(t.svalue):t},jn=function(t,n){return t.stype===K.Error?n(t.serror):t},Wn=function(t,n){return t.stype===K.Value?{stype:K.Value,svalue:n(t.svalue)}:t},Un=function(t,n){return t.stype===K.Error?{stype:K.Error,serror:n(t.serror)}:t},Gn=at,Xn=Object.keys,Yn=Object.hasOwnProperty,qn=function(t,o){var r={};return bt(t,function(t,n){var e=o(t,n);r[e.k]=e.v}),r},Kn=function(t,n){return Yn.call(t,n)},Jn=Ot(function(t,n){return x(t)&&x(n)?Jn(t,n):n}),$n=Ot(function(t,n){return n}),Qn=function(t){var n,e,o=(n=[],e=[],dt(t,function(t){at(t,function(t){return e.push(t)},function(t){return n.push(t)})}),{values:n,errors:e});return 0<o.errors.length?r(Nn,lt)(o.errors):zn(o.values)},Zn=It(zn),te=function(e){return{extract:function(i,u){for(var a={},c=[],t=0,n=e;t<n.length;t++)vt(n[t],function(t,n,e,o){var r=Vt(e,i,u,t,o);Gn(r,function(t){c.push.apply(c,t)},function(t){a[n]=t})},function(t,n){a[t]=n(u)});return 0<c.length?Nn(c):zn(a)},toString:function(){return"obj{\n"+A(e,function(t){return vt(t,function(t,n,e,o){return t+" -> "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"}}},ne=r(zt,te),ee=tt(Zn),oe=Lt(u,"number"),re=Lt(y,"string"),ie=Lt(w,"boolean"),ue=Lt(m,"function"),ae=function(n){if(Object(n)!==n)return!0;switch({}.toString.call(n).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(n).every(function(t){return ae(n[t])});default:return!1}},ce=It(function(t){return ae(t)?zn(t):Nn("Expected value to be acceptable for sending via postMessage")}),se=function(t){return"Errors: \n"+A(10<(n=t.errors).length?n.slice(0,10).concat([{path:[],getErrorInfo:tt("... (only showing first ten failures)")}]):n,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()}).join("\n")+"\n\nInput object: "+Mt(t.input);var n},le=ht,fe=function(t,n){return{tag:"custom",newKey:t,instantiator:n}},de={fromHtml:function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1<e.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return Mn(e.childNodes[0])},fromTag:function(t,n){var e=(n||document).createElement(t);return Mn(e)},fromText:function(t,n){var e=(n||document).createTextNode(t);return Mn(e)},fromDom:Mn,fromPoint:function(t,n,e){return ft.from(t.dom.elementFromPoint(n,e)).map(Mn)}},me=function(t,n){return{major:t,minor:n}},ge={nu:me,detect:function(t,n){var e,o,r=String(n).toLowerCase();return 0===t.length?Fn():(o=function(t,n){for(var e=0;e<t.length;e++){var o=t[e];if(o.test(n))return o}}(t,e=r))?me(i(1),i(2)):{major:0,minor:0};function i(t){return Number(e.replace(o,"$"+t))}},unknown:Fn},pe=function(t,n){return kn(t,n,0)},he=function(t,n){return kn(t,n,t.length-n.length)},ve=(Pn=/^\s+|\s+$/g,function(t){return t.replace(Pn,"")}),be=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,ye={browsers:tt([{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Cn(t,"edge/")&&Cn(t,"chrome")&&Cn(t,"safari")&&Cn(t,"applewebkit")}},{name:"Chrome",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,be],search:function(t){return Cn(t,"chrome")&&!Cn(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Cn(t,"msie")||Cn(t,"trident")}},{name:"Opera",versionRegexes:[be,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:_n("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:_n("firefox")},{name:"Safari",versionRegexes:[be,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Cn(t,"safari")||Cn(t,"mobile/"))&&Cn(t,"applewebkit")}}]),oses:tt([{name:"Windows",search:_n("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Cn(t,"iphone")||Cn(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:_n("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:_n("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:_n("linux"),versionRegexes:[]},{name:"Solaris",search:_n("sunos"),versionRegexes:[]},{name:"FreeBSD",search:_n("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:_n("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}])},xe="Firefox",we=function(){return In({current:void 0,version:ge.unknown()})},Se=In,ke=(tt("Edge"),tt("Chrome"),tt("IE"),tt("Opera"),tt(xe),tt("Safari"),"Windows"),Ce="Android",Oe="Solaris",_e="FreeBSD",Te="ChromeOS",Ee=function(){return Rn({current:void 0,version:ge.unknown()})},De=Rn,Be=(tt(ke),tt("iOS"),tt(Ce),tt("Linux"),tt("OSX"),tt(Oe),tt(_e),tt(Te),_t(function(){return t=navigator.userAgent,n=ft.from(navigator.userAgentData),e=Tn,p=ye.browsers(),h=ye.oses(),v=n.bind(function(t){return o=p,q(t.brands,function(n){var e=n.brand.toLowerCase();return V(o,function(t){var n;return e===(null===(n=t.brand)||void 0===n?void 0:n.toLowerCase())}).map(function(t){return{current:t.name,version:ge.nu(parseInt(n.version,10),0)}})});var o}).orThunk(function(){return Sn(p,e=t).map(function(t){var n=ge.detect(t.versionRegexes,e);return{current:t.name,version:n}});var e}).fold(we,Se),b=Sn(h,o=t).map(function(t){var n=ge.detect(t.versionRegexes,o);return{current:t.name,version:n}}).fold(Ee,De),{browser:v,os:b,deviceType:(i=v,u=t,a=e,c=(r=b).isiOS()&&!0===/ipad/i.test(u),s=r.isiOS()&&!c,f=(l=r.isiOS()||r.isAndroid())||a("(pointer:coarse)"),d=c||!s&&l&&a("(min-device-width:768px)"),m=s||l&&!d,g=i.isSafari()&&r.isiOS()&&!1===/safari/i.test(u),{isiPad:tt(c),isiPhone:tt(s),isTablet:tt(d),isPhone:tt(m),isTouch:tt(f),isAndroid:r.isAndroid,isiOS:r.isiOS,isWebView:tt(g),isDesktop:tt(!m&&!d&&!g)})};var t,n,e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b}));function Ae(t,n){return(e={})[t]=n,e;var e}function Me(t){return n={},dt(t,function(t){n[t.key]=t.value}),n;var n}function Fe(t){return m(t)?t:O}function Ie(t,n,e){for(var o=t.dom,r=Fe(e);o.parentNode;){var o=o.parentNode,i=de.fromDom(o),u=n(i);if(u.isSome())return u;if(r(i))break}return ft.none()}function Re(t,n,e){var o=n(t),r=Fe(e);return o.orThunk(function(){return r(t)?ft.none():Ie(t,n,r)})}function Ve(t,n){return Bn(t.element,n.event.target)}function Pe(t){if(!Ct(t,"can")&&!Ct(t,"abort")&&!Ct(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return st(st({},to),t)}function He(t){return tt("alloy."+t)}function ze(t,n){Ko(t,t.element,n,{})}function Ne(t,n,e){Ko(t,t.element,n,e)}function Le(t){ze(t,Eo())}function je(t,n,e){Ko(t,n,e,{})}function We(t,n,e,o){t.getSystem().triggerEvent(e,n,o.event)}function Ue(t,n){return{key:t,value:Pe({abort:n})}}function Ge(t){return{key:t,value:Pe({run:function(t,n){n.event.prevent()}})}}function Xe(t,n){return{key:t,value:Pe({run:n})}}function Ye(t,e,o){return{key:t,value:Pe({run:function(t,n){e.apply(void 0,[t,n].concat(o))}})}}function qe(t){return function(e){return{key:t,value:Pe({run:function(t,n){Ve(t,n)&&e(t,n)}})}}}function Ke(t,n,e){var o,r=n.partUids[e];return Xe(o=t,function(t,n){t.getSystem().getByUid(r).each(function(t){We(t,t.element,o,n)})})}function Je(t,r){return Xe(t,function(n,t){var e=t.event,o=n.getSystem().getByDom(e.target).getOrThunk(function(){return Re(e.target,function(t){return n.getSystem().getByDom(t).toOptional()},O).getOr(n)});r(n,o,t)})}function $e(t){return Xe(t,function(t,n){n.cut()})}function Qe(t,n){return qe(t)(n)}Vn([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var Ze,to={can:_,abort:O,run:ct},no=tt,eo=no("touchstart"),oo=no("touchmove"),ro=no("touchend"),io=no("touchcancel"),uo=no("mousedown"),ao=no("mousemove"),co=no("mouseout"),so=no("mouseup"),lo=no("mouseover"),fo=no("focusin"),mo=no("focusout"),go=no("keydown"),po=no("keyup"),ho=no("input"),vo=no("change"),bo=no("click"),yo=no("transitioncancel"),xo=no("transitionend"),wo=no("transitionstart"),So=no("selectstart"),ko={tap:He("tap")},Co=He("focus"),Oo=He("blur.post"),_o=He("paste.post"),To=He("receive"),Eo=He("execute"),Do=He("focus.item"),Bo=ko.tap,Ao=He("longpress"),Mo=He("sandbox.close"),Fo=He("typeahead.cancel"),Io=He("system.init"),Ro=He("system.touchmove"),Vo=He("system.touchend"),Po=He("system.scroll"),Ho=He("system.resize"),zo=He("system.attached"),No=He("system.detached"),Lo=He("system.dismissRequested"),jo=He("system.repositionRequested"),Wo=He("focusmanager.shifted"),Uo=He("slotcontainer.visibility"),Go=He("change.tab"),Xo=He("dismiss.tab"),Yo=He("highlight"),qo=He("dehighlight"),Ko=function(t,n,e,o){var r=st({target:n},o);t.getSystem().triggerEvent(e,n,r)},Jo=Me,$o=qe(zo()),Qo=qe(No()),Zo=qe(Io()),tr=(Ze=Eo(),function(t){return Xe(Ze,t)});function nr(t){return t.dom.nodeName.toLowerCase()}function er(n){return function(t){return t.dom.nodeType===n}}function or(t){return de.fromDom(t.dom.ownerDocument)}function rr(t){return Pi(t)?t:or(t)}function ir(t){return de.fromDom(rr(t).dom.documentElement)}function ur(t){return de.fromDom(rr(t).dom.defaultView)}function ar(t){return ft.from(t.dom.parentNode).map(de.fromDom)}function cr(t){return ft.from(t.dom.offsetParent).map(de.fromDom)}function sr(t){return A(t.dom.childNodes,de.fromDom)}function lr(t,n){var e=t.dom.childNodes;return ft.from(e[n]).map(de.fromDom)}function fr(t,n){return{element:t,offset:n}}function dr(t,n){var e=sr(t);return 0<e.length&&n<e.length?fr(e[n],0):fr(t,n)}function mr(t){return Hi(t)&&f(t.dom.host)}function gr(t){return mr(t)?t:de.fromDom(rr(t).dom.body)}function pr(t){return de.fromDom(t.dom.host)}function hr(n,e){ar(n).each(function(t){t.dom.insertBefore(e.dom,n.dom)})}function vr(t,n){ft.from(t.dom.nextSibling).map(de.fromDom).fold(function(){ar(t).each(function(t){Gi(t,n)})},function(t){hr(t,n)})}function br(n,e){lr(n,0).fold(function(){Gi(n,e)},function(t){n.dom.insertBefore(e.dom,t.dom)})}function yr(n,t){dt(t,function(t){Gi(n,t)})}function xr(t){t.dom.textContent="",dt(sr(t),function(t){Xi(t)})}function wr(t){var n,e=sr(t);0<e.length&&(n=t,dt(e,function(t){hr(n,t)})),Xi(t)}function Sr(t){return t.dom.innerHTML}function kr(t,n){var e,o,r=or(t).dom,i=de.fromDom(r.createDocumentFragment());yr(i,(e=n,(o=(r||document).createElement("div")).innerHTML=e,sr(de.fromDom(o)))),xr(t),Gi(t,i)}function Cr(t,n,e){if(!(y(e)||w(e)||u(e)))throw console.error("Invalid call to Attribute.set. Key ",n,":: Value ",e,":: Element ",t),new Error("Attribute value was not simple");t.setAttribute(n,e+"")}function Or(t,n,e){Cr(t.dom,n,e)}function _r(t,n){var e=t.dom.getAttribute(n);return null===e?void 0:e}function Tr(t,n){return ft.from(_r(t,n))}function Er(t,n){var e=t.dom;return!(!e||!e.hasAttribute)&&e.hasAttribute(n)}function Dr(t,n){t.dom.removeAttribute(n)}function Br(t){if(mr(t))return"#shadow-root";var n=de.fromDom(t.dom.cloneNode(!1)),e=de.fromTag("div"),o=de.fromDom(n.dom.cloneNode(!0));return Gi(e,o),Sr(e)}function Ar(t){var n=(new Date).getTime();return t+"_"+Math.floor(1e9*Math.random())+ ++Ki+String(n)}function Mr(t){var n=Ri(t)?t.dom[Zi]:null;return ft.from(n)}function Fr(n){function e(t){return"The component must be in a context to execute: "+t+(n?"\n"+Br(n().element)+" is not in context.":"")}function t(t){return function(){throw new Error(e(t))}}function o(t){return function(){console.warn(e(t))}}return{debugInfo:tt("fake"),triggerEvent:o("triggerEvent"),triggerFocus:o("triggerFocus"),triggerEscape:o("triggerEscape"),broadcast:o("broadcast"),broadcastOn:o("broadcastOn"),broadcastEvent:o("broadcastEvent"),build:t("build"),addToWorld:t("addToWorld"),removeFromWorld:t("removeFromWorld"),addToGui:t("addToGui"),removeFromGui:t("removeFromGui"),getByUid:t("getByUid"),getByDom:t("getByDom"),isConnected:O}}function Ir(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:ru(i)}},t}function Rr(t){return Ae(iu,t)}function Vr(o){return t=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return o.apply(void 0,H([t.getApis(),t],n))},e=(n=o.toString()).indexOf(")")+1,r=n.indexOf("("),i=n.substring(r+1,e-1).split(/,\s*/),t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:ru(i.slice(1))}},t;var t,n,e,r,i}function Pr(t,r){var i={};return bt(t,function(t,o){bt(t,function(t,n){var e=kt(i,n).getOr([]);i[n]=e.concat([r(o,t)])})}),i}function Hr(t){return{classes:E(t.classes)?[]:t.classes,attributes:E(t.attributes)?{}:t.attributes,styles:E(t.styles)?{}:t.styles}}function zr(t){return t.cHandler}function Nr(t,n){return{name:t,handler:n}}function Lr(t,n,e){var o=n[e];return o?function(u,t,a){try{var n=G(t,function(t,n){var e=t.name,o=n.name,r=a.indexOf(e),i=a.indexOf(o);if(-1===r)throw new Error("The ordering for "+u+" does not have an entry for "+e+".\nOrder specified: "+JSON.stringify(a,null,2));if(-1===i)throw new Error("The ordering for "+u+" does not have an entry for "+o+".\nOrder specified: "+JSON.stringify(a,null,2));return r<i?-1:i<r?1:0});return mt.value(n)}catch(t){return mt.error([t])}}("Event: "+e,t,o).map(function(t){var e,n,o,r,i=A(t,function(t){return t.handler});return{can:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return R(n,function(t,n){return t&&n.can.apply(void 0,e)},!0)},abort:(o=n=e=i,r=function(t){return t.abort},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return R(o,function(t,n){return t||r(n).apply(void 0,e)},!1)}),run:function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];dt(e,function(t){t.run.apply(void 0,n)})}}}):mt.error(["The event ("+e+') 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(A(t,function(t){return t.name}),null,2)])}function jr(t,n){var e=_r(t,n);return void 0===e||""===e?[]:e.split(" ")}function Wr(t){return void 0!==t.dom.classList}function Ur(t,n){var e,o,r;Wr(t)?t.dom.classList.add(n):(o=n,r=jr(e=t,"class").concat([o]),Or(e,"class",r.join(" ")))}function Gr(t,n){var e,o,r,i;Wr(t)?t.dom.classList.remove(n):(r=n,0<(i=F(jr(o=t,"class"),function(t){return t!==r})).length?Or(o,"class",i.join(" ")):Dr(o,"class")),0===(Wr(e=t)?e.dom.classList:jr(e,"class")).length&&Dr(e,"class")}function Xr(t,n){return Wr(t)&&t.dom.classList.contains(n)}function Yr(n,t){dt(t,function(t){Ur(n,t)})}function qr(n,t){dt(t,function(t){Gr(n,t)})}function Kr(t,n,e){return void 0===e&&(e=v),t.exists(function(t){return e(t,n)})}function Jr(t){for(var n=[],e=function(t){n.push(t)},o=0;o<t.length;o++)t[o].each(e);return n}function $r(t,n){return t?ft.some(n):ft.none()}function Qr(t){return void 0!==t.style&&m(t.style.getPropertyValue)}function Zr(t,n,e){if(!y(e))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);Qr(t)&&t.style.setProperty(n,e)}function ti(t,n){Qr(t)&&t.style.removeProperty(n)}function ni(t,n,e){Zr(t.dom,n,e)}function ei(t,n){var e=t.dom;bt(n,function(t,n){Zr(e,n,t)})}function oi(t,n){var e=t.dom;bt(n,function(t,n){t.fold(function(){ti(e,n)},function(t){Zr(e,n,t)})})}function ri(t,n){var e=t.dom,o=window.getComputedStyle(e).getPropertyValue(n);return""!==o||du(t)?o:pu(e,n)}function ii(t,n){var e=t.dom,o=pu(e,n);return ft.from(o).filter(function(t){return 0<t.length})}function ui(t,n,e){var o=de.fromTag(t);return ni(o,n,e),ii(o,n).isSome()}function ai(t,n){ti(t.dom,n),Kr(Tr(t,"style").map(ve),"")&&Dr(t,"style")}function ci(t){return t.dom.offsetWidth}function si(t){return t.dom.value}function li(t,n){if(void 0===n)throw new Error("Value.set was undefined");t.dom.value=n}function fi(t){var n,e,o,r,i=(n=kt(t,"behaviours").getOr({}),A(F(Xn(n),function(t){return void 0!==n[t]}),function(t){return n[t].me}));return e=t,r=A(o=i,function(t){return fn(t.name(),[Jt("config"),dn("state",uu)])}),{list:o,data:yt(Gt("component.behaviours",te(r),e.behaviours).fold(function(t){throw new Error(se(t)+"\nComplete spec:\n"+JSON.stringify(e,null,2))},h),function(t){return tt(t.map(function(t){return{config:t.config,state:t.state.init(t.config)}}))})}}function di(t,n,e){var o,r,i=st(st({},(o=t).dom),{uid:o.uid,domChildren:A(o.components,function(t){return t.element})}),u=t.domModification.fold(function(){return Hr({})},Hr),a=0<n.length?function(n,t,e,o){var r=st({},t);function i(t){return I(t,function(t,n){return st(st({},n.modification),t)},{})}dt(e,function(t){r[t.name()]=t.exhibit(n,o)});var u=Pr(r,function(t,n){return{name:t,modification:n}});return Hr({classes:I(u.classes,function(t,n){return n.modification.concat(t)},[]),attributes:i(u.attributes),styles:i(u.styles)})}(e,{"alloy.base.modification":u},n,i):u;return st(st({},r=i),{attributes:st(st({},r.attributes),a.attributes),styles:st(st({},r.styles),a.styles),classes:r.classes.concat(a.classes)})}function mi(t,n,e){var o,r,i,u,a,c={"alloy.base.behaviour":t.events},s=t.eventOrder;return r=e,i=n,o=Pr(st(st({},c),(u=r,a={},dt(i,function(t){a[t.name()]=t.handlers(u)}),a)),Nr),cu(o,s).getOrDie()}function gi(e){function t(){return l}var n=wn(ou),o=Xt(Gt("custom.definition",lu,e)),r=fi(e),i=r.list,u=r.data,a=function(t){var n=de.fromTag(t.tag),e=t.attributes,o=n.dom;bt(e,function(t,n){Cr(o,n,t)}),Yr(n,t.classes),ei(n,t.styles),t.innerHtml.each(function(t){return kr(n,t)});var r=t.domChildren;return yr(n,r),t.value.each(function(t){li(n,t)}),t.uid,tu(n,t.uid),n}(di(o,i,u)),c=mi(o,i,u),s=wn(o.components),l={uid:e.uid,getSystem:n.get,config:function(t){var n=u;return(m(n[t.name()])?n[t.name()]:function(){throw new Error("Could not find "+t.name()+" in "+JSON.stringify(e,null,2))})()},hasConfigured:function(t){return m(u[t.name()])},spec:e,readState:function(t){return u[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return o.apis},connect:function(t){n.set(t)},disconnect:function(){n.set(Fr(t))},element:a,syncComponents:function(){var t=z(sr(a),function(t){return n.get().getByDom(t).fold(function(){return[]},U)});s.set(t)},components:s.get,events:c};return l}function pi(t){var n=de.fromText(t);return hu({element:n})}function hi(o,r){function t(t){var n=r(t);if(n<=0||null===n){var e=ri(t,o);return parseFloat(e)||0}return n}function i(r,t){return R(t,function(t,n){var e=ri(r,n),o=void 0===e?0:parseInt(e,10);return isNaN(o)?t:t+o},0)}return{set:function(t,n){if(!u(n)&&!n.match(/^[0-9]+$/))throw new Error(o+".set accepts only positive integer values. Value was "+n);var e=t.dom;Qr(e)&&(e.style[o]=n+"px")},get:t,getOuter:t,aggregate:i,max:function(t,n,e){var o=i(t,e);return o<n?n-o:0}}}function vi(t){return xu.get(t)}function bi(t){return xu.getOuter(t)}function yi(t,n){return void 0!==t?t:void 0!==n?n:0}function xi(t){var n=t.dom.ownerDocument,e=n.body,o=n.defaultView,r=n.documentElement;if(e===t.dom)return Su(e.offsetLeft,e.offsetTop);var i=yi(null==o?void 0:o.pageYOffset,r.scrollTop),u=yi(null==o?void 0:o.pageXOffset,r.scrollLeft),a=yi(r.clientTop,e.clientTop),c=yi(r.clientLeft,e.clientLeft);return ku(t).translate(u-c,i-a)}function wi(t){return Cu.get(t)}function Si(t){return Cu.getOuter(t)}function ki(t){function n(){return t.stopPropagation()}function e(){return t.preventDefault()}var o=r(e,n);return{target:de.fromDom(function(t){if(Li()&&f(t.target)){var n=de.fromDom(t.target);if(Ri(n)&&Ui(n)&&t.composed&&t.composedPath){var e=t.composedPath();if(e)return ot(e)}}return ft.from(t.target)}(t).getOr(t.target)),x:t.clientX,y:t.clientY,stop:n,prevent:e,kill:o,raw:t}}function Ci(t,n,e,o,r){var i,u,a=(i=e,u=o,function(t){i(t)&&u(ki(t))});return t.dom.addEventListener(n,a,r),{unbind:S(Ou,t,n,a,r)}}function Oi(t){var n=void 0!==t?t.dom:document,e=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return Su(e,o)}function _i(t,n,e){var o=(void 0!==e?e.dom:document).defaultView;o&&o.scrollTo(t,n)}function Ti(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}}function Ei(t){var o=void 0===t?window:t,n=o.document,r=Oi(de.fromDom(n)),e=void 0===o?window:o;return ft.from(e.visualViewport).fold(function(){var t=o.document.documentElement,n=t.clientWidth,e=t.clientHeight;return Ti(r.left,r.top,n,e)},function(t){return Ti(Math.max(t.pageLeft,r.left),Math.max(t.pageTop,r.top),t.width,t.height)})}function Di(o){var t,r=Oi(de.fromDom(document)),n=(t=Tu).owner(o),e=_u(t,n);return ft.some(e).fold(S(xi,o),function(t){var n=ku(o),e=I(t,function(t,n){var e=ku(n);return{left:t.left+e.left,top:t.top+e.top}},{left:0,top:0});return Su(e.left+n.left+r.left,e.top+n.top+r.top)})}function Bi(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}}function Ai(t){var n=xi(t),e=Si(t),o=bi(t);return Bi(n.left,n.top,e,o)}function Mi(t){var n=Di(t),e=Si(t),o=bi(t);return Bi(n.left,n.top,e,o)}function Fi(){return Ei(window)}"undefined"!=typeof window||Function("return this;")();var Ii,Ri=er(1),Vi=er(3),Pi=er(9),Hi=er(11),zi=ar,Ni=m(Element.prototype.attachShadow)&&m(Node.prototype.getRootNode),Li=tt(Ni),ji=Ni?function(t){return de.fromDom(t.dom.getRootNode())}:rr,Wi=function(t){var n=ji(t);return mr(n)?ft.some(n):ft.none()},Ui=function(t){return f(t.dom.shadowRoot)},Gi=function(t,n){t.dom.appendChild(n.dom)},Xi=function(t){var n=t.dom;null!==n.parentNode&&n.parentNode.removeChild(n)},Yi=Jo([{key:Co(),value:Pe({can:function(t,n){var e,o=n.event,r=o.originator,i=o.target;return!(Bn(e=r,t.element)&&!Bn(e,i)&&(console.warn(Co()+" did not get interpreted by the desired target. \nOriginator: "+Br(r)+"\nTarget: "+Br(i)+"\nCheck the "+Co()+" event handlers"),1))}})}]),qi=Object.freeze({__proto__:null,events:Yi}),Ki=0,Ji=tt("alloy-id-"),$i=tt("data-alloy-id"),Qi=Ji(),Zi=$i(),tu=function(t,n){Object.defineProperty(t.dom,Zi,{value:n,writable:!0})},nu=Ar,eu=h,ou=Fr(),ru=function(t){return A(t,function(t){return he(t,"/*")?t.substring(0,t.length-"/*".length):t})},iu=Ar("alloy-premade"),uu={init:function(){return au({readState:tt("No State required")})}},au=function(t){return t},cu=function(t,a){var n,e,o,r,i,u,c=xt(t,function(r,u){return(1===r.length?mt.value(r[0].handler):Lr(r,a,u)).map(function(t){var n,i,e=(i=m(n=t)?{can:_,abort:O,run:n}:n,function(t,n){for(var e=[],o=2;o<arguments.length;o++)e[o-2]=arguments[o];var r=[t,n].concat(e);i.abort.apply(void 0,r)?n.stop():i.can.apply(void 0,r)&&i.run.apply(void 0,r)}),o=1<r.length?F(a[u],function(n){return T(r,function(t){return t.name===n})}).join(" > "):r[0].name;return Ae(u,{handler:e,purpose:o})})});return n={},e=[],o=[],dt(c,function(t){t.fold(function(t){e.push(t)},function(t){o.push(t)})}),0<(u={errors:e,values:o}).errors.length?mt.error(lt(u.errors)):(i=n,0===(r=u.values).length?mt.value(i):mt.value(Jn(i,$n.apply(void 0,r))))},su="alloy.base.behaviour",lu=te([le("dom","dom",Tt(),te([Jt("tag"),dn("styles",{}),dn("classes",[]),dn("attributes",{}),rn("value"),rn("innerHtml")])),Jt("components"),Jt("uid"),dn("events",{}),dn("apis",{}),le("eventOrder","eventOrder",((Ii={})[Eo()]=["disabling",su,"toggling","typeaheadevents"],Ii[Co()]=[su,"focusing","keying"],Ii[Io()]=[su,"disabling","toggling","representing"],Ii[ho()]=[su,"representing","streaming","invalidating"],Ii[No()]=[su,"representing","item-events","tooltipping"],Ii[uo()]=["focusing",su,"item-type-events"],Ii[eo()]=["focusing",su,"item-type-events"],Ii[lo()]=["item-type-events","tooltipping"],Ii[To()]=["receiving","reflecting","tooltipping"],At(tt(Ii))),ee()),rn("domModification")]),fu=function(t,n,e){return t.isSome()&&n.isSome()?ft.some(e(t.getOrDie(),n.getOrDie())):ft.none()},du=function(t){var n=Vi(t)?t.dom.parentNode:t.dom;if(null==n||null===n.ownerDocument)return!1;var e,o,r=n.ownerDocument;return Wi(de.fromDom(n)).fold(function(){return r.body.contains(n)},(e=du,o=pr,function(t){return e(o(t))}))},mu=function(){return gu(de.fromDom(document))},gu=function(t){var n=t.dom.body;if(null==n)throw new Error("Body is not available yet");return de.fromDom(n)},pu=function(t,n){return Qr(t)?t.style.getPropertyValue(n):""},hu=function(t){var n=Yt("external.component",Ht([Jt("element"),rn("uid")]),t),e=wn(Fr()),o=n.uid.getOrThunk(function(){return nu("external")});tu(n.element,o);var r={uid:o,getSystem:e.get,config:ft.none,hasConfigured:O,connect:function(t){e.set(t)},disconnect:function(){e.set(Fr(function(){return r}))},getApis:function(){return{}},element:n.element,spec:t,readState:tt("No state"),syncComponents:ct,components:tt([]),events:{}};return Rr(r)},vu=nu,bu=function(u){return kt(u,iu).getOrThunk(function(){var t,n,e,o,r,i=Kn(u,"uid")?u:st({uid:vu("")},u);return t=eu(i),n=t.events,e=s(t,["events"]),o=A(kt(e,"components").getOr([]),bu),r=st(st({},e),{events:st(st({},qi),n),components:o}),mt.value(gi(r)).getOrDie()})},yu=Rr,xu=hi("height",function(t){var n=t.dom;return du(t)?n.getBoundingClientRect().height:n.offsetHeight}),wu=function(e,o){return{left:e,top:o,translate:function(t,n){return wu(e+t,o+n)}}},Su=wu,ku=function(t){var n,e=t.dom,o=e.ownerDocument.body;return o===e?Su(o.offsetLeft,o.offsetTop):du(t)?(n=e.getBoundingClientRect(),Su(n.left,n.top)):Su(0,0)},Cu=hi("width",function(t){return t.dom.offsetWidth}),Ou=function(t,n,e,o){t.dom.removeEventListener(n,e,o)},_u=function(o,t){return o.view(t).fold(tt([]),function(t){var n=o.owner(t),e=_u(o,n);return[t].concat(e)})},Tu=Object.freeze({__proto__:null,view:function(t){var n;return(t.dom===document?ft.none():ft.from(null===(n=t.dom.defaultView)||void 0===n?void 0:n.frameElement)).map(de.fromDom)},owner:or});function Eu(t,n,e,o,r){return t(e,o)?ft.some(e):m(r)&&r(e)?ft.none():n(e,o,r)}function Du(t,n,e){for(var o=t.dom,r=m(e)?e:O;o.parentNode;){var o=o.parentNode,i=de.fromDom(o);if(n(i))return ft.some(i);if(r(i))break}return ft.none()}function Bu(t,n,e){return Eu(function(t,n){return n(t)},Du,t,n,e)}function Au(t,n,e){return Bu(t,n,e).isSome()}function Mu(t,n,e){return Du(t,function(t){return En(t,n)},e)}function Fu(t,n){return e=n,Dn(o=void 0===t?document:t.dom)?ft.none():ft.from(o.querySelector(e)).map(de.fromDom);var e,o}function Iu(t,n,e){return Eu(En,Mu,t,n,e)}function Ru(){var n=Ar("aria-owns");return{id:n,link:function(t){Or(t,"aria-owns",n)},unlink:function(t){Dr(t,"aria-owns")}}}var Vu,Pu,Hu=function(n,t){return Au(t,function(t){return Bn(t,n.element)},O)||(e=n,Bu(t,function(t){if(!Ri(t))return!1;var n=_r(t,"id");return void 0!==n&&-1<n.indexOf("aria-owns")}).bind(function(t){var n=_r(t,"id");return Fu(ji(t),'[aria-owns="'+n+'"]')}).exists(function(t){return Hu(e,t)}));var e},zu="unknown";function Nu(n,t,e){var o,r,i,u;switch(kt(Lu.get(),n).orThunk(function(){return q(Xn(Lu.get()),function(t){return-1<n.indexOf(t)?ft.some(Lu.get()[t]):ft.none()})}).getOr(Vu.NORMAL)){case Vu.NORMAL:return e(Wu());case Vu.LOGGING:var a=(o=n,r=t,i=[],u=(new Date).getTime(),{logEventCut:function(t,n,e){i.push({outcome:"cut",target:n,purpose:e})},logEventStopped:function(t,n,e){i.push({outcome:"stopped",target:n,purpose:e})},logNoParent:function(t,n,e){i.push({outcome:"no-parent",target:n,purpose:e})},logEventNoHandlers:function(t,n){i.push({outcome:"no-handlers-left",target:n})},logEventResponse:function(t,n,e){i.push({outcome:"response",purpose:e,target:n})},write:function(){var t=(new Date).getTime();et(["mousemove","mouseover","mouseout",Io()],o)||console.log(o,{event:o,time:t-u,target:r.dom,sequence:A(i,function(t){return et(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Br(t.target)+")":t.outcome})})}}),c=e(a);return a.write(),c;case Vu.STOP:return!0}}(Pu=Vu=Vu||{})[Pu.STOP=0]="STOP",Pu[Pu.NORMAL=1]="NORMAL",Pu[Pu.LOGGING=2]="LOGGING";var Lu=wn({}),ju=["alloy/data/Fields","alloy/debugging/Debugging"],Wu=tt({logEventCut:ct,logEventStopped:ct,logNoParent:ct,logEventNoHandlers:ct,logEventResponse:ct,write:ct}),Uu=tt([Jt("menu"),Jt("selectedMenu")]),Gu=tt([Jt("item"),Jt("selectedItem")]);function Xu(){return nn("markers",[Jt("backgroundMenu")].concat(Uu()).concat(Gu()))}function Yu(t){return nn("markers",A(t,Jt))}function qu(t,n,e){return void 0!==(o=new Error).stack&&V(o.stack.split("\n"),function(n){return 0<n.indexOf("alloy")&&!T(ju,function(t){return-1<n.indexOf(t)})}).getOr(zu),le(n,n,e,Wt(function(e){return mt.value(function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(void 0,t)})}));var o}function Ku(t){return qu(0,t,Dt(ct))}function Ju(t){return qu(0,t,Dt(ft.none))}function $u(t){return qu(0,t,Tt())}function Qu(t){return qu(0,t,Tt())}function Zu(t,n){return fe(t,tt(n))}function ta(t){return fe(t,h)}function na(t,n,e,o,r,i,u,a){return{x:t,y:n,bubble:e,direction:o,placement:r,restriction:i,label:u+"-"+r,alwaysFit:a=void 0!==a&&a}}function ea(t,n,e,o){var r=t+n;return o<r?e:r<e?o:r}function oa(t,n,e){return Math.min(Math.max(t,n),e)}function ra(e,n){return W(["left","right","top","bottom"],function(t){return kt(n,t).map(function(n){return function(t){switch(n){case 1:return t.x;case 0:return t.x+t.width;case 2:return t.y;case 3:return t.y+t.height}}(e)})})}function ia(t,n){return t.x+t.width/2-n.width/2}function ua(t,n){return t.x+t.width-n.width}function aa(t,n){return t.y-n.height}function ca(t){return t.y+t.height}function sa(t,n){return t.y+t.height/2-n.height/2}function la(t,n,e){return na(t.x+t.width,sa(t,n),e.east(),La(),"east",ra(t,{left:0}),Wa)}function fa(t,n,e){return na(t.x-n.width,sa(t,n),e.west(),ja(),"west",ra(t,{right:1}),Wa)}function da(){return[Ua,Ga,Xa,Ya,Ka,qa,la,fa]}function ma(){return[Ga,Ua,Ya,Xa,Ka,qa,la,fa]}function ga(){return[Xa,Ya,Ua,Ga,qa,Ka]}function pa(){return[Ya,Xa,Ga,Ua,qa,Ka]}function ha(){return[Ua,Ga,Xa,Ya,Ka,qa]}function va(){return[Ga,Ua,Ya,Xa,Ka,qa]}function ba(e,o,r){return Zo(function(t,n){r(t,e,o)})}function ya(t){return{key:t,value:void 0}}function xa(t){var n,e,o,r,i,u,a,c,s=Yt("Creating behaviour: "+t.name,tc,t);return n=s.fields,e=s.name,o=s.active,r=s.apis,i=s.extra,u=s.state,a=Ht(n),c=fn(e,[un("config",Ht(n))]),Qa(a,c,e,o,r,i,u)}function wa(t){var n,e=Yt("Creating behaviour: "+t.name,nc,t),o=qt(e.branchKey,e.branches),r=e.name,i=e.active,u=e.apis,a=e.extra,c=e.state,s=fn(r,[un("config",n=o)]);return Qa(n,s,r,i,u,a,c)}function Sa(t){return t.dom.focus()}function ka(t){var n=ji(t).dom;return t.dom===n.activeElement}function Ca(t){return void 0===t&&(t=de.fromDom(document)),ft.from(t.dom.activeElement).map(de.fromDom)}function Oa(n){return Ca(ji(n)).filter(function(t){return n.dom.contains(t.dom)})}function _a(t,e){var o=ji(e),n=Ca(o).bind(function(n){function t(t){return Bn(n,t)}var r,i;return t(e)?ft.some(e):(r=t,(i=function(t){for(var n=0;n<t.childNodes.length;n++){var e=de.fromDom(t.childNodes[n]);if(r(e))return ft.some(e);var o=i(t.childNodes[n]);if(o.isSome())return o}return ft.none()})(e.dom))}),r=t(e);return n.each(function(n){Ca(o).filter(function(t){return Bn(t,n)}).fold(function(){Sa(n)},ct)}),r}function Ta(t,n,e,o,r){function i(t){return t+"px"}return{position:t,left:n.map(i),top:e.map(i),right:o.map(i),bottom:r.map(i)}}function Ea(t,n){var e;oi(t,st(st({},e=n),{position:ft.some(e.position)}))}function Da(t,n,e,o,r,i){var u=n.rect,a=u.x-e,c=u.y-o,s=r-(a+u.width),l=i-(c+u.height),f=ft.some(a),d=ft.some(c),m=ft.some(s),g=ft.some(l),p=ft.none();return n.direction.fold(function(){return Ta(t,f,d,p,p)},function(){return Ta(t,p,d,m,p)},function(){return Ta(t,f,p,p,g)},function(){return Ta(t,p,p,m,g)},function(){return Ta(t,f,d,p,p)},function(){return Ta(t,f,p,p,g)},function(){return Ta(t,f,d,p,p)},function(){return Ta(t,p,d,m,p)})}function Ba(t,r){return t.fold(function(){var t=r.rect;return Ta("absolute",ft.some(t.x),ft.some(t.y),ft.none(),ft.none())},function(t,n,e,o){return Da("absolute",r,t,n,e,o)},function(t,n,e,o){return Da("fixed",r,t,n,e,o)})}function Aa(t,n){var e=S(Di,n),o=t.fold(e,e,function(){var t=Oi();return Di(n).translate(-t.left,-t.top)}),r=Si(n),i=bi(n);return Bi(o.left,o.top,r,i)}tt(te(Gu().concat(Uu())));var Ma=tt(te(Gu())),Fa=tt(nn("initSize",[Jt("numColumns"),Jt("numRows")])),Ia=Vn([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),Ra=Ia.southeast,Va=Ia.southwest,Pa=Ia.northeast,Ha=Ia.northwest,za=Ia.south,Na=Ia.north,La=Ia.east,ja=Ia.west,Wa="layout",Ua=function(t,n,e){return na(t.x,ca(t),e.southeast(),Ra(),"southeast",ra(t,{left:1,top:3}),Wa)},Ga=function(t,n,e){return na(ua(t,n),ca(t),e.southwest(),Va(),"southwest",ra(t,{right:0,top:3}),Wa)},Xa=function(t,n,e){return na(t.x,aa(t,n),e.northeast(),Pa(),"northeast",ra(t,{left:1,bottom:2}),Wa)},Ya=function(t,n,e){return na(ua(t,n),aa(t,n),e.northwest(),Ha(),"northwest",ra(t,{right:0,bottom:2}),Wa)},qa=function(t,n,e){return na(ia(t,n),aa(t,n),e.north(),Na(),"north",ra(t,{bottom:2}),Wa)},Ka=function(t,n,e){return na(ia(t,n),ca(t),e.south(),za(),"south",ra(t,{top:3}),Wa)},Ja=Object.freeze({__proto__:null,events:function(a){return Jo([Xe(To(),function(r,t){var n,i=a.channels,e=Xn(i),u=t,o=(n=u).universal?e:F(e,function(t){return et(n.channels,t)});dt(o,function(t){var n=i[t],e=n.schema,o=Yt("channel["+t+"] data\nReceiver: "+Br(r.element),e,u.data);n.onReceive(r,o)})})])}}),$a=[$t("channels",Ut(mt.value,Ht([$u("onReceive"),dn("schema",ee())])))],Qa=function(e,t,f,n,o,r,i){function u(t){return Ct(t,f)?t[f]():ft.none()}var a=yt(o,function(t,n){return r=f,e=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var o=[e].concat(t);return e.config({name:tt(r)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+r+". Using API: "+u)},function(t){var n=Array.prototype.slice.call(o,1);return i.apply(void 0,[e,t.config,t.state].concat(n))})},o=u=n,a=(i=t).toString(),c=a.indexOf(")")+1,s=a.indexOf("("),l=a.substring(s+1,c-1).split(/,\s*/),e.toFunctionAnnotation=function(){return{name:o,parameters:ru(l.slice(0,1).concat(l.slice(3)))}},e;var r,i,u,e,o,a,c,s,l}),c=yt(r,Ir),s=st(st(st({},c),a),{revoke:S(ya,f),config:function(t){var n=Yt(f+"-config",e,t);return{key:f,value:{config:n,me:s,configAsRaw:_t(function(){return Yt(f+"-config",e,t)}),initialConfig:t,state:i}}},schema:tt(t),exhibit:function(t,e){return fu(u(t),kt(n,"exhibit"),function(t,n){return n(e,t.config,t.state)}).getOrThunk(function(){return Hr({})})},name:tt(f),handlers:function(t){return u(t).map(function(t){return kt(n,"events").getOr(function(){return{}})(t.config,t.state)}).getOr({})}});return s},Za=Me,tc=Ht([Jt("fields"),Jt("name"),dn("active",{}),dn("apis",{}),dn("state",uu),dn("extra",{})]),nc=Ht([Jt("branchKey"),Jt("branches"),Jt("name"),dn("active",{}),dn("apis",{}),dn("state",uu),dn("extra",{})]),ec=tt(void 0),oc=xa({fields:$a,name:"receiving",active:Ja}),rc=Object.freeze({__proto__:null,exhibit:function(t,n){return Hr({classes:[],styles:n.useFixed()?{}:{position:"relative"}})}}),ic=Vn([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),uc=function(t,n,e){var o=Su(n,e);return t.fold(tt(o),tt(o),function(){var t=Oi();return o.translate(-t.left,-t.top)})};function ac(t){return Tr(t,_c)}function cc(t,n,e,o){var r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_,T,E,D,B,A,M,F,I,R,V,P,H,z=t.bubble,N=z.offset,L=(I=o,R=t.restriction,V=N,P=Z("left",I.x),H=Z("top",I.y),Bi(P,H,Z("right",I.right)-P,Z("bottom",I.bottom)-H)),j=t.x+N.left,W=t.y+N.top,U=Bi(j,W,n,e),G=(r=L.x,i=L.y,u=L.right,a=L.bottom,c=U.x,s=U.y,l=U.right,f=U.bottom,d=U.width,m=U.height,{originInBounds:r<=c&&c<=u&&i<=s&&s<=a,sizeInBounds:l<=u&&r<=l&&f<=a&&i<=f,visibleW:Math.min(d,r<=c?u-c:l-r),visibleH:Math.min(m,i<=s?a-s:f-i)}),X=G.visibleW,Y=G.visibleH,q=G.originInBounds&&G.sizeInBounds,K=q?U:(g=L.x,p=L.y,h=L.right,v=L.bottom,b=U.x,y=U.y,x=U.width,w=U.height,S=Math.max(g,h-x),k=Math.max(p,v-w),Bi(C=oa(b,g,S),O=oa(y,p,k),Math.min(C+x,h)-C,Math.min(O+w,v)-O)),J=0<K.width&&0<K.height,$=(_=t.direction,D=tt((T=K).bottom-(E=o).y),B=tt(E.bottom-T.y),A=_.fold(B,B,D,D,B,D,B,B),M=tt(T.right-E.x),F=tt(E.right-T.x),{maxWidth:_.fold(F,M,F,M,F,F,F,M),maxHeight:A}),Q={rect:K,maxHeight:$.maxHeight,maxWidth:$.maxWidth,direction:t.direction,placement:t.placement,classes:{on:z.classesOn,off:z.classesOff},layout:t.label,testY:W};function Z(r,i){return R[r].map(function(t){var n="top"===r||"bottom"===r,e=n?V.top:V.left,o=("left"===r||"top"===r?Math.max:Math.min)(t,i)+e;return n?oa(o,I.y,I.bottom):oa(o,I.x,I.right)}).getOr(i)}return q||t.alwaysFit?Tc.fit(Q):Tc.nofit(Q,X,Y,J)}function sc(t){function n(){return e.get().each(t)}var e=wn(ft.none());return{clear:function(){n(),e.set(ft.none())},isSet:function(){return e.get().isSome()},get:function(){return e.get()},set:function(t){n(),e.set(ft.some(t))}}}function lc(){return sc(function(t){return t.unbind()})}function fc(){var n=sc(ct);return st(st({},n),{on:function(t){return n.get().each(t)}})}function dc(t,n,e){return Ci(t,n,Ec,e,!1)}function mc(t,n,e){return Ci(t,n,Ec,e,!0)}function gc(o,e){function r(t){var n,e=null!==(n=t.raw.pseudoElement)&&void 0!==n?n:"";return Bn(t.target,o)&&!On(e)&&et(Bc,t.raw.propertyName)}function t(t){var n;(g(t)||r(t))&&(a.clear(),c.clear(),!g(n=null==t?void 0:t.raw.type)&&n!==xo()||(clearTimeout(i),Dr(o,Ac),qr(o,e.classes)))}function n(){a.set(dc(o,xo(),t)),c.set(dc(o,yo(),t))}var i,u,a=lc(),c=lc();"ontransitionstart"in o.dom?u=dc(o,wo(),function(t){r(t)&&(u.unbind(),n())}):n();var s,l,f=(s=o,l=d("transition-delay"),R(d("transition-duration"),function(t,n,e){var o=m(l[e])+m(n);return Math.max(t,o)},0));function d(t){var n=ri(s,t);return F(y(n)?n.split(/\s*,\s*/):[],On)}function m(t){if(y(t)&&/^[\d.]+/.test(t)){var n=parseFloat(t);return he(t,"ms")?n:1e3*n}return 0}requestAnimationFrame(function(){i=setTimeout(t,f+17),Or(o,Ac,i)})}function pc(t,n,e,o,r,i){var u,a,c,s,l,f,d,m,g,p=(u=o,a=r,i.exists(function(t){var n=u.mode;return"all"===n||t[n]!==a[n]}));function h(t){return parseFloat(t).toPrecision(3)}p||(g=t,N(o.classes,function(t){return Xr(g,t)}))?(ni(t,"position",e.position),c=Aa(n,t),s=Ba(n,st(st({},r),{rect:c})),l=W(Bc,function(t){return s[t]}),m=e,wt(l,function(t,n){var e,o,r,i=m[n].map(h),u=t.map(h);return!fu(e=i,o=u,r=void 0===r?v:r).getOr(e.isNone()&&o.isNone())}).isSome()&&(oi(t,l),p&&(Yr(f=t,(d=o).classes),Tr(f,Ac).each(function(t){clearTimeout(parseInt(t,10)),Dr(f,Ac)}),gc(f,d)),ci(t))):qr(t,o.classes)}function hc(t,n,e,o){ai(n,"max-height"),ai(n,"max-width");var r,s,i,l,f,d,m,g,p,u={width:Si(r=n),height:bi(r)};return s=n,i=o.preference,l=t,f=u,d=e,m=o.bounds,g=f.width,p=f.height,R(i,function(t,n){var e=S(a,n);return t.fold(tt(t),e)},Tc.nofit({rect:l,maxHeight:f.height,maxWidth:f.width,direction:Ra(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:l.y},-1,-1,!1)).fold(h,h);function a(t,r,i,u,a){var c=cc(t(l,f,d,s,m),g,p,m);return c.fold(tt(c),function(t,n,e,o){return(a===o?u<e||i<n:!a&&o)?c:Tc.nofit(r,i,u,a)})}}function vc(t,n){var e=t,o=Math.floor(n);ni(e,"max-height",xu.max(e,o,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"])+"px")}function bc(t,n,e){return void 0===t[n]?e:t[n]}function yc(t,n,e,o){function r(t){return kt(e,t).getOr([])}function i(t,n,e){var o=j(Rc,e);return{offset:Su(t,n),classesOn:z(e,r),classesOff:z(o,r)}}var u=t*(o=void 0===o?1:o),a=n*o;return{southeast:function(){return i(-t,n,["top","alignLeft"])},southwest:function(){return i(t,n,["top","alignRight"])},south:function(){return i(-t/2,n,["top","alignCentre"])},northeast:function(){return i(-t,-n,["bottom","alignLeft"])},northwest:function(){return i(t,-n,["bottom","alignRight"])},north:function(){return i(-t/2,-n,["bottom","alignCentre"])},east:function(){return i(t,-n/2,["valignCentre","left"])},west:function(){return i(-t,-n/2,["valignCentre","right"])},insetNortheast:function(){return i(u,a,["top","alignLeft","inset"])},insetNorthwest:function(){return i(-u,a,["top","alignRight","inset"])},insetNorth:function(){return i(-u/2,a,["top","alignCentre","inset"])},insetSoutheast:function(){return i(u,-a,["bottom","alignLeft","inset"])},insetSouthwest:function(){return i(-u,-a,["bottom","alignRight","inset"])},insetSouth:function(){return i(-u/2,-a,["bottom","alignCentre","inset"])},insetEast:function(){return i(-u,-a/2,["valignCentre","right","inset"])},insetWest:function(){return i(u,-a/2,["valignCentre","left","inset"])}}}function xc(){return yc(0,0,{})}function wc(n,e){return function(t){return"rtl"===Pc(t)?e:n}}ic.none;var Sc,kc,Cc=ic.relative,Oc=ic.fixed,_c="data-alloy-placement",Tc=Vn([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),Ec=_,Dc=ki,Bc=["top","bottom","right","left"],Ac="data-alloy-transition-timer",Mc=tt(function(t,n){vc(t,n),ei(t,{"overflow-x":"hidden","overflow-y":"auto"})}),Fc=tt(function(t,n){vc(t,n)}),Ic=function(t,n,e,o){var r,i,u,a,c=hc(t,n,e,o),s=n,l=c,f=Ba((r=o).origin,l);return r.transition.each(function(t){pc(s,r.origin,f,t,l,r.lastPlacement)}),Ea(s,f),a=c.placement,Or(n,_c,a),qr(i=n,(u=c.classes).off),Yr(i,u.on),(0,o.maxHeightFunction)(n,c.maxHeight),(0,o.maxWidthFunction)(n,c.maxWidth),{layout:c.layout,placement:c.placement}},Rc=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],Vc=h,Pc=function(t){return"rtl"===ri(t,"direction")?"rtl":"ltr"};function Hc(t){return Au(t,function(t){return Ri(t)&&_r(t,"data-alloy-vertical-dir")===Sc.BottomToTop})}function zc(){return fn("layouts",[Jt("onLtr"),Jt("onRtl"),rn("onBottomLtr"),rn("onBottomRtl")])}function Nc(n,t,e,o,r,i,u){var a=u.map(Hc).getOr(!1),c=t.layouts.map(function(t){return t.onLtr(n)}),s=t.layouts.map(function(t){return t.onRtl(n)});return wc(a?t.layouts.bind(function(t){return t.onBottomLtr.map(function(t){return t(n)})}).or(c).getOr(r):c.getOr(e),a?t.layouts.bind(function(t){return t.onBottomRtl.map(function(t){return t(n)})}).or(s).getOr(i):s.getOr(o))(n)}function Lc(t){return t.fold(h,function(t,n,e){return t.translate(-n,-e)})}function jc(t){return t.fold(h,h)}function Wc(t){return R(t,function(t,n){return t.translate(n.left,n.top)},Su(0,0))}function Uc(t){return Wc(A(t,jc))}function Gc(t,n,e){var o,r,i=Oi(or(t.element)),u=(o=t,r=ur(e.root).dom,ft.from(r.frameElement).map(de.fromDom).filter(function(t){return Bn(or(t),or(o.element))}).map(xi).getOr(i));return rs(u,i.left,i.top)}function Xc(t,n,e,o){var r=os(Su(t,n));return ft.some({point:r,width:e,height:o})}function Yc(t,a,c,s,l){return t.map(function(t){var n=[a,t.point],e=s.fold(function(){return Uc(n)},function(){return Uc(n)},function(){return Wc(A(n,Lc))}),o={x:e.left,y:e.top,width:t.width,height:t.height},r=(c.showAbove?ga:ha)(),i=(c.showAbove?pa:va)(),u=Nc(l,c,r,i,r,i,ft.none());return Vc({anchorBox:o,bubble:c.bubble.getOr(xc()),overrides:c.overrides,layouts:u,placer:ft.none()})})}function qc(t,n,e){var o,r=t.document.createRange(),i=r;return n.fold(function(t){i.setStartBefore(t.dom)},function(t,n){i.setStart(t.dom,n)},function(t){i.setStartAfter(t.dom)}),o=r,e.fold(function(t){o.setEndBefore(t.dom)},function(t,n){o.setEnd(t.dom,n)},function(t){o.setEndAfter(t.dom)}),r}function Kc(t,n,e,o,r){var i=t.document.createRange();return i.setStart(n.dom,e),i.setEnd(o.dom,r),i}function Jc(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}}function $c(t,n,e){return n(de.fromDom(e.startContainer),e.startOffset,de.fromDom(e.endContainer),e.endOffset)}function Qc(i,t){return r=i,o=t.match({domRange:function(t){return{ltr:tt(t),rtl:ft.none}},relative:function(t,n){return{ltr:_t(function(){return qc(r,t,n)}),rtl:_t(function(){return ft.some(qc(r,n,t))})}},exact:function(t,n,e,o){return{ltr:_t(function(){return Kc(r,t,n,e,o)}),rtl:_t(function(){return ft.some(Kc(r,e,o,t,n))})}}}),((e=(n=o).ltr()).collapsed?n.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return fs.rtl(de.fromDom(t.endContainer),t.endOffset,de.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return $c(0,fs.ltr,e)}):$c(0,fs.ltr,e)).match({ltr:function(t,n,e,o){var r=i.document.createRange();return r.setStart(t.dom,n),r.setEnd(e.dom,o),r},rtl:function(t,n,e,o){var r=i.document.createRange();return r.setStart(e.dom,o),r.setEnd(t.dom,n),r}});var r,n,e,o}(Sc=Sc||{}).TopToBottom="toptobottom",Sc.BottomToTop="bottomtotop";var Zc="data-alloy-vertical-dir",ts=[Jt("hotspot"),rn("bubble"),dn("overrides",{}),zc(),Zu("placement",function(t,n,e){var o=Aa(e,n.hotspot.element),r=Nc(t.element,n,ha(),va(),ga(),pa(),ft.some(n.hotspot.element));return ft.some(Vc({anchorBox:o,bubble:n.bubble.getOr(xc()),overrides:n.overrides,layouts:r,placer:ft.none()}))})],ns=[Jt("x"),Jt("y"),dn("height",0),dn("width",0),dn("bubble",xc()),dn("overrides",{}),zc(),Zu("placement",function(t,n,e){var o=uc(e,n.x,n.y),r=Bi(o.left,o.top,n.width,n.height),i=Nc(t.element,n,da(),ma(),da(),ma(),ft.none());return ft.some(Vc({anchorBox:r,bubble:n.bubble,overrides:n.overrides,layouts:i,placer:ft.none()}))})],es=Vn([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),os=es.screen,rs=es.absolute,is=[Jt("node"),Jt("root"),rn("bubble"),zc(),dn("overrides",{}),dn("showAbove",!1),Zu("placement",function(r,i,u){var a=Gc(r,0,i);return i.node.filter(du).bind(function(t){var n=t.dom.getBoundingClientRect(),e=Xc(n.left,n.top,n.width,n.height),o=i.node.getOr(r.element);return Yc(e,a,i,u,o)})})],us=function(t,n,e,o){return{start:t,soffset:n,finish:e,foffset:o}},as=Vn([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),cs=(as.before,as.on,as.after,function(t){return t.fold(h,h,h)}),ss=Vn([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ls={domRange:ss.domRange,relative:ss.relative,exact:ss.exact,exactFromRange:function(t){return ss.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){return ur(t.match({domRange:function(t){return de.fromDom(t.startContainer)},relative:function(t,n){return cs(t)},exact:function(t,n,e,o){return t}}))},range:us},fs=Vn([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]);function ds(t){return Ql.getOption(t)}function ms(t){return ds(t).filter(function(t){return 0!==t.trim().length||-1<t.indexOf("\xa0")}).isSome()||et(Zl,nr(t))}function gs(t,n){return Dn(e=void 0===t?document:t.dom)?[]:A(e.querySelectorAll(n),de.fromDom);var e}function ps(t){if(0<t.rangeCount){var n=t.getRangeAt(0),e=t.getRangeAt(t.rangeCount-1);return ft.some(us(de.fromDom(n.startContainer),n.startOffset,de.fromDom(e.endContainer),e.endOffset))}return ft.none()}function hs(t){if(null===t.anchorNode||null===t.focusNode)return ps(t);var n,e,o,r,i,u,a,c,s,l,f,d=de.fromDom(t.anchorNode),m=de.fromDom(t.focusNode);return n=d,e=t.anchorOffset,o=m,r=t.focusOffset,u=e,a=o,c=r,(s=or(i=n).dom.createRange()).setStart(i.dom,u),s.setEnd(a.dom,c),l=s,f=Bn(n,o)&&e===r,l.collapsed&&!f?ft.some(us(d,t.anchorOffset,m,t.focusOffset)):ps(t)}function vs(t,n){var e,o,r=(e=Qc(t,n)).getClientRects();return 0<(o=0<r.length?r[0]:e.getBoundingClientRect()).width||0<o.height?ft.some(o).map(Jc):ft.none()}function bs(t,n){return{element:t,offset:n}}function ys(t,n){return(Vi(t)?bs:function(t,n){var e=sr(t);if(0===e.length)return bs(t,n);if(n<e.length)return bs(e[n],0);var o=e[e.length-1];return bs(o,(Vi(o)?Ql.get(o):sr(o)).length)})(t,n)}function xs(t,n){return n.getSelection.getOrThunk(function(){return function(){return ft.from(t.getSelection()).filter(function(t){return 0<t.rangeCount}).bind(hs)}})().map(function(t){var n=ys(t.start,t.soffset),e=ys(t.finish,t.foffset);return ls.range(n.element,n.offset,e.element,e.offset)})}function ws(t){return t.x+t.width}function Ss(t,n){return t.x-n.width}function ks(t,n){return t.y-n.height+t.height}function Cs(t,n,e){return na(ws(t),t.y,e.southeast(),Ra(),"southeast",ra(t,{left:0,top:2}),nf)}function Os(t,n,e){return na(Ss(t,n),t.y,e.southwest(),Va(),"southwest",ra(t,{right:1,top:2}),nf)}function _s(t,n,e){return na(ws(t),ks(t,n),e.northeast(),Pa(),"northeast",ra(t,{left:0,bottom:3}),nf)}function Ts(t,n,e){return na(Ss(t,n),ks(t,n),e.northwest(),Ha(),"northwest",ra(t,{right:1,bottom:3}),nf)}function Es(){return[Cs,Os,_s,Ts]}function Ds(){return[Os,Cs,Ts,_s]}function Bs(t,n,e,o,r,i,u){var a,c,s,l,f,d,m,g,p,h,v,b,y,x,w={anchorBox:e.anchorBox,origin:n};return a=w,c=r.element,s=e.bubble,l=e.layouts,f=i,d=o,m=e.overrides,g=u,h=bc(m,"maxHeightFunction",Mc()),v=bc(m,"maxWidthFunction",ct),b=a.anchorBox,y=a.origin,x={bounds:(p=y,d.fold(function(){return p.fold(Fi,Fi,Bi)},function(e){return p.fold(e,e,function(){var t=e(),n=uc(p,t.x,t.y);return Bi(n.left,n.top,t.width,t.height)})})),origin:y,preference:l,maxHeightFunction:h,maxWidthFunction:v,lastPlacement:f,transition:g},Ic(b,c,s,x)}function As(t,n){Gi(t.element,n.element)}function Ms(n,t){var e,o=n.components();dt((e=n).components(),function(t){return Xi(t.element)}),xr(e.element),e.syncComponents();var r=j(o,t);dt(r,function(t){sf(t),n.getSystem().removeFromWorld(t)}),dt(t,function(t){t.getSystem().isConnected()?As(n,t):(n.getSystem().addToWorld(t),As(n,t),du(n.element)&&lf(t)),n.syncComponents()})}function Fs(t,n){ff(t,n,Gi)}function Is(t){sf(t),Xi(t.element),t.getSystem().removeFromWorld(t)}function Rs(n){var t=ar(n.element).bind(function(t){return n.getSystem().getByDom(t).toOptional()});Is(n),t.each(function(t){t.syncComponents()})}function Vs(t){var n=t.components();dt(n,Is),xr(t.element),t.syncComponents()}function Ps(t,n){df(t,n,Gi)}function Hs(n){var t=sr(n.element);dt(t,function(t){n.getByDom(t).each(sf)}),Xi(n.element)}function zs(n,t,e,o){e.get().each(function(t){Vs(n)}),Fs(t.getAttachPoint(n),n);var r=n.getSystem().build(o);return Fs(n,r),e.set(r),r}function Ns(t,n,e,o){var r=zs(t,n,e,o);return n.onOpen(t,r),r}function Ls(n,e,o){o.get().each(function(t){Vs(n),Rs(n),e.onClose(n,t),o.clear()})}function js(t,n,e){return e.isOpen()}function Ws(t){var e=Yt("Dismissal",yf,t),n={};return n[hf()]={schema:Ht([Jt("target")]),onReceive:function(n,t){pf.isOpen(n)&&(pf.isPartOf(n,t.target)||e.isExtraPart(n,t.target)||e.fireEventInstead.fold(function(){return pf.close(n)},function(t){return ze(n,t.event)}))}},n}function Us(t){var e=Yt("Reposition",xf,t),n={};return n[vf()]={onReceive:function(n){pf.isOpen(n)&&e.fireEventInstead.fold(function(){return e.doReposition(n)},function(t){return ze(n,t.event)})}},n}function Gs(t,n,e){n.store.manager.onLoad(t,n,e)}function Xs(t,n,e){n.store.manager.onUnload(t,n,e)}function Ys(){var t=wn(null);return au({set:t.set,get:t.get,isNotSet:function(){return null===t.get()},clear:function(){t.set(null)},readState:function(){return{mode:"memory",value:t.get()}}})}function qs(){var i=wn({}),u=wn({});return au({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(t){return kt(i.get(),t).orThunk(function(){return kt(u.get(),t)})},update:function(t){var n=i.get(),e=u.get(),o={},r={};dt(t,function(n){kt(o[n.value]=n,"meta").each(function(t){kt(t,"text").each(function(t){r[t]=n})})}),i.set(st(st({},n),o)),u.set(st(st({},e),r))},clear:function(){i.set({}),u.set({})}})}function Ks(t,n,e,o){var r=n.store;e.update([o]),r.setValue(t,o),n.onSetValue(t,o)}function Js(o,t){return xn(o,{},A(t,function(t){return n=t.name(),e="Cannot configure "+t.name()+" for "+o,le(n,n,Bt(),It(function(t){return Nn("The field: "+n+" is forbidden. "+e)}));var n,e}).concat([fe("dump",h)]))}function $s(t){return t.dump}function Qs(t,n){return st(st({},t.dump),Za(n))}function Zs(t){return Kn(t,"uiType")}function tl(t){return t.fold(ft.some,ft.none,ft.some,ft.some)}function nl(t){function n(t){return t.name}return t.fold(n,n,n,n)}function el(e,o){return function(t){var n=Yt("Converting part type",o,t);return e(n)}}function ol(t,n,e,o){return Jn(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))}function rl(r,t){var n={};return dt(t,function(t){tl(t).each(function(e){var o=Zf(r,e.pname);n[e.name]=function(t){var n=Yt("Part: "+e.name+" in "+r,te(e.schema),t);return st(st({},o),{config:t,validated:n})}})}),n}function il(t,n,e){return{uiType:If(),owner:t,name:n,config:e,validated:{}}}function ul(t){return z(t,function(t){return t.fold(ft.none,ft.some,ft.none,ft.none).map(function(t){return nn(t.name,t.schema.concat([ta($f())]))}).toArray()})}function al(t){return A(t,nl)}function cl(t,n,e){return o=n,r={},i={},dt(e,function(t){t.fold(function(o){r[o.pname]=Mf(!0,function(t,n,e){return o.factory.sketch(ol(t,o,n,e))})},function(t){var n=o.parts[t.name];i[t.name]=tt(t.factory.sketch(ol(o,t,n[$f()]),n))},function(o){r[o.pname]=Mf(!1,function(t,n,e){return o.factory.sketch(ol(t,o,n,e))})},function(o){r[o.pname]=Ff(!0,function(n,t,e){return A(n[o.name],function(t){return o.factory.sketch(Jn(o.defaults(n,t,e),t,o.overrides(n,t)))})})})}),{internals:tt(r),externals:tt(i)};var o,r,i}function sl(t,n,e){return o=ft.some(t),i=(r=n).components,s=yt(e,function(t,n){return o=t,r=!1,{name:tt(e=n),required:function(){return o.fold(function(t,n){return t},function(t,n){return t})},used:function(){return r},replace:function(){if(r)throw new Error("Trying to use the same placeholder more than once: "+e);return r=!0,o}};var e,o,r}),u=o,a=r,c=s,l=z(i,function(t){return Af(u,a,t,c)}),bt(s,function(t){if(!1===t.used()&&t.required())throw new Error("Placeholder: "+t.name()+" was not found in components list\nNamespace: "+o.getOr("none")+"\nComponents: "+JSON.stringify(r.components,null,2))}),l;var o,r,i,u,a,c,s,l}function ll(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOptional()}function fl(t,n,e){return ll(t,n,e).getOrDie("Could not find part: "+e)}function dl(t,n,e){var o={},r=n.partUids,i=t.getSystem();return dt(e,function(t){o[t]=tt(i.getByUid(r[t]))}),o}function ml(t,n){var e=t.getSystem();return yt(n.partUids,function(t,n){return tt(e.getByUid(t))})}function gl(t){return Xn(t.partUids)}function pl(t,n,e){var o={},r=n.partUids,i=t.getSystem();return dt(e,function(t){o[t]=tt(i.getByUid(r[t]).getOrDie())}),o}function hl(n,t){return Me(A(al(t),function(t){return{key:t,value:n+"-"+t}}))}function vl(n){return le("partUids","partUids",At(function(t){return hl(t.uid,n)}),ee())}function bl(t,n,e,o,r){var i;return Yt(t+" [SpecSchema]",Ht((i=r,(0<o.length?[nn("parts",o)]:[]).concat([Jt("uid"),dn("dom",{}),dn("components",[]),ta("originalSpec"),dn("debug.sketcher",{})]).concat(i)).concat(n)),e)}function yl(t,n,e,o,r){var i=nd(r),u=bl(t,n,i,ul(e),[vl(e)]),a=cl(0,u,e);return o(u,sl(t,u,a.internals()),i,a.externals())}function xl(t){var r=Yt("Sketcher for "+t.name,ed,t),n=yt(r.apis,Vr),e=yt(r.extraApis,Ir);return st(st({name:r.name,configFields:r.configFields,sketch:function(t){return n=r.name,e=r.configFields,(0,r.factory)(bl(n,e,o=nd(t),[],[]),o);var n,e,o}},n),e)}function wl(t){var n=Yt("Sketcher for "+t.name,od,t),e=rl(n.name,n.partFields),o=yt(n.apis,Vr),r=yt(n.extraApis,Ir);return st(st({name:n.name,partFields:n.partFields,configFields:n.configFields,sketch:function(t){return yl(n.name,n.configFields,n.partFields,n.factory,t)},parts:e},o),r)}function Sl(t){return"input"===nr(t)&&"radio"!==_r(t,"type")||"textarea"===nr(t)}function kl(t,n,e){(n.disabled()?ad:cd)(t,n)}function Cl(t,n){return!0===n.useNative&&et(ud,nr(t.element))}function Ol(t,n){return Cl(t,n)?Er(t.element,"disabled"):"true"===_r(t.element,"aria-disabled")}function _l(e,o,t,r){var n=gs(e.element,"."+o.highlightClass);dt(n,function(n){T(r,function(t){return t.element===n})||(Gr(n,o.highlightClass),e.getSystem().getByDom(n).each(function(t){o.onDehighlight(e,t),ze(t,qo())}))})}function Tl(t,n,e,o){_l(t,n,0,[o]),Ul(0,n,0,o)||(Ur(o.element,n.highlightClass),n.onHighlight(t,o),ze(o,Yo()))}function El(e,n,t,o){var r=gs(e.element,"."+n.itemClass);return P(r,function(t){return Xr(t,n.highlightClass)}).bind(function(t){var n=ea(t,o,0,r.length-1);return e.getSystem().getByDom(r[n]).toOptional()})}function Dl(t,n,e){var o=L(t.slice(0,n)),r=L(t.slice(n+1));return V(o.concat(r),e)}function Bl(t,n,e){return V(L(t.slice(0,n)),e)}function Al(t,n,e){var o=t.slice(0,n);return V(t.slice(n+1).concat(o),e)}function Ml(t,n,e){return V(t.slice(n+1),e)}function Fl(e){return function(t){var n=t.raw;return et(e,n.which)}}function Il(t){return function(n){return N(t,function(t){return t(n)})}}function Rl(t){return!0===t.raw.shiftKey}function Vl(t){return!0===t.raw.ctrlKey}function Pl(t,n){return{matches:t,classification:n}}function Hl(t,n,e){n.exists(function(n){return e.exists(function(t){return Bn(t,n)})})||Ne(t,Wo(),{prevFocus:n,newFocus:e})}function zl(){function o(t){return Oa(t.element)}return{get:o,set:function(t,n){var e=o(t);t.getSystem().triggerFocus(n,t.element),Hl(t,e,o(t))}}}function Nl(){function r(t){return md.getHighlighted(t).map(function(t){return t.element})}return{get:r,set:function(n,t){var e=r(n);n.getSystem().getByDom(t).fold(ct,function(t){md.highlight(n,t)});var o=r(n);Hl(n,e,o)}}}fs.ltr,fs.rtl;function Ll(t,n,e,o,r,i){var u=i.map(Ai);return af(t,n,e,o,r,u)}function jl(t,n,e){var o,r,i,u=n.getAttachPoint(t);ni(t.element,"position",cf.getMode(u)),i=n.cloakVisibilityAttr,ii((o=t).element,r="visibility").fold(function(){Dr(o.element,i)},function(t){Or(o.element,i,t)}),ni(o.element,r,"hidden")}function Wl(t,n,e){var o,r,i,u=t.element;T(["top","left","right","bottom"],function(t){return ii(u,t).isSome()})||ai(t.element,"position"),r="visibility",i=n.cloakVisibilityAttr,Tr((o=t).element,i).fold(function(){return ai(o.element,r)},function(t){return ni(o.element,r,t)})}function Ul(t,n,e,o){return Xr(o.element,n.highlightClass)}function Gl(n,t,e){return Fu(n.element,"."+t.itemClass).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}function Xl(n,t,e){var o=gs(n.element,"."+t.itemClass);return(0<o.length?ft.some(o[o.length-1]):ft.none()).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}function Yl(n,t,e){return Jr(A(gs(n.element,"."+t.itemClass),function(t){return n.getSystem().getByDom(t).toOptional()}))}var ql,Kl,Jl,$l,Ql=(ql=Vi,{get:function(t){if(!ql(t))throw new Error("Can only get text value of a text node");return Kl(t).getOr("")},getOption:Kl=function(t){return ql(t)?ft.from(t.dom.nodeValue):ft.none()},set:function(t,n){if(!ql(t))throw new Error("Can only set raw text value of a text node");t.dom.nodeValue=n}}),Zl=["img","br"],tf=[rn("getSelection"),Jt("root"),rn("bubble"),zc(),dn("overrides",{}),dn("showAbove",!1),Zu("placement",function(t,n,e){var r=ur(n.root).dom,o=Gc(t,0,n);return Yc(xs(r,n).bind(function(e){return t=r,n=ls.exactFromRange(e),(0<(o=Qc(t,n).getBoundingClientRect()).width||0<o.height?ft.some(o).map(Jc):ft.none()).orThunk(function(){var t=de.fromText("\ufeff");hr(e.start,t);var n=vs(r,ls.exact(t,0,t,1));return Xi(t),n}).bind(function(t){return Xc(t.left,t.top,t.width,t.height)});var t,n,o}),o,n,e,xs(r,n).bind(function(t){return Ri(t.start)?ft.some(t.start):zi(t.start)}).getOr(t.element))})],nf="link-layout",ef=qt("type",{selection:tf,node:is,hotspot:ts,submenu:[Jt("item"),zc(),dn("overrides",{}),Zu("placement",function(t,n,e){var o=Aa(e,n.item.element),r=Nc(t.element,n,Es(),Ds(),Es(),Ds(),ft.none());return ft.some(Vc({anchorBox:o,bubble:xc(),overrides:n.overrides,layouts:r,placer:ft.none()}))})],makeshift:ns}),of=[on("classes",re),hn("mode","all",["all","layout","placement"])],rf=[dn("useFixed",O),rn("getBounds")],uf=[$t("anchor",ef),fn("transition",of)],af=function(c,s,l,f,t,d){var m=Yt("placement.info",te(uf),t),g=m.anchor,p=f.element,h=l.get(f.uid);_a(function(){ni(p,"position","fixed");var t=ii(p,"visibility");ni(p,"visibility","hidden");var n,e,o,r,i=s.useFixed()?(r=document.documentElement,Oc(0,0,r.clientWidth,r.clientHeight)):(e=xi((n=c).element),o=n.element.dom.getBoundingClientRect(),Cc(e.left,e.top,o.width,o.height)),u=g.placement,a=d.map(tt).or(s.getBounds);u(c,g,i).each(function(t){var n=t.placer.getOr(Bs)(c,i,t,a,f,h,m.transition);l.set(f.uid,n)}),t.fold(function(){ai(p,"visibility")},function(t){ni(p,"visibility",t)}),ii(p,"left").isNone()&&ii(p,"top").isNone()&&ii(p,"right").isNone()&&ii(p,"bottom").isNone()&&Kr(ii(p,"position"),"fixed")&&ai(p,"position")},p)},cf=xa({fields:rf,name:"positioning",active:rc,apis:Object.freeze({__proto__:null,position:function(t,n,e,o,r){Ll(t,n,e,o,r,ft.none())},positionWithin:Ll,positionWithinBounds:af,getMode:function(t,n,e){return n.useFixed()?"fixed":"absolute"},reset:function(t,n,e,o){var r=o.element;dt(["position","left","right","top","bottom"],function(t){return ai(r,t)}),Dr(r,_c),e.clear(o.uid)}}),state:Object.freeze({__proto__:null,init:function(){var e={};return au({readState:function(){return e},clear:function(t){f(t)?delete e[t]:e={}},set:function(t,n){e[t]=n},get:function(t){return kt(e,t)}})}})}),sf=function(t){ze(t,No());var n=t.components();dt(n,sf)},lf=function(t){var n=t.components();dt(n,lf),ze(t,zo())},ff=function(t,n,e){t.getSystem().addToWorld(n),e(t.element,n.element),du(t.element)&&lf(n),t.syncComponents()},df=function(t,n,e){e(t,n.element);var o=sr(n.element);dt(o,function(t){n.getByDom(t).each(lf)})},mf=Object.freeze({__proto__:null,cloak:jl,decloak:Wl,open:Ns,openWhileCloaked:function(t,n,e,o,r){jl(t,n),Ns(t,n,e,o),r(),Wl(t,n)},close:Ls,isOpen:js,isPartOf:function(n,e,t,o){return js(0,0,t)&&t.get().exists(function(t){return e.isPartOf(n,t,o)})},getState:function(t,n,e){return e.get()},setContent:function(t,n,e,o){return e.get().map(function(){return zs(t,n,e,o)})}}),gf=Object.freeze({__proto__:null,events:function(e,o){return Jo([Xe(Mo(),function(t,n){Ls(t,e,o)})])}}),pf=xa({fields:[Ku("onOpen"),Ku("onClose"),Jt("isPartOf"),Jt("getAttachPoint"),dn("cloakVisibilityAttr","data-precloak-visibility")],name:"sandboxing",active:gf,apis:mf,state:Object.freeze({__proto__:null,init:function(){var t=fc(),n=tt("not-implemented");return au({readState:n,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}})}),hf=tt("dismiss.popups"),vf=tt("reposition.popups"),bf=tt("mouse.released"),yf=Ht([dn("isExtraPart",O),fn("fireEventInstead",[dn("event",Lo())])]),xf=Ht([fn("fireEventInstead",[dn("event",jo())]),tn("doReposition")]),wf=Object.freeze({__proto__:null,onLoad:Gs,onUnload:Xs,setValue:function(t,n,e,o){n.store.manager.setValue(t,n,e,o)},getValue:function(t,n,e){return n.store.manager.getValue(t,n,e)},getState:function(t,n,e){return e}}),Sf=Object.freeze({__proto__:null,events:function(e,o){var t=e.resetOnDom?[$o(function(t,n){Gs(t,e,o)}),Qo(function(t,n){Xs(t,e,o)})]:[ba(e,o,Gs)];return Jo(t)}}),kf=Object.freeze({__proto__:null,memory:Ys,dataset:qs,manual:function(){return au({readState:ct})},init:function(t){return t.store.manager.state(t)}}),Cf=[rn("initialValue"),Jt("getFallbackEntry"),Jt("getDataKey"),Jt("setValue"),Zu("manager",{setValue:Ks,getValue:function(t,n,e){var o=n.store,r=o.getDataKey(t);return e.lookup(r).getOrThunk(function(){return o.getFallbackEntry(r)})},onLoad:function(n,e,o){e.store.initialValue.each(function(t){Ks(n,e,o,t)})},onUnload:function(t,n,e){e.clear()},state:qs})],Of=[Jt("getValue"),dn("setValue",ct),rn("initialValue"),Zu("manager",{setValue:function(t,n,e,o){n.store.setValue(t,o),n.onSetValue(t,o)},getValue:function(t,n,e){return n.store.getValue(t)},onLoad:function(n,e,t){e.store.initialValue.each(function(t){e.store.setValue(n,t)})},onUnload:ct,state:uu.init})],_f=xa({fields:[mn("store",{mode:"memory"},qt("mode",{memory:[rn("initialValue"),Zu("manager",{setValue:function(t,n,e,o){e.set(o),n.onSetValue(t,o)},getValue:function(t,n,e){return e.get()},onLoad:function(t,n,e){n.store.initialValue.each(function(t){e.isNotSet()&&e.set(t)})},onUnload:function(t,n,e){e.clear()},state:Ys})],manual:Of,dataset:Cf})),Ku("onSetValue"),dn("resetOnDom",!1)],name:"representing",active:Sf,apis:wf,extra:{setValueFrom:function(t,n){var e=_f.getValue(n);_f.setValue(t,e)}},state:kf}),Tf=Js,Ef=Qs,Df="placeholder",Bf=Vn([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),Af=function(r,i,u,a){return t=r,e=a,(Zs(n=u)&&n.uiType===Df?(c=n,s=e,(o=t).exists(function(t){return t!==c.owner})?Bf.single(!0,tt(c)):kt(s,c.name).fold(function(){throw new Error("Unknown placeholder component: "+c.name+"\nKnown: ["+Xn(s)+"]\nNamespace: "+o.getOr("none")+"\nSpec: "+JSON.stringify(c,null,2))},function(t){return t.replace()})):Bf.single(!1,tt(n))).fold(function(t,n){var e=Zs(u)?n(i,u.config,u.validated):n(i),o=z(kt(e,"components").getOr([]),function(t){return Af(r,i,t,a)});return[st(st({},e),{components:o})]},function(t,n){if(Zs(u)){var e=n(i,u.config,u.validated);return u.validated.preprocess.getOr(h)(e)}return n(i)});var t,n,e,o,c,s},Mf=Bf.single,Ff=Bf.multiple,If=tt(Df),Rf=Vn([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),Vf=dn("factory",{sketch:h}),Pf=dn("schema",[]),Hf=Jt("name"),zf=le("pname","pname",Et(function(t){return"<alloy."+Ar(t.name)+">"}),ee()),Nf=fe("schema",function(){return[rn("preprocess")]}),Lf=dn("defaults",tt({})),jf=dn("overrides",tt({})),Wf=te([Vf,Pf,Hf,zf,Lf,jf]),Uf=te([Vf,Pf,Hf,Lf,jf]),Gf=te([Vf,Pf,Hf,zf,Lf,jf]),Xf=te([Vf,Nf,Hf,Jt("unit"),zf,Lf,jf]),Yf=el(Rf.required,Wf),qf=el(Rf.external,Uf),Kf=el(Rf.optional,Gf),Jf=el(Rf.group,Xf),$f=tt("entirety"),Qf=Object.freeze({__proto__:null,required:Yf,external:qf,optional:Kf,group:Jf,asNamedPart:tl,name:nl,asCommon:function(t){return t.fold(h,h,h,h)},original:$f}),Zf=function(t,n){return{uiType:If(),owner:t,name:n}},td=Object.freeze({__proto__:null,generate:rl,generateOne:il,schemas:ul,names:al,substitutes:cl,components:sl,defaultUids:hl,defaultUidsSchema:vl,getAllParts:ml,getAllPartNames:gl,getPart:ll,getPartOrDie:fl,getParts:dl,getPartsOrDie:pl}),nd=function(t){return Kn(t,"uid")?t:st(st({},t),{uid:nu("uid")})},ed=Ht([Jt("name"),Jt("factory"),Jt("configFields"),dn("apis",{}),dn("extraApis",{})]),od=Ht([Jt("name"),Jt("factory"),Jt("configFields"),Jt("partFields"),dn("apis",{}),dn("extraApis",{})]),rd=Object.freeze({__proto__:null,getCurrent:function(t,n,e){return n.find(t)}}),id=xa({fields:[Jt("find")],name:"composing",apis:rd}),ud=["input","button","textarea","select"],ad=function(n,t,e){t.disableClass.each(function(t){Ur(n.element,t)}),(Cl(n,t)?function(t){Or(t.element,"disabled","disabled")}:function(t){Or(t.element,"aria-disabled","true")})(n),t.onDisabled(n)},cd=function(n,t,e){t.disableClass.each(function(t){Gr(n.element,t)}),(Cl(n,t)?function(t){Dr(t.element,"disabled")}:function(t){Or(t.element,"aria-disabled","false")})(n),t.onEnabled(n)},sd=Object.freeze({__proto__:null,enable:cd,disable:ad,isDisabled:Ol,onLoad:kl,set:function(t,n,e,o){(o?ad:cd)(t,n)}}),ld=Object.freeze({__proto__:null,exhibit:function(t,n){return Hr({classes:n.disabled()?n.disableClass.toArray():[]})},events:function(e,t){return Jo([Ue(Eo(),function(t,n){return Ol(t,e)}),ba(e,t,kl)])}}),fd=xa({fields:[bn("disabled",O),dn("useNative",!0),rn("disableClass"),Ku("onDisabled"),Ku("onEnabled")],name:"disabling",active:ld,apis:sd}),dd=Object.freeze({__proto__:null,dehighlightAll:function(t,n,e){return _l(t,n,0,[])},dehighlight:function(t,n,e,o){Ul(0,n,0,o)&&(Gr(o.element,n.highlightClass),n.onDehighlight(t,o),ze(o,qo()))},highlight:Tl,highlightFirst:function(n,e,t){Gl(n,e).each(function(t){Tl(n,e,0,t)})},highlightLast:function(n,e,t){Xl(n,e).each(function(t){Tl(n,e,0,t)})},highlightAt:function(n,e,t,o){var r,i,u;i=o,u=gs((r=n).element,"."+e.itemClass),ft.from(u[i]).fold(function(){return mt.error(new Error("No element found with index "+i))},r.getSystem().getByDom).fold(function(t){throw t},function(t){Tl(n,e,0,t)})},highlightBy:function(n,e,t,o){V(Yl(n,e),o).each(function(t){Tl(n,e,0,t)})},isHighlighted:Ul,getHighlighted:function(n,t,e){return Fu(n.element,"."+t.highlightClass).bind(function(t){return n.getSystem().getByDom(t).toOptional()})},getFirst:Gl,getLast:Xl,getPrevious:function(t,n,e){return El(t,n,0,-1)},getNext:function(t,n,e){return El(t,n,0,1)},getCandidates:Yl}),md=xa({fields:[Jt("highlightClass"),Jt("itemClass"),Ku("onHighlight"),Ku("onDehighlight")],name:"highlighting",apis:dd}),gd=[8],pd=[9],hd=[13],vd=[27],bd=[32],yd=[37],xd=[38],wd=[39],Sd=[40],kd=k(Rl);function Cd(t,n,e,o,a){function c(n,e,t,o,r){var i=t(n,e,o,r),u=e.event;return V(i,function(t){return t.matches(u)}).map(function(t){return t.classification}).bind(function(t){return t(n,e,o,r)})}var r={schema:function(){return t.concat([dn("focusManager",zl()),mn("focusInside","onFocus",Wt(function(t){return et(["onFocus","onEnterOrSpace","onApi"],t)?mt.value(t):mt.error("Invalid value for focusInside")})),Zu("handler",r),Zu("state",n),Zu("sendFocusIn",a)])},processKey:c,toEvents:function(i,u){var t=i.focusInside!==Jl.OnFocusMode?ft.none():a(i).map(function(e){return Xe(Co(),function(t,n){e(t,i,u),n.stop()})}),n=[Xe(go(),function(o,r){c(o,r,e,i,u).fold(function(){var n=o,e=r,t=Fl(bd.concat(hd))(e.event);i.focusInside===Jl.OnEnterOrSpaceMode&&t&&Ve(n,e)&&a(i).each(function(t){t(n,i,u),e.stop()})},function(t){r.stop()})}),Xe(po(),function(t,n){c(t,n,o,i,u).each(function(t){n.stop()})})];return Jo(t.toArray().concat(n))}};return r}function Od(t){function a(t,n){return 0<vi(t.visibilitySelector.bind(function(t){return Iu(n,t)}).getOr(n))}function n(n,e,t){var o=e,r=F(gs(n.element,o.selector),function(t){return a(o,t)});ft.from(r[o.firstTabstop]).each(function(t){e.focusManager.set(n,t)})}function o(e,t,r,i){var n,u=gs(e.element,r.selector);return(n=r).focusManager.get(e).bind(function(t){return Iu(t,n.selector)}).bind(function(t){return P(u,S(Bn,t)).bind(function(t){return n=e,o=r,i(u,t,function(t){return a(n=o,e=t)&&n.useTabstopAt(e);var n,e}).fold(function(){return o.cyclic?ft.some(!0):ft.none()},function(t){return o.focusManager.set(n,t),ft.some(!0)});var n,o})})}var e=[rn("onEscape"),rn("onEnter"),dn("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),dn("firstTabstop",0),dn("useTabstopAt",_),rn("visibilitySelector")].concat([t]),r=tt([Pl(Il([Rl,Fl(pd)]),function(t,n,e){return o(t,0,e,e.cyclic?Dl:Bl)}),Pl(Fl(pd),function(t,n,e){return o(t,0,e,e.cyclic?Al:Ml)}),Pl(Fl(vd),function(n,e,t){return t.onEscape.bind(function(t){return t(n,e)})}),Pl(Il([kd,Fl(hd)]),function(n,e,t){return t.onEnter.bind(function(t){return t(n,e)})})]),i=tt([]);return Cd(e,uu.init,r,i,function(){return ft.some(n)})}function _d(t,n,e){return Sl(e)&&Fl(bd)(n.event)?ft.none():(je(t,e,Eo()),ft.some(!0))}function Td(t,n){return ft.some(!0)}function Ed(t,n,e){return e.execute(t,n,t.element)}function Dd(){var e=fc();return au({readState:function(){return e.get().map(function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(t,n){e.set({numRows:t,numColumns:n})},getNumRows:function(){return e.get().map(function(t){return t.numRows})},getNumColumns:function(){return e.get().map(function(t){return t.numColumns})}})}function Bd(i){return function(t,n,e,o){var r=i(t.element);return $m(r,t,n,e,o)}}function Ad(t,n){return Bd(wc(t,n))}function Md(t,n){return Bd(wc(n,t))}function Fd(r){return function(t,n,e,o){return $m(r,t,n,e,o)}}function Id(t){return!((n=t.dom).offsetWidth<=0&&n.offsetHeight<=0);var n}function Rd(t,n,e){var o,r=F(gs(t,e),Id);return P(o=r,function(t){return Bn(t,n)}).map(function(t){return{index:t,candidates:o}})}function Vd(t,n){return P(t,function(t){return Bn(n,t)})}function Pd(e,t,o,n){return n(Math.floor(t/o),t%o).bind(function(t){var n=t.row*o+t.column;return 0<=n&&n<e.length?ft.some(e[n]):ft.none()})}function Hd(r,t,i,u,a){return Pd(r,t,u,function(t,n){var e=t===i-1?r.length-t*u:u,o=ea(n,a,0,e-1);return ft.some({row:t,column:o})})}function zd(r,t,i,u,a){return Pd(r,t,u,function(t,n){var e=ea(t,a,0,i-1),o=oa(n,0,(e===i-1?r.length-e*u:u)-1);return ft.some({row:e,column:o})})}function Nd(n,e,t){Fu(n.element,e.selector).each(function(t){e.focusManager.set(n,t)})}function Ld(r){return function(t,n,e,o){return Rd(t,n,e.selector).bind(function(t){return r(t.candidates,t.index,o.getNumRows().getOr(e.initSize.numRows),o.getNumColumns().getOr(e.initSize.numColumns))})}}function jd(t,n,e){return e.captureTab?ft.some(!0):ft.none()}function Wd(t,n,e,i){var u=function(t,n,e){var o,r=ea(n,i,0,e.length-1);return r===t?ft.none():"button"===nr(o=e[r])&&"disabled"===_r(o,"disabled")?u(t,r,e):ft.from(e[r])};return Rd(t,e,n).bind(function(t){var n=t.index,e=t.candidates;return u(n,n,e)})}function Ud(n,e,o){return(r=o).focusManager.get(n).bind(function(t){return Iu(t,r.selector)}).bind(function(t){return o.execute(n,e,t)});var r}function Gd(n,e,t){e.getInitial(n).orThunk(function(){return Fu(n.element,e.selector)}).each(function(t){e.focusManager.set(n,t)})}function Xd(t,n,e){return Wd(t,e.selector,n,-1)}function Yd(t,n,e){return Wd(t,e.selector,n,1)}function qd(r){return function(t,n,e,o){return r(t,n,e,o).bind(function(){return e.executeOnMove?Ud(t,n,e):ft.some(!0)})}}function Kd(t,n,e){return e.onEscape(t,n)}function Jd(t,n,e){return ft.from(t[n]).bind(function(t){return ft.from(t[e]).map(function(t){return{rowIndex:n,columnIndex:e,cell:t}})})}function $d(t,n,e,o){return Jd(t,n,ea(e,o,0,t[n].length-1))}function Qd(t,n,e,o){var r=ea(e,o,0,t.length-1);return Jd(t,r,oa(n,0,t[r].length-1))}function Zd(t,n,e,o){return Jd(t,n,oa(e+o,0,t[n].length-1))}function tm(t,n,e,o){var r=oa(e+o,0,t.length-1);return Jd(t,r,oa(n,0,t[r].length-1))}function nm(n,e,t){e.previousSelector(n).orThunk(function(){var t=e.selectors;return Fu(n.element,t.cell)}).each(function(t){e.focusManager.set(n,t)})}function em(t,o){return function(n,e,i){var u=i.cycles?t:o;return Iu(e,i.selectors.row).bind(function(t){return Vd(gs(t,i.selectors.cell),e).bind(function(o){var r=gs(n,i.selectors.row);return Vd(r,t).bind(function(t){var n,e=(n=i,A(r,function(t){return gs(t,n.selectors.cell)}));return u(e,t,o).map(function(t){return t.cell})})})})}}function om(n,e,o){return o.focusManager.get(n).bind(function(t){return o.execute(n,e,t)})}function rm(n,e,t){Fu(n.element,e.selector).each(function(t){e.focusManager.set(n,t)})}function im(t,n,e){return Wd(t,e.selector,n,-1)}function um(t,n,e){return Wd(t,e.selector,n,1)}function am(t,n,e,o){var r=t.getSystem().build(o);ff(t,r,e)}function cm(t,n,e,o){V(Ag(t),function(t){return Bn(o.element,t.element)}).each(Rs)}function sm(n,t,e,r,o){var i=Ag(n);return ft.from(i[r]).map(function(t){return cm(n,0,0,t),o.each(function(t){am(n,0,function(t,n){var e,o=n;lr(e=t,r).fold(function(){Gi(e,o)},function(t){hr(t,o)})},t)}),t})}function lm(t,n){var e,o;return{key:t,value:{config:{},me:(e=t,o=Jo(n),xa({fields:[Jt("enabled")],name:e,active:{events:tt(o)}})),configAsRaw:tt({}),initialConfig:{},state:uu}}}function fm(t,n){n.ignore||(Sa(t.element),n.onFocus(t))}function dm(t,n,e){var o=n.aria;o.update(t,o,e.get())}function mm(n,t,e){t.toggleClass.each(function(t){(e.get()?Ur:Gr)(n.element,t)})}function gm(t,n,e){Um(t,n,e,!e.get())}function pm(t,n,e){e.set(!0),mm(t,n,e),dm(t,n,e)}function hm(t,n,e){e.set(!1),mm(t,n,e),dm(t,n,e)}function vm(t,n,e){Um(t,n,e,n.selected)}function bm(){function t(t,n){n.stop(),Le(t)}return[Xe(bo(),t),Xe(Bo(),t),$e(eo()),$e(uo())]}function ym(t){return Jo(lt([t.map(function(e){return tr(function(t,n){e(t),n.stop()})}).toArray(),bm()]))}function xm(t){(Oa(t.element).isNone()||Rg.isFocused(t))&&(Rg.isFocused(t)||Rg.focus(t),Ne(t,zg,{item:t}))}function wm(t){Ne(t,Ng,{item:t})}function Sm(t,n){return t.x+t.width/2-n.width/2}function km(t,n){return t.x+t.width-n.width}function Cm(t,n){return t.y+t.height-n.height}function Om(t,n){return t.y+t.height/2-n.height/2}function _m(t,n,e){return na(km(t,n),Cm(t,n),e.insetSouthwest(),Ha(),"southwest",ra(t,{right:0,bottom:3}),rp)}function Tm(t,n,e){return na(t.x,Cm(t,n),e.insetSoutheast(),Pa(),"southeast",ra(t,{left:1,bottom:3}),rp)}function Em(t,n,e){return na(km(t,n),t.y,e.insetNorthwest(),Va(),"northwest",ra(t,{right:0,top:2}),rp)}function Dm(t,n,e){return na(t.x,t.y,e.insetNortheast(),Ra(),"northeast",ra(t,{left:1,top:2}),rp)}function Bm(t,n,e){return na(km(t,n),Om(t,n),e.insetEast(),ja(),"east",ra(t,{right:0}),rp)}function Am(t,n,e){return na(t.x,Om(t,n),e.insetWest(),La(),"west",ra(t,{left:1}),rp)}function Mm(t){switch(t){case"north":return ip;case"northeast":return Dm;case"northwest":return Em;case"south":return up;case"southeast":return Tm;case"southwest":return _m;case"east":return Bm;case"west":return Am}}function Fm(t,n,e,o,r){return ac(o).map(Mm).getOr(ip)(t,n,e,o,r)}function Im(t){switch(t){case"north":return up;case"northeast":return Tm;case"northwest":return _m;case"south":return ip;case"southeast":return Dm;case"southwest":return Em;case"east":return Am;case"west":return Bm}}function Rm(t,n,e,o,r){return ac(o).map(Im).getOr(ip)(t,n,e,o,r)}function Vm(t){var n=void 0!==t.uid&&Ct(t,"uid")?t.uid:nu("memento");return{get:function(t){return t.getSystem().getByUid(n).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(n).toOptional()},asSpec:function(){return st(st({},t),{uid:n})}}}function Pm(t){return function(){return kt(t,fp).getOr("!not found!")}}function Hm(t,n){var e,o=t.toLowerCase();if(sp.isRtl()){var r=he(e=o,"-rtl")?e:e+"-rtl";return Kn(n,r)?r:o}return o}function zm(t,n){return kt(n,Hm(t,n))}function Nm(t,n){var e=n();return zm(t,e).getOrThunk(Pm(e))}function Lm(){return lm("add-focusable",[$o(function(t){var n,e,o;n=t.element,e="svg",o=function(t){return En(t,e)},V(n.dom.childNodes,function(t){return o(de.fromDom(t))}).map(de.fromDom).each(function(t){return Or(t,"focusable","false")})})])}function jm(t,n,e,o){var r,i,u,a=(u=n,sp.isRtl()&&Kn(lp,u)?["tox-icon--flip"]:[]),c=kt(e,Hm(n,e)).or(o).getOrThunk(Pm(e));return{dom:{tag:t.tag,attributes:null!==(r=t.attributes)&&void 0!==r?r:{},classes:t.classes.concat(a),innerHtml:c},behaviours:Za(H(H([],null!==(i=t.behaviours)&&void 0!==i?i:[]),[Lm()]))}}function Wm(t,n,e,o){return void 0===o&&(o=ft.none()),jm(n,t,e(),o)}($l=Jl=Jl||{}).OnFocusMode="onFocus",$l.OnEnterOrSpaceMode="onEnterOrSpace",$l.OnApiMode="onApi";function Um(t,n,e,o){(o?pm:hm)(t,n,e)}function Gm(t,n,e){Or(t.element,"aria-expanded",e)}function Xm(t){return"prepared"===t.type?ft.some(t.menu):ft.none()}var Ym=Od(fe("cyclic",O)),qm=Od(fe("cyclic",_)),Km=Cd([dn("execute",_d),dn("useSpace",!1),dn("useEnter",!0),dn("useControlEnter",!1),dn("useDown",!1)],uu.init,function(t,n,e,o){var r=e.useSpace&&!Sl(t.element)?bd:[],i=e.useEnter?hd:[],u=e.useDown?Sd:[];return[Pl(Fl(r.concat(i).concat(u)),Ed)].concat(e.useControlEnter?[Pl(Il([Vl,Fl(hd)]),Ed)]:[])},function(t,n,e,o){return e.useSpace&&!Sl(t.element)?[Pl(Fl(bd),Td)]:[]},function(){return ft.none()}),Jm=Object.freeze({__proto__:null,flatgrid:Dd,init:function(t){return t.state(t)}}),$m=function(n,e,t,o,r){return o.focusManager.get(e).bind(function(t){return n(e.element,t,o,r)}).map(function(t){return o.focusManager.set(e,t),!0})},Qm=Fd,Zm=Fd,tg=Fd,ng=Ld(function(t,n,e,o){return Hd(t,n,e,o,-1)}),eg=Ld(function(t,n,e,o){return Hd(t,n,e,o,1)}),og=Ld(function(t,n,e,o){return zd(t,n,e,o,-1)}),rg=Ld(function(t,n,e,o){return zd(t,n,e,o,1)}),ig=Cd([Jt("selector"),dn("execute",_d),Ju("onEscape"),dn("captureTab",!1),Fa()],Dd,tt([Pl(Fl(yd),Ad(ng,eg)),Pl(Fl(wd),Md(ng,eg)),Pl(Fl(xd),Qm(og)),Pl(Fl(Sd),Zm(rg)),Pl(Il([Rl,Fl(pd)]),jd),Pl(Il([kd,Fl(pd)]),jd),Pl(Fl(vd),function(t,n,e){return e.onEscape(t,n)}),Pl(Fl(bd.concat(hd)),function(n,e,o,t){return(r=o).focusManager.get(n).bind(function(t){return Iu(t,r.selector)}).bind(function(t){return o.execute(n,e,t)});var r})]),tt([Pl(Fl(bd),Td)]),function(){return ft.some(Nd)}),ug=[Jt("selector"),dn("getInitial",ft.none),dn("execute",_d),Ju("onEscape"),dn("executeOnMove",!1),dn("allowVertical",!0)],ag=tt([Pl(Fl(bd),Td)]),cg=Cd(ug,uu.init,function(t,n,e,o){var r=yd.concat(e.allowVertical?xd:[]),i=wd.concat(e.allowVertical?Sd:[]);return[Pl(Fl(r),qd(Ad(Xd,Yd))),Pl(Fl(i),qd(Md(Xd,Yd))),Pl(Fl(hd),Ud),Pl(Fl(bd),Ud),Pl(Fl(vd),Kd)]},ag,function(){return ft.some(Gd)}),sg=[nn("selectors",[Jt("row"),Jt("cell")]),dn("cycles",!0),dn("previousSelector",ft.none),dn("execute",_d)],lg=em(function(t,n,e){return $d(t,n,e,-1)},function(t,n,e){return Zd(t,n,e,-1)}),fg=em(function(t,n,e){return $d(t,n,e,1)},function(t,n,e){return Zd(t,n,e,1)}),dg=em(function(t,n,e){return Qd(t,e,n,-1)},function(t,n,e){return tm(t,e,n,-1)}),mg=em(function(t,n,e){return Qd(t,e,n,1)},function(t,n,e){return tm(t,e,n,1)}),gg=tt([Pl(Fl(yd),Ad(lg,fg)),Pl(Fl(wd),Md(lg,fg)),Pl(Fl(xd),Qm(dg)),Pl(Fl(Sd),Zm(mg)),Pl(Fl(bd.concat(hd)),function(n,e,o){return Oa(n.element).bind(function(t){return o.execute(n,e,t)})})]),pg=tt([Pl(Fl(bd),Td)]),hg=Cd(sg,uu.init,gg,pg,function(){return ft.some(nm)}),vg=[Jt("selector"),dn("execute",_d),dn("moveOnTab",!1)],bg=tt([Pl(Fl(xd),tg(im)),Pl(Fl(Sd),tg(um)),Pl(Il([Rl,Fl(pd)]),function(t,n,e,o){return e.moveOnTab?tg(im)(t,n,e,o):ft.none()}),Pl(Il([kd,Fl(pd)]),function(t,n,e,o){return e.moveOnTab?tg(um)(t,n,e,o):ft.none()}),Pl(Fl(hd),om),Pl(Fl(bd),om)]),yg=tt([Pl(Fl(bd),Td)]),xg=Cd(vg,uu.init,bg,yg,function(){return ft.some(rm)}),wg=Cd([Ju("onSpace"),Ju("onEnter"),Ju("onShiftEnter"),Ju("onLeft"),Ju("onRight"),Ju("onTab"),Ju("onShiftTab"),Ju("onUp"),Ju("onDown"),Ju("onEscape"),dn("stopSpaceKeyup",!1),rn("focusIn")],uu.init,function(t,n,e){return[Pl(Fl(bd),e.onSpace),Pl(Il([kd,Fl(hd)]),e.onEnter),Pl(Il([Rl,Fl(hd)]),e.onShiftEnter),Pl(Il([Rl,Fl(pd)]),e.onShiftTab),Pl(Il([kd,Fl(pd)]),e.onTab),Pl(Fl(xd),e.onUp),Pl(Fl(Sd),e.onDown),Pl(Fl(yd),e.onLeft),Pl(Fl(wd),e.onRight),Pl(Fl(bd),e.onSpace),Pl(Fl(vd),e.onEscape)]},function(t,n,e){return e.stopSpaceKeyup?[Pl(Fl(bd),Td)]:[]},function(t){return t.focusIn}),Sg=Ym.schema(),kg=qm.schema(),Cg=cg.schema(),Og=ig.schema(),_g=hg.schema(),Tg=Km.schema(),Eg=xg.schema(),Dg=wg.schema(),Bg=wa({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:Sg,cyclic:kg,flow:Cg,flatgrid:Og,matrix:_g,execution:Tg,menu:Eg,special:Dg}),name:"keying",active:{events:function(t,n){return t.handler.toEvents(t,n)}},apis:{focusIn:function(n,e,o){e.sendFocusIn(e).fold(function(){n.getSystem().triggerFocus(n.element,n.element)},function(t){t(n,e,o)})},setGridSize:function(t,n,e,o,r){Ct(e,"setGridSize")?e.setGridSize(o,r):console.error("Layout does not support setGridSize")}},state:Jm}),Ag=function(t,n){return t.components()},Mg=xa({fields:[],name:"replacing",apis:Object.freeze({__proto__:null,append:function(t,n,e,o){am(t,0,Gi,o)},prepend:function(t,n,e,o){am(t,0,br,o)},remove:cm,replaceAt:sm,replaceBy:function(n,t,e,o,r){return P(Ag(n),o).bind(function(t){return sm(n,0,0,t,r)})},set:function(n,t,e,o){_a(function(){var t=A(o,n.getSystem().build);Ms(n,t)},n.element)},contents:Ag})}),Fg=Object.freeze({__proto__:null,focus:fm,blur:function(t,n){n.ignore||t.element.dom.blur()},isFocused:function(t){return ka(t.element)}}),Ig=Object.freeze({__proto__:null,exhibit:function(t,n){return Hr(n.ignore?{}:{attributes:{tabindex:"-1"}})},events:function(e){return Jo([Xe(Co(),function(t,n){fm(t,e),n.stop()})].concat(e.stopMousedown?[Xe(uo(),function(t,n){n.event.prevent()})]:[]))}}),Rg=xa({fields:[Ku("onFocus"),dn("stopMousedown",!1),dn("ignore",!1)],name:"focusing",active:Ig,apis:Fg}),Vg=Object.freeze({__proto__:null,onLoad:vm,toggle:gm,isOn:function(t,n,e){return e.get()},on:pm,off:hm,set:Um}),Pg=Object.freeze({__proto__:null,exhibit:function(){return Hr({})},events:function(t,n){var e,o,r,i=(e=t,o=n,r=gm,tr(function(t){r(t,e,o)})),u=ba(t,n,vm);return Jo(lt([t.toggleOnExecute?[i]:[],[u]]))}}),Hg=xa({fields:[dn("selected",!1),rn("toggleClass"),dn("toggleOnExecute",!0),mn("aria",{mode:"none"},qt("mode",{pressed:[dn("syncWithExpanded",!1),Zu("update",function(t,n,e){Or(t.element,"aria-pressed",e),n.syncWithExpanded&&Gm(t,0,e)})],checked:[Zu("update",function(t,n,e){Or(t.element,"aria-checked",e)})],expanded:[Zu("update",Gm)],selected:[Zu("update",function(t,n,e){Or(t.element,"aria-selected",e)})],none:[Zu("update",ct)]}))],name:"toggling",active:Pg,apis:Vg,state:{init:function(){var n=wn(!1);return{get:function(){return n.get()},set:function(t){return n.set(t)},clear:function(){return n.set(!1)},readState:function(){return n.get()}}}}}),zg="alloy.item-hover",Ng="alloy.item-focus",Lg=tt(zg),jg=tt(Ng),Wg=[Jt("data"),Jt("components"),Jt("dom"),dn("hasSubmenu",!1),rn("toggling"),Tf("itemBehaviours",[Hg,Rg,Bg,_f]),dn("ignoreFocus",!1),dn("domModification",{}),Zu("builder",function(t){return{dom:t.dom,domModification:st(st({},t.domModification),{attributes:st(st(st({role:t.toggling.isSome()?"menuitemcheckbox":"menuitem"},t.domModification.attributes),{"aria-haspopup":t.hasSubmenu}),t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Ef(t.itemBehaviours,[t.toggling.fold(Hg.revoke,function(t){return Hg.config(st({aria:{mode:"checked"}},t))}),Rg.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){wm(t)}}),Bg.config({mode:"execution"}),_f.config({store:{mode:"memory",initialValue:t.data}}),lm("item-type-events",H(H([],bm()),[Xe(lo(),xm),Xe(Do(),Rg.focus)]))]),components:t.components,eventOrder:t.eventOrder}}),dn("eventOrder",{})],Ug=[Jt("dom"),Jt("components"),Zu("builder",function(t){return{dom:t.dom,components:t.components,events:Jo([Xe(Do(),function(t,n){n.stop()})])}})],Gg=tt("item-widget"),Xg=tt([Yf({name:"widget",overrides:function(n){return{behaviours:Za([_f.config({store:{mode:"manual",getValue:function(t){return n.data},setValue:ct}})])}}})]),Yg=qt("type",{widget:[Jt("uid"),Jt("data"),Jt("components"),Jt("dom"),dn("autofocus",!1),dn("ignoreFocus",!1),Tf("widgetBehaviours",[_f,Rg,Bg]),dn("domModification",{}),vl(Xg()),Zu("builder",function(e){function o(t){return ll(t,e,"widget").map(function(t){return Bg.focusIn(t),t})}function t(t,n){return Sl(n.event.target)||e.autofocus&&n.setSource(t.element),ft.none()}var n=cl(Gg(),e,Xg()),r=sl(Gg(),e,n.internals());return{dom:e.dom,components:r,domModification:e.domModification,events:Jo([tr(function(t,n){o(t).each(function(t){n.stop()})}),Xe(lo(),xm),Xe(Do(),function(t,n){e.autofocus?o(t):Rg.focus(t)})]),behaviours:Ef(e.widgetBehaviours,[_f.config({store:{mode:"memory",initialValue:e.data}}),Rg.config({ignore:e.ignoreFocus,onFocus:function(t){wm(t)}}),Bg.config({mode:"special",focusIn:e.autofocus?function(t){o(t)}:ec(),onLeft:t,onRight:t,onEscape:function(t,n){return Rg.isFocused(t)||e.autofocus?(e.autofocus&&n.setSource(t.element),ft.none()):(Rg.focus(t),ft.some(!0))}})])}})],item:Wg,separator:Ug}),qg=tt([Jf({factory:{sketch:function(t){var n=Yt("menu.spec item",Yg,t);return n.builder(n)}},name:"items",unit:"item",defaults:function(t,n){return Kn(n,"uid")?n:st(st({},n),{uid:nu("item")})},overrides:function(t,n){return{type:n.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),Kg=tt([Jt("value"),Jt("items"),Jt("dom"),Jt("components"),dn("eventOrder",{}),Js("menuBehaviours",[md,_f,id,Bg]),mn("movement",{mode:"menu",moveOnTab:!0},qt("mode",{grid:[Fa(),Zu("config",function(t,n){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:n.initSize.numColumns,numRows:n.initSize.numRows},focusManager:t.focusManager}})],matrix:[Zu("config",function(t,n){return{mode:"matrix",selectors:{row:n.rowSelector,cell:"."+t.markers.item},focusManager:t.focusManager}}),Jt("rowSelector")],menu:[dn("moveOnTab",!0),Zu("config",function(t,n){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:n.moveOnTab,focusManager:t.focusManager}})]})),$t("markers",Ma()),dn("fakeFocus",!1),dn("focusManager",zl()),Ku("onHighlight")]),Jg=tt("alloy.menu-focus"),$g=wl({name:"Menu",configFields:Kg(),partFields:qg(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:Qs(t.menuBehaviours,[md.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight}),_f.config({store:{mode:"memory",initialValue:t.value}}),id.config({find:ft.some}),Bg.config(t.movement.config(t,t.movement))]),events:Jo([Xe(jg(),function(n,e){var t=e.event;n.getSystem().getByDom(t.target).each(function(t){md.highlight(n,t),e.stop(),Ne(n,Jg(),{menu:n,item:t})})}),Xe(Lg(),function(t,n){var e=n.event.item;md.highlight(t,e)})]),components:n,eventOrder:t.eventOrder,domModification:{attributes:{role:"menu"}}}}}),Qg=function(e,o,r,t){return kt(r,t).bind(function(t){return kt(e,t).bind(function(t){var n=Qg(e,o,r,t);return ft.some([t].concat(n))})}).getOr([])},Zg=function(){function a(t){return n(t).bind(Xm)}function e(t){return kt(c.get(),t)}var c=wn({}),i=wn({}),s=wn({}),l=fc(),u=wn({}),n=function(t){return kt(i.get(),t)};return{setMenuBuilt:function(t,n){var e;i.set(st(st({},i.get()),((e={})[t]={type:"prepared",menu:n},e)))},setContents:function(t,n,e,o){l.set(t),c.set(e),i.set(n),u.set(o);var r=function(t,n){var e={};bt(t,function(t,n){dt(t,function(t){e[t]=n})});var o=n,r=qn(n,function(t,n){return{k:t,v:n}}),i=yt(r,function(t,n){return[n].concat(Qg(e,o,r,n))});return yt(e,function(t){return kt(i,t).getOr([t])})}(o,e);s.set(r)},expand:function(e){return kt(c.get(),e).map(function(t){var n=kt(s.get(),e).getOr([]);return[t].concat(n)})},refresh:function(t){return kt(s.get(),t)},collapse:function(t){return kt(s.get(),t).bind(function(t){return 1<t.length?ft.some(t.slice(1)):ft.none()})},lookupMenu:n,lookupItem:e,otherMenus:function(t){var n=u.get();return j(Xn(n),t)},getPrimary:function(){return l.get().bind(a)},getMenus:function(){return i.get()},clear:function(){c.set({}),i.set({}),s.set({}),l.clear()},isClear:function(){return l.get().isNone()},getTriggeringPath:function(t,u){var n=F(e(t).toArray(),function(t){return a(t).isSome()});return kt(s.get(),t).bind(function(t){var e=L(n.concat(t));return function(t){for(var n=[],e=0;e<t.length;e++){var o=t[e];if(!o.isSome())return ft.none();n.push(o.getOrDie())}return ft.some(n)}(z(e,function(t,n){return o=t,r=u,i=e.slice(0,n+1),a(o).bind(function(n){return e=o,wt(c.get(),function(t,n){return t===e}).bind(function(t){return r(t).map(function(t){return{triggeredMenu:n,triggeringItem:t,triggeringPath:i}})});var e}).fold(function(){return Kr(l.get(),t)?[]:[ft.none()]},function(t){return[ft.some(t)]});var o,r,i}))})}}},tp=Xm,np=tt("collapse-item"),ep=xl({name:"TieredMenu",configFields:[Qu("onExecute"),Qu("onEscape"),$u("onOpenMenu"),$u("onOpenSubmenu"),Ku("onRepositionMenu"),Ku("onCollapseMenu"),dn("highlightImmediately",!0),nn("data",[Jt("primary"),Jt("menus"),Jt("expansions")]),dn("fakeFocus",!1),Ku("onHighlight"),Ku("onHover"),Xu(),Jt("dom"),dn("navigateOnHover",!0),dn("stayInDom",!1),Js("tmenuBehaviours",[Bg,md,id,Mg]),dn("eventOrder",{})],apis:{collapseMenu:function(t,n){t.collapseMenu(n)},highlightPrimary:function(t,n){t.highlightPrimary(n)},repositionMenus:function(t,n){t.repositionMenus(n)}},factory:function(a,t){function e(t){var o,r,n=(o=t,r=a.data.primary,yt(a.data.menus,function(t,n){function e(){return $g.sketch(st(st({},t),{value:n,markers:a.markers,fakeFocus:a.fakeFocus,onHighlight:a.onHighlight,focusManager:(a.fakeFocus?Nl:zl)()}))}return n===r?{type:"prepared",menu:o.getSystem().build(e())}:{type:"notbuilt",nbMenu:e}})),e=yt(a.data.menus,function(t,n){return z(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})});return g.setContents(a.data.primary,n,a.data.expansions,e),g.getPrimary()}function c(t){return _f.getValue(t).value}function u(n,t){md.highlight(n,t),md.getHighlighted(t).orThunk(function(){return md.getFirst(t)}).each(function(t){je(n,t.element,Do())})}function s(n,t){return Jr(A(t,function(t){return n.lookupMenu(t).bind(function(t){return"prepared"===t.type?ft.some(t.menu):ft.none()})}))}function l(n,t,e){var o=s(t,t.otherMenus(e));dt(o,function(t){qr(t.element,[a.markers.backgroundMenu]),a.stayInDom||Mg.remove(n,t)})}function f(t,o){var n;bt((n=t,r.get().getOrThunk(function(){var e={},t=F(gs(n.element,"."+a.markers.item),function(t){return"true"===_r(t,"aria-haspopup")});return dt(t,function(t){n.getSystem().getByDom(t).each(function(t){var n=c(t);e[n]=t})}),r.set(e),e})),function(t,n){var e=et(o,n);Or(t.element,"aria-expanded",e)})}function d(o,r,i){return ft.from(i[0]).bind(function(t){return r.lookupMenu(t).bind(function(t){if("notbuilt"===t.type)return ft.none();var n=t.menu,e=s(r,i.slice(1));return dt(e,function(t){Ur(t.element,a.markers.backgroundMenu)}),du(n.element)||Mg.append(o,yu(n)),qr(n.element,[a.markers.backgroundMenu]),u(o,n),l(o,r,i),ft.some(n)})})}var m,n,r=fc(),g=Zg();function i(r,i,u){if(void 0===u&&(u=m.HighlightSubmenu),i.hasConfigured(fd)&&fd.isDisabled(i))return ft.some(i);var t=c(i);return g.expand(t).bind(function(o){return f(r,o),ft.from(o[0]).bind(function(e){return g.lookupMenu(e).bind(function(t){var n=function(t,n,e){if("notbuilt"!==e.type)return e.menu;var o=t.getSystem().build(e.nbMenu());return g.setMenuBuilt(n,o),o}(r,e,t);return du(n.element)||Mg.append(r,yu(n)),a.onOpenSubmenu(r,i,n,L(o)),u===m.HighlightSubmenu?(md.highlightFirst(n),d(r,g,o)):(md.dehighlightAll(n),ft.some(i))})})})}function o(n,e){var t=c(e);return g.collapse(t).bind(function(t){return f(n,t),d(n,g,t).map(function(t){return a.onCollapseMenu(n,e,t),t})})}function p(e){return function(n,t){return Iu(t.getSource(),"."+a.markers.item).bind(function(t){return n.getSystem().getByDom(t).toOptional().bind(function(t){return e(n,t).map(_)})})}}function h(t){return md.getHighlighted(t).bind(md.getHighlighted)}(n=m={})[n.HighlightSubmenu=0]="HighlightSubmenu",n[n.HighlightParent=1]="HighlightParent";var v=Jo([Xe(Jg(),function(e,o){var t=o.event.item;g.lookupItem(c(t)).each(function(){var t=o.event.menu;md.highlight(e,t);var n=c(o.event.item);g.refresh(n).each(function(t){return l(e,g,t)})})}),tr(function(n,t){var e=t.event.target;n.getSystem().getByDom(e).each(function(t){0===c(t).indexOf("collapse-item")&&o(n,t),i(n,t,m.HighlightSubmenu).fold(function(){a.onExecute(n,t)},ct)})}),$o(function(n,t){e(n).each(function(t){Mg.append(n,yu(t)),a.onOpenMenu(n,t),a.highlightImmediately&&u(n,t)})})].concat(a.navigateOnHover?[Xe(Lg(),function(t,n){var e=n.event.item,o=t,r=c(e);g.refresh(r).bind(function(t){return f(o,t),d(o,g,t)}),i(t,e,m.HighlightParent),a.onHover(t,e)})]:[])),b={collapseMenu:function(n){h(n).each(function(t){o(n,t)})},highlightPrimary:function(n){g.getPrimary().each(function(t){u(n,t)})},repositionMenus:function(o){g.getPrimary().bind(function(n){return h(o).bind(function(t){var n=c(t),e=Jr(A(St(g.getMenus()),tp));return g.getTriggeringPath(n,function(t){return n=t,q(e,function(t){return t.getSystem().isConnected()?V(md.getCandidates(t),function(t){return c(t)===n}):ft.none()});var n})}).map(function(t){return{primary:n,triggeringPath:t}})}).fold(function(){ft.from(o.components()[0]).filter(function(t){return"menu"===_r(t.element,"role")}).each(function(t){a.onRepositionMenu(o,t,[])})},function(t){var n=t.primary,e=t.triggeringPath;a.onRepositionMenu(o,n,e)})}};return{uid:a.uid,dom:a.dom,markers:a.markers,behaviours:Qs(a.tmenuBehaviours,[Bg.config({mode:"special",onRight:p(function(t,n){return Sl(n.element)?ft.none():i(t,n,m.HighlightSubmenu)}),onLeft:p(function(t,n){return Sl(n.element)?ft.none():o(t,n)}),onEscape:p(function(t,n){return o(t,n).orThunk(function(){return a.onEscape(t,n).map(function(){return t})})}),focusIn:function(n,t){g.getPrimary().each(function(t){je(n,t.element,Do())})}}),md.config({highlightClass:a.markers.selectedMenu,itemClass:a.markers.menu}),id.config({find:function(t){return md.getHighlighted(t)}}),Mg.config({})]),eventOrder:a.eventOrder,apis:b,events:v}},extraApis:{tieredData:function(t,n,e){return{primary:t,menus:n,expansions:e}},singleData:function(t,n){return{primary:t,menus:Ae(t,n),expansions:{}}},collapseItem:function(t){return{value:Ar(np()),meta:{text:t}}}}}),op=xl({name:"InlineView",configFields:[Jt("lazySink"),Ku("onShow"),Ku("onHide"),sn("onEscape"),Js("inlineBehaviours",[pf,_f,oc]),fn("fireDismissalEventInstead",[dn("event",Lo())]),fn("fireRepositionEventInstead",[dn("event",jo())]),dn("getRelated",ft.none),dn("isExtraPart",O),dn("eventOrder",ft.none)],factory:function(d,t){function n(e){pf.isOpen(e)&&_f.getValue(e).each(function(t){switch(t.mode){case"menu":pf.getState(e).each(ep.repositionMenus);break;case"position":var n=d.lazySink(e).getOrDie();cf.positionWithinBounds(n,e,t.config,t.getBounds())}})}function o(t,n,e,o){i(t,n,e,function(){return o.map(Ai)})}function r(t,n,e,o){var r,i,u,a,c,s=(r=d,i=t,u=n,a=o,c="horizontal"===e.type?{layouts:{onLtr:ha,onRtl:va}}:{},ep.sketch({dom:{tag:"div"},data:e.data,markers:e.menu.markers,highlightImmediately:e.menu.highlightImmediately,onEscape:function(){return pf.close(i),r.onEscape.map(function(t){return t(i)}),ft.some(!0)},onExecute:function(){return ft.some(!0)},onOpenMenu:function(t,n){cf.positionWithinBounds(l().getOrDie(),n,u,a())},onOpenSubmenu:function(t,n,e,o){var r=l().getOrDie();cf.position(r,e,{anchor:st({type:"submenu",item:n},f(o))})},onRepositionMenu:function(t,n,e){var o=l().getOrDie();cf.positionWithinBounds(o,n,u,a()),dt(e,function(t){var n=f(t.triggeringPath);cf.position(o,t.triggeredMenu,{anchor:st({type:"submenu",item:t.triggeringItem},n)})})}}));function l(){return r.lazySink(i)}function f(t){return 2===t.length?c:{}}pf.open(t,s),_f.setValue(t,ft.some({mode:"menu",menu:s}))}var i=function(t,n,e,o){var r=d.lazySink(t).getOrDie();pf.openWhileCloaked(t,n,function(){return cf.positionWithinBounds(r,t,e,o())}),_f.setValue(t,ft.some({mode:"position",config:e,getBounds:o}))},e={setContent:function(t,n){pf.setContent(t,n)},showAt:function(t,n,e){o(t,n,e,ft.none())},showWithin:o,showWithinBounds:i,showMenuAt:function(t,n,e){r(t,n,e,ft.none)},showMenuWithinBounds:r,hide:function(t){pf.isOpen(t)&&(_f.setValue(t,ft.none()),pf.close(t))},getContent:function(t){return pf.getState(t)},reposition:n,isOpen:pf.isOpen};return{uid:d.uid,dom:d.dom,behaviours:Qs(d.inlineBehaviours,[pf.config({isPartOf:function(t,n,e){return Hu(n,e)||(o=e,d.getRelated(t).exists(function(t){return Hu(t,o)}));var o},getAttachPoint:function(t){return d.lazySink(t).getOrDie()},onOpen:function(t){d.onShow(t)},onClose:function(t){d.onHide(t)}}),_f.config({store:{mode:"memory",initialValue:ft.none()}}),oc.config({channels:st(st({},Ws(st({isExtraPart:t.isExtraPart},d.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Us(st(st({},d.fireRepositionEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})),{doReposition:n})))})]),eventOrder:d.eventOrder,apis:e}},apis:{showAt:function(t,n,e,o){t.showAt(n,e,o)},showWithin:function(t,n,e,o,r){t.showWithin(n,e,o,r)},showWithinBounds:function(t,n,e,o,r){t.showWithinBounds(n,e,o,r)},showMenuAt:function(t,n,e,o){t.showMenuAt(n,e,o)},showMenuWithinBounds:function(t,n,e,o,r){t.showMenuWithinBounds(n,e,o,r)},hide:function(t,n){t.hide(n)},isOpen:function(t,n){return t.isOpen(n)},getContent:function(t,n){return t.getContent(n)},setContent:function(t,n,e){t.setContent(n,e)},reposition:function(t,n){t.reposition(n)}}}),rp="layout-inset",ip=function(t,n,e){return na(Sm(t,n),t.y,e.insetNorth(),za(),"north",ra(t,{top:2}),rp)},up=function(t,n,e){return na(Sm(t,n),Cm(t,n),e.insetSouth(),Na(),"south",ra(t,{bottom:3}),rp)},ap=tinymce.util.Tools.resolve("tinymce.util.Delay"),cp=xl({name:"Button",factory:function(t){function e(n){return kt(t.dom,"attributes").bind(function(t){return kt(t,n)})}var n=ym(t.action),o=t.dom.tag;return{uid:t.uid,dom:t.dom,components:t.components,events:n,behaviours:Ef(t.buttonBehaviours,[Rg.config({}),Bg.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==o)return{role:e("role").getOr("button")};var t=e("type").getOr("button"),n=e("role").map(function(t){return{role:t}}).getOr({});return st({type:t},n)}()},eventOrder:t.eventOrder}},configFields:[dn("uid",void 0),Jt("dom"),dn("components",[]),Tf("buttonBehaviours",[Rg,Bg]),rn("action"),rn("role"),dn("eventOrder",{})]}),sp=tinymce.util.Tools.resolve("tinymce.util.I18n"),lp={indent:!0,outdent:!0,"table-insert-column-after":!0,"table-insert-column-before":!0,"paste-column-after":!0,"paste-column-before":!0,"unordered-list":!0,"list-bull-circle":!0,"list-bull-default":!0,"list-bull-square":!0},fp="temporary-placeholder",dp={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},mp=xl({name:"Notification",factory:function(n){function e(t){return{dom:{tag:"div",classes:["tox-bar"],attributes:{style:"width: "+t+"%"}}}}function o(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:t+"%"}}}var t,r,i,u,a=Vm({dom:{tag:"p",innerHtml:n.translationProvider(n.text)},behaviours:Za([Mg.config({})])}),c=Vm({dom:{tag:"div",classes:n.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[e(0)]},o(0)],behaviours:Za([Mg.config({})])}),s={updateProgress:function(t,n){t.getSystem().isConnected()&&c.getOpt(t).each(function(t){Mg.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[e(n)]},o(n)])})},updateText:function(t,n){var e;t.getSystem().isConnected()&&(e=a.get(t),Mg.set(e,[pi(n)]))}},l=lt([n.icon.toArray(),n.level.toArray(),n.level.bind(function(t){return ft.from(dp[t])}).toArray()]),f=Vm(cp.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"]},components:[Wm("close",{tag:"div",classes:["tox-icon"],attributes:{"aria-label":n.translationProvider("Close")}},n.iconProvider)],action:function(t){n.onAction(t)}})),d=[(t=l,r={tag:"div",classes:["tox-notification__icon"]},i=n.iconProvider,u=i(),jm(r,V(t,function(t){return Kn(u,Hm(t,u))}).getOr(fp),u,ft.none())),{dom:{tag:"div",classes:["tox-notification__body"]},components:[a.asSpec()],behaviours:Za([Mg.config({})])}];return{uid:n.uid,dom:{tag:"div",attributes:{role:"alert"},classes:n.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--"+t]}).getOr(["tox-notification","tox-notification--in"])},behaviours:Za([Rg.config({}),lm("notification-events",[Xe(fo(),function(t){f.getOpt(t).each(Rg.focus)})])]),components:d.concat(n.progress?[c.asSpec()]:[]).concat(n.closeButton?[f.asSpec()]:[]),apis:s}},configFields:[rn("level"),Jt("progress"),Jt("icon"),Jt("onAction"),Jt("text"),Jt("iconProvider"),Jt("translationProvider"),vn("closeButton",!0)],apis:{updateProgress:function(t,n,e){t.updateProgress(n,e)},updateText:function(t,n,e){t.updateText(n,e)}}});function gp(e,o){function r(){b(i)||(clearTimeout(i),i=null)}var i=null;return{cancel:r,throttle:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r(),i=setTimeout(function(){i=null,e.apply(null,t)},o)}}}function pp(o,t,n,e,r){var i=Tp(o,function(t){return(n=o).isBlock(e=t)||et(["BR","IMG","HR","INPUT"],e.nodeName)||"false"===n.getContentEditable(e);var n,e});return ft.from(i.backwards(t,n,e,r))}function hp(e,n){return Ep(de.fromDom(e.selection.getNode())).getOrThunk(function(){var i,u,t=de.fromHtml('<span data-mce-autocompleter="1" data-mce-bogus="1"></span>',e.getDoc());return Gi(t,de.fromDom(n.extractContents())),n.insertNode(t.dom),ar(t).each(function(t){return t.dom.normalize()}),i=ms,(u=function(t){for(var n=sr(t),e=n.length-1;0<=e;e--){var o=n[e];if(i(o))return ft.some(o);var r=u(o);if(r.isSome())return r}return ft.none()})(t).map(function(t){var n;e.selection.setCursorLocation(t.dom,"img"===nr(n=t)?1:ds(n).fold(function(){return sr(n).length},function(t){return t.length}))}),t})}function vp(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")}function bp(t){return""!==t&&-1!==" \xa0\f\n\r\t\v".indexOf(t)}function yp(t,n){return t.substring(n.length)}function xp(o,t,r,n){return void 0===n&&(n=0),Ep(de.fromDom(t.startContainer)).fold(function(){return function(t,o,i,r){if(void 0===r&&(r=0),!o.collapsed||3!==o.startContainer.nodeType)return ft.none();var n=t.getParent(o.startContainer,t.isBlock)||t.getRoot();return pp(t,o.startContainer,o.startOffset,function(t,r,n){return function(t,n){for(var e=r-1;0<=e;e--){var o=t.charAt(e);if(bp(o))return ft.none();if(o===n)break}return ft.some(e)}(n,i).getOr(r)},n).bind(function(t){var n=o.cloneRange();if(n.setStart(t.container,t.offset),n.setEnd(o.endContainer,o.endOffset),n.collapsed)return ft.none();var e=vp(n);return 0!==e.lastIndexOf(i)||yp(e,i).length<r?ft.none():ft.some({text:yp(e,i),range:n,triggerChar:i})})}(o,t,r,n)},function(t){var n=o.createRng();n.selectNode(t.dom);var e=vp(n);return ft.some({range:n,text:yp(e,r),triggerChar:r})})}function wp(t,n){return{container:t,offset:n}}function Sp(t){return Gt("toolbarbutton",Vp,t)}function kp(t){return Gt("ToggleButton",Hp,t)}function Cp(n,t,e,o){void 0===o&&(o={});var r=t(),i=n.selection.getRng().startContainer.nodeValue,u=F(r.lookupByChar(e.triggerChar),function(t){return e.text.length>=t.minChars&&t.matches.getOrThunk(function(){return e=n.dom,function(t){var n=Ap(t.startContainer,t.startOffset);return!pp(e,n.container,n.offset,function(t,n){return 0===n?-1:n},e.getRoot()).filter(function(t){return!bp(t.container.data.charAt(t.offset-1))}).isSome()};var e})(e.range,i,e.text)});if(0===u.length)return ft.none();var a=Dp.all(A(u,function(n){return n.fetch(e.text,n.maxResults,o).then(function(t){return{matchText:e.text,items:t,columns:n.columns,onAction:n.onAction,highlightOn:n.highlightOn}})}));return ft.some({lookupData:a,context:e})}var Op,_p,Tp=tinymce.util.Tools.resolve("tinymce.dom.TextSeeker"),Ep=function(t){return Iu(t,"[data-mce-autocompleter]")},Dp=tinymce.util.Tools.resolve("tinymce.util.Promise"),Bp=function(t){if(3===t.nodeType)return wp(t,t.data.length);var n=t.childNodes;return 0<n.length?Bp(n[n.length-1]):wp(t,n.length)},Ap=function(t,n){var e=t.childNodes;return 0<e.length&&n<e.length?Ap(e[n],0):0<e.length&&1===t.nodeType&&e.length===n?Bp(e[e.length-1]):wp(t,n)},Mp=te([Qt("type"),cn("text")]),Fp=te([dn("type","autocompleteitem"),dn("active",!1),dn("disabled",!1),dn("meta",{}),Qt("value"),cn("text"),cn("icon")]),Ip=te([Qt("type"),Qt("ch"),gn("minChars",1),dn("columns",1),gn("maxResults",10),sn("matches"),tn("fetch"),tn("onAction"),yn("highlightOn",[],re)]),Rp=[vn("disabled",!1),cn("tooltip"),cn("icon"),cn("text"),bn("onSetup",function(){return ct})],Vp=te([Qt("type"),tn("onAction")].concat(Rp)),Pp=[vn("active",!1)].concat(Rp),Hp=te(Pp.concat([Qt("type"),tn("onAction")])),zp=[bn("predicate",O),hn("scope","node",["node","editor"]),hn("position","selection",["node","selection","line"])],Np=Rp.concat([dn("type","contextformbutton"),dn("primary",!1),tn("onAction"),fe("original",h)]),Lp=Pp.concat([dn("type","contextformbutton"),dn("primary",!1),tn("onAction"),fe("original",h)]),jp=Rp.concat([dn("type","contextformbutton")]),Wp=Pp.concat([dn("type","contextformtogglebutton")]),Up=qt("type",{contextformbutton:Np,contextformtogglebutton:Lp}),Gp=te([dn("type","contextform"),bn("initValue",tt("")),cn("label"),on("commands",Up),un("launch",qt("type",{contextformbutton:jp,contextformtogglebutton:Wp}))].concat(zp)),Xp=te([dn("type","contexttoolbar"),Qt("items")].concat(zp));function Yp(t){return kt(kh,t).getOr(xh)}function qp(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:"color"===t?"tox-swatches":"tox-menu",tieredMenu:"tox-tiered-menu"}}function Kp(t){var n=qp(t);return{backgroundMenu:n.backgroundMenu,selectedMenu:n.selectedMenu,menu:n.menu,selectedItem:n.selectedItem,item:Yp(t)}}function Jp(t,n,e){return{dom:{tag:"div",classes:lt([[qp(e).tieredMenu]])},markers:Kp(e)}}function $p(n,e){return function(t){return A(B(t,e),function(t){return{dom:n,components:t}})}}function Qp(t,e){var o=[],r=[];return dt(t,function(t,n){e(t,n)?(0<r.length&&o.push(r),r=[],Kn(t.dom,"innerHtml")&&r.push(t)):r.push(t)}),0<r.length&&o.push(r),A(o,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}})}function Zp(n,e){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===n?["tox-collection--list"]:["tox-collection--grid"])},components:[$g.parts.items({preprocess:function(t){return"auto"!==n&&1<n?$p({tag:"div",classes:["tox-collection__group"]},n)(t):Qp(t,function(t,n){return"separator"===e[n].type})}})]}}function th(t){return T(t,function(t){return"icon"in t&&void 0!==t.icon})}function nh(t){return console.error(se(t)),console.log(t),ft.none()}function eh(t,n,e,o,r){var i,u=(i=e,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[$g.parts.items({preprocess:function(t){return Qp(t,function(t,n){return"separator"===i[n].type})}})]});return{value:t,dom:u.dom,components:u.components,items:e}}function oh(t,n,e,o,r){var i,u;return"color"===r?{value:t,dom:(i={dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[$g.parts.items({preprocess:"auto"!==o?$p({tag:"div",classes:["tox-swatches__row"]},o):h})]}]}).dom,components:i.components,items:e}:"normal"===r&&"auto"===o?{value:t,dom:(i=Zp(o,e)).dom,components:i.components,items:e}:"normal"===r&&1===o?{value:t,dom:(i=Zp(1,e)).dom,components:i.components,items:e}:"normal"===r?{value:t,dom:(i=Zp(o,e)).dom,components:i.components,items:e}:"listpreview"!==r||"auto"===o?{value:t,dom:{tag:"div",classes:lt([[(u=qp(r)).menu,"tox-menu-"+o+"-column"],n?[u.hasIcons]:[]])},components:Ah,items:e}:{value:t,dom:(i={dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[$g.parts.items({preprocess:$p({tag:"div",classes:["tox-collection__group"]},o)})]}).dom,components:i.components,items:e}}function rh(t,o,n){var r=gs(t.element,"."+n);if(0<r.length){var e=P(r,function(t){var n=t.dom.getBoundingClientRect().top,e=r[0].dom.getBoundingClientRect().top;return Math.abs(n-e)>o}).getOr(r.length);return ft.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return ft.none()}function ih(t,n,e){t.getSystem().broadcastOn([Yh],{})}function uh(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))}function ah(t){return t.getParam("width",Zh.DOM.getStyle(t.getElement(),"width"))}function ch(t){return ft.from(t.getParam("min_width")).filter(u)}function sh(t){return ft.from(t.getParam("min_height")).filter(u)}function lh(t){return ft.from(t.getParam("max_width")).filter(u)}function fh(t){return ft.from(t.getParam("max_height")).filter(u)}function dh(t){return!1!==t.getParam("menubar",!0,"boolean")}function mh(t){var n=t.getParam("toolbar",!0),e=!0===n,o=y(n),r=c(n)&&0<n.length;return!nv(t)&&(r||o||e)}function gh(n){var t=F(D(9,function(t){return n.getParam("toolbar"+(t+1),!1,"string")}),function(t){return"string"==typeof t});return 0<t.length?ft.some(t):ft.none()}(_p=Op={})[_p.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",_p[_p.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var ph,hh,vh,bh,yh=Op,xh="tox-menu-nav__js",wh="tox-collection__item",Sh="tox-swatch",kh={normal:xh,color:Sh},Ch="tox-collection__item--enabled",Oh="tox-collection__item-icon",_h="tox-collection__item-label",Th="tox-collection__item-caret",Eh="tox-collection__item--active",Dh="tox-collection__item-container",Bh="tox-collection__item-container--row",Ah=[$g.parts.items({})],Mh=[Qt("type"),Qt("src"),cn("alt"),yn("classes",[],re)],Fh=te(Mh),Ih=[Qt("type"),Qt("text"),cn("name"),yn("classes",["tox-collection__item-label"],re)],Rh=te(Ih),Vh=Pt(function(){return jt("type",{cardimage:Fh,cardtext:Rh,cardcontainer:Ph})}),Ph=te([Qt("type"),pn("direction","horizontal"),pn("align","left"),pn("valign","middle"),on("items",Vh)]),Hh=[vn("disabled",!1),cn("text"),cn("shortcut"),le("value","value",Et(function(){return Ar("menuitem-value")}),ee()),dn("meta",{})],zh=te([Qt("type"),cn("label"),on("items",Vh),bn("onSetup",function(){return ct}),bn("onAction",ct)].concat(Hh)),Nh=te([Qt("type"),vn("active",!1),cn("icon")].concat(Hh)),Lh=[Qt("type"),Qt("fancytype"),bn("onAction",ct)],jh=qt("fancytype",{inserttable:[dn("initData",{})].concat(Lh),colorswatch:[xn("initData",{},[vn("allowCustomColors",!0),ln("colors",ee())])].concat(Lh)}),Wh=te([Qt("type"),bn("onSetup",function(){return ct}),bn("onAction",ct),cn("icon")].concat(Hh)),Uh=te([Qt("type"),tn("getSubmenuItems"),bn("onSetup",function(){return ct}),cn("icon")].concat(Hh)),Gh=te([Qt("type"),cn("icon"),vn("active",!1),bn("onSetup",function(){return ct}),tn("onAction")].concat(Hh)),Xh=function(t){return n=Ar("unnamed-events"),Za([lm(n,t)]);var n},Yh=Ar("tooltip.exclusive"),qh=Ar("tooltip.show"),Kh=Ar("tooltip.hide"),Jh=Object.freeze({__proto__:null,hideAllExclusive:ih,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&Mg.set(t,o)})}}),$h=Object.freeze({__proto__:null,events:function(r,i){function e(n){i.getTooltip().each(function(t){Rs(t),r.onHide(n,t),i.clearTooltip()}),i.clearTimer()}return Jo(lt([[Xe(qh,function(o){i.resetTimer(function(){var t,n,e=o;i.isShowing()||(ih(e),t=r.lazySink(e).getOrDie(),n=e.getSystem().build({dom:r.tooltipDom,components:r.tooltipComponents,events:Jo("normal"===r.mode?[Xe(lo(),function(t){ze(e,qh)}),Xe(co(),function(t){ze(e,Kh)})]:[]),behaviours:Za([Mg.config({})])}),i.setTooltip(n),Fs(t,n),r.onShow(e,n),cf.position(t,n,{anchor:r.anchor(e)}))},r.delay)}),Xe(Kh,function(t){i.resetTimer(function(){e(t)},r.delay)}),Xe(To(),function(t,n){n.universal||et(n.channels,Yh)&&e(t)}),Qo(function(t){e(t)})],"normal"===r.mode?[Xe(fo(),function(t){ze(t,qh)}),Xe(Oo(),function(t){ze(t,Kh)}),Xe(lo(),function(t){ze(t,qh)}),Xe(co(),function(t){ze(t,Kh)})]:[Xe(Yo(),function(t,n){ze(t,qh)}),Xe(qo(),function(t){ze(t,Kh)})]]))}}),Qh=xa({fields:[Jt("lazySink"),Jt("tooltipDom"),dn("exclusive",!0),dn("tooltipComponents",[]),dn("delay",300),hn("mode","normal",["normal","follow-highlight"]),dn("anchor",function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:tt([Ka,qa,Ua,Xa,Ga,Ya]),onRtl:tt([Ka,qa,Ua,Xa,Ga,Ya])}}}),Ku("onHide"),Ku("onShow")],name:"tooltipping",active:$h,state:Object.freeze({__proto__:null,init:function(){function e(){o.on(clearTimeout)}var o=fc(),t=fc(),n=tt("not-implemented");return au({getTooltip:t.get,isShowing:t.isSet,setTooltip:t.set,clearTooltip:t.clear,clearTimer:e,resetTimer:function(t,n){e(),o.set(setTimeout(t,n))},readState:n})}}),apis:Jh}),Zh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),tv=tinymce.util.Tools.resolve("tinymce.EditorManager"),nv=function(t){return gh(t).fold(function(){return 0<t.getParam("toolbar",[],"string[]").length},_)};function ev(t){return t.getParam("toolbar_mode","","string")}function ov(t){return t.getParam("toolbar_location",vh.auto,"string")}function rv(t){return ov(t)===vh.bottom}function iv(t){if(!t.inline)return ft.none();var n=t.getParam("fixed_toolbar_container","","string");if(0<n.length)return Fu(mu(),n);var e=t.getParam("fixed_toolbar_container_target");return f(e)?ft.some(de.fromDom(e)):ft.none()}function uv(t){return t.inline&&iv(t).isSome()}function av(t){return iv(t).getOrThunk(function(){return gr(ji(de.fromDom(t.getElement())))})}function cv(t){return t.inline&&!dh(t)&&!mh(t)&&!nv(t)}function sv(t){return(t.getParam("toolbar_sticky",!1,"boolean")||t.inline)&&!uv(t)&&!cv(t)}function lv(t,n){var e=t.outerContainer.element;n&&(t.mothership.broadcastOn([hf()],{target:e}),t.uiMothership.broadcastOn([hf()],{target:e})),t.mothership.broadcastOn([Xv],{readonly:n}),t.uiMothership.broadcastOn([Xv],{readonly:n})}function fv(t,n){t.on("init",function(){t.mode.isReadOnly()&&lv(n,!0)}),t.on("SwitchMode",function(){return lv(n,t.mode.isReadOnly())}),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly")}function dv(){var t;return oc.config({channels:((t={})[Xv]={schema:Yv,onReceive:function(t,n){fd.set(t,n.readonly)}},t)})}function mv(t,n){var e=t.getApi(n);return function(t){t(e)}}function gv(e,o){return $o(function(t){mv(e,t)(function(t){var n=e.onSetup(t);m(n)&&o.set(n)})})}function pv(n,e){return Qo(function(t){return mv(n,t)(e.get())})}function hv(t,n,e,o){var r,i,u=wn(ct);return{type:"item",dom:n.dom,components:$v(n.optComponents),data:t.data,eventOrder:Jv,hasSubmenu:t.triggersSubmenu,itemBehaviours:Za([lm("item-events",[(r=t,i=e,tr(function(t,n){mv(r,t)(r.onAction),r.triggersSubmenu||i!==yh.CLOSE_ON_EXECUTE||(ze(t,Mo()),n.stop())})),gv(t,u),pv(t,u)]),fd.config({disabled:function(){return t.disabled||o.isDisabled()},disableClass:"tox-collection__item--state-disabled"}),dv(),Mg.config({})].concat(t.itemBehaviours))}}function vv(t){return{value:t.value,meta:st({text:t.text.getOr("")},t.meta)}}function bv(t,n,e){return Wm(t,{tag:"div",classes:e=void 0===e?[Oh]:e},n)}function yv(t){return{dom:{tag:"div",classes:[_h]},components:[pi(sp.translate(t))]}}function xv(t,n){return{dom:{tag:"div",classes:n,innerHtml:t}}}function wv(t,n){return{dom:{tag:"div",classes:[_h]},components:[{dom:{tag:t.tag,styles:t.styles},components:[pi(sp.translate(n))]}]}}function Sv(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"],innerHtml:(e=Qv.mac?{alt:"&#x2325;",ctrl:"&#x2303;",shift:"&#x21E7;",meta:"&#x2318;",access:"&#x2303;&#x2325;"}:{meta:"Ctrl",access:"Shift+Alt"},n=A(t.split("+"),function(t){var n=t.toLowerCase().trim();return Kn(e,n)?e[n]:t}),Qv.mac?n.join(""):n.join("+"))}};var e,n}function kv(t){return bv("checkmark",t,["tox-collection__item-checkmark"])}function Cv(t){var n=t.map(function(t){return{attributes:{title:sp.translate(t)}}}).getOr({});return st({tag:"div",classes:[xh,wh]},n)}function Ov(t,n,e,o){return void 0===o&&(o=ft.none()),"color"===t.presets?(r=n,i=o,c=t.ariaLabel,s=t.value,{dom:(u=t.iconContent.map(function(t){return n=r.icons,e=i,zm(t,o=n()).or(e).getOrThunk(Pm(o));var n,e,o}).getOr(""),a={tag:"div",attributes:c.map(function(t){return{title:r.translate(t)}}).getOr({}),classes:["tox-swatch"]},st(st({},a),"custom"===s?{tag:"button",classes:H(H([],a.classes),["tox-swatches__picker-btn"]),innerHtml:u}:"remove"===s?{classes:H(H([],a.classes),["tox-swatch--remove"]),innerHtml:u}:{attributes:st(st({},a.attributes),{"data-mce-color":s}),styles:{"background-color":s}})),optComponents:[]}):(l=t,f=n,d=o,m={tag:"div",classes:[Oh]},g=e?l.iconContent.map(function(t){return Wm(t,m,f.icons,d)}).orThunk(function(){return ft.some({dom:m})}):ft.none(),p=l.checkMark,h=ft.from(l.meta).fold(function(){return yv},function(t){return Kn(t,"style")?S(wv,t.style):yv}),v=l.htmlContent.fold(function(){return l.textContent.map(h)},function(t){return ft.some(xv(t,[_h]))}),{dom:Cv(l.ariaLabel),optComponents:[g,v,l.shortcutContent.map(Sv),p,l.caret]});var r,i,u,a,c,s,l,f,d,m,g,p,h,v}function _v(t,n){return kt(t,"tooltipWorker").map(function(e){return[Qh.config({lazySink:n.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:Fc}}},mode:"follow-highlight",onShow:function(n,t){e(function(t){Qh.setComponents(n,[hu({element:de.fromDom(t)})])})}})]}).getOr([])}function Tv(t,n){var e=sp.translate(t),o=Zh.DOM.encode(e);if(0<n.length){var r=new RegExp(n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");return o.replace(r,function(t){return'<span class="tox-autocompleter-highlight">'+t+"</span>"})}return o}function Ev(t){return{value:t}}function Dv(t){return nb.test(t)||eb.test(t)}function Bv(t){var n=t.toString(16);return(1===n.length?"0"+n:n).toUpperCase()}function Av(t){return Ev(Bv(t.red)+Bv(t.green)+Bv(t.blue))}function Mv(t,n,e,o){return{red:t,green:n,blue:e,alpha:o}}function Fv(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255}function Iv(t){var n,e,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100,i=rb(0,ob(i,1)),u=rb(0,ob(u,1));if(0===i)return Mv(n=e=o=ib(255*u),e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:n=c,e=s,o=0;break;case 1:n=s,e=c,o=0;break;case 2:n=0,e=c,o=s;break;case 3:n=0,e=s,o=c;break;case 4:n=s,e=0,o=c;break;case 5:n=c,e=0,o=s;break;default:n=e=o=0}return Mv(n=ib(255*(n+l)),e=ib(255*(e+l)),o=ib(255*(o+l)),1)}function Rv(t){var n,e,o=(n={value:t.value.replace(nb,function(t,n,e,o){return n+n+e+e+o+o})},null===(e=eb.exec(n.value))?["FFFFFF","FF","FF","FF"]:e);return Mv(parseInt(o[1],16),parseInt(o[2],16),parseInt(o[3],16),1)}function Vv(t,n,e,o){return Mv(parseInt(t,10),parseInt(n,10),parseInt(e,10),parseFloat(o))}function Pv(t){if("transparent"===t)return ft.some(Mv(0,0,0,0));var n=ub.exec(t);if(null!==n)return ft.some(Vv(n[1],n[2],n[3],"1"));var e=ab.exec(t);return null!==e?ft.some(Vv(e[1],e[2],e[3],e[4])):ft.none()}function Hv(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"}function zv(t,n){return t.fire("ResizeContent",n)}function Nv(t,n,e){return{hue:t,saturation:n,value:e}}function Lv(t){var n,e,o=0,r=t.red/255,i=t.green/255,u=t.blue/255,a=Math.min(r,Math.min(i,u)),c=Math.max(r,Math.max(i,u));return a===c?Nv(0,0,100*(o=a)):(e=60*((r===a?3:u===a?1:5)-(r===a?i-u:u===a?r-i:u-r)/(c-a)),n=(c-a)/c,o=c,Nv(Math.round(e),Math.round(100*n),Math.round(100*o)))}function jv(t){return Av(Iv(t))}function Wv(o){return(Dv(n=o)?ft.some({value:(pe(t=n,"#")?t.substring("#".length):t).toUpperCase()}):ft.none()).orThunk(function(){return Pv(o).map(Av)}).getOrThunk(function(){var t=document.createElement("canvas");t.height=1,t.width=1;var n=t.getContext("2d");n.clearRect(0,0,t.width,t.height),n.fillStyle="#FFFFFF",n.fillStyle=o,n.fillRect(0,0,1,1);var e=n.getImageData(0,0,1,1).data;return Av(Mv(e[0],e[1],e[2],e[3]))});var t,n}(hh=ph=ph||{}).default="wrap",hh.floating="floating",hh.sliding="sliding",hh.scrolling="scrolling",(bh=vh=vh||{}).auto="auto",bh.top="top",bh.bottom="bottom";function Uv(t){return fd.config({disabled:t,disableClass:"tox-tbtn--disabled"})}var Gv,Xv="silver.readonly",Yv=te([$t("readonly",ie)]),qv=function(t){return fd.config({disabled:t})},Kv=function(t){return fd.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},Jv=((Gv={})[Eo()]=["disabling","alloy.base.behaviour","toggling","item-events"],Gv),$v=Jr,Qv=tinymce.util.Tools.resolve("tinymce.Env"),Zv=function(t,a){return A(t,function(t){switch(t.type){case"cardcontainer":return r=Zv((o=t).items,a),i="vertical"===o.direction?"tox-collection__item-container--column":Bh,u="left"===o.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right",{dom:{tag:"div",classes:[Dh,i,u,function(){switch(o.valign){case"top":return"tox-collection__item-container--valign-top";case"middle":return"tox-collection__item-container--valign-middle";case"bottom":return"tox-collection__item-container--valign-bottom"}}()]},components:r};case"cardimage":return e=t.src,{dom:{tag:"img",classes:t.classes,attributes:{src:e,alt:t.alt.getOr("")}}};case"cardtext":var n=t.name.exists(function(t){return et(a.cardText.highlightOn,t)})?ft.from(a.cardText.matchText).getOr(""):"";return xv(Tv(t.text,n),t.classes)}var e,o,r,i,u})},tb=rl(Gg(),Xg()),nb=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,eb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,ob=Math.min,rb=Math.max,ib=Math.round,ub=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,ab=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,cb=Mv(255,0,0,1),sb=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),lb="tinymce-custom-colors";function fb(t){return!1!==t.getParam("custom_colors")}function db(t){var n=t.getParam("color_map");return void 0!==n?function(t){for(var n=[],e=0;e<t.length;e+=2)n.push({text:t[e+1],value:"#"+Wv(t[e]).value,type:"choiceitem"});return n}(n):Tb}function mb(t){Eb.add(t)}function gb(t){var n,e=(n=db(t).length,Math.max(5,Math.ceil(Math.sqrt(n))));return t.getParam("color_cols",e,"number")}function pb(t){var n="choiceitem",e={type:n,text:"Remove color",icon:"color-swatch-remove-color",value:"remove"};return t?[e,{type:n,text:"Custom color",icon:"color-picker",value:"custom"}]:[e]}function hb(n,e,t,o){"custom"===t?Db(n)(function(t){t.each(function(t){mb(t),n.execCommand("mceApplyTextcolor",e,t),o(t)})},"#000000"):"remove"===t?(o(""),n.execCommand("mceRemoveTextcolor",e)):(o(t),n.execCommand("mceApplyTextcolor",e,t))}function vb(t,n){return t.concat(A(Eb.state(),function(t){return{type:_b,text:t,value:t}}).concat(pb(n)))}function bb(n,e){return function(t){t(vb(n,e))}}function yb(t,n,e){t.setIconFill("forecolor"===n?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color",e)}function xb(i,e,u,t,o){i.ui.registry.addSplitButton(e,{tooltip:t,presets:"color",icon:"forecolor"===e?"text-color":"highlight-bg-color",select:function(e){var o,r;return ft.from((o=u,i.dom.getParents(i.selection.getStart(),function(t){var n;(n=t.style["forecolor"===o?"color":"background-color"])&&(r=r||n)}),r)).bind(function(t){return Pv(t).map(function(t){var n=Av(t).value;return Cn(e.toLowerCase(),n)})}).getOr(!1)},columns:gb(i),fetch:bb(db(i),fb(i)),onAction:function(t){null!==o.get()&&hb(i,u,o.get(),ct)},onItemAction:function(t,n){hb(i,u,n,function(t){o.set(t),i.fire("TextColorChange",{name:e,color:t})})},onSetup:function(n){function t(t){t.name===e&&yb(n,t.name,t.color)}return null!==o.get()&&yb(n,e,o.get()),i.on("TextColorChange",t),function(){i.off("TextColorChange",t)}}})}function wb(n,t,e,o){n.ui.registry.addNestedMenuItem(t,{text:o,icon:"forecolor"===t?"text-color":"highlight-bg-color",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",onAction:function(t){hb(n,e,t.value,ct)}}]}})}function Sb(t,n,e,o,r,i,u,a){return oh(t,th(n),Bb(n,e,o,"color"!==r?"normal":"color",i,u,a),o,r)}function kb(t,n){var e=Kp(n);return 1===t?{mode:"menu",moveOnTab:!0}:"auto"===t?{mode:"grid",selector:"."+e.item,initSize:{numColumns:1,numRows:1}}:{mode:"matrix",rowSelector:"."+("color"===n?"tox-swatches__row":"tox-collection__group")}}var Cb,Ob,_b="choiceitem",Tb=[{type:_b,text:"Light Green",value:"#BFEDD2"},{type:_b,text:"Light Yellow",value:"#FBEEB8"},{type:_b,text:"Light Red",value:"#F8CAC6"},{type:_b,text:"Light Purple",value:"#ECCAFA"},{type:_b,text:"Light Blue",value:"#C2E0F4"},{type:_b,text:"Green",value:"#2DC26B"},{type:_b,text:"Yellow",value:"#F1C40F"},{type:_b,text:"Red",value:"#E03E2D"},{type:_b,text:"Purple",value:"#B96AD9"},{type:_b,text:"Blue",value:"#3598DB"},{type:_b,text:"Dark Turquoise",value:"#169179"},{type:_b,text:"Orange",value:"#E67E23"},{type:_b,text:"Dark Red",value:"#BA372A"},{type:_b,text:"Dark Purple",value:"#843FA1"},{type:_b,text:"Dark Blue",value:"#236FA1"},{type:_b,text:"Light Gray",value:"#ECF0F1"},{type:_b,text:"Medium Gray",value:"#CED4D9"},{type:_b,text:"Gray",value:"#95A5A6"},{type:_b,text:"Dark Gray",value:"#7E8C8D"},{type:_b,text:"Navy Blue",value:"#34495E"},{type:_b,text:"Black",value:"#000000"},{type:_b,text:"White",value:"#ffffff"}],Eb=function(e){void 0===e&&(e=10);function o(t){i.splice(t,1)}var t,n=sb.getItem(lb),r=y(n)?JSON.parse(n):[],i=e-(t=r).length<0?t.slice(0,e):t;return{add:function(t){var n;(-1===(n=p(i,t))?ft.none():ft.some(n)).each(o),i.unshift(t),i.length>e&&i.pop(),sb.setItem(lb,JSON.stringify(i))},state:function(){return i.slice(0)}}}(10),Db=function(r){return function(e,t){var o=!1;r.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:{colorpicker:t},onAction:function(t,n){"hex-valid"===n.name&&(o=n.value)},onSubmit:function(t){var n=t.getData().colorpicker;o?(e(ft.from(n)),t.close()):r.windowManager.alert(r.translate(["Invalid hex color code: {0}",n]))},onClose:ct,onCancel:function(){e(ft.none())}})}},Bb=function(e,o,r,i,u,a,c){return Jr(A(e,function(n){return"choiceitem"===n.type?Gt("choicemenuitem",Nh,n).fold(nh,function(t){return ft.some(function(n,t,e,o,r,i,u,a){void 0===a&&(a=!0);var c=Ov({presets:e,textContent:t?n.text:ft.none(),htmlContent:ft.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:t?n.shortcut:ft.none(),checkMark:t?ft.some(kv(u.icons)):ft.none(),caret:ft.none(),value:n.value},u,a);return Jn(hv({data:vv(n),disabled:n.disabled,getApi:function(n){return{setActive:function(t){Hg.set(n,t)},isActive:function(){return Hg.isOn(n)},isDisabled:function(){return fd.isDisabled(n)},setDisabled:function(t){return fd.set(n,t)}}},onAction:function(t){return o(n.value)},onSetup:function(t){return t.setActive(r),ct},triggersSubmenu:!1,itemBehaviours:[]},c,i,u),{toggling:{toggleClass:Ch,toggleOnExecute:!1,selected:n.active}})}(t,1===r,i,o,a(n.value),u,c,th(e)))}):ft.none()}))},Ab=Ar("cell-over"),Mb=Ar("cell-execute"),Fb={inserttable:function(o){var t=Ar("size-label"),i=function(t){for(var n=[],e=0;e<10;e++){for(var o=[],r=0;r<10;r++)o.push(function(n,e,t){function o(t){return Ne(t,Mb,{row:n,col:e})}function r(t,n){n.stop(),o(t)}var i;return bu({dom:{tag:"div",attributes:((i={role:"button"})["aria-labelledby"]=t,i)},behaviours:Za([lm("insert-table-picker-cell",[Xe(lo(),Rg.focus),Xe(Eo(),o),Xe(bo(),r),Xe(Bo(),r)]),Hg.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Rg.config({onFocus:function(t){return Ne(t,Ab,{row:n,col:e})}})])})}(e,r,t));n.push(o)}return n}(t),u=Vm({dom:{tag:"span",classes:["tox-insert-table-picker__label"],attributes:{id:t}},components:[pi("0x0")],behaviours:Za([Mg.config({})])});return{type:"widget",data:{value:Ar("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[tb.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:z(i,function(t){return A(t,yu)}).concat(u.asSpec()),behaviours:Za([lm("insert-table-picker",[Je(Ab,function(t,n,e){var o=e.event.row,r=e.event.col;!function(t,n,e){for(var o=0;o<10;o++)for(var r=0;r<10;r++)Hg.set(t[o][r],o<=n&&r<=e)}(i,o,r),Mg.set(u.get(t),[pi(r+1+"x"+(o+1))])}),Je(Mb,function(t,n,e){o.onAction({numRows:e.event.row+1,numColumns:e.event.col+1}),ze(t,Mo())})]),Bg.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(n,t){var e,o,r,i=(o=t,r=(e=n).initData.allowCustomColors&&o.colorinput.hasCustomColors(),e.initData.colors.fold(function(){return vb(o.colorinput.getColors(),r)},function(t){return t.concat(pb(r))})),u=t.colorinput.getColorCols(),a=Sb(Ar("menu-value"),i,function(t){n.onAction({value:t})},u,"color",yh.CLOSE_ON_EXECUTE,O,t.shared.providers),c=st(st({},a),{markers:Kp("color"),movement:kb(u,"color")});return{type:"widget",data:{value:Ar("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[tb.widget($g.sketch(c))]}}},Ib=function(t){var n=t.text.fold(function(){return{}},function(t){return{innerHtml:t}});return{type:"separator",dom:st({tag:"div",classes:[wh,"tox-collection__group-heading"]},n),components:[]}},Rb=function(t,n,e,o){void 0===o&&(o=!0);var r=Ov({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:ft.none(),ariaLabel:t.text,caret:ft.none(),checkMark:ft.none(),shortcutContent:t.shortcut},e,o);return hv({data:vv(t),getApi:function(n){return{isDisabled:function(){return fd.isDisabled(n)},setDisabled:function(t){return fd.set(n,t)}}},disabled:t.disabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e)},Vb=function(t,n,e,o,r){void 0===o&&(o=!0);var i=(r=void 0!==r&&r)?bv("chevron-down",e.icons,[Th]):bv("chevron-right",e.icons,[Th]),u=Ov({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:ft.none(),ariaLabel:t.text,caret:ft.some(i),checkMark:ft.none(),shortcutContent:t.shortcut},e,o);return hv({data:vv(t),getApi:function(n){return{isDisabled:function(){return fd.isDisabled(n)},setDisabled:function(t){return fd.set(n,t)}}},disabled:t.disabled,onAction:ct,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,n,e)},Pb=function(t,n,e,o){void 0===o&&(o=!0);var r=Ov({iconContent:t.icon,textContent:t.text,htmlContent:ft.none(),ariaLabel:t.text,checkMark:ft.some(kv(e.icons)),caret:ft.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},e,o);return Jn(hv({data:vv(t),disabled:t.disabled,getApi:function(n){return{setActive:function(t){Hg.set(n,t)},isActive:function(){return Hg.isOn(n)},isDisabled:function(){return fd.isDisabled(n)},setDisabled:function(t){return fd.set(n,t)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e),{toggling:{toggleClass:Ch,toggleOnExecute:!1,selected:t.active}})},Hb=function(n,e){return kt(Fb,n.fancytype).map(function(t){return t(n,e)})};function zb(t,u,a,n,c,s,l){var e=1===n,o=!e||th(t);return Jr(A(t,function(t){switch(t.type){case"separator":return Gt("Autocompleter.Separator",Mp,t).fold(nh,function(t){return ft.some(Ib(t))});case"cardmenuitem":return Gt("cardmenuitem",zh,t).fold(nh,function(n){return ft.some((t=st(st({},n),{onAction:function(t){n.onAction(t),a(n.value,n.meta)}}),e=c,o=s,r={itemBehaviours:_v(n.meta,s),cardText:{matchText:u,highlightOn:l}},i={dom:Cv(t.label),optComponents:[ft.some({dom:{tag:"div",classes:[Dh,Bh]},components:Zv(t.items,r)})]},hv({data:vv(st({text:ft.none()},t)),disabled:t.disabled,getApi:function(e){return{isDisabled:function(){return fd.isDisabled(e)},setDisabled:function(n){fd.set(e,n),dt(gs(e.element,"*"),function(t){e.getSystem().getByDom(t).each(function(t){t.hasConfigured(fd)&&fd.set(t,n)})})}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:ft.from(r.itemBehaviours).getOr([])},i,e,o.providers)));var t,e,o,r,i});default:return Gt("Autocompleter.Item",Fp,t).fold(nh,function(t){return ft.some(function(n,e,t,o,r,i,u,a){void 0===a&&(a=!0);var c=Ov({presets:o,textContent:ft.none(),htmlContent:t?n.text.map(function(t){return Tv(t,e)}):ft.none(),ariaLabel:n.text,iconContent:n.icon,shortcutContent:ft.none(),checkMark:ft.none(),caret:ft.none(),value:n.value},u.providers,a,n.icon);return hv({data:vv(n),disabled:n.disabled,getApi:tt({}),onAction:function(t){return r(n.value,n.meta)},onSetup:tt(ct),triggersSubmenu:!1,itemBehaviours:_v(n.meta,u)},c,i,u.providers)}(t,u,e,"normal",a,c,s,o))})}}))}function Nb(t,n,e,o,r){var i=th(n),u=Jr(A(n,function(t){function n(t){return function(t,n,e,o,r){function i(t){return r?st(st({},t),{shortcut:ft.none(),icon:t.text.isSome()?ft.none():t.icon}):t}var u=e.shared.providers;switch(t.type){case"menuitem":return Gt("menuitem",Wh,t).fold(nh,function(t){return ft.some(Rb(i(t),n,u,o))});case"nestedmenuitem":return Gt("nestedmenuitem",Uh,t).fold(nh,function(t){return ft.some(Vb(i(t),n,u,o,r))});case"togglemenuitem":return Gt("togglemenuitem",Gh,t).fold(nh,function(t){return ft.some(Pb(i(t),n,u,o))});case"separator":return Gt("separatormenuitem",Mp,t).fold(nh,function(t){return ft.some(Ib(t))});case"fancymenuitem":return Gt("fancymenuitem",jh,t).fold(nh,function(t){return Hb(i(t),e)});default:return console.error("Unknown item in general menu",t),ft.none()}}(t,e,o,r?!Kn(t,"text"):i,r)}return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?n(st(st({},t),{disabled:!0})):n(t)}));return(r?eh:oh)(t,i,u,1,"normal")}function Lb(t){return ep.singleData(t.value,t)}function jb(t,n,e){return Iu(t,n,e).isSome()}function Wb(e,o){var r=null;return{cancel:function(){null!==r&&(clearTimeout(r),r=null)},schedule:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];r=setTimeout(function(){e.apply(null,t),r=null},o)}}}function Ub(t){var n=t.raw;return void 0===n.touches||1!==n.touches.length?ft.none():ft.some(n.touches[0])}function Gb(){return Be().browser.isFirefox()}function Xb(n,t){var e,o,r,i,u,a,c,s,l,f=Yt("Getting GUI events settings",iy,t),d=(u=f,a=fc(),c=wn(!1),s=Wb(function(t){u.triggerEvent(Ao(),t),c.set(!0)},400),l=Me([{key:eo(),value:function(e){return Ub(e).each(function(t){s.cancel();var n={x:t.clientX,y:t.clientY,target:e.target};s.schedule(e),c.set(!1),a.set(n)}),ft.none()}},{key:oo(),value:function(t){return s.cancel(),Ub(t).each(function(i){a.on(function(t){var n=i,e=t,o=Math.abs(n.clientX-e.x),r=Math.abs(n.clientY-e.y);(5<o||5<r)&&a.clear()})}),ft.none()}},{key:ro(),value:function(n){return s.cancel(),a.get().filter(function(t){return Bn(t.target,n.target)}).map(function(t){return c.get()?(n.prevent(),!1):u.triggerEvent(Bo(),n)})}}]),{fireIfReady:function(n,t){return kt(l,t).bind(function(t){return t(n)})}}),m=A(["touchstart","touchmove","touchend","touchcancel","gesturestart","mousedown","mouseup","mouseover","mousemove","mouseout","click"].concat(["selectstart","input","contextmenu","change","transitionend","transitioncancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","keyup"]),function(t){return dc(n,t,function(n){d.fireIfReady(n,t).each(function(t){t&&n.kill()}),f.triggerEvent(t,n)&&n.kill()})}),g=fc(),p=dc(n,"paste",function(n){d.fireIfReady(n,"paste").each(function(t){t&&n.kill()}),f.triggerEvent("paste",n)&&n.kill(),g.set(setTimeout(function(){f.triggerEvent(_o(),n)},0))}),h=dc(n,"keydown",function(t){var n;f.triggerEvent("keydown",t)?t.kill():!0!==f.stopBackspace||(n=t).raw.which!==gd[0]||et(["input","textarea"],nr(n.target))||jb(n.target,'[contenteditable="true"]')||t.prevent()}),v=(e=n,o=function(t){f.triggerEvent("focusin",t)&&t.kill()},Gb()?mc(e,"focus",o):dc(e,"focusin",o)),b=fc(),y=(r=n,i=function(t){f.triggerEvent("focusout",t)&&t.kill(),b.set(setTimeout(function(){f.triggerEvent(Oo(),t)},0))},Gb()?mc(r,"blur",i):dc(r,"focusout",i));return{unbind:function(){dt(m,function(t){t.unbind()}),h.unbind(),v.unbind(),y.unbind(),p.unbind(),g.on(clearTimeout),b.on(clearTimeout)}}}function Yb(t,n){return wn(kt(t,"target").getOr(n))}function qb(t,o,n,e,r,i){var u,a,c=t(o,e),s=(u=wn(!1),a=wn(!1),{stop:function(){u.set(!0)},cut:function(){a.set(!0)},isStopped:u.get,isCut:a.get,event:n,setSource:r.set,getSource:r.get});return c.fold(function(){return i.logEventNoHandlers(o,e),uy.complete()},function(n){var e=n.descHandler;return zr(e)(s),s.isStopped()?(i.logEventStopped(o,n.element,e.purpose),uy.stopped()):s.isCut()?(i.logEventCut(o,n.element,e.purpose),uy.complete()):ar(n.element).fold(function(){return i.logNoParent(o,n.element,e.purpose),uy.complete()},function(t){return i.logEventResponse(o,n.element,e.purpose),uy.resume(t)})})}function Kb(){function r(t){Mr(t.element).each(function(t){delete a[t],i.unregisterId(t)})}var u,i=(u={},{registerId:function(r,i,t){bt(t,function(t,n){var e,o=void 0!==u[n]?u[n]:{};o[i]={cHandler:S.apply(void 0,[(e=t).handler].concat(r)),purpose:e.purpose},u[n]=o})},unregisterId:function(e){bt(u,function(t,n){Kn(t,e)&&delete t[e]})},filterByType:function(t){return kt(u,t).map(function(t){return xt(t,function(t,n){return{id:n,descHandler:t}})}).getOr([])},find:function(t,n,e){var r=kt(u,n);return Re(e,function(t){return e=r,Mr(o=t).fold(function(){return ft.none()},function(n){return e.bind(function(t){return kt(t,n)}).map(function(t){return{element:o,descHandler:t}})});var e,o},t)}}),a={};return{find:function(t,n,e){return i.find(t,n,e)},filter:function(t){return i.filterByType(t)},register:function(t){var e,o=Mr((e=t).element).getOrThunk(function(){return t=e.element,n=Ar(Qi+"uid-"),tu(t,n),n;var t,n});Ct(a,o)&&function(t){var n=a[o];if(n!==t)throw new Error('The tagId "'+o+'" is already used by: '+Br(n.element)+"\nCannot use it for: "+Br(t.element)+"\nThe conflicting element is"+(du(n.element)?" ":" not ")+"already in the DOM");r(t)}(t),i.registerId([t],o,t.events),a[o]=t},unregister:r,getById:function(t){return kt(a,t)}}}function Jb(e){function o(n){return ar(e.element).fold(_,function(t){return Bn(n,t)})}function s(t,n){return i.find(o,t,n)}function r(n){var t=i.filter(To());dt(t,function(t){zr(t.descHandler)(n)})}var i=Kb(),t=Xb(e.element,{triggerEvent:function(n,e){return Nu(n,e.target,function(t){return cy(s,n,e,e.target,t)})}}),u={debugInfo:tt("real"),triggerEvent:function(n,e,o){Nu(n,e,function(t){return cy(s,n,o,e,t)})},triggerFocus:function(a,c){Mr(a).fold(function(){Sa(a)},function(t){Nu(Co(),a,function(t){var n,e,o=s,r=Co(),i=t,u=Yb(n={originator:c,kill:ct,prevent:ct,target:a},e=a);return qb(o,r,n,e,u,i),!1})})},triggerEscape:function(t,n){u.triggerEvent("keydown",t.element,n.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:bu,addToGui:function(t){c(t)},removeFromGui:function(t){l(t)},addToWorld:function(t){n(t)},removeFromWorld:function(t){a(t)},broadcast:function(t){f(t)},broadcastOn:function(t,n){d(t,n)},broadcastEvent:function(t,n){m(t,n)},isConnected:_},n=function(t){t.connect(u),Vi(t.element)||(i.register(t),dt(t.components(),n),u.triggerEvent(Io(),t.element,{target:t.element}))},a=function(t){Vi(t.element)||(dt(t.components(),a),i.unregister(t)),t.disconnect()},c=function(t){Fs(e,t)},l=function(t){Rs(t)},f=function(t){r({universal:!0,data:t})},d=function(t,n){r({universal:!1,channels:t,data:n})},m=function(t,n){var e,o,r=i.filter(t);return o={stop:function(){e.set(!0)},cut:ct,isStopped:(e=wn(!1)).get,isCut:O,event:n,setSource:C("Cannot set source of a broadcasted event"),getSource:C("Cannot get source of a broadcasted event")},dt(r,function(t){zr(t.descHandler)(o)}),o.isStopped()},g=function(t){return i.getById(t).fold(function(){return mt.error(new Error('Could not find component with uid: "'+t+'" in system.'))},mt.value)},p=function(t){var n=Mr(t).getOr("not found");return g(n)};return n(e),{root:e,element:e.element,destroy:function(){t.unbind(),Xi(e.element)},add:c,remove:l,getByUid:g,getByDom:p,addToWorld:n,removeFromWorld:a,broadcast:f,broadcastOn:d,broadcastEvent:m}}function $b(t,n,e,o){var r=hy(t,n,e,o);return dy.sketch(r)}function Qb(t,n){return dy.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}})}function Zb(t){return Za([Rg.config({onFocus:t.selectOnFocus?function(t){var n=t.element,e=si(n);n.dom.setSelectionRange(0,e.length)}:ct})])}function ty(t){return{tag:t.tag,attributes:st({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}}(Ob=Cb={})[Ob.ContentFocus=0]="ContentFocus",Ob[Ob.UiFocus=1]="UiFocus";function ny(f,c){function e(){return r.get().isSome()}function s(){e()&&op.hide(d)}var o,t,r=fc(),l=wn(!1),d=bu(op.sketch({dom:{tag:"div",classes:["tox-autocompleter"]},components:[],fireDismissalEventInstead:{},inlineBehaviours:Za([lm("dismissAutocompleter",[Xe(Lo(),function(){return m()})])]),lazySink:c.getSink})),m=function(){var t;e()&&(t=r.get().map(function(t){return t.element}),Ep(t.getOr(de.fromDom(f.selection.getNode()))).each(wr),s(),r.clear(),l.set(!1))},u=_t(function(){return e=yt(f.ui.registry.getAll().popups,function(t){return Gt("Autocompleter",Ip,t).fold(function(t){throw new Error(se(t))},h)}),t=xt(e,function(t){return t.ch}),n={},dt(t,function(t){n[t]={}}),o=Xn(n),r=St(e),{dataset:e,triggerChars:o,lookupByChar:function(n){return F(r,function(t){return t.ch===n})}};var t,n,e,o,r}),g=function(t){var n=t;r.get().map(function(t){return xp(f.dom,f.selection.getRng(),t.triggerChar).bind(function(t){return Cp(f,u,t,n)})}).getOrThunk(function(){return n=f,t=(e=u)(),o=n.selection.getRng(),r=n.dom,i=o,q(t.triggerChars,function(t){return xp(r,i,t)}).bind(function(t){return Cp(n,e,t)});var n,e,t,o,r,i}).fold(m,function(a){var t,n=a.context;e()||(t=hp(f,n.range),r.set({triggerChar:n.triggerChar,element:t,matchLength:n.text.length}),l.set(!1)),a.lookupData.then(function(u){r.get().map(function(t){var n,e,o,r,i=a.context;t.triggerChar===i.triggerChar&&(e=i.triggerChar,r=q(o=u,function(t){return ft.from(t.columns)}).getOr(1),0<(n=z(o,function(i){return zb(i.items,i.matchText,function(o,r){var t=f.selection.getRng();xp(f.dom,t,e).fold(function(){return console.error("Lost context. Cursor probably moved")},function(t){var n=t.range,e={hide:function(){m()},reload:function(t){s(),g(t)}};l.set(!0),i.onAction(e,n,o,r),l.set(!1)})},r,yh.BUBBLE_TO_SANDBOX,c,i.highlightOn)})).length?function(t,n,e,o){t.matchLength=n.text.length;var r,i,u,a,c,s,l=q(e,function(t){return ft.from(t.columns)}).getOr(1);op.showAt(d,$g.sketch((r=oh("autocompleter-value",!0,o,l,"normal"),i=l,a=((u=Cb.ContentFocus)===Cb.ContentFocus?Nl:zl)(),c=kb(i,"normal"),s=Kp("normal"),{dom:r.dom,components:r.components,items:r.items,value:r.value,markers:{selectedItem:s.selectedItem,item:s.item},movement:c,fakeFocus:u===Cb.ContentFocus,focusManager:a,menuBehaviours:Xh("auto"!==i?[]:[$o(function(o,t){rh(o,4,s.item).each(function(t){var n=t.numColumns,e=t.numRows;Bg.setGridSize(o,e,n)})})])})),{anchor:{type:"node",root:de.fromDom(f.getBody()),node:ft.from(t.element)}}),op.getContent(d).each(md.highlightFirst)}(t,i,u,n):(10<=i.text.length-t.matchLength?m:s)())})})})},n={onKeypress:gp(function(t){27!==t.which&&g()},50),cancelIfNecessary:m,isMenuOpen:function(){return op.isOpen(d)},isActive:e,isProcessingAction:l.get,getView:function(){return op.getContent(d)}};function i(t,n){Ne(t,go(),{raw:n})}!1===f.hasPlugin("rtc")&&(o=n,(t=f).on("keypress compositionend",o.onKeypress.throttle),t.on("remove",o.onKeypress.cancel),t.on("keydown",function(n){function t(){return o.getView().bind(md.getHighlighted)}8===n.which&&o.onKeypress.throttle(n),o.isActive()&&(27===n.which&&o.cancelIfNecessary(),o.isMenuOpen()?13===n.which?(t().each(Le),n.preventDefault()):40===n.which?(t().fold(function(){o.getView().each(md.highlightFirst)},function(t){i(t,n)}),n.preventDefault(),n.stopImmediatePropagation()):37!==n.which&&38!==n.which&&39!==n.which||t().each(function(t){i(t,n),n.preventDefault(),n.stopImmediatePropagation()}):13!==n.which&&38!==n.which&&40!==n.which||o.cancelIfNecessary())}),t.on("NodeChange",function(t){o.isActive()&&!o.isProcessingAction()&&Ep(de.fromDom(t.element)).isNone()&&o.cancelIfNecessary()}))}var ey,oy,ry,iy=Ht([tn("triggerEvent"),dn("stopBackspace",!0)]),uy=Vn([{stopped:[]},{resume:["element"]},{complete:[]}]),ay=function(n,e,o,t,r,i){return qb(n,e,o,t,r,i).fold(_,function(t){return ay(n,e,o,t,r,i)},O)},cy=function(t,n,e,o,r){var i=Yb(e,o);return ay(t,n,e,o,i,r)},sy=xl({name:"Container",factory:function(t){var n=t.dom,e=n.attributes,o=s(n,["attributes"]);return{uid:t.uid,dom:st({tag:"div",attributes:st({role:"presentation"},e)},o),components:t.components,behaviours:$s(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[dn("components",[]),Js("containerBehaviours",[]),dn("events",{}),dn("domModification",{}),dn("eventOrder",{})]}),ly=tt([dn("prefix","form-field"),Js("fieldBehaviours",[id,_f])]),fy=tt([Kf({schema:[Jt("dom")],name:"label"}),Kf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Jt("text")],name:"aria-descriptor"}),Yf({factory:{sketch:function(t){var e,o,n=(e=["factory"],o={},bt(t,function(t,n){et(e,n)||(o[n]=t)}),o);return t.factory.sketch(n)}},schema:[Jt("factory")],name:"field"})]),dy=wl({name:"FormField",configFields:ly(),partFields:fy(),factory:function(r,t,n,e){var o=Qs(r.fieldBehaviours,[id.config({find:function(t){return ll(t,r,"field")}}),_f.config({store:{mode:"manual",getValue:function(t){return id.getCurrent(t).bind(_f.getValue)},setValue:function(t,n){id.getCurrent(t).each(function(t){_f.setValue(t,n)})}}})]),i=Jo([$o(function(t,n){var o=dl(t,r,["label","field","aria-descriptor"]);o.field().each(function(e){var n=Ar(r.prefix);o.label().each(function(t){Or(t.element,"for",n),Or(e.element,"id",n)}),o["aria-descriptor"]().each(function(t){var n=Ar(r.prefix);Or(t.element,"id",n),Or(e.element,"aria-describedby",n)})})})]);return{uid:r.uid,dom:r.dom,components:t,behaviours:o,events:i,apis:{getField:function(t){return ll(t,r,"field")},getLabel:function(t){return ll(t,r,"label")}}}},apis:{getField:function(t,n){return t.getField(n)},getLabel:function(t,n){return t.getLabel(n)}}}),my=Object.freeze({__proto__:null,exhibit:function(t,n){return Hr({attributes:Me([{key:n.tabAttr,value:"true"}])})}}),gy=xa({fields:[dn("tabAttr","data-alloy-tabstop")],name:"tabstopping",active:my}),py=tinymce.util.Tools.resolve("tinymce.html.Entities"),hy=function(t,n,e,o){return{dom:vy(e),components:t.toArray().concat([n]),fieldBehaviours:Za(o)}},vy=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},by=Ar("form-component-change"),yy=Ar("form-close"),xy=Ar("form-cancel"),wy=Ar("form-action"),Sy=Ar("form-submit"),ky=Ar("form-block"),Cy=Ar("form-unblock"),Oy=Ar("form-tabchange"),_y=Ar("form-resize"),Ty=tt([rn("data"),dn("inputAttributes",{}),dn("inputStyles",{}),dn("tag","input"),dn("inputClasses",[]),Ku("onSetValue"),dn("styles",{}),dn("eventOrder",{}),Js("inputBehaviours",[_f,Rg]),dn("selectOnFocus",!0)]),Ey=xl({name:"Input",configFields:Ty(),factory:function(t,n){return{uid:t.uid,dom:ty(t),components:[],behaviours:st(st({},Zb(e=t)),Qs(e.inputBehaviours,[_f.config({store:st(st({mode:"manual"},e.data.map(function(t){return{initialValue:t}}).getOr({})),{getValue:function(t){return si(t.element)},setValue:function(t,n){si(t.element)!==n&&li(t.element,n)}}),onSetValue:e.onSetValue})])),eventOrder:t.eventOrder};var e}}),Dy={},By={exports:Dy};function Ay(t){setTimeout(function(){throw t},0)}function My(t){var n=nr(t);return et(Gy,n)}function Fy(t,n){Gr(n.getRoot(t).getOr(t.element),n.invalidClass),n.notify.each(function(n){My(t.element)&&Or(t.element,"aria-invalid",!1),n.getContainer(t).each(function(t){kr(t,n.validHtml)}),n.onValid(t)})}function Iy(n,t,e,o){Ur(t.getRoot(n).getOr(n.element),t.invalidClass),t.notify.each(function(t){My(n.element)&&Or(n.element,"aria-invalid",!0),t.getContainer(n).each(function(t){kr(t,o)}),t.onInvalid(n,o)})}function Ry(n,t,e){return t.validator.fold(function(){return Uy(mt.value(!0))},function(t){return t.validate(n)})}function Vy(n,e,t){return e.notify.each(function(t){t.onValidate(n)}),Ry(n,e).map(function(t){return n.getSystem().isConnected()?t.fold(function(t){return Iy(n,e,0,t),mt.error(t)},function(t){return Fy(n,e),mt.value(t)}):mt.error("No longer in system")})}ey=Dy,oy=By,ry=void 0,function(t){"object"==typeof ey&&void 0!==oy?oy.exports=t():("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function i(u,a,c){function s(n,t){if(!a[n]){if(!u[n]){var e="function"==typeof ry;if(!t&&e)return e(n,!0);if(l)return l(n,!0);var o=new Error("Cannot find module '"+n+"'");throw o.code="MODULE_NOT_FOUND",o}var r=a[n]={exports:{}};u[n][0].call(r.exports,function(t){return s(u[n][1][t]||t)},r,r.exports,i,u,a,c)}return a[n].exports}for(var l="function"==typeof ry,t=0;t<c.length;t++)s(c[t]);return s}({1:[function(t,n,e){var o,r,i=n.exports={};function u(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(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(t){o=u}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,l=[],f=!1,d=-1;function m(){f&&s&&(f=!1,s.length?l=s.concat(l):d=-1,l.length&&g())}function g(){if(!f){var t=c(m);f=!0;for(var n=l.length;n;){for(s=l,l=[];++d<n;)s&&s[d].run();d=-1,n=l.length}s=null,f=!1,function(n){if(r===clearTimeout)return clearTimeout(n);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(n);try{r(n)}catch(t){try{return r.call(null,n)}catch(t){return r.call(this,n)}}}(t)}}function p(t,n){this.fun=t,this.array=n}function h(){}i.nextTick=function(t){var n=new Array(arguments.length-1);if(1<arguments.length)for(var e=1;e<arguments.length;e++)n[e-1]=arguments[e];l.push(new p(t,n)),1!==l.length||f||c(g)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=h,i.addListener=h,i.once=h,i.off=h,i.removeListener=h,i.removeAllListeners=h,i.emit=h,i.prependListener=h,i.prependOnceListener=h,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],2:[function(t,f,n){!function(n){function o(){}function i(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function r(e,o){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,i._immediateFn(function(){var t,n=1===e._state?o.onFulfilled:o.onRejected;if(null!==n){try{t=n(e._value)}catch(t){return void a(o.promise,t)}u(o.promise,t)}else(1===e._state?u:a)(o.promise,e._value)})):e._deferreds.push(o)}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 l((o=e,r=t,function(){o.apply(r,arguments)}),n)}n._state=1,n._value=t,c(n)}catch(t){a(n,t)}var o,r}function a(t,n){t._state=2,t._value=n,c(t)}function c(t){2===t._state&&0===t._deferreds.length&&i._immediateFn(function(){t._handled||i._unhandledRejectionFn(t._value)});for(var n=0,e=t._deferreds.length;n<e;n++)r(t,t._deferreds[n]);t._deferreds=null}function s(t,n,e){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof n?n:null,this.promise=e}function l(t,n){var e=!1;try{t(function(t){e||(e=!0,u(n,t))},function(t){e||(e=!0,a(n,t))})}catch(t){if(e)return;e=!0,a(n,t)}}var e=setTimeout;i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,n){var e=new this.constructor(o);return r(this,new s(t,n,e)),e},i.all=function(t){var a=Array.prototype.slice.call(t);return new i(function(r,i){if(0===a.length)return r([]);for(var u=a.length,t=0;t<a.length;t++)!function n(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var o=t.then;if("function"==typeof o)return o.call(t,function(t){n(e,t)},i),0}a[e]=t,0==--u&&r(a)}catch(t){i(t)}}(t,a[t])})},i.resolve=function(n){return n&&"object"==typeof n&&n.constructor===i?n:new i(function(t){t(n)})},i.reject=function(e){return new i(function(t,n){n(e)})},i.race=function(r){return new i(function(t,n){for(var e=0,o=r.length;e<o;e++)r[e].then(t,n)})},i._immediateFn="function"==typeof n?function(t){n(t)}:function(t){e(t,0)},i._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},i._setImmediateFn=function(t){i._immediateFn=t},i._setUnhandledRejectionFn=function(t){i._unhandledRejectionFn=t},void 0!==f&&f.exports?f.exports=i:this.Promise||(this.Promise=i)}.call(this,t("timers").setImmediate)},{timers:3}],3:[function(c,t,s){!function(t,n){var o=c("process/browser.js").nextTick,e=Function.prototype.apply,r=Array.prototype.slice,i={},u=0;function a(t,n){this._id=t,this._clearFn=n}s.setTimeout=function(){return new a(e.call(setTimeout,window,arguments),clearTimeout)},s.setInterval=function(){return new a(e.call(setInterval,window,arguments),clearInterval)},s.clearTimeout=s.clearInterval=function(t){t.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},s.enroll=function(t,n){clearTimeout(t._idleTimeoutId),t._idleTimeout=n},s.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},s._unrefActive=s.active=function(t){clearTimeout(t._idleTimeoutId);var n=t._idleTimeout;0<=n&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},n))},s.setImmediate="function"==typeof t?t:function(t){var n=u++,e=!(arguments.length<2)&&r.call(arguments,1);return i[n]=!0,o(function(){i[n]&&(e?t.apply(null,e):t.call(null),s.clearImmediate(n))}),n},s.clearImmediate="function"==typeof n?n:function(t){delete i[t]}}.call(this,c("timers").setImmediate,c("timers").clearImmediate)},{"process/browser.js":1,timers:3}],4:[function(t,n,e){var o=t("promise-polyfill"),r="undefined"!=typeof window?window:Function("return this;")();n.exports={boltExport:r.Promise||o}},{"promise-polyfill":2}]},{},[4])(4)});var Py,Hy,zy=By.exports.boltExport,Ny=function(t){function o(t){r()?i(t):n.push(t)}var e=ft.none(),n=[],r=function(){return e.isSome()},i=function(n){e.each(function(t){setTimeout(function(){n(t)},0)})};return t(function(t){r()||(e=ft.some(t),dt(n,i),n=[])}),{get:o,map:function(e){return Ny(function(n){o(function(t){n(e(t))})})},isReady:r}},Ly={nu:Ny,pure:function(n){return Ny(function(t){t(n)})}},jy=function(e){function t(t){e().then(t,Ay)}return{map:function(t){return jy(function(){return e().then(t)})},bind:function(n){return jy(function(){return e().then(function(t){return n(t).toPromise()})})},anonBind:function(t){return jy(function(){return e().then(function(){return t.toPromise()})})},toLazy:function(){return Ly.nu(t)},toCached:function(){var t=null;return jy(function(){return t=null===t?e():t})},toPromise:e,get:t}},Wy=function(t){return jy(function(){return new zy(t)})},Uy=function(t){return jy(function(){return zy.resolve(t)})},Gy=["input","textarea"],Xy=Object.freeze({__proto__:null,markValid:Fy,markInvalid:Iy,query:Ry,run:Vy,isInvalid:function(t,n){return Xr(n.getRoot(t).getOr(t.element),n.invalidClass)}}),Yy=Object.freeze({__proto__:null,events:function(n,t){return n.validator.map(function(t){return Jo([Xe(t.onEvent,function(t){Vy(t,n).get(h)})].concat(t.validateOnLoad?[$o(function(t){Vy(t,n).get(ct)})]:[]))}).getOr({})}}),qy=xa({fields:[Jt("invalidClass"),dn("getRoot",ft.none),fn("notify",[dn("aria","alert"),dn("getContainer",ft.none),dn("validHtml",""),Ku("onValid"),Ku("onInvalid"),Ku("onValidate")]),fn("validator",[Jt("validate"),dn("onEvent","input"),dn("validateOnLoad",!0)])],name:"invalidating",active:Yy,apis:Xy,extra:{validation:function(e){return function(t){var n=_f.getValue(t);return Uy(e(n))}}}}),Ky=Object.freeze({__proto__:null,getCoupled:function(t,n,e,o){return e.getOrCreate(t,n,o)}}),Jy=xa({fields:[$t("others",Ut(mt.value,ee()))],name:"coupling",apis:Ky,state:Object.freeze({__proto__:null,init:function(){var i={},t=tt({});return au({readState:t,getOrCreate:function(e,o,r){var t=Xn(o.others);if(t)return kt(i,r).getOrThunk(function(){var t=kt(o.others,r).getOrDie("No information found for coupled component: "+r)(e),n=e.getSystem().build(t);return i[r]=n});throw new Error("Cannot find coupled component: "+r+". Known coupled components: "+JSON.stringify(t,null,2))}})}})}),$y=tt("sink"),Qy=tt(Kf({name:$y(),overrides:tt({dom:{tag:"div"},behaviours:Za([cf.config({useFixed:_})]),events:Jo([$e(go()),$e(uo()),$e(bo())])})}));function Zy(t,n){var e=t.getHotspot(n).getOr(n),o=t.getAnchorOverrides();return t.layouts.fold(function(){return{type:"hotspot",hotspot:e,overrides:o}},function(t){return{type:"hotspot",hotspot:e,overrides:o,layouts:t}})}function tx(t,n,e,o,r,i,u){var a,c=Zy(t,e),s=e,l=o,f=r,d=u,m=n,g=(0,(a=t).fetch)(s).map(m),p=T0(s,a);return g.map(function(t){return t.bind(function(t){return ft.from(ep.sketch(st(st({},f.menu()),{uid:nu(""),data:t,highlightImmediately:d===Py.HighlightFirst,onOpenMenu:function(t,n){var e=p().getOrDie();cf.position(e,n,{anchor:c}),pf.decloak(l)},onOpenSubmenu:function(t,n,e){var o=p().getOrDie();cf.position(o,e,{anchor:{type:"submenu",item:n}}),pf.decloak(l)},onRepositionMenu:function(t,n,e){var o=p().getOrDie();cf.position(o,n,{anchor:c}),dt(e,function(t){cf.position(o,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})})},onEscape:function(){return Rg.focus(s),pf.close(l),ft.some(!0)}})))})}).map(function(t){return t.fold(function(){pf.isOpen(o)&&pf.close(o)},function(t){pf.cloak(o),pf.open(o,t),i(o)}),o})}function nx(t,n,e,o,r,i){var u=Jy.getCoupled(e,"sandbox");return(pf.isOpen(u)?function(t,n,e,o,r,i,u){return pf.close(o),Uy(o)}:tx)(t,n,e,u,o,r,i)}function ex(t){pf.getState(t).each(function(t){ep.repositionMenus(t)})}function ox(s,l,f){var d=Ru(),t=T0(l,s);return{dom:{tag:"div",classes:s.sandboxClasses,attributes:{id:d.id,role:"listbox"}},behaviours:Ef(s.sandboxBehaviours,[_f.config({store:{mode:"memory",initialValue:l}}),pf.config({onOpen:function(t,n){var e,o,r,i,u,a,c=Zy(s,l);d.link(l.element),s.matchWidth&&(e=c.hotspot,o=n,r=s.useMinWidth,u=id.getCurrent(o).getOr(o),a=wi(e.element),r?ni(u.element,"min-width",a+"px"):(i=u.element,Cu.set(i,a))),s.onOpen(c,t,n),void 0!==f&&void 0!==f.onOpen&&f.onOpen(t,n)},onClose:function(t,n){d.unlink(l.element),void 0!==f&&void 0!==f.onClose&&f.onClose(t,n)},isPartOf:function(t,n,e){return Hu(n,e)||Hu(l,e)},getAttachPoint:function(){return t().getOrDie()}}),id.config({find:function(t){return pf.getState(t).bind(function(t){return id.getCurrent(t)})}}),oc.config({channels:st(st({},Ws({isExtraPart:O})),Us({doReposition:ex}))})])}}function rx(t){ex(Jy.getCoupled(t,"sandbox"))}function ix(){return[dn("sandboxClasses",[]),Tf("sandboxBehaviours",[id,oc,pf,_f])]}function ux(n){return Kf({name:n+"-edge",overrides:function(t){return t.model.manager.edgeActions[n].fold(function(){return{}},function(o){return{events:Jo([Ye(eo(),function(t,n,e){return o(t,e)},[t]),Ye(uo(),function(t,n,e){return o(t,e)},[t]),Ye(ao(),function(t,n,e){e.mouseIsDown.get()&&o(t,e)},[t])])}})}})}function ax(t){var n=t.event.raw;return-1===n.type.indexOf("touch")?void 0!==n.clientX?ft.some(n).map(function(t){return Su(t.clientX,t.clientY)}):ft.none():void 0!==n.touches&&1===n.touches.length?ft.some(n.touches[0]).map(function(t){return Su(t.clientX,t.clientY)}):ft.none()}function cx(t){return t.model.minX}function sx(t){return t.model.minY}function lx(t){return t.model.minX-1}function fx(t){return t.model.minY-1}function dx(t){return t.model.maxX}function mx(t){return t.model.maxY}function gx(t){return t.model.maxX+1}function px(t){return t.model.maxY+1}function hx(t,n,e){return n(t)-e(t)}function vx(t){return hx(t,dx,cx)}function bx(t){return hx(t,mx,sx)}function yx(t){return vx(t)/2}function xx(t){return bx(t)/2}function wx(t){return t.stepSize}function Sx(t){return t.snapToGrid}function kx(t){return t.snapStart}function Cx(t){return t.rounded}function Ox(t,n){return void 0!==t[n+"-edge"]}function _x(t){return Ox(t,"left")}function Tx(t){return Ox(t,"right")}function Ex(t){return Ox(t,"top")}function Dx(t){return Ox(t,"bottom")}function Bx(t){return t.model.value.get()}function Ax(t,n){return{x:t,y:n}}function Mx(t,n){Ne(t,U0(),{value:n})}function Fx(t,n,e,o){return t<n?t:e<t?e:t===n?n-1:Math.max(n,t-o)}function Ix(t,n,e,o){return e<t?t:t<n?n:t===e?e+1:Math.min(e,t+o)}function Rx(t,n,e){return Math.max(n,Math.min(e,t))}function Vx(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,l=t.hasMaxEdge,f=t.minBound,d=t.maxBound,m=t.screenRange,g=s?n-1:n,p=l?e+1:e;if(r<f)return g;if(d<r)return p;var h,v,b,y,x,w=Rx((x=f,Math.min(d,Math.max(r,x))-x)/m*o+n,g,p);return u&&n<=w&&w<=e?(h=w,v=n,b=e,y=i,a.fold(function(){var t=Math.round((h-v)/y)*y;return Rx(v+t,v-1,b+1)},function(t){var n=Math.round((h-t)%y/y),e=Math.floor((h-t)/y),o=Math.floor((b-t)/y),r=Math.min(o,e+n);return Math.max(t,t+r*y)})):c?Math.round(w):w}function Px(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return r<n?i?0:s:e<r?u?a:l:(r-n)/o*c}function Hx(t){return t.element.dom.getBoundingClientRect()}function zx(t){return Hx(t)[G0]}function Nx(t){return Hx(t).right}function Lx(t){return Hx(t).top}function jx(t){return Hx(t).bottom}function Wx(t){return Hx(t).width}function Ux(t){return Hx(t).height}function Gx(t,n){var e=Hx(t),o=Hx(n);return(e[G0]+e.right)/2-o[G0]}function Xx(t,n){var e=Hx(t),o=Hx(n);return(e.top+e.bottom)/2-o.top}function Yx(t,n){Ne(t,U0(),{value:n})}function qx(t,n,e){return Vx({min:cx(n),max:dx(n),range:vx(n),value:e,step:wx(n),snap:Sx(n),snapStart:kx(n),rounded:Cx(n),hasMinEdge:_x(n),hasMaxEdge:Tx(n),minBound:zx(t),maxBound:Nx(t),screenRange:Wx(t)})}function Kx(r){return function(t,n){return Yx(t,{x:o=(0<r?Ix:Fx)(Bx(e=n).x,cx(e),dx(e),wx(e))}),ft.some(o).map(_);var e,o}}function Jx(t,n,e,o,r,i){var u,a,c,s,l,f,d,m,g=(a=i,c=e,s=o,l=r,f=Wx(u=n),d=s.bind(function(t){return ft.some(Gx(t,u))}).getOr(0),m=l.bind(function(t){return ft.some(Gx(t,u))}).getOr(f),Px({min:cx(a),max:dx(a),range:vx(a),value:c,hasMinEdge:_x(a),hasMaxEdge:Tx(a),minBound:zx(u),minOffset:0,maxBound:Nx(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:m}));return zx(n)-zx(t)+g}function $x(t,n){Ne(t,U0(),{value:n})}function Qx(t,n,e){return Vx({min:sx(n),max:mx(n),range:bx(n),value:e,step:wx(n),snap:Sx(n),snapStart:kx(n),rounded:Cx(n),hasMinEdge:Ex(n),hasMaxEdge:Dx(n),minBound:Lx(t),maxBound:jx(t),screenRange:Ux(t)})}function Zx(r){return function(t,n){return $x(t,{y:o=(0<r?Ix:Fx)(Bx(e=n).y,sx(e),mx(e),wx(e))}),ft.some(o).map(_);var e,o}}function t0(t,n,e,o,r,i){var u,a,c,s,l,f,d,m,g=(a=i,c=e,s=o,l=r,f=Ux(u=n),d=s.bind(function(t){return ft.some(Xx(t,u))}).getOr(0),m=l.bind(function(t){return ft.some(Xx(t,u))}).getOr(f),Px({min:sx(a),max:mx(a),range:bx(a),value:c,hasMinEdge:Ex(a),hasMaxEdge:Dx(a),minBound:Lx(u),minOffset:0,maxBound:jx(u),maxOffset:f,centerMinEdge:d,centerMaxEdge:m}));return Lx(n)-Lx(t)+g}function n0(t,n){Ne(t,U0(),{value:n})}function e0(t,n){return{x:t,y:n}}function o0(u,a){return function(t,n){return o=n,r=0<u?Ix:Fx,n0(t,e0(i=(e=a)?Bx(o).x:r(Bx(o).x,cx(o),dx(o),wx(o)),e?r(Bx(o).y,sx(o),mx(o),wx(o)):Bx(o).y)),ft.some(i).map(_);var e,o,r,i}}function r0(t){return"<alloy.field."+t+">"}function i0(f,d,m,g){function p(t,n,e,o,r){var i,u,a=f(xw+"range"),c=[dy.parts.label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),dy.parts.field({data:r,factory:Ey,inputAttributes:st({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[d("textfield")],inputBehaviours:Za([(i=n,u=t,qy.config({invalidClass:d("invalid"),notify:{onValidate:function(t){Ne(t,yw,{type:i})},onValid:function(t){Ne(t,vw,{type:i,value:_f.getValue(t)})},onInvalid:function(t){Ne(t,bw,{type:i,value:_f.getValue(t)})}},validator:{validate:function(t){var n=_f.getValue(t),e=u(n)?mt.value(!0):mt.error(f("aria.input.invalid"));return Uy(e)},validateOnLoad:!1}})),gy.config({})]),onSetValue:function(t){qy.isInvalid(t)&&qy.run(t).get(ct)}})],s="hex"!==n?[dy.parts["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}}function h(t,n){var e=n.red,o=n.green,r=n.blue;_f.setValue(t,{red:e,green:o,blue:r})}function v(t,n){b.getOpt(t).each(function(t){ni(t.element,"background-color","#"+n.value)})}var b=Vm({dom:{tag:"div",classes:[d("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}});return xl({factory:function(){function a(t){return o[t].get()}function c(t,n){o[t].set(n)}function n(t,n){var e=n.event;"hex"!==e.type?c(e.type,ft.none()):g(t)}function e(t,n){var r,e,o,i,u=n.event;"hex"===u.type?function(t,n){m(t);var e=Ev(n);c("hex",ft.some(n));var o=Rv(e);h(t,o),s(o),Ne(t,dw,{hex:e}),v(t,e)}(t,u.value):(r=t,e=u.type,o=u.value,i=parseInt(o,10),c(e,ft.some(i)),a("red").bind(function(e){return a("green").bind(function(n){return a("blue").map(function(t){return Mv(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=Av(t),hw.getField(n,"hex").each(function(t){Rg.isFocused(t)||_f.setValue(n,{hex:e.value})}),e);Ne(r,dw,{hex:o}),v(r,o)}))}function t(t){return{label:f(xw+t+".label"),description:f(xw+t+".description")}}function s(t){var n=t.red,e=t.green,o=t.blue;c("red",ft.some(n)),c("green",ft.some(e)),c("blue",ft.some(o))}var o={red:wn(ft.some(255)),green:wn(ft.some(255)),blue:wn(ft.some(255)),hex:wn(ft.some("ffffff"))},r=t("red"),i=t("green"),u=t("blue"),l=t("hex");return Jn(hw.sketch(function(t){return{dom:{tag:"form",classes:[d("rgb-form")],attributes:{"aria-label":f("aria.color.picker")}},components:[t.field("red",dy.sketch(p(Fv,"red",r.label,r.description,255))),t.field("green",dy.sketch(p(Fv,"green",i.label,i.description,255))),t.field("blue",dy.sketch(p(Fv,"blue",u.label,u.description,255))),t.field("hex",dy.sketch(p(Dv,"hex",l.label,l.description,"ffffff"))),b.asSpec()],formBehaviours:Za([qy.config({invalidClass:d("form-invalid")}),lm("rgb-form-events",[Xe(vw,e),Xe(bw,n),Xe(yw,n)])])}}),{apis:{updateHex:function(t,n){var e;_f.setValue(t,{hex:n.value}),h(t,e=Rv(n)),s(e),v(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})}function u0(x,w){return xl({name:"ColourPicker",configFields:[Jt("dom"),dn("onValidHex",ct),dn("onInvalidHex",ct)],factory:function(t){function n(t,n,e){v.getOpt(t).each(function(t){g.setHue(t,e)})}function e(t,n){b.getOpt(t).each(function(t){m.updateHex(t,n)})}function r(n,e,o,t){var r=o,i=Rv(e);p.paletteRgba.set(i),p.paletteHue.set(r),dt(t,function(t){t(n,e,o)})}var o,i,u,a,c,s,l,f,d,m=i0(x,w,t.onValidHex,t.onInvalidHex),g=(l=w,f=fw.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[l("sv-palette-spectrum")]}}),d=fw.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[l("sv-palette-thumb")],innerHtml:"<div class="+l("sv-palette-inner-thumb")+' role="presentation"></div>'}}),xl({factory:function(t){var n=tt({x:0,y:0}),e=Za([id.config({find:ft.some}),Rg.config({})]);return fw.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[l("sv-palette")]},model:{mode:"xy",getInitialValue:n},rounded:!1,components:[f,d],onChange:function(t,n,e){Ne(t,gw,{value:e})},onInit:function(t,n,e,o){y(e.element.dom,Hv(cb))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,n,e){var o=e;y(n.components()[0].element.dom,Hv(Iv(Nv(o,100,100))))},setThumb:function(t,n,e){var o=n,r=Lv(Rv(e));fw.setValue(o,{x:r.saturation,y:100-r.value})}},extraApis:{}})),p={paletteRgba:wn(cb),paletteHue:wn(0)},h=Vm((i=fw.parts.spectrum({dom:{tag:"div",classes:[(o=w)("hue-slider-spectrum")],attributes:{role:"presentation"}}}),u=fw.parts.thumb({dom:{tag:"div",classes:[o("hue-slider-thumb")],attributes:{role:"presentation"}}}),fw.sketch({dom:{tag:"div",classes:[o("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:tt({y:0})},components:[i,u],sliderBehaviours:Za([Rg.config({})]),onChange:function(t,n,e){Ne(t,mw,{value:e})}}))),v=Vm(g.sketch({})),b=Vm(m.sketch({}));function y(t,n){var e,o,r=t.width,i=t.height,u=t.getContext("2d");null!==u&&(u.fillStyle=n,u.fillRect(0,0,r,i),(e=u.createLinearGradient(0,0,r,0)).addColorStop(0,"rgba(255,255,255,1)"),e.addColorStop(1,"rgba(255,255,255,0)"),u.fillStyle=e,u.fillRect(0,0,r,i),(o=u.createLinearGradient(0,0,0,i)).addColorStop(0,"rgba(0,0,0,0)"),o.addColorStop(1,"rgba(0,0,0,1)"),u.fillStyle=o,u.fillRect(0,0,r,i))}return{uid:t.uid,dom:t.dom,components:[v.asSpec(),h.asSpec(),b.asSpec()],behaviours:Za([lm("colour-picker-events",[Xe(dw,(s=[n,function(t,n,e){h.getOpt(t).each(function(t){fw.setValue(t,{y:100-e/360*100})})},function(t,n){v.getOpt(t).each(function(t){g.setThumb(t,n)})}],function(t,n){var e=n.event.hex;r(t,e,Lv(Rv(e)).hue,s)})),Xe(gw,(c=[e],function(t,n){var e=n.event.value,o=p.paletteHue.get();r(t,jv(Nv(o,e.x,100-e.y)),o,c)})),Xe(mw,(a=[n,e],function(t,n){var e=(100-n.event.value.y)/100*360,o=Lv(p.paletteRgba.get());r(t,jv(Nv(e,o.saturation,o.value)),e,a)}))]),id.config({find:function(t){return b.getOpt(t)}}),Bg.config({mode:"acyclic"})])}}})}function a0(t){return kw[t]}function c0(t,n,e){return _f.config(Jn({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))}function s0(r,i){function n(t,n){n.stop()}function e(t){return function(n,e){dt(t,function(t){t(n,e)})}}function o(t,n){var e;fd.isDisabled(t)||(e=n.event.raw,a(t,e.dataTransfer.files))}function u(t,n){var e=n.event.raw.target;a(t,e.files)}function a(t,n){var e,o;_f.setValue(t,(e=n,o=Ow.explode(i.getSetting("images_file_types","jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp","string")),F(rt(e),function(n){return T(o,function(t){return he(n.name.toLowerCase(),"."+t.toLowerCase())})}))),Ne(t,by,{name:r.name})}var c=Vm({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:Za([lm("input-file-events",[$e(bo()),$e(Bo())])])});return $b(r.label.map(function(t){return Qb(t,i)}),dy.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:Za([Dw([]),x0(),fd.config({}),Hg.config({toggleClass:"dragenter",toggleOnExecute:!1}),lm("dropzone-events",[Xe("dragenter",e([n,Hg.toggle])),Xe("dragleave",e([n,Hg.toggle])),Xe("dragover",n),Xe("drop",e([n,o])),Xe(vo(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:i.translate("Drop an image here")}},cp.sketch({dom:{tag:"button",innerHtml:i.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element.dom.click()},buttonBehaviours:Za([gy.config({}),qv(i.isDisabled),dv()])})]}]}}}}),["tox-form__group--stretched"],[])}function l0(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:Za([Rg.config({ignore:!0}),gy.config({})])}}function f0(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[l0([Bw]),t,l0([Aw])],behaviours:Za([Sw(1)])}}function d0(t,n){Ne(t,go(),{raw:{which:9,shiftKey:n}})}function m0(t,n){var e=n.element;Xr(e,Bw)?d0(t,!0):Xr(e,Aw)&&d0(t,!1)}function g0(t){return jb(t,["."+Bw,"."+Aw].join(","),O)}function p0(t,n){return Iw(document.createElement("canvas"),t,n)}function h0(t){var n=p0(t.width,t.height);return Fw(n).drawImage(t,0,0),n}function v0(t){return t.naturalWidth||t.width}function b0(t){return t.naturalHeight||t.height}(Hy=Py=Py||{})[Hy.HighlightFirst=0]="HighlightFirst",Hy[Hy.HighlightNone=1]="HighlightNone";function y0(o,t){return{uid:o.uid,dom:o.dom,components:t,behaviours:Qs(o.formBehaviours,[_f.config({store:{mode:"manual",getValue:function(t){return yt(ml(t,o),function(t,o){return t().bind(function(t){var n=id.getCurrent(t),e=new Error("Cannot find a current component to extract the value from for form part '"+o+"': "+Br(t.element));return n.fold(function(){return mt.error(e)},mt.value)}).map(_f.getValue)})},setValue:function(e,t){bt(t,function(n,t){ll(e,o,t).each(function(t){id.getCurrent(t).each(function(t){_f.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return ll(t,o,n).bind(id.getCurrent)}}}}function x0(){return id.config({find:ft.some})}function w0(t){return n=Sr,e=kr,c0(t,function(t){return n(t.element)},function(t,n){return e(t.element,n)});var n,e}var S0,k0,C0,O0,_0,T0=function(n,t){return n.getSystem().getByUid(t.uid+"-"+$y()).map(function(t){return function(){return mt.value(t)}}).getOrThunk(function(){return t.lazySink.fold(function(){return function(){return mt.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(t){return function(){return t(n)}})})},E0=tt([Jt("dom"),Jt("fetch"),Ku("onOpen"),Ju("onExecute"),dn("getHotspot",ft.some),dn("getAnchorOverrides",tt({})),zc(),Js("dropdownBehaviours",[Hg,Jy,Bg,Rg]),Jt("toggleClass"),dn("eventOrder",{}),rn("lazySink"),dn("matchWidth",!1),dn("useMinWidth",!1),rn("role")].concat(ix())),D0=tt([qf({schema:[Xu()],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Qy()]),B0=wl({name:"Dropdown",configFields:E0(),partFields:D0(),factory:function(n,t,e,o){function r(t){pf.getState(t).each(function(t){ep.highlightPrimary(t)})}function i(t,n){return Le(t),ft.some(!0)}var u,a={expand:function(t){Hg.isOn(t)||nx(n,h,t,o,ct,Py.HighlightNone).get(ct)},open:function(t){Hg.isOn(t)||nx(n,h,t,o,ct,Py.HighlightFirst).get(ct)},isOpen:Hg.isOn,close:function(t){Hg.isOn(t)&&nx(n,h,t,o,ct,Py.HighlightFirst).get(ct)},repositionMenus:function(t){Hg.isOn(t)&&rx(t)}};return{uid:n.uid,dom:n.dom,components:t,behaviours:Qs(n.dropdownBehaviours,[Hg.config({toggleClass:n.toggleClass,aria:{mode:"expanded"}}),Jy.config({others:{sandbox:function(t){return ox(n,t,{onOpen:function(){return Hg.on(t)},onClose:function(){return Hg.off(t)}})}}}),Bg.config({mode:"special",onSpace:i,onEnter:i,onDown:function(t,n){return B0.isOpen(t)?r(Jy.getCoupled(t,"sandbox")):B0.open(t),ft.some(!0)},onEscape:function(t,n){return B0.isOpen(t)?(B0.close(t),ft.some(!0)):ft.none()}}),Rg.config({})]),events:ym(ft.some(function(t){nx(n,h,t,o,r,Py.HighlightFirst).get(ct)})),eventOrder:st(st({},n.eventOrder),((u={})[Eo()]=["disabling","toggling","alloy.base.behaviour"],u)),apis:a,domModification:{attributes:st(st({"aria-haspopup":"true"},n.role.fold(function(){return{}},function(t){return{role:t}})),"button"===n.dom.tag?{type:kt(n.dom,"attributes").bind(function(t){return kt(t,"type")}).getOr("button")}:{})}}},apis:{open:function(t,n){return t.open(n)},expand:function(t,n){return t.expand(n)},close:function(t,n){return t.close(n)},isOpen:function(t,n){return t.isOpen(n)},repositionMenus:function(t,n){return t.repositionMenus(n)}}}),A0=xa({fields:[],name:"unselecting",active:Object.freeze({__proto__:null,events:function(){return Jo([Ue(So(),_)])},exhibit:function(){return Hr({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),M0=Ar("color-input-change"),F0=Ar("color-swatch-change"),I0=Ar("color-picker-cancel"),R0=Kf({schema:[Jt("dom")],name:"label"}),V0=ux("top-left"),P0=ux("top"),H0=ux("top-right"),z0=ux("right"),N0=ux("bottom-right"),L0=ux("bottom"),j0=ux("bottom-left"),W0=[R0,ux("left"),z0,P0,L0,V0,H0,j0,N0,Yf({name:"thumb",defaults:tt({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:Jo([Ke(eo(),t,"spectrum"),Ke(oo(),t,"spectrum"),Ke(ro(),t,"spectrum"),Ke(uo(),t,"spectrum"),Ke(ao(),t,"spectrum"),Ke(so(),t,"spectrum")])}}}),Yf({schema:[fe("mouseIsDown",function(){return wn(!1)})],name:"spectrum",overrides:function(e){function o(n,t){return r.getValueFromEvent(t).map(function(t){return r.setValueFrom(n,e,t)})}var r=e.model.manager;return{behaviours:Za([Bg.config({mode:"special",onLeft:function(t){return r.onLeft(t,e)},onRight:function(t){return r.onRight(t,e)},onUp:function(t){return r.onUp(t,e)},onDown:function(t){return r.onDown(t,e)}}),Rg.config({})]),events:Jo([Xe(eo(),o),Xe(oo(),o),Xe(uo(),o),Xe(ao(),function(t,n){e.mouseIsDown.get()&&o(t,n)})])}}})],U0=tt("slider.change.value"),G0="left",X0=Kx(-1),Y0=Kx(1),q0=ft.none,K0=ft.none,J0={"top-left":ft.none(),top:ft.none(),"top-right":ft.none(),right:ft.some(function(t,n){Mx(t,{x:gx(n)})}),"bottom-right":ft.none(),bottom:ft.none(),"bottom-left":ft.none(),left:ft.some(function(t,n){Mx(t,{x:lx(n)})})},$0=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=qx(t,n,e);return Yx(t,{x:o}),o},setToMin:function(t,n){Yx(t,{x:cx(n)})},setToMax:function(t,n){Yx(t,{x:dx(n)})},findValueOfOffset:qx,getValueFromEvent:function(t){return ax(t).map(function(t){return t.left})},findPositionOfValue:Jx,setPositionFromValue:function(t,n,e,o){var r=Bx(e),i=Jx(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),e),u=wi(n.element)/2;ni(n.element,"left",i-u+"px")},onLeft:X0,onRight:Y0,onUp:q0,onDown:K0,edgeActions:J0}),Q0=ft.none,Z0=ft.none,tw=Zx(-1),nw=Zx(1),ew={"top-left":ft.none(),top:ft.some(function(t,n){Mx(t,{y:fx(n)})}),"top-right":ft.none(),right:ft.none(),"bottom-right":ft.none(),bottom:ft.some(function(t,n){Mx(t,{y:px(n)})}),"bottom-left":ft.none(),left:ft.none()},ow=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=Qx(t,n,e);return $x(t,{y:o}),o},setToMin:function(t,n){$x(t,{y:sx(n)})},setToMax:function(t,n){$x(t,{y:mx(n)})},findValueOfOffset:Qx,getValueFromEvent:function(t){return ax(t).map(function(t){return t.top})},findPositionOfValue:t0,setPositionFromValue:function(t,n,e,o){var r=Bx(e),i=t0(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),e),u=vi(n.element)/2;ni(n.element,"top",i-u+"px")},onLeft:Q0,onRight:Z0,onUp:tw,onDown:nw,edgeActions:ew}),rw=ax,iw=o0(-1,!1),uw=o0(1,!1),aw=o0(-1,!0),cw=o0(1,!0),sw={"top-left":ft.some(function(t,n){Mx(t,Ax(lx(n),fx(n)))}),top:ft.some(function(t,n){Mx(t,Ax(yx(n),fx(n)))}),"top-right":ft.some(function(t,n){Mx(t,Ax(gx(n),fx(n)))}),right:ft.some(function(t,n){Mx(t,Ax(gx(n),xx(n)))}),"bottom-right":ft.some(function(t,n){Mx(t,Ax(gx(n),px(n)))}),bottom:ft.some(function(t,n){Mx(t,Ax(yx(n),px(n)))}),"bottom-left":ft.some(function(t,n){Mx(t,Ax(lx(n),px(n)))}),left:ft.some(function(t,n){Mx(t,Ax(lx(n),xx(n)))})},lw=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=e0(qx(t,n,e.left),Qx(t,n,e.top));return n0(t,o),o},setToMin:function(t,n){n0(t,e0(cx(n),sx(n)))},setToMax:function(t,n){n0(t,e0(dx(n),mx(n)))},getValueFromEvent:rw,setPositionFromValue:function(t,n,e,o){var r=Bx(e),i=Jx(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),e),u=t0(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),e),a=wi(n.element)/2,c=vi(n.element)/2;ni(n.element,"left",i-a+"px"),ni(n.element,"top",u-c+"px")},onLeft:iw,onRight:uw,onUp:aw,onDown:cw,edgeActions:sw}),fw=wl({name:"Slider",configFields:[dn("stepSize",1),dn("onChange",ct),dn("onChoose",ct),dn("onInit",ct),dn("onDragStart",ct),dn("onDragEnd",ct),dn("snapToGrid",!1),dn("rounded",!0),rn("snapStart"),$t("model",qt("mode",{x:[dn("minX",0),dn("maxX",100),fe("value",function(t){return wn(t.mode.minX)}),Jt("getInitialValue"),Zu("manager",$0)],y:[dn("minY",0),dn("maxY",100),fe("value",function(t){return wn(t.mode.minY)}),Jt("getInitialValue"),Zu("manager",ow)],xy:[dn("minX",0),dn("maxX",100),dn("minY",0),dn("maxY",100),fe("value",function(t){return wn({x:t.mode.minX,y:t.mode.minY})}),Jt("getInitialValue"),Zu("manager",lw)]})),Js("sliderBehaviours",[Bg,_f]),fe("mouseIsDown",function(){return wn(!1)})],partFields:W0,factory:function(i,t,n,e){function u(t){return fl(t,i,"thumb")}function a(t){return fl(t,i,"spectrum")}function o(t){return ll(t,i,"left-edge")}function r(t){return ll(t,i,"right-edge")}function c(t){return ll(t,i,"top-edge")}function s(t){return ll(t,i,"bottom-edge")}function l(t,n){v.setPositionFromValue(t,n,i,{getLeftEdge:o,getRightEdge:r,getTopEdge:c,getBottomEdge:s,getSpectrum:a})}function f(t,n){h.value.set(n),l(t,u(t))}function d(e){var t=i.mouseIsDown.get();i.mouseIsDown.set(!1),t&&ll(e,i,"thumb").each(function(t){var n=h.value.get();i.onChoose(e,t,n)})}function m(t,n){n.stop(),i.mouseIsDown.set(!0),i.onDragStart(t,u(t))}function g(t,n){n.stop(),i.onDragEnd(t,u(t)),d(t)}var p,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:t,behaviours:Qs(i.sliderBehaviours,[Bg.config({mode:"special",focusIn:function(t){return ll(t,i,"spectrum").map(Bg.focusIn).map(_)}}),_f.config({store:{mode:"manual",getValue:function(t){return h.value.get()}}}),oc.config({channels:((p={})[bf()]={onReceive:d},p)})]),events:Jo([Xe(U0(),function(t,n){!function(t,n){f(t,n);var e=u(t);i.onChange(t,e,n),ft.some(!0)}(t,n.event.value)}),$o(function(t,n){var e=h.getInitialValue();h.value.set(e);var o=u(t);l(t,o);var r=a(t);i.onInit(t,o,r,h.value.get())}),Xe(eo(),m),Xe(ro(),g),Xe(uo(),m),Xe(so(),g)]),apis:{resetToMin:function(t){v.setToMin(t,i)},resetToMax:function(t){v.setToMax(t,i)},setValue:f,refresh:l},domModification:{styles:{position:"relative"}}}},apis:{setValue:function(t,n,e){t.setValue(n,e)},resetToMin:function(t,n){t.resetToMin(n)},resetToMax:function(t,n){t.resetToMax(n)},refresh:function(t,n){t.refresh(n)}}}),dw=Ar("rgb-hex-update"),mw=Ar("slider-update"),gw=Ar("palette-update"),pw=[Js("formBehaviours",[_f])],hw={getField:Vr(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n={field:function(t,n){return e.push(t),il("form",r0(t),n)},record:tt(e=[])},o=t(n),r=A(n.record(),function(t){return Yf({name:t,pname:r0(t)})});return yl("form",pw,r,y0,o)}},vw=Ar("valid-input"),bw=Ar("invalid-input"),yw=Ar("validating-input"),xw="colorcustom.rgb.",ww=function(t){return id.config({find:t.getOpt})},Sw=function(t){return id.config({find:function(n){return lr(n.element,t).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}})},kw={"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"},Cw=tinymce.util.Tools.resolve("tinymce.Resource"),Ow=tinymce.util.Tools.resolve("tinymce.util.Tools"),_w=te([dn("preprocess",h),dn("postprocess",h)]),Tw=function(r,t){var i=Yt("RepresentingConfigs.memento processors",_w,t);return _f.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=_f.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);_f.setValue(o,e)}}})},Ew=c0,Dw=function(t){return _f.config({store:{mode:"memory",initialValue:t}})},Bw=Ar("alloy-fake-before-tabstop"),Aw=Ar("alloy-fake-after-tabstop"),Mw=!(Be().browser.isIE()||Be().browser.isEdge()),Fw=function(t){return t.getContext("2d")},Iw=function(t,n,e){return t.width=n,t.height=e,t},Rw=window.Promise||(S0=window,k0=Vw.immediateFn||"function"==typeof S0.setImmediate&&S0.setImmediate||function(t){return setTimeout(t,1)},C0=function(e,o){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.apply(o,t)}},O0=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},_0=function(t,n,e){var o=!1;try{t(function(t){o||(o=!0,n(t))},function(t){o||(o=!0,e(t))})}catch(t){if(o)return;o=!0,e(t)}},Vw.prototype.catch=function(t){return this.then(null,t)},Vw.prototype.then=function(e,o){var r=this;return new Vw(function(t,n){Pw.call(r,new Lw(e,o,t,n))})},Vw.all=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var a=Array.prototype.slice.call(1===t.length&&O0(t[0])?t[0]:t);return new Vw(function(o,r){if(0===a.length)return o([]);for(var i=a.length,u=function(n,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void e.call(t,function(t){u(n,t)},r)}a[n]=t,0==--i&&o(a)}catch(t){r(t)}},t=0;t<a.length;t++)u(t,a[t])})},Vw.resolve=function(n){return n&&"object"==typeof n&&n.constructor===Vw?n:new Vw(function(t){t(n)})},Vw.reject=function(e){return new Vw(function(t,n){n(e)})},Vw.race=function(r){return new Vw(function(t,n){for(var e=0,o=r;e<o.length;e++)o[e].then(t,n)})},Vw);function Vw(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],_0(t,C0(Hw,this),C0(zw,this))}function Pw(e){var o=this;null!==this._state?k0(function(){var t,n=o._state?e.onFulfilled:e.onRejected;if(null!==n){try{t=n(o._value)}catch(t){return void e.reject(t)}e.resolve(t)}else(o._state?e.resolve:e.reject)(o._value)}):this._deferreds.push(e)}function Hw(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void _0(C0(n,t),C0(Hw,this),C0(zw,this))}this._state=!0,this._value=t,Nw.call(this)}catch(t){zw.call(this,t)}}function zw(t){this._state=!1,this._value=t,Nw.call(this)}function Nw(){for(var t=0,n=this._deferreds;t<n.length;t++){var e=n[t];Pw.call(this,e)}this._deferreds=[]}function Lw(t,n,e,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof n?n:null,this.resolve=e,this.reject=o}function jw(t,o,r){return o=o||"image/png",m(HTMLCanvasElement.prototype.toBlob)?new Rw(function(n,e){t.toBlob(function(t){t?n(t):e()},o,r)}):(g=t.toDataURL(o,r),new Rw(function(t,n){!function(){var t=g.split(","),n=/data:([^;]+)/.exec(t[0]);if(!n)return ft.none();for(var e=n[1],o=t[1],r=atob(o),i=r.length,u=Math.ceil(i/1024),a=new Array(u),c=0;c<u;++c){for(var s=1024*c,l=Math.min(1024+s,i),f=new Array(l-s),d=s,m=0;d<l;++m,++d)f[m]=r[d].charCodeAt(0);a[c]=new Uint8Array(f)}return ft.some(new Blob(a,{type:e}))}().fold(function(){n("uri is not base64: "+g)},t)}));var g}function Ww(t,n,e){function o(n,e){return t.then(function(t){return t.toDataURL(n||"image/png",e)})}return{getType:tt(n.type),toBlob:function(){return Rw.resolve(n)},toDataURL:tt(e),toBase64:function(){return e.split(",")[1]},toAdjustedBlob:function(n,e){return t.then(function(t){return jw(t,n,e)})},toAdjustedDataURL:o,toAdjustedBase64:function(t,n){return o(t,n).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(h0)}}}function Uw(n,t){return jw(n,t).then(function(t){return Ww(Rw.resolve(n),t,n.toDataURL())})}function Gw(n){return e=n,new Rw(function(t){var n=new FileReader;n.onloadend=function(){t(n.result)},n.readAsDataURL(e)}).then(function(t){return Ww((a=n,new Rw(function(t,n){function e(){r.removeEventListener("load",i),r.removeEventListener("error",u)}var o=URL.createObjectURL(a),r=new Image,i=function(){e(),t(r)},u=function(){e(),n("Unable to load data of type "+a.type+": "+o)};r.addEventListener("load",i),r.addEventListener("error",u),r.src=o,r.complete&&setTimeout(i,0)}).then(function(t){MS(t);var n=p0(v0(t),b0(t));return Fw(n).drawImage(t,0,0),n})),n,t);var a});var e}function Xw(t,n,e){var o="string"==typeof t?parseFloat(t):t;return e<o?o=e:o<n&&(o=n),o}function Yw(){return[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1]}function qw(t,n){for(var e=[],o=new Array(25),r=0;r<5;r++){for(var i=0;i<5;i++)e[i]=n[i+5*r];for(i=0;i<5;i++){for(var u=0,a=0;a<5;a++)u+=t[i+5*a]*e[a];o[i+5*r]=u}}return o}function Kw(n,e){return n.toCanvas().then(function(t){return IS(t,n.getType(),e)})}function Jw(e){return function(t,n){return Kw(t,e(Yw(),n))}}function $w(t,n){void 0===n&&(n=2);var e=Math.pow(10,n),o=Math.round(t*e);return Math.ceil(o/e)}function Qw(t){return RS(t)}function Zw(t){return HS(t)}function tS(t,n){return zS(t,n)}function nS(t,n){return VS(t,n)}function eS(t,n){return PS(t,n)}function oS(t,n){return o=n,(e=t).toCanvas().then(function(t){return WS(t,e.getType(),o)});var e,o}function rS(t,n){return o=n,(e=t).toCanvas().then(function(t){return jS(t,e.getType(),o)});var e,o}function iS(t,n,e){return Wm(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:e},n)}function uS(t,n){return iS(t,n,[])}function aS(t,n){return iS(t,n,[Mg.config({})])}function cS(t,n,e){return{dom:{tag:"span",innerHtml:e.translate(t),classes:[n+"__select-label"]},behaviours:Za([Mg.config({})])}}function sS(n,e,o){function t(t,n){var e=_f.getValue(t);return Rg.focus(e),Ne(e,"keydown",{raw:n.event.raw}),B0.close(e),ft.some(!0)}var r=wn(ct),i=n.text.map(function(t){return Vm(cS(t,e,o.providers))}),u=n.icon.map(function(t){return Vm(aS(t,o.providers.icons))}),a=n.role.fold(function(){return{}},function(t){return{role:t}}),c=n.tooltip.fold(function(){return{}},function(t){var n=o.providers.translate(t);return{title:n,"aria-label":n}}),s=Wm("chevron-down",{tag:"div",classes:[e+"__select-chevron"]},o.providers.icons);return Vm(B0.sketch(st(st(st({},n.uid?{uid:n.uid}:{}),a),{dom:{tag:"button",classes:[e,e+"--select"].concat(A(n.classes,function(t){return e+"--"+t})),attributes:st({},c)},components:$v([u.map(function(t){return t.asSpec()}),i.map(function(t){return t.asSpec()}),ft.some(s)]),matchWidth:!0,useMinWidth:!0,dropdownBehaviours:Za(H(H([],n.dropdownBehaviours),[qv(function(){return n.disabled||o.providers.isDisabled()}),dv(),A0.config({}),Mg.config({}),lm("dropdown-events",[gv(n,r),pv(n,r)]),lm("menubutton-update-display-text",[Xe(YS,function(n,e){i.bind(function(t){return t.getOpt(n)}).each(function(t){Mg.set(t,[pi(o.providers.translate(e.event.text))])})}),Xe(qS,function(n,e){u.bind(function(t){return t.getOpt(n)}).each(function(t){Mg.set(t,[aS(e.event.icon,o.providers.icons)])})})])])),eventOrder:Jn(XS,{mousedown:["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]}),sandboxBehaviours:Za([Bg.config({mode:"special",onLeft:t,onRight:t})]),lazySink:o.getSink,toggleClass:e+"--active",parts:{menu:Jp(0,n.columns,n.presets)},fetch:function(t){return Wy(S(n.fetch,t))}}))).asSpec()}function lS(t){return"separator"===t.type}function fS(t,e,o,n){var r=Ar("primary-menu"),i=JS(t,o.shared.providers.menuItems());if(0===i.items.length)return ft.none();var u=Nb(r,i.items,e,o,n),a=yt(i.menus,function(t,n){return Nb(n,t,e,o,!1)}),c=Jn(a,Ae(r,u));return ft.from(ep.tieredData(r,c,i.expansions))}function dS(e){return{isDisabled:function(){return fd.isDisabled(e)},setDisabled:function(t){return fd.set(e,t)},setActive:function(t){var n=e.element;t?(Ur(n,"tox-tbtn--enabled"),Or(n,"aria-pressed",!0)):(Gr(n,"tox-tbtn--enabled"),Dr(n,"aria-pressed"))},isActive:function(){return Xr(e.element,"tox-tbtn--enabled")}}}function mS(e,t,o,n){return sS({text:e.text,icon:e.icon,tooltip:e.tooltip,role:n,fetch:function(t,n){e.fetch(function(t){n(fS(t,yh.CLOSE_ON_EXECUTE,o,!1))})},onSetup:e.onSetup,getApi:dS,columns:1,presets:"normal",classes:[],dropdownBehaviours:[gy.config({})]},t,o.shared)}function gS(t,n,e,o,r,i){void 0===e&&(e=[]);var u=n.fold(function(){return{}},function(t){return{action:t}}),a=st({buttonBehaviours:Za([qv(function(){return t.disabled||i.isDisabled()}),dv(),gy.config({}),lm("button press",[Ge("click"),Ge("mousedown")])].concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},u),c=Jn(a,{dom:o});return Jn(c,{components:r})}function pS(t,n,e,o){void 0===o&&(o=[]);var r={tag:"button",classes:["tox-tbtn"],attributes:t.tooltip.map(function(t){return{"aria-label":e.translate(t),title:e.translate(t)}}).getOr({})},i=t.icon.map(function(t){return uS(t,e.icons)});return gS(t,n,o,r,$v([i]),e)}function hS(t,n,e,o){void 0===o&&(o=[]);var r=pS(t,ft.some(n),e,o);return cp.sketch(r)}function vS(t,n,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=e.translate(t.text),u=t.icon?t.icon.map(function(t){return uS(t,e.icons)}):ft.none(),a=u.isSome()?$v([u]):[],c=u.isSome()?{}:{innerHtml:i},s=H(H(H(H([],t.primary||t.borderless?["tox-button"]:["tox-button","tox-button--secondary"]),u.isSome()?["tox-button--icon"]:[]),t.borderless?["tox-button--naked"]:[]),r);return gS(t,n,o,st(st({tag:"button",classes:s},c),{attributes:{title:i}}),a,e)}function bS(t,n,e,o,r){void 0===o&&(o=[]),void 0===r&&(r=[]);var i=vS(t,ft.some(n),e,o,r);return cp.sketch(i)}function yS(n,e){return function(t){"custom"===e?Ne(t,wy,{name:n,value:{}}):"submit"===e?ze(t,Sy):"cancel"===e?ze(t,xy):console.error("Unknown button type: ",e)}}function xS(n,t,e){if("menu"===t){var o=n,r=Vm(mS(st(st({},n),{onSetup:function(t){return t.setDisabled(n.disabled),ct},fetch:(i=o.items,u=function(){return r},a=e,function(t){t(A(i,function(t){var n,e,o=t.text.fold(function(){return{}},function(t){return{text:t}});return st(st({type:t.type,active:!1},o),{onAction:function(t){var n=!t.isActive();t.setActive(n),e.storage.set(n),a.shared.getSink().each(function(t){u().getOpt(t).each(function(t){Sa(t.element),Ne(t,wy,{name:e.name,value:e.storage.get()})})})},onSetup:(n=e=t,function(t){t.setActive(n.storage.get())})})}))})}),"tox-tbtn",e,ft.none()));return r.asSpec()}var i,u,a;if("custom"===t||"cancel"===t||"submit"===t){var c=yS(n.name,t);return bS(st(st({},n),{borderless:!1}),c,e.shared.providers,[])}console.error("Unknown footer button type: ",t)}function wS(t,n){return Yf({factory:dy,name:t,overrides:function(o){return{fieldBehaviours:Za([lm("coupled-input-behaviour",[Xe(ho(),function(e){ll(e,o,n).bind(id.getCurrent).each(function(n){ll(e,o,"lock").each(function(t){Hg.isOn(t)&&o.onLockedChange(e,n,t)})})})])])}}})}function SS(t){var n=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null===n)return mt.error(t);var e=parseFloat(n[1]),o=n[2];return mt.value({value:e,unit:o})}function kS(t,n){function e(t){return Kn(o,t)}var o={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1};return t.unit===n?ft.some(t.value):e(t.unit)&&e(n)?o[t.unit]===o[n]?ft.some(t.value):ft.some(t.value/o[t.unit]*o[n]):ft.none()}function CS(t){return ft.none()}function OS(o,n){function t(t){return Wm(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},n.icons)}function e(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}}function r(e){return dy.parts.field({factory:Ey,inputClasses:["tox-textfield"],inputBehaviours:Za([fd.config({disabled:function(){return o.disabled||n.isDisabled()}}),dv(),gy.config({}),lm("size-input-events",[Xe(fo(),function(t,n){Ne(t,u,{isField1:e})}),Xe(vo(),function(t,n){Ne(t,by,{name:o.name})})])]),selectOnFocus:!1})}function i(t){return{dom:{tag:"label",classes:["tox-label"],innerHtml:n.translate(t)}}}var l=CS,u=Ar("ratio-event"),a=ZS.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{title:n.translate(o.label.getOr("Constrain proportions"))}},components:[t("lock"),t("unlock")],buttonBehaviours:Za([fd.config({disabled:function(){return o.disabled||n.isDisabled()}}),dv(),gy.config({})])}),c=ZS.parts.field1(e([dy.parts.label(i("Width")),r(!0)])),s=ZS.parts.field2(e([dy.parts.label(i("Height")),r(!1)]));return ZS.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[c,s,e([i("&nbsp;"),a])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,i,n){SS(_f.getValue(t)).each(function(t){l(t).each(function(t){var n,e,o,r;_f.setValue(i,(r=-1!==(r=(n=t).value.toFixed((e=n.unit)in(o={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4})?o[e]:1)).indexOf(".")?r.replace(/\.?0*$/,""):r)+n.unit)})})},coupledFieldBehaviours:Za([fd.config({disabled:function(){return o.disabled||n.isDisabled()},onDisabled:function(t){ZS.getField1(t).bind(dy.getField).each(fd.disable),ZS.getField2(t).bind(dy.getField).each(fd.disable),ZS.getLock(t).each(fd.disable)},onEnabled:function(t){ZS.getField1(t).bind(dy.getField).each(fd.enable),ZS.getField2(t).bind(dy.getField).each(fd.enable),ZS.getLock(t).each(fd.enable)}}),dv(),lm("size-input-events2",[Xe(u,function(t,n){var e,o,r,i=n.event.isField1,u=i?ZS.getField1(t):ZS.getField2(t),a=i?ZS.getField2(t):ZS.getField1(t),c=u.map(_f.getValue).getOr(""),s=a.map(_f.getValue).getOr("");e=s,o=SS(c).toOptional(),r=SS(e).toOptional(),l=fu(o,r,function(t,o){return kS(t,o.unit).map(function(t){return o.value/t}).map(function(t){return n=t,e=o.unit,function(t){return kS(t,e).map(function(t){return{value:t*n,unit:e}})};var n,e}).getOr(CS)}).getOr(CS)})])])})}function _S(f,c){function t(t,n,e,o){return Vm(bS({name:t,text:t,disabled:e,primary:o,icon:ft.none(),borderless:!1},n,c))}function n(t,n,e,o){return Vm(hS({name:t,icon:ft.some(t),tooltip:ft.some(n),disabled:o,primary:!1,borderless:!1},e,c))}function d(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(fd)&&fd.disable(n)})}function m(t,e){t.map(function(t){var n=t.get(e);n.hasConfigured(fd)&&fd.enable(n)})}function r(t,n,e){Ne(t,n,e)}function i(t){return ze(t,rk.disable()),0}function u(t){return ze(t,rk.enable()),0}function g(t,n){i(t),r(t,tk.transform(),{transform:n}),u(t)}function e(t){return function(){q.getOpt(t).each(function(t){Mg.set(t,[Y])})}}function s(t,n){i(t),r(t,tk.transformApply(),{transform:n,swap:e(t)}),u(t)}function p(){return t("Back",function(t){return r(t,tk.back(),{swap:e(t)})},!1,!1)}function o(){return Vm({dom:{tag:"div",classes:["tox-spacer"]},behaviours:Za([fd.config({})])})}function h(){return t("Apply",function(t){return r(t,tk.apply(),{swap:e(t)})},!0,!0)}function v(n,e){return function(t){return n(t,e)}}function a(t,n){var e,o=n;i(e=t),r(e,tk.tempTransform(),{transform:o}),u(e)}function b(t,n,e,o,r){var i=fw.parts.label({dom:{tag:"label",classes:["tox-label"],innerHtml:c.translate(t)}}),u=fw.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),a=fw.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return Vm(fw.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:e,maxX:r,getInitialValue:tt({x:o})},components:[i,u,a],sliderBehaviours:Za([Rg.config({})]),onChoose:n}))}function l(t,n,e,o,r){var i,u,a,c,s,l,f=(i=t,u=n,a=e,c=o,s=r,[p(),(l=u,b(i,function(t,n,e){g(t,v(l,e.x/100))},a,c,s)),h()]);return sy.sketch({dom:w,components:f.map(function(t){return t.asSpec()}),containerBehaviours:Za([lm("image-tools-filter-panel-buttons-events",[Xe(rk.disable(),function(t,n){d(f,t)}),Xe(rk.enable(),function(t,n){m(f,t)})])])})}function y(t){return b(t,function(l,t,n){var e=z.getOpt(l),o=L.getOpt(l),r=N.getOpt(l);e.each(function(s){o.each(function(c){r.each(function(t){var o,r,i,n=_f.getValue(s).x/100,e=_f.getValue(t).x/100,u=_f.getValue(c).x/100,a=(o=n,r=e,i=u,function(t){return Kw(t,(n=r,e=i,qw(Yw(),[Xw(o,0,2),0,0,0,0,0,Xw(n,0,2),0,0,0,0,0,Xw(e,0,2),0,0,0,0,0,1,0,0,0,0,0,1])));var n,e});g(l,a)})})})},0,100,200)}function x(n,e,o){return function(t){r(t,tk.swap(),{transform:e,swap:function(){q.getOpt(t).each(function(t){Mg.set(t,[n]),o(t)})}})}}var w={tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools-edit-panel"]},S=ct,k=[p(),o(),t("Apply",function(t){s(t,function(t){var n,e,o,r,i,u,a,c,s,l=f.getRect();return n=l.x,e=l.y,o=l.w,r=l.h,u=n,a=e,c=o,s=r,(i=t).toCanvas().then(function(t){return US(t,i.getType(),u,a,c,s)})}),f.hideCrop()},!1,!0)],C=sy.sketch({dom:w,components:k.map(function(t){return t.asSpec()}),containerBehaviours:Za([lm("image-tools-crop-buttons-events",[Xe(rk.disable(),function(t,n){d(k,t)}),Xe(rk.enable(),function(t,n){m(k,t)})])])}),O=Vm(OS({name:"size",label:ft.none(),constrain:!0,disabled:!1},c)),_=[p(),o(),O,o(),t("Apply",function(a){O.getOpt(a).each(function(t){var r,i,n=_f.getValue(t),e=parseInt(n.width,10),o=parseInt(n.height,10),u=(r=e,i=o,function(t){return e=r,o=i,(n=t).toCanvas().then(function(t){return NS(t,e,o).then(function(t){return Uw(t,n.getType())})});var n,e,o});s(a,u)})},!1,!0)],T=sy.sketch({dom:w,components:_.map(function(t){return t.asSpec()}),containerBehaviours:Za([lm("image-tools-resize-buttons-events",[Xe(rk.disable(),function(t,n){d(_,t)}),Xe(rk.enable(),function(t,n){m(_,t)})])])}),E=v(oS,"h"),D=v(oS,"v"),B=v(rS,-90),A=v(rS,90),M=[p(),o(),n("flip-horizontally","Flip horizontally",function(t){a(t,E)},!1),n("flip-vertically","Flip vertically",function(t){a(t,D)},!1),n("rotate-left","Rotate counterclockwise",function(t){a(t,B)},!1),n("rotate-right","Rotate clockwise",function(t){a(t,A)},!1),o(),h()],F=sy.sketch({dom:w,components:M.map(function(t){return t.asSpec()}),containerBehaviours:Za([lm("image-tools-fliprotate-buttons-events",[Xe(rk.disable(),function(t,n){d(M,t)}),Xe(rk.enable(),function(t,n){m(M,t)})])])}),I=[p(),o(),h()],R=sy.sketch({dom:w,components:I.map(function(t){return t.asSpec()})}),V=l("Brightness",nS,-100,0,100),P=l("Contrast",eS,-100,0,100),H=l("Gamma",tS,-100,0,100),z=y("R"),N=y("G"),L=y("B"),j=[p(),z,N,L,h()],W=sy.sketch({dom:w,components:j.map(function(t){return t.asSpec()})}),U=ft.some(Zw),G=ft.some(Qw),X=[n("crop","Crop",x(C,ft.none(),function(t){f.showCrop()}),!1),n("resize","Resize",x(T,ft.none(),function(t){O.getOpt(t).each(function(t){var n=f.getMeasurements(),e=n.width,o=n.height;_f.setValue(t,{width:e,height:o})})}),!1),n("orientation","Orientation",x(F,ft.none(),S),!1),n("brightness","Brightness",x(V,ft.none(),S),!1),n("sharpen","Sharpen",x(R,U,S),!1),n("contrast","Contrast",x(P,ft.none(),S),!1),n("color-levels","Color levels",x(W,ft.none(),S),!1),n("gamma","Gamma",x(H,ft.none(),S),!1),n("invert","Invert",x(R,G,S),!1)],Y=sy.sketch({dom:w,components:X.map(function(t){return t.asSpec()})}),q=Vm(sy.sketch({dom:{tag:"div"},components:[Y],containerBehaviours:Za([Mg.config({})])}));return{memContainer:q,getApplyButton:function(t){return q.getOpt(t).map(function(t){var n=t.components()[0];return n.components()[n.components().length-1]})}}}function TS(t){var n,e;if(t.changedTouches)for(n="screenX screenY pageX pageY clientX clientY".split(" "),e=0;e<n.length;e++)t[n[e]]=t.changedTouches[0][n[e]]}var ES,DS,BS,AS,MS=function(t){URL.revokeObjectURL(t.src)},FS=[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],IS=function(t,n,T){var e=Fw(t),o=function(t){for(var n,e,o,r,i=t.data,u=T[0],a=T[1],c=T[2],s=T[3],l=T[4],f=T[5],d=T[6],m=T[7],g=T[8],p=T[9],h=T[10],v=T[11],b=T[12],y=T[13],x=T[14],w=T[15],S=T[16],k=T[17],C=T[18],O=T[19],_=0;_<i.length;_+=4)n=i[_],e=i[_+1],o=i[_+2],r=i[_+3],i[_]=n*u+e*a+o*c+r*s+l,i[_+1]=n*f+e*d+o*m+r*g+p,i[_+2]=n*h+e*v+o*b+r*y+x,i[_+3]=n*w+e*S+o*k+r*C+O;return t}(e.getImageData(0,0,t.width,t.height));return e.putImageData(o,0,0),Uw(t,n)},RS=(ES=[-1,0,0,0,255,0,-1,0,0,255,0,0,-1,0,255,0,0,0,1,0,0,0,0,0,1],function(t){return Kw(t,ES)}),VS=Jw(function(t,n){return qw(t,[1,0,0,0,n=Xw(255*n,-255,255),0,1,0,0,n,0,0,1,0,n,0,0,0,1,0,0,0,0,0,1])}),PS=Jw(function(t,n){var e;return n=Xw(n,-1,1),qw(t,[(e=(n*=100)<0?127+n/100*127:127*(0==(e=n%1)?FS[n]:FS[Math.floor(n)]*(1-e)+FS[Math.floor(n)+1]*e)+127)/127,0,0,0,.5*(127-e),0,e/127,0,0,.5*(127-e),0,0,e/127,0,.5*(127-e),0,0,0,1,0,0,0,0,0,1])}),HS=(DS=[0,-1,0,-1,5,-1,0,-1,0],function(t){return a=DS,(u=t).toCanvas().then(function(t){return n=t,e=u.getType(),o=a,r=Fw(n),i=function(t,n,e){for(var o=function(t,n,e){return e<t?t=e:t<n&&(t=n),t},r=Math.round(Math.sqrt(e.length)),i=Math.floor(r/2),u=t.data,a=n.data,c=t.width,s=t.height,l=0;l<s;l++)for(var f=0;f<c;f++){for(var d=0,m=0,g=0,p=0;p<r;p++)for(var h=0;h<r;h++){var v=o(f+h-i,0,c-1),b=4*(o(l+p-i,0,s-1)*c+v),y=e[p*r+h];d+=u[b]*y,m+=u[1+b]*y,g+=u[2+b]*y}var x=4*(l*c+f);a[x]=o(d,0,255),a[1+x]=o(m,0,255),a[2+x]=o(g,0,255)}return n}(r.getImageData(0,0,n.width,n.height),r.getImageData(0,0,n.width,n.height),o),r.putImageData(i,0,0),Uw(n,e);var n,e,o,r,i});var u,a}),zS=(BS=function(t,n){return 255*Math.pow(t/255,1-n)},function(n,e){return n.toCanvas().then(function(t){return function(t,n,e){for(var o=Fw(t),r=new Array(256),i=0;i<r.length;i++)r[i]=BS(i,e);var u=function(t,n){for(var e=t.data,o=0;o<e.length;o+=4)e[o]=n[e[o]],e[o+1]=n[e[o+1]],e[o+2]=n[e[o+2]];return t}(o.getImageData(0,0,t.width,t.height),r);return o.putImageData(u,0,0),Uw(t,n)}(t,n.getType(),e)})}),NS=function(t,n,e){var o=v0(t),r=b0(t),i=n/o,u=e/r,a=!1;(i<.5||2<i)&&(i=i<.5?.5:2,a=!0),(u<.5||2<u)&&(u=u<.5?.5:2,a=!0);var c=LS(t,i,u);return a?c.then(function(t){return NS(t,n,e)}):c},LS=function(u,a,c){return new Rw(function(t){var n=v0(u),e=b0(u),o=Math.floor(n*a),r=Math.floor(e*c),i=p0(o,r);Fw(i).drawImage(u,0,0,n,e,0,0,o,r),t(i)})},jS=function(t,n,e){var o=(e<0?360+e:e)*Math.PI/180,r=t.width,i=t.height,u=Math.sin(o),a=Math.cos(o),c=$w(Math.abs(r*a)+Math.abs(i*u)),s=$w(Math.abs(r*u)+Math.abs(i*a)),l=p0(c,s),f=Fw(l);return f.translate(c/2,s/2),f.rotate(o),f.drawImage(t,-r/2,-i/2),Uw(l,n)},WS=function(t,n,e){var o=p0(t.width,t.height),r=Fw(o);return"v"===e?(r.scale(1,-1),r.drawImage(t,0,-o.height)):(r.scale(-1,1),r.drawImage(t,-o.width,0)),Uw(o,n)},US=function(t,n,e,o,r,i){var u=p0(r,i);return Fw(u).drawImage(t,-e,-o),Uw(u,n)},GS=Ar("toolbar.button.execute"),XS=((AS={})[Eo()]=["disabling","alloy.base.behaviour","toggling","toolbar-button-events"],AS),YS=Ar("update-menu-text"),qS=Ar("update-menu-icon"),KS={type:"separator"},JS=function(t,l){var n,e,o;return I((n=y(t)?t.split(" "):t,e=l,0<(o=R(n,function(t,n){return y(n)?""===n?t:"|"===n?0<t.length&&!lS(t[t.length-1])?t.concat([KS]):t:Kn(e,n.toLowerCase())?t.concat([e[n.toLowerCase()]]):t:t.concat([n])},[])).length&&lS(o[o.length-1])&&o.pop(),o),function(t,n){var e,o,r,i,u,a,c=function(t){if(lS(t))return t;var n=kt(t,"value").getOrThunk(function(){return Ar("generated-menu-item")});return Jn({value:n},t)}(n),s=(o=l,Kn(e=c,"getSubmenuItems")?(i=o,u=(r=e).getSubmenuItems(),a=JS(u,i),{item:r,menus:Jn(a.menus,Ae(r.value,a.items)),expansions:Jn(a.expansions,Ae(r.value,r.value))}):{item:e,menus:{},expansions:{}});return{menus:Jn(t.menus,s.menus),items:[s.item].concat(t.items),expansions:Jn(t.expansions,s.expansions)}},{menus:{},expansions:{},items:[]})},$S=tt([dn("field1Name","field1"),dn("field2Name","field2"),$u("onLockedChange"),Yu(["lockClass"]),dn("locked",!1),Tf("coupledFieldBehaviours",[id,_f])]),QS=tt([wS("field1","field2"),wS("field2","field1"),Yf({factory:cp,schema:[Jt("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:Za([Hg.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),ZS=wl({name:"FormCoupledInputs",configFields:$S(),partFields:QS(),factory:function(o,t,n,e){return{uid:o.uid,dom:o.dom,components:t,behaviours:Ef(o.coupledFieldBehaviours,[id.config({find:ft.some}),_f.config({store:{mode:"manual",getValue:function(t){var n=pl(t,o,["field1","field2"]),e={};return e[o.field1Name]=_f.getValue(n.field1()),e[o.field2Name]=_f.getValue(n.field2()),e},setValue:function(t,n){var e=pl(t,o,["field1","field2"]);Ct(n,o.field1Name)&&_f.setValue(e.field1(),n[o.field1Name]),Ct(n,o.field2Name)&&_f.setValue(e.field2(),n[o.field2Name])}}})]),apis:{getField1:function(t){return ll(t,o,"field1")},getField2:function(t){return ll(t,o,"field2")},getLock:function(t){return ll(t,o,"lock")}}}},apis:{getField1:function(t,n){return t.getField1(n)},getField2:function(t,n){return t.getField2(n)},getLock:function(t,n){return t.getLock(n)}}}),tk={undo:tt(Ar("undo")),redo:tt(Ar("redo")),zoom:tt(Ar("zoom")),back:tt(Ar("back")),apply:tt(Ar("apply")),swap:tt(Ar("swap")),transform:tt(Ar("transform")),tempTransform:tt(Ar("temp-transform")),transformApply:tt(Ar("transform-apply"))},nk=tt("save-state"),ek=tt("disable"),ok=tt("enable"),rk={formActionEvent:wy,saveState:nk,disable:ek,enable:ok},ik=tinymce.util.Tools.resolve("tinymce.geom.Rect"),uk=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),ak=tinymce.util.Tools.resolve("tinymce.util.Observable"),ck=tinymce.util.Tools.resolve("tinymce.util.VK");function sk(t,d){function m(t){if(TS(t),t.button!==p)return x(t);t.deltaX=t.screenX-h,t.deltaY=t.screenY-v,t.preventDefault(),d.drag(t)}var g,p,h,v,b=d.document||document,y=b.getElementById(d.handle||t),x=function(t){TS(t),uk(b).off("mousemove touchmove",m).off("mouseup touchend",x),g.remove(),d.stop&&d.stop(t)};return uk(y).on("mousedown touchstart",function(t){var n,e,o,r,i,u,a,c,s,l=(n=Math.max,e=b.documentElement,o=b.body,r=n(e.scrollWidth,o.scrollWidth),i=n(e.clientWidth,o.clientWidth),u=n(e.offsetWidth,o.offsetWidth),a=n(e.scrollHeight,o.scrollHeight),c=n(e.clientHeight,o.clientHeight),{width:r<u?i:r,height:a<n(e.offsetHeight,o.offsetHeight)?c:a});TS(t),t.preventDefault(),p=t.button;var f=y;h=t.screenX,v=t.screenY,s=window.getComputedStyle?window.getComputedStyle(f,null).getPropertyValue("cursor"):f.runtimeStyle.cursor,g=uk("<div></div>").css({position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,cursor:s}).appendTo(b.body),uk(b).on("mousemove touchmove",m).on("mouseup touchend",x),d.start(t)}),{destroy:function(){uk(y).off()}}}function lk(t,n,e,o,r){return hS({name:t,icon:ft.some(n),disabled:e,tooltip:ft.some(t),primary:!1,borderless:!1},o,r)}function fk(t,n){n?fd.enable(t):fd.disable(t)}var dk=0,mk=function(s,e,l,o,r){function f(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}}function u(t,n,e,o){var r,i=n.x,u=n.y,a=n.w,c=n.h;i+=e*t.deltaX,u+=o*t.deltaY,a+=e*t.deltaW,c+=o*t.deltaH,s=ik.clamp({x:i,y:u,w:a=a<20?20:a,h:c=c<20?20:c},l,"move"===t.name),r=f(l,s),p.fire("updateRect",{rect:r}),g(r)}function i(t){n(s=t)}function n(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),uk("#"+c+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}Ow.each(d,function(t){uk("#"+c+"-"+t.name,o).css({left:n.w*t.xMul+n.x,top:n.h*t.yMul+n.y})}),t("top",{x:e.x,y:e.y,w:e.w,h:n.y-e.y}),t("right",{x:n.x+n.w,y:n.y,w:e.w-n.x-n.w+e.x,h:n.h}),t("bottom",{x:e.x,y:n.y+n.h,w:e.w,h:e.h-n.y-n.h+e.y}),t("left",{x:e.x,y:n.y,w:n.x-e.x,h:n.h}),t("move",n)}var t,a="tox-",c="tox-crid-"+dk++,d=[{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"}],m=["top","right","bottom","left"],g=function(t){var n;i((n=l,{x:t.x+n.x,y:t.y+n.y,w:t.w,h:t.h}))};uk('<div id="'+c+'" class="'+a+'croprect-container" role="grid" aria-dropeffect="execute">').appendTo(o),Ow.each(m,function(t){uk("#"+c,o).append('<div id="'+c+"-"+t+'"class="'+a+'croprect-block" style="display: none" data-mce-bogus="all">')}),Ow.each(d,function(t){uk("#"+c,o).append('<div id="'+c+"-"+t.name+'" class="'+a+"croprect-handle "+a+"croprect-handle-"+t.name+'"style="display: none" data-mce-bogus="all" role="gridcell" tabindex="-1" aria-label="'+t.label+'" aria-grabbed="false" title="'+t.label+'">')}),t=Ow.map(d,function(n){var e;return sk(c,{document:o.ownerDocument,handle:c+"-"+n.name,start:function(){e=s},drag:function(t){u(n,e,t.deltaX,t.deltaY)}})}),n(s),uk(o).on("focusin focusout",function(t){uk(t.target).attr("aria-grabbed","focus"===t.type?"true":"false")}),uk(o).on("keydown",function(n){var i;function t(t,n,e,o,r){t.stopPropagation(),t.preventDefault(),u(i,e,o,r)}switch(Ow.each(d,function(t){if(n.target.id===c+"-"+t.name)return i=t,!1}),n.keyCode){case ck.LEFT:t(n,0,s,-10,0);break;case ck.RIGHT:t(n,0,s,10,0);break;case ck.UP:t(n,0,s,0,-10);break;case ck.DOWN:t(n,0,s,0,10);break;case ck.ENTER:case ck.SPACEBAR:n.preventDefault(),r()}});var p=Ow.extend({toggleVisibility:function(t){var n=Ow.map(d,function(t){return"#"+c+"-"+t.name}).concat(Ow.map(m,function(t){return"#"+c+"-"+t})).join(",");t?uk(n,o).show():uk(n,o).hide()},setClampRect:function(t){l=t,n(s)},setRect:i,getInnerRect:function(){return f(l,s)},setInnerRect:g,setViewPortRect:function(t){e=t,n(s)},destroy:function(){Ow.each(t,function(t){t.destroy()}),t=[]}},ak);return p};function gk(t){var e,o,n,r,i=wn(t),u=fc(),a=(o=-1,{data:e=[],add:function(t){var n=e.splice(++o);return e.push(t),{state:t,removed:n}},undo:function(){if(n())return e[--o]},redo:function(){if(r())return e[++o]},canUndo:n=function(){return 0<o},canRedo:r=function(){return-1!==o&&o<e.length-1}});function c(t){i.set(t)}function s(t){URL.revokeObjectURL(t.url)}function l(t){var n=f(t);c(n);var e=a.add(n).removed;return Ow.each(e,s),n.url}a.add(t);function f(t){return{blob:t,url:URL.createObjectURL(t)}}function d(){u.on(s),u.clear()}return{getBlobState:function(){return i.get()},setBlobState:c,addBlobState:l,getTempState:function(){return u.get().getOrThunk(i.get)},updateTempState:function(t){var n=f(t);return d(),u.set(n),n.url},addTempState:function(t){var n=f(t);return u.set(n),n.url},applyTempState:function(n){return u.get().fold(ct,function(t){l(t.blob),n()})},destroyTempState:d,undo:function(){var t=a.undo();return c(t),t.url},redo:function(){var t=a.redo();return c(t),t.url},getHistoryStates:function(){return{undoEnabled:a.canUndo(),redoEnabled:a.canRedo()}}}}function pk(t,n){function i(t){var n=b.getHistoryStates();S.updateButtonUndoStates(t,n.undoEnabled,n.redoEnabled),Ne(t,rk.formActionEvent,{name:rk.saveState(),value:n.undoEnabled})}function u(t){return t.toBlob()}function a(t){Ne(t,rk.formActionEvent,{name:rk.disable(),value:{}})}function c(n,t,e,o,r){a(n),Gw(t).then(e).then(u).then(o).then(function(t){return x(n,t)}).then(function(){i(n),r(),y(n)}).catch(function(t){console.log(t),n.getSystem().isConnected()&&y(n)})}function r(t,n,e){c(t,b.getBlobState().blob,n,function(t){return b.updateTempState(t)},e)}function s(t){var n=b.getBlobState().url;return b.destroyTempState(),i(t),n}var e,o,l,f,d,m,g,p,h,v,b=gk(t.currentState),y=function(t){k.getApplyButton(t).each(function(t){fd.enable(t)}),Ne(t,rk.formActionEvent,{name:rk.enable(),value:{}})},x=function(t,n){return a(t),w.updateSrc(t,n)},w=(f=t.currentState.url,d=Vm({dom:{tag:"div",classes:["tox-image-tools__image-bg"],attributes:{role:"presentation"}}}),m=wn(1),g=fc(),p=wn({x:0,y:0,w:1,h:1}),h=wn({x:0,y:0,w:1,h:1}),{memContainer:v=Vm(sy.sketch({dom:{tag:"div",classes:["tox-image-tools__image"]},components:[d.asSpec(),{dom:{tag:"img",attributes:{src:f}}},{dom:{tag:"div"},behaviours:Za([lm("image-panel-crop-events",[$o(function(t){v.getOpt(t).each(function(t){var n=t.element.dom,e=mk({x:10,y:10,w:100,h:100},{x:0,y:0,w:200,h:200},{x:0,y:0,w:200,h:200},n,ct);e.toggleVisibility(!1),e.on("updateRect",function(t){var n=t.rect,e=m.get(),o={x:Math.round(n.x/e),y:Math.round(n.y/e),w:Math.round(n.w/e),h:Math.round(n.h/e)};p.set(o)}),g.set(e)})})])])}],containerBehaviours:Za([Mg.config({}),lm("image-panel-events",[$o(function(t){O(t,f)})])])})),updateSrc:O,zoom:function(t,n){var e=m.get(),o=0<n?Math.min(2,e+.1):Math.max(.1,e-.1);m.set(o),v.getOpt(t).each(function(t){var n=t.components()[1].element;C(t,n)})},showCrop:function(){g.on(function(t){t.toggleVisibility(!0)})},hideCrop:function(){g.on(function(t){t.toggleVisibility(!1)})},getRect:function(){return p.get()},getMeasurements:function(){var t=h.get();return{width:t.w,height:t.h}}}),S=(o=Vm(lk("Undo","undo",!0,function(t){Ne(t,tk.undo(),{direction:1})},e=n)),l=Vm(lk("Redo","redo",!0,function(t){Ne(t,tk.redo(),{direction:1})},e)),{container:sy.sketch({dom:{tag:"div",classes:["tox-image-tools__toolbar","tox-image-tools__sidebar"]},components:[o.asSpec(),l.asSpec(),lk("Zoom in","zoom-in",!1,function(t){Ne(t,tk.zoom(),{direction:1})},e),lk("Zoom out","zoom-out",!1,function(t){Ne(t,tk.zoom(),{direction:-1})},e)]}),updateButtonUndoStates:function(t,n,e){o.getOpt(t).each(function(t){fk(t,n)}),l.getOpt(t).each(function(t){fk(t,e)})}}),k=_S(w,n);function C(t,s){v.getOpt(t).each(function(t){var e=m.get(),o=wi(t.element),r=vi(t.element),i=s.dom.naturalWidth*e,u=s.dom.naturalHeight*e,a=Math.max(0,o/2-i/2),c=Math.max(0,r/2-u/2),n={left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px",position:"absolute"};ei(s,n),d.getOpt(t).each(function(t){ei(t.element,n)}),g.on(function(t){var n=p.get();t.setRect({x:n.x*e+a,y:n.y*e+c,w:n.w*e,h:n.h*e}),t.setClampRect({x:a,y:c,w:i,h:u}),t.setViewPortRect({x:0,y:0,w:o,h:r})})})}function O(t,n){var e,i=de.fromTag("img");return Or(i,"src",n),e=i.dom,new Dp(function(t){var n=function(){e.removeEventListener("load",n),t(e)};e.complete?t(e):e.addEventListener("load",n)}).then(function(){t.getSystem().isConnected()&&v.getOpt(t).map(function(t){var n=hu({element:i});Mg.replaceAt(t,1,ft.some(n));var e=h.get(),o={x:0,y:0,w:i.dom.naturalWidth,h:i.dom.naturalHeight};h.set(o);var u,r=ik.inflate(o,-20,-20);p.set(r),e.w===o.w&&e.h===o.h||(u=i,v.getOpt(t).each(function(t){var n=wi(t.element),e=vi(t.element),o=u.dom.naturalWidth,r=u.dom.naturalHeight,i=Math.min(n/o,e/r);1<=i?m.set(1):m.set(i)})),C(t,i)})})}return{dom:{tag:"div",attributes:{role:"presentation"}},components:[k.memContainer.asSpec(),w.memContainer.asSpec(),S.container],behaviours:Za([_f.config({store:{mode:"manual",getValue:function(){return b.getBlobState()}}}),lm("image-tools-events",[Xe(tk.undo(),function(n,t){var e=b.undo();x(n,e).then(function(t){y(n),i(n)})}),Xe(tk.redo(),function(n,t){var e=b.redo();x(n,e).then(function(t){y(n),i(n)})}),Xe(tk.zoom(),function(t,n){var e=n.event.direction;w.zoom(t,e)}),Xe(tk.back(),function(t,n){var e,o=s(e=t);x(e,o).then(function(t){y(e)}),(0,n.event.swap)(),w.hideCrop()}),Xe(tk.apply(),function(t,n){b.applyTempState(function(){s(t),(0,n.event.swap)()})}),Xe(tk.transform(),function(t,n){return r(t,n.event.transform,ct)}),Xe(tk.tempTransform(),function(t,n){var e=n.event.transform;c(t,b.getTempState().blob,e,function(t){return b.addTempState(t)},ct)}),Xe(tk.transformApply(),function(t,n){var e=t,o=n.event.transform,r=n.event.swap,i=b.getBlobState().blob;c(e,i,o,function(t){var n=b.addBlobState(t);return s(e),n},r)}),Xe(tk.swap(),function(n,t){S.updateButtonUndoStates(n,!1,!1);var e=t.event.transform,o=t.event.swap;e.fold(function(){o()},function(t){r(n,t,o)})})]),x0()])}}function hk(t){return!Kn(t,"items")}function vk(t,n){function e(t){return{dom:{tag:"td",innerHtml:n.translate(t)}}}return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:A(t.header,function(t){return{dom:{tag:"th",innerHtml:n.translate(t)}}})}]},{dom:{tag:"tbody"},components:A(t.cells,function(t){return{dom:{tag:"tr"},components:A(t,e)}})}],behaviours:Za([gy.config({}),Rg.config({})])}}function bk(e,n){var t=e.label.map(function(t){return Qb(t,n)}),o=[fd.config({disabled:function(){return e.disabled||n.isDisabled()}}),dv(),Bg.config({mode:"execution",useEnter:!0!==e.multiline,useControlEnter:!0===e.multiline,execute:function(t){return ze(t,Sy),ft.some(!0)}}),lm("textfield-change",[Xe(ho(),function(t,n){Ne(t,by,{name:e.name})}),Xe(_o(),function(t,n){Ne(t,by,{name:e.name})})]),gy.config({})],r=e.validation.map(function(o){return qy.config({getRoot:function(t){return ar(t.element)},invalidClass:"tox-invalid",validator:{validate:function(t){var n=_f.getValue(t),e=o.validator(n);return Uy(!0===e?mt.value(n):mt.error(e))},validateOnLoad:o.validateOnLoad}})}).toArray(),i=e.placeholder.fold(tt({}),function(t){return{placeholder:n.translate(t)}}),u=e.inputMode.fold(tt({}),function(t){return{inputmode:t}}),a=st(st({},i),u);return $b(t,dy.parts.field({tag:!0===e.multiline?"textarea":"input",inputAttributes:a,inputClasses:[e.classname],inputBehaviours:Za(lt([o,r])),selectOnFocus:!1,factory:Ey}),(e.flex?["tox-form__group--stretched"]:[]).concat(e.maximized?["tox-form-group--maximize"]:[]),[fd.config({disabled:function(){return e.disabled||n.isDisabled()},onDisabled:function(t){dy.getField(t).each(fd.disable)},onEnabled:function(t){dy.getField(t).each(fd.enable)}}),dv()])}function yk(t){var n=wn(null);return au({readState:function(){return{timer:null!==n.get()?"set":"unset"}},setTimer:function(t){n.set(t)},cancel:function(){var t=n.get();null!==t&&t.cancel()}})}function xk(t,n,e){var o=_f.getValue(e);_f.setValue(n,o),w1(n)}function wk(t,n){var e=t.element,o=si(e),r=e.dom;"number"!==_r(e,"type")&&n(r,o)}function Sk(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:ct}}function kk(t,n){return{type:"menuitem",value:n,text:t,meta:{attach:void 0},onAction:ct}}function Ck(t,n){return e=t,A(F(n,function(t){return t.type===e}),Sk);var e}function Ok(t,n){var e=t.toLowerCase();return F(n,function(t){return Cn((void 0!==t.meta&&void 0!==t.meta.text?t.meta:t).text.toLowerCase(),e)||Cn(t.value.toLowerCase(),e)})}function _k(u,a,c){function r(t){var n=_f.getValue(t);c.addToHistory(n.value,u.filetype)}var t,n,e,o,i=a.shared.providers,s=dy.parts.field({factory:O1,dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":D1,type:"url"},minChars:0,responseTime:0,fetch:function(t){var e,o,n,r,i=fS((e=u.filetype,o=c,n=_f.getValue(t),r=void 0!==n.meta.text?n.meta.text:n.value,o.getLinkInformation().fold(function(){return[]},function(t){var n=Ok(r,A(o.getHistory(e),function(t){return kk(t,t)}));return"file"===e?R([n,Ok(r,Ck("header",t.targets)),Ok(r,lt([ft.from(t.anchorTop).map(function(t){return kk("<top>",t)}).toArray(),Ck("anchor",t.targets),ft.from(t.anchorBottom).map(function(t){return kk("<bottom>",t)}).toArray()]))],function(t,n){return 0===t.length||0===n.length?t.concat(n):t.concat(E1,n)},[]):n})),yh.BUBBLE_TO_SANDBOX,a,!1);return Uy(i)},getHotspot:function(t){return p.getOpt(t)},onSetValue:function(t,n){t.hasConfigured(qy)&&qy.run(t).get(ct)},typeaheadBehaviours:Za(lt([c.getValidationHandler().map(function(e){return qy.config({getRoot:function(t){return ar(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,n){f.getOpt(t).each(function(t){Or(t.element,"title",i.translate(n))})}},validator:{validate:function(t){var n=_f.getValue(t);return T1(function(o){e({type:u.filetype,url:n.value},function(t){var n,e;"invalid"===t.status?(n=mt.error(t.message),o(n)):(e=mt.value(t.message),o(e))})})},validateOnLoad:!1}})}).toArray(),[fd.config({disabled:function(){return u.disabled||i.isDisabled()}}),gy.config({}),lm("urlinput-events",lt(["file"===u.filetype?[Xe(ho(),function(t){Ne(t,by,{name:u.name})})]:[],[Xe(vo(),function(t){Ne(t,by,{name:u.name}),r(t)}),Xe(_o(),function(t){Ne(t,by,{name:u.name}),r(t)})]]))]])),eventOrder:((t={})[ho()]=["streaming","urlinput-events","invalidating"],t),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:a.shared.getSink,parts:{menu:Jp(0,0,"normal")},onExecute:function(t,n,e){Ne(n,Sy,{})},onItemExecute:function(t,n,e,o){r(t),Ne(t,by,{name:u.name})}}),l=u.label.map(function(t){return Qb(t,i)}),f=Vm((n="invalid",e=ft.some(D1),Wm("warning",{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+n],attributes:st({title:i.translate(o=void 0===o?n:o),"aria-live":"polite"},e.fold(function(){return{}},function(t){return{id:t}}))},i.icons))),d=Vm({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[f.asSpec()]}),m=c.getUrlPicker(u.filetype),g=Ar("browser.url.event"),p=Vm({dom:{tag:"div",classes:["tox-control-wrap"]},components:[s,d.asSpec()],behaviours:Za([fd.config({disabled:function(){return u.disabled||i.isDisabled()}})])}),h=Vm(bS({name:u.name,icon:ft.some("browse"),text:u.label.getOr(""),disabled:u.disabled,primary:!1,borderless:!0},function(t){return ze(t,g)},i,[],["tox-browse-url"]));return dy.sketch({dom:vy([]),components:l.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:lt([[p.asSpec()],m.map(function(){return h.asSpec()}).toArray()])}]),fieldBehaviours:Za([fd.config({disabled:function(){return u.disabled||i.isDisabled()},onDisabled:function(t){dy.getField(t).each(fd.disable),h.getOpt(t).each(fd.disable)},onEnabled:function(t){dy.getField(t).each(fd.enable),h.getOpt(t).each(fd.enable)}}),dv(),lm("url-input-events",[Xe(g,function(o){id.getCurrent(o).each(function(n){var t=_f.getValue(n),e=st({fieldname:u.name},t);m.each(function(t){t(e).get(function(t){_f.setValue(n,t),Ne(o,by,{name:u.name})})})})})])])})}function Tk(r){return function(n,e,o){return kt(e,"name").fold(function(){return r(e,o)},function(t){return n.field(t,r(e,o))})}}function Ek(n,t,e){var o=Jn(e,{shared:{interpreter:function(t){return M1(n,t,o)}}});return M1(n,t,o)}function Dk(t,n,e){function o(){return de.fromDom(t.getContentAreaContainer())}function r(){return p||!e()}var i,u,a,c,s,l,f,d,m,g,p=uv(t);return{inlineDialog:(f=o,d=n,m=r,g={maxHeightFunction:Fc()},function(){return m()?{type:"node",root:gr(f()),node:ft.from(f()),bubble:yc(12,12,F1),layouts:{onRtl:function(){return[Dm]},onLtr:function(){return[Em]}},overrides:g}:{type:"hotspot",hotspot:d(),bubble:yc(-12,12,F1),layouts:{onRtl:function(){return[Ua]},onLtr:function(){return[Ga]}},overrides:g}}),banner:(c=o,s=n,l=r,function(){return l()?{type:"node",root:gr(c()),node:ft.from(c()),layouts:{onRtl:function(){return[ip]},onLtr:function(){return[ip]}}}:{type:"hotspot",hotspot:s(),layouts:{onRtl:function(){return[Ka]},onLtr:function(){return[Ka]}}}}),cursor:(u=t,function(){return{type:"selection",root:a(),getSelection:function(){var t=u.selection.getRng();return ft.some(ls.range(de.fromDom(t.startContainer),t.startOffset,de.fromDom(t.endContainer),t.endOffset))}}}),node:(i=a=function(){return de.fromDom(t.getBody())},function(t){return{type:"node",root:i(),node:t}})}}function Bk(i){return ft.from(i.getParam("style_formats")).filter(c).map(function(t){var n,e,o=(n=i,e=R1(t),n.formatter?r(e.customFormats):n.on("init",function(){r(e.customFormats)}),e.formats);function r(t){dt(t,function(t){n.formatter.has(t.name)||n.formatter.register(t.name,t.format)})}return i.getParam("style_formats_merge",!1,"boolean")?I1.concat(o):o}).getOr(I1)}function Ak(t,n,e){var o={type:"formatter",isSelected:n(t.format),getStylePreview:e(t.format)};return Jn(t,o)}function Mk(c,t,s,l){var f=function(t){return A(t,function(t){var n,e,o,r,i,u=Xn(t);if(Ct(t,"items")){var a=f(t.items);return Jn(Jn(t,{type:"submenu"}),{getStyleItems:tt(a)})}return Ct(t,"format")?Ak(t,s,l):1===u.length&&et(u,"title")?Jn(t,{type:"separator"}):(r={type:"formatter",format:o="custom-"+(e=y((n=t).name)?n.name:Ar(n.title)),isSelected:s(o),getStylePreview:l(o)},i=Jn(n,r),c.formatter.register(e,i),i)})};return f(t)}function Fk(e){return function(t){if(f(n=t)&&1===n.nodeType){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}var n;return!1}}function Ik(t,n,e,o,r){return{type:t,title:n,url:e,level:o,attach:r}}function Rk(t){return t.innerText||t.textContent}function Vk(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)&&c1(t)}function Pk(t){return t&&/^(H[1-6])$/.test(t.nodeName)}function Hk(t){return Pk(t)&&c1(t)}function zk(t){var n,e=t.id||Ar("h");return Ik("header",Rk(t),"#"+e,Pk(n=t)?parseInt(n.nodeName.substr(1),10):0,function(){t.id=e})}function Nk(t){var n=t.id||t.name;return Ik("anchor",Rk(t)||"#"+n,"#"+n,0,ct)}function Lk(t){return 0<V1(t.title).length}function jk(t){return y(t)&&/^https?/.test(t)}function Wk(t){return x(t)&&wt(t,function(t){return!(c(n=t)&&n.length<=5&&N(n,jk));var n}).isNone()}function Uk(){var t,n=sb.getItem(N1);if(null===n)return{};try{t=JSON.parse(n)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+N1+" was not valid JSON",t),{};throw t}return Wk(t)?t:(console.log("Local storage "+N1+" was not valid format",t),{})}function Gk(t){return kt(Uk(),t).getOr([])}function Xk(n,t){var e,o;jk(n)&&(o=F(kt(e=Uk(),t).getOr([]),function(t){return t!==n}),e[t]=[n].concat(o).slice(0,5),function(t){if(!Wk(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));sb.setItem(N1,JSON.stringify(t))}(e))}function Yk(t){return!!t}function qk(t){return yt(Ow.makeMap(t,/[, ]/),Yk)}function Kk(t){return ft.from(t.getParam("file_picker_callback")).filter(m)}function Jk(t){return ft.from(t).filter(y).getOrUndefined()}function $k(l){return{getHistory:Gk,addToHistory:Xk,getLinkInformation:function(){return!1===(t=l).getParam("typeahead_urls")?ft.none():ft.some({targets:z1(t.getBody()),anchorTop:Jk(t.getParam("anchor_top","#top")),anchorBottom:Jk(t.getParam("anchor_bottom","#bottom"))});var t},getValidationHandler:function(){return ft.from(void 0===(n=(t=l).getParam("file_picker_validator_handler",void 0,"function"))?t.getParam("filepicker_validator_handler",void 0,"function"):n);var t,n},getUrlPicker:function(t){return n=c=l,e=s=t,r=ft.some((o=n).getParam("file_picker_types")).filter(Yk),i=ft.some(o.getParam("file_browser_callback_types")).filter(Yk),u=r.or(i).map(qk),a=Kk(o).fold(O,function(t){return u.fold(_,function(t){return 0<Xn(t).length&&t})}),(w(a)?a?Kk(n):ft.none():a[e]?Kk(n):ft.none()).map(function(o){return function(n){return Wy(function(e){var t=st({filetype:s,fieldname:n.fieldname},ft.from(n.meta).getOr({}));o.call(c,function(t,n){if(!y(t))throw new Error("Expected value to be string");if(void 0!==n&&!x(n))throw new Error("Expected meta to be a object");e({value:t,meta:n})},n.value,t)})}});var n,e,o,r,i,u,a,c,s}}}function Qk(t,n,e){var o,r,i,u,a,c,s,l,f,d,m,g,p,h=wn(!1),v={isPositionedAtTop:function(){return"top"===o.get()},getDockingMode:(o=wn(rv(n)?"bottom":"top")).get,setDockingMode:o.set},b={shared:{providers:{icons:function(){return n.ui.registry.getAll().icons},menuItems:function(){return n.ui.registry.getAll().menuItems},translate:sp.translate,isDisabled:function(){return n.mode.isReadOnly()||n.ui.isDisabled()},getSetting:n.getParam.bind(n)},interpreter:function(t){return M1(A1,t,b)},anchors:Dk(n,e,v.isPositionedAtTop),header:v,getSink:function(){return mt.value(t)}},urlinput:$k(n),styleselect:(f=wn([]),d=wn([]),m=wn([]),g=wn([]),p=wn(!(l=function(t){var n=t.items;return void 0!==n&&0<n.length?z(n,l):[t.format]})),(s=n).on("PreInit",function(t){var n=Bk(s),e=Mk(s,n,y,x);f.set(e),d.set(z(e,l))}),s.on("addStyleModifications",function(t){var n=Mk(s,t.items,y,x);m.set(n),p.set(t.replace),g.set(z(n,l))}),{getData:function(){var t=p.get()?[]:f.get(),n=m.get();return t.concat(n)},getFlattenedKeys:function(){var t=p.get()?[]:d.get(),n=g.get();return t.concat(n)}}),colorinput:{colorPicker:function(t,n){Db(c)(t,n)},hasCustomColors:function(){return fb(a)},getColors:function(){return db(u)},getColorCols:(i=u=a=c=n,function(){return gb(i)})},dialog:{isDraggableModal:(r=n,function(){return r.getParam("draggable_modal",!1,"boolean")})},isContextMenuOpen:function(){return h.get()},setContextMenuState:function(t){return h.set(t)}};function y(t){return function(){return s.formatter.match(t)}}function x(n){return function(){var t=s.formatter.get(n);return void 0!==t?ft.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:s.dom.parseStyle(s.formatter.getCssText(n))}):ft.none()}}return b}function Zk(t){return(Kr(ii(t,"position"),"fixed")?ft.none():cr(t)).orThunk(function(){var e=de.fromTag("span");return ar(t).bind(function(t){Gi(t,e);var n=cr(e);return Xi(e),n})})}function tC(t){return Zk(t).map(xi).getOrThunk(function(){return Su(0,0)})}function nC(t,n){var e=t.element;Ur(e,n.transitionClass),Gr(e,n.fadeOutClass),Ur(e,n.fadeInClass),n.onShow(t)}function eC(t,n){var e=t.element;Ur(e,n.transitionClass),Gr(e,n.fadeInClass),Ur(e,n.fadeOutClass),n.onHide(t)}function oC(t,n,e){return N(t,function(t){switch(t){case"bottom":return n.bottom<=e.bottom;case"top":return n.y>=e.y}})}function rC(n,t){return t.getInitialPos().map(function(t){return Bi(t.bounds.x,t.bounds.y,wi(n),vi(n))})}function iC(e,o,r){return r.getInitialPos().bind(function(t){switch(r.clearInitialPos(),t.position){case"static":return ft.some($1.static());case"absolute":var n=Zk(e).map(Ai).getOrThunk(function(){return Ai(mu())});return ft.some($1.absolute(Ta("absolute",kt(t.style,"left").map(function(t){return o.x-n.x}),kt(t.style,"top").map(function(t){return o.y-n.y}),kt(t.style,"right").map(function(t){return n.right-o.right}),kt(t.style,"bottom").map(function(t){return n.bottom-o.bottom}))));default:return ft.none()}})}function uC(t,n,e){var o,r,i,u=t.element;return Kr(ii(u,"position"),"fixed")?(r=n,rC(o=u,i=e).filter(function(t){return oC(i.getModes(),t,r)}).bind(function(t){return iC(o,t,i)})):function(t,n,e){var r,o,i=Ai(t);if(oC(e.getModes(),i,n))return ft.none();r=t,o=i,e.setInitialPos({style:function(){var t={},n=r.dom;if(Qr(n))for(var e=0;e<n.style.length;e++){var o=n.style.item(e);t[o]=n.style[o]}return t}(),position:ri(r,"position")||"static",bounds:o});var u=Fi(),a=i.x-u.x,c=n.y-u.y,s=u.bottom-n.bottom,l=i.y<=n.y;return ft.some($1.fixed(Ta("fixed",ft.some(a),l?ft.some(c):ft.none(),ft.none(),l?ft.none():ft.some(s))))}(u,n,e)}function aC(n,t){dt(["left","right","top","bottom","position"],function(t){return ai(n.element,t)}),t.onUndocked(n)}function cC(t,n,e){Ea(t.element,e),("fixed"===e.position?n.onDocked:n.onUndocked)(t)}function sC(o,t,r,i,u){void 0===u&&(u=!1),t.contextual.each(function(e){e.lazyContext(o).each(function(t){var n=t.y<i.bottom&&t.bottom>i.y;n!==r.isVisible()&&(r.setVisible(n),u&&!n?(Yr(o.element,[e.fadeOutClass]),e.onHide(o)):(n?nC:eC)(o,e))})})}function lC(t,n,e){var o,r,i,u,a,c;e.isDocked()&&(r=n,i=e,c=(o=t).element,i.setDocked(!1),rC(a=o.element,u=i).bind(function(t){return iC(a,t,u)}).each(function(t){t.fold(function(){return aC(o,r)},function(t){return cC(o,r,t)},ct)}),i.setVisible(!0),r.contextual.each(function(t){qr(c,[t.fadeInClass,t.fadeOutClass,t.transitionClass]),t.onShow(o)}),Q1(o,r,i))}function fC(t,n){return et(nO.getModes(t),n)}function dC(r){var i=r.element;ar(i).each(function(t){var n,e,o="padding-"+nO.getModes(r)[0];nO.isDocked(r)?(n=wi(t),ni(i,"width",n+"px"),ni(t,o,bi(e=i)+(parseInt(ri(e,"margin-top"),10)||0)+(parseInt(ri(e,"margin-bottom"),10)||0)+"px")):(ai(i,"width"),ai(t,o))})}function mC(t,n){n?(Gr(t,oO.fadeOutClass),Yr(t,[oO.transitionClass,oO.fadeInClass])):(Gr(t,oO.fadeInClass),Yr(t,[oO.fadeOutClass,oO.transitionClass]))}function gC(t,n){var e=de.fromDom(t.getContainer());n?(Ur(e,rO),Gr(e,iO)):(Ur(e,iO),Gr(e,rO))}function pC(u,t){function o(n){r().each(function(t){return n(t.element)})}function n(t){u.inline||dC(t),gC(u,nO.isDocked(t)),t.getSystem().broadcastOn([vf()],{}),r().each(function(t){return t.getSystem().broadcastOn([vf()],{})})}var e,i=fc(),r=t.getSink,a=u.inline?[]:[oc.config({channels:((e={})[eO()]={onReceive:dC},e)})];return H([Rg.config({}),nO.config({contextual:st({lazyContext:function(t){var n=bi(t.element),e=u.inline?u.getContentAreaContainer():u.getContainer(),o=Ai(de.fromDom(e)),r=o.height-n,i=o.y+(fC(t,"top")?0:n);return ft.some(Bi(o.x,i,o.width,r))},onShow:function(){o(function(t){return mC(t,!0)})},onShown:function(r){o(function(t){return qr(t,[oO.transitionClass,oO.fadeInClass])}),i.get().each(function(t){var n,e=r.element,o=or(n=t);Ca(o).filter(function(t){return!Bn(n,t)}).filter(function(t){return Bn(t,de.fromDom(o.dom.body))||An(e,t)}).each(function(){return Sa(n)}),i.clear()})},onHide:function(t){var n=t.element,e=r;Oa(n).orThunk(function(){return e().toOptional().bind(function(t){return Oa(t.element)})}).fold(i.clear,i.set),o(function(t){return mC(t,!1)})},onHidden:function(){o(function(t){return qr(t,[oO.transitionClass])})}},oO),lazyViewport:function(t){var n=Fi(),e=u.getParam("toolbar_sticky_offset",0,"number"),o=n.y+(fC(t,"top")?e:0),r=n.height-(fC(t,"bottom")?e:0);return Bi(n.x,o,n.width,r)},modes:[t.header.getDockingMode()],onDocked:n,onUndocked:n})],a)}function hC(t){return Gt("menubutton",sO,t)}function vC(n,t){return t.getAnimationRoot.fold(function(){return n.element},function(t){return t(n)})}function bC(t){return t.dimension.property}function yC(t,n){return t.dimension.getDimension(n)}function xC(t,n){qr(vC(t,n),[n.shrinkingClass,n.growingClass])}function wC(t,n){Gr(t.element,n.openClass),Ur(t.element,n.closedClass),ni(t.element,bC(n),"0px"),ci(t.element)}function SC(t,n){Gr(t.element,n.closedClass),Ur(t.element,n.openClass),ai(t.element,bC(n))}function kC(t,n,e,o){e.setCollapsed(),ni(t.element,bC(n),yC(n,t.element)),ci(t.element),xC(t,n),wC(t,n),n.onStartShrink(t),n.onShrunk(t)}function CC(t,n,e){var o=yC(n,t.element);("0px"===o?kC:function(t,n,e,o){var r=o.getOrThunk(function(){return yC(n,t.element)});e.setCollapsed(),ni(t.element,bC(n),r),ci(t.element);var i=vC(t,n);Gr(i,n.growingClass),Ur(i,n.shrinkingClass),wC(t,n),n.onStartShrink(t)})(t,n,e,ft.some(o))}function OC(t,n,e){var o=vC(t,n),r=Xr(o,n.shrinkingClass),i=yC(n,t.element);SC(t,n);var u=yC(n,t.element);(r?function(){ni(t.element,bC(n),i),ci(t.element)}:function(){wC(t,n)})(),Gr(o,n.shrinkingClass),Ur(o,n.growingClass),SC(t,n),ni(t.element,bC(n),u),e.setExpanded(),n.onStartGrow(t)}function _C(t,n,e){return!0===Xr(vC(t,n),n.growingClass)}function TC(t,n,e){return!0===Xr(vC(t,n),n.shrinkingClass)}function EC(t){return"<alloy.field."+t+">"}function DC(t){return{element:function(){return t.element.dom}}}function BC(t,e){id.getCurrent(t).each(function(t){return Mg.set(t,[(n=e,bO.sketch(function(t){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:(e=t,r=A(Xn(o=n),function(t){var n=o[t],e=Xt(Gt("sidebar",yO,n));return{name:t,getApi:DC,onSetup:e.onSetup,onShow:e.onShow,onHide:e.onHide}}),A(r,function(t){var n=wn(ct);return e.slot(t.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:Xh([gv(t,n),pv(t,n),Xe(Uo(),function(n,t){var e=t.event;V(r,function(t){return t.name===e.name}).each(function(t){(e.visible?t.onShow:t.onHide)(t.getApi(n))})})])})})),slotBehaviours:Xh([$o(function(t){return bO.hideAllSlots(t)})])};var e,o,r}))]);var n})}function AC(t){return id.getCurrent(t).bind(function(t){return gO.isGrowing(t)||gO.hasGrown(t)?id.getCurrent(t).bind(function(n){return V(bO.getSlotNames(n),function(t){return bO.isShowing(n,t)})}):ft.none()})}function MC(t){var n=de.fromHtml(t),e=sr(n),o=R(void 0!==n.dom.attributes?n.dom.attributes:[],function(t,n){var e;return"class"===n.name?t:st(st({},t),((e={})[n.name]=n.value,e))},{}),r=Array.prototype.slice.call(n.dom.classList,0),i=0===e.length?{}:{innerHtml:Sr(n)};return st({tag:nr(n),classes:r,attributes:o},i)}function FC(t){return id.getCurrent(t).each(function(t){return Sa(t.element)})}function IC(f,d,m){function n(t){var n;!g.get()||"focusin"===(n=t).type&&(n.composed?ot(n.composedPath()):ft.from(n.target)).map(de.fromDom).filter(Ri).exists(function(t){return Xr(t,"mce-pastebin")})||(t.preventDefault(),FC(d()),f.editorManager.setActive(f))}var g=wn(!1),e=fc();function o(t){var n,e,o,r,i,u,a,c,s,l;t!==g.get()&&(g.set(t),n=f,e=d(),o=t,r=m.providers,c=e.element,s=o,l="data-mce-"+(i="tabindex"),ft.from(n.iframeElement).map(de.fromDom).each(function(n){s?(Tr(n,i).each(function(t){return Or(n,l,t)}),Or(n,i,-1)):(Dr(n,i),Tr(n,l).each(function(t){Or(n,i,t),Dr(n,l)}))}),o?(kO.block(e,(a=r,function(t,n){return{dom:{tag:"div",attributes:{"aria-label":a.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:MC('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}})),ai(c,"display"),Dr(c,"aria-hidden"),n.hasFocus()&&FC(e)):(u=id.getCurrent(e).exists(function(t){return ka(t.element)}),kO.unblock(e),ni(c,"display","none"),Or(c,"aria-hidden","true"),u&&n.focus()),f.fire("AfterProgressState",{state:t}))}f.inline||f.on("PreInit",function(){f.dom.bind(f.getWin(),"focusin",n),f.on("BeforeExecCommand",function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&n(t)})}),f.on("ProgressState",function(t){var n;e.on(ap.clearTimeout),u(t.time)?(n=ap.setEditorTimeout(f,function(){return o(t.state)},t.time),e.set(n)):(o(t.state),e.clear())})}function RC(t,n,e){return{within:t,extra:n,withinWidth:e}}function VC(t,n,o){var e,r=(e=function(t,n){var e=o(t);return ft.some({element:t,start:n,finish:n+e,width:e})},R(t,function(n,t){return e(t,n.len).fold(tt(n),function(t){return{len:t.finish,list:n.list.concat([t])}})},{len:0,list:[]}).list),i=F(r,function(t){return t.finish<=n}),u=I(i,function(t,n){return t+n.width},0);return{within:i,extra:r.slice(i.length),withinWidth:u}}function PC(t){return A(t,function(t){return t.element})}function HC(t,n){var e=A(n,function(t){return yu(t)});q1.setGroups(t,e)}function zC(t,n,e){var o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k=n.builtGroups.get();0!==k.length&&(o=fl(t,n,"primary"),r=Jy.getCoupled(t,"overflowGroup"),ni(o.element,"visibility","hidden"),u=q(i=k.concat([r]),function(n){return Oa(n.element).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}),e([]),HC(o,i),a=wi(o.element),0===(s=a,l=n.builtGroups.get(),d=r,y=(0===(m=VC(l,s,f=function(t){return wi(t.element)})).extra.length?ft.some(m):ft.none()).getOrThunk(function(){return VC(l,s-f(d),f)}),x=y.within,w=y.extra,S=y.withinWidth,(c=1===w.length&&w[0].width<=f(d)?(b=S,RC(PC(x.concat(w)),[],b)):1<=w.length?(p=w,h=d,v=S,RC(PC(x).concat([h]),PC(p),v)):(g=S,RC(PC(x),[],g))).extra.length)?(Mg.remove(o,r),e([])):(HC(o,c.within),e(c.extra)),ai(o.element,"visibility"),ci(o.element),u.each(Rg.focus))}function NC(t,n){var e=Jy.getCoupled(t,"toolbarSandbox");pf.isOpen(e)?pf.close(e):pf.open(e,n.toolbar())}function LC(t,n,e,o){var r=e.getBounds.map(function(t){return t()}),i=e.lazySink(t).getOrDie();cf.positionWithinBounds(i,n,{anchor:{type:"hotspot",hotspot:t,layouts:o,overrides:{maxWidthFunction:TO()}}},r)}function jC(t,n,e,o,r){q1.setGroups(n,r),LC(t,n,e,o),Hg.on(t)}function WC(t){return A(t,function(t){return yu(t)})}function UC(t,e,o){zC(t,o,function(n){o.overflowGroups.set(n),e.getOpt(t).each(function(t){BO.setGroups(t,WC(n))})})}function GC(n,e){ll(n,e,"overflow-button").bind(function(){return ll(n,e,"overflow")}).each(function(t){l1(n,e),gO.toggleGrow(t)})}function XC(t){var n=t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}});return{dom:st({tag:"div",classes:["tox-toolbar__group"]},n),components:[FO.parts.items({})],items:t.items,markers:{itemSelector:"*:not(.tox-split-button) > .tox-tbtn:not([disabled]), .tox-split-button:not([disabled]), .tox-toolbar-nav-js:not([disabled])"},tgroupBehaviours:Za([gy.config({}),Rg.config({})])}}function YC(t){return FO.sketch(XC(t))}function qC(e,t){var n=$o(function(t){var n=A(e.initGroups,YC);q1.setGroups(t,n)});return Za([Kv(e.providers.isDisabled),dv(),Bg.config({mode:t,onEscape:e.onEscape,selector:".tox-toolbar__group"}),lm("toolbar-events",[n])])}function KC(t){var n=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":XC({title:ft.none(),items:[]}),"overflow-button":pS({name:"more",icon:ft.some("more-drawer"),disabled:!1,tooltip:ft.some("More..."),primary:!1,borderless:!1},ft.none(),t.providers)},splitToolbarBehaviours:qC(t,n)}}function JC(t){var n=t.cyclicKeying?"cyclic":"acyclic";return q1.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===ph.scrolling?["tox-toolbar--scrolling"]:[])},components:[q1.parts.groups({})],toolbarBehaviours:qC(t,n)})}function $C(t){return"string"==typeof t?t.split(" "):t}function QC(i,u){var a=st(st({},XO),u.menus),e=0<Xn(u.menus).length,t=F(void 0===u.menubar||!0===u.menubar?$C("file edit view insert format tools table help"):$C(!1===u.menubar?"":u.menubar),function(t){var n=Kn(XO,t);return e?n||kt(u.menus,t).exists(function(t){return Kn(t,"items")}):n});return F(A(t,function(t){var n=a[t],e={title:n.title,items:$C(n.items)},o=u,r=i.getParam("removed_menuitems","").split(/[ ,]/);return{text:e.title,getItems:function(){return z(e.items,function(t){var n=t.toLowerCase();return 0===n.trim().length||T(r,function(t){return t===n})?[]:"separator"===n||"|"===n?[{type:"separator"}]:o.menuItems[n]?[o.menuItems[n]]:[]})}}}),function(t){return 0<t.getItems().length&&T(t.getItems(),function(t){return"separator"!==t.type})})}function ZC(t){function n(){t._skinLoaded=!0,t.fire("SkinLoaded")}return function(){t.initialized?n():t.on("init",n)}}function t1(e,o,r){return new Dp(function(t,n){r.load(o,t,n),e.on("remove",function(){return r.unload(o)})})}function n1(t,n){var e,o,r,i,u,a,c,s,l,f=(r=(e=n).getParam("skin"),i=e.getParam("skin_url"),!1!==r&&(o=r||"oxide",i=i?e.documentBaseURI.toAbsolute(i):tv.baseURL+"/skins/ui/"+o),i);f&&n.contentCSS.push(f+(t?"/content.inline":"/content")+".min.css"),!1===n.getParam("skin")==0&&y(f)?Dp.all([t1(n,f+"/skin.min.css",n.ui.styleSheetLoader),(c=n,s=f,l=de.fromDom(c.getElement()),Wi(l).isSome()?t1(c,s+"/skin.shadowdom.min.css",Zh.DOM.styleSheetLoader):Dp.resolve())]).then(ZC(n),(u=n,a="Skin could not be loaded",function(){return u.fire("SkinLoadError",{message:a})})):ZC(n)()}function e1(o,r){return function(n){function t(){n.setActive(o.formatter.match(r));var t=o.formatter.formatChanged(r,n.setActive);e.set(t)}var e=lc();return o.initialized?t():o.once("init",t),function(){o.off("init",t),e.clear()}}}function o1(o,r,i){return function(t){function n(){return i(t)}function e(){i(t),o.on(r,n)}return o.initialized?e():o.once("init",e),function(){o.off("init",e),o.off(r,n)}}}function r1(n){return function(t){return function(){n.undoManager.transact(function(){n.focus(),n.execCommand("mceToggleFormat",!1,t.format)})}}}function i1(t,n){return function(){return t.execCommand(n)}}function u1(t,n,e){var u,a,c,o=e.dataset,r="basic"===o.type?function(){return A(o.data,function(t){return Ak(t,e.isSelectedFor,e.getPreviewFor)})}:o.getData;return{items:(u=n,a=e,c=function(t,n,e){var o="formatter"===t.type&&a.isInvalid(t);return 0===n?o?[]:i(t,n,!1,e).toArray():i(t,n,o,e).toArray()},{validateItems:s,getFetch:function(e,o){return function(t,n){n(fS(s(o()),yh.CLOSE_ON_EXECUTE,e,!1))}}}),getStyleItems:r};function i(t,n,e,o){var r=u.shared.providers.translate(t.title);if("separator"===t.type)return ft.some({type:"separator",text:r});if("submenu"!==t.type)return ft.some(st({type:"togglemenuitem",text:r,icon:t.icon,active:t.isSelected(o),disabled:e,onAction:a.onAction(t)},t.getStylePreview().fold(function(){return{}},function(t){return{meta:{style:t}}})));var i=z(t.getStyleItems(),function(t){return c(t,n,o)});return 0===n&&i.length<=0?ft.none():ft.some({type:"nestedmenuitem",text:r,disabled:i.length<=0,getSubmenuItems:function(){return z(t.getStyleItems(),function(t){return c(t,n,o)})}})}function s(t){var n=a.getCurrentValue(),e=a.shouldHide?0:1;return z(t,function(t){return c(t,e,n)})}}function a1(t,n,e){var o=u1(0,n,e),r=o.items,i=o.getStyleItems,u=o1(t,"NodeChange",function(t){var n=t.getComponent();e.updateText(n)});return sS({text:e.icon.isSome()?ft.none():e.text,icon:e.icon,tooltip:ft.from(e.tooltip),role:ft.none(),fetch:r.getFetch(n,i),onSetup:u,getApi:function(t){return{getComponent:tt(t)}},columns:1,presets:"normal",classes:e.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[]},"tox-tbtn",n.shared)}function c1(t){return function(t){for(;t=t.parentNode;){var n=t.contentEditable;if(n&&"inherit"!==n)return P1(t)}return!1}(t)&&!H1(t)}function s1(r,t){function n(t){return gl(r)}function e(e,o){return function(t,n){return ll(t,r,n).map(function(t){return e(t,n)}).getOr(o)}}function o(t,n){return"true"!==_r(t.element,"aria-hidden")}var i,u=e(o,!1),a=e(function(t,n){var e;o(t)&&(ni(e=t.element,"display","none"),Or(e,"aria-hidden","true"),Ne(t,Uo(),{name:n,visible:!1}))}),c=(i=a,function(n,t){dt(t,function(t){return i(n,t)})}),s=e(function(t,n){var e;o(t)||(ai(e=t.element,"display"),Dr(e,"aria-hidden"),Ne(t,Uo(),{name:n,visible:!0}))});return{uid:r.uid,dom:r.dom,components:t,behaviours:$s(r.slotBehaviours),apis:{getSlotNames:n,getSlot:function(t,n){return ll(t,r,n)},isShowing:u,hideSlot:a,hideAllSlots:function(t){return c(t,n())},showSlot:s}}}function l1(t,n){ll(t,n,"overflow").each(function(e){zC(t,n,function(t){var n=A(t,function(t){return yu(t)});q1.setGroups(e,n)}),ll(t,n,"overflow-button").each(function(t){gO.hasGrown(e)&&Hg.on(t)}),gO.refresh(e)})}var f1,d1,m1,g1="data-value",p1=function(n,e,t,o){return A(t,function(t){return hk(t)?{type:"togglemenuitem",text:t.text,value:t.value,active:t.value===o,onAction:function(){_f.setValue(n,t.value),Ne(n,by,{name:e}),Rg.focus(n)}}:{type:"nestedmenuitem",text:t.text,getSubmenuItems:function(){return p1(n,e,t.items,o)}}})},h1=function(t,n){return q(t,function(t){return hk(t)?$r(t.value===n,t):h1(t.items,n)})},v1=xl({name:"HtmlSelect",configFields:[Jt("options"),Js("selectBehaviours",[Rg,_f]),dn("selectClasses",[]),dn("selectAttributes",{}),rn("data")],factory:function(e,t){var n=A(e.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),o=e.data.map(function(t){return Ae("initialValue",t)}).getOr({});return{uid:e.uid,dom:{tag:"select",classes:e.selectClasses,attributes:e.selectAttributes},components:n,behaviours:Qs(e.selectBehaviours,[Rg.config({}),_f.config({store:st({mode:"manual",getValue:function(t){return si(t.element)},setValue:function(t,n){V(e.options,function(t){return t.value===n}).isSome()&&li(t.element,n)}},o)})])}}}),b1=Object.freeze({__proto__:null,events:function(t,n){var e=t.stream.streams.setup(t,n);return Jo([Xe(t.event,e),Qo(function(){return n.cancel()})].concat(t.cancelEvent.map(function(t){return[Xe(t,function(){return n.cancel()})]}).getOr([])))}}),y1=Object.freeze({__proto__:null,throttle:yk,init:function(t){return t.stream.streams.state(t)}}),x1=xa({fields:[$t("stream",qt("mode",{throttle:[Jt("delay"),dn("stopEvent",!0),Zu("streams",{setup:function(t,n){var e=t.stream,o=gp(t.onStream,e.delay);return n.setTimer(o),function(t,n){o.throttle(t,n),e.stopEvent&&n.stop()}},state:yk})]})),dn("event","input"),rn("cancelEvent"),$u("onStream")],name:"streaming",active:b1,state:y1}),w1=function(t){wk(t,function(t,n){return t.setSelectionRange(n.length,n.length)})},S1=tt("alloy.typeahead.itemexecute"),k1=tt([rn("lazySink"),Jt("fetch"),dn("minChars",5),dn("responseTime",1e3),Ku("onOpen"),dn("getHotspot",ft.some),dn("getAnchorOverrides",tt({})),dn("layouts",ft.none()),dn("eventOrder",{}),xn("model",{},[dn("getDisplayText",function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value}),dn("selectsOver",!0),dn("populateFromBrowse",!0)]),Ku("onSetValue"),Ju("onExecute"),Ku("onItemExecute"),dn("inputClasses",[]),dn("inputAttributes",{}),dn("inputStyles",{}),dn("matchWidth",!0),dn("useMinWidth",!1),dn("dismissOnBlur",!0),Yu(["openClass"]),rn("initialData"),Js("typeaheadBehaviours",[Rg,_f,x1,Bg,Hg,Jy]),fe("previewing",function(){return wn(!0)})].concat(Ty()).concat(ix())),C1=tt([qf({schema:[Xu()],name:"menu",overrides:function(o){return{fakeFocus:!0,onHighlight:function(n,e){o.previewing.get()?n.getSystem().getByUid(o.uid).each(function(t){!function(t,n,o){if(t.selectsOver){var e=_f.getValue(n),r=t.getDisplayText(e),i=_f.getValue(o);return 0===t.getDisplayText(i).indexOf(r)?ft.some(function(){var e;xk(0,n,o),e=r.length,wk(n,function(t,n){return t.setSelectionRange(e,n.length)})}):ft.none()}return ft.none()}(o.model,t,e).fold(function(){return md.dehighlight(n,e)},function(t){return t()})}):n.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&xk(o.model,t,e)}),o.previewing.set(!1)},onExecute:function(t,n){return t.getSystem().getByUid(o.uid).toOptional().map(function(t){return Ne(t,S1(),{item:n}),!0})},onHover:function(t,n){o.previewing.set(!1),t.getSystem().getByUid(o.uid).each(function(t){o.model.populateFromBrowse&&xk(o.model,t,n)})}}}})]),O1=wl({name:"Typeahead",configFields:k1(),partFields:C1(),factory:function(r,t,n,i){function e(t,n,e){r.previewing.set(!1);var o=Jy.getCoupled(t,"sandbox");pf.isOpen(o)?id.getCurrent(o).each(function(t){md.getHighlighted(t).fold(function(){e(t)},function(){We(o,t.element,"keydown",n)})}):tx(r,u(t),t,o,i,function(t){id.getCurrent(t).each(e)},Py.HighlightFirst).get(ct)}function u(e){return function(t){return t.map(function(t){var n=z(St(t.menus),function(t){return F(t.items,function(t){return"item"===t.type})});return _f.getState(e).update(A(n,function(t){return t.data})),t})}}var o=Zb(r),a=[Rg.config({}),_f.config({onSetValue:r.onSetValue,store:st({mode:"dataset",getDataKey:function(t){return si(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(t,n){li(t.element,r.model.getDisplayText(n))}},r.initialData.map(function(t){return Ae("initialValue",t)}).getOr({}))}),x1.config({stream:{mode:"throttle",delay:r.responseTime,stopEvent:!1},onStream:function(t,n){var e,o=Jy.getCoupled(t,"sandbox");Rg.isFocused(t)&&si(t.element).length>=r.minChars&&(e=id.getCurrent(o).bind(function(t){return md.getHighlighted(t).map(_f.getValue)}),r.previewing.set(!0),tx(r,u(t),t,o,i,function(t){id.getCurrent(o).each(function(t){e.fold(function(){r.model.selectsOver&&md.highlightFirst(t)},function(n){md.highlightBy(t,function(t){return _f.getValue(t).value===n.value}),md.getHighlighted(t).orThunk(function(){return md.highlightFirst(t),ft.none()})})})},Py.HighlightFirst).get(ct))},cancelEvent:Fo()}),Bg.config({mode:"special",onDown:function(t,n){return e(t,n,md.highlightFirst),ft.some(!0)},onEscape:function(t){var n=Jy.getCoupled(t,"sandbox");return pf.isOpen(n)?(pf.close(n),ft.some(!0)):ft.none()},onUp:function(t,n){return e(t,n,md.highlightLast),ft.some(!0)},onEnter:function(n){var t=Jy.getCoupled(n,"sandbox"),e=pf.isOpen(t);if(e&&!r.previewing.get())return id.getCurrent(t).bind(function(t){return md.getHighlighted(t)}).map(function(t){return Ne(n,S1(),{item:t}),!0});var o=_f.getValue(n);return ze(n,Fo()),r.onExecute(t,n,o),e&&pf.close(t),ft.some(!0)}}),Hg.config({toggleClass:r.markers.openClass,aria:{mode:"expanded"}}),Jy.config({others:{sandbox:function(t){return ox(r,t,{onOpen:function(){return Hg.on(t)},onClose:function(){return Hg.off(t)}})}}}),lm("typeaheadevents",[tr(function(t){nx(r,u(t),t,i,ct,Py.HighlightFirst).get(ct)}),Xe(S1(),function(t,n){var e=Jy.getCoupled(t,"sandbox");xk(r.model,t,n.event.item),ze(t,Fo()),r.onItemExecute(t,e,n.event.item,_f.getValue(t)),pf.close(e),w1(t)})].concat(r.dismissOnBlur?[Xe(Oo(),function(t){var n=Jy.getCoupled(t,"sandbox");Oa(n.element).isNone()&&pf.close(n)})]:[]))];return{uid:r.uid,dom:ty(Jn(r,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:st(st({},o),Qs(r.typeaheadBehaviours,a)),eventOrder:r.eventOrder}}}),_1=function(i){return st(st({},i),{toCached:function(){return _1(i.toCached())},bindFuture:function(n){return _1(i.bind(function(t){return t.fold(function(t){return Uy(mt.error(t))},function(t){return n(t)})}))},bindResult:function(n){return _1(i.map(function(t){return t.bind(n)}))},mapResult:function(n){return _1(i.map(function(t){return t.map(n)}))},mapError:function(n){return _1(i.map(function(t){return t.mapError(n)}))},foldResult:function(n,e){return i.map(function(t){return t.fold(n,e)})},withTimeout:function(t,r){return _1(Wy(function(n){var e=!1,o=setTimeout(function(){e=!0,n(mt.error(r()))},t);i.get(function(t){e||(clearTimeout(o),n(t))})}))}})},T1=function(t){return _1(Wy(t))},E1={type:"separator"},D1=Ar("aria-invalid"),B1={bar:Tk(function(t,n){return e=n.shared,{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:A(t.items,e.interpreter)};var e}),collection:Tk(function(t,n){return u=t,a=n.shared.providers,c=u.label.map(function(t){return Qb(t,a)}),s=e(function(t,n,e,o){n.stop(),a.isDisabled()||Ne(t,wy,{name:u.name,value:o})}),l=[Xe(lo(),e(function(t,n,e){Sa(e)})),Xe(bo(),s),Xe(Bo(),s),Xe(fo(),e(function(t,n,e){Fu(t.element,"."+Eh).each(function(t){Gr(t,Eh)}),Ur(e,Eh)})),Xe(mo(),e(function(t){Fu(t.element,"."+Eh).each(function(t){Gr(t,Eh)})})),tr(e(function(t,n,e,o){Ne(t,wy,{name:u.name,value:o})}))],$b(c,dy.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==u.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:h},behaviours:Za([fd.config({disabled:a.isDisabled,onDisabled:function(t){o(t,function(t){Ur(t,"tox-collection__item--state-disabled"),Or(t,"aria-disabled",!0)})},onEnabled:function(t){o(t,function(t){Gr(t,"tox-collection__item--state-disabled"),Dr(t,"aria-disabled")})}}),dv(),Mg.config({}),_f.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){var n=o,e=A(t,function(t){var n=sp.translate(t.text),e=1===u.columns?'<div class="tox-collection__item-label">'+n+"</div>":"",o='<div class="tox-collection__item-icon">'+t.icon+"</div>",r={_:" "," - ":" ","-":" "},i=n.replace(/\_| \- |\-/g,function(t){return r[t]});return'<div class="tox-collection__item'+(a.isDisabled()?" tox-collection__item--state-disabled":"")+'" tabindex="-1" data-collection-item-value="'+py.encodeAllRaw(t.value)+'" title="'+i+'" aria-label="'+i+'">'+o+e+"</div>"}),r=A("auto"!==u.columns&&1<u.columns?B(e,u.columns):[e],function(t){return'<div class="tox-collection__group">'+t.join("")+"</div>"});kr(n.element,r.join("")),"auto"===u.columns&&rh(o,5,"tox-collection__item").each(function(t){var n=t.numRows,e=t.numColumns;Bg.setGridSize(o,n,e)}),ze(o,_y)}}),gy.config({}),Bg.config(1===(i=u.columns)?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===i?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:".tox-collection__group",cell:"."+wh}}),lm("collection-events",l)]),eventOrder:((r={})[Eo()]=["disabling","alloy.base.behaviour","collection-events"],r)}),["tox-form__group--collection"],[]);function e(o){return function(n,e){Iu(e.event.target,"[data-collection-item-value]").each(function(t){o(n,e,t,_r(t,"data-collection-item-value"))})}}function o(t,n){return A(gs(t.element,".tox-collection__item"),n)}var u,a,r,i,c,s,l}),alertbanner:Tk(function(t,n){return o=n.shared.providers,sy.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--"+(e=t).level]},components:[{dom:{tag:"div",classes:["tox-notification__icon"]},components:[cp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:Nm(e.icon,o.icons),attributes:{title:o.translate(e.iconTooltip)}},action:function(t){Ne(t,wy,{name:"alert-banner",value:e.url})},buttonBehaviours:Za([Lm()])})]},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:o.translate(e.text)}}]});var e,o}),input:Tk(function(t,n){return o=n.shared.providers,bk({name:(e=t).name,multiline:!1,label:e.label,inputMode:e.inputMode,placeholder:e.placeholder,flex:!1,disabled:e.disabled,classname:"tox-textfield",validation:ft.none(),maximized:e.maximized},o);var e,o}),textarea:Tk(function(t,n){return o=n.shared.providers,bk({name:(e=t).name,multiline:!0,label:e.label,inputMode:ft.none(),placeholder:e.placeholder,flex:!0,disabled:e.disabled,classname:"tox-textarea",validation:ft.none(),maximized:e.maximized},o);var e,o}),label:Tk(function(t,n){return r={dom:{tag:"label",innerHtml:(o=n.shared).providers.translate((e=t).label),classes:["tox-label"]}},i=A(e.items,o.interpreter),{dom:{tag:"div",classes:["tox-form__group"]},components:[r].concat(i),behaviours:Za([x0(),Mg.config({}),w0(ft.none()),Bg.config({mode:"acyclic"})])};var e,o,r,i}),iframe:(f1=function(t,n){return e=t,o=n.shared.providers,u=Mw&&e.sandboxed,a=st(st({},e.label.map(function(t){return{title:t}}).getOr({})),u?{sandbox:"allow-scripts allow-same-origin"}:{}),r=u,i=wn(""),c={getValue:function(t){return i.get()},setValue:function(t,n){var e;r?Or(t.element,"srcdoc",n):(Or(t.element,"src","javascript:''"),(e=t.element.dom.contentWindow.document).open(),e.write(n),e.close()),i.set(n)}},$b(e.label.map(function(t){return Qb(t,o)}),dy.parts.field({factory:{sketch:function(t){return f0({uid:t.uid,dom:{tag:"iframe",attributes:a},behaviours:Za([gy.config({}),Rg.config({}),Ew(ft.none(),c.getValue,c.setValue)])})}}}),["tox-form__group--stretched"],[]);var e,o,r,i,u,a,c},function(t,n,e){var o=Jn(n,{source:"dynamic"});return Tk(f1)(t,o,e)}),button:Tk(function(t,n){return e=t,o=n.shared.providers,r=yS(e.name,"custom"),$b(ft.none(),dy.parts.field(st({factory:cp},vS(e,ft.some(r),o,[Dw(""),x0()]))),[],[]);var e,o,r}),checkbox:Tk(function(t,n){return r=t,i=n.shared.providers,u=_f.config({store:{mode:"manual",getValue:function(t){return t.element.dom.checked},setValue:function(t,n){t.element.dom.checked=n}}}),a=dy.parts.field({factory:{sketch:h},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:Za([x0(),fd.config({disabled:function(){return r.disabled||i.isDisabled()}}),gy.config({}),Rg.config({}),u,Bg.config({mode:"special",onEnter:e,onSpace:e,stopSpaceKeyup:!0}),lm("checkbox-events",[Xe(vo(),function(t,n){Ne(t,by,{name:r.name})})])])}),c=dy.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"],innerHtml:i.translate(r.label)},behaviours:Za([A0.config({})])}),s=Vm({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[o("checked"),o("unchecked")]}),dy.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[a,s.asSpec(),c],fieldBehaviours:Za([fd.config({disabled:function(){return r.disabled||i.isDisabled()},disableClass:"tox-checkbox--disabled",onDisabled:function(t){dy.getField(t).each(fd.disable)},onEnabled:function(t){dy.getField(t).each(fd.enable)}}),dv()])});function e(t){return t.element.dom.click(),ft.some(!0)}function o(t){return Wm("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},i.icons)}var r,i,u,a,c,s}),colorinput:Tk(function(t,n){return e=t,r=n.shared,i=n.colorinput,c=dy.parts.field({factory:Ey,inputClasses:["tox-textfield"],onSetValue:function(t){return qy.run(t).get(ct)},inputBehaviours:Za([fd.config({disabled:r.providers.isDisabled}),dv(),gy.config({}),qy.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return ar(t.element)},notify:{onValid:function(t){var n=_f.getValue(t);Ne(t,M0,{color:n})}},validator:{validateOnLoad:!1,validate:function(t){var n=_f.getValue(t);if(0===n.length)return Uy(mt.value(!0));var e=de.fromTag("span");ni(e,"background-color",n);var o=ii(e,"background-color").fold(function(){return mt.error("blah")},function(t){return mt.value(n)});return Uy(o)}}})]),selectOnFocus:!1}),s=e.label.map(function(t){return Qb(t,r.providers)}),l=Vm((u={dom:{tag:"span",attributes:{"aria-label":r.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[Ga,Ua,Ka]},onLtr:function(){return[Ua,Ga,Ka]}},components:[],fetch:bb(i.getColors(),i.hasCustomColors()),columns:i.getColorCols(),presets:"color",onItemAction:function(t,e){l.getOpt(t).each(function(n){"custom"===e?i.colorPicker(function(t){t.fold(function(){return ze(n,I0)},function(t){o(n,t),mb(t)})},"#ffffff"):o(n,"remove"===e?"":e)})}},B0.sketch({dom:u.dom,components:u.components,toggleClass:"mce-active",dropdownBehaviours:Za([qv((a=r).providers.isDisabled),dv(),A0.config({}),gy.config({})]),layouts:u.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:a.getSink,fetch:function(n){return Wy(function(t){return u.fetch(t)}).map(function(t){return ft.from(Lb(Jn(Sb(Ar("menu-value"),t,function(t){u.onItemAction(n,t)},u.columns,u.presets,yh.CLOSE_ON_EXECUTE,O,a.providers),{movement:kb(u.columns,u.presets)})))})},parts:{menu:Jp(0,0,u.presets)}}))),dy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:s.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[c,l.asSpec()]}]),fieldBehaviours:Za([lm("form-field-events",[Xe(M0,function(t,n){l.getOpt(t).each(function(t){ni(t.element,"background-color",n.event.color)}),Ne(t,by,{name:e.name})}),Xe(F0,function(n,e){dy.getField(n).each(function(t){_f.setValue(t,e.event.value),id.getCurrent(n).each(Rg.focus)})}),Xe(I0,function(n,t){dy.getField(n).each(function(t){id.getCurrent(n).each(Rg.focus)})})])])});function o(t,n){Ne(t,F0,{value:n})}var e,r,i,u,a,c,s,l}),colorpicker:Tk(function(t){var r=Vm(u0(a0,function(t){return"tox-"+t}).sketch({dom:{tag:"div",classes:["tox-color-picker-container"],attributes:{role:"presentation"}},onValidHex:function(t){Ne(t,wy,{name:"hex-valid",value:!0})},onInvalidHex:function(t){Ne(t,wy,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[r.asSpec()],behaviours:Za([_f.config({store:{mode:"manual",getValue:function(t){var n=r.get(t);return id.getCurrent(n).bind(function(t){return _f.getValue(t).hex}).map(function(t){return"#"+t}).getOr("")},setValue:function(t,n){var e=/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n),o=r.get(t);id.getCurrent(o).fold(function(){console.log("Can not find form")},function(t){_f.setValue(t,{hex:ft.from(e[1]).getOr("")}),hw.getField(t,"hex").each(function(t){ze(t,ho())})})}}}),x0()])}}),dropzone:Tk(function(t,n){return s0(t,n.shared.providers)}),grid:Tk(function(t,n){return e=n.shared,{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--"+t.columns+"col"]},components:A(t.items,e.interpreter)};var e}),listbox:Tk(function(t,n){return e=t,r=(o=n).shared.providers,i=ot(e.items).filter(hk),u=e.label.map(function(t){return Qb(t,r)}),a={dom:{tag:"div",classes:["tox-listboxfield"]},components:[dy.parts.field({dom:{},factory:{sketch:function(t){return sS({uid:t.uid,text:i.map(function(t){return t.text}),icon:ft.none(),tooltip:e.label,role:ft.none(),fetch:function(t,n){n(fS(p1(t,e.name,e.items,_f.getValue(t)),yh.CLOSE_ON_EXECUTE,o,!1))},onSetup:tt(ct),getApi:tt({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[gy.config({}),_f.config({store:{mode:"manual",initialValue:i.map(function(t){return t.value}).getOr(""),getValue:function(t){return _r(t.element,g1)},setValue:function(n,t){h1(e.items,t).each(function(t){Or(n.element,g1,t.value),Ne(n,YS,{text:t.text})})}}})]},"tox-listbox",o.shared)}}})]},dy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:lt([u.toArray(),[a]]),fieldBehaviours:Za([fd.config({disabled:tt(e.disabled),onDisabled:function(t){dy.getField(t).each(fd.disable)},onEnabled:function(t){dy.getField(t).each(fd.enable)}})])});var e,o,r,i,u,a}),selectbox:Tk(function(t,n){return e=t,o=n.shared.providers,r=A(e.items,function(t){return{text:o.translate(t.text),value:t.value}}),i=e.label.map(function(t){return Qb(t,o)}),u={dom:{tag:"div",classes:["tox-selectfield"]},components:lt([[dy.parts.field({dom:{},selectAttributes:{size:e.size},options:r,factory:v1,selectBehaviours:Za([fd.config({disabled:function(){return e.disabled||o.isDisabled()}}),gy.config({}),lm("selectbox-change",[Xe(vo(),function(t,n){Ne(t,by,{name:e.name})})])])})],(1<e.size?ft.none():ft.some(Wm("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},o.icons))).toArray()])},dy.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:lt([i.toArray(),[u]]),fieldBehaviours:Za([fd.config({disabled:function(){return e.disabled||o.isDisabled()},onDisabled:function(t){dy.getField(t).each(fd.disable)},onEnabled:function(t){dy.getField(t).each(fd.enable)}}),dv()])});var e,o,r,i,u}),sizeinput:Tk(function(t,n){return OS(t,n.shared.providers)}),urlinput:Tk(function(t,n){return _k(t,n,n.urlinput)}),customeditor:Tk(function(e){var o=fc(),n=Vm({dom:{tag:e.tag}}),r=fc();return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:Za([lm("custom-editor-events",[$o(function(t){n.getOpt(t).each(function(n){(Kn(e,"init")?e.init(n.element.dom):Cw.load(e.scriptId,e.scriptUrl).then(function(t){return t(n.element.dom,e.settings)})).then(function(n){r.on(function(t){n.setValue(t)}),r.clear(),o.set(n)})})})]),_f.config({store:{mode:"manual",getValue:function(){return o.get().fold(function(){return r.get().getOr("")},function(t){return t.getValue()})},setValue:function(t,n){o.get().fold(function(){r.set(n)},function(t){return t.setValue(n)})}}}),x0()]),components:[n.asSpec()]}}),htmlpanel:Tk(function(t){return"presentation"===t.presets?sy.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html}}):sy.sketch({dom:{tag:"div",classes:["tox-form__group"],innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:Za([gy.config({}),Rg.config({})])})}),imagetools:Tk(function(t,n){return pk(t,n.shared.providers)}),table:Tk(function(t,n){return vk(t,n.shared.providers)}),panel:Tk(function(t,n){return{dom:{tag:"div",classes:t.classes},components:A(t.items,n.shared.interpreter)}})},A1={field:function(t,n){return n}},M1=function(n,e,o){return kt(B1,e.type).fold(function(){return console.error('Unknown factory type "'+e.type+'", defaulting to container: ',e),e},function(t){return t(n,e,o)})},F1={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},I1=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",format:"bold"},{title:"Italic",format:"italic"},{title:"Underline",format:"underline"},{title:"Strikethrough",format:"strikethrough"},{title:"Superscript",format:"superscript"},{title:"Subscript",format:"subscript"},{title:"Code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Align",items:[{title:"Left",format:"alignleft"},{title:"Center",format:"aligncenter"},{title:"Right",format:"alignright"},{title:"Justify",format:"alignjustify"}]}],R1=function(t){return R(t,function(t,n){if(Kn(n,"items")){var e=R1(n.items);return{customFormats:t.customFormats.concat(e.customFormats),formats:t.formats.concat([{title:n.title,items:e.formats}])}}if(Kn(n,"inline")||Kn(n,"block")||Kn(n,"selector")){var o="custom-"+(y(n.name)?n.name:n.title.toLowerCase());return{customFormats:t.customFormats.concat([{name:o,format:n}]),formats:t.formats.concat([{title:n.title,format:o,icon:n.icon}])}}return st(st({},t),{formats:t.formats.concat(n)})},{customFormats:[],formats:[]})},V1=Ow.trim,P1=Fk("true"),H1=Fk("false"),z1=function(t){var n=A(gs(de.fromDom(t),"h1,h2,h3,h4,h5,h6,a:not([href])"),function(t){return t.dom});return F(A(F(n,Hk),zk).concat(A(F(n,Vk),Nk)),Lk)},N1="tinymce-url-history",L1=td,j1=Qf,W1=tt([dn("shell",!1),Jt("makeItem"),dn("setupItem",ct),Tf("listBehaviours",[Mg])]),U1=tt([Kf({name:"items",overrides:function(){return{behaviours:Za([Mg.config({})])}}})]),G1=wl({name:tt("CustomList")(),configFields:W1(),partFields:U1(),factory:function(s,t,n,e){var o=s.shell?{behaviours:[Mg.config({})],components:[]}:{behaviours:[],components:t};return{uid:s.uid,dom:s.dom,components:o.components,behaviours:Qs(s.listBehaviours,o.behaviours),apis:{setItems:function(a,c){var t;t=a,(s.shell?ft.some(t):ll(t,s,"items")).fold(function(){throw console.error("Custom List was defined to not be a shell, but no item container was specified in components"),new Error("Custom List was defined to not be a shell, but no item container was specified in components")},function(n){var t=Mg.contents(n),e=c.length,o=e-t.length,r=0<o?D(o,function(){return s.makeItem()}):[],i=t.slice(e);dt(i,function(t){return Mg.remove(n,t)}),dt(r,function(t){return Mg.append(n,t)});var u=Mg.contents(n);dt(u,function(t,n){s.setupItem(a,t,c[n],n)})})}}}},apis:{setItems:function(t,n,e){t.setItems(n,e)}}}),X1=tt([Jt("dom"),dn("shell",!0),Js("toolbarBehaviours",[Mg])]),Y1=tt([Kf({name:"groups",overrides:function(){return{behaviours:Za([Mg.config({})])}}})]),q1=wl({name:"Toolbar",configFields:X1(),partFields:Y1(),factory:function(o,t,n,e){var r=o.shell?{behaviours:[Mg.config({})],components:[]}:{behaviours:[],components:t};return{uid:o.uid,dom:o.dom,components:r.components,behaviours:Qs(o.toolbarBehaviours,r.behaviours),apis:{setGroups:function(t,n){var e;e=t,(o.shell?ft.some(e):ll(e,o,"groups")).fold(function(){throw console.error("Toolbar was defined to not be a shell, but no groups container was specified in components"),new Error("Toolbar was defined to not be a shell, but no groups container was specified in components")},function(t){Mg.set(t,n)})}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)}}}),K1=tt([]),J1=Object.freeze({__proto__:null,setup:ct,isDocked:O,getBehaviours:K1}),$1=Vn([{static:[]},{absolute:["positionCss"]},{fixed:["positionCss"]}]),Q1=function(t,n,e){var o,r,i,u,a;t.getSystem().isConnected()&&(i=e,u=(r=n).lazyViewport(o=t),(a=i.isDocked())&&sC(o,r,i,u),uC(o,u,i).each(function(t){i.setDocked(!a),t.fold(function(){return aC(o,r)},function(t){return cC(o,r,t)},function(t){sC(o,r,i,u,!0),cC(o,r,t)})}))},Z1=Object.freeze({__proto__:null,refresh:Q1,reset:lC,isDocked:function(t,n,e){return e.isDocked()},getModes:function(t,n,e){return e.getModes()},setModes:function(t,n,e,o){return e.setModes(o)}}),tO=Object.freeze({__proto__:null,events:function(o,r){return Jo([Qe(xo(),function(n,e){o.contextual.each(function(t){Xr(n.element,t.transitionClass)&&(qr(n.element,[t.transitionClass,t.fadeInClass]),(r.isVisible()?t.onShown:t.onHidden)(n)),e.stop()})}),Xe(Po(),function(t,n){Q1(t,o,r)}),Xe(Ho(),function(t,n){lC(t,o,r)})])}}),nO=xa({fields:[fn("contextual",[Qt("fadeInClass"),Qt("fadeOutClass"),Qt("transitionClass"),tn("lazyContext"),Ku("onShow"),Ku("onShown"),Ku("onHide"),Ku("onHidden")]),bn("lazyViewport",Fi),yn("modes",["top","bottom"],re),Ku("onDocked"),Ku("onUndocked")],name:"docking",active:tO,apis:Z1,state:Object.freeze({__proto__:null,init:function(t){var n=wn(!1),e=wn(!0),o=fc(),r=wn(t.modes);return au({isDocked:n.get,setDocked:n.set,getInitialPos:o.get,setInitialPos:o.set,clearInitialPos:o.clear,isVisible:e.get,setVisible:e.set,getModes:r.get,setModes:r.set,readState:function(){return"docked: "+n.get()+", visible: "+e.get()+", modes: "+r.get().join(",")}})}})}),eO=tt(Ar("toolbar-height-change")),oO={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},rO="tox-tinymce--toolbar-sticky-on",iO="tox-tinymce--toolbar-sticky-off",uO=Object.freeze({__proto__:null,setup:function(t,n,e){t.inline||(n.header.isPositionedAtTop()||t.on("ResizeEditor",function(){e().each(nO.reset)}),t.on("ResizeWindow ResizeEditor",function(){e().each(dC)}),t.on("SkinLoaded",function(){e().each(function(t){nO.isDocked(t)?nO.reset(t):nO.refresh(t)})}),t.on("FullscreenStateChanged",function(){e().each(nO.reset)})),t.on("AfterScrollIntoView",function(b){e().each(function(t){nO.refresh(t);var n,e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v=t.element;Id(v)&&(n=b,r=(o=or(e=v)).dom.defaultView.innerHeight,i=Oi(o),a=Mi(u=de.fromDom(n.elm)),c=vi(u),l=(s=a.y)+c,f=xi(e),d=vi(e),g=(m=f.top)+d,p=Math.abs(m-i.top)<2,h=Math.abs(g-(i.top+r))<2,p&&s<g?_i(i.left,s-d,o):h&&m<l&&_i(i.left,s-r+c+d,o))})}),t.on("PostRender",function(){gC(t,!1)})},isDocked:function(t){return t().map(nO.isDocked).getOr(!1)},getBehaviours:pC}),aO=te([Qt("type"),$t("items",Nt([ne([Qt("name"),on("items",re)]),re]))].concat(Rp)),cO=[cn("text"),cn("tooltip"),cn("icon"),tn("fetch"),bn("onSetup",function(){return ct})],sO=te(H([Qt("type")],cO)),lO=te([Qt("type"),cn("tooltip"),cn("icon"),cn("text"),sn("select"),tn("fetch"),bn("onSetup",function(){return ct}),hn("presets","normal",["normal","color","listpreview"]),dn("columns",1),tn("onAction"),tn("onItemAction")]),fO=xl({factory:function(n,o){var t={focus:Bg.focusIn,setMenus:function(t,n){var e=A(n,function(n){return mS(hC({type:"menubutton",text:n.text,fetch:function(t){t(n.getItems())}}).mapError(function(t){return se(t)}).getOrDie(),"tox-mbtn",o.backstage,ft.some("menuitem"))});Mg.set(t,e)}};return{uid:n.uid,dom:n.dom,components:[],behaviours:Za([Mg.config({}),lm("menubar-events",[$o(function(t){n.onSetup(t)}),Xe(lo(),function(e,t){Fu(e.element,".tox-mbtn--active").each(function(n){Iu(t.event.target,".tox-mbtn").each(function(t){Bn(n,t)||e.getSystem().getByDom(n).each(function(n){e.getSystem().getByDom(t).each(function(t){B0.expand(t),B0.close(n),Rg.focus(t)})})})})}),Xe(Wo(),function(e,t){t.event.prevFocus.bind(function(t){return e.getSystem().getByDom(t).toOptional()}).each(function(n){t.event.newFocus.bind(function(t){return e.getSystem().getByDom(t).toOptional()}).each(function(t){B0.isOpen(n)&&(B0.expand(t),B0.close(n))})})})]),Bg.config({mode:"flow",selector:".tox-mbtn",onEscape:function(t){return n.onEscape(t),ft.some(!0)}}),gy.config({})]),apis:t,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Jt("dom"),Jt("uid"),Jt("onEscape"),Jt("backstage"),dn("onSetup",ct)],apis:{focus:function(t,n){t.focus(n)},setMenus:function(t,n,e){t.setMenus(n,e)}}}),dO=Object.freeze({__proto__:null,refresh:function(t,n,e){var o;e.isExpanded()&&(ai(t.element,bC(n)),o=yC(n,t.element),ni(t.element,bC(n),o))},grow:function(t,n,e){e.isExpanded()||OC(t,n,e)},shrink:function(t,n,e){e.isExpanded()&&CC(t,n,e)},immediateShrink:function(t,n,e){e.isExpanded()&&kC(t,n,e)},hasGrown:function(t,n,e){return e.isExpanded()},hasShrunk:function(t,n,e){return e.isCollapsed()},isGrowing:_C,isShrinking:TC,isTransitioning:function(t,n,e){return _C(t,n)||TC(t,n)},toggleGrow:function(t,n,e){(e.isExpanded()?CC:OC)(t,n,e)},disableTransitions:xC}),mO=Object.freeze({__proto__:null,exhibit:function(t,n,e){return Hr(n.expanded?{classes:[n.openClass],styles:{}}:{classes:[n.closedClass],styles:Ae(n.dimension.property,"0px")})},events:function(e,o){return Jo([Qe(xo(),function(t,n){n.event.raw.propertyName===e.dimension.property&&(xC(t,e),o.isExpanded()&&ai(t.element,e.dimension.property),(o.isExpanded()?e.onGrown:e.onShrunk)(t))})])}}),gO=xa({fields:[Jt("closedClass"),Jt("openClass"),Jt("shrinkingClass"),Jt("growingClass"),rn("getAnimationRoot"),Ku("onShrunk"),Ku("onStartShrink"),Ku("onGrown"),Ku("onStartGrow"),dn("expanded",!1),$t("dimension",qt("property",{width:[Zu("property","width"),Zu("getDimension",function(t){return wi(t)+"px"})],height:[Zu("property","height"),Zu("getDimension",function(t){return vi(t)+"px"})]}))],name:"sliding",active:mO,apis:dO,state:Object.freeze({__proto__:null,init:function(t){var n=wn(t.expanded);return au({isExpanded:function(){return!0===n.get()},isCollapsed:function(){return!1===n.get()},setCollapsed:S(n.set,!1),setExpanded:S(n.set,!0),readState:function(){return"expanded: "+n.get()}})}})}),pO="container",hO=[Js("slotBehaviours",[])],vO=yt({getSlotNames:function(t,n){return t.getSlotNames(n)},getSlot:function(t,n,e){return t.getSlot(n,e)},isShowing:function(t,n,e){return t.isShowing(n,e)},hideSlot:function(t,n,e){return t.hideSlot(n,e)},hideAllSlots:function(t,n){return t.hideAllSlots(n)},showSlot:function(t,n,e){return t.showSlot(n,e)}},Vr),bO=st(st({},vO),{sketch:function(t){var e,n={slot:function(t,n){return e.push(t),il(pO,EC(t),n)},record:tt(e=[])},o=t(n),r=A(n.record(),function(t){return Yf({name:t,pname:EC(t)})});return yl(pO,hO,r,s1,o)}}),yO=te([cn("icon"),cn("tooltip"),bn("onShow",ct),bn("onHide",ct),bn("onSetup",function(){return ct})]),xO=Ar("FixSizeEvent"),wO=Ar("AutoSizeEvent"),SO=Object.freeze({__proto__:null,block:function(t,n,e,o){Or(t.element,"aria-busy",!0);var r=n.getRoot(t).getOr(t),i=Za([Bg.config({mode:"special",onTab:function(){return ft.some(!0)},onShiftTab:function(){return ft.some(!0)}}),Rg.config({})]),u=o(r,i),a=r.getSystem().build(u);Mg.append(r,yu(a)),a.hasConfigured(Bg)&&n.focus&&Bg.focusIn(a),e.isBlocked()||n.onBlock(t),e.blockWith(function(){return Mg.remove(r,a)})},unblock:function(t,n,e){Dr(t.element,"aria-busy"),e.isBlocked()&&n.onUnblock(t),e.clear()}}),kO=xa({fields:[bn("getRoot",ft.none),vn("focus",!0),Ku("onBlock"),Ku("onUnblock")],name:"blocking",apis:SO,state:Object.freeze({__proto__:null,init:function(){var n=sc(function(t){return t.destroy()});return au({readState:n.isSet,blockWith:function(t){n.set({destroy:t})},clear:n.clear,isBlocked:n.isSet})}})}),CO=tt([Js("splitToolbarBehaviours",[Jy]),fe("builtGroups",function(){return wn([])})]),OO=tt([Yu(["overflowToggledClass"]),sn("getOverflowBounds"),Jt("lazySink"),fe("overflowGroups",function(){return wn([])})].concat(CO())),_O=tt([Yf({factory:q1,schema:X1(),name:"primary"}),qf({schema:X1(),name:"overflow"}),qf({name:"overflow-button"}),qf({name:"overflow-group"})]),TO=tt(function(t,n){var e=t,o=Math.floor(n);ni(e,"max-width",Cu.max(e,o,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"])+"px")}),EO=tt([Yu(["toggledClass"]),Jt("lazySink"),tn("fetch"),sn("getBounds"),fn("fireDismissalEventInstead",[dn("event",Lo())]),zc()]),DO=tt([qf({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:Za([Hg.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),qf({factory:q1,schema:X1(),name:"toolbar",overrides:function(n){return{toolbarBehaviours:Za([Bg.config({mode:"cyclic",onEscape:function(t){return ll(t,n,"button").each(Rg.focus),ft.none()}})])}}})]),BO=wl({name:"FloatingToolbarButton",factory:function(u,t,a,n){return st(st({},cp.sketch(st(st({},n.button()),{action:function(t){NC(t,n)},buttonBehaviours:Ef({dump:n.button().buttonBehaviours},[Jy.config({others:{toolbarSandbox:function(t){return o=t,e=a,r=u,{dom:{tag:"div",attributes:{id:(i=Ru()).id}},behaviours:Za([Bg.config({mode:"special",onEscape:function(t){return pf.close(t),ft.some(!0)}}),pf.config({onOpen:function(t,n){r.fetch().get(function(t){jC(o,n,r,e.layouts,t),i.link(o.element),Bg.focusIn(n)})},onClose:function(){Hg.off(o),Rg.focus(o),i.unlink(o.element)},isPartOf:function(t,n,e){return Hu(n,e)||Hu(o,e)},getAttachPoint:function(){return r.lazySink(o).getOrDie()}}),oc.config({channels:st(st({},Ws(st({isExtraPart:O},r.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Us({doReposition:function(){pf.getState(Jy.getCoupled(o,"toolbarSandbox")).each(function(t){LC(o,t,r,e.layouts)})}}))})])};var o,e,r,i}}})])}))),{apis:{setGroups:function(n,e){pf.getState(Jy.getCoupled(n,"toolbarSandbox")).each(function(t){jC(n,t,u,a.layouts,e)})},reposition:function(n){pf.getState(Jy.getCoupled(n,"toolbarSandbox")).each(function(t){LC(n,t,u,a.layouts)})},toggle:function(t){NC(t,n)},getToolbar:function(t){return pf.getState(Jy.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return pf.isOpen(Jy.getCoupled(t,"toolbarSandbox"))}}})},configFields:EO(),partFields:DO(),apis:{setGroups:function(t,n,e){t.setGroups(n,e)},reposition:function(t,n){t.reposition(n)},toggle:function(t,n){t.toggle(n)},getToolbar:function(t,n){return t.getToolbar(n)},isOpen:function(t,n){return t.isOpen(n)}}}),AO=tt([Jt("items"),Yu(["itemSelector"]),Js("tgroupBehaviours",[Bg])]),MO=tt([Jf({name:"items",unit:"item"})]),FO=wl({name:"ToolbarGroup",configFields:AO(),partFields:MO(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,behaviours:Qs(t.tgroupBehaviours,[Bg.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),IO=wl({name:"SplitFloatingToolbar",configFields:OO(),partFields:_O(),factory:function(e,t,n,o){var r=Vm(BO.sketch({fetch:function(){return Wy(function(t){t(WC(e.overflowGroups.get()))})},layouts:{onLtr:function(){return[Ga,Ua]},onRtl:function(){return[Ua,Ga]},onBottomLtr:function(){return[Ya,Xa]},onBottomRtl:function(){return[Xa,Ya]}},getBounds:n.getOverflowBounds,lazySink:e.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:e.markers.overflowToggledClass},parts:{button:o["overflow-button"](),toolbar:o.overflow()}}));return{uid:e.uid,dom:e.dom,components:t,behaviours:Qs(e.splitToolbarBehaviours,[Jy.config({others:{overflowGroup:function(){return FO.sketch(st(st({},o["overflow-group"]()),{items:[r.asSpec()]}))}}})]),apis:{setGroups:function(t,n){e.builtGroups.set(A(n,t.getSystem().build)),UC(t,r,e)},refresh:function(t){return UC(t,r,e)},toggle:function(t){r.getOpt(t).each(function(t){BO.toggle(t)})},isOpen:function(t){return r.getOpt(t).map(BO.isOpen).getOr(!1)},reposition:function(t){r.getOpt(t).each(function(t){BO.reposition(t)})},getOverflow:function(t){return r.getOpt(t).bind(BO.getToolbar)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},reposition:function(t,n){t.reposition(n)},toggle:function(t,n){t.toggle(n)},isOpen:function(t,n){return t.isOpen(n)},getOverflow:function(t,n){return t.getOverflow(n)}}}),RO=tt([Yu(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Ku("onOpened"),Ku("onClosed")].concat(CO())),VO=tt([Yf({factory:q1,schema:X1(),name:"primary"}),Yf({factory:q1,schema:X1(),name:"overflow",overrides:function(n){return{toolbarBehaviours:Za([gO.config({dimension:{property:"height"},closedClass:n.markers.closedClass,openClass:n.markers.openClass,shrinkingClass:n.markers.shrinkingClass,growingClass:n.markers.growingClass,onShrunk:function(t){ll(t,n,"overflow-button").each(function(t){Hg.off(t),Rg.focus(t)}),n.onClosed(t)},onGrown:function(t){Bg.focusIn(t),n.onOpened(t)},onStartGrow:function(t){ll(t,n,"overflow-button").each(Hg.on)}}),Bg.config({mode:"acyclic",onEscape:function(t){return ll(t,n,"overflow-button").each(Rg.focus),ft.some(!0)}})])}}}),qf({name:"overflow-button",overrides:function(t){return{buttonBehaviours:Za([Hg.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"pressed"},toggleOnExecute:!1})])}}}),qf({name:"overflow-group"})]),PO=wl({name:"SplitSlidingToolbar",configFields:RO(),partFields:VO(),factory:function(o,t,n,e){var r="alloy.toolbar.toggle";return{uid:o.uid,dom:o.dom,components:t,behaviours:Qs(o.splitToolbarBehaviours,[Jy.config({others:{overflowGroup:function(n){return FO.sketch(st(st({},e["overflow-group"]()),{items:[cp.sketch(st(st({},e["overflow-button"]()),{action:function(t){ze(n,r)}}))]}))}}}),lm("toolbar-toggle-events",[Xe(r,function(t){GC(t,o)})])]),apis:{setGroups:function(t,n){var e=A(n,t.getSystem().build);o.builtGroups.set(e),l1(t,o)},refresh:function(t){return l1(t,o)},toggle:function(t){return GC(t,o)},isOpen:function(t){return ll(t,o,"overflow").map(gO.hasGrown).getOr(!1)}},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)},refresh:function(t,n){t.refresh(n)},toggle:function(t,n){t.toggle(n)},isOpen:function(t,n){return t.isOpen(n)}}}),HO=j1.optional({factory:fO,name:"menubar",schema:[Jt("backstage")]}),zO=j1.optional({factory:{sketch:function(t){return G1.sketch({uid:t.uid,dom:t.dom,listBehaviours:Za([Bg.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return JC({type:t.type,uid:Ar("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),ft.some(!0)}})},setupItem:function(t,n,e,o){q1.setGroups(n,e)},shell:!0})}},name:"multiple-toolbar",schema:[Jt("dom"),Jt("onEscape")]}),NO=j1.optional({factory:{sketch:function(t){return(t.type===ph.sliding?function(t){var n=PO.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),e=PO.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=KC(t);return PO.sketch(st(st({},o),{components:[n,e],markers:{openClass:"tox-toolbar__overflow--open",closedClass:"tox-toolbar__overflow--closed",growingClass:"tox-toolbar__overflow--growing",shrinkingClass:"tox-toolbar__overflow--shrinking",overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(t){t.getSystem().broadcastOn([eO()],{type:"opened"})},onClosed:function(t){t.getSystem().broadcastOn([eO()],{type:"closed"})}}))}:t.type===ph.floating?function(i){var t=KC(i),n=IO.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return IO.sketch(st(st({},t),{lazySink:i.getSink,getOverflowBounds:function(){var t=i.moreDrawerData.lazyHeader().element,n=Mi(t),e=ir(t),o=Mi(e),r=Math.max(e.dom.scrollHeight,o.height);return Bi(n.x+4,o.y,n.width-8,r)},parts:st(st({},t.parts),{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:i.attributes}}}),components:[n],markers:{overflowToggledClass:"tox-tbtn--enabled"}}))}:JC)({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),ft.some(!0)},cyclicKeying:!1,initGroups:[],getSink:t.getSink,providers:t.providers,moreDrawerData:{lazyToolbar:t.lazyToolbar,lazyMoreButton:t.lazyMoreButton,lazyHeader:t.lazyHeader},attributes:t.attributes})}},name:"toolbar",schema:[Jt("dom"),Jt("onEscape"),Jt("getSink")]}),LO=j1.optional({factory:{sketch:function(t){var n=t.editor,e=t.sticky?pC:K1;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:Za(e(n,t.sharedBackstage))}}},name:"header",schema:[Jt("dom")]}),jO=j1.optional({name:"socket",schema:[Jt("dom")]}),WO=j1.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"complementary"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:Za([gy.config({}),Rg.config({}),gO.config({dimension:{property:"width"},closedClass:"tox-sidebar--sliding-closed",openClass:"tox-sidebar--sliding-open",shrinkingClass:"tox-sidebar--sliding-shrinking",growingClass:"tox-sidebar--sliding-growing",onShrunk:function(t){id.getCurrent(t).each(bO.hideAllSlots),ze(t,wO)},onGrown:function(t){ze(t,wO)},onStartGrow:function(t){Ne(t,xO,{width:ii(t.element,"width").getOr("")})},onStartShrink:function(t){Ne(t,xO,{width:wi(t.element)+"px"})}}),Mg.config({}),id.config({find:function(t){var n=Mg.contents(t);return ot(n)}})])}],behaviours:Za([Sw(0),lm("sidebar-sliding-events",[Xe(xO,function(t,n){ni(t.element,"width",n.event.width)}),Xe(wO,function(t,n){ai(t.element,"width")})])])}}},name:"sidebar",schema:[Jt("dom")]}),UO=j1.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:Za([Mg.config({}),kO.config({focus:!1}),id.config({find:function(t){return ot(t.components())}})]),components:[]}}},name:"throbber",schema:[Jt("dom")]}),GO=wl({name:"OuterContainer",factory:function(e,t,n){return{uid:e.uid,dom:e.dom,components:t,apis:{getSocket:function(t){return L1.getPart(t,e,"socket")},setSidebar:function(t,n){L1.getPart(t,e,"sidebar").each(function(t){return BC(t,n)})},toggleSidebar:function(t,n){L1.getPart(t,e,"sidebar").each(function(t){var e=n;id.getCurrent(t).each(function(n){id.getCurrent(n).each(function(t){gO.hasGrown(n)?bO.isShowing(t,e)?gO.shrink(n):(bO.hideAllSlots(t),bO.showSlot(t,e)):(bO.hideAllSlots(t),bO.showSlot(t,e),gO.grow(n))})})})},whichSidebar:function(t){return L1.getPart(t,e,"sidebar").bind(AC).getOrNull()},getHeader:function(t){return L1.getPart(t,e,"header")},getToolbar:function(t){return L1.getPart(t,e,"toolbar")},setToolbar:function(t,n){L1.getPart(t,e,"toolbar").each(function(t){t.getApis().setGroups(t,n)})},setToolbars:function(t,n){L1.getPart(t,e,"multiple-toolbar").each(function(t){G1.setItems(t,n)})},refreshToolbar:function(t){L1.getPart(t,e,"toolbar").each(function(t){return t.getApis().refresh(t)})},toggleToolbarDrawer:function(t){L1.getPart(t,e,"toolbar").each(function(n){var t=n.getApis().toggle;null!=t?ft.some(function(t){return t(n)}(t)):ft.none()})},isToolbarDrawerToggled:function(t){return L1.getPart(t,e,"toolbar").bind(function(n){return ft.from(n.getApis().isOpen).map(function(t){return t(n)})}).getOr(!1)},getThrobber:function(t){return L1.getPart(t,e,"throbber")},focusToolbar:function(t){L1.getPart(t,e,"toolbar").orThunk(function(){return L1.getPart(t,e,"multiple-toolbar")}).each(function(t){Bg.focusIn(t)})},setMenubar:function(t,n){L1.getPart(t,e,"menubar").each(function(t){fO.setMenus(t,n)})},focusMenubar:function(t){L1.getPart(t,e,"menubar").each(function(t){fO.focus(t)})}},behaviours:e.behaviours}},configFields:[Jt("dom"),Jt("behaviours")],partFields:[LO,HO,NO,zO,jO,WO,UO],apis:{getSocket:function(t,n){return t.getSocket(n)},setSidebar:function(t,n,e){t.setSidebar(n,e)},toggleSidebar:function(t,n,e){t.toggleSidebar(n,e)},whichSidebar:function(t,n){return t.whichSidebar(n)},getHeader:function(t,n){return t.getHeader(n)},getToolbar:function(t,n){return t.getToolbar(n)},setToolbar:function(t,n,e){var o=A(e,YC);t.setToolbar(n,o)},setToolbars:function(t,n,e){var o=A(e,function(t){return A(t,YC)});t.setToolbars(n,o)},refreshToolbar:function(t,n){return t.refreshToolbar(n)},toggleToolbarDrawer:function(t,n){t.toggleToolbarDrawer(n)},isToolbarDrawerToggled:function(t,n){return t.isToolbarDrawerToggled(n)},getThrobber:function(t,n){return t.getThrobber(n)},setMenubar:function(t,n,e){t.setMenubar(n,e)},focusMenubar:function(t,n){t.focusMenubar(n)},focusToolbar:function(t,n){t.focusToolbar(n)}}}),XO={file:{title:"File",items:"newdocument restoredraft | preview | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | formats blockformats fontformats fontsizes align lineheight | forecolor backcolor | language | 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"}},YO=S(n1,!1),qO=S(n1,!0);function KO(t,n,e,o){var r;return{type:"basic",data:(r=t.getParam(n,e,"string"),A(o===d1.SemiColon?r.replace(/;$/,"").split(";"):r.split(" "),function(t){var n=t,e=t,o=t.split("=");return 1<o.length&&(n=o[0],e=o[1]),{title:n,format:e}}))}}function JO(e){var t={type:"basic",data:D_};return{tooltip:"Align",text:ft.none(),icon:ft.some("align-left"),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:ft.none,getPreviewFor:function(t){return ft.none},onAction:function(n){return function(){return V(D_,function(t){return t.format===n.format}).each(function(t){return e.execCommand(t.command)})}},updateText:function(t){var n=V(D_,function(t){return e.formatter.match(t.format)}).fold(tt("left"),function(t){return t.title.toLowerCase()});Ne(t,qS,{icon:"align-"+n})},dataset:t,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}}function $O(t){return A(t.split(/\s*,\s*/),function(t){return t.replace(/^['"]+|['"]+$/g,"")})}function QO(r){function i(){function e(t){return t?$O(t)[0]:""}var t=r.queryCommandValue("FontName"),n=a.data,o=t?t.toLowerCase():"";return{matchOpt:V(n,function(t){var n=t.format;return n.toLowerCase()===o||e(n).toLowerCase()===e(o).toLowerCase()}).orThunk(function(){return $r(0===(t=o).indexOf("-apple-system")&&(n=$O(t.toLowerCase()),N(B_,function(t){return-1<n.indexOf(t.toLowerCase())})),{title:u,format:o});var t,n}),font:t}}var u="System Font",a=KO(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",d1.SemiColon);return{tooltip:"Fonts",text:ft.some(u),icon:ft.none(),isSelectedFor:function(n){return function(t){return t.exists(function(t){return t.format===n})}},getCurrentValue:function(){return i().matchOpt},getPreviewFor:function(t){return function(){return ft.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}},onAction:function(t){return function(){r.undoManager.transact(function(){r.focus(),r.execCommand("FontName",!1,t.format)})}},updateText:function(t){var n=i(),e=n.matchOpt,o=n.font,r=e.fold(tt(o),function(t){return t.title});Ne(t,YS,{text:r})},dataset:a,shouldHide:!1,isInvalid:O}}function ZO(e){function i(){var a=ft.none(),c=o.data,s=e.queryCommandValue("FontSize");if(s)for(var t=function(t){var n,e,o,r,i=(e=t,/[0-9.]+px$/.test(n=s)?(o=72*parseInt(n,10)/96,r=Math.pow(10,e||0),Math.round(o*r)/r+"pt"):kt(M_,n).getOr(n)),u=kt(A_,i).getOr("");a=V(c,function(t){return t.format===s||t.format===i||t.format===u})},n=3;a.isNone()&&0<=n;n--)t(n);return{matchOpt:a,size:s}}var t=tt(ft.none),o=KO(e,"fontsize_formats","8pt 10pt 12pt 14pt 18pt 24pt 36pt",d1.Space);return{tooltip:"Font sizes",text:ft.some("12pt"),icon:ft.none(),isSelectedFor:function(n){return function(t){return t.exists(function(t){return t.format===n})}},getPreviewFor:t,getCurrentValue:function(){return i().matchOpt},onAction:function(t){return function(){e.undoManager.transact(function(){e.focus(),e.execCommand("FontSize",!1,t.format)})}},updateText:function(t){var n=i(),e=n.matchOpt,o=n.size,r=e.fold(tt(o),function(t){return t.title});Ne(t,YS,{text:r})},dataset:o,shouldHide:!1,isInvalid:O}}function t_(t,n){var e=n(),o=A(e,function(t){return t.format});return ft.from(t.formatter.closest(o)).bind(function(n){return V(e,function(t){return t.format===n})}).orThunk(function(){return $r(t.formatter.match("p"),{title:"Paragraph",format:"p"})})}function n_(e){var o=KO(e,"block_formats","Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre",d1.SemiColon);return{tooltip:"Blocks",text:ft.some("Paragraph"),icon:ft.none(),isSelectedFor:function(t){return function(){return e.formatter.match(t)}},getCurrentValue:ft.none,getPreviewFor:function(n){return function(){var t=e.formatter.get(n);return ft.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:e.dom.parseStyle(e.formatter.getCssText(n))})}},onAction:r1(e),updateText:function(t){var n=t_(e,function(){return o.data}).fold(tt("Paragraph"),function(t){return t.title});Ne(t,YS,{text:n})},dataset:o,shouldHide:!1,isInvalid:function(t){return!e.formatter.canApply(t.format)}}}function e_(r,t){return{tooltip:"Formats",text:ft.some("Paragraph"),icon:ft.none(),isSelectedFor:function(t){return function(){return r.formatter.match(t)}},getCurrentValue:ft.none,getPreviewFor:function(n){return function(){var t=r.formatter.get(n);return void 0!==t?ft.some({tag:0<t.length&&(t[0].inline||t[0].block)||"div",styles:r.dom.parseStyle(r.formatter.getCssText(n))}):ft.none()}},onAction:r1(r),updateText:function(t){var e=function(t){var n=t.items;return void 0!==n&&0<n.length?z(n,e):[{title:t.title,format:t.format}]},n=z(Bk(r),e),o=t_(r,tt(n)).fold(tt("Paragraph"),function(t){return t.title});Ne(t,YS,{text:o})},shouldHide:r.getParam("style_formats_autohide",!1,"boolean"),isInvalid:function(t){return!r.formatter.canApply(t.format)},dataset:t}}function o_(n){return{isDisabled:function(){return fd.isDisabled(n)},setDisabled:function(t){return fd.set(n,t)}}}function r_(n){return{setActive:function(t){Hg.set(n,t)},isActive:function(){return Hg.isOn(n)},isDisabled:function(){return fd.isDisabled(n)},setDisabled:function(t){return fd.set(n,t)}}}function i_(t,n){return t.map(function(t){return{"aria-label":n.translate(t),title:n.translate(t)}}).getOr({})}function u_(n,e,t,o,r,i){var u;return{dom:{tag:"button",classes:["tox-tbtn"].concat(e.isSome()?["tox-tbtn--select"]:[]),attributes:i_(t,i)},components:$v([n.map(function(t){return uS(t,i.icons)}),e.map(function(t){return cS(t,"tox-tbtn",i)})]),eventOrder:((u={})[uo()]=["focusing","alloy.base.behaviour","common-button-display-events"],u),buttonBehaviours:Za([Kv(i.isDisabled),dv(),lm("common-button-display-events",[Xe(uo(),function(t,n){n.event.prevent(),ze(t,z_)})])].concat(o.map(function(t){return R_.config({channel:t,initialData:{icon:n,text:e},renderComponents:function(t,n){return $v([t.icon.map(function(t){return uS(t,i.icons)}),t.text.map(function(t){return cS(t,"tox-tbtn",i)})])}})}).toArray()).concat(r.getOr([])))}}function a_(t,n,e){var o,r=wn(ct),i=u_(t.icon,t.text,t.tooltip,ft.none(),ft.none(),e);return cp.sketch({dom:i.dom,components:i.components,eventOrder:XS,buttonBehaviours:Za([lm("toolbar-button-events",[(o={onAction:t.onAction,getApi:n.getApi},tr(function(n,t){mv(o,n)(function(t){Ne(n,GS,{buttonApi:t}),o.onAction(t)})})),gv(n,r),pv(n,r)]),Kv(function(){return t.disabled||e.isDisabled()}),dv()].concat(n.toolbarButtonBehaviours))})}function c_(r,i){return function(t,n,e){var o=r(t).mapError(function(t){return se(t)}).getOrDie();return i(o,n,e)}}function s_(e,t,o,r){var n,i=t.outerContainer,u=o.toolbar,a=o.buttons;d(u,y)?(n=u.map(function(t){var n={toolbar:t,buttons:a,allowToolbarGroups:o.allowToolbarGroups};return G_(e,n,{backstage:r},ft.none())}),GO.setToolbars(i,n)):GO.setToolbar(i,G_(e,o,{backstage:r},ft.none()))}function l_(t){return/^[0-9\.]+(|px)$/i.test(""+t)?ft.some(parseInt(""+t,10)):ft.none()}function f_(t){return u(t)?t+"px":t}function d_(n,t,e){var o=t.filter(function(t){return n<t}),r=e.filter(function(t){return t<n});return o.or(r).getOr(n)}function m_(t){var n=ah(t),e=ch(t),o=lh(t);return l_(n).map(function(t){return d_(t,e,o)})}function g_(u,a,t,n,c){function s(){return x.get()&&!u.removed}function l(t){return y?t.fold(tt(0),function(t){return 1<t.components().length?vi(t.components()[1].element):0}):0}function f(){r.broadcastOn([vf()],{})}function o(t){var n,e,o,r,i;void 0===t&&(t=!1),s()&&(m||(n=p.getOrThunk(function(){var t=l_(ri(mu(),"margin-left")).getOr(0);return wi(mu())-xi(a).left+t}),ni(c.get().element,"max-width",n+"px")),y&&GO.refreshToolbar(d),m||(e=l(GO.getToolbar(d)),o=Ai(a),r=v()?Math.max(o.y-vi(c.get().element)+e,0):o.bottom,ei(d.element,{position:"absolute",top:Math.round(r)+"px",left:Math.round(o.x)+"px"})),g&&(i=c.get(),t?nO.reset(i):nO.refresh(i)),f())}function e(t){var n,e;void 0===t&&(t=!0),!m&&g&&s()&&(n=h.getDockingMode(),(e=function(t){switch(ov(u)){case vh.auto:var n=l(GO.getToolbar(d)),e=vi(t.element)-n,o=Ai(a);if(o.y>e)return"top";var r=ir(a),i=Math.max(r.dom.scrollHeight,vi(r));return o.bottom<i-e||Fi().bottom<o.bottom-e?"bottom":"top";case vh.bottom:return"bottom";default:return vh.top,"top"}}(c.get()))!==n&&(function(t){var n=c.get();nO.setModes(n,[t]),h.setDockingMode(t);var e=v()?Sc.TopToBottom:Sc.BottomToTop;Or(n.element,Zc,e)}(e),t&&o(!0)))}var r=t.uiMothership,d=t.outerContainer,i=Zh.DOM,m=uv(u),g=sv(u),p=lh(u).or(m_(u)),h=n.shared.header,v=h.isPositionedAtTop,b=ev(u),y=b===ph.sliding||b===ph.floating,x=wn(!1);return{isVisible:s,isPositionedAtTop:v,show:function(){x.set(!0),ni(d.element,"display","flex"),i.addClass(u.getBody(),"mce-edit-focus"),ai(r.element,"display"),e(!1),o()},hide:function(){x.set(!1),t.outerContainer&&(ni(d.element,"display","none"),i.removeClass(u.getBody(),"mce-edit-focus")),ni(r.element,"display","none")},update:o,updateMode:e,repositionPopups:f}}function p_(t,n){var e=Ai(t);return{pos:n?e.y:e.bottom,bounds:e}}function h_(i,u){return Xe(GS,function(t,n){var e,o=i.get(t),r=(e=o,{hide:function(){return ze(e,Mo())},getValue:function(){return _f.getValue(e)}});u.onAction(r,n.event.buttonApi)})}function v_(t,n,e){return n.bottom-t.y>=(e=void 0===e?.01:e)&&t.bottom-n.y>=e}function b_(t){var n=function(t){var n=t.getBoundingClientRect();if(n.height<=0&&n.width<=0){var e=dr(de.fromDom(t.startContainer),t.startOffset).element;return(Vi(e)?ar(e):ft.some(e)).filter(Ri).map(function(t){return t.dom.getBoundingClientRect()}).getOr(n)}return n}(t.selection.getRng());if(t.inline){var e=Oi();return Bi(e.left+n.left,e.top+n.top,n.width,n.height)}var o=Mi(de.fromDom(t.getBody()));return Bi(o.x+n.left,o.y+n.top,n.width,n.height)}function y_(t,n,e,o){void 0===o&&(o=0);var r,i,u,a,c=Ei(window),s=Ai(de.fromDom(t.getContentAreaContainer())),l=dh(t)||mh(t)||nv(t),f=(r=s,i=c,u=o,{x:a=Math.max(r.x+u,i.x),width:Math.min(r.right-u,i.right)-a}),d=f.x,m=f.width;if(t.inline&&!l)return Bi(d,c.y,m,c.height);var g=function(t,n,e,o,r,i){var u=de.fromDom(t.getContainer()),a=Ai(Fu(u,".tox-editor-header").getOr(u)),c=a.y>=n.bottom,s=o&&!c;if(t.inline&&s)return{y:Math.max(a.bottom+i,e.y),bottom:e.bottom};if(t.inline&&!s)return{y:e.y,bottom:Math.min(a.y-i,e.bottom)};var l="line"===r?Ai(u):n;return s?{y:Math.max(a.bottom+i,e.y),bottom:Math.min(l.bottom-i,e.bottom)}:{y:Math.max(l.y+i,e.y),bottom:Math.min(a.y-i,e.bottom)}}(t,s,c,n.header.isPositionedAtTop(),e,o),p=g.y;return Bi(d,p,m,g.bottom-p)}function x_(t){return"node"===t}function w_(t,r,n,i,e){var u=b_(t),o=i.lastElement().exists(function(t){return Bn(n,t)}),a=n,c=t.selection.getRng(),s=dr(de.fromDom(c.startContainer),c.startOffset);return c.startContainer===c.endContainer&&c.startOffset===c.endOffset-1&&Bn(s.element,a)?o?Fm:ip:o?function(n,t){var e=ii(n,"position");ni(n,"position",t);var o=v_(u,Ai(r))&&!i.isReposition()?Rm:Fm;return e.each(function(t){return ni(n,"position",t)}),o}(r,i.getMode()):("fixed"===i.getMode()?e.y+Oi().top:e.y)+(vi(r)+12)<=u.y?ip:up}function S_(n,t){var e=M(F(t,function(t){return t.predicate(n.dom)}),function(t){return"contexttoolbar"===t.type});return{contextToolbars:e.pass,contextForms:e.fail}}function k_(e,t){function o(t){return Bn(t,r)}var n,r=de.fromDom(t.getBody()),i=de.fromDom(t.selection.getNode());return o(n=i)||An(r,n)?function(t,n,e){var o=S_(t,n);if(0<o.contextForms.length)return ft.some({elem:t,toolbars:[o.contextForms[0]]});var r=S_(t,e);if(0<r.contextForms.length)return ft.some({elem:t,toolbars:[r.contextForms[0]]});if(0<o.contextToolbars.length||0<r.contextToolbars.length){var i=function(t){if(t.length<=1)return t;function n(n){return T(t,function(t){return t.position===n})}function e(n){return F(t,function(t){return t.position===n})}var o=n("selection"),r=n("node");if(o||r){if(r&&o){var i=e("node"),u=A(e("selection"),function(t){return st(st({},t),{position:"node"})});return i.concat(u)}return e(o?"selection":"node")}return e("line")}(o.contextToolbars.concat(r.contextToolbars));return ft.some({elem:t,toolbars:i})}return ft.none()}(i,e.inNodeScope,e.inEditorScope).orThunk(function(){return a=e,(t=o)(n=i)?ft.none():Ie(n,function(t){if(Ri(t)){var n=S_(t,a.inNodeScope),e=n.contextToolbars,o=n.contextForms,r=0<o.length?o:(u=e).length<=1?u:i("selection").orThunk(function(){return i("node")}).orThunk(function(){return i("line")}).map(function(t){return t.position}).fold(function(){return[]},function(n){return F(u,function(t){return t.position===n})});return 0<r.length?ft.some({elem:t,toolbars:r}):ft.none()}function i(n){return V(u,function(t){return t.position===n})}var u;return ft.none()},t);var t,n,a}):ft.none()}function C_(a,c){var s={},l=[],f=[],d={},m={},t=Xn(a);return dt(t,function(t){var n,e,o,r,i,u=a[t];"contextform"===u.type?(o=t,i=Xt(Gt("ContextForm",Gp,r=u)),(s[o]=i).launch.map(function(t){d["form:"+o]=st(st({},r.launch),{type:"contextformtogglebutton"===t.type?"togglebutton":"button",onAction:function(){c(i)}})}),("editor"===i.scope?f:l).push(i),m[o]=i):"contexttoolbar"===u.type&&(n=t,Gt("ContextToolbar",Xp,e=u).each(function(t){("editor"===e.scope?f:l).push(t),m[n]=t}))}),{forms:s,inNodeScope:l,inEditorScope:f,lookupTable:m,formNavigators:d}}function O_(d,t,m,u){function a(){var t=y.get().getOr("node"),n=x_(t)?1:0;return y_(d,p,t,n)}function c(){return!(d.removed||h()&&g.isContextMenuOpen())}function s(){if(c()){var t=a(),n=Kr(y.get(),"node")?(e=d,v.get().filter(du).map(Mi).getOrThunk(function(){return b_(e)})):b_(d);return t.height<=0||!v_(n,t)}return 1;var e}function n(){v.clear(),b.clear(),y.clear(),op.hide(x)}function e(){var t;op.isOpen(x)&&(ai(t=x.element,"display"),s()?ni(t,"display","none"):(b.set(0),op.reposition(x)))}function l(t){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[t],behaviours:Za([Bg.config({mode:"acyclic"}),lm("pop-dialog-wrap-events",[$o(function(t){d.shortcuts.add("ctrl+F9","focus statusbar",function(){return Bg.focusIn(t)})}),Qo(function(t){d.shortcuts.remove("ctrl+F9")})])])}}function f(t,n){var e,o,r,i,c,s,u,a="node"===t?p.anchors.node(n):p.anchors.cursor(),l=(e=d,o=t,r=h(),i={lastElement:v.get,isReposition:function(){return Kr(b.get(),0)},getMode:function(){return cf.getMode(m)}},"line"===o?{bubble:yc(12,0,Q_),layouts:{onLtr:function(){return[la]},onRtl:function(){return[fa]}},overrides:Z_}:{bubble:yc(0,12,Q_,1/12),layouts:(c=e,s=i,u=o,r?{onLtr:function(t){return[Ka,Ua,Ga,Xa,Ya,qa].concat(f(t))},onRtl:function(t){return[Ka,Ga,Ua,Ya,Xa,qa].concat(f(t))}}:{onLtr:function(t){return[qa,Ka,Xa,Ua,Ya,Ga].concat(f(t))},onRtl:function(t){return[qa,Ka,Ya,Ga,Xa,Ua].concat(f(t))}}),overrides:Z_});function f(t){return x_(u)?[(a=t,function(t,n,e,o,r){var i=w_(c,o,a,s,r),u=st(st({},t),{y:r.y,height:r.height});return st(st({},i(u,n,e,o,r)),{alwaysFit:!0})})]:[];var a}return Jn(a,l)}function o(t,n){var e,o,r,i;k.cancel(),c()&&(e=S(t),r=f(o=t[0].position,n),y.set(o),b.set(1),ai(i=x.element,"display"),Kr(fu(n,v.get(),Bn),!0)||(Gr(i,rT),cf.reset(m,x)),op.showWithinBounds(x,l(e),{anchor:r,transition:{classes:[rT],mode:"placement"}},function(){return ft.some(a())}),n.fold(v.clear,v.set),s()&&ni(i,"display","none"))}var r,i,g=u.backstage,p=g.shared,h=Be().deviceType.isTouch,v=fc(),b=fc(),y=fc(),x=bu((r={sink:m,onEscape:function(){return d.focus(),ft.some(!0)}},i=wn([]),op.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),op.getContent(t).each(function(t){ai(t.element,"visibility")}),Gr(t.element,oT),ai(t.element,"width")},inlineBehaviours:Za([lm("context-toolbar-events",[Qe(xo(),function(t,n){"width"===n.event.raw.propertyName&&(Gr(t.element,oT),ai(t.element,"width"))}),Xe(eT,function(t,n){var e=t.element;ai(e,"width");var o=wi(e);op.setContent(t,n.event.contents),Ur(e,oT);var r=wi(e);ni(e,"width",o+"px"),op.getContent(t).each(function(t){n.event.focus.bind(function(t){return Sa(t),Oa(e)}).orThunk(function(){return Bg.focusIn(t),Ca(ji(e))})}),ap.setTimeout(function(){ni(t.element,"width",r+"px")},0)}),Xe(tT,function(n,t){op.getContent(n).each(function(t){i.set(i.get().concat([{bar:t,focus:Ca(ji(n.element))}]))}),Ne(n,eT,{contents:t.event.forwardContents,focus:ft.none()})}),Xe(nT,function(n,t){Y(i.get()).each(function(t){i.set(i.get().slice(0,i.get().length-1)),Ne(n,eT,{contents:yu(t.bar),focus:t.focus})})})]),Bg.config({mode:"special",onEscape:function(n){return Y(i.get()).fold(function(){return r.onEscape()},function(t){return ze(n,nT),ft.some(!0)})}})]),lazySink:function(){return mt.value(r.sink)}}))),w=_t(function(){return C_(t,function(t){var n=S([t]);Ne(x,tT,{forwardContents:l(n)})})}),S=function(t){var n=d.ui.registry.getAll().buttons,e=w(),o=st(st({},n),e.formNavigators),r=ev(d)===ph.scrolling?ph.scrolling:ph.default,i=lt(A(t,function(t){return"contexttoolbar"===t.type?G_(d,{buttons:o,toolbar:t.items,allowToolbarGroups:!1},u,ft.some(["form:"])):(n=p.providers,$_(t,n));var n}));return JC({type:r,uid:Ar("context-toolbar"),initGroups:i,onEscape:ft.none,cyclicKeying:!0,providers:p.providers})},k=gp(function(){d.hasFocus()&&!d.removed&&(Xr(x.element,rT)?k.throttle():k_(w(),d).fold(n,function(t){o(t.toolbars,ft.some(t.elem))}))},17);d.on("init",function(){d.on("remove",n),d.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",e),d.on("click keyup focus SetContent",k.throttle),d.on(J_,n),d.on("contexttoolbar-show",function(n){kt(w().lookupTable,n.toolbarKey).each(function(t){o([t],$r(n.target!==d,n.target)),op.getContent(x).each(Bg.focusIn)})}),d.on("focusout",function(t){ap.setEditorTimeout(d,function(){Oa(m.element).isNone()&&Oa(x.element).isNone()&&n()},0)}),d.on("SwitchMode",function(){d.mode.isReadOnly()&&n()}),d.on("AfterProgressState",function(t){t.state?n():d.hasFocus()&&k.throttle()}),d.on("NodeChange",function(t){Oa(x.element).fold(k.throttle,ct)})})}(m1=d1=d1||{})[m1.SemiColon=0]="SemiColon",m1[m1.Space=1]="Space";var __,T_,E_,D_=[{title:"Left",icon:"align-left",format:"alignleft",command:"JustifyLeft"},{title:"Center",icon:"align-center",format:"aligncenter",command:"JustifyCenter"},{title:"Right",icon:"align-right",format:"alignright",command:"JustifyRight"},{title:"Justify",icon:"align-justify",format:"alignjustify",command:"JustifyFull"}],B_=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],A_={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},M_={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},F_=Object.freeze({__proto__:null,events:function(r,i){function u(e,o){r.updateState.each(function(t){var n=t(e,o);i.set(n)}),r.renderComponents.each(function(t){var n=A(t(o,i.get()),e.getSystem().build);Ms(e,n)})}return Jo([Xe(To(),function(t,n){var e,o=n;o.universal||(e=r.channel,et(o.channels,e)&&u(t,o.data))}),$o(function(n,t){r.initialData.each(function(t){u(n,t)})})])}}),I_=Object.freeze({__proto__:null,getState:function(t,n,e){return e}}),R_=xa({fields:[Jt("channel"),rn("renderComponents"),rn("updateState"),rn("initialData")],name:"reflecting",active:F_,apis:I_,state:Object.freeze({__proto__:null,init:function(){var t=wn(ft.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(ft.none())}}}})}),V_=tt([Jt("toggleClass"),Jt("fetch"),$u("onExecute"),dn("getHotspot",ft.some),dn("getAnchorOverrides",tt({})),zc(),$u("onItemExecute"),rn("lazySink"),Jt("dom"),Ku("onOpen"),Js("splitDropdownBehaviours",[Jy,Bg,Rg]),dn("matchWidth",!1),dn("useMinWidth",!1),dn("eventOrder",{}),rn("role")].concat(ix())),P_=tt([Yf({factory:cp,schema:[Jt("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:Za([Rg.revoke()])}},overrides:function(n){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(t){t.getSystem().getByUid(n.uid).each(Le)},buttonBehaviours:Za([Hg.config({toggleOnExecute:!1,toggleClass:n.toggleClass})])}}}),Yf({factory:cp,schema:[Jt("dom")],name:"button",defaults:function(){return{buttonBehaviours:Za([Rg.revoke()])}},overrides:function(e){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(e.uid).each(function(t){e.onExecute(t,n)})}}}}),Kf({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Jt("text")],name:"aria-descriptor"}),qf({schema:[Xu()],name:"menu",defaults:function(o){return{onExecute:function(n,e){n.getSystem().getByUid(o.uid).each(function(t){o.onItemExecute(t,n,e)})}}}}),Qy()]),H_=wl({name:"SplitDropdown",configFields:V_(),partFields:P_(),factory:function(o,t,n,e){function r(t){id.getCurrent(t).each(function(t){md.highlightFirst(t),Bg.focusIn(t)})}function i(t){nx(o,h,t,e,r,Py.HighlightFirst).get(ct)}function u(t){return Le(fl(t,o,"button")),ft.some(!0)}var a,c=st(st({},Jo([$o(function(e,t){ll(e,o,"aria-descriptor").each(function(t){var n=Ar("aria");Or(t.element,"id",n),Or(e.element,"aria-describedby",n)})})])),ym(ft.some(i))),s={repositionMenus:function(t){Hg.isOn(t)&&rx(t)}};return{uid:o.uid,dom:o.dom,components:t,apis:s,eventOrder:st(st({},o.eventOrder),((a={})[Eo()]=["disabling","toggling","alloy.base.behaviour"],a)),events:c,behaviours:Qs(o.splitDropdownBehaviours,[Jy.config({others:{sandbox:function(t){var n=fl(t,o,"arrow");return ox(o,t,{onOpen:function(){Hg.on(n),Hg.on(t)},onClose:function(){Hg.off(n),Hg.off(t)}})}}}),Bg.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return i(t),ft.some(!0)}}),Rg.config({}),Hg.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:o.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,n){return t.repositionMenus(n)}}}),z_=Ar("focus-button"),N_=function(t,n,e){return a_(t,{toolbarButtonBehaviours:[].concat(0<e.length?[lm("toolbarButtonWith",e)]:[]),getApi:o_,onSetup:t.onSetup},n)},L_=function(t,n,e){return Jn(a_(t,{toolbarButtonBehaviours:[Mg.config({}),Hg.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(0<e.length?[lm("toolbarToggleButtonWith",e)]:[]),getApi:r_,onSetup:t.onSetup},n))},j_=[{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"]}],W_={button:c_(Sp,function(t,n){return e=n.backstage.shared.providers,N_(t,e,[]);var e}),togglebutton:c_(kp,function(t,n){return e=n.backstage.shared.providers,L_(t,e,[]);var e}),menubutton:c_(hC,function(t,n){return mS(t,"tox-tbtn",n.backstage,ft.none())}),splitbutton:c_(function(t){return Gt("SplitButton",lO,t)},function(t,n){return o=t,r=n.backstage.shared,s=Ar("channel-update-split-dropdown-display"),l=wn(ct),f={getApi:e,onSetup:o.onSetup},H_.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:st({"aria-pressed":!1},i_(o.tooltip,r.providers))},onExecute:function(t){o.onAction(e(t))},onItemExecute:function(t,n,e){},splitDropdownBehaviours:Za([Uv(r.providers.isDisabled),dv(),lm("split-dropdown-events",[Xe(z_,Rg.focus),gv(f,l),pv(f,l)]),A0.config({})]),eventOrder:((i={})[zo()]=["alloy.base.behaviour","split-dropdown-events"],i),toggleClass:"tox-tbtn--enabled",lazySink:r.getSink,fetch:(u=e,a=o,c=r.providers,function(n){return Wy(function(t){return a.fetch(t)}).map(function(t){return ft.from(Lb(Jn(Sb(Ar("menu-value"),t,function(t){a.onItemAction(u(n),t)},a.columns,a.presets,yh.CLOSE_ON_EXECUTE,a.select.getOr(O),c),{movement:kb(a.columns,a.presets),menuBehaviours:Xh("auto"!==a.columns?[]:[$o(function(o,t){rh(o,4,Yp(a.presets)).each(function(t){var n=t.numRows,e=t.numColumns;Bg.setGridSize(o,n,e)})})])})))})}),parts:{menu:Jp(0,o.columns,o.presets)},components:[H_.parts.button(u_(o.icon,o.text,ft.none(),ft.some(s),ft.some([Hg.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1})]),r.providers)),H_.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:Nm("chevron-down",r.providers.icons)},buttonBehaviours:Za([Uv(r.providers.isDisabled),dv(),Lm()])}),H_.parts["aria-descriptor"]({text:r.providers.translate("To open the popup, press Shift+Enter")})]});function e(e){return{isDisabled:function(){return fd.isDisabled(e)},setDisabled:function(t){return fd.set(e,t)},setIconFill:function(t,n){Fu(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){Or(t,"fill",n)})},setIconStroke:function(t,n){Fu(e.element,'svg path[id="'+t+'"], rect[id="'+t+'"]').each(function(t){Or(t,"stroke",n)})},setActive:function(n){Or(e.element,"aria-pressed",n),Fu(e.element,"span").each(function(t){e.getSystem().getByDom(t).each(function(t){return Hg.set(t,n)})})},isActive:function(){return Fu(e.element,"span").exists(function(t){return e.getSystem().getByDom(t).exists(Hg.isOn)})}}}var o,r,i,u,a,c,s,l,f}),grouptoolbarbutton:c_(function(t){return Gt("GroupToolbarButton",aO,t)},function(t,n,e){var o,r,i,u,a,c,s=e.ui.registry.getAll().buttons,l=((o={})[Zc]=n.backstage.shared.header.isPositionedAtTop()?Sc.TopToBottom:Sc.BottomToTop,o);if(ev(e)!==ph.floating)throw new Error("Toolbar groups are only supported when using floating toolbar mode");return i=n.backstage,u=function(t){return G_(e,{buttons:s,toolbar:t,allowToolbarGroups:!1},n,ft.none())},a=l,c=i.shared,BO.sketch({lazySink:c.getSink,fetch:function(){return Wy(function(t){t(A(u(r.items),YC))})},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:u_((r=t).icon,r.text,r.tooltip,ft.none(),ft.none(),c.providers),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:a}}}})}),styleSelectButton:function(t,n){return a1(t,e=n.backstage,e_(t,st({type:"advanced"},e.styleselect)));var e},fontsizeSelectButton:function(t,n){return a1(t,n.backstage,ZO(t))},fontSelectButton:function(t,n){return a1(t,n.backstage,QO(t))},formatButton:function(t,n){return a1(t,n.backstage,n_(t))},alignMenuButton:function(t,n){return a1(t,n.backstage,JO(t))}},U_={styleselect:W_.styleSelectButton,fontsizeselect:W_.fontsizeSelectButton,fontselect:W_.fontSelectButton,formatselect:W_.formatButton,align:W_.alignMenuButton},G_=function(o,c,s,l){var e,t,n,r,i=(n=c.toolbar,r=c.buttons,!1===n?[]:void 0===n||!0===n?(e=r,t=A(j_,function(t){var n=F(t.items,function(t){return Kn(e,t)||Kn(U_,t)});return{name:t.name,items:n}}),F(t,function(t){return 0<t.items.length})):y(n)?A(n.split("|"),function(t){return{items:t.trim().split(" ")}}):d(n,function(t){return Kn(t,"name")&&Kn(t,"items")})?n:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[]));return F(A(i,function(t){var n=z(t.items,function(t){return 0===t.trim().length?[]:(r=o,n=c.buttons,i=t,u=c.allowToolbarGroups,a=s,e=l,kt(n,i.toLowerCase()).orThunk(function(){return e.bind(function(t){return q(t,function(t){return kt(n,t+i.toLowerCase())})})}).fold(function(){return kt(U_,i.toLowerCase()).map(function(t){return t(r,a)}).orThunk(function(){return ft.none()})},function(t){return"grouptoolbarbutton"!==t.type||u?(e=a,o=r,kt(W_,(n=t).type).fold(function(){return console.error("skipping button defined by",n),ft.none()},function(t){return ft.some(t(n,e,o))})):(console.warn("Ignoring the '"+i+"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested."),ft.none());var n,e,o}).toArray());var r,n,i,u,a,e});return{title:ft.from(o.translate(t.name)),items:n}}),function(t){return 0<t.items.length})},X_=Be(),Y_=X_.os.isiOS()&&X_.os.version.major<=12,q_=Object.freeze({__proto__:null,render:function(e,n,t,o,r){var i=wn(0),u=n.outerContainer;YO(e);var a=de.fromDom(r.targetNode),c=gr(ji(a)),s=n.mothership;df(a,s,vr),Ps(c,n.uiMothership),e.on("PostRender",function(){s_(e,n,t,o),i.set(e.getWin().innerWidth),GO.setMenubar(u,QC(e,t)),GO.setSidebar(u,t.sidebar),function(e,t){function n(){var t=c.get();t.left===u.innerWidth&&t.top===u.innerHeight||(c.set(Su(u.innerWidth,u.innerHeight)),zv(e))}function o(){var t=e.getDoc().documentElement,n=s.get();n.left===t.offsetWidth&&n.top===t.offsetHeight||(s.set(Su(t.offsetWidth,t.offsetHeight)),zv(e))}function r(t){return e.fire("ScrollContent",t)}var i=e.dom,u=e.getWin(),a=e.getDoc().documentElement,c=wn(Su(u.innerWidth,u.innerHeight)),s=wn(Su(a.offsetWidth,a.offsetHeight));i.bind(u,"resize",n),i.bind(u,"scroll",r);var l=mc(de.fromDom(e.getBody()),"load",o),f=t.uiMothership.element;e.on("hide",function(){ni(f,"display","none")}),e.on("show",function(){ai(f,"display")}),e.on("NodeChange",o),e.on("remove",function(){l.unbind(),i.unbind(u,"resize",n),i.unbind(u,"scroll",r),u=null})}(e,n)});var l,f,d,m,g=GO.getSocket(u).getOrDie("Could not find expected socket element");Y_&&(ei(g.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"}),f=function(){e.fire("ScrollContent")},d=null,m=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];b(d)&&(d=setTimeout(function(){d=null,f.apply(null,t)},20))},l=dc(g.element,"scroll",m),e.on("remove",l.unbind)),fv(e,n),e.addCommand("ToggleSidebar",function(t,n){GO.toggleSidebar(u,n),e.fire("ToggleSidebar")}),e.addQueryValueHandler("ToggleSidebar",function(){return GO.whichSidebar(u)});var p=ev(e);p!==ph.sliding&&p!==ph.floating||e.on("ResizeWindow ResizeEditor ResizeContent",function(){var t=e.getWin().innerWidth;t!==i.get()&&(GO.refreshToolbar(n.outerContainer),i.set(t))});var h={enable:function(){lv(n,!1)},disable:function(){lv(n,!0)},isDisabled:function(){return fd.isDisabled(u)}};return{iframeContainer:g.element.dom,editorContainer:u.element.dom,api:h}}}),K_=Object.freeze({__proto__:null,render:function(n,e,o,r,t){var i=e.mothership,u=e.uiMothership,a=e.outerContainer,c=wn(null),s=de.fromDom(t.targetNode),l=g_(n,s,e,r,c),f=n.getParam("toolbar_persist",!1,"boolean");function d(){var t;c.get()?l.show():(c.set(GO.getHeader(a).getOrDie()),Ps(t=av(n),i),Ps(t,u),s_(n,e,o,r),GO.setMenubar(a,QC(n,o)),l.show(),function(c,s,l,t){function n(t){var n=p_(s,l.isPositionedAtTop()),e=n.pos,o=n.bounds,r=f.get(),i=r.pos,u=r.bounds,a=o.height!==u.height||o.width!==u.width;f.set({pos:e,bounds:o}),a&&zv(c,t),l.isVisible()&&(i!==e?l.update(!0):a&&(l.updateMode(),l.repositionPopups()))}var f=wn(p_(s,l.isPositionedAtTop()));t||(c.on("activate",l.show),c.on("deactivate",l.hide)),c.on("SkinLoaded ResizeWindow",function(){return l.update(!0)}),c.on("NodeChange keydown",function(t){ap.requestAnimationFrame(function(){return n(t)})}),c.on("ScrollWindow",function(){return l.updateMode()});var e=lc();e.set(mc(de.fromDom(c.getBody()),"load",n)),c.on("remove",function(){e.clear()})}(n,s,l,f),n.nodeChanged())}function m(){return ap.setEditorTimeout(n,d,0)}qO(n),n.on("show",d),n.on("hide",l.hide),f||(n.on("focus",m),n.on("blur",l.hide)),n.on("init",function(){(n.hasFocus()||f)&&m()}),fv(n,e);var g={show:function(){l.show()},hide:function(){l.hide()},enable:function(){lv(e,!1)},disable:function(){lv(e,!0)},isDisabled:function(){return fd.isDisabled(a)}};return{editorContainer:a.element.dom,api:g}}}),J_="contexttoolbar-hide",$_=function(t,n){var e,o,r,i,u=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),a=Vm(Ey.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:u,selectOnFocus:!0,inputBehaviours:Za([Bg.config({mode:"special",onEnter:function(t){return c.findPrimary(t).map(function(t){return Le(t),!0})},onLeft:function(t,n){return n.cut(),ft.none()},onRight:function(t,n){return n.cut(),ft.none()}})])})),c=(e=a,o=t.commands,r=n,i=A(o,function(t){return Vm(("contextformtogglebutton"===t.type?function(t,n,e){var o=n.original;o.primary;var r=s(o,["primary"]),i=Xt(kp(st(st({},r),{type:"togglebutton",onAction:ct})));return L_(i,e.backstage.shared.providers,[h_(t,n)])}:function(t,n,e){var o=n.original;o.primary;var r=s(o,["primary"]),i=Xt(Sp(st(st({},r),{type:"button",onAction:ct})));return N_(i,e.backstage.shared.providers,[h_(t,n)])})(e,t,{backstage:{shared:{providers:r}}}))}),{asSpecs:function(){return A(i,function(t){return t.asSpec()})},findPrimary:function(e){return q(o,function(t,n){return t.primary?ft.from(i[n]).bind(function(t){return t.getOpt(e)}).filter(k(fd.isDisabled)):ft.none()})}});return[{title:ft.none(),items:[a.asSpec()]},{title:ft.none(),items:c.asSpecs()}]},Q_={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"],inset:["tox-pop--inset"]},Z_={maxHeightFunction:Fc(),maxWidthFunction:TO()},tT=Ar("forward-slide"),nT=Ar("backward-slide"),eT=Ar("change-slide-event"),oT="tox-pop--resizing",rT="tox-pop--transition",iT={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},uT=(E_=["Infinity",(__="[0-9]+")+"\\."+aT(__)+aT(T_="[eE][+-]?[0-9]+"),"\\."+__+aT(T_),__+aT(T_)].join("|"),new RegExp("^([+-]?(?:"+E_+"))(.*)$"));function aT(t){return"(?:"+t+")?"}function cT(u,a){function n(){var t=a.getOptions(u),r=a.getCurrent(u).map(a.hash),i=fc();return A(t,function(o){return{type:"togglemenuitem",text:a.display(o),onSetup:function(n){function t(t){t&&(i.on(function(t){return t.setActive(!1)}),i.set(n)),n.setActive(t)}t(Kr(r,a.hash(o)));var e=a.watcher(u,o,t);return function(){i.clear(),e()}},onAction:function(){return a.setCurrent(u,o)}}})}u.ui.registry.addMenuButton(a.name,{tooltip:a.text,icon:a.icon,fetch:function(t){return t(n())},onSetup:a.onToolbarSetup}),u.ui.registry.addNestedMenuItem(a.name,{type:"nestedmenuitem",text:a.text,getSubmenuItems:n,onSetup:a.onMenuSetup})}function sT(t,n){return function(){t.execCommand("mceToggleFormat",!1,n)}}function lT(t){var n,e;!function(e){Ow.each([{name:"bold",text:"Bold",icon:"bold"},{name:"italic",text:"Italic",icon:"italic"},{name:"underline",text:"Underline",icon:"underline"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(t,n){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onSetup:e1(e,t.name),onAction:sT(e,t.name)})});for(var t=1;t<=6;t++){var n="h"+t;e.ui.registry.addToggleButton(n,{text:n.toUpperCase(),tooltip:"Heading "+t,onSetup:e1(e,n),onAction:sT(e,n)})}}(t),n=t,Ow.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"copy",text:"Copy",action:"Copy",icon:"copy"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"help",text:"Help",action:"mceHelp",icon:"help"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"}],function(t){n.ui.registry.addButton(t.name,{tooltip:t.text,icon:t.icon,onAction:i1(n,t.action)})}),e=t,Ow.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(t){e.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:i1(e,t.action),onSetup:e1(e,t.name)})})}function fT(n,e){return o1(n,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(t){t.setDisabled(n.mode.isReadOnly()||!n.undoManager[e]())})}function dT(t){var n;t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:i1(t,"mceToggleVisualAid")}),t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:o1(n=t,"VisualAid",function(t){t.setActive(n.hasVisual)}),onAction:i1(t,"mceToggleVisualAid")})}function mT(t,n){var e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_,T=t;dt([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],function(t){T.ui.registry.addToggleButton(t.name,{tooltip:t.text,icon:t.icon,onAction:i1(T,t.cmd),onSetup:e1(T,t.name)})}),T.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onAction:i1(T,"JustifyNone")}),lT(O=t),_=O,Ow.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",action:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",action:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",action:"Strikethrough",icon:"strike-through",shortcut:""},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript",shortcut:""},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript",shortcut:""},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting",shortcut:""},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document",shortcut:""},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A"}],function(t){_.ui.registry.addMenuItem(t.name,{text:t.text,icon:t.icon,shortcut:t.shortcut,onAction:i1(_,t.action)})}),_.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onAction:sT(_,"code")}),C=u1(0,d=l=n,JO(f=s=t)),f.ui.registry.addNestedMenuItem("align",{text:d.shared.providers.translate("Align"),getSubmenuItems:function(){return C.items.validateItems(C.getStyleItems())}}),p=u1(0,g=l,QO(m=s)),m.ui.registry.addNestedMenuItem("fontformats",{text:g.shared.providers.translate("Fonts"),getSubmenuItems:function(){return p.items.validateItems(p.getStyleItems())}}),h=s,b=st({type:"advanced"},(v=l).styleselect),y=u1(0,v,e_(h,b)),h.ui.registry.addNestedMenuItem("formats",{text:"Formats",getSubmenuItems:function(){return y.items.validateItems(y.getStyleItems())}}),w=u1(0,l,n_(x=s)),x.ui.registry.addNestedMenuItem("blockformats",{text:"Blocks",getSubmenuItems:function(){return w.items.validateItems(w.getStyleItems())}}),k=u1(0,l,ZO(S=s)),S.ui.registry.addNestedMenuItem("fontsizes",{text:"Font sizes",getSubmenuItems:function(){return k.items.validateItems(k.getStyleItems())}}),(a=u=t).ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:fT(a,"hasUndo"),onAction:i1(a,"undo")}),a.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:fT(a,"hasRedo"),onAction:i1(a,"redo")}),(c=u).ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",disabled:!0,onSetup:fT(c,"hasUndo"),onAction:i1(c,"undo")}),c.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",disabled:!0,onSetup:fT(c,"hasRedo"),onAction:i1(c,"redo")}),function(t){var i;(i=t).addCommand("mceApplyTextcolor",function(t,n){var e,o=t,r=n;(e=i).undoManager.transact(function(){e.focus(),e.formatter.apply(o,{value:r}),e.nodeChanged()})}),i.addCommand("mceRemoveTextcolor",function(t){var n,e=t;(n=i).undoManager.transact(function(){n.focus(),n.formatter.remove(e,{value:null},null,!0),n.nodeChanged()})});var n=wn(null),e=wn(null);xb(t,"forecolor","forecolor","Text color",n),xb(t,"backcolor","hilitecolor","Background color",e),wb(t,"forecolor","forecolor","Text color"),wb(t,"backcolor","hilitecolor","Background color")}(t),dT(t),(r=t).ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:o1(i=r,"NodeChange",function(t){t.setDisabled(!i.queryCommandState("outdent"))}),onAction:i1(r,"outdent")}),r.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onAction:i1(r,"indent")}),cT(e=t,QT),o=e,ft.from(o.getParam("content_langs",void 0,"array")).map(function(t){return{name:"language",text:"Language",icon:"language",getOptions:tt(t),hash:function(t){return E(t.customCode)?t.code:t.code+"/"+t.customCode},display:function(t){return t.title},watcher:function(t,n,e){return t.formatter.formatChanged("lang",e,!1,{value:n.code,customValue:n.customCode}).unbind},getCurrent:function(t){return Re(de.fromDom(t.selection.getNode()),function(t){return ft.some(t).filter(Ri).bind(function(n){return Tr(n,"lang").map(function(t){return{code:t,customCode:Tr(n,"data-mce-lang").getOrUndefined(),title:""}})})})},setCurrent:function(t,n){return t.execCommand("Lang",!1,n)},onToolbarSetup:function(t){var n=lc();return t.setActive(o.formatter.match("lang",{},void 0,!0)),n.set(o.formatter.formatChanged("lang",t.setActive,!0)),n.clear}}}).each(function(t){return cT(e,t)})}function gT(t,n){return{type:"makeshift",x:t,y:n}}function pT(t){return"longpress"===t.type||0===t.type.indexOf("touch")}function hT(t,n){return"contextmenu"===n.type||"longpress"===n.type?t.inline?function(t){if(pT(t)){var n=t.touches[0];return gT(n.pageX,n.pageY)}return gT(t.pageX,t.pageY)}(n):(e=t.getContentAreaContainer(),o=function(t){if(pT(t)){var n=t.touches[0];return gT(n.clientX,n.clientY)}return gT(t.clientX,t.clientY)}(n),r=Zh.DOM.getPos(e),i=r.x,u=r.y,gT(o.x+i,o.y+u)):ZT(t);var e,o,r,i,u}function vT(t,n,e){switch(e){case"node":return{type:"node",node:ft.some(de.fromDom((o=t).selection.getNode())),root:de.fromDom(o.getBody())};case"point":return hT(t,n);case"selection":return ZT(t)}var o}function bT(f,d,m,g,p,h){function t(){var n,e,t,o,r,i,u,a,c,s,l=m();t=l,o=g,r=p,u=!(y||v||b&&x),c=vT(n=f,e=d,a=i=h),s=st({bubble:yc(0,"point"===a?12:0,nE),layouts:tE,overrides:{maxWidthFunction:TO(),maxHeightFunction:Fc()}},c),fS(t,yh.CLOSE_ON_EXECUTE,o,!0).map(function(t){e.preventDefault(),op.showMenuWithinBounds(r,{anchor:s},{menu:{markers:Kp("normal"),highlightImmediately:u},data:t,type:"horizontal"},function(){return ft.some(y_(n,o.shared,"node"===i?"node":"selection"))}),n.fire(J_)})}var n,e=Be(),v=e.os.isiOS(),b=e.os.isOSX(),y=e.os.isAndroid(),x=e.deviceType.isTouch();(b||v)&&"node"!==h?(n=function(){(function(t){function n(){ap.setEditorTimeout(t,function(){t.selection.setRng(e)},10),i()}var e=t.selection.getRng();function o(t){t.preventDefault(),t.stopImmediatePropagation()}function r(){return i()}t.once("touchend",n),t.on("mousedown",o,!0),t.once("longpresscancel",r);var i=function(){t.off("touchend",n),t.off("longpresscancel",r),t.off("mousedown",o)}})(f),t()},function(t,n){var e=t.selection;if(!(e.isCollapsed()||n.touches.length<1)){var o=n.touches[0],r=e.getRng();return vs(t.getWin(),ls.domRange(r)).exists(function(t){return t.left<=o.clientX&&t.right>=o.clientX&&t.top<=o.clientY&&t.bottom>=o.clientY})}}(f,d)?n():(f.once("selectionchange",n),f.once("touchend",function(){return f.off("selectionchange",n)}))):t()}function yT(t){return"string"==typeof t?t.split(/[ ,]/):t}function xT(t){return t.getParam("contextmenu_never_use_native",!1,"boolean")}function wT(t){return y(t)?"|"===t:"separator"===t.type}function ST(t,n){if(0===n.length)return t;var e=Y(t).filter(function(t){return!wT(t)}).fold(function(){return[]},function(t){return[eE]});return t.concat(e).concat(n).concat([eE])}function kT(t,n){return"longpress"!==n.type&&(2!==n.button||n.target===t.getBody()&&""===n.pointerType)}function CT(t,n){return kT(t,n)?t.selection.getStart(!0):n.target}function OT(s,t,n){function e(t){return op.hide(i)}function o(c){var t;xT(s)&&c.preventDefault(),c.ctrlKey&&!xT(s)||!1===s.getParam("contextmenu")||(t=function(t,n){var e=t.getParam("contextmenu_avoid_overlap","","string"),o=kT(t,n)?"selection":"point";if(On(e)){var r=CT(t,n);return jb(de.fromDom(r),e)?"node":o}return o}(s,c),(r()?bT:function(t,n,e,o,r,i){var u=e(),a=vT(t,n,i);fS(u,yh.CLOSE_ON_EXECUTE,o,!1).map(function(t){n.preventDefault(),op.showMenuAt(r,{anchor:a},{menu:{markers:Kp("normal")},data:t})})})(s,c,function(){var t,n,e,o=CT(s,c),r=s.ui.registry.getAll(),i=(e=(n=s).ui.registry.getAll().contextMenus,ft.from(n.getParam("contextmenu")).map(yT).getOrThunk(function(){return F(yT("link linkchecker image imagetools table spellchecker configurepermanentpen"),function(t){return Kn(e,t)})})),u=r.contextMenus,a=o;return 0<(t=R(i,function(o,t){return kt(u,t.toLowerCase()).map(function(t){var n=t.update(a);if(y(n))return ST(o,n.split(" "));if(0<n.length){var e=A(n,oE);return ST(o,e)}return o}).getOrThunk(function(){return o.concat([t])})},[])).length&&wT(t[t.length-1])&&t.pop(),t},n,i,t))}var r=Be().deviceType.isTouch,i=bu(op.sketch({dom:{tag:"div"},lazySink:t,onEscape:function(){return s.focus()},onShow:function(){return n.setContextMenuState(!0)},onHide:function(){return n.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:Za([lm("dismissContextMenu",[Xe(Lo(),function(t,n){pf.close(t),s.focus()})])])}));s.on("init",function(){var t="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(r()?"":" ResizeWindow");s.on(t,e),s.on("longpress contextmenu",o)})}function _T(n){return function(t){return t.translate(-n.left,-n.top)}}function TT(n){return function(t){return t.translate(n.left,n.top)}}function ET(e){return function(t,n){return R(e,function(t,n){return n(t)},Su(t,n))}}function DT(t,n,e){return t.fold(ET([TT(e),_T(n)]),ET([_T(n)]),ET([]))}function BT(t,n,e){return t.fold(ET([TT(e)]),ET([]),ET([TT(n)]))}function AT(t,n,e){return t.fold(ET([]),ET([_T(e)]),ET([TT(n),_T(e)]))}function MT(t,n,e){var o=t.fold(function(t,n){return{position:ft.some("absolute"),left:ft.some(t+"px"),top:ft.some(n+"px")}},function(t,n){return{position:ft.some("absolute"),left:ft.some(t-e.left+"px"),top:ft.some(n-e.top+"px")}},function(t,n){return{position:ft.some("fixed"),left:ft.some(t+"px"),top:ft.some(n+"px")}});return st({right:ft.none(),bottom:ft.none()},o)}function FT(t,i,u,a){function n(o,r){return function(t,n){var e=o(i,u,a);return r(t.getOr(e.left),n.getOr(e.top))}}return t.fold(n(AT,iE),n(BT,uE),n(DT,aE))}function IT(t,n){var e=_r(t,n);return E(e)?NaN:parseInt(e,10)}function RT(t,n,e,o,r,i){var u,a,c,s,l,f,d=(u=e,a=o,l=IT(s=t.element,(c=n).leftAttr),f=IT(s,c.topAttr),(isNaN(l)||isNaN(f)?ft.none():ft.some(Su(l,f))).fold(function(){return u},function(t){return aE(t.left+a.left,t.top+a.top)})),m=(n.mustSnap?cE:sE)(t,n,d,r,i),g=DT(d,r,i),p=n,h=g,v=t.element;return Or(v,p.leftAttr,h.left+"px"),Or(v,p.topAttr,h.top+"px"),m.fold(function(){return{coord:aE(g.left,g.top),extra:ft.none()}},function(t){return{coord:t.output,extra:t.extra}})}function VT(t,c,s,l){return q(t,function(t){var n,e,o=t.sensor,r=t.range.left,i=t.range.top,u=BT(c,n=s,e=l),a=BT(o,n,e);return Math.abs(u.left-a.left)<=r&&Math.abs(u.top-a.top)<=i?ft.some({output:FT(t.output,c,s,l),extra:t.extra}):ft.none()})}function PT(t,n){var e;t.getSystem().addToGui(n),ar((e=n).element).filter(Ri).each(function(n){ii(n,"z-index").each(function(t){Or(n,fE,t)}),ni(n,"z-index",ri(e.element,"z-index"))})}function HT(t){ar(t.element).filter(Ri).each(function(n){Tr(n,fE).fold(function(){return ai(n,"z-index")},function(t){return ni(n,"z-index",t)}),Dr(n,fE)}),t.getSystem().removeFromGui(t)}function zT(t,n,e){return t.getSystem().build(sy.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[n]},events:e}))}function NT(t,n){return{bounds:t.getBounds(),height:bi(n.element),width:Si(n.element)}}function LT(B,A,t,n,e){var o=t.update(n,e),M=t.getStartData().getOrThunk(function(){return NT(A,B)});o.each(function(t){var n,e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_=B,T=M,E=t,D=(n=A).getTarget(_.element);n.repositionTarget&&(e=Oi(or(_.element)),o=tC(D),S=ii(w=D,"left"),k=ii(w,"top"),C=ii(w,"position"),O=function(t,n,e){return("fixed"===e?aE:iE)(parseInt(t,10),parseInt(n,10))},r=(S.isSome()&&k.isSome()&&C.isSome()?ft.some(O(S.getOrDie(),k.getOrDie(),C.getOrDie())):ft.none()).getOrThunk(function(){var t=xi(w);return uE(t.left,t.top)}),i=_,u=n.snaps,a=r,c=e,s=o,l=E,f=T,m=u.fold(function(){var e,o,t=DT((e=l.left,o=l.top,a.fold(function(t,n){return iE(t+e,n+o)},function(t,n){return uE(t+e,n+o)},function(t,n){return aE(t+e,n+o)})),c,s);return aE(t.left,t.top)},function(n){var t=RT(i,n,a,l,c,s);return t.extra.each(function(t){n.onSensor(i,t)}),t.coord}),g=c,p=s,h=(d=f).bounds,v=BT(m,g,p),b=oa(v.left,h.x,h.x+h.width-d.width),y=oa(v.top,h.y,h.y+h.height-d.height),x=uE(b,y),oi(D,MT(m.fold(function(){var t=AT(x,g,p);return iE(t.left,t.top)},tt(x),function(){var t=DT(x,g,p);return aE(t.left,t.top)}),0,o))),n.onDrag(_,D,E)})}function jT(o,t,n,e){t.each(HT),n.snaps.each(function(t){var n,e;n=t,Dr(e=o.element,n.leftAttr),Dr(e,n.topAttr)});var r=n.getTarget(o.element);e.reset(),n.onDrop(o,r)}function WT(t){return function(n,e){function o(t){e.setStartData(NT(n,t))}return Jo(H([Xe(Po(),function(t){e.getStartData().each(function(){return o(t)})})],t(n,e,o)))}}function UT(a,c,s){return[Xe(uo(),function(n,t){var e,o,r,i,u;0===t.event.raw.button&&(t.stop(),r={drop:e=function(){return jT(n,ft.some(i),a,c)},delayDrop:(o=Wb(e,200)).schedule,forceDrop:e,move:function(t){o.cancel(),LT(n,a,c,gE,t)}},i=zT(n,a.blockerClass,(u=r,Jo([Xe(uo(),u.forceDrop),Xe(so(),u.drop),Xe(ao(),function(t,n){u.move(n.event)}),Xe(co(),u.delayDrop)]))),s(n),PT(n,i))})]}function GT(a,c,s){function l(t){jT(t,f.get(),a,c),f.clear()}var f=fc();return[Xe(eo(),function(n,t){function e(){return l(n)}t.stop();var o,r,i,u=zT(n,a.blockerClass,(r=o=e,i=function(t){LT(n,a,c,hE,t)},Jo([Xe(eo(),r),Xe(ro(),o),Xe(io(),o),Xe(oo(),function(t,n){i(n.event)})])));f.set(u),s(n),PT(n,u)}),Xe(oo(),function(t,n){n.stop(),LT(t,a,c,hE,n.event)}),Xe(ro(),function(t,n){n.stop(),l(t)}),Xe(io(),l)]}function XT(t,r,i,u,n,e){return t.fold(function(){return yE.snap({sensor:uE(i-20,u-20),range:Su(n,e),output:uE(ft.some(i),ft.some(u)),extra:{td:r}})},function(t){var n=i-20,e=u-20,o=t.element.dom.getBoundingClientRect();return yE.snap({sensor:uE(n,e),range:Su(40,40),output:uE(ft.some(i-o.width/2),ft.some(u-o.height/2)),extra:{td:r}})})}function YT(t,i,u){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,n){var e=n.td,o=i.get(),r=e;o.exists(function(t){return Bn(t,r)})||(i.set(e),u(e))},mustSnap:!0}}function qT(t){return Vm(cp.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:Za([yE.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),A0.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))}function KT(a,e){function n(t){var n=Mi(t);return XT(g.getOpt(e),t,n.x,n.y,n.width,n.height)}function o(t){var n=Mi(t);return XT(p.getOpt(e),t,n.right,n.bottom,n.width,n.height)}function r(t,i,n,u){var e=n(i);yE.snapTo(t,e),function(t){var n=i.dom.getBoundingClientRect();ai(t.element,"display");var e=ur(de.fromDom(a.getBody())).dom.innerHeight,o=n[u]<0,r=n[u]>e;(o||r)&&ni(t.element,"display","none")}(t)}function i(t){return r(h,t,n,"top")}function u(t){return r(v,t,o,"bottom")}var c=wn([]),s=wn([]),t=wn(!1),l=fc(),f=fc(),d=YT(function(){return A(c.get(),n)},l,function(n){f.get().each(function(t){a.fire("TableSelectorChange",{start:n,finish:t})})}),m=YT(function(){return A(s.get(),o)},f,function(n){l.get().each(function(t){a.fire("TableSelectorChange",{start:t,finish:n})})}),g=qT(d),p=qT(m),h=bu(g.asSpec()),v=bu(p.asSpec());Be().deviceType.isTouch()&&(a.on("TableSelectionChange",function(n){t.get()||(Fs(e,h),Fs(e,v),t.set(!0)),l.set(n.start),f.set(n.finish),n.otherCells.each(function(t){c.set(t.upOrLeftCells),s.set(t.downOrRightCells),i(n.start),u(n.finish)})}),a.on("ResizeEditor ResizeWindow ScrollContent",function(){l.get().each(i),f.get().each(u)}),a.on("TableSelectionClear",function(){t.get()&&(Rs(h),Rs(v),t.set(!1)),l.clear(),f.clear()}))}var JT,$T,QT={name:"lineheight",text:"Line height",icon:"line-height",getOptions:function(t){return t.getParam("lineheight_formats","1 1.1 1.2 1.3 1.4 1.5 2","string").split(" ")},hash:function(t){return r=["fixed","relative","empty"],ft.from(uT.exec(t)).bind(function(t){var n=Number(t[1]),e=t[2],o=e;return T(r,function(t){return T(iT[t],function(t){return o===t})})?ft.some({value:n,unit:e}):ft.none()}).map(function(t){return t.value+t.unit}).getOr(t);var r},display:h,watcher:function(t,n,e){return t.formatter.formatChanged("lineheight",e,!1,{value:n}).unbind},getCurrent:function(t){return ft.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,n){return t.execCommand("LineHeight",!1,n)}},ZT=function(t){return{type:"selection",root:de.fromDom(t.selection.getNode())}},tE={onLtr:function(){return[Ka,Ua,Ga,Xa,Ya,qa,ip,up,Dm,Tm,Em,_m]},onRtl:function(){return[Ka,Ga,Ua,Ya,Xa,qa,ip,up,Em,_m,Dm,Tm]}},nE={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"]},eE={type:"separator"},oE=function(n){function t(t){return{text:t.text,icon:t.icon,disabled:t.disabled,shortcut:t.shortcut}}var e;if(y(n))return n;switch(n.type){case"separator":return eE;case"submenu":return st(st({type:"nestedmenuitem"},t(n)),{getSubmenuItems:function(){var t=n.getSubmenuItems();return y(t)?t:A(t,oE)}});default:return st(st({type:"menuitem"},t(n)),{onAction:(e=n.onAction,function(){return e()})})}},rE=Vn([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),iE=rE.offset,uE=rE.absolute,aE=rE.fixed,cE=function(t,n,l,f,d){var e=n.getSnapPoints(t);return VT(e,l,f,d).orThunk(function(){return R(e,function(n,e){var t,o,r,i,u,a,c,s=(t=e.sensor,e.range.left,e.range.top,i=BT(l,o=f,r=d),u=BT(t,o,r),a=Math.abs(i.left-u.left),c=Math.abs(i.top-u.top),Su(a,c));return n.deltas.fold(function(){return{deltas:ft.some(s),snap:ft.some(e)}},function(t){return(s.left+s.top)/2<=(t.left+t.top)/2?{deltas:ft.some(s),snap:ft.some(e)}:n})},{deltas:ft.none(),snap:ft.none()}).snap.map(function(t){return{output:FT(t.output,l,f,d),extra:t.extra}})})},sE=function(t,n,e,o,r){return VT(n.getSnapPoints(t),e,o,r)},lE=Object.freeze({__proto__:null,snapTo:function(t,n,e,o){var r,i,u,a=n.getTarget(t.element);n.repositionTarget&&(r=Oi(or(t.element)),i=tC(a),oi(a,MT({coord:FT((u=o).output,u.output,r,i),extra:u.extra}.coord,0,i)))}}),fE="data-initial-z-index",dE=fn("snaps",[Jt("getSnapPoints"),Ku("onSensor"),Jt("leftAttr"),Jt("topAttr"),dn("lazyViewport",Fi),dn("mustSnap",!1)]),mE=[dn("useFixed",O),Jt("blockerClass"),dn("getTarget",h),dn("onDrag",ct),dn("repositionTarget",!0),dn("onDrop",ct),bn("getBounds",Fi),dE],gE=Object.freeze({__proto__:null,getData:function(t){return ft.from(Su(t.x,t.y))},getDelta:function(t,n){return Su(n.left-t.left,n.top-t.top)}}),pE=H(H([],mE),[Zu("dragger",{handlers:WT(UT)})]),hE=Object.freeze({__proto__:null,getData:function(t){var n,e=t.raw.touches;return 1===e.length?(n=e[0],ft.some(Su(n.clientX,n.clientY))):ft.none()},getDelta:function(t,n){return Su(n.left-t.left,n.top-t.top)}}),vE=H(H([],mE),[Zu("dragger",{handlers:WT(GT)})]),bE=H(H([],mE),[Zu("dragger",{handlers:WT(function(t,n,e){return H(H([],UT(t,n,e)),GT(t,n,e))})})]),yE=wa({branchKey:"mode",branches:Object.freeze({__proto__:null,mouse:pE,touch:vE,mouseOrTouch:bE}),name:"dragging",active:{events:function(t,n){return t.dragger.handlers(t,n)}},extra:{snap:function(t){return{sensor:t.sensor,range:t.range,output:t.output,extra:ft.from(t.extra)}}},state:Object.freeze({__proto__:null,init:function(){var i=ft.none(),n=ft.none(),t=tt({});return au({readState:t,reset:function(){i=ft.none(),n=ft.none()},update:function(r,t){return r.getData(t).bind(function(t){return n=r,e=t,o=i.map(function(t){return n.getDelta(t,e)}),i=ft.some(e),o;var n,e,o})},getStartData:function(){return n},setStartData:function(t){n=ft.some(t)}})}}),apis:lE});function xE(t,n,e){var o,r,i,u,a,c,s=de.fromDom(t.getContainer());bt((o=t,r=n,i=e,u=vi(s),a=wi(s),(c={}).height=d_(u+r.top,sh(o),fh(o)),i===JT.Both&&(c.width=d_(a+r.left,ch(o),lh(o))),c),function(t,n){return ni(s,n,f_(t)),0}),t.fire("ResizeEditor")}function wE(t,n,e,o){return xE(t,Su(20*e,20*o),n),ft.some(!0)}function SE(t,n){var e,o,r,i,u,a,c,s,l,f,d,m,g,p,h,v;return{dom:{tag:"div",classes:["tox-statusbar"]},components:(v=[],t.getParam("elementpath",!0,"boolean")&&v.push((g=t,h=n,(p={}).delimiter||(p.delimiter="\xbb"),{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:Za([Bg.config({mode:"flow",selector:"div[role=button]"}),fd.config({disabled:h.isDisabled}),dv(),gy.config({}),Mg.config({}),lm("elementPathEvents",[$o(function(r,t){g.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return Bg.focusIn(r)}),g.on("NodeChange",function(t){var n,o,e=function(t){for(var n=[],e=t.length;0<e--;){var o=t[e];if(1===o.nodeType&&!function(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return 1;if("bookmark"===t.getAttribute("data-mce-type"))return 1}}(o)){var r=g.fire("ResolveName",{name:o.nodeName.toLowerCase(),target:o});if(r.isDefaultPrevented()||n.push({name:r.name,element:o}),r.isPropagationStopped())break}}return n}(t.parents);0<e.length?Mg.set(r,(n=A(e||[],function(n,t){return cp.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{role:"button","data-index":t,"tab-index":-1,"aria-level":t+1},innerHtml:n.name},action:function(t){g.focus(),g.selection.select(n.element),g.nodeChanged()},buttonBehaviours:Za([qv(h.isDisabled),dv()])})}),o={dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0},innerHtml:" "+p.delimiter+" "}},R(n.slice(1),function(t,n){var e=t;return e.push(o),e.push(n),e},[n[0]]))):Mg.set(r,[])})})])]),components:[]})),t.hasPlugin("wordcount")&&v.push((f=t,d=n,cp.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:Za([qv(d.isDisabled),dv(),gy.config({}),Mg.config({}),_f.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),lm("wordcount-events",[tr(function(t){var n=_f.getValue(t),e="words"===n.mode?"characters":"words";_f.setValue(t,{mode:e,count:n.count}),b(t,n.count,e)}),$o(function(e){f.on("wordCountUpdate",function(t){var n=_f.getValue(e).mode;_f.setValue(e,{mode:n,count:t.wordCount}),b(e,t.wordCount,n)})})])]),eventOrder:((m={})[Eo()]=["disabling","alloy.base.behaviour","wordcount-events"],m)}))),t.getParam("branding",!0,"boolean")&&v.push({dom:{tag:"span",classes:["tox-statusbar__branding"],innerHtml:'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&amp;utm_medium=poweredby&amp;utm_source=tinymce&amp;utm_content=v5" rel="noopener" target="_blank" tabindex="-1" aria-label="'+(l=sp.translate(["Powered by {0}","Tiny"]))+'">'+l+"</a>"}}),e=0<v.length?[{dom:{tag:"div",classes:["tox-statusbar__text-container"]},components:v}]:[],i=n,a=!(u=r=t).hasPlugin("autoresize"),o=(s=!1===(c=u.getParam("resize",a))?JT.None:"both"===c?JT.Both:JT.Vertical)===JT.None?ft.none():ft.some(Wm("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{title:i.translate("Resize")},behaviours:[yE.config({mode:"mouse",repositionTarget:!1,onDrag:function(t,n,e){return xE(r,e,s)},blockerClass:"tox-blocker"}),Bg.config({mode:"special",onLeft:function(){return wE(r,s,-1,0)},onRight:function(){return wE(r,s,1,0)},onUp:function(){return wE(r,s,0,-1)},onDown:function(){return wE(r,s,0,1)}}),gy.config({}),Rg.config({})]},i.icons)),e.concat(o.toArray()))};function b(t,n,e){return Mg.set(t,[pi(d.translate(["{0} "+e,n[e]]))])}}function kE(d){function m(){return i.bind(GO.getHeader)}function g(){return mt.value(y)}function p(){return i.bind(function(t){return GO.getThrobber(t)}).getOrDie("Could not find throbber element")}var t,n,e,o,r=d.inline,h=r?K_:q_,v=sv(d)?uO:J1,i=ft.none(),u=Be(),a=u.browser.isIE()?["tox-platform-ie"]:[],c=u.deviceType.isTouch()?["tox-platform-touch"]:[],s=rv(d),l=av(d),f=sp.isRtl()?{attributes:{dir:"rtl"}}:{},b={attributes:((t={})[Zc]=s?Sc.BottomToTop:Sc.TopToBottom,t)},y=bu((n=Bn(mu(),l)&&"grid"===ri(l,"display"),e={dom:st({tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(a).concat(c)},f),behaviours:Za([cf.config({useFixed:function(){return v.isDocked(m)}})])},o={dom:{styles:{width:document.body.clientWidth+"px"}},events:Jo([Xe(Ho(),function(){ni(K.element,"width",document.body.clientWidth+"px")})])},Jn(e,n?o:{}))),x=Vm({dom:{tag:"div",classes:["tox-anchorbar"]}}),w=Qk(y,d,function(){return i.bind(function(t){return x.getOpt(t)}).getOrDie("Could not find a anchor bar element")}),S=GO.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:w,onEscape:function(){d.focus()}}),k=ev(d),C=GO.parts.toolbar(st({dom:{tag:"div",classes:["tox-toolbar"]},getSink:g,providers:w.shared.providers,onEscape:function(){d.focus()},type:k,lazyToolbar:function(){return i.bind(function(t){return GO.getToolbar(t)}).getOrDie("Could not find more toolbar element")},lazyHeader:function(){return m().getOrDie("Could not find header element")}},b)),O=GO.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:w.shared.providers,onEscape:function(){d.focus()},type:k}),_=GO.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),T=GO.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}}),E=GO.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:w}),D=d.getParam("statusbar",!0,"boolean")&&!r?ft.some(SE(d,w.shared.providers)):ft.none(),B={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[_,T]},A=nv(d),M=mh(d),F=dh(d),I=GO.parts.header({dom:st({tag:"div",classes:["tox-editor-header"]},b),components:lt([F?[S]:[],A?[O]:M?[C]:[],uv(d)?[]:[x.asSpec()]]),sticky:sv(d),editor:d,sharedBackstage:w.shared}),R=lt([s?[]:[I],r?[]:[B],s?[I]:[]]),V=lt([[{dom:{tag:"div",classes:["tox-editor-container"]},components:R}],r?[]:D.toArray(),[E]]),P=cv(d),H=st(st({role:"application"},sp.isRtl()?{dir:"rtl"}:{}),P?{"aria-hidden":"true"}:{}),z=bu(GO.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(r?["tox-tinymce-inline"]:[]).concat(s?["tox-tinymce--toolbar-bottom"]:[]).concat(c).concat(a),styles:st({visibility:"hidden"},P?{opacity:"0",border:"0"}:{}),attributes:H},components:V,behaviours:Za([dv(),fd.config({disableClass:"tox-tinymce--disabled"}),Bg.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, .tox-statusbar__resize-handle"})])})),i=ft.some(z);d.shortcuts.add("alt+F9","focus menubar",function(){GO.focusMenubar(z)}),d.shortcuts.add("alt+F10","focus toolbar",function(){GO.focusToolbar(z)}),d.addCommand("ToggleToolbarDrawer",function(){GO.toggleToolbarDrawer(z)}),d.addQueryStateHandler("ToggleToolbarDrawer",function(){return GO.isToolbarDrawerToggled(z)});var N,L,j,W,U,G,X,Y,q=Jb(z),K=Jb(y);function J(){var t,n,e,o,r,i,u=f_((o=uh(e=n=d),r=sh(e),i=fh(e),l_(o).map(function(t){return d_(t,r,i)}).getOr(uh(n)))),a=f_(m_(t=d).getOr(ah(t)));return d.inline||(ui("div","width",a)&&ni(z.element,"width",a),ui("div","height",u)?ni(z.element,"height",u):ni(z.element,"height","200px")),u}return N=d,L=q,j=K,W=dc(de.fromDom(document),"touchstart",Z),U=dc(de.fromDom(document),"touchmove",function(t){return $(Ro(),t)}),G=dc(de.fromDom(document),"touchend",function(t){return $(Vo(),t)}),X=dc(de.fromDom(document),"mousedown",Z),Y=dc(de.fromDom(document),"mouseup",function(t){0===t.raw.button&&Q(bf(),{target:t.target})}),N.on("PostRender",function(){N.on("click",tt),N.on("tap",tt),N.on("mouseup",nt),N.on("mousedown",et),N.on("ScrollWindow",ot),N.on("ResizeWindow",rt),N.on("ResizeEditor",it),N.on("AfterProgressState",ut),N.on("DismissPopups",at)}),N.on("remove",function(){N.off("click",tt),N.off("tap",tt),N.off("mouseup",nt),N.off("mousedown",et),N.off("ScrollWindow",ot),N.off("ResizeWindow",rt),N.off("ResizeEditor",it),N.off("AfterProgressState",ut),N.off("DismissPopups",at),X.unbind(),W.unbind(),U.unbind(),G.unbind(),Y.unbind()}),N.on("detach",function(){Hs(L),Hs(j),L.destroy(),j.destroy()}),{mothership:q,uiMothership:K,backstage:w,renderUI:function(){var o,r;v.setup(d,w.shared,m),mT(d,w),OT(d,g,w),r=(o=d).ui.registry.getAll().sidebars,dt(Xn(r),function(n){function e(){return Kr(ft.from(o.queryCommandValue("ToggleSidebar")),n)}var t=r[n];o.ui.registry.addToggleButton(n,{icon:t.icon,tooltip:t.tooltip,onAction:function(t){o.execCommand("ToggleSidebar",!1,n),t.setActive(e())},onSetup:function(t){function n(){return t.setActive(e())}return o.on("ToggleSidebar",n),function(){o.off("ToggleSidebar",n)}}})}),IC(d,p,w.shared),yt(d.getParam("toolbar_groups",{},"object"),function(t,n){d.ui.registry.addGroupToolbarButton(n,t)});var t,n=d.ui.registry.getAll(),e=n.buttons,i=n.menuItems,u=n.contextToolbars,a=n.sidebars,c=gh(d),s={menuItems:i,menus:(t=d.getParam("menu"))?yt(t,function(t){return st(st({},t),{items:t.items})}):{},menubar:d.getParam("menubar"),toolbar:c.getOrThunk(function(){return d.getParam("toolbar",!0)}),allowToolbarGroups:k===ph.floating,buttons:e,sidebar:a};O_(d,u,y,{backstage:w}),KT(d,y);var l=d.getElement(),f=J();return h.render(d,{mothership:q,uiMothership:K,outerContainer:z},s,w,{targetNode:l,height:f})},getUi:function(){return{channels:{broadcastAll:K.broadcast,broadcastOn:K.broadcastOn,register:ct}}}};function $(n,e){dt([L,j],function(t){t.broadcastEvent(n,e)})}function Q(n,e){dt([L,j],function(t){t.broadcastOn([n],e)})}function Z(t){return Q(hf(),{target:t.target})}function tt(t){return Q(hf(),{target:de.fromDom(t.target)})}function nt(t){0===t.button&&Q(bf(),{target:de.fromDom(t.target)})}function et(){dt(N.editorManager.get(),function(t){N!==t&&t.fire("DismissPopups",{relatedTarget:N})})}function ot(t){return $(Po(),Dc(t))}function rt(t){Q(vf(),{}),$(Ho(),Dc(t))}function it(){return Q(vf(),{})}function ut(t){t.state&&Q(hf(),{target:de.fromDom(N.getContainer())})}function at(t){Q(hf(),{target:de.fromDom(t.relatedTarget.getContainer())})}}function CE(n){return le("items","items",Tt(),zt(Wt(function(t){return Gt("Checking item of "+n,mB,t).fold(function(t){return mt.error(se(t))},function(t){return mt.value(t)})})))}function OE(t){return y(t.type)&&y(t.name)}function _E(t){return{internalDialog:Xt(Gt("dialog",wB,t)),dataValidator:(n=z(F(CB(t),OE),function(n){return ft.from(OB[n.type]).fold(function(){return[]},function(t){return[$t(n.name,t)]})}),te(n)),initialData:t.initialData};var n}function TE(t){var e=[],o={};return bt(t,function(t,n){t.fold(function(){e.push(n)},function(t){o[n]=t})}),0<e.length?mt.error(e):mt.value(o)}function EE(t,n){ni(t,"height",n+"px"),Be().browser.isIE()?ai(t,"flex-basis"):ni(t,"flex-basis",n+"px")}function DE(t,d,n){Mu(t,'[role="dialog"]').each(function(f){Fu(f,'[role="tablist"]').each(function(l){n.get().map(function(t){return ni(d,"height","0"),ni(d,"flex-basis","0"),Math.min(t,(e=d,o=l,r=ir(n=f).dom,i="fixed"===ri(Mu(n,".tox-dialog-wrap").getOr(n),"position")?Math.max(r.clientHeight,window.innerHeight):Math.max(r.offsetHeight,r.scrollHeight),u=vi(e),a=e.dom.offsetLeft>=o.dom.offsetLeft+wi(o)?Math.max(vi(o),u):u,c=parseInt(ri(n,"margin-top"),10)||0,s=parseInt(ri(n,"margin-bottom"),10)||0,i-(vi(n)+c+s-a)));var n,e,o,r,i,u,a,c,s}).each(function(t){EE(d,t)})})})}function BE(t){return Fu(t,'[role="tabpanel"]')}function AE(t,e){function o(t){var n=TE(_f.getValue(t)).getOr({}),e=i.get(),o=Jn(e,n);i.set(o)}function r(t){var n=i.get();_f.setValue(t,n)}var u,a,i=wn({}),c=wn(null),n=A(t.tabs,function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"],innerHtml:e.shared.providers.translate(t.title)},view:function(){return[hw.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"]},components:A(t.items,function(t){return Ek(n,t,e)}),formBehaviours:Za([Bg.config({mode:"acyclic",useTabstopAt:k(g0)}),lm("TabView.form.events",[$o(r),Qo(o)]),oc.config({channels:Me([{key:RB,value:{onReceive:o}},{key:VB,value:{onReceive:r}}])})])}})]}}}),s=(u=n,a=fc(),{extraEvents:[$o(function(t){var o=t.element;BE(o).each(function(e){var n;ni(e,"visibility","hidden"),t.getSystem().getByDom(e).toOptional().each(function(t){var o,r,i,n=(r=e,i=t,A(o=u,function(t,n){Mg.set(i,o[n].view());var e=r.dom.getBoundingClientRect();return Mg.set(i,[]),e.height}));ot(G(n,function(t,n){return n<t?-1:t<n?1:0})).fold(a.clear,a.set)}),DE(o,e,a),ai(e,"visibility"),n=t,ot(u).each(function(t){return IB.showTab(n,t.value)}),ap.requestAnimationFrame(function(){DE(o,e,a)})})}),Xe(Ho(),function(t){var n=t.element;BE(n).each(function(t){DE(n,t,a)})}),Xe(_y,function(t,n){var r=t.element;BE(r).each(function(n){var t=Ca(ji(n));ni(n,"visibility","hidden");var e=ii(n,"height").map(function(t){return parseInt(t,10)});ai(n,"height"),ai(n,"flex-basis");var o=n.dom.getBoundingClientRect().height;e.forall(function(t){return t<o})?(a.set(o),DE(r,n,a)):e.each(function(t){EE(n,t)}),ai(n,"visibility"),t.each(Sa)})})],selectFirst:!1});return IB.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,n,e){var o=_f.getValue(n);Ne(t,Oy,{name:o,oldName:c.get()}),c.set(o)},tabs:n,components:[IB.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[BB.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:Za([gy.config({})])}),IB.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:s.selectFirst,tabSectionBehaviours:Za([lm("tabpanel",s.extraEvents),Bg.config({mode:"acyclic"}),id.config({find:function(t){return ot(IB.getViewItems(t))}}),_f.config({store:{mode:"manual",getValue:function(t){return t.getSystem().broadcastOn([RB],{}),i.get()},setValue:function(t,n){i.set(n),t.getSystem().broadcastOn([VB],{})}}})])})}function ME(t,n,r,e){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:st(st({},n.map(function(t){return{id:t}}).getOr({})),e?{"aria-live":"polite"}:{})},components:[],behaviours:Za([Sw(0),R_.config({channel:zB,updateState:function(t,n){return ft.some({isTabPanel:function(){return"tabpanel"===n.body.type}})},renderComponents:function(t){return"tabpanel"!==t.body.type?[(e=t.body,o=r,{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[(n=Vm(hw.sketch(function(n){return{dom:{tag:"div",classes:["tox-form"].concat(e.classes)},components:A(e.items,function(t){return Ek(n,t,o)})}}))).asSpec()]}],behaviours:Za([Bg.config({mode:"acyclic",useTabstopAt:k(g0)}),ww(n),Tw(n,{postprocess:function(t){return TE(t).fold(function(t){return console.error(t),{}},h)}})])})]:[AE(t.body,r)];var e,o,n},initialData:t})])}}function FE(t,n){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,n]}}function IE(t,n){return cD.parts.close(cp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close")}},action:t,buttonBehaviours:Za([gy.config({})])}))}function RE(){return cD.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})}function VE(t,n){return cD.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:MC("<p>"+n.translate(t)+"</p>")}]}]})}function PE(t){return cD.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})}function HE(t,n){return[sy.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),sy.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]}function zE(n){var t,e="tox-dialog",o=e+"-wrap",r=o+"__backdrop",i=e+"__disable-scroll";return cD.sketch({lazySink:n.lazySink,onEscape:function(t){return n.onEscape(t),ft.some(!0)},useTabstopAt:function(t){return!g0(t)},dom:{tag:"div",classes:[e].concat(n.extraClasses),styles:st({position:"relative"},n.extraStyles)},components:H([n.header,n.body],n.footer.toArray()),parts:{blocker:{dom:MC('<div class="'+o+'"></div>'),components:[{dom:{tag:"div",classes:jB?[r,r+"--opaque"]:[r]}}]}},dragBlockClass:o,modalBehaviours:Za(H([Rg.config({}),lm("dialog-events",n.dialogEvents.concat([Qe(fo(),function(t,n){Bg.focusIn(t)})])),lm("scroll-lock",[$o(function(){Ur(mu(),i)}),Qo(function(){Gr(mu(),i)})])],n.extraBehaviours)),eventOrder:st(((t={})[Eo()]=["dialog-events"],t[zo()]=["scroll-lock","dialog-events","alloy.base.behaviour"],t[No()]=["alloy.base.behaviour","dialog-events","scroll-lock"],t),n.eventOrder)})}function NE(t){return cp.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),title:t.translate("Close")}},components:[Wm("close",{tag:"div",classes:["tox-icon"]},t.icons)],action:function(t){ze(t,xy)}})}function LE(t,n,e){function o(t){return[pi(e.translate(t.title))]}return{dom:{tag:"div",classes:["tox-dialog__title"],attributes:st({},n.map(function(t){return{id:t}}).getOr({}))},components:o(t),behaviours:Za([R_.config({channel:HB,renderComponents:o})])}}function jE(){return{dom:MC('<div class="tox-dialog__draghandle"></div>')}}function WE(t,n){return e={title:n.shared.providers.translate(t),draggable:n.dialog.isDraggableModal()},o=n.shared.providers,r=cD.parts.title(LE(e,ft.none(),o)),i=cD.parts.draghandle(jE()),u=cD.parts.close(NE(o)),a=[r].concat(e.draggable?[i]:[]).concat([u]),sy.sketch({dom:MC('<div class="tox-dialog__header"></div>'),components:a});var e,o,r,i,u,a}function UE(t,n,e){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.translate(t)},styles:{left:"0px",right:"0px",bottom:"0px",top:"0px",position:"absolute"}},behaviours:n,components:[{dom:MC('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}function GE(t,o,n){return{onClose:function(){return n.closeWindow()},onBlock:function(e){cD.setBusy(t(),function(t,n){return UE(e.message,n,o)})},onUnblock:function(){cD.setIdle(t())}}}function XE(t,n,e,o){var r;return bu(zE(st(st({},t),{lazySink:o.shared.getSink,extraBehaviours:H([R_.config({channel:PB,updateState:function(t,n){return ft.some(n)},initialData:n}),Dw({})],t.extraBehaviours),onEscape:function(t){ze(t,xy)},dialogEvents:e,eventOrder:((r={})[To()]=[R_.name(),oc.name()],r[zo()]=["scroll-lock",R_.name(),"messages","dialog-events","alloy.base.behaviour"],r[No()]=["alloy.base.behaviour","dialog-events","messages",R_.name(),"scroll-lock"],r)})))}function YE(t){return A(t,function(t){return"menu"===t.type?(e=A((n=t).items,function(t){var n=wn(!1);return st(st({},t),{storage:n})}),st(st({},n),{items:e})):t;var n,e})}function qE(t){return R(t,function(t,n){return"menu"!==n.type?t:R(n.items,function(t,n){return t[n.name]=n.storage,t},t)},{})}function KE(t,e){return[Je(fo(),m0),t(yy,function(t,n){e.onClose(),n.onClose()}),t(xy,function(t,n,e,o){n.onCancel(t),ze(o,yy)}),Xe(Cy,function(t,n){return e.onUnblock()}),Xe(ky,function(t,n){return e.onBlock(n.event)})]}function JE(t,n){function e(t,n){return sy.sketch({dom:{tag:"div",classes:["tox-dialog__footer-"+t]},components:A(n,function(t){return t.memento.asSpec()})})}var o=M(n.map(function(t){return t.footerButtons}).getOr([]),function(t){return"start"===t.align});return[e("start",o.pass),e("end",o.fail)]}function $E(t,e){return{dom:MC('<div class="tox-dialog__footer"></div>'),components:[],behaviours:Za([R_.config({channel:NB,initialData:t,updateState:function(t,n){var r=A(n.buttons,function(t){var n=Vm(xS(t,t.type,e));return{name:t.name,align:t.align,memento:n}});return ft.some({lookupByName:function(t,n){return e=t,o=n,V(r,function(t){return t.name===o}).bind(function(t){return t.memento.getOpt(e)});var e,o},footerButtons:r})},renderComponents:JE})])}}function QE(t,n){return cD.parts.footer($E(t,n))}function ZE(n,e){if(n.getRoot().getSystem().isConnected()){var o=id.getCurrent(n.getFormWrapper()).getOr(n.getFormWrapper());return hw.getField(o,e).fold(function(){var t=n.getFooter();return R_.getState(t).get().bind(function(t){return t.lookupByName(o,e)})},function(t){return ft.some(t)})}return ft.none()}function tD(c,o,s){function t(t){var n=c.getRoot();n.getSystem().isConnected()&&t(n)}var l={getData:function(){var t=c.getRoot(),n=t.getSystem().isConnected()?c.getFormWrapper():t,e=_f.getValue(n),o=yt(s,function(t){return t.get()});return st(st({},e),o)},setData:function(a){t(function(t){var n,e,o=l.getData(),r=st(st({},o),a),i=(n=r,e=c.getRoot(),R_.getState(e).get().map(function(t){return Xt(Gt("data",t.dataValidator,n))}).getOr(n)),u=c.getFormWrapper();_f.setValue(u,i),bt(s,function(t,n){Kn(r,n)&&t.set(r[n])})})},disable:function(t){ZE(c,t).each(fd.disable)},enable:function(t){ZE(c,t).each(fd.enable)},focus:function(t){ZE(c,t).each(Rg.focus)},block:function(n){if(!y(n))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");t(function(t){Ne(t,ky,{message:n})})},unblock:function(){t(function(t){ze(t,Cy)})},showTab:function(e){t(function(t){var n=c.getBody();R_.getState(n).get().exists(function(t){return t.isTabPanel()})&&id.getCurrent(n).each(function(t){IB.showTab(t,e)})})},redial:function(e){t(function(t){var n=o(e);t.getSystem().broadcastOn([PB],n),t.getSystem().broadcastOn([HB],n.internalDialog),t.getSystem().broadcastOn([zB],n.internalDialog),t.getSystem().broadcastOn([NB],n.internalDialog),l.setData(n.initialData)})},close:function(){t(function(t){ze(t,yy)})}};return l}function nD(t){return x(t)&&-1!==YB.indexOf(t.mceAction)}function eD(o,t,r,n){var e,i,u,a=WE(o.title,n),c=(i={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[f0({dom:{tag:"iframe",attributes:{src:o.url}},behaviours:Za([gy.config({}),Rg.config({})])})]}],behaviours:Za([Bg.config({mode:"acyclic",useTabstopAt:k(g0)})])},cD.parts.body(i)),s=o.buttons.bind(function(t){return 0===t.length?ft.none():ft.some(QE({buttons:t},n))}),l=WB(function(){return v},GE(function(){return h},n.shared.providers,t)),f=st(st({},o.height.fold(function(){return{}},function(t){return{height:t+"px","max-height":t+"px"}})),o.width.fold(function(){return{}},function(t){return{width:t+"px","max-width":t+"px"}})),d=o.width.isNone()&&o.height.isNone()?["tox-dialog--width-lg"]:[],m=new XB(o.url,{base_uri:new XB(window.location.href)}),g=m.protocol+"://"+m.host+(m.port?":"+m.port:""),p=lc(),h=XE({header:a,body:c,footer:s,extraClasses:d,extraBehaviours:[lm("messages",[$o(function(){var t=dc(de.fromDom(window),"message",function(t){var n,e;m.isSameOrigin(new XB(t.raw.origin))&&(nD(n=t.raw.data)?function(t,n,e){switch(e.mceAction){case"insertContent":t.insertContent(e.content);break;case"setContent":t.setContent(e.content);break;case"execCommand":var o=!!w(e.ui)&&e.ui;t.execCommand(e.cmd,o,e.value);break;case"close":n.close();break;case"block":n.block(e.message);break;case"unblock":n.unblock()}}(r,v,n):!nD(e=n)&&x(e)&&Kn(e,"mceAction")&&o.onMessage(v,n))});p.set(t)}),Qo(p.clear)]),oc.config({channels:((e={})[LB]={onReceive:function(t,n){Fu(t.element,"iframe").each(function(t){t.dom.contentWindow.postMessage(n,g)})}},e)})],extraStyles:f},o,l,n),v={block:function(n){if(!y(n))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");b(function(t){Ne(t,ky,{message:n})})},unblock:function(){b(function(t){ze(t,Cy)})},close:function(){b(function(t){ze(t,yy)})},sendMessage:function(n){b(function(t){t.getSystem().broadcastOn([LB],n)})}};function b(t){u.getSystem().isConnected()&&t(u)}return{dialog:u=h,instanceApi:v}}function oD(t){function o(t,y){return _B.open(function(t,n,e){var o,r,i,u,a,c,s,l,f,d,m,g,p,h,v=n,b=(r={redial:_B.redial,closeWindow:function(){cD.hide(b.dialog),y(b.instanceApi)}},i=R,c=WE((o={dataValidator:e,initialData:v,internalDialog:t}).internalDialog.title,i),u=i,a=ME({body:o.internalDialog.body},ft.none(),u,!1),s=cD.parts.body(a),l=YE(o.internalDialog.buttons),f=qE(l),d=QE({buttons:l},i),m=UB(function(){return h},GE(function(){return p},i.shared.providers,r),i.shared.getSink),g=function(){switch(o.internalDialog.size){case"large":return["tox-dialog--width-lg"];case"medium":return["tox-dialog--width-md"];default:return[]}}(),p=XE({header:c,body:s,footer:ft.some(d),extraClasses:g,extraBehaviours:[],extraStyles:{}},o,m,i),h=tD({getRoot:tt(p),getBody:function(){return cD.getBody(p)},getFooter:function(){return cD.getFooter(p)},getFormWrapper:function(){var t=cD.getBody(p);return id.getCurrent(t).getOr(t)}},r.redial,f),{dialog:p,instanceApi:h});return cD.show(b.dialog),b.instanceApi.setData(v),b.instanceApi},t)}function r(t,M,F,I){return _B.open(function(t,n,e){function o(){return E.on(function(t){op.reposition(t),nO.refresh(t)})}var r,i,u,a,c,s,l,f,d,m,g,p,h,v,b,y,x,w,S,k,C,O,_,T=Xt(Gt("data",e,n)),E=fc(),D=R.shared.header.isPositionedAtTop(),B=(i={dataValidator:e,initialData:T,internalDialog:t},u={redial:_B.redial,closeWindow:function(){E.on(op.hide),V.off("ResizeEditor",o),E.clear(),F(B.instanceApi)}},a=R,c=I,v=Ar("dialog-label"),b=Ar("dialog-content"),y=Vm((f={title:i.internalDialog.title,draggable:!0},d=v,m=a.shared.providers,sy.sketch({dom:MC('<div class="tox-dialog__header"></div>'),components:[LE(f,ft.some(d),m),jE(),NE(m)],containerBehaviours:Za([yE.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return Iu(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])}))),x=Vm((g={body:i.internalDialog.body},p=a,h=c,ME(g,ft.some(b),p,h))),w=YE(i.internalDialog.buttons),S=qE(w),k=Vm(GB({buttons:w},a)),C=UB(function(){return _},{onBlock:function(e){kO.block(O,function(t,n){return UE(e.message,n,a.shared.providers)})},onUnblock:function(){kO.unblock(O)},onClose:function(){return u.closeWindow()}},a.shared.getSink),O=bu({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"],attributes:((s={role:"dialog"})["aria-labelledby"]=v,s["aria-describedby"]=b,s)},eventOrder:((l={})[To()]=[R_.name(),oc.name()],l[Eo()]=["execute-on-form"],l[zo()]=["reflecting","execute-on-form"],l),behaviours:Za([Bg.config({mode:"cyclic",onEscape:function(t){return ze(t,yy),ft.some(!0)},useTabstopAt:function(t){return!g0(t)&&("button"!==nr(t)||"disabled"!==_r(t,"disabled"))}}),R_.config({channel:PB,updateState:function(t,n){return ft.some(n)},initialData:i}),Rg.config({}),lm("execute-on-form",C.concat([Qe(fo(),function(t,n){Bg.focusIn(t)})])),kO.config({getRoot:function(){return ft.some(O)}}),Mg.config({}),Dw({})]),components:[y.asSpec(),x.asSpec(),k.asSpec()]}),_=tD({getRoot:tt(O),getFooter:function(){return k.get(O)},getBody:function(){return x.get(O)},getFormWrapper:function(){var t=x.get(O);return id.getCurrent(t).getOr(t)}},u.redial,S),{dialog:O,instanceApi:_}),A=bu(op.sketch(st(st({lazySink:R.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:{}},D?{}:{fireRepositionEventInstead:{}}),{inlineBehaviours:Za(H([lm("window-manager-inline-events",[Xe(Lo(),function(t,n){ze(B.dialog,xy)})])],(r=V,P&&D?[]:[nO.config({contextual:{lazyContext:function(){return ft.some(Ai(de.fromDom(r.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"]})]))),isExtraPart:function(t,n){return jb(e=n,".tox-alert-dialog")||jb(e,".tox-confirm-dialog");var e}})));return E.set(A),op.showWithin(A,yu(B.dialog),{anchor:M},ft.some(mu())),P&&D||(nO.refresh(A),V.on("ResizeEditor",o)),B.instanceApi.setData(T),Bg.focusIn(B.dialog),B.instanceApi},t)}var c,s,l,f,R=t.backstage,V=t.editor,P=sv(V),e=(s=(c=t).backstage.shared,{open:function(t,n){function e(){cD.hide(u),n()}var o=Vm(xS({name:"close-alert",text:"OK",primary:!0,align:"end",disabled:!1,icon:ft.none()},"cancel",c.backstage)),r=RE(),i=IE(e,s.providers),u=bu(zE({lazySink:function(){return s.getSink()},header:FE(r,i),body:VE(t,s.providers),footer:ft.some(PE(HE([],[o.asSpec()]))),onEscape:e,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Xe(xy,e)],eventOrder:{}}));cD.show(u);var a=o.get(u);Rg.focus(a)}}),i=(f=(l=t).backstage.shared,{open:function(t,n){function e(t){cD.hide(a),n(t)}var o=Vm(xS({name:"yes",text:"Yes",primary:!0,align:"end",disabled:!1,icon:ft.none()},"submit",l.backstage)),r=xS({name:"no",text:"No",primary:!1,align:"end",disabled:!1,icon:ft.none()},"cancel",l.backstage),i=RE(),u=IE(function(){return e(!1)},f.providers),a=bu(zE({lazySink:function(){return f.getSink()},header:FE(i,u),body:VE(t,f.providers),footer:ft.some(PE(HE([],[r,o.asSpec()]))),onEscape:function(){return e(!1)},extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[Xe(xy,function(){return e(!1)}),Xe(Sy,function(){return e(!0)})],eventOrder:{}}));cD.show(a);var c=o.get(a);Rg.focus(c)}});return{open:function(t,n,e){return void 0!==n&&"toolbar"===n.inline?r(t,R.shared.anchors.inlineDialog(),e,n.ariaAttrs):void 0!==n&&"cursor"===n.inline?r(t,R.shared.anchors.cursor(),e,n.ariaAttrs):o(t,e)},openUrl:function(t,n){return e=n,_B.openUrl(function(t){var n=eD(t,{closeWindow:function(){cD.hide(n.dialog),e(n.instanceApi)}},V,R);return cD.show(n.dialog),n.instanceApi},t);var e},alert:function(t,n){e.open(t,function(){n()})},close:function(t){t.close()},confirm:function(t,n){i.open(t,function(t){n(t)})}}}($T=JT=JT||{})[$T.None=0]="None",$T[$T.Both=1]="Both",$T[$T.Vertical=2]="Vertical";var rD,iD=tt([Jt("lazySink"),rn("dragBlockClass"),bn("getBounds",Fi),dn("useTabstopAt",_),dn("eventOrder",{}),Js("modalBehaviours",[Bg]),Ju("onExecute"),Qu("onEscape")]),uD={sketch:h},aD=tt([Kf({name:"draghandle",overrides:function(t,n){return{behaviours:Za([yE.config({mode:"mouse",getTarget:function(t){return Mu(t,'[role="dialog"]').getOr(t)},blockerClass:t.dragBlockClass.getOrDie(new Error("The drag blocker class was not specified for a dialog with a drag handle: \n"+JSON.stringify(n,null,2)).message),getBounds:t.getDragBounds})])}}}),Yf({schema:[Jt("dom")],name:"title"}),Yf({factory:uD,schema:[Jt("dom")],name:"close"}),Yf({factory:uD,schema:[Jt("dom")],name:"body"}),Kf({factory:uD,schema:[Jt("dom")],name:"footer"}),qf({factory:{sketch:function(t,n){return st(st({},t),{dom:n.dom,components:n.components})}},schema:[dn("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),dn("components",[])],name:"blocker"})]),cD=wl({name:"ModalDialog",configFields:iD(),partFields:aD(),factory:function(a,t,n,r){var e,i=fc(),o=Ar("modal-events"),u=st(st({},a.eventOrder),((e={})[zo()]=[o].concat(a.eventOrder["alloy.system.attached"]||[]),e));return{uid:a.uid,dom:a.dom,components:t,apis:{show:function(t){i.set(t);var n=a.lazySink(t).getOrDie(),e=r.blocker(),o=n.getSystem().build(st(st({},e),{components:e.components.concat([yu(t)]),behaviours:Za([Rg.config({}),lm("dialog-blocker-events",[Qe(fo(),function(){Bg.focusIn(t)})])])}));Fs(n,o),Bg.focusIn(t)},hide:function(n){i.clear(),ar(n.element).each(function(t){n.getSystem().getByDom(t).each(function(t){Rs(t)})})},getBody:function(t){return fl(t,a,"body")},getFooter:function(t){return fl(t,a,"footer")},setIdle:function(t){kO.unblock(t)},setBusy:function(t,n){kO.block(t,n)}},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:Qs(a.modalBehaviours,[Mg.config({}),Bg.config({mode:"cyclic",onEnter:a.onExecute,onEscape:a.onEscape,useTabstopAt:a.useTabstopAt}),kO.config({getRoot:i.get}),lm(o,[$o(function(t){var n,e,o,r=t.element,i=fl(t,a,"title").element,u=Tr(r,"id").fold(function(){var t=Ar("dialog-label");return Or(i,"id",t),t},h);Or(r,"aria-labelledby",u),n=t.element,e=fl(t,a,"body").element,o=ft.from(_r(n,"id")).fold(function(){var t=Ar("dialog-describe");return Or(e,"id",t),t},h),Or(n,"aria-describedby",o)})])])}},apis:{show:function(t,n){t.show(n)},hide:function(t,n){t.hide(n)},getBody:function(t,n){return t.getBody(n)},getFooter:function(t,n){return t.getFooter(n)},setBusy:function(t,n,e){t.setBusy(n,e)},setIdle:function(t,n){t.setIdle(n)}}}),sD=te([Qt("type"),Qt("name")].concat(Hh)),lD=ie,fD=[le("name","name",Et(function(){return Ar("button-name")}),re),cn("icon"),hn("align","end",["start","end"]),vn("primary",!1),vn("disabled",!1)],dD=H(H([],fD),[Qt("text")]),mD=H([Zt("type",["submit","cancel","custom"])],dD),gD=qt("type",{submit:mD,cancel:mD,custom:mD,menu:H([Zt("type",["menu"]),cn("text"),cn("tooltip"),cn("icon"),on("items",sD)],fD)}),pD=[Qt("type"),Qt("text"),Zt("level",["info","warn","error","success"]),Qt("icon"),dn("url","")],hD=te(pD),vD=[Qt("type"),Qt("text"),vn("disabled",!1),vn("primary",!1),le("name","name",Et(function(){return Ar("button-name")}),re),cn("icon"),vn("borderless",!1)],bD=te(vD),yD=[Qt("type"),Qt("name"),Qt("label"),vn("disabled",!1)],xD=te(yD),wD=ie,SD=[Qt("type"),Qt("name")],kD=SD.concat([cn("label")]),CD=kD.concat([dn("columns","auto")]),OD=te(CD),_D=ne([Qt("value"),Qt("text"),Qt("icon")]),TD=te(kD),ED=re,DD=te(kD),BD=re,AD=SD.concat([pn("tag","textarea"),Qt("scriptId"),Qt("scriptUrl"),mn("settings",void 0,ce)]),MD=SD.concat([pn("tag","textarea"),tn("init")]),FD=Wt(function(t){return Gt("customeditor.old",Ht(MD),t).orThunk(function(){return Gt("customeditor.new",Ht(AD),t)})}),ID=re,RD=te(kD),VD=zt(Zn),PD=[Qt("type"),Qt("html"),hn("presets","presentation",["presentation","document"])],HD=te(PD),zD=kD.concat([vn("sandboxed",!0)]),ND=te(zD),LD=re,jD=kD.concat([$t("currentState",te([Jt("blob"),Qt("url")]))]),WD=te(jD),UD=kD.concat([cn("inputMode"),cn("placeholder"),vn("maximized",!1),vn("disabled",!1)]),GD=te(UD),XD=re,YD=[Qt("text"),Qt("value")],qD=[Qt("text"),on("items",(rD=_t(function(){return KD}),{extract:function(t,n){return rD().extract(t,n)},toString:function(){return rD().toString()}}))],KD=Nt([te(YD),te(qD)]),JD=kD.concat([on("items",KD),vn("disabled",!1)]),$D=te(JD),QD=re,ZD=kD.concat([en("items",[Qt("text"),Qt("value")]),gn("size",1),vn("disabled",!1)]),tB=te(ZD),nB=re,eB=kD.concat([vn("constrain",!0),vn("disabled",!1)]),oB=te(eB),rB=te([Qt("width"),Qt("height")]),iB=[Qt("type"),on("header",re),on("cells",zt(re))],uB=te(iB),aB=kD.concat([cn("placeholder"),vn("maximized",!1),vn("disabled",!1)]),cB=te(aB),sB=re,lB=kD.concat([hn("filetype","file",["image","media","file"]),dn("disabled",!1)]),fB=te(lB),dB=te([Qt("value"),dn("meta",{})]),mB=Pt(function(){return jt("type",{alertbanner:hD,bar:te((e=CE("bar"),[Qt("type"),e])),button:bD,checkbox:xD,colorinput:TD,colorpicker:DD,dropzone:RD,grid:te((t=CE("grid"),[Qt("type"),$t("columns",oe),t])),iframe:ND,input:GD,listbox:$D,selectbox:tB,sizeinput:oB,textarea:cB,urlinput:fB,customeditor:FD,htmlpanel:HD,imagetools:WD,collection:OD,label:te((n=CE("label"),[Qt("type"),Qt("label"),n])),table:uB,panel:pB});var t,n,e}),gB=[Qt("type"),dn("classes",[]),on("items",mB)],pB=te(gB),hB=[le("name","name",Et(function(){return Ar("tab-name")}),re),Qt("title"),on("items",mB)],vB=[Qt("type"),en("tabs",hB)],bB=te(vB),yB=dD,xB=gD,wB=te([Qt("title"),$t("body",jt("type",{panel:pB,tabpanel:bB})),pn("size","normal"),on("buttons",xB),dn("initialData",{}),bn("onAction",ct),bn("onChange",ct),bn("onSubmit",ct),bn("onClose",ct),bn("onCancel",ct),dn("onTabChange",ct)]),SB=te(H([Zt("type",["cancel","custom"])],yB)),kB=te([Qt("title"),Qt("url"),an("height"),an("width"),ln("buttons",SB),bn("onAction",ct),bn("onCancel",ct),bn("onClose",ct),bn("onMessage",ct)]),CB=function(t){return x(t)?[t].concat(z(St(t),CB)):c(t)?z(t,CB):[]},OB={checkbox:wD,colorinput:ED,colorpicker:BD,dropzone:VD,input:XD,iframe:LD,sizeinput:rB,selectbox:nB,listbox:QD,size:rB,textarea:sB,urlinput:dB,customeditor:ID,collection:_D,togglemenuitem:lD},_B={open:function(t,n){var e=_E(n);return t(e.internalDialog,e.initialData,e.dataValidator)},openUrl:function(t,n){return t(Xt(Gt("dialog",kB,n)))},redial:_E},TB=xl({name:"TabButton",configFields:[dn("uid",void 0),Jt("value"),le("dom","dom",At(function(){return{attributes:{role:"tab",id:Ar("aria"),"aria-selected":"false"}}}),ee()),rn("action"),dn("domModification",{}),Js("tabButtonBehaviours",[Rg,Bg,_f]),Jt("view")],factory:function(t,n){return{uid:t.uid,dom:t.dom,components:t.components,events:ym(t.action),behaviours:Qs(t.tabButtonBehaviours,[Rg.config({}),Bg.config({mode:"execution",useSpace:!0,useEnter:!0}),_f.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),EB=tt([Jt("tabs"),Jt("dom"),dn("clickToDismiss",!1),Js("tabbarBehaviours",[md,Bg]),Yu(["tabClass","selectedClass"])]),DB=tt([Jf({factory:TB,name:"tabs",unit:"tab",overrides:function(o){return{action:function(t){var n=t.getSystem().getByUid(o.uid).getOrDie(),e=md.isHighlighted(n,t);(e&&o.clickToDismiss?function(t,n){md.dehighlight(t,n),Ne(t,Xo(),{tabbar:t,button:n})}:e?ct:function(t,n){md.highlight(t,n),Ne(t,Go(),{tabbar:t,button:n})})(n,t)},domModification:{classes:[o.markers.tabClass]}}}})]),BB=wl({name:"Tabbar",configFields:EB(),partFields:DB(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:Qs(t.tabbarBehaviours,[md.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,n){Or(n.element,"aria-selected","true")},onDehighlight:function(t,n){Or(n.element,"aria-selected","false")}}),Bg.config({mode:"flow",getInitial:function(t){return md.getHighlighted(t).map(function(t){return t.element})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),AB=xl({name:"Tabview",configFields:[Js("tabviewBehaviours",[Mg])],factory:function(t,n){return{uid:t.uid,dom:t.dom,behaviours:Qs(t.tabviewBehaviours,[Mg.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),MB=tt([dn("selectFirst",!0),Ku("onChangeTab"),Ku("onDismissTab"),dn("tabs",[]),Js("tabSectionBehaviours",[])]),FB=tt([Yf({factory:BB,schema:[Jt("dom"),nn("markers",[Jt("tabClass"),Jt("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),Yf({factory:AB,name:"tabview"})]),IB=wl({name:"TabSection",configFields:MB(),partFields:FB(),factory:function(i,t,n,e){function o(t,n){ll(t,i,"tabbar").each(function(t){n(t).each(Le)})}return{uid:i.uid,dom:i.dom,components:t,behaviours:$s(i.tabSectionBehaviours),events:Jo(lt([i.selectFirst?[$o(function(t,n){o(t,md.getFirst)})]:[],[Xe(Go(),function(t,n){var o=n.event.button,r=_f.getValue(o);ll(o,i,"tabview").each(function(e){V(i.tabs,function(t){return t.value===r}).each(function(t){var n=t.view();Tr(o.element,"id").each(function(t){Or(e.element,"aria-labelledby",t)}),Mg.set(e,n),i.onChangeTab(e,o,n)})})}),Xe(Xo(),function(t,n){var e=n.event.button;i.onDismissTab(t,e)})]])),apis:{getViewItems:function(t){return ll(t,i,"tabview").map(function(t){return Mg.contents(t)}).getOr([])},showTab:function(t,e){o(t,function(n){return V(md.getCandidates(n),function(t){return _f.getValue(t)===e}).filter(function(t){return!md.isHighlighted(n,t)})})}}}},apis:{getViewItems:function(t,n){return t.getViewItems(n)},showTab:function(t,n,e){t.showTab(n,e)}}}),RB="send-data-to-section",VB="send-data-to-view",PB=Ar("update-dialog"),HB=Ar("update-title"),zB=Ar("update-body"),NB=Ar("update-footer"),LB=Ar("body-send-message"),jB=Qv.deviceType.isTouch(),WB=function(u,t){function n(t,i){return Xe(t,function(e,o){var n,r;n=e,r=function(t,n){i(u(),t,o.event,e)},R_.getState(n).get().each(function(t){r(t,n)})})}return H(H([],KE(n,t)),[n(wy,function(t,n,e){n.onAction(t,{name:e.name})})])},UB=function(u,t,c){function n(t,i){return Xe(t,function(e,o){var n,r;n=e,r=function(t,n){i(u(),t,o.event,e)},R_.getState(n).get().each(function(t){r(t.internalDialog,n)})})}return H(H([],KE(n,t)),[n(Sy,function(t,n){return n.onSubmit(t)}),n(by,function(t,n,e){n.onChange(t,{name:e.name})}),n(wy,function(t,n,e,o){function r(){return Bg.focusIn(o)}function i(t){return Er(t,"disabled")||Tr(t,"aria-disabled").exists(function(t){return"true"===t})}var u=ji(o.element),a=Ca(u);n.onAction(t,{name:e.name,value:e.value}),Ca(u).fold(r,function(n){i(n)||a.exists(function(t){return An(n,t)&&i(t)})?r():c().toOptional().filter(function(t){return!An(t.element,n)}).each(r)})}),n(Oy,function(t,n,e){n.onTabChange(t,{newTabName:e.name,oldTabName:e.oldName})}),Qo(function(t){var n=u();_f.setValue(t,n.getData())})])},GB=$E,XB=tinymce.util.Tools.resolve("tinymce.util.URI"),YB=["insertContent","setContent","execCommand","close","block","unblock"];o.add("silver",function(t){var n=kE(t),e=n.uiMothership,o=n.backstage,r=n.renderUI,i=n.getUi;return ny(t,o.shared),{renderUI:r,getWindowManagerImpl:tt(oD({editor:t,backstage:o})),getNotificationManagerImpl:function(){return u=e,a={backstage:o}.backstage.shared,{open:function(t,n){function e(){n(),op.hide(i)}var o=!t.closeButton&&t.timeout&&(0<t.timeout||t.timeout<0),r=bu(mp.sketch({text:t.text,level:et(["success","error","warning","warn","info"],t.type)?t.type:void 0,progress:!0===t.progressBar,icon:ft.from(t.icon),closeButton:!o,onAction:e,iconProvider:a.providers.icons,translationProvider:a.providers.translate})),i=bu(op.sketch(st({dom:{tag:"div",classes:["tox-notifications-container"]},lazySink:a.getSink,fireDismissalEventInstead:{}},a.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}})));return u.add(i),0<t.timeout&&ap.setTimeout(function(){e()},t.timeout),{close:e,moveTo:function(t,n){op.showAt(i,yu(r),{anchor:{type:"makeshift",x:t,y:n}})},moveRel:function(t,n){var e,o;"banner"!==n?(e=function(){switch(n){case"bc-bc":return up;case"tc-tc":return ip;case"tc-bc":return qa;default:return Ka}}(),o={type:"node",root:mu(),node:ft.some(de.fromDom(t)),layouts:{onRtl:function(){return[e]},onLtr:function(){return[e]}}},op.showAt(i,yu(r),{anchor:o})):op.showAt(i,yu(r),{anchor:a.anchors.banner()})},text:function(t){mp.updateText(r,t)},settings:t,getEl:function(){return r.element.dom},progressBar:{value:function(t){mp.updateProgress(r,t)}}}},close:function(t){t.close()},reposition:function(t){var e;dt(t,function(t){return t.moveTo(0,0)}),0<(e=t).length&&(ot(e).each(function(t){return t.moveRel(null,"banner")}),dt(e,function(t,n){0<n&&t.moveRel(e[n-1].getEl(),"bc-tc")}))},getArgs:function(t){return t.settings}};var u,a},ui:i()}})}();