PageSourceSearch

https://bids.gryphonusa.com/editor-c5b7bd51.d73397c128fe7e087987.js

js gryphonusa.com collected 2026-10-04 13:40:08 UTC 500,252 bytes, 2 lines download raw bytes

vendor: 5,200 bytes, lines 1-2
1/*! For license information please see editor-c5b7bd51.d73397c128fe7e087987.js.LICENSE.txt */
2(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[2364],{50755(){var t=["class","style"],n=["events"],e=["attributes"],o=["primary"],r=["primary"];function i(){"use strict";var t=f(),n=t.m(i),e=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function o(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===e||"GeneratorFunction"===(n.displayName||n.name))}var r={throw:1,return:2,break:3,continue:3};function d(t){var n,e;return function(o){n||(n={stop:function(){return e(o.a,2)},catch:function(){return o.v},abrupt:function(t,n){return e(o.a,r[t],n)},delegateYield:function(t,r,i){return n.resultName=r,e(o.d,u(t),i)},finish:function(t){return e(o.f,t)}},e=function(t,e,r){o.p=n.prev,o.n=n.next;try{return t(e,r)}finally{n.next=o.n}}),n.resultName&&(n[n.resultName]=o.v,n.resultName=void 0),n.sent=o.v,n.next=o.n;try{return t.call(this,n)}finally{o.p=n.prev,o.n=n.next}}}return(i=function(){return{wrap:function(n,e,o,r){return t.w(d(n),e,o,r&&r.reverse())},isGeneratorFunction:o,mark:t.m,awrap:function(t,n){return new m(t,n)},AsyncIterator:l,async:function(t,n,e,r,i){return(o(n)?s:c)(d(t),n,e,r,i)},keys:a,values:u}})()}function u(t){if(null!=t){var n=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],e=0;if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}}}throw new TypeError(A(t)+" is not iterable")}function a(t){var n=Object(t),e=[];for(var o in n)e.unshift(o);return function t(){for(;e.length;)if((o=e.pop())in n)return t.value=o,t.done=!1,t;return t.done=!0,t}}function c(t,n,e,o,r){var i=s(t,n,e,o,r);return i.next().then(function(t){return t.done?t.value:i.next()})}function s(t,n,e,o,r){return new l(f().w(t,n,e,o),r||Promise)}function l(t,n){function e(o,r,i,u){try{var a=t[o](r),c=a.value;return c instanceof m?n.resolve(c.v).then(function(t){e("next",t,i,u)},function(t){e("throw",t,i,u)}):n.resolve(c).then(function(t){a.value=t,i(a)},function(t){return e("throw",t,i,u)})}catch(t){u(t)}}var o;this.next||(d(l.prototype),d(l.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),d(this,"_invoke",function(t,r,i){function u(){return new n(function(n,o){e(t,i,n,o)})}return o=o?o.then(u,u):u()},!0)}function f(){var t,n,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",r=e.toStringTag||"@@toStringTag";function i(e,o,r,i){var c=o&&o.prototype instanceof a?o:a,s=Object.create(c.prototype);return d(s,"_invoke",function(e,o,r){var i,a,c,s=0,l=r||[],f=!1,d={p:0,n:0,v:t,a:m,f:m.bind(t,4),d:function(n,e){return i=n,a=0,c=t,d.n=e,u}};function m(e,o){for(a=e,c=o,n=0;!f&&s&&!r&&n<l.length;n++){var r,i=l[n],m=d.p,g=i[2];e>3?(r=g===o)&&(c=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=m&&((r=e<2&&m<i[1])?(a=0,d.v=o,d.n=i[1]):m<g&&(r=e<3||i[0]>o||o>g)&&(i[4]=e,i[5]=o,d.n=g,a=0))}if(r||e>1)return u;throw f=!0,o}return function(r,l,g){if(s>1)throw TypeError("Generator is already running");for(f&&1===l&&m(l,g),a=l,c=g;(n=a<2?t:c)||!f;){i||(a?a<3?(a>1&&(d.n=-1),m(a,c)):d.n=c:d.v=c);try{if(s=2,i){if(a||(r="next"),n=i[r]){if(!(n=n.call(i,c)))throw TypeError("iterator result is not an object");if(!n.done)return n;c=n.value,a<2&&(a=0)}else 1===a&&(n=i.return)&&n.call(i),a<2&&(c=TypeError("The iterator does not provide a '"+r+"' method"),a=1);i=t}else if((n=(f=d.n<0)?c:e.call(o,d))!==u)break}catch(n){i=t,a=1,c=n}finally{s=1}}return{value:n,done:f}}}(e,r,i),!0),s}var u={};function a(){}function c(){}function s(){}n=Object.getPrototypeOf;var l=[][o]?n(n([][o]())):(d(n={},o,function(){return this}),n),m=s.prototype=a.prototype=Object.create(l);function g(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,d(t,r,"GeneratorFunction")),t.prototype=Object.create(m),t}return c.prototype=s,d(m,"constructor",s),d(s,"constructor",c),c.displayName="GeneratorFunction",d(s,r,"GeneratorFunction"),d(m),d(m,r,"Generator"),d(m,o,function(){return this}),d(m,"toString",function(){return"[object Generator]"}),(f=function(){return{w:i,m:g}})()}function d(t,n,e,o){var r=Object.defineProperty;try{r({},"",{})}catch(t){r=0}d=function(t,n,e,o){function i(n,e){d(t,n,function(t){return this._invoke(n,e,t)})}n?r?r(t,n,{value:e,enumerable:!o,configurable:!o,writable:!o}):t[n]=e:(i("next",0),i("throw",1),i("return",2))},d(t,n,e,o)}function m(t,n){this.v=t,this.k=n}function g(t,n,e,o,r,i,u){try{var a=t[i](u),c=a.value}catch(t){return void e(t)}a.done?n(c):Promise.resolve(c).then(o,r)}function p(t){return function(){var n=this,e=arguments;return new Promise(function(o,r){var i=t.apply(n,e);function u(t){g(i,o,r,u,a,"next",t)}function a(t){g(i,o,r,u,a,"throw",t)}u(void 0)})}}function h(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var o,r,i,u,a=[],c=!0,s=!1;try{if(i=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;c=!1}else for(;!(c=(o=i.call(e)).done)&&(a.push(o.value),a.length!==n);c=!0);}catch(t){s=!0,r=t}
vendor: 2,944 bytes, line 2
2finally{try{if(!c&&null!=e.return&&(u=e.return(),Object(u)!==u))return}finally{if(s)throw r}}return a}}(t,n)||C(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(t,n,e){if(y())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,n);var r=new(t.bind.apply(t,o));return e&&b(r,e.prototype),r}function b(t,n){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},b(t,n)}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(y=function(){return!!t})()}function x(t,n){if(null==t)return{};var e,o,r=function(t,n){if(null==t)return{};var e={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(-1!==n.indexOf(o))continue;e[o]=t[o]}return e}(t,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)e=i[o],-1===n.indexOf(e)&&{}.propertyIsEnumerable.call(t,e)&&(r[e]=t[e])}return r}function w(t){return function(t){if(Array.isArray(t))return k(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||C(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(t,n){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=C(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return u=t.done,t},e:function(t){a=!0,i=t},f:function(){try{u||null==e.return||e.return()}finally{if(a)throw i}}}}function C(t,n){if(t){if("string"==typeof t)return k(t,n);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?k(t,n):void 0}}function k(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,o=Array(n);e<n;e++)o[e]=t[e];return o}function O(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),e.push.apply(e,o)}return e}function _(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?O(Object(e),!0).forEach(function(n){T(t,n,e[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):O(Object(e)).forEac
2h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})}return t}function T(t,n,e){return(n=D(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function E(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,D(o.key),o)}}function D(t){var n=function(t,n){if("object"!=A(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,n||"default");if("object"!=A(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==A(n)?n:n+""}function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}!function(){"use strict";var u=Object.getPrototypeOf,a=function(t,n,e){var o;return!!e(t,n.prototype)||(null===(o=t.constructor)||void 0===o?void 0:o.name)===n.name},c=function(t){return function(n){return function(t){var n=A(t);return null===t?"null":"object"===n&&Array.isArray(t)?"array":"object"===n&&a(t,String,function(t,n){return n.isPrototypeOf(t)})?"string":n}(n)===t}},s=function(t){return function(n){return A(n)===t}},l=function(t){return function(n){return t===n}},f=c("string"),d=c("object"),m=function(t){return function(t,n){return d(t)&&a(t,n,function(t,n){return u(t)===n})}(t,Object)},g=c("array"),b=l(null),y=s("boolean"),C=l(void 0),k=function(t){return null==t},O=function(t){return!k(t)},D=s("function"),M=s("number"),B=function(t,n){if(g(t)){for(var e=0,o=t.length;e<o;++e)if(!n(t[e]))return!1;return!0}return!1},I=function(){},F=function(t){return function(){return t()}},R=function(t,n){return function(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return t(n.apply(null,o))}},N=function(t){return function(){return t}},L=function(t){return t},z=function(t,n){return t===n};function P(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o<n;o++)e[o-1]=arguments[o];return function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];var i=e.concat(o);return t.apply(null,i)}}var H=function(t){return function(n){return!t(n)}},V=function(t){return function(){throw new Error(t)}},U=function(t){return t()},W=N(!1),j=N(!0),G=function(){function t(n,e){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.tag=n,this.value=e}return function(t,n,e){return n&&E(t.prototype,n),e&&E(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"fold",value:function(t,n){return this.tag?n(this.value):t()}},{key:"isSome",value:function(){return this.tag}},{key:"isNone",value:function(){return!this.tag}},{key:"map",value:function(n){return this.tag?t.some(n(this.value)):t.none()}},{key:"bind",value:function(n){return this.tag?n(this.value):t.none()}},{key:"exists",value:function(t){return this.tag&&t(this.value)}},{key:"forall",value:function(t){return!this.tag||t(this.value)}},{key:"filter",value:function(n){return!this.tag||n(this.value)?this:t.none()}},{key:"getOr",value:function(t){return this.tag?this.value:t}},{key:"or",value:function(t){return this.tag?this:t}},{key:"getOrThunk",value:function(t){return this.tag?this.value:t()}},{key:"orThunk",value:function(t){return this.tag?this:t()}},{key:"getOrDie",value:function(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}},{key:"getOrNull",value:function(){return this.tag?this.value:null}},{key:"getOrUndefined",value:function(){return this.value}},{key:"each",value:function(t){this.tag&&t(this.value)}},{key:"toArray",value:function(){return this.tag?[this.value]:[]}},{key:"toString",value:function(){return this.tag?"some(".concat(this.value,")"):"none()"}}],[{key:"some",value:function(n){return new t(!0,n)}},{key:"none",value:function(){return t.singletonNone}},{key:"from",value:function(n){return O(n)?t.some(n):t.none()}}])}();G.singletonNone=new G(!1);var q,Y=Array.prototype.slice,X=Array.prototype.indexOf,K=Array.prototype.push,J=function(t,n){return X.call(t,n)},$=function(t,n){return J(t,n)>-1},Q=function(t,n){for(var e=0,o=t.length;e<o;e++){if(n(t[e],e))return!0}return!1},Z=function(t,n){for(var e=[],o=0;o<t;
2o++)e.push(n(o));return e},tt=function(t,n){for(var e=[],o=0;o<t.length;o+=n){var r=Y.call(t,o,o+n);e.push(r)}return e},nt=function(t,n){for(var e=t.length,o=new Array(e),r=0;r<e;r++){var i=t[r];o[r]=n(i,r)}return o},et=function(t,n){for(var e=0,o=t.length;e<o;e++){n(t[e],e)}},ot=function(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}},rt=function(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},it=function(t,n,e){return function(t,n){for(var e=t.length-1;e>=0;e--)n(t[e],e)}(t,function(t,o){e=n(e,t,o)}),e},ut=function(t,n,e){return et(t,function(t,o){e=n(e,t,o)}),e},at=function(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 G.some(i);if(e(i,o))break}return G.none()}(t,n,W)},ct=function(t,n){for(var e=0,o=t.length;e<o;e++){if(n(t[e],e))return G.some(e)}return G.none()},st=function(t){for(var n=[],e=0,o=t.length;e<o;++e){if(!g(t[e]))throw new Error("Arr.flatten item "+e+" was not an array, input: "+t);K.apply(n,t[e])}return n},lt=function(t,n){return st(nt(t,n))},ft=function(t,n){for(var e=0,o=t.length;e<o;++e){if(!0!==n(t[e],e))return!1}return!0},dt=function(t){var n=Y.call(t,0);return n.reverse(),n},mt=function(t,n){return rt(t,function(t){return!$(n,t)})},gt=function(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},pt=function(t){return[t]},ht=function(t,n){var e=Y.call(t,0);return e.sort(n),e},vt=function(t,n){return n>=0&&n<t.length?G.some(t[n]):G.none()},bt=function(t){return vt(t,0)},yt=function(t){return vt(t,t.length-1)},xt=D(Array.from)?Array.from:function(t){return Y.call(t)},wt=function(t,n){for(var e=0;e<t.length;e++){var o=n(t[e],e);if(o.isSome())return o}return G.none()},St=Object.keys,Ct=Object.hasOwnProperty,kt=function(t,n){for(var e=St(t),o=0,r=e.length;o<r;o++){var i=e[o];n(t[i],i)}},Ot=function(t,n){return _t(t,function(t,e){return{k:e,v:n(t,e)}})},_t=function(t,n){var e={};return kt(t,function(t,o){var r=n(t,o);e[r.k]=r.v}),e},Tt=function(t){return function(n,e){t[e]=n}},Et=function(t,n,e,o){kt(t,function(t,r){(n(t,r)?e:o)(t,r)})},Dt=function(t,n){var e={};return Et(t,n,Tt(e),I),e},At=function(t,n){var e=[];return kt(t,function(t,o){e.push(n(t,o))}),e},Mt=function(t,n){for(var e=St(t),o=0,r=e.length;o<r;o++){var i=e[o],u=t[i];if(n(u,i,t))return G.some(u)}return G.none()},Bt=function(t){return At(t,L)},It=function(t,n){return Ft(t,n)?G.from(t[n]):G.none()},Ft=function(t,n){return Ct.call(t,n)},Rt=function(t,n){return Ft(t,n)&&void 0!==t[n]&&null!==t[n]},Nt=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:z;return t.exists(function(t){return e(t,n)})},Lt=function(t){for(var n=[],e=function(t){n.push(t)},o=0;o<t.length;o++)t[o].each(e);return n},zt=function(t,n,e){return t.isSome()&&n.isSome()?G.some(e(t.getOrDie(),n.getOrDie())):G.none()},Pt=function(t,n){return null!=t?G.some(n(t)):G.none()},Ht=function(t,n){return t?G.some(n):G.none()},Vt=function(t,n,e){return""===n||t.length>=n.length&&t.substr(e,e+n.length)===n},Ut=function(t,n){return jt(t,n)?function(t,n){return t.substring(n)}(t,n.length):t},Wt=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3?arguments[3]:void 0,r=t.indexOf(n,e);return-1!==r&&(!!C(o)||r+n.length<=o)},jt=function(t,n){return Vt(t,n,0)},Gt=function(t,n){return Vt(t,n,t.length-n.length)},qt=function(t){return function(n){return n.replace(t,"")}}(/^\s+|\s+$/g),Yt=function(t){return t.length>0},Xt=function(t){return!Yt(t)},Kt=function(t){return void 0!==t.style&&D(t.style.getPropertyValue)},Jt=function(t){if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},$t={fromHtml:function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||e.childNodes.length>1){var o="HTML does not have a single root node";throw console.error(o,t),new Error(o)}return Jt(e.childNodes[0])},fromTag:function(t,n){var e=(n||document).createElement(t);return Jt(e)},fromText:function(t,n){var e=(n||document).createTextNode(t);return Jt(e)},fromDom:Jt,fromPoint:function(t,n,e){return G.from(t.dom.elementFromPoint(n,e)).map(Jt)}},Qt="undefined"!=typeof window?window:Function("return this;")(),Zt=function(t,n){return function(t,n){for(var e=null!=n?n:Qt,o=0;o<t.length&&null!=e;++o)e=e[t[o]];return e}(t.split("."),n)},tn=function(t,n){var e=function(t,n){return Zt(t,n)}(t,n);if(null==e)throw new Error(t+" not available on this browser");return e},nn=Object.getPrototypeOf,en=function(t){var n=Zt("ownerDocument.defaultView",t);return d(t)&&(function(t){return tn("HTMLElement",t)}(n).prototype.isPrototypeOf(t)||/^HTML\w*Element$/.test(nn(t).constructor.name))},on=function(t){return t.dom.nodeName.toLowerCase()},rn=function(t){return function(n){return function(t){return t.dom.nodeType}(n)===t}},un=function(t){return an(t)&&en(t.dom)},an=rn(1),cn=rn(3),sn=rn(9),ln=rn(11),fn=function(t){return function(n){return an(n)&&on(n)===t}},dn=function(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")},mn=function(t){return 1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType||0===t.childElementCount},gn=function(t,n){var e=void 0===n?document:n.dom;return mn(e)?G.none():G.from(e.querySelector(t)).map($t.fromDom)},pn=function(t,n){return t.dom===n.dom},hn=function(t,n){var e=t.dom,o=n.dom;return e!==o&&e.contains(o)},vn=function(t){return $t.fromDom(t.dom.ownerDocument)},bn=function(t){return sn(t)?t:vn(t)},yn=function(t){return $t.fromDom(bn(t).dom.documentElement)},xn=function(t){return $t.fromDom(bn(t).dom.defaultView)},wn=function(t){return G.from(t.dom.parentNode).map($t.fromDom)},Sn=function(t){return G.from(t.dom.parentElement).map($t.fromDom)},Cn=function(t){return G.from(t.dom.offsetParent).map($t.fromDom)},kn=function(t){return nt(t.dom.childNodes,$t.fromDom)},On=function(t,n){var e=t.dom.childNodes;return G.from(e[n]).map($t.fromDom)},_n=function(t){return On(t,0)},Tn=function(t,n){return{element:t,offset:n}},En=function(t,n){var e=kn(t);return e.length>0&&n<e.length?Tn(e[n],0):Tn(t,n)},Dn=function(t){return ln(t)&&O(t.dom.host)},An=function(t){return $t.fromDom(t.dom.getRootNode())},Mn=function(t){return Dn(t)?t:$t.fromDom(bn(t).dom.body)},Bn=function(t){return In(t).isSome()},In=function(t){var n=An(t);
2return Dn(n)?G.some(n):G.none()},Fn=function(t){return $t.fromDom(t.dom.host)},Rn=function(t){return O(t.dom.shadowRoot)},Nn=function(t){var n=cn(t)?t.dom.parentNode:t.dom;if(null==n||null===n.ownerDocument)return!1;var e,o,r=n.ownerDocument;return In($t.fromDom(n)).fold(function(){return r.body.contains(n)},(e=Nn,o=Fn,function(t){return e(o(t))}))},Ln=function(){return zn($t.fromDom(document))},zn=function(t){var n=t.dom.body;if(null==n)throw new Error("Body is not available yet");return $t.fromDom(n)},Pn=function(t,n,e){if(!(f(e)||y(e)||M(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+"")},Hn=function(t,n,e){Pn(t.dom,n,e)},Vn=function(t,n){var e=t.dom;kt(n,function(t,n){Pn(e,n,t)})},Un=function(t,n){var e=t.dom.getAttribute(n);return null===e?void 0:e},Wn=function(t,n){return G.from(Un(t,n))},jn=function(t,n){var e=t.dom;return!(!e||!e.hasAttribute)&&e.hasAttribute(n)},Gn=function(t,n){t.dom.removeAttribute(n)},qn=function(t,n,e){if(!f(e))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);Kt(t)&&t.style.setProperty(n,e)},Yn=function(t,n){Kt(t)&&t.style.removeProperty(n)},Xn=function(t,n,e){var o=t.dom;qn(o,n,e)},Kn=function(t,n){var e=t.dom;kt(n,function(t,n){qn(e,n,t)})},Jn=function(t,n){var e=t.dom;kt(n,function(t,n){t.fold(function(){Yn(e,n)},function(t){qn(e,n,t)})})},$n=function(t,n){var e=t.dom,o=window.getComputedStyle(e).getPropertyValue(n);return""!==o||Nn(t)?o:Qn(e,n)},Qn=function(t,n){return Kt(t)?t.style.getPropertyValue(n):""},Zn=function(t,n){var e=t.dom,o=Qn(e,n);return G.from(o).filter(function(t){return t.length>0})},te=function(t){var n={},e=t.dom;if(Kt(e))for(var o=0;o<e.style.length;o++){var r=e.style.item(o);n[r]=e.style[r]}return n},ne=function(t,n,e){var o=$t.fromTag(t);return Xn(o,n,e),Zn(o,n).isSome()},ee=function(t,n){var e=t.dom;Yn(e,n),Nt(Wn(t,"style").map(qt),"")&&Gn(t,"style")},oe=function(t){return t.dom.offsetWidth},re=function(t,n){var e=function(e){var o=n(e);if(o<=0||null===o){var r=$n(e,t);return parseFloat(r)||0}return o},o=function(t,n){return ut(n,function(n,e){var o=$n(t,e),r=void 0===o?0:parseInt(o,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!M(e)&&!e.match(/^[0-9]+$/))throw new Error(t+".set accepts only positive integer values. Value was "+e);var o=n.dom;Kt(o)&&(o.style[t]=e+"px")},get:e,getOuter:e,aggregate:o,max:function(t,n,e){var r=o(t,e);return n>r?n-r:0}}},ie=re("height",function(t){var n=t.dom;return Nn(t)?n.getBoundingClientRect().height:n.offsetHeight}),ue=function(t){return ie.get(t)},ae=function(t){return ie.getOuter(t)},ce=function(t,n){return{left:t,top:n,translate:function(e,o){return ce(t+e,n+o)}}},se=ce,le=function(t,n){return void 0!==t?t:void 0!==n?n:0},fe=function(t){var n=t.dom.ownerDocument,e=n.body,o=n.defaultView,r=n.documentElement;if(e===t.dom)return se(e.offsetLeft,e.offsetTop);var i=le(null==o?void 0:o.pageYOffset,r.scrollTop),u=le(null==o?void 0:o.pageXOffset,r.scrollLeft),a=le(r.clientTop,e.clientTop),c=le(r.clientLeft,e.clientLeft);return de(t).translate(u-c,i-a)},de=function(t){var n=t.dom,e=n.ownerDocument.body;return e===n?se(e.offsetLeft,e.offsetTop):Nn(t)?function(t){var n=t.getBoundingClientRect();return se(n.left,n.top)}(n):se(0,0)},me=re("width",function(t){return t.dom.offsetWidth}),ge=function(t){return me.get(t)},pe=function(t){return me.getOuter(t)},he=function(t){var n,e=!1;return function(){if(!e){e=!0;for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];n=t.apply(null,r)}return n}},ve=function(){return be(0,0)},be=function(t,n){return{major:t,minor:n}},ye={nu:be,detect:function(t,n){var e=String(n).toLowerCase();return 0===t.length?ve():function(t,n){var e=function(t,n){for(var e=0;e<t.length;e++){var o=t[e];if(o.test(n))return o}}(t,n);if(!e)return{major:0,minor:0};var o=function(t){return Number(n.replace(e,"$"+t))};return be(o(1),o(2))}(t,e)},unknown:ve},xe=function(t,n){var e=String(n).toLowerCase();return at(t,function(t){return t.search(e)})},we=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Se=function(t){return function(n){return Wt(n,t)}},Ce=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Wt(t,"edge/")&&Wt(t,"chrome")&&Wt(t,"safari")&&Wt(t,"applewebkit")}},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,we],search:function(t){return Wt(t,"chrome")&&!Wt(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Wt(t,"msie")||Wt(t,"trident")}}
2,{name:"Opera",versionRegexes:[we,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Se("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Se("firefox")},{name:"Safari",versionRegexes:[we,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Wt(t,"safari")||Wt(t,"mobile/"))&&Wt(t,"applewebkit")}}],ke=[{name:"Windows",search:Se("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Wt(t,"iphone")||Wt(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Se("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Se("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Se("linux"),versionRegexes:[]},{name:"Solaris",search:Se("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Se("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Se("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Oe={browsers:N(Ce),oses:N(ke)},_e="Edge",Te="Chromium",Ee="Opera",De="Firefox",Ae="Safari",Me=function(t){var n=t.current,e=t.version,o=function(t){return function(){return n===t}};return{current:n,version:e,isEdge:o(_e),isChromium:o(Te),isIE:o("IE"),isOpera:o(Ee),isFirefox:o(De),isSafari:o(Ae)}},Be={unknown:function(){return Me({current:void 0,version:ye.unknown()})},nu:Me,edge:N(_e),chromium:N(Te),ie:N("IE"),opera:N(Ee),firefox:N(De),safari:N(Ae)},Ie="Windows",Fe="Android",Re="Linux",Ne="macOS",Le="Solaris",ze="FreeBSD",Pe="ChromeOS",He=function(t){var n=t.current,e=t.version,o=function(t){return function(){return n===t}};return{current:n,version:e,isWindows:o(Ie),isiOS:o("iOS"),isAndroid:o(Fe),isMacOS:o(Ne),isLinux:o(Re),isSolaris:o(Le),isFreeBSD:o(ze),isChromeOS:o(Pe)}},Ve={unknown:function(){return He({current:void 0,version:ye.unknown()})},nu:He,windows:N(Ie),ios:N("iOS"),android:N(Fe),linux:N(Re),macos:N(Ne),solaris:N(Le),freebsd:N(ze),chromeos:N(Pe)},Ue=function(t,n,e){var o=Oe.browsers(),r=Oe.oses(),i=n.bind(function(t){return function(t,n){return wt(n.brands,function(n){var e=n.brand.toLowerCase();return at(t,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:ye.nu(parseInt(n.version,10),0)}})})}(o,t)}).orThunk(function(){return function(t,n){return xe(t,n).map(function(t){var e=ye.detect(t.versionRegexes,n);return{current:t.name,version:e}})}(o,t)}).fold(Be.unknown,Be.nu),u=function(t,n){return xe(t,n).map(function(t){var e=ye.detect(t.versionRegexes,n);return{current:t.name,version:e}})}(r,t).fold(Ve.unknown,Ve.nu),a=function(t,n,e,o){var r=t.isiOS()&&!0===/ipad/i.test(e),i=t.isiOS()&&!r,u=t.isiOS()||t.isAndroid(),a=u||o("(pointer:coarse)"),c=r||!i&&u&&o("(min-device-width:768px)"),s=i||u&&!c,l=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(e),f=!s&&!c&&!l;return{isiPad:N(r),isiPhone:N(i),isTablet:N(c),isPhone:N(s),isTouch:N(a),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:N(l),isDesktop:N(f)}}(u,i,t,e);return{browser:i,os:u,deviceType:a}},We=function(t){return window.matchMedia(t).matches},je=he(function(){return Ue(window.navigator.userAgent,G.from(window.navigator.userAgentData),We)}),Ge=function(){return je()},qe=function(t){var n=$t.fromDom(function(t){if(O(t.target)){var n=$t.fromDom(t.target);if(an(n)&&Rn(n)&&t.composed&&t.composedPath){var e=t.composedPath();if(e)return bt(e)}}return G.from(t.target)}(t).getOr(t.target)),e=function(){return t.stopPropagation()},o=function(){return t.preventDefault()},r=R(o,e);return function(t,n,e,o,r,i,u){return{target:t,x:n,y:e,stop:o,prevent:r,kill:i,raw:u}}(n,t.clientX,t.clientY,e,o,r,t)},Ye=function(t,n,e,o,r){var i=function(t,n){return function(e){t(e)&&n(qe(e))}}(e,o);return t.dom.addEventListener(n,i,r),{unbind:P(Xe,t,n,i,r)}},Xe=function(t,n,e,o){t.dom.removeEventListener(n,e,o)},Ke=function(t,n){wn(t).each(function(e){e.dom.insertBefore(n.dom,t.dom)})},Je=function(t,n){var e=function(t){return G.from(t.dom.nextSibling).map($t.fromDom)}(t);e.fold(function(){wn(t).each(function(t){Qe(t,n)})},function(t){Ke(t,n)})},$e=function(t,n){_n(t).fold(function(){Qe(t,n)},function(e){t.dom.insertBefore(n.dom,e.dom)}
2)},Qe=function(t,n){t.dom.appendChild(n.dom)},Ze=function(t,n){et(n,function(n){Qe(t,n)})},to=function(t){t.dom.textContent="",et(kn(t),function(t){no(t)})},no=function(t){var n=t.dom;null!==n.parentNode&&n.parentNode.removeChild(n)},eo=function(t){var n=void 0!==t?t.dom:document,e=n.body.scrollLeft||n.documentElement.scrollLeft,o=n.body.scrollTop||n.documentElement.scrollTop;return se(e,o)},oo=function(t,n,e){var o=(void 0!==e?e.dom:document).defaultView;o&&o.scrollTo(t,n)},ro=function(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}},io=function(t){var n=void 0===t?window:t,e=n.document,o=eo($t.fromDom(e));return function(t){var n=void 0===t?window:t;return Ge().browser.isFirefox()?G.none():G.from(n.visualViewport)}(n).fold(function(){var t=n.document.documentElement,e=t.clientWidth,r=t.clientHeight;return ro(o.left,o.top,e,r)},function(t){return ro(Math.max(t.pageLeft,o.left),Math.max(t.pageTop,o.top),t.width,t.height)})},uo=function(){return $t.fromDom(document)},ao=function(t,n){return t.view(n).fold(N([]),function(n){var e=t.owner(n),o=ao(t,e);return[n].concat(o)})},co=Object.freeze({__proto__:null,view:function(t){var n;return(t.dom===document?G.none():G.from(null===(n=t.dom.defaultView)||void 0===n?void 0:n.frameElement)).map($t.fromDom)},owner:function(t){return vn(t)}}),so=function(t){var n=uo(),e=eo(n),o=function(t,n){var e=n.owner(t),o=ao(n,e);return G.some(o)}(t,co);return o.fold(P(fe,t),function(n){var o=de(t),r=it(n,function(t,n){var e=de(n);return{left:t.left+e.left,top:t.top+e.top}},{left:0,top:0});return se(r.left+o.left+e.left,r.top+o.top+e.top)})},lo=function(t,n,e,o){return{x:t,y:n,width:e,height:o,right:t+e,bottom:n+o}},fo=function(t){var n=fe(t),e=pe(t),o=ae(t);return lo(n.left,n.top,e,o)},mo=function(t){var n=so(t),e=pe(t),o=ae(t);return lo(n.left,n.top,e,o)},go=function(t,n){var e=Math.max(t.x,n.x),o=Math.max(t.y,n.y),r=Math.min(t.right,n.right),i=Math.min(t.bottom,n.bottom);return lo(e,o,r-e,i-o)},po=function(){return io(window)},ho=function(t){var n=t;return{get:function(){return n},set:function(t){n=t}}},vo=function(t){var n=ho(G.none()),e=function(){return n.get().each(t)};return{clear:function(){e(),n.set(G.none())},isSet:function(){return n.get().isSome()},get:function(){return n.get()},set:function(t){e(),n.set(G.some(t))}}},bo=function(){return vo(function(t){return t.unbind()})},yo=function(){var t=vo(I);return _(_({},t),{},{on:function(n){return t.get().each(n)}})},xo=tinymce.util.Tools.resolve("tinymce.ThemeManager"),wo=function(t){var n=function(n){return n(t)},e=N(t),o=function(){return r},r={tag:!0,inner:t,fold:function(n,e){return e(t)},isValue:j,isError:W,map:function(n){return Co.value(n(t))},mapError:o,bind:n,exists:n,forall:n,getOr:e,or:o,getOrThunk:e,orThunk:o,getOrDie:e,each:function(n){n(t)},toOptional:function(){return G.some(t)}};return r},So=function(t){var n=function(){return e},e={tag:!1,inner:t,fold:function(n,e){return n(t)},isValue:W,isError:j,map:n,mapError:function(n){return Co.error(n(t))},bind:n,exists:W,forall:j,getOr:L,or:L,getOrThunk:U,orThunk:U,getOrDie:V(String(t)),each:I,toOptional:G.none};return e},Co={value:wo,error:So,fromOption:function(t,n){return t.fold(function(){return So(n)},wo)}};!function(t){t[t.Error=0]="Error",t[t.Value=1]="Value"}(q||(q={}));var ko=function(t,n,e){return t.stype===q.Error?n(t.serror):e(t.svalue)},Oo=function(t){return{stype:q.Value,svalue:t}},_o=function(t){return{stype:q.Error,serror:t}},To=function(t){return t.fold(_o,Oo)},Eo=function(t){return ko(t,Co.error,Co.value)},Do=Oo,Ao=function(t){var n=[],e=[];return et(t,function(t){ko(t,function(t){return e.push(t)},function(t){return n.push(t)})}),{values:n,errors:e}},Mo=_o,Bo=function(t,n){return t.stype===q.Value?n(t.svalue):t},Io=function(t,n){return t.stype===q.Error?n(t.serror):t},Fo=function(t,n){return t.stype===q.Value?{stype:q.Value,svalue:n(t.svalue)}:t},Ro=function(t,n){return t.stype===q.Error?{stype:q.Error,serror:n(t.serror)}:t},No=ko,Lo=function(t,n,e,o){return{tag:"field",key:t,newKey:n,presence:e,prop:o}},zo=function(t,n,e){switch(t.tag){case"field":return n(t.key,t.newKey,t.presence,t.prop);
2case"custom":return e(t.newKey,t.instantiator)}},Po=function(t){return function(){if(0===arguments.length)throw new Error("Can't merge zero objects");for(var n={},e=0;e<arguments.length;e++){var o=e<0||arguments.length<=e?void 0:arguments[e];for(var r in o)Ft(o,r)&&(n[r]=t(n[r],o[r]))}return n}},Ho=Po(function(t,n){return m(t)&&m(n)?Ho(t,n):n}),Vo=Po(function(t,n){return n}),Uo=function(t){return{tag:"defaultedThunk",process:t}},Wo=function(t){return Uo(N(t))},jo=function(t){return{tag:"mergeWithThunk",process:t}},Go=function(t){return R(Mo,st)(t)},qo=function(t){var n=Ao(t);return n.errors.length>0?Go(n.errors):Do(n.values)},Yo=function(t){return d(t)&&St(t).length>100?" removed due to size":JSON.stringify(t,null,2)},Xo=function(t,n){return Mo([{path:t,getErrorInfo:n}])},Ko=function(t){return{extract:function(n,e){return Io(t(e),function(t){return function(t,n){return Xo(t,N(n))}(n,t)})},toString:N("val")}},Jo=Ko(Do),$o=function(t,n,e,o){return It(n,e).fold(function(){return function(t,n,e){return Xo(t,function(){return'Could not find valid *required* value for "'+n+'" in '+Yo(e)})}(t,e,n)},o)},Qo=function(t,n,e,o){return o(It(t,n).getOrThunk(function(){return e(t)}))},Zo=function(t,n,e,o,r){var i=function(t){return r.extract(n.concat([o]),t)},u=function(t){return t.fold(function(){return Do(G.none())},function(t){var e=r.extract(n.concat([o]),t);return Fo(e,G.some)})};switch(t.tag){case"required":return $o(n,e,o,i);case"defaultedThunk":return Qo(e,o,t.process,i);case"option":return function(t,n,e){return e(It(t,n))}(e,o,u);case"defaultedOptionThunk":return function(t,n,e,o){return o(It(t,n).map(function(n){return!0===n?e(t):n}))}(e,o,t.process,u);case"mergeWithThunk":return Qo(e,o,N({}),function(n){var o=Ho(t.process(e),n);return i(o)})}},tr=function(t){return{extract:function(n,e){return t().extract(n,e)},toString:function(){return t().toString()}}},nr=function(t){return St(Dt(t,O))},er=function(t){var n=or(t),e=it(t,function(t,n){return zo(n,function(n){return Ho(t,T({},n,!0))},N(t))},{});return{extract:function(t,o){var r=y(o)?[]:nr(o),i=rt(r,function(t){return!Rt(e,t)});return 0===i.length?n.extract(t,o):function(t,n){return Xo(t,function(){return"There are unsupported fields: ["+n.join(", ")+"] specified"})}(t,i)},toString:n.toString}},or=function(t){return{extract:function(n,e){return function(t,n,e){var o,r={},i=[],u=S(e);try{for(u.s();!(o=u.n()).done;){var a=o.value;zo(a,function(e,o,u,a){var c=Zo(u,t,n,e,a);No(c,function(t){i.push.apply(i,w(t))},function(t){r[o]=t})},function(t,e){r[t]=e(n)})}}catch(t){u.e(t)}finally{u.f()}return i.length>0?Mo(i):Do(r)}(n,e,t)},toString:function(){var n=nt(t,function(t){return zo(t,function(t,n,e,o){return t+" -> "+o.toString()},function(t,n){return"state("+t+")"})});return"obj{\n"+n.join("\n")+"}"}}},rr=function(t){return{extract:function(n,e){var o=nt(e,function(e,o){return t.extract(n.concat(["["+o+"]"]),e)});return qo(o)},toString:function(){return"array("+t.toString()+")"}}},ir=function(t,n){var e=void 0!==n?n:L;return{extract:function(n,o){var r,i=[],u=S(t);try{for(u.s();!(r=u.n()).done;){var a=r.value.extract(n,o);if(a.stype===q.Value)return{stype:q.Value,svalue:e(a.svalue)};i.push(a)}}catch(t){u.e(t)}finally{u.f()}return qo(i)},toString:function(){return"oneOf("+nt(t,function(t){return t.toString()}).join(", ")+")"}}},ur=function(t,n){return{extract:function(e,o){var r=St(o),i=function(n,e){return rr(Ko(t)).extract(n,e)}(e,r);return Bo(i,function(t){var r=nt(t,function(t){return Lo(t,t,{tag:"required",process:{}},n)});return or(r).extract(e,o)})},toString:function(){return"setOf("+n.toString()+")"}}},ar=R(rr,or),cr=N(Jo),sr=function(t,n){return Ko(function(e){var o=A(e);return t(e)?Do(e):Mo("Expected type: ".concat(n," but got: ").concat(o))})},lr=sr(M,"number"),fr=sr(f,"string"),dr=sr(y,"boolean"),mr=sr(D,"function"),gr=function(t){if(Object(t)!==t)return!0;switch({}.toString.call(t).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(t).every(function(n){return gr(t[n])});default:return!1}},pr=Ko(function(t){return gr(t)?Do(t):Mo("Expected value to be acceptable for sending via postMessage")}),hr=function(t,n,e,o){return It(e,o).fold(function(){return function(t,n,e){return Xo(t,function(){return'The chosen schema: "'+e+'" did not exist in branches: '+Yo(n)})}(t,e,o)},function(e){return e.extract(t.concat(["branch: "+o]),n)})},vr=function(t,n){return{extract:function(e,o){return It(o,t).fold(function(){return function(t,n){return Xo(t,function(){return'Choice schema did not contain choice key: "'+n+'"'})}(e,t)},function(t){return hr(e,o,n,t)})},toString:function(){return"chooseOn("+t+"). Possible values: "+St(n)}}},br=function(t){return Ko(function(n){return t(n).fold(Mo,Do)})},yr=function(t,n){return ur(function(n){return To(t(n))},n)},xr=function(t,n,e){return Eo(function(t,n,e){var o=n.extract([t],e);return Ro(o,function(t){return{input:e,errors:t}})}(t,n,e))},wr=function(t){return t.fold(function(t){throw new Error(Cr(t))},L)},Sr=function(t,n,e){return wr(xr(t,n,e))},Cr=function(t){return"Errors: \n"+(n=t.errors,e=n.length>10?n.slice(0,10).concat([{path:[],getErrorInfo:N("... (only showing first ten failures)")}]):n,nt(e,function(t){return"Failed path: ("+t.path.join(" > ")+")\n"+t.getErrorInfo()})).join("\n")+"\n\nInput object: "+Yo(t.input);var n,e},kr=function(t,n){return vr(t,Ot(n,or))},Or=function(t,n){return e=he(n),{extract:function(t,n){return e().extract(t,n)},toString:function(){return e().toString()}};var e},_r=Lo,Tr=function(t,n){return{tag:"custom",newKey:t,instantiator:n}},Er=function(t){return br(function(n){return $(t,n)?Co.value(n):Co.error('Unsupported value: "'.concat(n,'", choose one of "').concat(t.join(", "),'".'))})},Dr=function(t){return _r(t,t,{tag:"required",process:{}},cr())},Ar=function(t,n){return _r(t,t,{tag:"required",process:{}},n)},Mr=function(t){return Ar(t,fr)},Br=function(t,n){return _r(t,t,{tag:"required",process:{}},Er(n))},Ir=function(t){return Ar(t,mr)},Fr=function(t,n){return _r(t,t,{tag:"required",process:{}},or(n))},Rr=function(t,n){return _r(t,t,{tag:"required",process:{}},ar(n))},Nr=function(t,n){return _r(t,t,{tag:"required",process:{}},rr(n))},Lr=function(t){return _r(t,t,{tag:"option",process:{}},cr())},zr=function(t,n){return _r(t,t,{tag:"option",process:{}},n)},Pr=function(t){return zr(t,lr)},Hr=function(t){return zr(t,fr)},Vr=function(t,n){return zr(t,Er(n))},Ur=function(t){return zr(t,mr)},Wr=function(t,n){return zr(t,rr(n))},jr=function(t,n){return zr(t,or(n))},Gr=function(t,n){return _r(t,t,Wo(n),cr())},qr=function(t,n,e){return _r(t,t,Wo(n),e)},Yr=function(t,n){return qr(t,n,lr)},Xr=function(t,n){return qr(t,n,fr)},Kr=function(t,n,e){return qr(t,n,Er(e))},Jr=function(t,n){return qr(t,n,dr)},$r=function(t,n){return qr(t,n,mr)},Qr=function(t,n,e){return qr(t,n,rr(e))},Zr=function(t,n,e){return qr(t,n,or(e))},ti=function(t){if(!g(t))throw new Error("cases must be an array");if(0===t.length)throw new Error("there must be at least one case");var n=[],e={};return et(t,function(o,r){var i=St(o);if(1!==i.length)throw new Error("one and only one name per case");var u=i[0],a=o[u];if(void 0!==e[u])throw new Error("duplicate key detected:"+u);if("cata"===u)throw new Error("cannot have a case named cata (sorry
2)");if(!g(a))throw new Error("case arguments must be an array");n.push(u),e[u]=function(){for(var e=arguments.length,o=new Array(e),i=0;i<e;i++)o[i]=arguments[i];var c=o.length;if(c!==a.length)throw new Error("Wrong number of arguments to case "+u+". Expected "+a.length+" ("+a+"), got "+c);return{fold:function(){for(var n=arguments.length,e=new Array(n),i=0;i<n;i++)e[i]=arguments[i];if(e.length!==t.length)throw new Error("Wrong number of arguments to fold. Expected "+t.length+", got "+e.length);return e[r].apply(null,o)},match:function(t){var e=St(t);if(n.length!==e.length)throw new Error("Wrong number of arguments to match. Expected: "+n.join(",")+"\nActual: "+e.join(","));if(!ft(n,function(t){return $(e,t)}))throw new Error("Not all branches were specified when using match. Specified: "+e.join(", ")+"\nRequired: "+n.join(", "));return t[u].apply(null,o)},log:function(t){console.log(t,{constructors:n,constructor:u,params:o})}}}}),e};ti([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);var ni,ei=function(t,n){return function(t,n){var e={};return kt(t,function(t,o){$(n,o)||(e[o]=t)}),e}(t,n)},oi=function(t,n){return function(t,n){return T({},t,n)}(t,n)},ri=function(t){return function(t){var n={};return et(t,function(t){n[t.key]=t.value}),n}(t)},ii=function(t,n){var e,o=function(t){var n=[],e=[];return et(t,function(t){t.fold(function(t){n.push(t)},function(t){e.push(t)})}),{errors:n,values:e}}(t);return o.errors.length>0?(e=o.errors,Co.error(st(e))):function(t,n){return 0===t.length?Co.value(n):Co.value(Ho(n,Vo.apply(void 0,t)))}(o.values,n)},ui=function(t){return D(t)?t:W},ai=function(t,n,e){for(var o=t.dom,r=ui(e);o.parentNode;){o=o.parentNode;var i=$t.fromDom(o),u=n(i);if(u.isSome())return u;if(r(i))break}return G.none()},ci=function(t,n,e){var o=n(t),r=ui(e);return o.orThunk(function(){return r(t)?G.none():ai(t,n,r)})},si=function(t,n){return pn(t.element,n.event.target)},li={can:j,abort:W,run:I},fi=function(t){if(!Rt(t,"can")&&!Rt(t,"abort")&&!Rt(t,"run"))throw new Error("EventHandler defined by: "+JSON.stringify(t,null,2)+" does not have can, abort, or run!");return _(_({},li),t)},di=function(t){var n=function(t,n){return function(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return ut(t,function(t,e){return t&&n(e).apply(void 0,o)},!0)}}(t,function(t){return t.can}),e=function(t,n){return function(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return ut(t,function(t,e){return t||n(e).apply(void 0,o)},!1)}}(t,function(t){return t.abort});return{can:n,abort:e,run:function(){for(var n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];et(t,function(t){t.run.apply(void 0,e)})}}},mi=N,gi=mi("touchstart"),pi=mi("touchmove"),hi=mi("touchend"),vi=mi("touchcancel"),bi=mi("mousedown"),yi=mi("mousemove"),xi=mi("mouseout"),wi=mi("mouseup"),Si=mi("mouseover"),Ci=mi("focusin"),ki=mi("focusout"),Oi=mi("keydown"),_i=mi("keyup"),Ti=mi("input"),Ei=mi("change"),Di=mi("click"),Ai=mi("transitioncancel"),Mi=mi("transitionend"),Bi=mi("transitionstart"),Ii=mi("selectstart"),Fi=function(t){return N("alloy."+t)},Ri={tap:Fi("tap")},Ni=Fi("focus"),Li=Fi("blur.post"),zi=Fi("paste.post"),Pi=Fi("receive"),Hi=Fi("execute"),Vi=Fi("focus.item"),Ui=Ri.tap,Wi=Fi("longpress"),ji=Fi("sandbox.close"),Gi=Fi("typeahead.cancel"),qi=Fi("system.init"),Yi=Fi("system.touchmove"),Xi=Fi("system.touchend"),Ki=Fi("system.scroll"),Ji=Fi("system.resize"),$i=Fi("system.attached"),Qi=Fi("system.detached"),Zi=Fi("system.dismissRequested"),tu=Fi("system.repositionRequested"),nu=Fi("focusmanager.shifted"),eu=Fi("slotcontainer.visibility"),ou=Fi("system.external.element.scroll"),ru=Fi("change.tab"),iu=Fi("dismiss.tab"),uu=Fi("highlight"),au=Fi("dehighlight"),cu=function(t,n){du(t,t.element,n,{})},su=function(t,n,e){du(t,t.element,n,e)},lu=function(t){cu(t,Hi())},fu=function(t,n,e){du(t,n,e,{})},du=function(t,n,e,o){var r=_({target:n},o);t.getSystem().triggerEvent(e,n,r)},mu=function(t,n,e,o){t.getSystem().triggerEvent(e,n,o.event)},gu=function(t){return ri(t)},pu=function(t,n){return{key:t,value:fi({abort:n})}},hu=function(t){return{key:t,value:fi({run:function(t,n){n.event.prevent()}})}},vu=function(t,n){return{key:t,value:fi({run:n})}},bu=function(t,n,e){return{key:t,value:fi({run:function(t,o){n.apply(void 0,[t,o].concat(e))}})}},yu=function(t){return function(n){return{key:t,value:fi({run:function(t,e){si(t,e)&&n(t,e)}})}}},xu=function(t,n,e){return function(t,n){return vu(t,function(e,o){e.getSystem().getByUid(n).each(function(n){mu(n,n.element,t,o)})})}(t,n.partUids[e])},wu=function(t,n){return vu(t,function(t,e){var o=e.event,r=t.getSystem().getByDom(o.target).getOrThunk(function(){return ci(o.target,function(n){return t.getSystem().getByDom(n).toOptional()},W).getOr(t)});n(t,r,e)})},Su=function(t){return vu(t,function(t,n){n.cut()})},Cu=function(t){return vu(t,function(t,n){n.stop()})},ku=function(t,n){return yu(t)(n)},Ou=yu($i()),_u=yu(Qi()),Tu=yu(qi()),Eu=function(t){return function(n){return vu(t,n)}}(Hi()),Du=function(t){return nt(t,function(t){return Gt(t,"/*")?t.substring(0,t.length-2):t})},Au=function(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:Du(i)}},t},Mu=function(t){return{classes:C(t.classes)?[]:t.classes,attributes:C(t.attributes)?{}:t.attributes,styles:C(t.styles)?{}:t.styles}},Bu=function(t,n,e){return Tu(function(o,r){e(o,t,n)})},Iu=function(t,n,e){return function(t,n,e){var o=e.toString(),r=o.indexOf(")")+1,i=o.indexOf("("),u=o.substring(i+1,r-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:Du(u.slice(0,1).concat(u.slice(3)))}},t}(function(o){for(var r=arguments.length,i=new Array(r>1?r-1:0),u=1;u<r;
2u++)i[u-1]=arguments[u];var a=[o].concat(i);return o.config({name:N(t)}).fold(function(){throw new Error("We could not find any behaviour configuration for: "+t+". Using API: "+e)},function(t){var e=Array.prototype.slice.call(a,1);return n.apply(void 0,[o,t.config,t.state].concat(e))})},e,n)},Fu=function(t){return{key:t,value:void 0}},Ru=function(t,n,e,o,r,i,u){var a=function(t){return Rt(t,e)?t[e]():G.none()},c=Ot(r,function(t,n){return Iu(e,t,n)}),s=_(_(_({},Ot(i,function(t,n){return Au(t,n)})),c),{},{revoke:P(Fu,e),config:function(n){var o=Sr(e+"-config",t,n);return{key:e,value:{config:o,me:s,configAsRaw:he(function(){return Sr(e+"-config",t,n)}),initialConfig:n,state:u}}},schema:N(n),exhibit:function(t,n){return zt(a(t),It(o,"exhibit"),function(t,e){return e(n,t.config,t.state)}).getOrThunk(function(){return Mu({})})},name:N(e),handlers:function(t){return a(t).map(function(t){return It(o,"events").getOr(function(){return{}})(t.config,t.state)}).getOr({})}});return s},Nu={init:function(){return Lu({readState:N("No State required")})}},Lu=function(t){return t},zu=function(t){return ri(t)},Pu=er([Dr("fields"),Dr("name"),Gr("active",{}),Gr("apis",{}),Gr("state",Nu),Gr("extra",{})]),Hu=function(t){var n=Sr("Creating behaviour: "+t.name,Pu,t);return function(t,n,e,o,r,i){var u,a,c=er(t),s=jr(n,[(u="config",a=t,zr(u,er(a)))]);return Ru(c,s,n,e,o,r,i)}(n.fields,n.name,n.active,n.apis,n.extra,n.state)},Vu=er([Dr("branchKey"),Dr("branches"),Dr("name"),Gr("active",{}),Gr("apis",{}),Gr("state",Nu),Gr("extra",{})]),Uu=function(t){var n=Sr("Creating behaviour: "+t.name,Vu,t);return function(t,n,e,o,r,i){var u=t,a=jr(n,[zr("config",t)]);return Ru(u,a,n,e,o,r,i)}(kr(n.branchKey,n.branches),n.name,n.active,n.apis,n.extra,n.state)},Wu=N(void 0),ju=function(t,n){var e=Un(t,n);return void 0===e||""===e?[]:e.split(" ")},Gu=function(t){return void 0!==t.dom.classList},qu=function(t){return ju(t,"class")},Yu=function(t,n){return function(t,n,e){var o=ju(t,n).concat([e]);return Hn(t,n,o.join(" ")),!0}(t,"class",n)},Xu=function(t,n){return function(t,n,e){var o=rt(ju(t,n),function(t){return t!==e});return o.length>0?Hn(t,n,o.join(" ")):Gn(t,n),!1}(t,"class",n)},Ku=function(t,n){Gu(t)?t.dom.classList.add(n):Yu(t,n)},Ju=function(t){0===(Gu(t)?t.dom.classList:qu(t)).length&&Gn(t,"class")},$u=function(t,n){Gu(t)?t.dom.classList.remove(n):Xu(t,n);Ju(t)},Qu=function(t,n){var e=Gu(t)?t.dom.classList.toggle(n):function(t,n){return $(qu(t),n)?Xu(t,n):Yu(t,n)}(t,n);return Ju(t),e},Zu=function(t,n){return Gu(t)&&t.dom.classList.contains(n)},ta=function(t,n){et(n,function(n){Ku(t,n)})},na=function(t,n){et(n,function(n){$u(t,n)})},ea=function(t){return Gu(t)?function(t){for(var n=t.dom.classList,e=new Array(n.length),o=0;o<n.length;o++){var r=n.item(o);null!==r&&(e[o]=r)}return e}(t):qu(t)},oa=function(t,n,e,o,r){var i=function(t){return t+"px"};return{position:t,left:n.map(i),top:e.map(i),right:o.map(i),bottom:r.map(i)}},ra=function(t,n){Jn(t,function(t){return _(_({},t),{},{position:G.some(t.position)})}(n))},ia=function(t){return(Nt(Zn(t,"position"),"fixed")?G.none():Cn(t)).orThunk(function(){var n=$t.fromTag("span");return wn(t).bind(function(t){Qe(t,n);var e=Cn(n);return no(n),e})})},ua=function(t){return ia(t).map(fe).getOrThunk(function(){return se(0,0)})},aa=function(t,n){var e=t.element;Ku(e,n.transitionClass),$u(e,n.fadeOutClass),Ku(e,n.fadeInClass),n.onShow(t)},ca=function(t,n){var e=t.element;Ku(e,n.transitionClass),$u(e,n.fadeInClass),Ku(e,n.fadeOutClass),n.onHide(t)},sa=function(t,n){return t.y>=n.y},la=function(t,n){return t.bottom<=n.bottom},fa=function(t,n,e){return{location:"top",leftX:n,topY:e.bounds.y-t.y}},da=function(t,n,e){return{location:"bottom",leftX:n,bottomY:t.bottom-e.bounds.bottom}},ma=function(t){return t.box.x-t.win.x},ga=function(t,n,e){return e.getInitialPos().map(function(e){var o=function(t,n){var e=n.optScrollEnv.fold(N(t.bounds.y),function(n){return n.scrollElmTop+(t.bounds.y-n.currentScrollTop)});return se(t.bounds.x,e)}(e,n);return{box:lo(o.left,o.top,ge(t),ue(t)),location:e.location}})},pa=function(t,n,e,o,r){var i=function(t,n){var e=n.optScrollEnv.fold(N(t.y),function(n){return t.y+n.currentScrollTop-n.scrollElmTop});return se(t.x,e)}(n,e),u=lo(i.left,i.top,n.width,n.height);o.setInitialPos({style:te(t),position:$n(t,"position")||"static",boun
2ds:u,location:r.location})},ha=function(t,n,e){return e.getInitialPos().bind(function(o){var r;switch(e.clearInitialPos(),o.position){case"static":return G.some({morph:"static"});case"absolute":var i=ia(t).getOr(Ln()),u=fo(i),a=null!==(r=i.dom.scrollTop)&&void 0!==r?r:0;return G.some({morph:"absolute",positionCss:oa("absolute",It(o.style,"left").map(function(t){return n.x-u.x}),It(o.style,"top").map(function(t){return n.y-u.y+a}),It(o.style,"right").map(function(t){return u.right-n.right}),It(o.style,"bottom").map(function(t){return u.bottom-n.bottom}))});default:return G.none()}})},va=function(t,n,e){return ga(t,n,e).filter(function(t){var o=t.box;return function(t,n,e){return ft(t,function(t){switch(t){case"bottom":return la(n,e.bounds);case"top":return sa(n,e.bounds)}})}(e.getModes(),o,n)}).bind(function(n){var o=n.box;return ha(t,o,e)})},ba=function(t){switch(t.location){case"top":return G.some({morph:"fixed",positionCss:oa("fixed",G.some(t.leftX),G.some(t.topY),G.none(),G.none())});case"bottom":return G.some({morph:"fixed",positionCss:oa("fixed",G.some(t.leftX),G.none(),G.none(),G.some(t.bottomY))});default:return G.none()}},ya=function(t,n,e){var o=fo(t),r=po(),i=function(t,n,e){var o=n.win,r=n.box,i=ma(n);return wt(t,function(t){switch(t){case"bottom":return la(r,e.bounds)?G.none():G.some(da(o,i,e));case"top":return sa(r,e.bounds)?G.none():G.some(fa(o,i,e));default:return G.none()}}).getOr({location:"no-dock"})}(e.getModes(),{win:r,box:o},n);return"top"===i.location||"bottom"===i.location?(pa(t,o,n,e,i),ba(i)):G.none()},xa=function(t,n,e){var o=t.element;return Nt(Zn(o,"position"),"fixed")?function(t,n,e){return va(t,n,e).orThunk(function(){return n.optScrollEnv.bind(function(o){return ga(t,n,e)}).bind(function(t){var e=t.box,o=t.location,r=po(),i=ma({win:r,box:e}),u="top"===o?fa(r,i,n):da(r,i,n);return ba(u)})})}(o,n,e):ya(o,n,e)},wa=function(t,n,e,o){var r=fo(t),i=po(),u=o(i,ma({win:i,box:r}),n);return"bottom"===u.location||"top"===u.location?(function(t,n,e,o,r){o.getInitialPos().fold(function(){return pa(t,n,e,o,r)},function(){return I})}(t,r,n,e,u),ba(u)):G.none()},Sa=function(t,n,e){e.setDocked(!1),et(["left","right","top","bottom","position"],function(n){return ee(t.element,n)}),n.onUndocked(t)}
2,Ca=function(t,n,e,o){var r="fixed"===o.position;e.setDocked(r),ra(t.element,o),(r?n.onDocked:n.onUndocked)(t)},ka=function(t,n,e,o){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];n.contextual.each(function(n){n.lazyContext(t).each(function(i){var u=function(t,n){return t.y<n.bottom&&t.bottom>n.y}(i,o.bounds);u!==e.isVisible()&&(e.setVisible(u),r&&!u?(ta(t.element,[n.fadeOutClass]),n.onHide(t)):(u?aa:ca)(t,n))})})},Oa=function(t,n,e,o,r){ka(t,n,e,o,!0),Ca(t,n,e,r.positionCss)},_a=function(t,n,e){var o=n.lazyViewport(t);ka(t,n,e,o),xa(t,o,e).each(function(r){!function(t,n,e,o,r){switch(r.morph){case"static":return Sa(t,n,e);case"absolute":return Ca(t,n,e,r.positionCss);case"fixed":Oa(t,n,e,o,r)}}(t,n,e,o,r)})},Ta=function(t,n,e){var o=t.element;e.setDocked(!1);var r=n.lazyViewport(t);(function(t,n,e){var o=t.element;return ga(o,n,e).bind(function(t){var n=t.box;return ha(o,n,e)})})(t,r,e).each(function(o){switch(o.morph){case"static":Sa(t,n,e);break;case"absolute":Ca(t,n,e,o.positionCss)}}),e.setVisible(!0),n.contextual.each(function(n){na(o,[n.fadeInClass,n.fadeOutClass,n.transitionClass]),n.onShow(t)}),Ea(t,n,e)},Ea=function(t,n,e){t.getSystem().isConnected()&&_a(t,n,e)},Da=function(t,n,e){e.isDocked()&&Ta(t,n,e)},Aa=function(t){return function(n,e,o){var r=e.lazyViewport(n);wa(n.element,r,o,t).each(function(t){Oa(n,e,o,r,t)})}},Ma=Aa(fa),Ba=Aa(da),Ia=Object.freeze({__proto__:null,refresh:Ea,reset:Da,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)},forceDockToTop:Ma,forceDockToBottom:Ba}),Fa=Object.freeze({__proto__:null,events:function(t,n){return gu([ku(Mi(),function(e,o){t.contextual.each(function(t){Zu(e.element,t.transitionClass)&&(na(e.element,[t.transitionClass,t.fadeInClass]),(n.isVisible()?t.onShown:t.onHidden)(e));o.stop()})}),vu(Ki(),function(e,o){Ea(e,t,n)}),vu(ou(),function(e,o){Ea(e,t,n)}),vu(Ji(),function(e,o){Da(e,t,n)})])}}),Ra=function(t){return t.dom.innerHTML},Na=function(t,n){var e=vn(t).dom,o=$t.fromDom(e.createDocumentFragment()),r=function(t,n){var e=(n||document).createElement("div");return e.innerHTML=t,kn($t.fromDom(e))}(n,e);Ze(o,r),to(t),Qe(t,o)},La=function(t,n){return $t.fromDom(t.dom.cloneNode(n))},za=function(t){if(Dn(t))return"#shadow-root";var n=function(t){return La(t,!1)}(t);return function(t){var n=$t.fromTag("div"),e=$t.fromDom(t.dom.cloneNode(!0));return Qe(n,e),Ra(n)}(n)},Pa=function(t){return za(t)},Ha="unknown";!function(t){t[t.STOP=0]="STOP",t[t.NORMAL=1]="NORMAL",t[t.LOGGING=2]="LOGGING"}(ni||(ni={}));var Va=ho({}),Ua=function(t,n,e){switch(It(Va.get(),t).orThunk(function(){var n=St(Va.get());return wt(n,function(n){return t.indexOf(n)>-1?G.some(Va.get()[n]):G.none()})}).getOr(ni.NORMAL)){case ni.NORMAL:return e(Ga());case ni.LOGGING:var o=function(t,n){var e=[],o=(new Date).getTime();return{logEventCut:function(t,n,o){e.push({outcome:"cut",target:n,purpose:o})},logEventStopped:function(t,n,o){e.push({outcome:"stopped",target:n,purpose:o})},logNoParent:function(t,n,o){e.push({outcome:"no-parent",target:n,purpose:o})},logEventNoHandlers:function(t,n){e.push({outcome:"no-handlers-left",target:n})},logEventResponse:function(t,n,o){e.push({outcome:"response",purpose:o,target:n})},write:function(){var r=(new Date).getTime();$(["mousemove","mouseover","mouseout",qi()],t)||console.log(t,{event:t,time:r-o,target:n.dom,sequence:nt(e,function(t){return $(["cut","stopped","response"],t.outcome)?"{"+t.purpose+"} "+t.outcome+" at ("+Pa(t.target)+")":t.outcome})})}}}(t,n),r=e(o);return o.write(),r;case ni.STOP:return!0}},Wa=["alloy/data/Fields","alloy/debugging/Debugging"],ja=function(t,n,e){return Ua(t,n,e)},Ga=N({logEventCut:I,logEventStopped:I,logNoParent:I,logEventNoHandlers:I,logEventResponse:I,write:I}),qa=N([Dr("menu"),Dr("selectedMenu")]),Ya=N([Dr("item"),Dr("selectedItem")]);N(or(Ya().concat(qa())));var Xa=N(or(Ya())),Ka=Fr("initSize",[Dr("numColumns"),Dr("numRows")]),Ja=function(){return Fr("markers",[Dr("backgroundMenu")].concat(qa()).concat(Ya()))},$a=function(t){return Fr("markers",nt(t,Dr))},Qa=function(t,n,e){return function(){var t=new Error;if(void 0!==t.stack){var n=t.stack.split("\n");return at(n,function(t){return t.indexOf("alloy")>0&&!Q(Wa,function(n){return t.indexOf(n)>-1})}).getOr(Ha)}}(),_r(n,n,e,br(function(t){return Co.value(function(){for(var n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];return t.apply(void 0,e)})}))},Za=function(t){return Qa(0,t,Wo(I))},tc=function(t){return Qa(0,t,Wo(G.none))},nc=function(t){return Qa(0,t,{tag:"required",process:{}})},ec=function(t){return Qa(0,t,{tag:"required",process:{}})},oc=function(t,n){return Tr(t,N(n))},rc=function(t){return Tr(t,L)},ic=N(Ka),uc=[jr("contextual",[Mr("fadeInClass"),Mr("fadeOutClass"),Mr("transitionClass"),Ir("lazyContext"),Za("onShow"),Za("onShown"),Za("onHide"),Za("onHidden")]),$r("lazyViewport",function(){return{bounds:po(),optScrollEnv:G.none()}}),Qr("modes",["top","bottom"],fr),Za("onDocked"),Za("onUndocked")],ac=Hu({fields:uc,name:"docking",active:Fa,apis:Ia,state:Object.freeze({__proto__:null,init:function(t){var n=ho(!1),e=ho(!0),o=yo(),r=ho(t.modes);return Lu({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:  ".concat(n.get(),", visible: ").concat(e.get(),", modes: ").concat(r.get().join(","))}})}})}),cc=gu([function(t,n){return{key:t,value:fi({can:n})}}(Ni(),function(t,n){var e=n.event,o=e.originator,r=e.target;return!function(t,n,e){return pn(n,t.element)&&!pn(n,e)}
2(t,o,r)||(console.warn(Ni()+" did not get interpreted by the desired target. \nOriginator: "+Pa(o)+"\nTarget: "+Pa(r)+"\nCheck the "+Ni()+" event handlers"),!1)})]),sc=Object.freeze({__proto__:null,events:cc}),lc=function(t,n,e,o){var r=t+n;return r>o?e:r<e?o:r},fc=function(t,n,e){return Math.min(Math.max(t,n),e)},dc=0,mc=function(t){var n=(new Date).getTime();return t+"_"+Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967295*1e9)+ ++dc+String(n)},gc=N("alloy-id-"),pc=N("data-alloy-id"),hc=gc(),vc=pc(),bc=function(t,n){Object.defineProperty(t.dom,vc,{value:n,writable:!0})},yc=function(t){var n=an(t)?t.dom[vc]:null;return G.from(n)},xc=function(t){return mc(t)},wc=L,Sc=function(t){var n=function(n){return"The component must be in a context to execute: ".concat(n)+(t?"\n"+Pa(t().element)+" is not in context.":"")},e=function(t){return function(){throw new Error(n(t))}},o=function(t){return function(){console.warn(n(t))}};return{debugInfo:N("fake"),triggerEvent:o("triggerEvent"),triggerFocus:o("triggerFocus"),triggerEscape:o("triggerEscape"),broadcast:o("broadcast"),broadcastOn:o("broadcastOn"),broadcastEvent:o("broadcastEvent"),build:e("build"),buildOrPatch:e("buildOrPatch"),addToWorld:e("addToWorld"),removeFromWorld:e("removeFromWorld"),addToGui:e("addToGui"),removeFromGui:e("removeFromGui"),getByUid:e("getByUid"),getByDom:e("getByDom"),isConnected:W}},Cc=Sc(),kc=mc("alloy-premade"),Oc=function(t){return Object.defineProperty(t.element.dom,kc,{value:t.uid,writable:!0}),oi(kc,t)},_c=function(t){return It(t,kc)},Tc=function(t){return function(t,n){var e=n.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:"OVERRIDE",parameters:Du(i.slice(1))}},t}(function(n){for(var e=arguments.length,o=new Array(e>1?e-1:0),r=1;r<e;r++)o[r-1]=arguments[r];return t.apply(void 0,[n.getApis(),n].concat(o))},t)},Ec=function(t,n){var e={};return kt(t,function(t,o){kt(t,function(t,r){var i=It(e,r).getOr([]);e[r]=i.concat([n(o,t)])})}),e},Dc=function(t){return t.cHandler},Ac=function(t,n){return{name:t,handler:n}},Mc=function(t,n,e){var o=_(_({},e),function(t,n){var e={};return et(t,function(t){e[t.name()]=t.handlers(n)}),e}(n,t));return Ec(o,Ac)},Bc=function(t){var n=function(t){return D(t)?{can:j,abort:W,run:t}:t}(t);return function(t,e){for(var o=arguments.length,r=new Array(o>2?o-2:0),i=2;i<o;i++)r[i-2]=arguments[i];var u=[t,e].concat(r);n.abort.apply(void 0,u)?e.stop():n.can.apply(void 0,u)&&n.run.apply(void 0,u)}},Ic=function(t,n,e){var o=n[e];return o?function(t,n,e,o){try{var r=ht(e,function(e,r){var i=e[n],u=r[n],a=o.indexOf(i),c=o.indexOf(u);if(-1===a)throw new Error("The ordering for "+t+" does not have an entry for "+i+".\nOrder specified: "+JSON.stringify(o,null,2));if(-1===c)throw new Error("The ordering for "+t+" does not have an entry for "+u+".\nOrder specified: "+JSON.stringify(o,null,2));return a<c?-1:c<a?1:0});return Co.value(r)}catch(t){return Co.error([t])}}("Event: "+e,"name",t,o).map(function(t){var n=nt(t,function(t){return t.handler});return di(n)}):function(t,n){return Co.error(["The event ("+t+') 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(nt(n,function(t){return t.name}),null,2)])}(e,t)},Fc=function(t,n){var e=At(t,function(t,e){return(1===t.length?Co.value(t[0].handler):Ic(t,n,e)).map(function(o){var r=Bc(o),i=t.length>1?rt(n[e],function(n){return Q(t,function(t){return t.name===n})}).join(" > "):t[0].name;return oi(e,function(t,n){return{handler:t,purpose:n}}(r,i))})});return ii(e,{})},Rc="alloy.base.behaviour",Nc=or([_r("dom","dom",{tag:"required",process:{}},or([Dr("tag"),Gr("styles",{}),Gr("classes",[]),Gr("attributes",{}),Lr("value"),Lr("innerHtml")])),Dr("components"),Dr("uid"),Gr("events",{}),Gr("apis",{}),_r("eventOrder","eventOrder",function(t){return jo(N(t))}(T(T(T(T(T(T(T(T(T({},Hi(),["disabling",Rc,"toggling","typeaheadevents"]),Ni(),[Rc,"focu
2sing","keying"]),qi(),[Rc,"disabling","toggling","representing","tooltipping"]),Ti(),[Rc,"representing","streaming","invalidating"]),Qi(),[Rc,"representing","item-events","toolbar-button-events","tooltipping"]),bi(),["focusing",Rc,"item-type-events"]),gi(),["focusing",Rc,"item-type-events"]),Si(),["item-type-events","tooltipping"]),Pi(),["receiving","reflecting","tooltipping"])),cr()),Lr("domModification")]),Lc=function(t){return t.events},zc=function(t){return t.dom.value},Pc=function(t,n){if(void 0===n)throw new Error("Value.set was undefined");t.dom.value=n},Hc=function(t,n,e){e.fold(function(){return Qe(t,n)},function(t){pn(t,n)||(Ke(t,n),no(t))})},Vc=function(t,n,e){var o=nt(n,e),r=kn(t);return et(r.slice(o.length),no),o},Uc=function(t,n,e,o){var r=On(t,n),i=o(e,r),u=function(t,n,e){return On(t,n).map(function(t){if(e.exists(function(n){return!pn(n,t)})){var n=e.map(on).getOr("span"),o=$t.fromTag(n);return Ke(t,o),o}return t})}(t,n,r);return Hc(t,i.element,u),i},Wc=function(t,n){var e=St(t),o=St(n),r=mt(o,e),i=function(t,n){var e={},o={};return Et(t,n,Tt(e),Tt(o)),{t:e,f:o}}(t,function(t,e){return!Ft(n,e)||t!==n[e]}).t;return{toRemove:r,toSet:i}},jc=function(n,e){var o=function(t){return ut(t.dom.attributes,function(t,n){return t[n.name]=n.value,t},{})}(e),r=(o.class,o.style,x(o,t)),i=Wc(n.attributes,r),u=i.toSet,a=i.toRemove,c=te(e),s=Wc(n.styles,c),l=s.toSet,f=s.toRemove,d=ea(e),m=mt(d,n.classes),g=mt(n.classes,d);return et(a,function(t){return Gn(e,t)}),Vn(e,u),ta(e,g),na(e,m),et(f,function(t){return ee(e,t)}),Kn(e,l),n.innerHtml.fold(function(){var t=n.domChildren;!function(t,n){Vc(t,n,function(n,e){var o=On(t,e);return Hc(t,n,o),n})}(e,t)},function(t){Na(e,t)}),function(){var t=e,o=n.value.getOrUndefined();o!==zc(t)&&Pc(t,null!=o?o:"")}(),e},Gc=function(t,n){var e=n.filter(function(n){return on(n)===t.tag&&!function(t){return t.innerHtml.isSome()&&t.domChildren.length>0}(t)&&!function(t){return Ft(t.dom,kc)}(n)}).bind(function(n){return function(t,n){try{var e=jc(t,n);return G.some(e)}catch(t){return G.none()}}(t,n)}).getOrThunk(function(){return function(t){var n=$t.fromTag(t.tag);Vn(n,t.attributes),ta(n,t.classes),Kn(n,t.styles),t.innerHtml.each(function(t){return Na(n,t)});var e=t.domChildren;return Ze(n,e),t.value.each(function(t){Pc(n,t)}),n}(t)});return bc(e,t.uid),e},qc=function(t,n){return function(t,n){var e=nt(n,function(t){return jr(t.name(),[Dr("config"),Gr("state",Nu)])}),o=xr("component.behaviours",or(e),t.behaviours).fold(function(n){throw new Error(Cr(n)+"\nComplete spec:\n"+JSON.stringify(t,null,2))},L);return{list:n,data:Ot(o,function(t){var n=t.map(function(t){return{config:t.config,state:t.state.init(t.config)}});return N(n)})}}(t,n)},Yc=function(t){var n=function(t){var n=It(t,"behaviours").getOr({});return lt(St(n),function(t){var e=n[t];return O(e)?[e.me]:[]})}(t);return qc(t,n)},Xc=function(t,n,e){var o,r,i,u=_(_({},(o=t).dom),{},{uid:o.uid,domChildren:nt(o.components,function(t){return t.element})}),a=function(t){return t.domModification.fold(function(){return Mu({})},Mu)}(t),c={"alloy.base.modification":a},s=n.length>0?function(t,n,e,o){var r=_({},n);et(e,function(n){r[n.name()]=n.exhibit(t,o)});var i=Ec(r,function(t,n){return{name:t,modification:n}}),u=function(t){return it(t,function(t,n){return _(_({},n.modification),t)},{})},a=it(i.classes,function(t,n){return n.modification.concat(t)},[]),c=u(i.attributes),s=u(i.styles);return Mu({classes:a,attributes:c,styles:s})}(e,c,n,u):a;return i=s,_(_({},r=u),{},{attributes:_(_({},r.attributes),i.attributes),styles:_(_({},r.styles),i.styles),classes:r.classes.concat(i.classes)})},Kc=function(t,n,e){var o={"alloy.base.behaviour":Lc(t)};return function(t,n,e,o){var r=Mc(t,e,o);return Fc(r,n)}(e,t.eventOrder,n,o).getOrDie()},Jc=function(t,n){var e=function(){return d},o=ho(Cc),r=wr(function(t){return xr("custom.definition",Nc,t)}(t)),i=Yc(t),u=function(t){return t.list}(i),a=function(t){return t.data}(i),c=Xc(r,u,a),s=Gc(c,n),l=Kc(r,u,a),f=ho(r.components),d={uid:t.uid,getSystem:o.get,config:function(n){var e=a;return(D(e[n.name()])?e[n.name()]:function(){throw new Error("Could not find "+n.name()+" in "+JSON.stringify(t,null,2))})()},hasConfigured:function(t){return D(a[t.name()])},spec:t,readState:function(t){return a[t]().map(function(t){return t.state.readState()}).getOr("not enabled")},getApis:function(){return r.apis},connect:function(t){o.set(t)},disconnect:function(){o.set(Sc(e))},element:s,syncComponents:function(){var t=kn(s),n=lt(t,function(t){return o.get().getByDom(t).fold(function(){return[]},pt)});f.set(n)},components:f.get,events:l};return d},$c=function(t,e){var o=wc(t),r=o.events,i=x(o,n),u=function(t,n){var e=It(t,"components").getOr([]);return n.fold(function(){return nt(e,es)},function(t){return nt(e,function(n,e){return ns(n,On(t,e))})})}(i,e),a=_(_({},i),{},{events:_(_({},sc),r),components:u});return Co.value(Jc(a,e))},Qc=function(t){var n=$t.fromText(t);return Zc({element:n})},Zc=function(t){var n=Sr("external.component",er([Dr("element"),Lr("uid")]),t),e=ho(Sc()),o=n.uid.getOrThunk(function(){return xc("external")});bc(n.element,o);var r={uid:o,getSystem:e.get,config:G.none,hasConfigured:W,connect:function(t){e.set(t)},disconnect:function(){e.set(Sc(function(){return r}))},getApis:function(){return{}},element:n.element,spec:t,readState:N("No state"),syncComponents:I,components:N([]),events:{}};return Oc(r)},ts=xc,ns=function(t,n){return _c(t).getOrThunk(function(){var e=function(t){return Ft(t,"uid")}(t)?t:_({uid:ts("")},t);
2return $c(e,n).getOrDie()})},es=function(t){return ns(t,G.none())},os=Oc,rs=function(t,n,e,o,r){return t(e,o)?G.some(e):D(r)&&r(e)?G.none():n(e,o,r)},is=function(t,n,e){for(var o=t.dom,r=D(e)?e:W;o.parentNode;){o=o.parentNode;var i=$t.fromDom(o);if(n(i))return G.some(i);if(r(i))break}return G.none()},us=function(t,n,e){return rs(function(t,n){return n(t)},is,t,n,e)},as=function(t,n){return at(t.dom.childNodes,function(t){return n($t.fromDom(t))}).map($t.fromDom)},cs=function(t,n,e){return us(t,n,e).isSome()},ss=function(t,n,e){return is(t,function(t){return dn(t,n)},e)},ls=function(t,n){return function(t,n){var e=t.dom;return e.parentNode?as($t.fromDom(e.parentNode),function(e){return!pn(t,e)&&n(e)}):G.none()}(t,function(t){return dn(t,n)})},fs=function(t,n){return as(t,function(t){return dn(t,n)})},ds=function(t,n){return gn(n,t)},ms=function(t,n,e){return rs(function(t,n){return dn(t,n)},ss,t,n,e)},gs="aria-controls",ps=function(){var t=mc(gs);return{id:t,link:function(n){Hn(n,gs,t)},unlink:function(t){Gn(t,gs)}}},hs=function(t,n){return function(t){return us(t,function(t){if(!an(t))return!1;var n=Un(t,"id");return void 0!==n&&n.indexOf(gs)>-1}).bind(function(t){var n=Un(t,"id"),e=An(t);return ds(e,"[".concat(gs,'="').concat(n,'"]'))})}(n).exists(function(n){return vs(t,n)})},vs=function(t,n){return cs(n,function(n){return pn(n,t.element)},W)||hs(t,n)},bs=function(t,n,e,o,r,i,u){var a=arguments.length>7&&void 0!==arguments[7]&&arguments[7];return{x:t,y:n,bubble:e,direction:o,placement:r,restriction:i,label:"".concat(u,"-").concat(r),alwaysFit:a}},ys=ti([{southeast:[]},{southwest:[]},{northeast:[]},{northwest:[]},{south:[]},{north:[]},{east:[]},{west:[]}]),xs=ys.southeast,ws=ys.southwest,Ss=ys.northeast,Cs=ys.northwest,ks=ys.south,Os=ys.north,_s=ys.east,Ts=ys.west,Es=function(t,n){return gt(["left","right","top","bottom"],function(e){return It(n,e).map(function(n){return function(t,n){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}}(t,n)})})},Ds="layout",As=function(t){return t.x},Ms=function(t,n){return t.x+t.width/2-n.width/2},Bs=function(t,n){return t.x+t.width-n.width},Is=function(t,n){return t.y-n.height},Fs=function(t){return t.y+t.height},Rs=function(t,n){return t.y+t.height/2-n.height/2},Ns=function(t,n,e){return bs(As(t),Fs(t),e.southeast(),xs(),"southeast",Es(t,{left:1,top:3}),Ds)},Ls=function(t,n,e){return bs(Bs(t,n),Fs(t),e.southwest(),ws(),"southwest",Es(t,{right:0,top:3}),Ds)},zs=function(t,n,e){return bs(As(t),Is(t,n),e.northeast(),Ss(),"northeast",Es(t,{left:1,bottom:2}),Ds)},Ps=function(t,n,e){return bs(Bs(t,n),Is(t,n),e.northwest(),Cs(),"northwest",Es(t,{right:0,bottom:2}),Ds)},Hs=function(t,n,e){return bs(Ms(t,n),Is(t,n),e.north(),Os(),"north",Es(t,{bottom:2}),Ds)},Vs=function(t,n,e){return bs(Ms(t,n),Fs(t),e.south(),ks(),"south",Es(t,{top:3}),Ds)},Us=function(t,n,e){return bs(function(t){return t.x+t.width}(t),Rs(t,n),e.east(),_s(),"east",Es(t,{left:0}),Ds)},Ws=function(t,n,e){return bs(function(t,n){return t.x-n.width}(t,n),Rs(t,n),e.west(),Ts(),"west",Es(t,{right:1}),Ds)},js=function(){return[Ns,Ls,zs,Ps,Vs,Hs,Us,Ws]},Gs=function(){return[Ls,Ns,Ps,zs,Vs,Hs,Us,Ws]},qs=function(){return[zs,Ps,Ns,Ls,Hs,Vs]},Ys=function(){return[Ps,zs,Ls,Ns,Hs,Vs]},Xs=function(){return[Ns,Ls,zs,Ps,Vs,Hs]},Ks=function(){return[Ls,Ns,Ps,zs,Vs,Hs]},Js=Object.freeze({__proto__:null,events:function(t){return gu([vu(Pi(),function(n,e){var o=t.channels,r=St(o),i=e,u=function(t,n){return n.universal?t:rt(t,function(t){return $(n.channels,t)})}(r,i);et(u,function(t){var e=o[t],r=e.schema,u=Sr("channel["+t+"] data\nReceiver: "+Pa(n.element),r,i.data);e.onReceive(n,u)})})])}}),$s=[Ar("channels",yr(Co.value,er([nc("onReceive"),Gr("schema",cr())])))],Qs=Hu({fields:$s,name:"receiving",active:Js}),Zs=Object.freeze({__proto__:null,exhibit:function(t,n){return Mu({classes:[],styles:n.useFixed()?{}:{position:"relative"}})}}),tl=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t.dom.focus({preventScroll:n})},nl=function(t){return t.dom.blur()},el=function(t){var n=An(t).dom;return t.dom===n.activeElement},ol=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:uo();return G.from(t.dom.activeElement).map($t.fromDom)},rl=function(t){return ol(An(t)).filter(function(n){return t.dom.contains(n.dom)})},il=function(t,n){var e=An(n),o=ol(e).bind(function(t){var e,o,r=function(n){return pn(t,n)};return r(n)?G.some(n):(e=r,(o=function(t){for(var n=0;n<t.childNodes.length;n++){var r=$t.fromDom(t.childNodes[n]);if(e(r))return G.some(r);var i=o(t.childNodes[n]);if(i.isSome())return i}return G.none()})(n.dom))}),r=t(n);return o.each(function(t){ol(e).filter(function(n){return pn(n,t)}).fold(function(){tl(t)},I)}),r},ul=ti([{none:[]},{relative:["x","y","width","height"]},{fixed:["x","y","width","height"]}]),al=function(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=G.some(a),d=G.some(c),m=G.some(s),g=G.some(l),p=G.none();return function(t,n,e,o,r,i,u,a,c){return t.fold(n,e,o,r,i,u,a,c)}(n.direction,function(){return oa(t,f,d,p,p)},function(){return oa(t,p,d,m,p)},function(){return oa(t,f,p,p,g)},function(){return oa(t,p,p,m,g)},function(){return oa(t,f,d,p,p)},function(){return oa(t,f,p,p,g)},function(){return oa(t,f,d,p,p)},function(){return oa(t,p,d,m,p)})},cl=function(t,n){return t.fold(function(){var t=n.rect;return oa("absolute",G.some(t.x),G.some(t.y),G.none(),G.none())},function(t,e,o,r){return al("absolute",n,t,e,o,r)},function(t,e,o,r){return al("fixed",n,t,e,o,r)})},sl=function(t,n){var e=P(so,n),o=t.fold(e,e,function(){var t=eo();return so(n).translate(-t.left,-t.top)}),r=pe(n),i=ae(n);return lo(o.left,o.top,r,i)},ll=function(t,n){return n.fold(function(){return t.fold(po,po,lo)},function(n){return t.fold(N(n),N(n),function(){var e=fl(t,n.x,n.y);return lo(e.left,e.top,n.width,n.height)})})},fl=function(t,n,e){var o=se(n,e);return t.fold(N(o),N(o),function(){var t=eo();return o.translate(-t.left,-t.top)})};ul.none;var dl,ml=ul.relative,gl=ul.fixed,pl=function(t,n){return function(t,n){return{anchorBox:t,origin:n}}
2(t,n)},hl="data-alloy-placement",vl=function(t){return Wn(t,hl)},bl=ti([{fit:["reposition"]},{nofit:["reposition","visibleW","visibleH","isVisible"]}]),yl=function(t,n,e,o){var r=t.bubble,i=r.offset,u=function(t,n,e){var o=function(o,r){return n[o].map(function(n){var i="top"===o||"bottom"===o,u=i?e.top:e.left,a=("left"===o||"top"===o?Math.max:Math.min)(n,r)+u;return i?fc(a,t.y,t.bottom):fc(a,t.x,t.right)}).getOr(r)},r=o("left",t.x),i=o("top",t.y),u=o("right",t.right),a=o("bottom",t.bottom);return lo(r,i,u-r,a-i)}(o,t.restriction,i),a=t.x+i.left,c=t.y+i.top,s=lo(a,c,n,e),l=function(t,n){var e=n.x,o=n.y,r=n.right,i=n.bottom,u=t.x,a=t.y,c=t.right,s=t.bottom,l=t.width,f=t.height;return{originInBounds:u>=e&&u<=r&&a>=o&&a<=i,sizeInBounds:c<=r&&c>=e&&s<=i&&s>=o,visibleW:Math.min(l,u>=e?r-u:c-e),visibleH:Math.min(f,a>=o?i-a:s-o)}}(s,u),f=l.originInBounds,d=l.sizeInBounds,m=l.visibleW,g=l.visibleH,p=f&&d,h=p?s:function(t,n){var e=n.x,o=n.y,r=n.right,i=n.bottom,u=t.x,a=t.y,c=t.width,s=t.height,l=Math.max(e,r-c),f=Math.max(o,i-s),d=fc(u,e,l),m=fc(a,o,f),g=Math.min(d+c,r)-d,p=Math.min(m+s,i)-m;return lo(d,m,g,p)}(s,u),v=h.width>0&&h.height>0,b=function(t,n,e){var o=N(n.bottom-e.y),r=N(e.bottom-n.y),i=function(t,n,e,o){return t.fold(n,n,o,o,n,o,e,e)}(t,r,r,o),u=N(n.right-e.x),a=N(e.right-n.x),c=function(t,n,e,o){return t.fold(n,o,n,o,e,e,n,o)}(t,a,a,u);return{maxWidth:c,maxHeight:i}}(t.direction,h,o),y=b.maxWidth,x={rect:h,maxHeight:b.maxHeight,maxWidth:y,direction:t.direction,placement:t.placement,classes:{on:r.classesOn,off:r.classesOff},layout:t.label,testY:c};return p||t.alwaysFit?bl.fit(x):bl.nofit(x,m,g,v)},xl=j,wl=function(t,n,e){return function(t,n,e,o){return Ye(t,n,e,o,!1)}(t,n,xl,e)},Sl=function(t,n,e){return function(t,n,e,o){return Ye(t,n,e,o,!0)}(t,n,xl,e)},Cl=qe,kl=["top","bottom","right","left"],Ol="data-alloy-transition-timer",_l=function(t,n){return function(t,n){return ft(n,function(n){return Zu(t,n)})}(t,n.classes)},Tl=function(t,n){var e=function(t){return parseFloat(t).toFixed(3)};return Mt(n,function(n,o){return!function(t,n){return zt(t,n,arguments.length>2&&void 0!==arguments[2]?arguments[2]:z).getOr(t.isNone()&&n.isNone())}(t[o].map(e),n.map(e))}).isSome()},El=function(t,n){var e,o=bo(),r=bo(),i=function(n){var e,o=null!==(e=n.raw.pseudoElement)&&void 0!==e?e:"";return pn(n.target,t)&&Xt(o)&&$(kl,n.raw.propertyName)},u=function(u){if(k(u)||i(u)){o.clear(),r.clear();var a=null==u?void 0:u.raw.type;(k(a)||a===Mi())&&(clearTimeout(e),Gn(t,Ol),na(t,n.classes))}},a=wl(t,Bi(),function(n){i(n)&&(a.unbind(),o.set(wl(t,Mi(),u)),r.set(wl(t,Ai(),u)))}),c=function(t){var n=function(n){var e=$n(t,n).split(/\s*,\s*/);return rt(e,Yt)},e=function(t){if(f(t)&&/^[\d.]+/.test(t)){var n=parseFloat(t);return Gt(t,"ms")?n:1e3*n}return 0},o=n("transition-delay"),r=n("transition-duration");return ut(r,function(t,n,r){var i=e(o[r])+e(n);return Math.max(t,i)},0)}(t);requestAnimationFrame(function(){e=setTimeout(u,c+17),Hn(t,Ol,e)})},Dl=function(t,n,e,o,r,i){var u=function(t,n,e){return e.exists(function(e){var o=t.mode;return"all"===o||e[o]!==n[o]})}(o,r,i);if(u||_l(t,o)){Xn(t,"position",e.position);var a=sl(n,t),c=cl(n,_(_({},r),{},{rect:a})),s=gt(kl,function(t){return c[t]});Tl(e,s)&&(Jn(t,s),u&&function(t,n){ta(t,n.classes),Wn(t,Ol).each(function(n){clearTimeout(parseInt(n,10)),Gn(t,Ol)}),El(t,n)}(t,o),oe(t))}else na(t,o.classes)},Al=function(t,n,e,o){ee(n,"max-height"),ee(n,"max-width");var r,i={width:pe(r=n),height:ae(r)};return function(t,n,e,o,r,i){var u=o.width,a=o.height,c=function(n,c,s,l,f){var d=n(e,o,r,t,i),m=yl(d,u,a,i);return m.fold(N(m),function(t,n,e,o){return(f===o?e>l||n>s:!f&&o)?m:bl.nofit(c,s,l,f)})},s=ut(n,function(t,n){var e=P(c,n);return t.fold(N(t),e)},bl.nofit({rect:e,maxHeight:o.height,maxWidth:o.width,direction:xs(),placement:"southeast",classes:{on:[],off:[]},layout:"none",testY:e.y},-1,-1,!1));return s.fold(L,L)}(n,o.preference,t,i,e,o.bounds)},Ml=function(t,n){!function(t,n){Hn(t,hl,n)}(t,n.placement)},Bl=function(t,n){!function(t,n){var e=ie.max(t,n,["margin-top","border-top-width","padding-top","padding-bottom","border-bottom-width","margin-bottom"]);Xn(t,"max-height",e+"px")}(t,Math.floor(n))},Il=N(function(t,n){Bl(t,n),Kn(t,{"overflow-x":"hidden","overflow-y":"auto"})}),Fl=N(function(t,n){Bl(t,n)}),Rl=function(t,n,e){return void 0===t[n]?e:t[n]},Nl=function(t,n,e,o){var r=Al(t,n,e,o);return function(t,n,e){var o=cl(e.origin,n);e.transition.each(function(r){Dl(t,e.origin,o,r,n,e.lastPlacement)}),ra(t,o)}(n,r,o),Ml(n,r),function(t,n){var e=n.classes;na(t,e.off),ta(t,e.on)}(n,r),function(t,n,e){(0,e.maxHeightFunction)(t,n.maxHeight)}(n,r,o),function(t,n,e){(0,e.maxWidthFunction)(t,n.maxWidth)}(n,r,o),{layout:r.layout,placement:r.placement}},Ll=["valignCentre","alignLeft","alignRight","alignCentre","top","bottom","left","right","inset"],zl=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=t*o,i=n*o,u=function(t){return It(e,t).getOr([])},a=function(t,n,e){var o=mt(Ll,e);return{offset:se(t,n),classesOn:lt(e,u),classesOff:lt(o,u)}};
2return{southeast:function(){return a(-t,n,["top","alignLeft"])},southwest:function(){return a(t,n,["top","alignRight"])},south:function(){return a(-t/2,n,["top","alignCentre"])},northeast:function(){return a(-t,-n,["bottom","alignLeft"])},northwest:function(){return a(t,-n,["bottom","alignRight"])},north:function(){return a(-t/2,-n,["bottom","alignCentre"])},east:function(){return a(t,-n/2,["valignCentre","left"])},west:function(){return a(-t,-n/2,["valignCentre","right"])},insetNortheast:function(){return a(r,i,["top","alignLeft","inset"])},insetNorthwest:function(){return a(-r,i,["top","alignRight","inset"])},insetNorth:function(){return a(-r/2,i,["top","alignCentre","inset"])},insetSoutheast:function(){return a(r,-i,["bottom","alignLeft","inset"])},insetSouthwest:function(){return a(-r,-i,["bottom","alignRight","inset"])},insetSouth:function(){return a(-r/2,-i,["bottom","alignCentre","inset"])},insetEast:function(){return a(-r,-i/2,["valignCentre","right","inset"])},insetWest:function(){return a(r,-i/2,["valignCentre","left","inset"])}}},Pl=function(){return zl(0,0,{})},Hl=L,Vl=function(t,n){return function(e){return"rtl"===Ul(e)?n:t}},Ul=function(t){return"rtl"===$n(t,"direction")?"rtl":"ltr"};!function(t){t.TopToBottom="toptobottom",t.BottomToTop="bottomtotop"}(dl||(dl={}));var Wl="data-alloy-vertical-dir",jl=function(t){return cs(t,function(t){return an(t)&&Un(t,"data-alloy-vertical-dir")===dl.BottomToTop})},Gl=function(){return jr("layouts",[Dr("onLtr"),Dr("onRtl"),Lr("onBottomLtr"),Lr("onBottomRtl")])},ql=function(t,n,e,o,r,i,u){var a=u.map(jl).getOr(!1),c=n.layouts.map(function(n){return n.onLtr(t)}),s=n.layouts.map(function(n){return n.onRtl(t)}),l=a?n.layouts.bind(function(n){return n.onBottomLtr.map(function(n){return n(t)})}).or(c).getOr(r):c.getOr(e),f=a?n.layouts.bind(function(n){return n.onBottomRtl.map(function(n){return n(t)})}).or(s).getOr(i):s.getOr(o);return Vl(l,f)(t)},Yl=[Dr("hotspot"),Lr("bubble"),Gr("overrides",{}),Gl(),oc("placement",function(t,n,e){var o=n.hotspot,r=sl(e,o.element),i=ql(t.element,n,Xs(),Ks(),qs(),Ys(),G.some(n.hotspot.element));return G.some(Hl({anchorBox:r,bubble:n.bubble.getOr(Pl()),overrides:n.overrides,layouts:i}))})],Xl=[Dr("x"),Dr("y"),Gr("height",0),Gr("width",0),Gr("bubble",Pl()),Gr("overrides",{}
2),Gl(),oc("placement",function(t,n,e){var o=fl(e,n.x,n.y),r=lo(o.left,o.top,n.width,n.height),i=ql(t.element,n,js(),Gs(),js(),Gs(),G.none());return G.some(Hl({anchorBox:r,bubble:n.bubble,overrides:n.overrides,layouts:i}))})],Kl=ti([{screen:["point"]},{absolute:["point","scrollLeft","scrollTop"]}]),Jl=function(t){return t.fold(L,function(t,n,e){return t.translate(-n,-e)})},$l=function(t){return t.fold(L,L)},Ql=function(t){return ut(t,function(t,n){return t.translate(n.left,n.top)},se(0,0))},Zl=function(t){var n=nt(t,$l);return Ql(n)},tf=Kl.screen,nf=Kl.absolute,ef=function(t,n,e){var o=vn(t.element),r=eo(o),i=function(t,n,e){var o=xn(e.root).dom;return G.from(o.frameElement).map($t.fromDom).filter(function(n){var e=vn(n),o=vn(t.element);return pn(e,o)}).map(fe)}(t,0,e).getOr(r);return nf(i,r.left,r.top)},of=function(t,n,e,o){var r=tf(se(t,n));return G.some(function(t,n,e){return{point:t,width:n,height:e}}(r,e,o))},rf=function(t,n,e,o,r){return t.map(function(t){var i,u,a,c=[n,t.point],s=(i=function(){return Zl(c)},u=function(){return Zl(c)},a=function(){return function(t){var n=nt(t,Jl);return Ql(n)}(c)},o.fold(i,u,a)),l=function(t,n,e,o){return{x:t,y:n,width:e,height:o}}(s.left,s.top,t.width,t.height),f=e.showAbove?qs():Xs(),d=e.showAbove?Ys():Ks(),m=ql(r,e,f,d,f,d,G.none());return Hl({anchorBox:l,bubble:e.bubble.getOr(Pl()),overrides:e.overrides,layouts:m})})},uf=[Dr("node"),Dr("root"),Lr("bubble"),Gl(),Gr("overrides",{}),Gr("showAbove",!1),oc("placement",function(t,n,e){var o=ef(t,0,n);return n.node.filter(Nn).bind(function(r){var i=r.dom.getBoundingClientRect(),u=of(i.left,i.top,i.width,i.height),a=n.node.getOr(t.element);return rf(u,o,n,e,a)})})],af=function(t,n,e,o){return{start:t,soffset:n,finish:e,foffset:o}},cf=ti([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),sf=(cf.before,cf.on,cf.after,function(t){return t.fold(L,L,L)}),lf=ti([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),ff={domRange:lf.domRange,relative:lf.relative,exact:lf.exact,exactFromRange:function(t){return lf.exact(t.start,t.soffset,t.finish,t.foffset)},getWin:function(t){var n=function(t){return t.match({domRange:function(t){return $t.fromDom(t.startContainer)},relative:function(t,n){return sf(t)},exact:function(t,n,e,o){return t}})}(t);return xn(n)},range:af},df=function(t,n,e){var o,r=t.document.createRange();return o=r,n.fold(function(t){o.setStartBefore(t.dom)},function(t,n){o.setStart(t.dom,n)},function(t){o.setStartAfter(t.dom)}),function(t,n){n.fold(function(n){t.setEndBefore(n.dom)},function(n,e){t.setEnd(n.dom,e)},function(n){t.setEndAfter(n.dom)})}(r,e),r},mf=function(t,n,e,o,r){var i=t.document.createRange();return i.setStart(n.dom,e),i.setEnd(o.dom,r),i},gf=function(t){return{left:t.left,top:t.top,right:t.right,bottom:t.bottom,width:t.width,height:t.height}},pf=ti([{ltr:["start","soffset","finish","foffset"]},{rtl:["start","soffset","finish","foffset"]}]),hf=function(t,n,e){return n($t.fromDom(e.startContainer),e.startOffset,$t.fromDom(e.endContainer),e.endOffset)},vf=function(t,n){var e=function(t,n){return n.match({domRange:function(t){return{ltr:N(t),rtl:G.none}},relative:function(n,e){return{ltr:he(function(){return df(t,n,e)}),rtl:he(function(){return G.some(df(t,e,n))})}},exact:function(n,e,o,r){return{ltr:he(function(){return mf(t,n,e,o,r)}),rtl:he(function(){return G.some(mf(t,o,r,n,e))})}}})}(t,n);return function(t,n){var e=n.ltr();return e.collapsed?n.rtl().filter(function(t){return!1===t.collapsed}).map(function(t){return pf.rtl($t.fromDom(t.endContainer),t.endOffset,$t.fromDom(t.startContainer),t.startOffset)}).getOrThunk(function(){return hf(0,pf.ltr,e)}):hf(0,pf.ltr,e)}(0,e)},bf=function(t,n){return vf(t,n).match({ltr:function(n,e,o,r){var i=t.document.createRange();return i.setStart(n.dom,e),i.setEnd(o.dom,r),i},rtl:function(n,e,o,r){var i=t.document.createRange();return i.setStart(o.dom,r),i.setEnd(n.dom,e),i}})};pf.ltr,pf.rtl;var yf,xf=function(t,n,e){return rt(function(t,n){for(var e=D(n)?n:W,o=t.dom,r=[];null!==o.parentNode&&void 0!==o.parentNode;){var i=o.parentNode,u=$t.fromDom(i);if(r.push(u),!0===e(u))break;o=i}return r}(t,e),n)},wf=function(t,n){return function(t,n){var e=void 0===n?document:n.dom;return mn(e)?[]:nt(e.querySelectorAll(t),$t.fromDom)}(n,t)},Sf=function(t,n,e,o){var r=function(t,n,e,o){var r=vn(t).dom.createRange();return r.setStart(t.dom,n),r.setEnd(e.dom,o),r}(t,n,e,o),i=pn(t,e)&&n===o;return r.collapsed&&!i},Cf=function(t){if(t.rangeCount>0){var n=t.getRangeAt(0),e=t.getRangeAt(t.rangeCount-1);return G.some(af($t.fromDom(n.startContainer),n.startOffset,$t.fromDom(e.endContainer),e.endOffset))}return G.none()},kf=function(t){if(null===t.anchorNode||null===t.focusNode)return Cf(t);var n=$t.fromDom(t.anchorNode),e=$t.fromDom(t.focusNode);return Sf(n,t.anchorOffset,e,t.focusOffset)?G.some(af(n,t.anchorOffset,e,t.focusOffset)):Cf(t)},Of=function(t){return function(t){return G.from(t.getSelection())}(t).filter(function(t){return t.rangeCount>0}).bind(kf)},_f=function(t,n){return function(t){var n=t.getClientRects(),e=n.length>0?n[0]:t.getBoundingClientRect();return e.width>0||e.height>0?G.some(e).map(gf):G.none()}(bf(t,n))},Tf=function(t,n){return function(t){var n=t.getBoundingClientRect();return n.width>0||n.height>0?G.some(n).map(gf):G.none()}(bf(t,n))},Ef=function(t,n){var e=function(n){return t(n)?G.from(n.dom.nodeValue):G.none()};
2return{get:function(o){if(!t(o))throw new Error("Can only get "+n+" value of a "+n+" node");return e(o).getOr("")},getOption:e,set:function(e,o){if(!t(e))throw new Error("Can only set raw "+n+" value of a "+n+" node");e.dom.nodeValue=o}}}(cn,"text"),Df=function(t,n){return{element:t,offset:n}},Af=function(t,n){var e=kn(t);if(0===e.length)return Df(t,n);if(n<e.length)return Df(e[n],0);var o=e[e.length-1],r=cn(o)?function(t){return Ef.get(t)}(o).length:kn(o).length;return Df(o,r)},Mf=function(t,n){return cn(t)?Df(t,n):Af(t,n)},Bf=function(t){return void 0!==t.foffset},If=function(t,n){return n.getSelection.getOrThunk(function(){return function(){return Of(t)}})().map(function(t){if(Bf(t)){var n=Mf(t.start,t.soffset),e=Mf(t.finish,t.foffset);return ff.range(n.element,n.offset,e.element,e.offset)}return t})},Ff=[Lr("getSelection"),Dr("root"),Lr("bubble"),Gl(),Gr("overrides",{}),Gr("showAbove",!1),oc("placement",function(t,n,e){var o=xn(n.root).dom,r=ef(t,0,n),i=If(o,n).bind(function(t){if(Bf(t)){var n=Tf(o,ff.exactFromRange(t)).orThunk(function(){var n=$t.fromText("\ufeff");Ke(t.start,n);var e=_f(o,ff.exact(n,0,n,1));return no(n),e});return n.bind(function(t){return of(t.left,t.top,t.width,t.height)})}var e=Ot(t,function(t){return t.dom.getBoundingClientRect()}),r={left:Math.min(e.firstCell.left,e.lastCell.left),right:Math.max(e.firstCell.right,e.lastCell.right),top:Math.min(e.firstCell.top,e.lastCell.top),bottom:Math.max(e.firstCell.bottom,e.lastCell.bottom)};return of(r.left,r.top,r.right-r.left,r.bottom-r.top)}),u=If(o,n).bind(function(t){return Bf(t)?an(t.start)?G.some(t.start):Sn(t.start):G.some(t.firstCell)}).getOr(t.element);return rf(i,r,n,e,u)})],Rf="link-layout",Nf=function(t){return t.x+t.width},Lf=function(t,n){return t.x-n.width},zf=function(t,n){return t.y-n.height+t.height},Pf=function(t){return t.y},Hf=function(t,n,e){return bs(Nf(t),Pf(t),e.southeast(),xs(),"southeast",Es(t,{left:0,top:2}),Rf)},Vf=function(t,n,e){return bs(Lf(t,n),Pf(t),e.southwest(),ws(),"southwest",Es(t,{right:1,top:2}),Rf)},Uf=function(t,n,e){return bs(Nf(t),zf(t,n),e.northeast(),Ss(),"northeast",Es(t,{left:0,bottom:3}),Rf)},Wf=function(t,n,e){return bs(Lf(t,n),zf(t,n),e.northwest(),Cs(),"northwest",Es(t,{right:1,bottom:3}),Rf)},jf=function(){return[Hf,Vf,Uf,Wf]},Gf=function(){return[Vf,Hf,Wf,Uf]},qf=[Dr("item"),Gl(),Gr("overrides",{}),oc("placement",function(t,n,e){var o=sl(e,n.item.element),r=ql(t.element,n,jf(),Gf(),jf(),Gf(),G.none());return G.some(Hl({anchorBox:o,bubble:Pl(),overrides:n.overrides,layouts:r}))})],Yf=kr("type",{selection:Ff,node:uf,hotspot:Yl,submenu:qf,makeshift:Xl}),Xf=[Nr("classes",fr),Kr("mode","all",["all","layout","placement"])],Kf=[Gr("useFixed",W),Lr("getBounds")],Jf=[Ar("anchor",Yf),jr("transition",Xf)],$f=function(t,n,e,o,r,i){return function(t,n,e,o,r,i,u,a){var c=Rl(u,"maxHeightFunction",Il()),s=Rl(u,"maxWidthFunction",I),l=t.anchorBox,f=t.origin,d={bounds:ll(f,i),origin:f,preference:o,maxHeightFunction:c,maxWidthFunction:s,lastPlacement:r,transition:a};return Nl(l,n,e,d)}(pl(n.anchorBox,t),o.element,n.bubble,n.layouts,r,e,n.overrides,i)},Qf=function(t,n,e,o,r,i){var u=Sr("placement.info",or(Jf),r),a=u.anchor,c=o.element,s=e.get(o.uid);il(function(){Xn(c,"position","fixed");var r=Zn(c,"visibility");Xn(c,"visibility","hidden");var l=n.useFixed()?function(){var t=document.documentElement;return gl(0,0,t.clientWidth,t.clientHeight)}():function(t){var n=fe(t.element),e=t.element.dom.getBoundingClientRect();return ml(n.left,n.top,e.width,e.height)}(t);a.placement(t,a,l).each(function(t){var r=i.orThunk(function(){return n.getBounds.map(U)}),a=$f(l,t,r,o,s,u.transition);e.set(o.uid,a)}),r.fold(function(){ee(c,"visibility")},function(t){Xn(c,"visibility",t)}),Zn(c,"left").isNone()&&Zn(c,"top").isNone()&&Zn(c,"right").isNone()&&Zn(c,"bottom").isNone()&&Nt(Zn(c,"position"),"fixed")&&ee(c,"position")},c)},Zf=Object.freeze({__proto__:null,position:function(t,n,e,o,r){var i=G.none();Qf(t,n,e,o,r,i)},positionWithinBounds:Qf,getMode:function(t,n,e){return n.useFixed()?"fixed":"absolute"},reset:function(t,n,e,o){var r=o.element;et(["position","left","right","top","bottom"],function(t){return ee(r,t)}),function(t){Gn(t,hl)}(r),e.clear(o.uid)}}),td=Object.freeze({__proto__:null,init:function(){var t={};return Lu({readState:function(){return t},clear:function(n){O(n)?delete t[n]:t={}},set:function(n,e){t[n]=e},get:function(n){return It(t,n)}})}}),nd=Hu({fields:Kf,name:"positioning",active:Zs,apis:Zf,state:td}),ed=function(t){return t.getSystem().isConnected()},od=function(t){cu(t,Qi());var n=t.components();et(n,od)},rd=function(t){var n=t.components();et(n,rd),cu(t,$i())},id=function(t,n){t.getSystem().addToWorld(n),Nn(t.element)&&rd(n)},ud=function(t){od(t),t.getSystem().removeFromWorld(t)},ad=function(t,n){Qe(t.element,n.element)},cd=function(t,n,e){var o=t.components();!function(t){et(t.components(),function(t){return no(t.element)}),to(t.element),t.syncComponents()}(t);var r=e(n),i=mt(o,r);et(i,function(n){od(n),t.getSystem().removeFromWorld(n)}
2),et(r,function(n){ed(n)?ad(t,n):(t.getSystem().addToWorld(n),ad(t,n),Nn(t.element)&&rd(n))}),t.syncComponents()},sd=function(t,n){ld(t,n,Qe)},ld=function(t,n,e){t.getSystem().addToWorld(n),e(t.element,n.element),Nn(t.element)&&rd(n),t.syncComponents()},fd=function(t){od(t),no(t.element),t.getSystem().removeFromWorld(t)},dd=function(t){var n=wn(t.element).bind(function(n){return t.getSystem().getByDom(n).toOptional()});fd(t),n.each(function(t){t.syncComponents()})},md=function(t){var n=t.components();et(n,fd),to(t.element),t.syncComponents()},gd=function(t,n){hd(t,n,Qe)},pd=function(t,n){hd(t,n,Je)},hd=function(t,n,e){e(t,n.element);var o=kn(n.element);et(o,function(t){n.getByDom(t).each(rd)})},vd=function(t){var n=kn(t.element);et(n,function(n){t.getByDom(n).each(od)}),no(t.element)},bd=function(t,n,e,o){e.get().each(function(n){md(t)});var r=n.getAttachPoint(t);sd(r,t);var i=t.getSystem().build(o);return sd(t,i),e.set(i),i},yd=function(t,n,e,o){var r=bd(t,n,e,o);return n.onOpen(t,r),r},xd=function(t,n,e){e.get().each(function(o){md(t),dd(t),n.onClose(t,o),e.clear()})},wd=function(t,n,e){return e.isOpen()},Sd=function(t,n,e){var o=n.getAttachPoint(t);Xn(t.element,"position",nd.getMode(o)),function(t,n,e,o){Zn(t.element,n).fold(function(){Gn(t.element,e)},function(n){Hn(t.element,e,n)}),Xn(t.element,n,o)}(t,"visibility",n.cloakVisibilityAttr,"hidden")},Cd=function(t,n,e){(function(t){return Q(["top","left","right","bottom"],function(n){return Zn(t,n).isSome()})})(t.element)||ee(t.element,"position"),function(t,n,e){Wn(t.element,e).fold(function(){return ee(t.element,n)},function(e){return Xn(t.element,n,e)})}(t,"visibility",n.cloakVisibilityAttr)},kd=Object.freeze({__proto__:null,cloak:Sd,decloak:Cd,open:yd,openWhileCloaked:function(t,n,e,o,r){Sd(t,n),yd(t,n,e,o),r(),Cd(t,n)},close:xd,isOpen:wd,isPartOf:function(t,n,e,o){return wd(0,0,e)&&e.get().exists(function(e){return n.isPartOf(t,e,o)})},getState:function(t,n,e){return e.get()},setContent:function(t,n,e,o){return e.get().map(function(){return bd(t,n,e,o)})}}),Od=Object.freeze({__proto__:null,events:function(t,n){return gu([vu(ji(),function(e,o){xd(e,t,n)})])}}),_d=[Za("onOpen"),Za("onClose"),Dr("isPartOf"),Dr("getAttachPoint"),Gr("cloakVisibilityAttr","data-precloak-visibility")],Td=Object.freeze({__proto__:null,init:function(){var t=yo(),n=N("not-implemented");return Lu({readState:n,isOpen:t.isSet,clear:t.clear,set:t.set,get:t.get})}}),Ed=Hu({fields:_d,name:"sandboxing",active:Od,apis:kd,state:Td}),Dd=N("dismiss.popups"),Ad=N("reposition.popups"),Md=N("mouse.released"),Bd=er([Gr("isExtraPart",W),jr("fireEventInstead",[Gr("event",Zi())])]),Id=function(t){var n=Sr("Dismissal",Bd,t);return T({},Dd(),{schema:er([Dr("target")]),onReceive:function(t,e){Ed.isOpen(t)&&(Ed.isPartOf(t,e.target)||n.isExtraPart(t,e.target)||n.fireEventInstead.fold(function(){return Ed.close(t)},function(n){return cu(t,n.event)}))}})},Fd=er([jr("fireEventInstead",[Gr("event",tu())]),Ir("doReposition")]),Rd=function(t){var n=Sr("Reposition",Fd,t);return T({},Ad(),{onReceive:function(t){Ed.isOpen(t)&&n.fireEventInstead.fold(function(){return n.doReposition(t)},function(n){return cu(t,n.event)})}})},Nd=function(t,n,e){n.store.manager.onLoad(t,n,e)},Ld=function(t,n,e){n.store.manager.onUnload(t,n,e)},zd=Object.freeze({__proto__:null,onLoad:Nd,onUnload:Ld,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}}),Pd=Object.freeze({__proto__:null,events:function(t,n){var e=t.resetOnDom?[Ou(function(e,o){Nd(e,t,n)}),_u(function(e,o){Ld(e,t,n)})]:[Bu(t,n,Nd)];return gu(e)}}),Hd=function(){var t=ho(null);return Lu({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()}}})},Vd=function(){var t=ho({}),n=ho({});return Lu({readState:function(){return{mode:"dataset",dataByValue:t.get(),dataByText:n.get()}},lookup:function(e){return It(t.get(),e).orThunk(function(){return It(n.get(),e)})}
2,update:function(e){var o=t.get(),r=n.get(),i={},u={};et(e,function(t){i[t.value]=t,It(t,"meta").each(function(n){It(n,"text").each(function(n){u[n]=t})})}),t.set(_(_({},o),i)),n.set(_(_({},r),u))},clear:function(){t.set({}),n.set({})}})},Ud=Object.freeze({__proto__:null,memory:Hd,dataset:Vd,manual:function(){return Lu({readState:I})},init:function(t){return t.store.manager.state(t)}}),Wd=function(t,n,e,o){var r=n.store;e.update([o]),r.setValue(t,o),n.onSetValue(t,o)},jd=[Lr("initialValue"),Dr("getFallbackEntry"),Dr("getDataKey"),Dr("setValue"),oc("manager",{setValue:Wd,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(t,n,e){n.store.initialValue.each(function(o){Wd(t,n,e,o)})},onUnload:function(t,n,e){e.clear()},state:Vd})],Gd=[Dr("getValue"),Gr("setValue",I),Lr("initialValue"),oc("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(t,n,e){n.store.initialValue.each(function(e){n.store.setValue(t,e)})},onUnload:I,state:Nu.init})],qd=[Lr("initialValue"),oc("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:Hd})],Yd=[qr("store",{mode:"memory"},kr("mode",{memory:qd,manual:Gd,dataset:jd})),Za("onSetValue"),Gr("resetOnDom",!1)],Xd=Hu({fields:Yd,name:"representing",active:Pd,apis:zd,extra:{setValueFrom:function(t,n){var e=Xd.getValue(n);Xd.setValue(t,e)}},state:Ud}),Kd=function(t,n){return Zr(t,{},nt(n,function(n){return e=n.name(),o="Cannot configure "+n.name()+" for "+t,_r(e,e,{tag:"option",process:{}},Ko(function(t){return Mo("The field: "+e+" is forbidden. "+o)}));var e,o}).concat([Tr("dump",L)]))},Jd=function(t){return t.dump},$d=function(t,n){return _(_({},zu(n)),t.dump)},Qd=Kd,Zd=$d,tm="placeholder",nm=ti([{single:["required","valueThunk"]},{multiple:["required","valueThunks"]}]),em=function(t){return Ft(t,"uiType")},om=function(t,n,e,o){return em(e)&&e.uiType===tm?function(t,n,e,o){return t.exists(function(t){return t!==e.owner})?nm.single(!0,N(e)):It(o,e.name).fold(function(){throw new Error("Unknown placeholder component: "+e.name+"\nKnown: ["+St(o)+"]\nNamespace: "+t.getOr("none")+"\nSpec: "+JSON.stringify(e,null,2))},function(t){return t.replace()})}(t,0,e,o):nm.single(!1,N(e))},rm=function(t,n,e,o){return om(t,0,e,o).fold(function(r,i){var u=em(e)?i(n,e.config,e.validated):i(n),a=It(u,"components").getOr([]),c=lt(a,function(e){return rm(t,n,e,o)});return[_(_({},u),{},{components:c})]},function(t,o){if(em(e)){var r=o(n,e.config,e.validated);return e.validated.preprocess.getOr(L)(r)}return o(n)})},im=function(t,n,e,o){var r=Ot(o,function(t,n){return function(t,n){var e=!1;return{name:N(t),required:function(){return n.fold(function(t,n){return t},function(t,n){return t})},used:function(){return e},replace:function(){if(e)throw new Error("Trying to use the same placeholder more than once: "+t);return e=!0,n}}}(n,t)}),i=function(t,n,e,o){return lt(e,function(e){return rm(t,n,e,o)})}(t,n,e,r);return kt(r,function(e){if(!1===e.used()&&e.required())throw new Error("Placeholder: "+e.name()+" was not found in components list\nNamespace: "+t.getOr("none")+"\nComponents: "+JSON.stringify(n.components,null,2))}),i},um=nm.single,am=nm.multiple,cm=N(tm),sm=ti([{required:["data"]},{external:["data"]},{optional:["data"]},{group:["data"]}]),lm=Gr("factory",{sketch:L}),fm=Gr("schema",[]),dm=Dr("name"),mm=_r("pname","pname",Uo(function(t){return"<alloy."+mc(t.name)+">"}),cr()),gm=Tr("schema",function(){return[Lr("preprocess")]}),pm=Gr("defaults",N({})),hm=Gr("overrides",N({})),vm=or([lm,fm,dm,mm,pm,hm]),bm=or([lm,fm,dm,pm,hm]),ym=or([lm,fm,dm,mm,pm,hm]),xm=or([lm,gm,dm,Dr("unit"),mm,pm,hm]),wm=function(t){return t.fold(G.some,G.none,G.some,G.some)},Sm=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},Cm=function(t,n){return function(e){var o=Sr("Converting part type",n,e);return t(o)}},km=Cm(sm.required,vm),Om=Cm(sm.external,bm),_m=Cm(sm.optional,ym),Tm=Cm(sm.group,xm),Em=N("entirety"),Dm=Object.freeze({__proto__:null,required:km,external:Om,optional:_m,group:Tm,asNamedPart:wm,name:Sm,asCommon:function(t){return t.fold(L,L,L,L)},original:Em}),Am=function(t,n,e,o){return Ho(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},Mm=function(t,n){var e={};return et(n,function(n){wm(n).each(function(n){var o=Bm(t,n.pname);e[n.name]=function(e){var r=Sr("Part: "+n.name+" in "+t,or(n.schema),e);return _(_({},o),{},{config:e,validated:r})}})}),e},Bm=function(t,n){return{uiType:cm(),owner:t,name:n}},Im=function(t,n,e){return{uiType:cm(),owner:t,name:n,config:e,validated:{}}},Fm=function(t){return lt(t,function(t){return t.fold(G.none,G.some,G.none,G.none).map(function(t){return Fr(t.name,t.sc
2hema.concat([rc(Em())]))}).toArray()})},Rm=function(t){return nt(t,Sm)},Nm=function(t,n,e){return function(t,n,e){var o={},r={};return et(e,function(t){t.fold(function(t){o[t.pname]=um(!0,function(n,e,o){return t.factory.sketch(Am(n,t,e,o))})},function(t){var e=n.parts[t.name];r[t.name]=N(t.factory.sketch(Am(n,t,e[Em()]),e))},function(t){o[t.pname]=um(!1,function(n,e,o){return t.factory.sketch(Am(n,t,e,o))})},function(t){o[t.pname]=am(!0,function(n,e,o){var r=n[t.name];return nt(r,function(e){return t.factory.sketch(Ho(t.defaults(n,e,o),e,t.overrides(n,e)))})})})}),{internals:N(o),externals:N(r)}}(0,n,e)},Lm=function(t,n,e){return im(G.some(t),n,n.components,e)},zm=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOptional()},Pm=function(t,n,e){return zm(t,n,e).getOrDie("Could not find part: "+e)},Hm=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return et(e,function(t){o[t]=N(i.getByUid(r[t]))}),o},Vm=function(t,n){var e=t.getSystem();return Ot(n.partUids,function(t,n){return N(e.getByUid(t))})},Um=function(t){return St(t.partUids)},Wm=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return et(e,function(t){o[t]=N(i.getByUid(r[t]).getOrDie())}),o},jm=function(t,n){var e=Rm(n);return ri(nt(e,function(n){return{key:n,value:t+"-"+n}}))},Gm=function(t){return _r("partUids","partUids",jo(function(n){return jm(n.uid,t)}),cr())},qm=Object.freeze({__proto__:null,generate:Mm,generateOne:Im,schemas:Fm,names:Rm,substitutes:Nm,components:Lm,defaultUids:jm,defaultUidsSchema:Gm,getAllParts:Vm,getAllPartNames:Um,getPart:zm,getPartOrDie:Pm,getParts:Hm,getPartsOrDie:Wm}),Ym=function(t,n,e,o,r){var i=function(t,n){return(t.length>0?[Fr("parts",t)]:[]).concat([Dr("uid"),Gr("dom",{}),Gr("components",[]),rc("originalSpec"),Gr("debug.sketcher",{})]).concat(n)}(o,r);return Sr(t+" [SpecSchema]",er(i.concat(n)),e)},Xm=function(t,n,e,o,r){var i=Km(r),u=Fm(e),a=Gm(e),c=Ym(t,n,i,u,[a]),s=Nm(0,c,e);return o(c,Lm(t,c,s.internals()),i,s.externals())},Km=function(t){return function(t){return Ft(t,"uid")}(t)?t:_(_({},t),{},{uid:xc("uid")})},Jm=er([Dr("name"),Dr("factory"),Dr("configFields"),Gr("apis",{}),Gr("extraApis",{})]),$m=er([Dr("name"),Dr("factory"),Dr("configFields"),Dr("partFields"),Gr("apis",{}),Gr("extraApis",{})]),Qm=function(t){var n=Sr("Sketcher for "+t.name,Jm,t),e=Ot(n.apis,Tc),o=Ot(n.extraApis,function(t,n){return Au(t,n)});return _(_({name:n.name,configFields:n.configFields,sketch:function(t){return function(t,n,e,o){var r=Km(o);return e(Ym(t,n,r,[],[]),r)}(n.name,n.configFields,n.factory,t)}},e),o)},Zm=function(t){var n=Sr("Sketcher for "+t.name,$m,t),e=Mm(n.name,n.partFields),o=Ot(n.apis,Tc),r=Ot(n.extraApis,function(t,n){return Au(t,n)});return _(_({name:n.name,partFields:n.partFields,configFields:n.configFields,sketch:function(t){return Xm(n.name,n.configFields,n.partFields,n.factory,t)},parts:e},o),r)},tg=function(t){return fn("input")(t)&&"radio"!==Un(t,"type")||fn("textarea")(t)},ng=Object.freeze({__proto__:null,getCurrent:function(t,n,e){return n.find(t)}}),eg=[Dr("find")],og=Hu({fields:eg,name:"composing",apis:ng}),rg=["input","button","textarea","select"],ig=function(t,n,e){(n.disabled()?fg:dg)(t,n)},ug=function(t,n){return!0===n.useNative&&$(rg,on(t.element))},ag=function(t){Hn(t.element,"disabled","disabled")},cg=function(t){Gn(t.element,"disabled")},sg=function(t){Hn(t.element,"aria-disabled","true")},lg=function(t){Hn(t.element,"aria-disabled","false")},fg=function(t,n,e){n.disableClass.each(function(n){Ku(t.element,n)}),(ug(t,n)?ag:sg)(t),n.onDisabled(t)},dg=function(t,n,e){n.disableClass.each(function(n){$u(t.element,n)}),(ug(t,n)?cg:lg)(t),n.onEnabled(t)},mg=function(t,n){return ug(t,n)?function(t){return jn(t.element,"disabled")}(t):function(t){return"true"===Un(t.element,"aria-disabled")}(t)},gg=Object.freeze({__proto__:null,enable:dg,disable:fg,isDisabled:mg,onLoad:ig,set:function(t,n,e,o){(o?fg:dg)(t,n)}}),pg=Object.freeze({__proto__:null,exhibit:function(t,n){return Mu({classes:n.disabled()?n.disableClass.toArray():[]})},events:function(t,n){return gu([pu(Hi(),function(n,e){return mg(n,t)}),Bu(t,n,ig)])}}),hg=[$r("disabled",W),Gr("useNative",!0),Lr("disableClass"),Za("onDisabled"),Za("onEnabled")],vg=Hu({fields:hg,name:"disabling",active:pg,apis:gg}),bg=function(t,n,e,o){var r=wf(t.element,"."+n.highlightClass);et(r,function(e){Q(o,function(t){return pn(t.element,e)})||($u(e,n.highlightClass),t.getSystem().getByDom(e).each(function(e){n.onDehighlight(t,e),cu(e,au())}))})},yg=function(t,n,e,o){bg(t,n,0,[o]),xg(t,n,e,o)||(Ku(o.element,n.highlightClass),n.onHighlight(t,o),cu(o,uu()))},xg=function(t,n,e,o){return Zu(o.element,n.highlightClass)},wg=function(t,n,e,o){var r=wf(t.element,"."+n.itemClass);return G.from(r[o]).fold(function(){return Co.error(new Error("No element found with index "+o))},t.getSystem().getByDom)},Sg=function(t,n,e){return ds(t.element,"."+n.itemClass).bind(function(n){return t.getSystem().getByDom(n).toOptional()})},Cg=function(t,n,e){var o=wf(t.element,"."+n.itemClass);return(o.length>0?G.some(o[o.length-1]):G.none()).bind(function(n){return t.getSystem().getByDom(n).toOptional()})},kg=function(t,n,e,o){var r=wf(t.element,"."+n.itemClass),i=ct(r,function(t){return Zu(t,n.highlightClass)});
2return i.bind(function(n){var e=lc(n,o,0,r.length-1);return t.getSystem().getByDom(r[e]).toOptional()})},Og=function(t,n,e){var o=wf(t.element,"."+n.itemClass);return Lt(nt(o,function(n){return t.getSystem().getByDom(n).toOptional()}))},_g=Object.freeze({__proto__:null,dehighlightAll:function(t,n,e){return bg(t,n,0,[])},dehighlight:function(t,n,e,o){xg(t,n,e,o)&&($u(o.element,n.highlightClass),n.onDehighlight(t,o),cu(o,au()))},highlight:yg,highlightFirst:function(t,n,e){Sg(t,n).each(function(o){yg(t,n,e,o)})},highlightLast:function(t,n,e){Cg(t,n).each(function(o){yg(t,n,e,o)})},highlightAt:function(t,n,e,o){wg(t,n,e,o).fold(function(t){throw t},function(o){yg(t,n,e,o)})},highlightBy:function(t,n,e,o){var r=Og(t,n);at(r,o).each(function(o){yg(t,n,e,o)})},isHighlighted:xg,getHighlighted:function(t,n,e){return ds(t.element,"."+n.highlightClass).bind(function(n){return t.getSystem().getByDom(n).toOptional()})},getFirst:Sg,getLast:Cg,getPrevious:function(t,n,e){return kg(t,n,0,-1)},getNext:function(t,n,e){return kg(t,n,0,1)},getCandidates:Og}),Tg=[Dr("highlightClass"),Dr("itemClass"),Za("onHighlight"),Za("onDehighlight")],Eg=Hu({fields:Tg,name:"highlighting",apis:_g}),Dg=[8],Ag=[9],Mg=[13],Bg=[27],Ig=[32],Fg=[37],Rg=[38],Ng=[39],Lg=[40],zg=function(t,n,e){var o=dt(t.slice(0,n)),r=dt(t.slice(n+1));return at(o.concat(r),e)},Pg=function(t,n,e){var o=dt(t.slice(0,n));return at(o,e)},Hg=function(t,n,e){var o=t.slice(0,n),r=t.slice(n+1);return at(r.concat(o),e)},Vg=function(t,n,e){var o=t.slice(n+1);return at(o,e)},Ug=function(t){return function(n){var e=n.raw;return $(t,e.which)}},Wg=function(t){return function(n){return ft(t,function(t){return t(n)})}},jg=function(t){return!0===t.raw.shiftKey},Gg=function(t){return!0===t.raw.ctrlKey},qg=H(jg),Yg=function(t,n){return{matches:t,classification:n}},Xg=function(t,n,e){n.exists(function(t){return e.exists(function(n){return pn(n,t)})})||su(t,nu(),{prevFocus:n,newFocus:e})},Kg=function(){var t=function(t){return rl(t.element)};return{get:t,set:function(n,e){var o=t(n);n.getSystem().triggerFocus(e,n.element);var r=t(n);Xg(n,o,r)}}},Jg=function(){var t=function(t){return Eg.getHighlighted(t).map(function(t){return t.element})};return{get:t,set:function(n,e){var o=t(n);n.getSystem().getByDom(e).fold(I,function(t){Eg.highlight(n,t)});var r=t(n);Xg(n,o,r)}}};!function(t){t.OnFocusMode="onFocus",t.OnEnterOrSpaceMode="onEnterOrSpace",t.OnApiMode="onApi"}(yf||(yf={}));var $g,Qg,Zg=function(t,n,e,o,r){var i=function(t,n,e,o,r){var i,u,a,c=e(t,n,o,r);return(i=c,u=n.event,a=at(i,function(t){return t.matches(u)}),a.map(function(t){return t.classification})).bind(function(e){return e(t,n,o,r)})},u={schema:function(){return t.concat([Gr("focusManager",Kg()),qr("focusInside","onFocus",br(function(t){return $(["onFocus","onEnterOrSpace","onApi"],t)?Co.value(t):Co.error("Invalid value for focusInside")})),oc("handler",u),oc("state",n),oc("sendFocusIn",r)])},processKey:i,toEvents:function(t,n){var u=t.focusInside!==yf.OnFocusMode?G.none():r(t).map(function(e){return vu(Ni(),function(o,r){e(o,t,n),r.stop()})}),a=[vu(Oi(),function(o,u){i(o,u,e,t,n).fold(function(){!function(e,o){var i=Ug(Ig.concat(Mg))(o.event);t.focusInside===yf.OnEnterOrSpaceMode&&i&&si(e,o)&&r(t).each(function(r){r(e,t,n),o.stop()})}(o,u)},function(t){u.stop()})}),vu(_i(),function(e,r){i(e,r,o,t,n).each(function(t){r.stop()})})];return gu(u.toArray().concat(a))}};return u},tp=function(t){var n=[Lr("onEscape"),Lr("onEnter"),Gr("selector",'[data-alloy-tabstop="true"]:not(:disabled)'),Gr("firstTabstop",0),Gr("useTabstopAt",j),Lr("visibilitySelector")].concat([t]),e=function(t,n){var e=t.visibilitySelector.bind(function(t){return ms(n,t)}).getOr(n);return ue(e)>0},o=function(t,n){return n.focusManager.get(t).bind(function(t){return ms(t,n.selector)})},r=function(t,n,o){(function(t,n){var o=wf(t.element,n.selector),r=rt(o,function(t){return e(n,t)});return G.from(r[n.firstTabstop])})(t,n).each(function(e){n.focusManager.set(t,e)})},i=function(t,n,o,r,i){return i(n,o,function(t){return function(t,n){return e(t,n)&&t.useTabstopAt(n)}(r,t)}).fold(function(){return r.cyclic?G.some(!0):G.none()}
2,function(n){return r.focusManager.set(t,n),G.some(!0)})},u=function(t,n,e,r){var u=wf(t.element,e.selector);return o(t,e).bind(function(n){return ct(u,P(pn,n)).bind(function(n){return i(t,u,n,e,r)})})},a=function(t,n,e){var o=e.cyclic?zg:Pg;return u(t,0,e,o)},c=function(t,n,e){var o=e.cyclic?Hg:Vg;return u(t,0,e,o)},s=function(t){return function(t){return wn(t)}(t).bind(_n).exists(function(n){return pn(n,t)})},l=N([Yg(Wg([jg,Ug(Ag)]),a),Yg(Ug(Ag),c),Yg(Wg([qg,Ug(Mg)]),function(t,n,e){return e.onEnter.bind(function(e){return e(t,n)})})]),f=N([Yg(Ug(Bg),function(t,n,e){return e.onEscape.bind(function(e){return e(t,n)})}),Yg(Ug(Ag),function(t,n,e){return o(t,e).filter(function(t){return!e.useTabstopAt(t)}).bind(function(o){return(s(o)?a:c)(t,n,e)})})]);return Zg(n,Nu.init,l,f,function(){return G.some(r)})},np=tp(Tr("cyclic",W)),ep=tp(Tr("cyclic",j)),op=function(t,n,e){return tg(e)&&Ug(Ig)(n.event)?G.none():function(t,n,e){return fu(t,e,Hi()),G.some(!0)}(t,0,e)},rp=function(t,n){return G.some(!0)},ip=[Gr("execute",op),Gr("useSpace",!1),Gr("useEnter",!0),Gr("useControlEnter",!1),Gr("useDown",!1)],up=function(t,n,e){return e.execute(t,n,t.element)},ap=Zg(ip,Nu.init,function(t,n,e,o){var r=e.useSpace&&!tg(t.element)?Ig:[],i=e.useEnter?Mg:[],u=e.useDown?Lg:[],a=r.concat(i).concat(u);return[Yg(Ug(a),up)].concat(e.useControlEnter?[Yg(Wg([Gg,Ug(Mg)]),up)]:[])},function(t,n,e,o){return e.useSpace&&!tg(t.element)?[Yg(Ug(Ig),rp)]:[]},function(){return G.none()}),cp=function(){var t=yo();return Lu({readState:function(){return t.get().map(function(t){return{numRows:String(t.numRows),numColumns:String(t.numColumns)}}).getOr({numRows:"?",numColumns:"?"})},setGridSize:function(n,e){t.set({numRows:n,numColumns:e})},getNumRows:function(){return t.get().map(function(t){return t.numRows})},getNumColumns:function(){return t.get().map(function(t){return t.numColumns})}})},sp=Object.freeze({__proto__:null,flatgrid:cp,init:function(t){return t.state(t)}}),lp=function(t){return function(n,e,o,r){var i=t(n.element);return gp(i,n,e,o,r)}},fp=function(t,n){var e=Vl(t,n);return lp(e)},dp=function(t,n){var e=Vl(n,t);return lp(e)},mp=function(t){return function(n,e,o,r){return gp(t,n,e,o,r)}},gp=function(t,n,e,o,r){return o.focusManager.get(n).bind(function(e){return t(n.element,e,o,r)}).map(function(t){return o.focusManager.set(n,t),!0})},pp=mp,hp=mp,vp=mp,bp=function(t){return!function(t){return t.offsetWidth<=0&&t.offsetHeight<=0}(t.dom)},yp=function(t,n,e){var o=wf(t,e);return function(t,n){return ct(t,n).map(function(n){return{index:n,candidates:t}})}(rt(o,bp),function(t){return pn(t,n)})},xp=function(t,n){return ct(t,function(t){return pn(n,t)})},wp=function(t,n,e,o){return o(Math.floor(n/e),n%e).bind(function(n){var o=n.row*e+n.column;return o>=0&&o<t.length?G.some(t[o]):G.none()})},Sp=function(t,n,e,o,r){return wp(t,n,o,function(n,i){var u=n===e-1?t.length-n*o:o,a=lc(i,r,0,u-1);return G.some({row:n,column:a})})},Cp=function(t,n,e,o,r){return wp(t,n,o,function(n,i){var u=lc(n,r,0,e-1),a=u===e-1?t.length-u*o:o,c=fc(i,0,a-1);return G.some({row:u,column:c})})},kp=[Dr("selector"),Gr("execute",op),tc("onEscape"),Gr("captureTab",!1),ic()],Op=function(t,n,e){ds(t.element,n.selector).each(function(e){n.focusManager.set(t,e)})},_p=function(t){return function(n,e,o,r){return yp(n,e,o.selector).bind(function(n){return t(n.candidates,n.index,r.getNumRows().getOr(o.initSize.numRows),r.getNumColumns().getOr(o.initSize.numColumns))})}},Tp=function(t,n,e){return e.captureTab?G.some(!0):G.none()},Ep=_p(function(t,n,e,o){return Sp(t,n,e,o,-1)}),Dp=_p(function(t,n,e,o){return Sp(t,n,e,o,1)}),Ap=_p(function(t,n,e,o){return Cp(t,n,e,o,-1)}),Mp=_p(function(t,n,e,o){return Cp(t,n,e,o,1)}),Bp=N([Yg(Ug(Fg),fp(Ep,Dp)),Yg(Ug(Ng),dp(Ep,Dp)),Yg(Ug(Rg),pp(Ap)),Yg(Ug(Lg),hp(Mp)),Yg(Wg([jg,Ug(Ag)]),Tp),Yg(Wg([qg,Ug(Ag)]),Tp),Yg(Ug(Ig.concat(Mg)),function(t,n,e,o){return function(t,n){return n.focusManager.get(t).bind(function(t){return ms(t,n.selector)})}(t,e).bind(function(o){return e.execute(t,n,o)})})]),Ip=N([Yg(Ug(Bg),function(t,n,e){return e.onEscape(t,n)}),Yg(Ug(Ig),rp)]),Fp=Zg(kp,cp,Bp,Ip,function(){return G.some(Op)}),Rp=function(t,n,e,o,r){var i=function(t,n,e){return r(t,n,o,0,e.length-1,e[n],function(n){return o=e[n],"button"===on(o)&&"disabled"===Un(o,"disabled")?i(t,n,e):G.from(e[n]);var o})};return yp(t,e,n).bind(function(t){var n=t.index,e=t.candidates;return i(n,n,e)})},Np=function(t,n,e,o){return Rp(t,n,e,o,function(t,n,e,o,r,i,u){var a=fc(n+e,o,r);return a===t?G.from(i):u(a)})},Lp=function(t,n,e,o){return Rp(t,n,e,o,function(t,n,e,o,r,i,u){var a=lc(n,e,o,r);
2return a===t?G.none():u(a)})},zp=[Dr("selector"),Gr("getInitial",G.none),Gr("execute",op),tc("onEscape"),Gr("executeOnMove",!1),Gr("allowVertical",!0),Gr("allowHorizontal",!0),Gr("cycles",!0)],Pp=function(t,n,e){return function(t,n){return n.focusManager.get(t).bind(function(t){return ms(t,n.selector)})}(t,e).bind(function(o){return e.execute(t,n,o)})},Hp=function(t,n,e){n.getInitial(t).orThunk(function(){return ds(t.element,n.selector)}).each(function(e){n.focusManager.set(t,e)})},Vp=function(t,n,e){return(e.cycles?Lp:Np)(t,e.selector,n,-1)},Up=function(t,n,e){return(e.cycles?Lp:Np)(t,e.selector,n,1)},Wp=function(t){return function(n,e,o,r){return t(n,e,o,r).bind(function(){return o.executeOnMove?Pp(n,e,o):G.some(!0)})}},jp=N([Yg(Ug(Ig),rp),Yg(Ug(Bg),function(t,n,e){return e.onEscape(t,n)})]),Gp=Zg(zp,Nu.init,function(t,n,e,o){var r=w(e.allowHorizontal?Fg:[]).concat(e.allowVertical?Rg:[]),i=w(e.allowHorizontal?Ng:[]).concat(e.allowVertical?Lg:[]);return[Yg(Ug(r),Wp(fp(Vp,Up))),Yg(Ug(i),Wp(dp(Vp,Up))),Yg(Ug(Mg),Pp),Yg(Ug(Ig),Pp)]},jp,function(){return G.some(Hp)}),qp=function(t,n,e){return G.from(t[n]).bind(function(t){return G.from(t[e]).map(function(t){return{rowIndex:n,columnIndex:e,cell:t}})})},Yp=function(t,n,e,o){var r=t[n].length,i=lc(e,o,0,r-1);return qp(t,n,i)},Xp=function(t,n,e,o){var r=lc(e,o,0,t.length-1),i=t[r].length,u=fc(n,0,i-1);return qp(t,r,u)},Kp=function(t,n,e,o){var r=t[n].length,i=fc(e+o,0,r-1);return qp(t,n,i)},Jp=function(t,n,e,o){var r=fc(e+o,0,t.length-1),i=t[r].length,u=fc(n,0,i-1);return qp(t,r,u)},$p=[Fr("selectors",[Dr("row"),Dr("cell")]),Gr("cycles",!0),Gr("previousSelector",G.none),Gr("execute",op)],Qp=function(t,n,e){n.previousSelector(t).orThunk(function(){var e=n.selectors;return ds(t.element,e.cell)}).each(function(e){n.focusManager.set(t,e)})},Zp=function(t,n){return function(e,o,r){var i=r.cycles?t:n;return ms(o,r.selectors.row).bind(function(t){var n=wf(t,r.selectors.cell);return xp(n,o).bind(function(n){var o=wf(e,r.selectors.row);return xp(o,t).bind(function(t){var e=function(t,n){return nt(t,function(t){return wf(t,n.selectors.cell)})}(o,r);return i(e,t,n).map(function(t){return t.cell})})})})}},th=Zp(function(t,n,e){return Yp(t,n,e,-1)},function(t,n,e){return Kp(t,n,e,-1)}),nh=Zp(function(t,n,e){return Yp(t,n,e,1)},function(t,n,e){return Kp(t,n,e,1)}),eh=Zp(function(t,n,e){return Xp(t,e,n,-1)},function(t,n,e){return Jp(t,e,n,-1)}),oh=Zp(function(t,n,e){return Xp(t,e,n,1)},function(t,n,e){return Jp(t,e,n,1)}),rh=N([Yg(Ug(Fg),fp(th,nh)),Yg(Ug(Ng),dp(th,nh)),Yg(Ug(Rg),pp(eh)),Yg(Ug(Lg),hp(oh)),Yg(Ug(Ig.concat(Mg)),function(t,n,e){return rl(t.element).bind(function(o){return e.execute(t,n,o)})})]),ih=N([Yg(Ug(Ig),rp)]),uh=Zg($p,Nu.init,rh,ih,function(){return G.some(Qp)}),ah=[Dr("selector"),Gr("execute",op),Gr("moveOnTab",!1)],ch=function(t,n,e){return e.focusManager.get(t).bind(function(o){return e.execute(t,n,o)})},sh=function(t,n,e){ds(t.element,n.selector).each(function(e){n.focusManager.set(t,e)})},lh=function(t,n,e){return Lp(t,e.selector,n,-1)},fh=function(t,n,e){return Lp(t,e.selector,n,1)},dh=N([Yg(Ug(Rg),vp(lh)),Yg(Ug(Lg),vp(fh)),Yg(Wg([jg,Ug(Ag)]),function(t,n,e,o){return e.moveOnTab?vp(lh)(t,n,e,o):G.none()}),Yg(Wg([qg,Ug(Ag)]),function(t,n,e,o){return e.moveOnTab?vp(fh)(t,n,e,o):G.none()}),Yg(Ug(Mg),ch),Yg(Ug(Ig),ch)]),mh=N([Yg(Ug(Ig),rp)]),gh=Zg(ah,Nu.init,dh,mh,function(){return G.some(sh)}),ph=[tc("onSpace"),tc("onEnter"),tc("onShiftEnter"),tc("onLeft"),tc("onRight"),tc("onTab"),tc("onShiftTab"),tc("onUp"),tc("onDown"),tc("onEscape"),Gr("stopSpaceKeyup",!1),Lr("focusIn")],hh=Zg(ph,Nu.init,function(t,n,e){return[Yg(Ug(Ig),e.onSpace),Yg(Wg([qg,Ug(Mg)]),e.onEnter),Yg(Wg([jg,Ug(Mg)]),e.onShiftEnter),Yg(Wg([jg,Ug(Ag)]),e.onShiftTab),Yg(Wg([qg,Ug(Ag)]),e.onTab),Yg(Ug(Rg),e.onUp),Yg(Ug(Lg),e.onDown),Yg(Ug(Fg),e.onLeft),Yg(Ug(Ng),e.onRight),Yg(Ug(Ig),e.onSpace)]},function(t,n,e){return[].concat(w(e.stopSpaceKeyup?[Yg(Ug(Ig),rp)]:[]),[Yg(Ug(Bg),e.onEscape)])},function(t){return t.focusIn}),vh=np.schema(),bh=ep.schema(),yh=Gp.schema(),xh=Fp.schema(),wh=uh.schema(),Sh=ap.schema(),Ch=gh.schema(),kh=hh.schema(),Oh=Uu({branchKey:"mode",branches:Object.freeze({__proto__:null,acyclic:vh,cyclic:bh,flow:yh,flatgrid:xh,matrix:wh,execution:Sh,menu:Ch,special:kh}),name:"keying",active:{events:function(t,n){return t.handler.toEvents(t,n)}},apis:{focusIn:function(t,n,e){n.sendFocusIn(n).fold(function(){t.getSystem().triggerFocus(t.element,t.element)},function(o){o(t,n,e)})},setGridSize:function(t,n,e,o,r){!function(t){return Rt(t,"setGridSize")}(e)?console.error("Layout does not support setGridSize"):e.setGridSize(o,r)}},state:sp}),_h=function(t,n){il(function(){cd(t,n,function(){return nt(n,t.getSystem().build)})},t.element)},Th=function(t,n){il(function(){!function(t,n,e){var o=t.components(),r=lt(n,function(t){return _c(t).toArray()});et(o,function(t){$(r,t)||ud(t)});var i=e(n),u=mt(o,i);et(u,function(t){ed(t)&&ud(t)}),et(i,function(n){ed(n)||id(t,n)}),t.syncComponents()}(t,n,function(){return function(t,n,e){return Vc(t,n,function(n,o){return Uc(t,o,n,e)})}(t.element,n,t.getSystem().buildOrPatch)})},t.element)},Eh=function(t,n,e,o){ud(n);var r=Uc(t.element,e,o,t.getSystem().buildOrPatch);id(t,r),t.syncComponents()},Dh=function(t,n,e){var o=t.getSystem().build(e);ld(t,o,n)},Ah=function(t,n,e,o){dd(n),Dh(t,function(t,n){return function(t,n,e){On(t,e).fold(function(){Qe(t,n)},function(t){Ke(t,n)})}(t,n,e)},o)},Mh=function(t,n){return t.components()},Bh=function(t,n,e,o,r){var i=Mh(t);
2return G.from(i[o]).map(function(e){return r.fold(function(){return dd(e)},function(r){(n.reuseDom?Eh:Ah)(t,e,o,r)}),e})},Ih=Object.freeze({__proto__:null,append:function(t,n,e,o){Dh(t,Qe,o)},prepend:function(t,n,e,o){Dh(t,$e,o)},remove:function(t,n,e,o){var r=Mh(t),i=at(r,function(t){return pn(o.element,t.element)});i.each(dd)},replaceAt:Bh,replaceBy:function(t,n,e,o,r){var i=Mh(t);return ct(i,o).bind(function(e){return Bh(t,n,0,e,r)})},set:function(t,n,e,o){return(n.reuseDom?Th:_h)(t,o)},contents:Mh}),Fh=Hu({fields:[Jr("reuseDom",!0)],name:"replacing",apis:Ih}),Rh=function(t,n){var e=function(t,n){var e=gu(n);return Hu({fields:[Dr("enabled")],name:t,active:{events:N(e)}})}(t,n);return{key:t,value:{config:{},me:e,configAsRaw:N({}),initialConfig:{},state:Nu}}},Nh=function(t,n){n.ignore||(tl(t.element),n.onFocus(t))},Lh=Object.freeze({__proto__:null,focus:Nh,blur:function(t,n){n.ignore||nl(t.element)},isFocused:function(t){return el(t.element)}}),zh=Object.freeze({__proto__:null,exhibit:function(t,n){var e=n.ignore?{}:{attributes:{tabindex:"-1"}};return Mu(e)},events:function(t){return gu([vu(Ni(),function(n,e){Nh(n,t),e.stop()})].concat(t.stopMousedown?[vu(bi(),function(t,n){n.event.prevent()})]:[]))}}),Ph=[Za("onFocus"),Gr("stopMousedown",!1),Gr("ignore",!1)],Hh=Hu({fields:Ph,name:"focusing",active:zh,apis:Lh}),Vh=function(t,n,e,o){var r=e.get();e.set(o),function(t,n,e){n.toggleClass.each(function(n){e.get()?Ku(t.element,n):$u(t.element,n)})}(t,n,e),function(t,n,e){var o=n.aria;o.update(t,o,e.get())}(t,n,e),r!==o&&n.onToggled(t,o)},Uh=function(t,n,e){Vh(t,n,e,!e.get())},Wh=function(t,n,e){Vh(t,n,e,n.selected)},jh=Object.freeze({__proto__:null,onLoad:Wh,toggle:Uh,isOn:function(t,n,e){return e.get()},on:function(t,n,e){Vh(t,n,e,!0)},off:function(t,n,e){Vh(t,n,e,!1)},set:Vh}),Gh=Object.freeze({__proto__:null,exhibit:function(){return Mu({})},events:function(t,n){var e,o,r,i=(e=t,o=n,r=Uh,Eu(function(t){r(t,e,o)})),u=Bu(t,n,Wh);return gu(st([t.toggleOnExecute?[i]:[],[u]]))}}),qh=function(t,n,e){Hn(t.element,"aria-expanded",e)},Yh=[Gr("selected",!1),Lr("toggleClass"),Gr("toggleOnExecute",!0),Za("onToggled"),qr("aria",{mode:"none"},kr("mode",{pressed:[Gr("syncWithExpanded",!1),oc("update",function(t,n,e){Hn(t.element,"aria-pressed",e),n.syncWithExpanded&&qh(t,n,e)})],checked:[oc("update",function(t,n,e){Hn(t.element,"aria-checked",e)})],expanded:[oc("update",qh)],selected:[oc("update",function(t,n,e){Hn(t.element,"aria-selected",e)})],none:[oc("update",I)]}))],Xh=Hu({fields:Yh,name:"toggling",active:Gh,apis:jh,state:($g=!1,{init:function(){var t=ho($g);return{get:function(){return t.get()},set:function(n){return t.set(n)},clear:function(){return t.set($g)},readState:function(){return t.get()}}}})}),Kh=function(){var t=function(t,n){n.stop(),lu(t)};return[vu(Di(),t),vu(Ui(),t),Su(gi()),Su(bi())]},Jh=function(t){return gu(st([t.map(function(t){return Eu(function(n,e){t(n),e.stop()})}).toArray(),Kh()]))},$h="alloy.item-hover",Qh="alloy.item-focus",Zh="alloy.item-toggled",tv=function(t){(rl(t.element).isNone()||Hh.isFocused(t))&&(Hh.isFocused(t)||Hh.focus(t),su(t,$h,{item:t}))},nv=function(t){su(t,Qh,{item:t})},ev=N($h),ov=N(Qh),rv=N(Zh),iv=function(t){return t.role.fold(function(){return t.toggling.map(function(t){return t.exclusive?"menuitemradio":"menuitemcheckbox"}).getOr("menuitem")},L)},uv=function(t,n){return _(_({aria:{mode:n?"selected":"checked"}},Dt(t,function(t,n){return"exclusive"!==n})),{},{onToggled:function(n,e){D(t.onToggled)&&t.onToggled(n,e),function(t,n){su(t,Zh,{item:t,state:n})}(n,e)}})},av=[Dr("data"),Dr("components"),Dr("dom"),Gr("hasSubmenu",!1),Lr("toggling"),Lr("role"),Qd("itemBehaviours",[Xh,Hh,Oh,Xd]),Gr("ignoreFocus",!1),Gr("domModification",{}),oc("builder",function(t){return{dom:t.dom,domModification:_(_({},t.domModification),{},{attributes:_(_({role:iv(t)},t.domModification.attributes),{},{"aria-haspopup":t.hasSubmenu},t.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:Zd(t.itemBehaviours,[t.toggling.fold(Xh.revoke,function(n){return Xh.config(uv(n,t.role.exists(function(t){return"option"===t})))}),Hh.config({ignore:t.ignoreFocus,stopMousedown:t.ignoreFocus,onFocus:function(t){nv(t)}}),Oh.config({mode:"execution"}),Xd.config({store:{mode:"memory",initialValue:t.data}}),Rh("item-type-events",[].concat(w(Kh()),[vu(Si(),tv),vu(Vi(),Hh.focus)]))]),components:t.components,eventOrder:t.eventOrder}}),Gr("eventOrder",{})],cv=[Dr("dom"),Dr("components"),oc("builder",function(t){return{dom:t.dom,components:t.components,events:gu([Cu(Vi())])}})],sv=N("item-widget"),lv=N([km({name:"widget",overrides:function(t){return{behaviours:zu([Xd.config({store:{mode:"manual",getValue:function(n){return t.data},setValue:I}})])}}})]),fv=[Dr("uid"),Dr("data"),Dr("components"),Dr("dom"),Gr("autofocus",!1),Gr("ignoreFocus",!1),Qd("widgetBehaviours",[Xd,Hh,Oh]),Gr("domModification",{}),Gm(lv()),oc("builder",function(t){var n=Nm(sv(),t,lv()),e=Lm(sv(),t,n.internals()),o=function(n){return zm(n,t,"widget").map(function(t){return Oh.focusIn(t),t})},r=function(n,e){return tg(e.event.target)?G.none():t.autofocus?(e.setSource(n.element),G.none()):G.none()};return{dom:t.dom,components:e,domModification:t.domModification,events:gu([Eu(function(t,n){o(t).each(function(t){n.stop()})}),vu(Si(),tv),vu(Vi(),function(n,e){t.autofocus?o(n):Hh.focus(n)})]),behaviours:Zd(t.widgetBehaviours,[Xd.config({store:{mode:"memory",initialValue:t.data}}),Hh.config({ignore:t.ignoreFocus,onFocus:function(t){nv(t)}}),Oh.config({mode:"special",focusIn:t.autofocus?function(t){o(t)}:Wu(),onLeft:r,onRight:r,onEscape:function(n,e){return Hh.isFocused(n)||t.autofocus?t.autofocus?(e.setSource(n.element),G.none()):G.none():(Hh.focus(n),G.some(!0))}})])}})],dv=kr("type",{widget:fv,item:av,separator:cv}),mv=N([Tm({factory:{sketch:function(t){var n=Sr("menu.spec item",dv,t);return n.builder(n)}},name:"items",unit:"item",defaults:function(t,n){return Ft(n,"uid")?n:_(_({},n),{},{uid:xc("item")})},overrides:function(t,n){return{type:n.type,ignoreFocus:t.fakeFocus,domModification:{classes:[t.markers.item]}}}})]),gv=N([Hr("role"),Dr("value"),Dr("items"),Dr("dom"),Dr("components"),Gr("eventOrder",{}),Kd("menuBehaviours",[Eg,Xd,og,Oh]),qr("movement",{mode:"menu",moveOnTab:!0},kr("mode",{grid:[ic(),oc("config",function(t,n){return{mode:"flatgrid",selector:"."+t.markers.item,initSize:{numColumns:n.initSize.numColumns,numRows:n.initSize.numRows},focusManager:t.focusManager}})],matrix:[oc("config",function(t,n){return{mode:"matrix",selectors:{row:n.rowSelector,cell:"."+t.markers.item},previousSelector:n.previousSelector,focusManager:t.focusManager}}),Dr("rowSelector"),Gr("previousSelector",G.none)],menu:[Gr("moveOnTab",!0),oc("config",function(t,n){return{mode:"menu",selector:"."+t.markers.item,moveOnTab:n.moveOnTab,focusManager:t.focusManager}})]})),Ar("markers",Xa()),Gr("fakeFocus",!1),Gr("focusManager",Kg()),Za("onHighlight"),Za("onDehighlight"),Gr("showMenuRole",!0)]),pv=N("alloy.menu-focus"),hv=Zm({name:"Menu",configFields:gv(),partFields:mv(),factory:function(t,n,e,o){return _({uid:t.uid,dom:t.dom,markers:t.markers,behaviours:$d(t.menuBehaviours,[Eg.config({highlightClass:t.markers.selectedItem,itemClass:t.markers.item,onHighlight:t.onHighlight,onDehighlight:t.onDehighlight}),Xd.config({store:{mode:"memory",initialValue:t.value}}),og.config({find:G.some}),Oh.config(t.movement.config(t,t.movement))]),events:gu([vu(ov(),function(t,n){var e=n.event;t.getSystem().getByDom(e.target).each(function(e){Eg.highlight(t,e),n.stop(),su(t,pv(),{menu:t,item:e})})}),vu(ev(),function(t,n){var e=n.event.item;Eg.highlight(t,e)}),vu(rv(),function(t,n){var e=n.event,o=e.item;e.state&&"menuitemradio"===Un(o.element,"role")&&function(t,n){var e=wf(t.element,'[role="menuitemradio"][aria-checked="true"]');et(e,function(e){pn(e,n.element)||t.getSystem().getByDom(e).each(function(t){Xh.off(t)})})}(t,o)})]),components:n,eventOrder:t.eventOrder},t.showMenuRole?{domModification:{attributes:{role:t.role.getOr("menu")}}}:{})}}),vv=function(t,n,e,o){return It(e,o).bind(function(o){return It(t,o).bind(function(o){var r=vv(t,n,e,o);return G.some([o].concat(r))})}).getOr([])},bv=function(t,n){var e={};kt(t,function(t,n){et(t,function(t){e[t]=n})});var o=n,r=_t(n,function(t,n){return{k:t,v:n}}),i=Ot(r,function(t,n){return[n].concat(vv(e,o,r,n))});return Ot(e,function(t){return It(i,t).getOr([t])})},yv=function(t){return"prepared"===t.type?G.some(t.menu):G.none()},xv={init:function(){var t=ho({}),n=ho({}),e=ho({}),o=yo(),r=ho({}),i=function(n,e,o){return u(n).bind(function(r){return function(n){return Mt(t.get(),function(t,e){return t===n})}(n).bind(function(t){return e(t).map(function(t){return{triggeredMenu:r,triggeringItem:t,triggeringPath:o}})})})},u=function(t){return a(t).bind(yv)},a=function(t){return It(n.get(),t)},c=function(n){return It(t.get(),n)};return{setMenuBuilt:function(t,e){n.set(_(_({},n.get()),{},T({},t,{type:"prepared",menu:e})))},setContents:function(i,u,a,c){o.set(i),t.set(a),n.set(u),r.set(c);var s=bv(c,a);e.set(s)},expand:function(n){return It(t.get(),n).map(function(t){var o=It(e.get(),n).getOr([]);return[t].concat(o)})},refresh:function(t){return It(e.get(),t)}
2,collapse:function(t){return It(e.get(),t).bind(function(t){return t.length>1?G.some(t.slice(1)):G.none()})},lookupMenu:a,lookupItem:c,otherMenus:function(t){var n=r.get();return mt(St(n),t)},getPrimary:function(){return o.get().bind(u)},getMenus:function(){return n.get()},clear:function(){t.set({}),n.set({}),e.set({}),o.clear()},isClear:function(){return o.get().isNone()},getTriggeringPath:function(t,n){var r=rt(c(t).toArray(),function(t){return u(t).isSome()});return It(e.get(),t).bind(function(t){var e=dt(r.concat(t));return function(t){for(var n=[],e=0;e<t.length;e++){var o=t[e];if(!o.isSome())return G.none();n.push(o.getOrDie())}return G.some(n)}(lt(e,function(t,r){return i(t,n,e.slice(0,r+1)).fold(function(){return Nt(o.get(),t)?[]:[G.none()]},function(t){return[G.some(t)]})}))})}}},extractPreparedMenu:yv},wv=mc("tiered-menu-item-highlight"),Sv=mc("tiered-menu-item-dehighlight");!function(t){t[t.HighlightMenuAndItem=0]="HighlightMenuAndItem",t[t.HighlightJustMenu=1]="HighlightJustMenu",t[t.HighlightNone=2]="HighlightNone"}(Qg||(Qg={}));var Cv,kv,Ov=N("collapse-item"),_v=Qm({name:"TieredMenu",configFields:[ec("onExecute"),ec("onEscape"),nc("onOpenMenu"),nc("onOpenSubmenu"),Za("onRepositionMenu"),Za("onCollapseMenu"),Gr("highlightOnOpen",Qg.HighlightMenuAndItem),Fr("data",[Dr("primary"),Dr("menus"),Dr("expansions")]),Gr("fakeFocus",!1),Za("onHighlightItem"),Za("onDehighlightItem"),Za("onHover"),Ja(),Dr("dom"),Gr("navigateOnHover",!0),Gr("stayInDom",!1),Kd("tmenuBehaviours",[Oh,Eg,og,Fh]),Gr("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(t,n){var e,o=yo(),r=xv.init(),i=function(n){var e=function(n,e,o){return Ot(o,function(o,r){var i=function(){return hv.sketch(_(_({},o),{},{value:r,markers:t.markers,fakeFocus:t.fakeFocus,onHighlight:function(t,n){su(t,wv,{menuComp:t,itemComp:n})},onDehighlight:function(t,n){su(t,Sv,{menuComp:t,itemComp:n})},focusManager:t.fakeFocus?Jg():Kg()}))};return r===e?{type:"prepared",menu:n.getSystem().build(i())}:{type:"notbuilt",nbMenu:i}})}(n,t.data.primary,t.data.menus),o=a();return r.setContents(t.data.primary,e,t.data.expansions,o),r.getPrimary()},u=function(t){return Xd.getValue(t).value},a=function(n){return Ot(t.data.menus,function(t,n){return lt(t.items,function(t){return"separator"===t.type?[]:[t.data.value]})})},c=Eg.highlight,s=function(n,e){c(n,e),Eg.getHighlighted(e).orThunk(function(){return Eg.getFirst(e)}).each(function(o){t.fakeFocus?Eg.highlight(e,o):fu(n,o.element,Vi())})},l=function(t,n){return Lt(nt(n,function(n){return t.lookupMenu(n).bind(function(t){return"prepared"===t.type?G.some(t.menu):G.none()})}))},f=function(n,e,o){var r=l(e,e.otherMenus(o));et(r,function(e){na(e.element,[t.markers.backgroundMenu]),t.stayInDom||Fh.remove(n,e)})},d=function(n,e){var r=function(n){return o.get().getOrThunk(function(){var e={},r=wf(n.element,".".concat(t.markers.item)),i=rt(r,function(t){return"true"===Un(t,"aria-haspopup")});return et(i,function(t){n.getSystem().getByDom(t).each(function(t){var n=u(t);e[n]=t})}),o.set(e),e})}(n);kt(r,function(t,n){var o=$(e,n);Hn(t.element,"aria-expanded",o)})},m=function(n,e,o){return G.from(o[0]).bind(function(r){return e.lookupMenu(r).bind(function(r){if("notbuilt"===r.type)return G.none();var i=r.menu,u=l(e,o.slice(1));return et(u,function(n){Ku(n.element,t.markers.backgroundMenu)}),Nn(i.element)||Fh.append(n,os(i)),na(i.element,[t.markers.backgroundMenu]),s(n,i),f(n,e,o),G.some(i)})})};!function(t){t[t.HighlightSubmenu=0]="HighlightSubmenu",t[t.HighlightParent=1]="HighlightParent"}(e||(e={}));var g=function(n,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.HighlightSubmenu;if(o.hasConfigured(vg)&&vg.isDisabled(o))return G.some(o);var a=u(o);return r.expand(a).bind(function(u){return d(n,u),G.from(u[0]).bind(function(a){return r.lookupMenu(a).bind(function(c){var s=function(t,n,e){if("notbuilt"===e.type){var o=t.getSystem().build(e.nbMenu());return r.setMenuBuilt(n,o),o}return e.menu}(n,a,c);return Nn(s.element)||Fh.append(n,os(s)),t.onOpenSubmenu(n,o,s,dt(u)),i===e.HighlightSubmenu?(Eg.highlightFirst(s),m(n,r,u)):(Eg.dehighlightAll(s),G.some(o))})})})},p=function(n,e){var o=u(e);return r.collapse(o).bind(function(o){return d(n,o),m(n,r,o).map(function(o){return t.onCollapseMenu(n,e,o),o})})},h=function(n){return function(e,o){return ms(o.getSource(),".".concat(t.markers.item)).bind(function(t){return e.getSystem().getByDom(t).toOptional().bind(function(t){return n(e,t).map(j)})})}},v=gu([vu(pv(),function(t,n){var e=n.event.item;r.lookupItem(u(e)).each(function(){var e=n.event.menu;Eg.highlight(t,e);var o=u(n.event.item);r.refresh(o).each(function(n){return f(t,r,n)})})}),Eu(function(n,o){var r=o.event.target;n.getSystem().getByDom(r).each(function(o){0===u(o).indexOf("collapse-item")&&p(n,o),g(n,o,e.HighlightSubmenu).fold(function(){t.onExecute(n,o)},I)})}),Ou(function(n,e){i(n).each(function(e){Fh.append(n,os(e)),t.onOpenMenu(n,e),t.highlightOnOpen===Qg.HighlightMenuAndItem?s(n,e):t.highlightOnOpen===Qg.HighlightJustMenu&&c(n,e)})}),vu(wv,function(n,e){t.onHighlightItem(n,e.event.menuComp,e.event.itemComp)}),vu(Sv,function(n,e){t.onDehighlightItem(n,e.event.menuComp,e.event.itemComp)})].concat(w(t.navigateOnHover?[vu(ev(),function(n,o){var i=o.event.item;!function(t,n){var e=u(n);r.refresh(e).bind(function(n){return d(t,n),m(t,r,n)})}(n,i),g(n,i,e.HighlightParent),t.onHover(n,i)})]:[]))),b=function(t){return Eg.getHighlighted(t).bind(Eg.getHighlighted)},y={collapseMenu:function(t){b(t).each(function(n){p(t,n)})},highlightPrimary:function(t){r.getPrimary().each(function(n){s(t,n)})},repositionMenus:function(n){var e=r.getPrimary().bind(function(t){return b(n).bind(function(t){var n=u(t),e=Bt(r.getMenus()),o=Lt(nt(e,xv.extractPreparedMenu));return r.getTriggeringPath(n,function(t){return function(t,n,e){return wt(n,function(t){if(!t.getSystem().isConnected())return G.none();var n=Eg.getCandidates(t);return at(n,function(t){return u(t)===e})})}(0,o,t)})}).map(function(n){return{primary:t,triggeringPath:n}})});e.fold(function(){(function(t){return G.from(t.components()[0]).filter(function(t){return"menu"===Un(t.element,"role")})})(n).each(function(e){t.onRepositionMenu(n,e,[])})},function(e){var o=e.primary,r=e.triggeringPath;t.onRepositionMenu(n,o,r)})}};return{uid:t.uid,dom:t.dom,markers:t.markers,behaviours:$d(t.tmenuBehaviours,[Oh.config({mode:"special",onRight:h(function(t,n){return tg(n.element)?G.none():g(t,n,e.HighlightSubmenu)}),onLeft:h(function(t,n){return tg(n.element)?G.none():p(t,n)}),onEscape:h(function(n,e){return p(n,e).orThunk(function(){return t.onEscape(n,e).map(function(){return n})})}),focusIn:function(t,n){r.getPrimary().each(function(n){fu(t,n.element,Vi())})}}),Eg.config({highlightClass:t.markers.selectedMenu,itemClass:t.markers.menu}),og.config({find:function(t){return Eg.getHighlighted(t)}}),Fh.config({})]),eventOrder:t.eventOrder,apis:y,events:v}},extraApis:{tieredData:function(t,n,e){return{primary:t,menus:n,expansions:e}},singleData:function(t,n){return{primary:t,menus:oi(t,n),expansions:{}}},collapseItem:function(t){return{value:mc(Ov()),meta:{text:t}}}}}),Tv=Qm({name:"InlineView",configFields:[Dr("lazySink"),Za("onShow"),Za("onHide"),Ur("onEscape"),Kd("inlineBehaviours",[Ed,Xd,Qs]),jr("fireDismissalEventInstead",[Gr("event",Zi())]),jr("fireRepositionEventInstead",[Gr("event",tu())]),Gr("getRelated",G.none),Gr("isExtraPart",W),Gr("eventOrder",G.none)],factory:function(t,n){var e=function(n,e,o,r){var i=t.lazySink(n).getOrDie();Ed.openWhileCloaked(n,e,function(){return nd.positionWithinBounds(i,n,o,r())}),Xd.setValue(n,G.some({mode:"position",config:o,getBounds:r}))},o=function(n,e,o,r){var i=function(t,n,e,o,r){var i=function(){return t.lazySink(n)}
2,u="horizontal"===o.type?{layouts:{onLtr:function(){return Xs()},onRtl:function(){return Ks()}}}:{},a=function(t){return function(t){return 2===t.length}(t)?u:{}};return _v.sketch({dom:{tag:"div"},data:o.data,markers:o.menu.markers,highlightOnOpen:o.menu.highlightOnOpen,fakeFocus:o.menu.fakeFocus,onEscape:function(){return Ed.close(n),t.onEscape.map(function(t){return t(n)}),G.some(!0)},onExecute:function(){return G.some(!0)},onOpenMenu:function(t,n){nd.positionWithinBounds(i().getOrDie(),n,e,r())},onOpenSubmenu:function(t,n,e,o){var r=i().getOrDie();nd.position(r,e,{anchor:_({type:"submenu",item:n},a(o))})},onRepositionMenu:function(t,n,o){var u=i().getOrDie();nd.positionWithinBounds(u,n,e,r()),et(o,function(t){var n=a(t.triggeringPath);nd.position(u,t.triggeredMenu,{anchor:_({type:"submenu",item:t.triggeringItem},n)})})}})}(t,n,e,o,r);Ed.open(n,i),Xd.setValue(n,G.some({mode:"menu",menu:i}))},r=function(n){Ed.isOpen(n)&&Xd.getValue(n).each(function(e){switch(e.mode){case"menu":Ed.getState(n).each(_v.repositionMenus);break;case"position":var o=t.lazySink(n).getOrDie();nd.positionWithinBounds(o,n,e.config,e.getBounds())}})},i={setContent:function(t,n){Ed.setContent(t,n)},showAt:function(t,n,o){var r=G.none;e(t,n,o,r)},showWithinBounds:e,showMenuAt:function(t,n,e){o(t,n,e,G.none)},showMenuWithinBounds:o,hide:function(t){Ed.isOpen(t)&&(Xd.setValue(t,G.none()),Ed.close(t))},getContent:function(t){return Ed.getState(t)},reposition:r,isOpen:Ed.isOpen};return{uid:t.uid,dom:t.dom,behaviours:$d(t.inlineBehaviours,[Ed.config({isPartOf:function(n,e,o){return vs(e,o)||function(n,e){return t.getRelated(n).exists(function(t){return vs(t,e)})}(n,o)},getAttachPoint:function(n){return t.lazySink(n).getOrDie()},onOpen:function(n){t.onShow(n)},onClose:function(n){t.onHide(n)}}),Xd.config({store:{mode:"memory",initialValue:G.none()}}),Qs.config({channels:_(_({},Id(_({isExtraPart:n.isExtraPart},t.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Rd(_(_({},t.fireRepositionEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})),{},{doReposition:r})))})]),eventOrder:t.eventOrder,apis:i}},apis:{showAt:function(t,n,e,o){t.showAt(n,e,o)},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)}}}),Ev=tinymce.util.Tools.resolve("tinymce.util.Delay"),Dv=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Av=tinymce.util.Tools.resolve("tinymce.EditorManager"),Mv=tinymce.util.Tools.resolve("tinymce.Env");!function(t){t.default="wrap",t.floating="floating",t.sliding="sliding",t.scrolling="scrolling"}(Cv||(Cv={})),function(t){t.auto="auto",t.top="top",t.bottom="bottom"}(kv||(kv={}));var Bv=function(t){return function(n){return n.options.get(t)}},Iv=function(t){return function(n){return G.from(t(n))}},Fv=function(t){var n=Mv.deviceType.isPhone(),e=Mv.deviceType.isTablet()||n,o=t.options.register,r=function(t){return f(t)||!1===t},i=function(t){return f(t)||M(t)};o("skin",{processor:function(t){return f(t)||!1===t},default:"oxide"}),o("skin_url",{processor:"string"}),o("height",{processor:i,default:Math.max(t.getElement().offsetHeight,400)}),o("width",{processor:i,default:Dv.DOM.getStyle(t.getElement(),"width")}),o("min_height",{processor:"number",default:100}),o("min_width",{processor:"number"}),o("max_height",{processor:"number"}),o("max_width",{processor:"number"}),o("style_formats",{processor:"object[]"}),o("style_formats_merge",{processor:"boolean",default:!1}),o("style_formats_autohide",{processor:"boolean",default:!1}),o("line_height_formats",{processor:"string",default:"1 1.1 1.2 1.3 1.4 1.5 2"}),o("font_family_formats",{processor:"string",default:"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"}),o("font_size_formats",{processor:"string",default:"8pt 10pt 12pt 14pt 18pt 24pt 36pt"}),o("font_size_input_default_unit",{processor:"string",default:"pt"}),o("block_formats",{processor:"string",default:"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre"}),o("content_langs",{processor:"object[]"}),o("removed_menuitems",{processor:"string",default:""}),o("menubar",{processor:function(t){return f(t)||y(t)},default:!n}),o("menu",{processor:"object",default:{}}),o("toolbar",{processor:function(t){return y(t)||f(t)||g(t)?{value:t,valid:!0}:{valid:!1,message:"Must be a boolean, string or array."}},default:!0}),Z(9,function(t){o("toolbar"+(t+1),{processor:"string"})}),o("toolbar_mode",{processor:"string",default:e?"scrolling":"floating"}),o("toolbar_groups",{processor:"object",default:{}}),o("toolbar_location",{processor:"string",default:kv.auto}),o("toolbar_persist",{processor:"boolean",default:!1}),o("toolbar_sticky",{processor:"boolean",default:t.inline}),o("toolbar_sticky_offset",{processor:"number",default:0}),o("fixed_toolbar_container",{processor:"string",default:""}),o("fixed_toolbar_container_target",{processor:"object"}),o("ui_mode",{processor:"string",default:"combined"}),o("file_picker_callback",{processor:"function"}),o("file_picker_validator_handler",{processor:"function"}),o("file_picker_types",{processor:"string"}),o("typeahead_urls",{processor:"boolean",default:!0}),o("anchor_top",{processor:r,default:"#top"}),o("anchor_bottom",{processor:r,default:"#bottom"}),o("draggable_modal",{processor:"boolean",default:!1}),o("statusbar",{processor:"boolean",default:!0}),o("elementpath",{processor:"boolean",default:!0}),o("branding",{processor:"boolean",default:!0}),o("promotion",{processor:"boolean",default:!0}),o("resize",{processor:function(t){return"both"===t||y(t)},default:!Mv.deviceType.isTouch()}),o("sidebar_show",{processor:"string"}),o("help_accessibility",{processor:"boolean",default:t.hasPlugin("help")}),o("default_font_stack",{processor:"string[]",default:[]})},Rv=Bv("readonly"),Nv=Bv("height"),Lv=Bv("width"),zv=Iv(Bv("min_width")),Pv=Iv(Bv("min_height")),Hv=Iv(Bv("max_width")),Vv=Iv(Bv("max_height")),Uv=Iv(Bv("style_formats")),Wv=Bv("style_formats_merge"),jv=Bv("style_formats_autohide"),Gv=Bv("content_langs"),qv=Bv("removed_menuitems"),Yv=Bv("toolbar_mode"),Xv=Bv("toolbar_groups"),Kv=Bv("toolbar_location"),Jv=Bv("fixed_toolbar_container"),$v=Bv("fixed_toolbar_container_target"),Qv=Bv("toolbar_persist"),Zv=Bv("toolbar_sticky_offset"),tb=Bv("menubar"),nb=Bv("toolbar"),eb=Bv("file_picker_callback"),ob=Bv("file_picker_validator_handler"),rb=Bv("font_size_input_default_unit"),ib=Bv("file_picker_types"),ub=Bv("typeahead_urls"),ab=Bv("anchor_top"),cb=Bv("anchor_bottom"),sb=Bv("draggable_modal"),lb=Bv("statusbar"),fb=Bv("elementpath"),db=Bv("branding"),mb=Bv("resize"),gb=Bv("paste_as_text"),pb=Bv("sidebar_show"),hb=Bv("promotion"),vb=Bv("help_accessibility"),bb=Bv("default_font_stack"),yb=function(t){return!1===t.options.get("skin")},xb=function(t){return!1!==t.options.get("menubar")},wb=function(t){var n=t.options.get("skin_url");
2if(yb(t))return n;if(n)return t.documentBaseURI.toAbsolute(n);var e=t.options.get("skin");return Av.baseURL+"/skins/ui/"+e},Sb=function(t){return G.from(t.options.get("skin_url"))},Cb=function(t){return t.options.get("line_height_formats").split(" ")},kb=function(t){var n=nb(t),e=f(n),o=g(n)&&n.length>0;return!_b(t)&&(o||e||!0===n)},Ob=function(t){var n=Z(9,function(n){return t.options.get("toolbar"+(n+1))}),e=rt(n,f);return Ht(e.length>0,e)},_b=function(t){return Ob(t).fold(function(){var n=nb(t);return B(n,f)&&n.length>0},j)},Tb=function(t){return Kv(t)===kv.bottom},Eb=function(t){var n;if(!t.inline)return G.none();var e=null!==(n=Jv(t))&&void 0!==n?n:"";if(e.length>0)return ds(Ln(),e);var o=$v(t);return O(o)?G.some($t.fromDom(o)):G.none()},Db=function(t){return t.inline&&Eb(t).isSome()},Ab=function(t){return Eb(t).getOrThunk(function(){return Mn(An($t.fromDom(t.getElement())))})},Mb=function(t){return t.inline&&!xb(t)&&!kb(t)&&!_b(t)},Bb=function(t){var n=t.options.get("toolbar_sticky");return(n||t.inline)&&!Db(t)&&!Mb(t)},Ib=function(t){return!Db(t)&&"split"===t.options.get("ui_mode")},Fb=function(t){var n=t.options.get("menu");return Ot(n,function(t){return _(_({},t),{},{items:t.items})})},Rb=Object.freeze({__proto__:null,get ToolbarMode(){return Cv},get ToolbarLocation(){return kv},register:Fv,getSkinUrl:wb,getSkinUrlOption:Sb,isReadOnly:Rv,isSkinDisabled:yb,getHeightOption:Nv,getWidthOption:Lv,getMinWidthOption:zv,getMinHeightOption:Pv,getMaxWidthOption:Hv,getMaxHeightOption:Vv,getUserStyleFormats:Uv,shouldMergeStyleFormats:Wv,shouldAutoHideStyleFormats:jv,getLineHeightFormats:Cb,getContentLanguages:Gv,getRemovedMenuItems:qv,isMenubarEnabled:xb,isMultipleToolbars:_b,isToolbarEnabled:kb,isToolbarPersist:Qv,getMultipleToolbarsOption:Ob,getUiContainer:Ab,useFixedContainer:Db,isSplitUiMode:Ib,getToolbarMode:Yv,isDraggableModal:sb,isDistractionFree:Mb,isStickyToolbar:Bb,getStickyToolbarOffset:Zv,getToolbarLocation:Kv,isToolbarLocationBottom:Tb,getToolbarGroups:Xv,getMenus:Fb,getMenubar:tb,getToolbar:nb,getFilePickerCallback:eb,getFilePickerTypes:ib,useTypeaheadUrls:ub,getAnchorTop:ab,getAnchorBottom:cb,getFilePickerValidatorHandler:ob,getFontSizeInputDefaultUnit:rb,useStatusBar:lb,useElementPath:fb,promotionEnabled:hb,useBranding:db,getResize:mb,getPasteAsText:gb,getSidebarShow:pb,useHelpAccessibility:vb,getDefaultFontStack:bb}),Nb=["visible","hidden","clip"],Lb=function(t){return qt(t).length>0&&!$(Nb,t)},zb=function(t){if(un(t)){var n=$n(t,"overflow-x"),e=$n(t,"overflow-y");return Lb(n)||Lb(e)}return!1},Pb=function(t){return t.plugins.fullscreen&&t.plugins.fullscreen.isFullscreen()},Hb=function(t,n){return Ib(t)?function(t,n){var e=xf(n,zb),o=0===e.length?In(n).map(Fn).map(function(t){return xf(t,zb)}).getOr([]):e;return bt(o).map(function(n){return{element:n,others:o.slice(1),isFullscreen:function(){return Pb(t)}}})}(t,n):G.none()},Vb=function(t){var n=[].concat(w(nt(t.others,fo)),[po()]);return t.isFullscreen()?po():function(t,n){return ut(n,function(t,n){return go(t,n)},t)}(fo(t.element),n)},Ub=Qm({name:"Button",factory:function(t){var n=Jh(t.action),e=t.dom.tag,o=function(n){return It(t.dom,"attributes").bind(function(t){return It(t,n)})};return{uid:t.uid,dom:t.dom,components:t.components,events:n,behaviours:Zd(t.buttonBehaviours,[Hh.config({}),Oh.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"===e){var n=o("type").getOr("button"),r=o("role").map(function(t){return{role:t}}).getOr({});return _({type:n},r)}return{role:t.role.getOr(o("role").getOr("button"))}}()},eventOrder:t.eventOrder}},configFields:[Gr("uid",void 0),Dr("dom"),Gr("components",[]),Qd("buttonBehaviours",[Hh,Oh]),Lr("action"),Lr("role"),Gr("eventOrder",{})]}),Wb=function(t){var n=$t.fromHtml(t),e=kn(n),o=function(t){var n=void 0!==t.dom.attributes?t.dom.attributes:[];return ut(n,function(t,n){return"class"===n.name?t:_(_({},t),{},T({},n.name,n.value))},{})}(n),r=function(t){return Array.prototype.slice.call(t.dom.classList,0)}(n),i=0===e.length?{}:{innerHtml:Ra(n)};return _({tag:on(n),classes:r,attributes:o},i)},jb=function(t){var n=function(t){return void 0!==t.uid}(t)&&Rt(t,"uid")?t.uid:xc("memento");return{get:function(t){return t.getSystem().getByUid(n).getOrDie()},getOpt:function(t){return t.getSystem().getByUid(n).toOptional()},asSpec:function(){return _(_({},t),{},{uid:n})}}},Gb=Object.freeze({__proto__:null,exhibit:function(t,n){return Mu({attributes:ri([{key:n.tabAttr,value:"true"}])})}}),qb=[Gr("tabAttr","data-alloy-tabstop")],Yb=Hu({fields:qb,name:"tabstopping",active:Gb}),Xb=mc("tooltip.exclusive"),Kb=mc("tooltip.show"),Jb=mc("tooltip.hide"),$b=mc("tooltip.immediateHide"),Qb=mc("tooltip.immediateShow"),Zb=function(t,n,e){t.getSystem().broadcastOn([Xb],{})},ty=Object.freeze({__proto__:null,hideAllExclusive:Zb,immediateOpenClose:function(t,n,e,o){return cu(t,o?Qb:$b)},isEnabled:function(t,n,e){return e.isEnabled()},setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&Fh.set(t,o)})},setEnabled:function(t,n,e,o){return e.setEnabled(o)}}),ny=Object.freeze({__proto__:null,events:function(t,n){var e=function(e){n.getTooltip().each(function(o){o.get
2System().isConnected()&&(dd(o),t.onHide(e,o),n.clearTooltip())}),n.clearTimer()},o=function(e){if(!n.isShowing()&&n.isEnabled()){Zb(e);var o=t.lazySink(e).getOrDie(),r=e.getSystem().build({dom:t.tooltipDom,components:t.tooltipComponents,events:gu("normal"===t.mode?[vu(Si(),function(t){cu(e,Kb)}),vu(xi(),function(t){cu(e,Jb)})]:[]),behaviours:zu([Fh.config({})])});n.setTooltip(r),sd(o,r),t.onShow(e,r),nd.position(o,r,{anchor:t.anchor(e)})}},r=function(e){n.getTooltip().each(function(n){var o=t.lazySink(e).getOrDie();nd.position(o,n,{anchor:t.anchor(e)})})};return gu(st([[Tu(function(n){t.onSetup(n)}),vu(Kb,function(e){n.resetTimer(function(){o(e)},t.delayForShow())}),vu(Jb,function(o){n.resetTimer(function(){e(o)},t.delayForHide())}),vu(Qb,function(t){n.resetTimer(function(){o(t)},0)}),vu($b,function(t){n.resetTimer(function(){e(t)},0)}),vu(Pi(),function(t,n){var o=n;o.universal||$(o.channels,Xb)&&e(t)}),_u(function(t){e(t)})],function(){switch(t.mode){case"normal":return[vu(Ci(),function(t){cu(t,Qb)}),vu(Li(),function(t){cu(t,$b)}),vu(Si(),function(t){cu(t,Kb)}),vu(xi(),function(t){cu(t,Jb)})];case"follow-highlight":return[vu(uu(),function(t,n){cu(t,Kb)}),vu(au(),function(t){cu(t,Jb)})];case"children-normal":return[vu(Ci(),function(e,o){rl(e.element).each(function(i){dn(o.event.target,"[data-mce-tooltip]")&&n.getTooltip().fold(function(){cu(e,Qb)},function(o){n.isShowing()&&(t.onShow(e,o),r(e))})})}),vu(Li(),function(t){rl(t.element).fold(function(){cu(t,$b)},I)}),vu(Si(),function(e){ds(e.element,"[data-mce-tooltip]:hover").each(function(o){n.getTooltip().fold(function(){cu(e,Kb)},function(o){n.isShowing()&&(t.onShow(e,o),r(e))})})}),vu(xi(),function(t){ds(t.element,"[data-mce-tooltip]:hover").fold(function(){cu(t,Jb)},I)})];default:return[vu(Ci(),function(e,o){rl(e.element).each(function(i){dn(o.event.target,"[data-mce-tooltip]")&&n.getTooltip().fold(function(){cu(e,Qb)},function(o){n.isShowing()&&(t.onShow(e,o),r(e))})})}),vu(Li(),function(t){rl(t.element).fold(function(){cu(t,$b)},I)})]}}()]))}}),ey=[Dr("lazySink"),Dr("tooltipDom"),Gr("exclusive",!0),Gr("tooltipComponents",[]),$r("delayForShow",N(300)),$r("delayForHide",N(300)),$r("onSetup",I),Kr("mode","normal",["normal","follow-highlight","children-keyboard-focus","children-normal"]),Gr("anchor",function(t){return{type:"hotspot",hotspot:t,layouts:{onLtr:N([Vs,Hs,Ns,zs,Ls,Ps]),onRtl:N([Vs,Hs,Ns,zs,Ls,Ps])},bubble:zl(0,-2,{})}}),Za("onHide"),Za("onShow")],oy=Object.freeze({__proto__:null,init:function(){var t=ho(!0),n=yo(),e=yo(),o=function(){n.on(clearTimeout)},r=N("not-implemented");return Lu({getTooltip:e.get,isShowing:e.isSet,setTooltip:e.set,clearTooltip:e.clear,clearTimer:o,resetTimer:function(t,e){o(),n.set(setTimeout(t,e))},readState:r,isEnabled:function(){return t.get()},setEnabled:function(n){return t.set(n)}})}}),ry=Hu({fields:ey,name:"tooltipping",active:ny,state:oy,apis:ty}),iy=Object.entries,uy=Object.setPrototypeOf,ay=Object.isFrozen,cy=Object.getPrototypeOf,sy=Object.getOwnPropertyDescriptor,ly=Object.freeze,fy=Object.
2seal,dy=Object.create,my="undefined"!=typeof Reflect&&Reflect,gy=my.apply,py=my.construct;ly||(ly=function(t){return t}),fy||(fy=function(t){return t}),gy||(gy=function(t,n,e){return t.apply(n,e)}),py||(py=function(t,n){return v(t,w(n))});var hy,vy=Dy(Array.prototype.forEach),by=Dy(Array.prototype.pop),yy=Dy(Array.prototype.push),xy=Dy(String.prototype.toLowerCase),wy=Dy(String.prototype.toString),Sy=Dy(String.prototype.match),Cy=Dy(String.prototype.replace),ky=Dy(String.prototype.indexOf),Oy=Dy(String.prototype.trim),_y=Dy(Object.prototype.hasOwnProperty),Ty=Dy(RegExp.prototype.test),Ey=(hy=TypeError,function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return py(hy,n)});function Dy(t){return function(n){for(var e=arguments.length,o=new Array(e>1?e-1:0),r=1;r<e;r++)o[r-1]=arguments[r];return gy(t,n,o)}}function Ay(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:xy;uy&&uy(t,null);for(var o=n.length;o--;){var r=n[o];if("string"==typeof r){var i=e(r);i!==r&&(ay(n)||(n[o]=i),r=i)}t[r]=!0}return t}function My(t){for(var n=0;n<t.length;n++){_y(t,n)||(t[n]=null)}return t}function By(t){var n,e=dy(null),o=S(iy(t));try{for(o.s();!(n=o.n()).done;){var r=h(n.value,2),i=r[0],u=r[1];_y(t,i)&&(Array.isArray(u)?e[i]=My(u):u&&"object"===A(u)&&u.constructor===Object?e[i]=By(u):e[i]=u)}}catch(t){o.e(t)}finally{o.f()}return e}function Iy(t,n){for(;null!==t;){var e=sy(t,n);if(e){if(e.get)return Dy(e.get);if("function"==typeof e.value)return Dy(e.value)}t=cy(t)}return function(){return null}}var Fy=ly(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ry=ly(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ny=ly(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ly=ly(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),zy=ly(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Py=ly(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Hy=ly(["#text"]),Vy=ly(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
2spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Uy=ly(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Wy=ly(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),jy=ly(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Gy=fy(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qy=fy(/<%[\w\W]*|[\w\W]*%>/gm),Yy=fy(/\${[\w\W]*}/gm),Xy=fy(/^data-[\-\w.\u00B7-\uFFFF]/),Ky=fy(/^aria-[\-\w]+$/),Jy=fy(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$y=fy(/^(?:\w+script|data):/i),Qy=fy(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Zy=fy(/^html$/i),tx=fy(/^[a-z][.\w]*(-[.\w]+)+$/i),nx=Object.freeze({__proto__:null,MUSTACHE_EXPR:Gy,ERB_EXPR:qy,TMPLIT_EXPR:Yy,DATA_ATTR:Xy,ARIA_ATTR:Ky,IS_ALLOWED_URI:Jy,IS_SCRIPT_OR_DATA:$y,ATTR_WHITESPACE:Qy,DOCTYPE_NAME:Zy,CUSTOM_ELEMENT:tx}),ex=1,ox=3,rx=7,ix=8,ux=9,ax=function(){return"undefined"==typeof window?null:window};var cx,sx=function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ax(),e=function(n){return t(n)};if(e.version="3.1.7",e.removed=[],!n||!n.document||n.document.nodeType!==ux)return e.isSupported=!1,e;var o,r=n.document,i=r,u=i.currentScript,a=n.DocumentFragment,c=n.HTMLTemplateElement,s=n.Node,l=n.Element,f=n.NodeFilter,d=n.NamedNodeMap,m=void 0===d?n.NamedNodeMap||n.MozNamedAttrMap:d,g=n.HTMLFormElement,p=n.DOMParser,h=n.trustedTypes,v=l.prototype,b=Iy(v,"cloneNode"),y=Iy(v,"remove"),x=Iy(v,"nextSibling"),S=Iy(v,"childNodes"),C=Iy(v,"parentNode");if("function"==typeof c){var k=r.createElement("template");k.content&&k.content.ownerDocument&&(r=k.content.ownerDocument)}var O="",_=r,T=_.implementation,E=_.createNodeIterator,D=_.createDocumentFragment,M=_.getElementsByTagName,B=i.importNode,I={};e.isSupported="function"==typeof iy&&"function"==typeof C&&T&&void 0!==T.createHTMLDocument;var F=nx.MUSTACHE_EXPR,R=nx.ERB_EXPR,N=nx.TMPLIT_EXPR,L=nx.DATA_ATTR,z=nx.ARIA_ATTR,P=nx.IS_SCRIPT_OR_DATA,H=nx.ATTR_WHITESPACE,V=nx.CUSTOM_ELEMENT,U=nx.IS_ALLOWED_URI,W=null,j=Ay({},[].concat(w(Fy),w(Ry),w(Ny),w(zy),w(Hy))),G=null,q=Ay({},[].concat(w(Vy),w(Uy),w(Wy),w(jy))),Y=Object.seal(dy(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),X=null,K=null,J=!0,$=!0,Q=!1,Z=!0,tt=!1,nt=!0,et=!1,ot=!1,rt=!1,it=!1,ut=!1,at=!1,ct=!0,st=!1,lt=!0,ft=!1,dt={},mt=null,gt=Ay({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),pt=null,ht=Ay({},["audio","video","img","source","image","track"]),vt=null,bt=Ay({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),yt="http://www.w3.org/1998/Math/MathML",xt="http://www.w3.org/2000/svg",wt="http://www.w3.org/1999/xhtml",St=wt,Ct=!1,kt=null,Ot=Ay({},[yt,xt,wt],wy),_t=null,Tt=["application/xhtml+xml","text/html"],Et=null,Dt=null,At=r.createElement("form"),Mt=function(t){return t instanceof RegExp||t instanceof Function},Bt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Dt||Dt!==t){if(t&&"object"===A(t)||(t={}
2),t=By(t),_t=-1===Tt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Et="application/xhtml+xml"===_t?wy:xy,W=_y(t,"ALLOWED_TAGS")?Ay({},t.ALLOWED_TAGS,Et):j,G=_y(t,"ALLOWED_ATTR")?Ay({},t.ALLOWED_ATTR,Et):q,kt=_y(t,"ALLOWED_NAMESPACES")?Ay({},t.ALLOWED_NAMESPACES,wy):Ot,vt=_y(t,"ADD_URI_SAFE_ATTR")?Ay(By(bt),t.ADD_URI_SAFE_ATTR,Et):bt,pt=_y(t,"ADD_DATA_URI_TAGS")?Ay(By(ht),t.ADD_DATA_URI_TAGS,Et):ht,mt=_y(t,"FORBID_CONTENTS")?Ay({},t.FORBID_CONTENTS,Et):gt,X=_y(t,"FORBID_TAGS")?Ay({},t.FORBID_TAGS,Et):{},K=_y(t,"FORBID_ATTR")?Ay({},t.FORBID_ATTR,Et):{},dt=!!_y(t,"USE_PROFILES")&&t.USE_PROFILES,J=!1!==t.ALLOW_ARIA_ATTR,$=!1!==t.ALLOW_DATA_ATTR,Q=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Z=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,tt=t.SAFE_FOR_TEMPLATES||!1,nt=!1!==t.SAFE_FOR_XML,et=t.WHOLE_DOCUMENT||!1,it=t.RETURN_DOM||!1,ut=t.RETURN_DOM_FRAGMENT||!1,at=t.RETURN_TRUSTED_TYPE||!1,rt=t.FORCE_BODY||!1,ct=!1!==t.SANITIZE_DOM,st=t.SANITIZE_NAMED_PROPS||!1,lt=!1!==t.KEEP_CONTENT,ft=t.IN_PLACE||!1,U=t.ALLOWED_URI_REGEXP||Jy,St=t.NAMESPACE||wt,Y=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&Mt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Y.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&Mt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Y.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Y.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),tt&&($=!1),ut&&(it=!0),dt&&(W=Ay({},Hy),G=[],!0===dt.html&&(Ay(W,Fy),Ay(G,Vy)),!0===dt.svg&&(Ay(W,Ry),Ay(G,Uy),Ay(G,jy)),!0===dt.svgFilters&&(Ay(W,Ny),Ay(G,Uy),Ay(G,jy)),!0===dt.mathMl&&(Ay(W,zy),Ay(G,Wy),Ay(G,jy))),t.ADD_TAGS&&(W===j&&(W=By(W)),Ay(W,t.ADD_TAGS,Et)),t.ADD_ATTR&&(G===q&&(G=By(G)),Ay(G,t.ADD_ATTR,Et)),t.ADD_URI_SAFE_ATTR&&Ay(vt,t.ADD_URI_SAFE_ATTR,Et),t.FORBID_CONTENTS&&(mt===gt&&(mt=By(mt)),Ay(mt,t.FORBID_CONTENTS,Et)),lt&&(W["#text"]=!0),et&&Ay(W,["html","head","body"]),W.table&&(Ay(W,["tbody"]),delete X.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw Ey('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw Ey('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');o=t.TRUSTED_TYPES_POLICY,O=o.createHTML("")}else void 0===o&&(o=function(t,n){if("object"!==A(t)||"function"!=typeof t.createPolicy)return null;var e=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(e=n.getAttribute(o));var r="dompurify"+(e?"#"+e:"");try{return t.createPolicy(r,{createHTML:function(t){return t},createScriptURL:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(h,u)),null!==o&&"string"==typeof O&&(O=o.createHTML(""));ly&&ly(t),Dt=t}},It=Ay({},["mi","mo","mn","ms","mtext"]),Ft=Ay({},["annotation-xml"]),Rt=Ay({},["title","style","font","a","script"]),Nt=Ay({},[].concat(w(Ry),w(Ny),w(Ly))),Lt=Ay({},[].concat(w(zy),w(Py))),zt=function(t){yy(e.removed,{element:t});try{C(t).removeChild(t)}catch(n){y(t)}},Pt=function(t,n){try{yy(e.removed,{attribute:n.getAttributeNode(t),from:n})}catch(t){yy(e.removed,{attribute:null,from:n})}if(n.removeAttribute(t),"is"===t&&!G[t])if(it||ut)try{zt(n)}catch(t){}else try{n.setAttribute(t,"")}catch(t){}},Ht=function(t){var n=null,e=null;if(rt)t="<remove></remove>"+t;else{var i=Sy(t,/^[\r\n\t ]+/);e=i&&i[0]}"application/xhtml+xml"===_t&&St===wt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");var u=o?o.createHTML(t):t;if(St===wt)try{n=(new p).parseFromString(u,_t)}catch(t){}if(!n||!n.documentElement){n=T.createDocument(St,"template",null);try{n.documentElement.innerHTML=Ct?O:u}catch(t){}}var a=n.body||n.documentElement;return t&&e&&a.insertBefore(r.createTextNode(e),a.childNodes[0]||null),St===wt?M.call(n,et?"html":"body")[0]:et?n.documentElement:a},Vt=function(t){return E.call(t.ownerDocument||t,t,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},Ut=function(t){return t instanceof g&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof m)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)}
2,Wt=function(t){return"function"==typeof s&&t instanceof s},jt=function(t,n,o){I[t]&&vy(I[t],function(t){t.call(e,n,o,Dt)})},Gt=function(t){var n=null;if(jt("beforeSanitizeElements",t,null),Ut(t))return zt(t),!0;var o=Et(t.nodeName);if(jt("uponSanitizeElement",t,{tagName:o,allowedTags:W}),t.hasChildNodes()&&!Wt(t.firstElementChild)&&Ty(/<[/\w]/g,t.innerHTML)&&Ty(/<[/\w]/g,t.textContent))return zt(t),!0;if(t.nodeType===rx)return zt(t),!0;if(nt&&t.nodeType===ix&&Ty(/<[/\w]/g,t.data))return zt(t),!0;if(!W[o]||X[o]){if(!X[o]&&Yt(o)){if(Y.tagNameCheck instanceof RegExp&&Ty(Y.tagNameCheck,o))return!1;if(Y.tagNameCheck instanceof Function&&Y.tagNameCheck(o))return!1}if(lt&&!mt[o]){var r=C(t)||t.parentNode,i=S(t)||t.childNodes;if(i&&r)for(var u=i.length-1;u>=0;--u){var a=b(i[u],!0);a.__removalCount=(t.__removalCount||0)+1,r.insertBefore(a,x(t))}}return zt(t),!0}return t instanceof l&&!function(t){var n=C(t);n&&n.tagName||(n={namespaceURI:St,tagName:"template"});var e=xy(t.tagName),o=xy(n.tagName);return!!kt[t.namespaceURI]&&(t.namespaceURI===xt?n.namespaceURI===wt?"svg"===e:n.namespaceURI===yt?"svg"===e&&("annotation-xml"===o||It[o]):Boolean(Nt[e]):t.namespaceURI===yt?n.namespaceURI===wt?"math"===e:n.namespaceURI===xt?"math"===e&&Ft[o]:Boolean(Lt[e]):t.namespaceURI===wt?!(n.namespaceURI===xt&&!Ft[o])&&!(n.namespaceURI===yt&&!It[o])&&!Lt[e]&&(Rt[e]||!Nt[e]):!("application/xhtml+xml"!==_t||!kt[t.namespaceURI]))}(t)?(zt(t),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!Ty(/<\/no(script|embed|frames)/i,t.innerHTML)?(tt&&t.nodeType===ox&&(n=t.textContent,vy([F,R,N],function(t){n=Cy(n,t," ")}),t.textContent!==n&&(yy(e.removed,{element:t.cloneNode()}),t.textContent=n)),jt("afterSanitizeElements",t,null),!1):(zt(t),!0)},qt=function(t,n,e){if(ct&&("id"===n||"name"===n)&&(e in r||e in At))return!1;if($&&!K[n]&&Ty(L,n));else if(J&&Ty(z,n));else if(!G[n]||K[n]){if(!(Yt(t)&&(Y.tagNameCheck instanceof RegExp&&Ty(Y.tagNameCheck,t)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(t))&&(Y.attributeNameCheck instanceof RegExp&&Ty(Y.attributeNameCheck,n)||Y.attributeNameCheck instanceof Function&&Y.attributeNameCheck(n))||"is"===n&&Y.allowCustomizedBuiltInElements&&(Y.tagNameCheck instanceof RegExp&&Ty(Y.tagNameCheck,e)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(e))))return!1}else if(vt[n]);else if(Ty(U,Cy(e,H,"")));else if("src"!==n&&"xlink:href"!==n&&"href"!==n||"script"===t||0!==ky(e,"data:")||!pt[t]){if(Q&&!Ty(P,Cy(e,H,"")));else if(e)return!1}else;return!0},Yt=function(t){return"annotation-xml"!==t&&Sy(t,V)},Xt=function(t){jt("beforeSanitizeAttributes",t,null);var n=t.attributes;if(n){for(var r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:G},i=n.length,u=function(){var u=n[i],a=u.name,c=u.namespaceURI,s=u.value,l=Et(a),f="value"===a?s:Oy(s),d=f;if(r.attrName=l,r.attrValue=f,r.keepAttr=!0,r.forceKeepAttr=void 0,jt("uponSanitizeAttribute",t,r),f=r.attrValue,r.forceKeepAttr)return 0;if(!r.keepAttr)return Pt(a,t),0;if(!Z&&Ty(/\/>/i,f))return Pt(a,t),0;tt&&vy([F,R,N],function(t){f=Cy(f,t," ")});var m=Et(t.nodeName);if(!qt(m,l,f))return Pt(a,t),0;if(!st||"id"!==l&&"name"!==l||(Pt(a,t),f="user-content-"+f),nt&&Ty(/((--!?|])>)|<\/(style|title)/i,f))return Pt(a,t),0;if(o&&"object"===A(h)&&"function"==typeof h.getAttributeType)if(c);else switch(h.getAttributeType(m,l)){case"TrustedHTML":f=o.createHTML(f);break;case"TrustedScriptURL":f=o.createScriptURL(f)}if(f!==d)try{c?t.setAttributeNS(c,a,f):t.setAttribute(a,f),Ut(t)?zt(t):by(e.removed)}catch(t){}};i--;)u();jt("afterSanitizeAttributes",t,null)}},Kt=function t(n){var e=null,o=Vt(n);for(jt("beforeSanitizeShadowDOM",n,null);e=o.nextNode();)jt("uponSanitizeShadowNode",e,null),Gt(e)||(e.content instanceof a&&t(e.content),Xt(e));jt("afterSanitizeShadowDOM",n,null)};return e.sanitize=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,u=null,c=null,l=null;if((Ct=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Wt(t)){if("function"!=typeof t.toString)throw Ey("toString is not a function");if("string"!=typeof(t=t.toString()))throw Ey("dirty is not a string, aborting")}if(!e.isSupported)return t;if(ot||Bt(n),e.removed=[],"string"==typeof t&&(ft=!1),ft){if(t.no
2deName){var f=Et(t.nodeName);if(!W[f]||X[f])throw Ey("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof s)(u=(r=Ht("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType===ex&&"BODY"===u.nodeName||"HTML"===u.nodeName?r=u:r.appendChild(u);else{if(!it&&!tt&&!et&&-1===t.indexOf("<"))return o&&at?o.createHTML(t):t;if(!(r=Ht(t)))return it?null:at?O:""}r&&rt&&zt(r.firstChild);for(var d=Vt(ft?t:r);c=d.nextNode();)Gt(c)||(c.content instanceof a&&Kt(c.content),Xt(c));if(ft)return t;if(it){if(ut)for(l=D.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(G.shadowroot||G.shadowrootmode)&&(l=B.call(i,l,!0)),l}var m=et?r.outerHTML:r.innerHTML;return et&&W["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Ty(Zy,r.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+m),tt&&vy([F,R,N],function(t){m=Cy(m,t," ")}),o&&at?o.createHTML(m):m},e.setConfig=function(){Bt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),ot=!0},e.clearConfig=function(){Dt=null,ot=!1},e.isValidAttribute=function(t,n,e){Dt||Bt({});var o=Et(t),r=Et(n);return qt(o,r,e)},e.addHook=function(t,n){"function"==typeof n&&(I[t]=I[t]||[],yy(I[t],n))},e.removeHook=function(t){if(I[t])return by(I[t])},e.removeHooks=function(t){I[t]&&(I[t]=[])},e.removeAllHooks=function(){I={}},e}(),lx=function(t){return sx().sanitize(t)},fx=tinymce.util.Tools.resolve("tinymce.util.I18n"),dx={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},mx="temporary-placeholder",gx=function(t){return function(){return It(t,mx).getOr("!not found!")}},px=function(t,n){var e=t.toLowerCase();if(fx.isRtl()){var o=function(t,n){return Gt(t,n)?t:function(t,n){return t+n}(t,n)}(e,"-rtl");return Ft(n,o)?o:e}return e},hx=function(t,n){return It(n,px(t,n))},vx=function(t,n){var e=n();return hx(t,e).getOrThunk(gx(e))},bx=function(){return Rh("add-focusable",[Ou(function(t){fs(t.element,"svg").each(function(t){return Hn(t,"focusable","false")})})])},yx=function(t,n,e,o){var r,i,u=function(t){return!!fx.isRtl()&&Ft(dx,t)}(n)?["tox-icon--flip"]:[],a=It(e,px(n,e)).or(o).getOrThunk(gx(e));return{dom:{tag:t.tag,attributes:null!==(r=t.attributes)&&void 0!==r?r:{},classes:t.classes.concat(u),innerHtml:a},behaviours:zu([].concat(w(null!==(i=t.behaviours)&&void 0!==i?i:[]),[bx()]))}},xx=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:G.none();return yx(n,t,e(),o)},wx={success:"checkmark",error:"warning",err:"error",warning:"warning",warn:"warning",info:"info"},Sx=Qm({name:"Notification",factory:function(t){var n,e,o,r,i,u=mc("notification-text"),a=jb({dom:Wb("<p id=".concat(u,">").concat(lx(t.backstageProvider.translate(t.text)),"</p>")),behaviours:zu([Fh.config({})])}),c=function(t){return{dom:{tag:"div",classes:["tox-bar"],styles:{width:"".concat(t,"%")}}}},s=function(t){return{dom:{tag:"div",classes:["tox-text"],innerHtml:"".concat(t,"%")}}},l=jb({dom:{tag:"div",classes:t.progress?["tox-progress-bar","tox-progress-indicator"]:["tox-progress-bar"]},components:[{dom:{tag:"div",classes:["tox-bar-container"]},components:[c(0)]},s(0)],behaviours:zu([Fh.config({})])}),f={updateProgress:function(t,n){t.getSystem().isConnected()&&l.getOpt(t).each(function(t){Fh.set(t,[{dom:{tag:"div",classes:["tox-bar-container"]},components:[c(n)]},s(n)])})},updateText:function(t,n){if(t.getSystem().isConnected()){var e=a.get(t);Fh.set(e,[Qc(n)])}}},d=st([t.icon.toArray(),t.level.toArray(),t.level.bind(function(t){return G.from(wx[t])}).toArray()]),m=jb(Ub.sketch({dom:{tag:"button",classes:["tox-notification__dismiss","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":t.backstageProvider.translate("Close")}},components:[xx("close",{tag:"span",classes:["tox-icon"]},t.iconProvider)],buttonBehaviours:zu([Yb.config({}),ry.config(_({},t.backstageProvider.tooltips.getConfig({tooltipText:t.backstageProvider.translate("Close")})))]),action:function(n){t.onAction(n)}})),g=(n=d,e={tag:"div",classes:["tox-notification__icon"]},o=t.iconProvider,r=o(),i=at(n,function(t){return Ft(r,px(t,r))}),yx(e,i.getOr(mx),r,G.none())),p=[g,{dom:{tag:"div",classes:["tox-notification__body"]},components:[a.asSpec()],behaviours:zu([Fh.config({})])}];return{uid:t.uid,dom:{tag:"div",attributes:{role:"alert","aria-labelledby":u},classes:t.level.map(function(t){return["tox-notification","tox-notification--in","tox-notification--".concat(t)]}).getOr(["tox-notification","tox-notification--in"])},behaviours:zu([Yb.config({}),Hh.config({}),Oh.config({mode:"special",onEscape:function(n){return t.onAction(n),G.some(!0)}})]),components:p.concat(t.progress?[l.asSpec()]:[]).concat([m.asSpec()]),apis:f}},configFields:[Lr("level"),Dr("progress"),Lr("icon"),Dr("onAction"),Dr("text"),Dr("iconProvider"),Dr("backstageProvider")],apis:{updateProgress:function(t,n,e){t.updateProgress(n,e)},updateText:function(t,n,e){t.updateText(n,e)}}}),Cx=function(t,n,e,o){var r=n.backstage.shared,i=function(){return $t.fromDom(""===t.queryCommandValue("ToggleView")?t.getContentAreaContainer():t.getContainer())},u=function(){var t=fo(i());return G.some(t)},a=function(t){u().each(function(n){et(t,function(t){ee(t.element,"width"),ge(t.element)>n.width&&Xn(t.element,"width",n.width+"px")})})};return{open:function(n,c,s){var l=function(){var n=function(n,e){Tv.hide(n),o.clear(),e&&t.focus()},e=function(t,n){n&&Oh.focusIn(t)};o.on(function(t){c();var o=s();!function(t){Fh.remove(t,f),v()}(t),function(t,o){0===kn(t.element).length?n(t,o):e(t,o)}(t,o)})},f=es(Sx.sketch({text:n.text,level:$(["success","error","warning","warn","info"],n.type)?n.type:void 0,progress:!0===n.progressBar,icon:n.icon,onAction:l,iconProvider:r.providers.icons,backstageProvider:r.providers}));if(o.isSet()){var d=os(f);o.on(function(t){Fh.append(t,d),Tv.reposition(t),ac.refresh(t),a(t.components())})}
2else{var m=es(Tv.sketch(_(_({dom:{tag:"div",classes:["tox-notifications-container"],attributes:{"aria-label":"Notifications",role:"region"}},lazySink:r.getSink,fireDismissalEventInstead:{}},r.header.isPositionedAtTop()?{}:{fireRepositionEventInstead:{}}),{},{inlineBehaviours:zu([Oh.config({mode:"cyclic",selector:".tox-notification, .tox-notification a, .tox-notification button"}),Fh.config({})].concat(w(Bb(t)&&!r.header.isPositionedAtTop()?[]:[ac.config({contextual:{lazyContext:function(){return G.some(fo(i()))},fadeInClass:"tox-notification-container-dock-fadein",fadeOutClass:"tox-notification-container-dock-fadeout",transitionClass:"tox-notification-container-dock-transition"},modes:["top"],lazyViewport:function(n){return Hb(t,n.element).map(function(t){return{bounds:Vb(t),optScrollEnv:G.some({currentScrollTop:t.element.dom.scrollTop,scrollElmTop:fe(t.element).top})}}).getOrThunk(function(){return{bounds:po(),optScrollEnv:G.none()}})}})])))}))),g=os(f),p={maxHeightFunction:Fl()},h=_(_({},r.anchors.banner()),{},{overrides:p});o.set(m),e.add(m),Tv.showWithinBounds(m,g,{anchor:h},u)}M(n.timeout)&&n.timeout>0&&Ev.setEditorTimeout(t,function(){l()},n.timeout);var v=function(){o.on(function(t){Tv.reposition(t),ac.refresh(t),a(t.components())})};return{close:l,reposition:v,text:function(t){Sx.updateText(f,t)},settings:n,getEl:function(){return f.element.dom},progressBar:{value:function(t){Sx.updateProgress(f,t)}}}},close:function(t){t.close()},getArgs:function(t){return t.settings}}},kx=function(t,n){var e=function(t,n){su(t,Oi(),{raw:n})},o=function(){return t.getMenu().bind(Eg.getHighlighted)};n.on("keydown",function(n){var r=n.which;t.isActive()&&(t.isMenuOpen()?13===r?(o().each(lu),n.preventDefault()):40===r?(o().fold(function(){t.getMenu().each(Eg.highlightFirst)},function(t){e(t,n)}),n.preventDefault(),n.stopImmediatePropagation()):37!==r&&38!==r&&39!==r||o().each(function(t){e(t,n),n.preventDefault(),n.stopImmediatePropagation()}):13!==r&&38!==r&&40!==r||t.cancelIfNecessary())}),n.on("NodeChange",function(){!t.isActive()||t.isProcessingAction()||n.queryCommandState("mceAutoCompleterInRange")||t.cancelIfNecessary()})};!function(t){t[t.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",t[t.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX"}(cx||(cx={}));var Ox,_x,Tx=cx,Ex="tox-menu-nav__js",Dx="tox-collection__item",Ax="tox-swatch",Mx={normal:Ex,color:Ax},Bx="tox-collection__item--enabled",Ix="tox-collection__item-icon",Fx="tox-collection__item-label",Rx="tox-collection__item-caret",Nx="tox-collection__item--active",Lx="tox-collection__item-container",zx="tox-collection__item-container--row",Px=function(t){return It(Mx,t).getOr(Ex)},Hx=function(t){return"color"===t?"tox-swatches":"tox-menu"},Vx=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:Hx(t),tieredMenu:"tox-tiered-menu"}},Ux=function(t){var n=Vx(t);return{backgroundMenu:n.backgroundMenu,selectedMenu:n.selectedMenu,menu:n.menu,selectedItem:n.selectedItem,item:Px(t)}},Wx=function(t,n,e){var o=Vx(e);return{tag:"div",classes:st([[o.menu,"tox-menu-".concat(n,"-column")],t?[o.hasIcons]:[]])}},jx=[hv.parts.items({})],Gx=function(t,n,e){var o=Vx(e);return{dom:{tag:"div",classes:st([[o.tieredMenu]])},markers:Ux(e)}},qx=N([Lr("data"),Gr("inputAttributes",{}),Gr("inputStyles",{}),Gr("tag","input"),Gr("inputClasses",[]),Za("onSetValue"),Gr("styles",{}),Gr("eventOrder",{}),Kd("inputBehaviours",[Xd,Hh]),Gr("selectOnFocus",!0)]),Yx=function(t){return zu([Hh.config({onFocus:t.selectOnFocus?function(t){var n=t.element,e=zc(n);n.dom.setSelectionRange(0,e.length)}:I})])},Xx=function(t){return _(_({},Yx(t)),$d(t.inputBehaviours,[Xd.config({store:_(_({mode:"manual"},t.data.map(function(t){return{initialValue:t}}).getOr({})),{},{getValue:function(t){return zc(t.element)},setValue:function(t,n){zc(t.element)!==n&&Pc(t.element,n)}}),onSetValue:t.onSetValue})]))},Kx=function(t){return{tag:t.tag,attributes:_({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Jx=Qm({name:"Input",configFields:qx(),factory:function(t,n){return{uid:t.uid,dom:Kx(t),components:[],behaviours:Xx(t),eventOrder:t.eventOrder}}}),$x=mc("refetch-trigger-event"),Qx=mc("redirect-menu-item-interaction"),Zx="tox-menu__searcher",tw=function(t){return ds(t.element,".".concat(Zx)).bind(function(n){return t.getSystem().getByDom(n).toOptional()})},nw=tw,ew=function(t){return{fetchPattern:Xd.getValue(t),selectionStart:t.element.dom.selectionStart,selectionEnd:t.element.dom.selectionEnd}},ow="tox-collection--results__js",rw=function(t){var n;return t.dom?_(_({},t),{},{dom:_(_({},t.dom),{},{attributes:_(_({},null!==(n=t.dom.attributes)&&void 0!==n?n:{}),{},{id:mc("aria-item-search-result-id"),"aria-selected":"false"})})}):t},iw=function(t,n){return function(e){var o=tt(e,n);return nt(o,function(n){return{dom:t,components:n}})}},uw=function(t,n){var e=[],o=[];return et(t,function(t,r){n(t,r)?(o.length>
20&&e.push(o),o=[],(Ft(t.dom,"innerHtml")||t.components&&t.components.length>0)&&o.push(t)):o.push(t)}),o.length>0&&e.push(o),nt(e,function(t){return{dom:{tag:"div",classes:["tox-collection__group"]},components:t}})},aw=function(t,n,e){return hv.parts.items({preprocess:function(o){var r=nt(o,e);return"auto"!==t&&t>1?iw({tag:"div",classes:["tox-collection__group"]},t)(r):uw(r,function(t,e){return"separator"===n[e].type})}})},cw=function(t,n){return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[aw(t,n,L)]}},sw=function(t){return Q(t,function(t){return"icon"in t&&void 0!==t.icon})},lw=function(t){return console.error(Cr(t)),console.log(t),G.none()},fw=function(t,n,e,o,r){var i,u=(i=e,{dom:{tag:"div",classes:["tox-collection","tox-collection--horizontal"]},components:[hv.parts.items({preprocess:function(t){return uw(t,function(t,n){return"separator"===i[n].type})}})]});return{value:t,dom:u.dom,components:u.components,items:e}},dw=function(t,n,e,o,r){if("color"===r.menuType){var i=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-swatches-menu"]},components:[{dom:{tag:"div",classes:["tox-swatches"]},components:[hv.parts.items({preprocess:"auto"!==t?iw({tag:"div",classes:["tox-swatches__row"]},t):L})]}]}}(o);return{value:t,dom:i.dom,components:i.components,items:e}}if("normal"===r.menuType&&"auto"===o){var u=cw(o,e);return{value:t,dom:u.dom,components:u.components,items:e}}if("normal"===r.menuType||"searchable"===r.menuType){var a="searchable"!==r.menuType?cw(o,e):"search-with-field"===r.searchMode.searchMode?function(t,n,e){var o,r,i,u,a=mc("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection"].concat(1===t?["tox-collection--list"]:["tox-collection--grid"])},components:[(o={i18n:fx.translate,placeholder:e.placeholder},r=function(t,n){return n.cut(),G.none()},i=function(t,n){var e={interactionEvent:n.event,eventType:n.event.raw.type};return su(t,Qx,e),G.some(!0)},u="searcher-events",{dom:{tag:"div",classes:[Dx]},components:[Jx.sketch({inputClasses:[Zx,"tox-textfield"],inputAttributes:_(_({},o.placeholder.map(function(t){return{placeholder:o.i18n(t)}}).getOr({})),{},{type:"search","aria-autocomplete":"list"}),inputBehaviours:zu([Rh(u,[vu(Ti(),function(t){cu(t,$x)}),vu(Oi(),function(t,n){"Escape"===n.event.raw.key&&n.stop()})]),Oh.config({mode:"special",onLeft:r,onRight:r,onSpace:r,onEnter:i,onEscape:i,onUp:i,onDown:i})]),eventOrder:{keydown:[u,Oh.name()]}})]}),{dom:{tag:"div",classes:[].concat(w(1===t?["tox-collection--list"]:["tox-collection--grid"]),[ow]),attributes:{id:a}},components:[aw(t,n,rw)]}]}}(o,e,r.searchMode):function(t,n){var e=mc("aria-controls-search-results");return{dom:{tag:"div",classes:["tox-menu","tox-collection",ow].concat(1===t?["tox-collection--list"]:["tox-collection--grid"]),attributes:{id:e}},components:[aw(t,n,rw)]}}(o,e);return{value:t,dom:a.dom,components:a.components,items:e}}if("listpreview"===r.menuType&&"auto"!==o){var c=function(t){return{dom:{tag:"div",classes:["tox-menu","tox-collection","tox-collection--toolbar","tox-collection--toolbar-lg"]},components:[hv.parts.items({preprocess:iw({tag:"div",classes:["tox-collection__group"]},t)})]}}(o);return{value:t,dom:c.dom,components:c.components,items:e}}return{value:t,dom:Wx(n,o,r.menuType),components:jx,items:e}},mw=Mr("type"),gw=Mr("name"),pw=Mr("label"),hw=Mr("text"),vw=Mr("title"),bw=Mr("icon"),yw=Mr("value"),xw=Ir("fetch"),ww=Ir("getSubmenuItems"),Sw=Ir("onAction"),Cw=Ir("onItemAction"),kw=$r("onSetup",function(){return I}),Ow=Hr("name"),_w=Hr("text"),Tw=Hr("role"),Ew=Hr("icon"),Dw=Hr("tooltip"),Aw=Hr("label"),Mw=Hr("shortcut"),Bw=Ur("select"),Iw=Jr("active",!1),Fw=Jr("borderless",!1),Rw=Jr("enabled",!0),Nw=Jr("primary",!1),Lw=function(t){return Gr("columns",t)},zw=Gr("meta",{}),Pw=$r("onAction",I),Hw=function(t){return Xr("type",t)},Vw=function(t){return _r("name","name",Uo(function(){return mc("".concat(t,"-name"))}),fr)},Uw=or([mw,_w]),Ww=or([Hw("autocompleteitem"),Iw,Rw,zw,yw,_w,Ew]),jw=[Rw,Dw,Ew,_w,kw,Xr("context","mode:design")],Gw=or([mw,Sw,Mw].concat(jw)),qw=function(t){return xr("toolbarbutton",Gw,t)},Yw=[Iw].concat(jw),Xw=or(Yw.concat([mw,Sw,Mw])),Kw=function(t){return xr("ToggleButton",Xw,t)},Jw=[$r("predicate",W),Kr("scope","node",["node","editor"]),Kr("position","selection",["node","selection","line"])],$w=jw.concat([Hw("contextformbutton"),Nw,Sw,Tr("original",L)]),Qw=Yw.concat([Hw("contextformbutton"),Nw,Sw,Tr("original",L)]),Zw=jw.concat([Hw("contextformbutton")]
2),tS=Yw.concat([Hw("contextformtogglebutton")]),nS=kr("type",{contextformbutton:$w,contextformtogglebutton:Qw}),eS=or([Hw("contextform"),$r("initValue",N("")),Aw,Nr("commands",nS),zr("launch",kr("type",{contextformbutton:Zw,contextformtogglebutton:tS}))].concat(Jw)),oS=or([Hw("contexttoolbar"),Mr("items")].concat(Jw)),rS=[mw,Mr("src"),Hr("alt"),Qr("classes",[],fr)],iS=or(rS),uS=[mw,hw,Ow,Qr("classes",["tox-collection__item-label"],fr)],aS=or(uS),cS=tr(function(){return vr("type",{cardimage:iS,cardtext:aS,cardcontainer:sS})}),sS=or([mw,Xr("direction","horizontal"),Xr("align","left"),Xr("valign","middle"),Nr("items",cS)]),lS=[Rw,_w,Tw,Mw,(Ox="menuitem",_r("value","value",Uo(function(){return mc("".concat(Ox,"-value"))}),cr())),zw,Xr("context","mode:design")],fS=or([mw,Aw,Nr("items",cS),kw,Pw].concat(lS)),dS=or([mw,Iw,Ew].concat(lS)),mS=[mw,Mr("fancytype"),Pw],gS=[Gr("initData",{})].concat(mS),pS=[Ur("select"),Zr("initData",{},[Jr("allowCustomColors",!0),Xr("storageKey","default"),Wr("colors",cr())])].concat(mS),hS=kr("fancytype",{inserttable:gS,colorswatch:pS}),vS=or([mw,kw,Pw,Ew].concat(lS)),bS=or([mw,ww,kw,Ew].concat(lS)),yS=or([mw,Ew,Iw,kw,Sw].concat(lS)),xS=function(t,n,e){var o=wf(t.element,"."+e);if(o.length>0){var r=ct(o,function(t){var e=t.dom.getBoundingClientRect().top,r=o[0].dom.getBoundingClientRect().top;return Math.abs(e-r)>n}).getOr(o.length);return G.some({numColumns:r,numRows:Math.ceil(o.length/r)})}return G.none()},wS=function(t,n){return zu([Rh(t,n)])},SS=function(t){return wS(mc("unnamed-events"),t)},CS=function(t){return vg.config({disabled:t,disableClass:"tox-collection__item--state-disabled"})},kS=function(t){return vg.config({disabled:t})},OS=function(t){return vg.config({disabled:t,disableClass:"tox-tbtn--disabled"})},_S=function(t){return vg.config({disabled:t,disableClass:"tox-tbtn--disabled",useNative:!1})},TS=function(t,n){var e=t.getApi(n);return function(t){t(e)}},ES=function(t,n){return Ou(function(e){TS(t,e)(function(e){var o=t.onSetup(e);D(o)&&n.set(o)})})},DS=function(t,n){return _u(function(e){return TS(t,e)(n.get())})},AS="silver.uistate",MS=function(t,n){var e=t.mainUi.outerContainer.element,o=[t.mainUi.mothership].concat(w(t.uiMotherships));"setDisabled"===n&&et(o,function(t){t.broadcastOn([Dd()],{target:e})}),et(o,function(t){t.broadcastOn([AS],n)})},BS=function(t,n){t.on("init SwitchMode",function(t){MS(n,t.type)}),t.on("NodeChange",function(e){t.ui.isEnabled()?MS(n,e.type):MS(n,"setDisabled")}),Rv(t)&&t.mode.set("readonly")},IS=function(t){return Qs.config({channels:T({},AS,{onReceive:function(n,e){if("setDisabled"!==e&&"setEnabled"!==e){var o=t(),r=o.contextType,i=o.shouldDisable;("mode"!==r||$(["switchmode","init"],e))&&vg.set(n,i)}else vg.set(n,"setDisabled"===e)}})})},FS=function(t,n){return Eu(function(e,o){TS(t,e)(t.onAction),t.triggersSubmenu||n!==Tx.CLOSE_ON_EXECUTE||(e.getSystem().isConnected()&&cu(e,ji()),o.stop())})},RS=T({},Hi(),["disabling","alloy.base.behaviour","toggling","item-events"]),NS=Lt,LS=function(t,n,e,o){var r=ho(I);return{type:"item",dom:n.dom,components:NS(n.optComponents),data:t.data,eventOrder:RS,hasSubmenu:t.triggersSubmenu,itemBehaviours:zu([Rh("item-events",[FS(t,e),ES(t,r),DS(t,r)]),CS(function(){return!t.enabled||o.checkUiComponentContext(t.context).shouldDisable}),IS(function(){return o.checkUiComponentContext(t.context)}),Fh.config({})].concat(t.itemBehaviours))}},zS=function(t){return{value:t.value,meta:_({text:t.text.getOr("")},t.meta)}},PS=function(t){var n=Mv.os.isMacOS()||Mv.os.isiOS(),e=n?{alt:"⌥",ctrl:"⌃",shift:"⇧",meta:"⌘",access:"⌃⌥"}:{meta:"Ctrl",access:"Shift+Alt"},o=t.split("+"),r=nt(o,function(t){var n=t.toLowerCase().trim();return Ft(e,n)?e[n]:t});return n?r.join(""):r.join("+")},HS=function(t,n){return xx(t,{tag:"div",classes:arguments.length>2&&void 0!==arguments[2]?arguments[2]:[Ix]},n)},VS=function(t){return{dom:{tag:"div",classes:[Fx]},components:[Qc(fx.translate(t))]}},US=function(t,n){return{dom:{tag:"div",classes:n,innerHtml:t}}},WS=function(t,n){return{dom:{tag:"div",classes:[Fx]},components:[{dom:{tag:t.tag,styles:t.styles},components:[Qc(fx.translate(n))]}]}},jS=function(t){return{dom:{tag:"div",classes:["tox-collection__item-accessory"]},components:[Qc(PS(t))]}},GS=function(t){return HS("checkmark",t,["tox-collection__item-checkmark"])},qS=function(t,n,e){var o=t.value,r=t.iconContent.map(function(t){return function(t,n,e){var o=n();return hx(t,o).or(e).getOrThunk(gx(o))}(t,n.icons,e)}),i=t.ariaLabel.map(function(t){return{"aria-label":n.translate(t),"data-mce-name":t}}).getOr({});return{dom:function(){var t=Ax,n=r.getOr(""),e={tag:"div",attributes:i,classes:[t]};return"custom"===o?_(_({},e),{},{tag:"button",classes:[].concat(w(e.classes),["tox-swatches__picker-btn"]),innerHtml:n}):"remove"===o?_(_({},e),{},{classes:[].concat(w(e.classes),["tox-swatch--remove"]),innerHtml:n}):O(o)?_(_({},e),{},{attributes:_(_({},e.attributes),{},{"data-mce-color":o}),styles:{"background-color":o},innerHtml:n}):e}(),optComponents:[]}},YS=function(t){var n=t.map(function(t){return{attributes:{id:mc("menu-item"),"aria-label":fx.translate(t)}
2}}).getOr({});return _({tag:"div",classes:[Ex,Dx]},n)},XS=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:G.none();return"color"===t.presets?qS(t,n,o):function(t,n,e,o){var r={tag:"div",classes:[Ix]},i=e?t.iconContent.map(function(t){return xx(t,r,n.icons,o)}).orThunk(function(){return G.some({dom:r})}):G.none(),u=t.checkMark,a=G.from(t.meta).fold(function(){return VS},function(t){return Ft(t,"style")?P(WS,t.style):VS}),c=t.htmlContent.fold(function(){return t.textContent.map(a)},function(t){return G.some(US(t,[Fx]))});return{dom:YS(t.ariaLabel),optComponents:[i,c,t.shortcutContent.map(jS),u,t.caret]}}(t,n,e,o)},KS=function(t,n,e){return It(t,"tooltipWorker").map(function(t){return[ry.config({lazySink:n.getSink,tooltipDom:{tag:"div",classes:["tox-tooltip-worker-container"]},tooltipComponents:[],anchor:function(t){return{type:"submenu",item:t,overrides:{maxHeightFunction:Fl}}},mode:"follow-highlight",onShow:function(n,e){t(function(t){ry.setComponents(n,[Zc({element:$t.fromDom(t)})])})}})]}).getOrThunk(function(){return e.map(function(t){return[ry.config(_(_({},n.providers.tooltips.getConfig({tooltipText:t})),{},{mode:"follow-highlight"}))]}).getOr([])})},JS=function(t,n){var e=function(t){return Dv.DOM.encode(t)}(fx.translate(t));if(n.length>0){var o=new RegExp(function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(n),"gi");return e.replace(o,function(t){return'<span class="tox-autocompleter-highlight">'.concat(t,"</span>")})}return e},$S=function(t,n){return nt(t,function(t){switch(t.type){case"cardcontainer":return function(t,n){var e="vertical"===t.direction?"tox-collection__item-container--column":zx,o="left"===t.align?"tox-collection__item-container--align-left":"tox-collection__item-container--align-right";return{dom:{tag:"div",classes:[Lx,e,o,function(){switch(t.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:n}}(t,$S(t.items,n));case"cardimage":return function(t,n,e){return{dom:{tag:"img",classes:n,attributes:{src:t,alt:e.getOr("")}}}}(t.src,t.classes,t.alt);case"cardtext":var e=t.name.exists(function(t){return $(n.cardText.highlightOn,t)}),o=e?G.from(n.cardText.matchText).getOr(""):"";return US(JS(t.text,o),t.classes)}})},QS=Mm(sv(),lv()),ZS=function(t){return{value:oC(t)}},tC=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,nC=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,eC=function(t){return tC.test(t)||nC.test(t)},oC=function(t){return Ut(t,"#").toUpperCase()},rC=function(t){var n=function(t){var n=t.value.replace(tC,function(t,n,e,o){return n+n+e+e+o+o});return{value:n}}(t),e=nC.exec(n.value);return null===e?["FFFFFF","FF","FF","FF"]:e},iC=function(t){var n=t.toString(16);return(1===n.length?"0"+n:n).toUpperCase()},uC=function(t){var n=iC(t.red)+iC(t.green)+iC(t.blue);return ZS(n)},aC=Math.min,cC=Math.max,sC=Math.round,lC=/^\s*rgb\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*\)\s*$/i,fC=/^\s*rgba\s*\(\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*(\d+)\s*[,\s]\s*((?:\d?\.\d+|\d+)%?)\s*\)\s*$/i,dC=function(t,n,e,o){return{red:t,green:n,blue:e,alpha:o}}
2,mC=function(t){var n=parseInt(t,10);return n.toString()===t&&n>=0&&n<=255},gC=function(t){var n,e,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100;if(i=cC(0,aC(i,1)),u=cC(0,aC(u,1)),0===i)return n=e=o=sC(255*u),dC(n,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 n=sC(255*(n+l)),e=sC(255*(e+l)),o=sC(255*(o+l)),dC(n,e,o,1)},pC=function(t){var n=rC(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return dC(e,o,r,1)},hC=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return dC(r,i,u,a)},vC=function(t){var n=lC.exec(t);if(null!==n)return G.some(hC(n[1],n[2],n[3],"1"));var e=fC.exec(t);return null!==e?G.some(hC(e[1],e[2],e[3],e[4])):G.none()},bC=function(t){return"rgba(".concat(t.red,",").concat(t.green,",").concat(t.blue,",").concat(t.alpha,")")},yC=dC(255,0,0,1),xC=function(t,n){t.dispatch("ResizeContent",n)},wC=function(t,n){t.dispatch("TextColorChange",n)},SC=function(t,n){return t.dispatch("ResolveName",{name:n.nodeName.toLowerCase(),target:n})},CC=function(t,n){return function(){t(),n()}},kC=function(t){return _C(t,"NodeChange",function(n){n.setEnabled(t.selection.isEditable())})},OC=function(t,n){return function(e){var o=kC(t)(e),r=function(t,n){return function(e){var o=bo(),r=function(){e.setActive(t.formatter.match(n));var r=t.formatter.formatChanged(n,e.setActive);o.set(r)};return t.initialized?r():t.once("init",r),function(){t.off("init",r),o.clear()}}}(t,n)(e);return function(){o(),r()}}},_C=function(t,n,e){return function(o){var r=function(){return e(o)},i=function(){e(o),t.on(n,r)};return t.initialized?i():t.once("init",i),function(){t.off("init",i),t.off(n,r)}}},TC=function(t){return function(n){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("mceToggleFormat",!1,n.format)})}}},EC=function(t,n){return function(){return t.execCommand(n)}},DC=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),AC={},MC=function(t){var n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=DC.getItem(t),r=f(o)?JSON.parse(o):[],i=e-(n=r).length<0?n.slice(0,e):n,u=function(t){i.splice(t,1)};return{add:function(n){(function(t,n){var e=J(t,n);return-1===e?G.none():G.some(e)})(i,n).each(u),i.unshift(n),i.length>e&&i.pop(),DC.setItem(t,JSON.stringify(i))},state:function(){return i.slice(0)}}},BC=function(t){return It(AC,t).getOrThunk(function(){var n="tinymce-custom-colors-".concat(t),e=DC.getItem(n);if(k(e)){var o=DC.getItem("tinymce-custom-colors");DC.setItem(n,O(o)?o:"[]")}var r=MC(n,10);return AC[t]=r,r})},IC=function(t,n){BC(t).add(n)},FC=function(t,n,e){return{hue:t,saturation:n,value:e}},RC=function(t){var n,e=0,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?FC(0,0,100*(o=a)):(e=60*((e=r===a?3:u===a?1:5)-(r===a?i-u:u===a?r-i:u-r)/(c-a)),n=(c-a)/c,o=c,FC(Math.round(e),Math.round(100*n),Math.round(100*o)))},NC=function(t){return uC(gC(t))},LC=function(t){return(n=t,eC(n)?G.some({value:oC(n)}):G.none()).orThunk(function(){return vC(t).map(uC)}).getOrThunk(function(){var n=document.createElement("canvas");n.height=1,n.width=1;var e=n.getContext("2d");e.clearRect(0,0,n.width,n.height),e.fillStyle="#FFFFFF",e.fillStyle=t,e.fillRect(0,0,1,1);var o=e.getImageData(0,0,1,1).data,r=o[0],i=o[1],u=o[2],a=o[3];return uC(dC(r,i,u,a))});var n},zC="forecolor",PC="hilitecolor",HC=function(t){for(var n=[],e=0;e<t.length;e+=2)n.push({text:t[e+1],value:t[e],icon:"checkmark",type:"choiceitem"});return n},VC=function(t){return function(n){return n.options.get(t)}},UC="#000000",WC=function(t,n){return n===zC&&t.options.isSet("color_map_foreground")?VC("color_map_foreground")(t):n===PC&&t.options.isSet("color_map_background")?VC("color_map_background")(t):t.options.isSet("color_map_raw")?VC("color_map_raw")(t):VC("color_map")(t)},jC=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";return Math.max(5,Math.ceil(Math.sqrt(WC(t,n).length)))},GC=function(t,n){var e=VC("color_cols")(t),o=jC(t,n);return e===jC(t)?o:e},qC=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";return Math.round(n===zC?VC("color_cols_foreground")(t):n===PC?VC("color_cols_background")(t):VC("color_cols")(t))},YC=VC("custom_colors"),XC=VC("color_default_foreground"),KC=VC("color_default_background"),JC=function(t){return ci(t,function(t){if(an(t)){var n=$n(t,"background-color");return Ht(function(t){return vC(t).exists(function(t){return 0!==t.alpha})}(n),n)}return G.none()}).getOr("rgba(0, 0, 0, 0)")},$C=function(t,n){var e=$t.fromDom(t.selection.getStart()),o="hilitecolor"===n?JC(e):$n(e,"color");return vC(o).map(function(t){return"#"+uC(t).value})}
2,QC=function(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]},ZC=function(t,n,e,o){"custom"===e?ck(t)(function(e){e.each(function(e){IC(n,e),t.execCommand("mceApplyTextcolor",n,e),o(e)})},$C(t,n).getOr(UC)):"remove"===e?(o(""),t.execCommand("mceRemoveTextcolor",n)):(o(e),t.execCommand("mceApplyTextcolor",n,e))},tk=function(t,n,e){return t.concat(function(t){return nt(BC(t).state(),function(t){return{type:"choiceitem",text:t,icon:"checkmark",value:t}})}(n).concat(QC(e)))},nk=function(t,n,e){return function(o){o(tk(t,n,e))}},ek=function(t,n,e){var o="forecolor"===n?"tox-icon-text-color__color":"tox-icon-highlight-bg-color__color";t.setIconFill(o,e)},ok=function(t,n){t.setTooltip(n)},rk=function(t,n){return function(e){var o=$C(t,n);return Nt(o,e.toUpperCase())}},ik=function(t,n,e){if(Xt(e))return"forecolor"===n?"Text color":"Background color";var o="forecolor"===n?"Text color {0}":"Background color {0}",r=tk(WC(t,n),n,!1),i=at(r,function(t){return t.value===e}).getOr({text:""}).text;return t.translate([o,t.translate(i)])},uk=function(t,n,e,o){t.ui.registry.addSplitButton(n,{tooltip:ik(t,e,o.get()),presets:"color",icon:"forecolor"===n?"text-color":"highlight-bg-color",select:rk(t,e),columns:qC(t,e),fetch:nk(WC(t,e),e,YC(t)),onAction:function(n){ZC(t,e,o.get(),I)},onItemAction:function(r,i){ZC(t,e,i,function(e){o.set(e),wC(t,{name:n,color:e})})},onSetup:function(r){ek(r,n,o.get());var i=function(o){o.name===n&&(ek(r,o.name,o.color),ok(r,ik(t,e,o.color)))};return t.on("TextColorChange",i),CC(kC(t)(r),function(){t.off("TextColorChange",i)})}})},ak=function(t,n,e,o,r){t.ui.registry.addNestedMenuItem(n,{text:o,icon:"forecolor"===n?"text-color":"highlight-bg-color",onSetup:function(o){return ok(o,ik(t,e,r.get())),ek(o,n,r.get()),kC(t)(o)},getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"colorswatch",select:rk(t,e),initData:{storageKey:e},onAction:function(o){ZC(t,e,o.value,function(e){r.set(e),wC(t,{name:n,color:e})})}}]}})},ck=function(t){return function(n,e){var o=!1,r={colorpicker:e};t.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:r,onAction:function(t,n){"hex-valid"===n.name&&(o=n.value)},onSubmit:function(e){var r=e.getData().colorpicker;o?(n(G.from(r)),e.close()):t.windowManager.alert(t.translate(["Invalid hex color code: {0}",r]))},onClose:I,onCancel:function(){n(G.none())}})}},sk=function(t,n,e,o,r,i,u,a){var c=sw(n),s=lk(n,e,o,"color"!==r?"normal":"color",i,u,a);return dw(t,c,s,o,{menuType:r})},lk=function(t,n,e,o,r,i,u){return Lt(nt(t,function(a){return"choiceitem"===a.type?(c=a,xr("choicemenuitem",dS,c)).fold(lw,function(a){return G.some(function(t,n,e,o,r,i,u){var a=!(arguments.length>7&&void 0!==arguments[7])||arguments[7],c=XS({presets:e,textContent:n?t.text:G.none(),htmlContent:G.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:n?t.shortcut:G.none(),checkMark:n?G.some(GS(u.icons)):G.none(),caret:G.none(),value:t.value},u,a),s=t.text.filter(N(!n)).map(function(t){return ry.config(u.tooltips.getConfig({tooltipText:u.translate(t)}))});return Ho(LS({context:t.context,data:zS(t),enabled:t.enabled,getApi:function(t){return{setActive:function(n){Xh.set(t,n)},isActive:function(){return Xh.isOn(t)},isEnabled:function(){return!vg.isDisabled(t)},setEnabled:function(n){return vg.set(t,!n)}}},onAction:function(n){return o(t.value)},onSetup:function(t){return t.setActive(r),I},triggersSubmenu:!1,itemBehaviours:w(s.toArray())},c,i,u),{toggling:{toggleClass:Bx,toggleOnExecute:!1,selected:t.active,exclusive:!0}})}(a,1===e,o,n,i(a.value),r,u,sw(t)))}):G.none();var c}))},fk=function(t,n){var e=Ux(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"),previousSelector:function(t){return"color"===n?ds(t.element,"[aria-checked=true]"):G.none()}}},dk=function(t,n){var e=t.initData.allowCustomColors&&n.colorinput.hasCustomColors();return t.initData.colors.fold(function(){return tk(n.colorinput.getColors(t.initData.storageKey),t.initData.storageKey,e)},function(t){return t.concat(QC(e))})},mk=mc("cell-over"),gk=mc("cell-execute"),pk=function(t,n,e){var o=function(e){return su(e,gk,{row:t,col:n})},r=function(t,n){n.stop(),o(t)};return es({dom:{tag:"div",attributes:T({role:"button"},"aria-label",e)},behaviours:zu([Rh("insert-table-picker-cell",[vu(Si(),Hh.focus),vu(Hi(),o),vu(Di(),r),vu(Ui(),r)]),Xh.config({toggleClass:"tox-insert-table-picker__selected",toggleOnExecute:!1}),Hh.config({onFocus:function(e){return su(e,mk,{row:t,col:n})}})])})},hk=function(t){return lt(t,function(t){return nt(t,os)})},vk=function(t,n){return Qc("".concat(n,"x").concat(t))},bk={inserttable:function(t,n){var e=function(t){return function(n,e){return t.shared.providers.translate(["{0} columns, {1} rows",e,n])}}(n),o=function(t,n,e){for(var o=[],r=0;r<n;r++){for(var i=[],u=0;u<e;u++){var a=t(r+1,u+1);i.push(pk(r,u,a))}o.push(i)}return o}(e,10,10),r=vk(0,0),i=jb({dom:{tag:"span",classes:["tox-insert-table-picker__label"]},components:[r],behaviours:zu([Fh.config({})])});return{type:"widget",data:{value:mc("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[QS.widget({dom:{tag:"div",classes:["tox-insert-table-picker"]},components:hk(o).concat(i.asSpec()),behaviours:zu([Rh("insert-table-picker",[Ou(function(t){Fh.set(i.get(t),[r])}),wu(mk,function(t,n,e){var r=e.event,u=r.row,a=r.col;!function(t,n,e,o,r){for(var i=0;i<o;i++)for(var u=0;u<r;u++)Xh.set(t[i][u],i<=n&&u<=e)}(o,u,a,10,10),Fh.set(i.get(t),[vk(u+1,a+1)])}),wu(gk,function(n,e,o){var r=o.event,i=r.row,u=r.col;cu(n,ji()),t.onAction({numRows:i+1,numColumns:u+1})})]),Oh.config({initSize:{numRows:10,numColumns:10},mode:"flatgrid",selector:'[role="button"]'})])})]}},colorswatch:function(t,n){var e=dk(t,n),o=n.colorinput.getColorCols(t.initData.storageKey),r="color",i=sk(mc("menu-value"),e,function(n){t.onAction({value:n})},o,r,Tx.CLOSE_ON_EXECUTE,t.select.getOr(W),n.shared.providers),u=_(_({},i),{},{markers:Ux(r),movement:fk(o,r),showMenuRole:!1});return{type:"widget",data:{value:mc("widget-id")},dom:{tag:"div",classes:["tox-fancymenuitem"]},autofocus:!0,components:[QS.widget(hv.sketch(u))]}}},yk=function(t,n,e,o,r,i,u){var a=!(arguments.length>7&&void 0!==arguments[7])||arguments[7],c=XS({presets:o,textContent:G.none(),htmlContent:e?t.text.map(function(t){return JS(t,n)}):G.none(),ariaLabel:t.text,iconContent:t.icon,shortcutContent:G.none(),checkMark:G.none(),caret:G.none(),value:t.value},u.providers,a,t.icon),s=t.text.filter(function(t){return!e&&""!==t});return LS({context:"mode:design",data:zS(t),enabled:t.enabled,getApi:N({}),onAction:function(n){return r(t.value,t.meta)},onSetup:N(I),triggersSubmenu:!1,itemBehaviours:KS(t,u,s)},c,i,u.providers)},xk=function(t){return{type:"separator",dom:{tag:"div",classes:[Dx,"tox-collection__group-heading"]},components:t.text.map(Qc).toArray()}},wk=function(t,n,e){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=XS({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:G.none(),ariaLabel:t.text,caret:G.none(),checkMark:G.none(),shortcutContent:t.shortcut},e,o);return LS({context:t.context,data:zS(t),getApi:function(t){return{isEnabled:function(){return!vg.isDisabled(t)},setEnabled:function(n){return vg.set(t,!n)}}},enabled:t.enabled,onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e)},Sk=function(t,n,e){var o,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4]?(o=e.icons,HS("chevron-down",o,[Rx])):function(t){return HS("chevron-right",t,[Rx])}(e.icons),u=XS({presets:"normal",iconContent:t.icon,textContent:t.text,htmlContent:G.none(),ariaLabel:t.text,caret:G.some(i),checkMark:G.none(),shortcutContent:t.shortcut},e,r);return LS({context:t.context,data:zS(t),getApi:function(t){return{isEnabled:function(){return!vg.isDisabled(t)},setEnabled:function(n){return vg.set(t,!n)},setIconFill:function(n,e){ds(t.element,'svg path[class="'.concat(n,'"], rect[class="').concat(n,'"]')).each(function(t){Hn(t,"fill",e)}
2)},setTooltip:function(n){var o=e.translate(n);Hn(t.element,"aria-label",o)}}},enabled:t.enabled,onAction:I,onSetup:t.onSetup,triggersSubmenu:!0,itemBehaviours:[]},u,n,e)},Ck=function(t,n,e){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=XS({iconContent:t.icon,textContent:t.text,htmlContent:G.none(),ariaLabel:t.text,checkMark:G.some(GS(e.icons)),caret:G.none(),shortcutContent:t.shortcut,presets:"normal",meta:t.meta},e,o);return Ho(LS({context:t.context,data:zS(t),enabled:t.enabled,getApi:function(t){return{setActive:function(n){Xh.set(t,n)},isActive:function(){return Xh.isOn(t)},isEnabled:function(){return!vg.isDisabled(t)},setEnabled:function(n){return vg.set(t,!n)}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:[]},r,n,e),{toggling:{toggleClass:Bx,toggleOnExecute:!1,selected:t.active},role:t.role.getOrUndefined()})},kk=function(t,n){return It(bk,t.fancytype).map(function(e){return e(t,n)})},Ok=function(t,n,e,o){var r={dom:YS(t.label),optComponents:[G.some({dom:{tag:"div",classes:[Lx,zx]},components:$S(t.items,o)})]};return LS({context:"mode:design",data:zS(_({text:G.none()},t)),enabled:t.enabled,getApi:function(t){return{isEnabled:function(){return!vg.isDisabled(t)},setEnabled:function(n){vg.set(t,!n),et(wf(t.element,"*"),function(e){t.getSystem().getByDom(e).each(function(t){t.hasConfigured(vg)&&vg.set(t,!n)})})}}},onAction:t.onAction,onSetup:t.onSetup,triggersSubmenu:!1,itemBehaviours:G.from(o.itemBehaviours).getOr([])},r,n,e.providers)},_k=Object.freeze({__proto__:null,getCoupled:function(t,n,e,o){return e.getOrCreate(t,n,o)},getExistingCoupled:function(t,n,e,o){return e.getExisting(t,n,o)}}),Tk=[Ar("others",yr(Co.value,cr()))],Ek=Object.freeze({__proto__:null,init:function(){var t={},n=function(n,e){if(0===St(n.others).length)throw new Error("Cannot find any known coupled components");return It(t,e)},e=N({});return Lu({readState:e,getExisting:function(t,e,o){return n(e,o).orThunk(function(){return It(e.others,o).getOrDie("No information found for coupled component: "+o),G.none()})},getOrCreate:function(e,o,r){return n(o,r).getOrThunk(function(){var n=It(o.others,r).getOrDie("No information found for coupled component: "+r)(e),i=e.getSystem().build(n);return t[r]=i,i})}})}}),Dk=Hu({fields:Tk,name:"coupling",apis:_k,state:Ek}),Ak=function(t){var n=G.none(),e=[],o=function(t){r()?u(t):e.push(t)},r=function(){return n.isSome()},i=function(t){et(t,u)},u=function(t){n.each(function(n){setTimeout(function(){t(n)},0)})};return t(function(t){r()||(n=G.some(t),i(e),e=[])}),{get:o,map:function(t){return Ak(function(n){o(function(e){n(t(e))})})},isReady:r}},Mk={nu:Ak,pure:function(t){return Ak(function(n){n(t)})}},Bk=function(t){setTimeout(function(){throw t},0)},Ik=function(t){var n=function(n){t().then(n,Bk)};return{map:function(n){return Ik(function(){return t().then(n)})},bind:function(n){return Ik(function(){return t().then(function(t){return n(t).toPromise()})})},anonBind:function(n){return Ik(function(){return t().then(function(){return n.toPromise()})})},toLazy:function(){return Mk.nu(n)},toCached:function(){var n=null;return Ik(function(){return null===n&&(n=t()),n})},toPromise:t,get:n}},Fk=function(t){return Ik(function(){return new Promise(t)})},Rk=function(t){return Ik(function(){return Promise.resolve(t)})},Nk=N("sink"),Lk=N(_m({name:Nk(),overrides:N({dom:{tag:"div"},behaviours:zu([nd.config({useFixed:j})]),events:gu([Su(Oi()),Su(bi()),Su(Di())])})})),zk=function(t,n){var e=t.getHotspot(n).getOr(n),o="hotspot",r=t.getAnchorOverrides();return t.layouts.fold(function(){return{type:o,hotspot:e,overrides:r}},function(t){return{type:o,hotspot:e,overrides:r,layouts:t}})},Pk=function(t,n,e,o,r,i,u){var a=function(t,n,e,o,r,i,u){var a=function(t,n,e){return(0,t.fetch)(e).map(n)}(t,n,o),c=Wk(o,t);return a.map(function(n){return n.bind(function(n){var a=n.menus[n.primary];return G.from(a).each(function(n){t.listRole.each(function(t){n.role=t})}),G.from(_v.sketch(_(_({},i.menu()),{},{uid:xc(""),data:n,highlightOnOpen:u,onOpenMenu:function(t,n){var o=c().getOrDie();nd.position(o,n,{anchor:e}),Ed.decloak(r)},onOpenSubmenu:function(t,n,e){var o=c().getOrDie();nd.position(o,e,{anchor:{type:"submenu",item:n}}),Ed.decloak(r)},onRepositionMenu:function(t,n,o){var r=c().getOrDie();nd.position(r,n,{anchor:e}),et(o,function(t){nd.position(r,t.triggeredMenu,{anchor:{type:"submenu",item:t.triggeringItem}})})},onEscape:function(){return Hh.focus(o),Ed.close(r),G.some(!0)}})))})})}(t,n,zk(t,e),e,o,r,u);return a.map(function(t){return t.fold(function(){Ed.isOpen(o)&&Ed.close(o)},function(t){Ed.cloak(o),Ed.open(o,t),i(o)}),o})},Hk=function(t,n,e,o,r,i,u){return Ed.close(o),Rk(o)},Vk=function(t,n,e,o,r,i){var u=Dk.getCoupled(e,"sandbox");return(Ed.isOpen(u)?Hk:Pk)(t,n,e,u,o,r,i)},Uk=function(t,n,e){var o=og.getCurrent(n).getOr(n),r=ge(t.element);e?Xn(o.element,"min-width",r+"px"):function(t,n){me.set(t,n)}(o.element,r)},Wk=function(t,n){return t.getSystem().getByUid(n.uid+"-"+Nk()).map(function(t){return function(){return Co.value(t)}}).getOrThunk(function(){return n.lazySink.fold(function(){return function(){return Co.error(new Error("No internal sink is specified, nor could an external sink be found"))}},function(n){return function(){return n(t)}})})},jk=function(t){Ed.getState(t).each(function(t){_v.repositionMenus(t)})},Gk=function(t,n,e){var o=ps(),r=Wk(n,t);return{dom:{tag:"div",classes:t.sandboxClasses,attributes:{id:o.id}},behaviours:Zd(t.sandboxBehaviours,[Xd.config({store:{mode:"memory",initialValue:n}}),Ed.config({onOpen:function(r,i){var u=zk(t,n);o.link(n.element),t.matchWidth&&Uk(u.hotspot,i,t.useMinWidth),t.onOpen(u,r,i),void 0!==e&&void 0!==e.onOpen&&e.onOpen(r,i)},onClose:function(t,i){o.unlink(n.element),r().getOr(i).element.dom.dis
2patchEvent(new window.FocusEvent("focusout")),void 0!==e&&void 0!==e.onClose&&e.onClose(t,i)},isPartOf:function(t,e,o){return vs(e,o)||vs(n,o)},getAttachPoint:function(){return r().getOrDie()}}),og.config({find:function(t){return Ed.getState(t).bind(function(t){return og.getCurrent(t)})}}),Qs.config({channels:_(_({},Id({isExtraPart:W})),Rd({doReposition:jk}))})])}},qk=function(t){var n=Dk.getCoupled(t,"sandbox");jk(n)},Yk=function(){return[Gr("sandboxClasses",[]),Qd("sandboxBehaviours",[og,Qs,Ed,Xd])]},Xk=N([Dr("dom"),Dr("fetch"),Za("onOpen"),tc("onExecute"),Gr("getHotspot",G.some),Gr("getAnchorOverrides",N({})),Gl(),Kd("dropdownBehaviours",[Xh,Dk,Oh,Hh]),Dr("toggleClass"),Gr("eventOrder",{}),Lr("lazySink"),Gr("matchWidth",!1),Gr("useMinWidth",!1),Lr("role"),Lr("listRole")].concat(Yk())),Kk=N([Om({schema:[Ja(),Gr("fakeFocus",!1)],name:"menu",defaults:function(t){return{onExecute:t.onExecute}}}),Lk()]),Jk=Zm({name:"Dropdown",configFields:Xk(),partFields:Kk(),factory:function(t,n,e,o){var r,i=function(t){Ed.getState(t).each(function(t){_v.highlightPrimary(t)})},u=function(n,e,r){return Vk(t,L,n,o,e,r)},a={expand:function(t){Xh.isOn(t)||u(t,I,Qg.HighlightNone).get(I)},open:function(t){Xh.isOn(t)||u(t,I,Qg.HighlightMenuAndItem).get(I)},refetch:function(n){return Dk.getExistingCoupled(n,"sandbox").fold(function(){return u(n,I,Qg.HighlightMenuAndItem).map(I)},function(e){return Pk(t,L,n,e,o,I,Qg.HighlightMenuAndItem).map(I)})},isOpen:Xh.isOn,close:function(t){Xh.isOn(t)&&u(t,I,Qg.HighlightMenuAndItem).get(I)},repositionMenus:function(t){Xh.isOn(t)&&qk(t)}},c=function(t,n){return lu(t),G.some(!0)};return{uid:t.uid,dom:t.dom,components:n,behaviours:$d(t.dropdownBehaviours,[Xh.config({toggleClass:t.toggleClass,aria:{mode:"expanded"}}),Dk.config({others:{sandbox:function(n){return Gk(t,n,{onOpen:function(){return Xh.on(n)},onClose:function(){return Xh.off(n)}})}}}),Oh.config({mode:"special",onSpace:c,onEnter:c,onDown:function(t,n){if(Jk.isOpen(t)){var e=Dk.getCoupled(t,"sandbox");i(e)}else Jk.open(t);return G.some(!0)},onEscape:function(t,n){return Jk.isOpen(t)?(Jk.close(t),G.some(!0)):G.none()}}),Hh.config({})]),events:Jh(G.some(function(t){u(t,i,Qg.HighlightMenuAndItem).get(I)})),eventOrder:_(_({},t.eventOrder),{},T({},Hi(),["disabling","toggling","alloy.base.behaviour"])),apis:a,domModification:{attributes:_(_({"aria-haspopup":t.listRole.getOr("true")},t.role.fold(function(){return{}},function(t){return{role:t}})),"button"===t.dom.tag?{type:(r="type",It(t.dom,"attributes").bind(function(t){return It(t,r)})).getOr("button")}:{})}}},apis:{open:function(t,n){return t.open(n)},refetch:function(t,n){return t.refetch(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)}}}),$k=function(t){var n=Xd.getValue(t),e=tw(t).map(ew);Jk.refetch(n).get(function(){var t=Dk.getCoupled(n,"sandbox");e.each(function(n){return tw(t).each(function(t){return function(t,n){Xd.setValue(t,n.fetchPattern),t.element.dom.selectionStart=n.selectionStart,t.element.dom.selectionEnd=n.selectionEnd}(t,n)})})})},Qk=function(t,n){Zk(t).each(function(e){!function(t,n,e,o){var r=_(_({},o),{},{target:n});t.getSystem().triggerEvent(e,n,r)}(t,e.element,n.event.eventType,n.event.interactionEvent)})},Zk=function(t){return Ed.getState(t).bind(Eg.getHighlighted).bind(Eg.getHighlighted)},tO=function(t,n,e){nw(t).each(function(t){var o;!function(t,n){Wn(n.element,"id").each(function(n){return Hn(t.element,"aria-activedescendant",n)})}(t,e),(Zu((o=n).element,ow)?G.some(o.element):ds(o.element,"."+ow)).each(function(n){Wn(n,"id").each(function(n){return Hn(t.element,"aria-controls",n)})})}),Hn(e.element,"aria-selected","true")},nO=function(t,n,e){Hn(e.element,"aria-selected","false")},eO=function(t){return Dk.getExistingCoupled(t,"sandbox").bind(tw).map(ew).map(function(t){return t.fetchPattern}).getOr("")};!function(t){t[t.ContentFocus=0]="ContentFocus",t[t.UiFocus=1]="UiFocus"}(_x||(_x={}));var oO,rO=function(t,n,e,o,r){var i,u=e.shared.providers,a=function(t){return r?_(_({},t),{},{shortcut:G.none(),icon:t.text.isSome()?G.none():t.icon}):t};switch(t.type){case"menuitem":return(i=t,xr("menuitem",vS,i)).fold(l
2w,function(t){return G.some(wk(a(t),n,u,o))});case"nestedmenuitem":return function(t){return xr("nestedmenuitem",bS,t)}(t).fold(lw,function(t){return G.some(Sk(a(t),n,u,o,r))});case"togglemenuitem":return function(t){return xr("togglemenuitem",yS,t)}(t).fold(lw,function(t){return G.some(Ck(a(t),n,u,o))});case"separator":return function(t){return xr("separatormenuitem",Uw,t)}(t).fold(lw,function(t){return G.some(xk(t))});case"fancymenuitem":return function(t){return xr("fancymenuitem",hS,t)}(t).fold(lw,function(t){return kk(t,e)});default:return console.error("Unknown item in general menu",t),G.none()}},iO=function(t,n,e,o,r,i,u){var a=1===o,c=!a||sw(t);return Lt(nt(t,function(t){switch(t.type){case"separator":return(o=t,xr("Autocompleter.Separator",Uw,o)).fold(lw,function(t){return G.some(xk(t))});case"cardmenuitem":return function(t){return xr("cardmenuitem",fS,t)}(t).fold(lw,function(t){return G.some(Ok(_(_({},t),{},{onAction:function(n){t.onAction(n),e(t.value,t.meta)}}),r,i,{itemBehaviours:KS(t.meta,i,G.none()),cardText:{matchText:n,highlightOn:u}}))});default:return function(t){return xr("Autocompleter.Item",Ww,t)}(t).fold(lw,function(t){return G.some(yk(t,n,a,"normal",e,r,i,c))})}var o}))},uO=function(t,n,e,o,r,i){var u=sw(n),a=Lt(nt(n,function(t){var n=function(t){return rO(t,e,o,function(t){return r?!Ft(t,"text"):u}(t),r)};return"nestedmenuitem"===t.type&&t.getSubmenuItems().length<=0?n(_(_({},t),{},{enabled:!1})):n(t)})),c=function(t){return"no-search"===t.searchMode?{menuType:"normal"}:{menuType:"searchable",searchMode:t}}(i);return(r?fw:dw)(t,u,a,1,c)},aO=function(t){return _v.singleData(t.value,t)},cO=function(t){return af($t.fromDom(t.startContainer),t.startOffset,$t.fromDom(t.endContainer),t.endOffset)},sO=function(t,n){var e=mc("autocompleter"),o=ho(!1),r=ho(!1),i=yo(),u=es(Tv.sketch({dom:{tag:"div",classes:["tox-autocompleter"],attributes:{id:e}},components:[],fireDismissalEventInstead:{},inlineBehaviours:zu([Rh("dismissAutocompleter",[vu(Zi(),function(){return f()}),vu(uu(),function(n,e){Wn(e.event.target,"id").each(function(n){return Hn($t.fromDom(t.getBody()),"aria-activedescendant",n)})}
2)])]),lazySink:n.getSink})),a=function(){return Tv.isOpen(u)},c=r.get,s=function(){if(a()){Tv.hide(u),t.dom.remove(e,!1);var n=$t.fromDom(t.getBody());Wn(n,"aria-owns").filter(function(t){return t===e}).each(function(){Gn(n,"aria-owns"),Gn(n,"aria-activedescendant")})}},l=function(){return Tv.getContent(u).bind(function(t){return vt(t.components(),0)})},f=function(){return t.execCommand("mceAutocompleterClose")},d=function(n,e){var o=wt(n,function(t){return G.from(t.columns)}).getOr(1);Tv.showMenuAt(u,{anchor:{type:"selection",getSelection:function(){return i.get().map(cO)},root:$t.fromDom(t.getBody())}},function(t,n,e,o){var r=fk(n,o),i=Ux(o);return{data:aO(_(_({},t),{},{movement:r,menuBehaviours:SS("auto"!==n?[]:[Ou(function(t,n){xS(t,4,i.item).each(function(n){var e=n.numColumns,o=n.numRows;Oh.setGridSize(t,o,e)})})])})),menu:{markers:Ux(o),fakeFocus:e===_x.ContentFocus}}}(dw("autocompleter-value",!0,e,o,{menuType:"normal"}),o,_x.ContentFocus,"normal")),l().each(Eg.highlightFirst)},m=function(r){var u,a,c=(a=wt(u=r,function(t){return G.from(t.columns)}).getOr(1),lt(u,function(e){var r=e.items;return iO(r,e.matchText,function(n,r){var u={hide:function(){return f()},reload:function(n){s(),t.execCommand("mceAutocompleterReload",!1,{fetchOptions:n})}};t.execCommand("mceAutocompleterRefreshActiveRange"),i.get().each(function(t){o.set(!0),e.onAction(u,t,n,r),o.set(!1)})},a,Tx.BUBBLE_TO_SANDBOX,n,e.highlightOn)}));c.length>0?(d(r,c),Hn($t.fromDom(t.getBody()),"aria-owns",e),t.inline||g()):s()},g=function(){t.dom.get(e)&&t.dom.remove(e,!1);var n=t.getDoc().documentElement,o=t.selection.getNode(),r=function(t){return La(t,!0)}(u.element);Kn(r,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",top:"".concat(o.offsetTop,"px"),left:"".concat(o.offsetLeft,"px")}),t.dom.add(n,r.dom),ds(r,'[role="menu"]').each(function(t){ee(t,"position"),ee(t,"max-height")})};t.on("AutocompleterStart",function(t){var n=t.lookupData;r.set(!0),o.set(!1),m(n)}),t.on("AutocompleterUpdate",function(t){var n=t.lookupData;return m(n)}),t.on("AutocompleterUpdateActiveRange",function(t){var n=t.range;return i.set(n)}),t.on("AutocompleterEnd",function(){s(),r.set(!1),o.set(!1),i.clear()});var p={cancelIfNecessary:f,isMenuOpen:a,isActive:c,isProcessingAction:o.get,getMenu:l};kx(p,t)},lO=function(t,n,e){return ms(t,n,e).isSome()},fO=function(t,n){var e=null;return{cancel:function(){null!==e&&(clearTimeout(e),e=null)},schedule:function(){for(var o=arguments.length,r=new Array(o),i=0;i<o;i++)r[i]=arguments[i];e=setTimeout(function(){t.apply(null,r),e=null},n)}}},dO=function(t){var n=t.raw;return void 0===n.touches||1!==n.touches.length?G.none():G.some(n.touches[0])},mO=function(t){var n=yo(),e=ho(!1),o=fO(function(n){t.triggerEvent(Wi(),n),e.set(!0)},400),r=ri([{key:gi(),value:function(t){return dO(t).each(function(r){o.cancel();var i={x:r.clientX,y:r.clientY,target:t.target};o.schedule(t),e.set(!1),n.set(i)}),G.none()}},{key:pi(),value:function(t){return o.cancel(),dO(t).each(function(t){n.on(function(e){(function(t,n){var e=Math.abs(t.clientX-n.x),o=Math.abs(t.clientY-n.y);return e>5||o>5})(t,e)&&n.clear()})}),G.none()}},{key:hi(),value:function(r){o.cancel();return n.get().filter(function(t){return pn(t.target,r.target)}).map(function(n){return e.get()?(r.prevent(),!1):t.triggerEvent(Ui(),r)})}}]);return{fireIfReady:function(t,n){return It(r,n).bind(function(n){return n(t)})}}},gO=function(t,n){var e=_({stopBackspace:!0},n),o=mO(e),r=nt(["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(n){return wl(t,n,function(t){o.fireIfReady(t,n).each(function(n){n&&t.kill()}),e.triggerEvent(n,t)&&t.kill()})}),i=yo(),u=wl(t,"paste",function(t){o.fireIfReady(t,"paste").each(function(n){n&&t.kill()}),e.triggerEvent("paste",t)&&t.kill(),i.set(setTimeout(function(){e.triggerEvent(zi(),t)},0))}),a=wl(t,"keydown",function(t){e.triggerEvent("keydown",t)?t.kill():e.stopBackspace&&function(t){return t.raw.which===Dg[0]&&!$(["input","textarea"],on(t.target))&&!lO(t.target,'[contenteditable="true"]')}(t)&&t.prevent()}),c=wl(t,"focusin",function(t){e.triggerEvent("focusin",t)&&t.kill()}),s=yo(),l=wl(t,"focusout",function(t){e.triggerEvent("focusout",t)&&t.kill(),s.set(setTimeout(function(){e.triggerEvent(Li(),t)},0))});return{unbind:function(){et(r,function(t){t.unbind()}),a.unbind(),c.unbind(),l.unbind(),u.unbind(),i.on(clearTimeout),s.on(clearTimeout)}}},pO=function(t,n){var e=It(t,"target").getOr(n);return ho(e)},hO=ti([{stopped:[]},{resume:["element"]},{complete:[]}]),vO=function(t,n,e,o,r,i){var u=t(n,o),a=function(t,n){var e=ho(!1),o=ho(!1);return{stop:function(){e.set(!0)},cut:function(){o.set(!0)},isStopped:e.get,isCut:o.get,event:t,setSource:n.set,getSource:n.get}}(e,r);return u.fold(function(){return i.logEventNoHandlers(n,o),hO.complete()},function(t){var e=t.descHandler;return Dc(e)(a),a.isStopped()?(i.logEventStopped(n,t.element,e.purpose),hO.stopped()):a.isCut()?(i.logEventCut(n,t.element,e.purpose),hO.complete()):wn(t.element).fold(function(){return i.logNoParent(n,t.element,e.purpose),hO.complete()},function(o){return i.logEventResponse(n,t.element,e.purpose),hO.resume(o)})})},bO=function(t,n,e,o,r,i){return vO(t,n,e,o,r,i).fold(j,function(o){return bO(t,n,e,o,r,i)},W)},yO=function(t,n,e){var o=function(t){var n=ho(!1);return{stop:function(){n.set(!0)},cut:I,isStopped:n.get,isCut:W,event:t,setSource:V("Cannot set source of a broadcasted event"),getSource:V("Cannot get source of a broadcasted event")}}(n);return et(t,function(t){var n=t.descHandler;Dc(n)(o)}),o.isStopped()},xO=function(t,n,e,o,r){var i=pO(e,o);return bO(t,n,e,o,i,r)},wO=function(){var t={};return{registerId:function(n,e,o){kt(o,function(o,r){var i=void 0!==t[r]?t[r]:{};i[e]=function(t,n){return e=P.apply(void 0,[t.handler].concat(n)),o=t.purpose,{cHandler:e,purpose:o};var e,o}(o,n),t[r]=i})},unregisterId:function(n){kt(t,function(t,e){Ft(t,n)&&delete t[n]})},filterByType:function(n){return It(t,n).map(function(t){return At(t,function(t,n){return function(t,n){return{id:t,descHandler:n}}(n,t)})}).getOr([])},find:function(n,e,o){return It(t,e).bind(function(t){return ci(o,function(n){return function(t,n){return yc(n).bind(function(n){return It(t,n)}).map(function(t){return function(t,n){return{element:t,descHandler:n}}(n,t)})}(t,n)},n)})}}},SO=function(){var t=wO(),n={},e=function(t){var n=t.element;return yc(n).getOrThunk(function(){return function(t,n){var e=mc(hc+t);return bc(n,e),e}("uid-",t.element)})},o=function(e){yc(e.element).each(function(e){delete n[e],t.unregisterId(e)})};return{find:function(n,e,o){return t.find(n,e,o)},filter:function(n){return t.filterByType(n)},register:function(r){var i=e(r);Rt(n,i)&&function(t,e){var r=n[e];if(r!==t)throw new Error('The tagId "'+e+'" is already used by: '+Pa(r.element)+"\nCannot use it for: "+Pa(t.element)+"\nThe conflicting element is"+(Nn(r.element)?" ":" not ")+"already in the DOM");o(t)}(r,i);var u=[r];t.registerId(u,i,r.events),n[i]=r},unregister:o,getById:function(t){return It(n,t)}}},CO=Qm({name:"Container",factory:function(t){var n=t.dom,o=n.attributes,r=x(n,e);return{uid:t.uid,dom:_({tag:"div",attributes:_({role:"presentation"},o)},r),components:t.components,behaviours:Jd(t.containerBehaviours),events:t.events,domModification:t.domModification,eventOrder:t.eventOrder}},configFields:[Gr("components",[]),Kd("containerBehaviours",[]),Gr("events",{}),Gr("domModification",{}),Gr("eventOrder",{})]}),kO=function(t){var n=function(n){return wn(t.element).fold(j,function(t){return pn(n,t)})},e=SO(),o=function(t,o){return e.find(n,t,o)},r=gO(t.element,{triggerEvent:function(t,n){return ja(t,n.target,function(e){return function(t,n,e,o){return xO(t,n,e,e.target,o)}(o,t,n,e)})}}),i={debugInfo:N("real"),triggerEvent:function(t,n,e){ja(t,n,function(r){return xO(o,t,e,n,r)})},triggerFocus:function(t,n){yc(t).fold(function(){tl(t)},function(e){ja(Ni(),t,function(e){return function(t,n,e,o,r){var i=pO(e,o);vO(t,n,e,o,i,r)}(o,Ni(),{originator:n,kill:I,prevent:I,target:t},t,e),!1})})},triggerEscape:function(t,n){i.triggerEvent("keydown",t.element,n.event)},getByUid:function(t){return g(t)},getByDom:function(t){return p(t)},build:es,buildOrPatch:ns,addToGui:function(t){c(t)},removeFromGui:function(t){s(t)},addToWorld:function(t){u(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:j},u=function(t){t.connect(i),cn(t.element)||(e.register(t),et(t.components(),u),i.triggerEvent(qi(),t.element,{target:t.element}))},a=function(t){cn(t.element)||(et(t.components(),a),e.unregister(t)),t.disconnect()},c=function(n){sd(t,n)},s=function(t){dd(t)},l=function(t){var n=e.filter(Pi());et(n,function(n){var e=n.descHandler;Dc(e)(t)})},f=function(t){l({universal:!0,data:t})},d=function(t,n){l({universal:!1,channels:t,data:n})},m=function(t,n){var o=e.filter(t);return yO(o,n)},g=function(t){return e.getById(t).fold(function(){return Co.error(new Error('Could not find component with uid: "'+t+'" in system.'))},Co.value)},p=function(t){var n=yc(t).getOr("not found");return g(n)};return u(t),{root:t,element:t.element,destroy:function(){r.unbind(),no(t.element)},add:c,remove:s,getByUid:g,getByDom:p,addToWorld:u,removeFromWorld:a,broadcast:f,broadcastOn:d,broadcastEvent:m}},OO=N([Gr("prefix","form-field"),Kd("fieldBehaviours",[og,Xd])]),_O=N([_m({schema:[Dr("dom")],name:"label"}),_m({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Dr("text")],name:"aria-descriptor"}
2),km({factory:{sketch:function(t){var n=ei(t,["factory"]);return t.factory.sketch(n)}},schema:[Dr("factory")],name:"field"})]),TO=Zm({name:"FormField",configFields:OO(),partFields:_O(),factory:function(t,n,e,o){var r=$d(t.fieldBehaviours,[og.config({find:function(n){return zm(n,t,"field")}}),Xd.config({store:{mode:"manual",getValue:function(t){return og.getCurrent(t).bind(Xd.getValue)},setValue:function(t,n){og.getCurrent(t).each(function(t){Xd.setValue(t,n)})}}})]),i=gu([Ou(function(n,e){var o=Hm(n,t,["label","field","aria-descriptor"]);o.field().each(function(n){var e=mc(t.prefix);o.label().each(function(t){Hn(t.element,"for",e),Hn(n.element,"id",e)}),o["aria-descriptor"]().each(function(e){var o=mc(t.prefix);Hn(e.element,"id",o),Hn(n.element,"aria-describedby",o)})})})]),u={getField:function(n){return zm(n,t,"field")},getLabel:function(n){return zm(n,t,"label")}};return{uid:t.uid,dom:t.dom,components:n,behaviours:r,events:i,apis:u}},apis:{getField:function(t,n){return t.getField(n)},getLabel:function(t,n){return t.getLabel(n)}}}),EO=tinymce.util.Tools.resolve("tinymce.html.Entities"),DO=function(t,n,e,o){var r=AO(t,n,e,o);return TO.sketch(r)},AO=function(t,n,e,o){return{dom:MO(e),components:t.toArray().concat([n]),fieldBehaviours:zu(o)}},MO=function(t){return{tag:"div",classes:["tox-form__group"].concat(t)}},BO=function(t,n){return TO.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Qc(n.translate(t))]})},IO=mc("form-component-change"),FO=mc("form-close"),RO=mc("form-cancel"),NO=mc("form-action"),LO=mc("form-submit"),zO=mc("form-block"),PO=mc("form-unblock"),HO=mc("form-tabchange"),VO=mc("form-resize"),UO=function(t,n,e){var o,r,i=t.label.map(function(t){return BO(t,n)}),u=n.icons(),a=function(t){return function(n,e){ms(e.event.target,"[data-collection-item-value]").each(function(o){t(n,e,o,Un(o,"data-collection-item-value"))})}},c=function(e,o){var r=n.checkUiComponentContext("mode:design").shouldDisable||n.isDisabled()?" tox-collection__item--state-disabled":"",i=nt(o,function(n){var e=fx.translate(n.text),o=1===t.columns?'<div class="tox-collection__item-label">'.concat(e,"</div>"):"",i='<div class="tox-collection__item-icon">'.concat(function(t){var n;return null!==(n=u[t])&&void 0!==n?n:t}(n.icon),"</div>"),a={_:" "," - ":" ","-":" "},c=e.replace(/\_| \- |\-/g,function(t){return a[t]});return'<div data-mce-tooltip="'.concat(c,'" class="tox-collection__item').concat(r,'" tabindex="-1" data-collection-item-value="').concat(EO.encodeAllRaw(n.value),'" aria-label="').concat(c,'">').concat(i).concat(o,"</div>")}),a="auto"!==t.columns&&t.columns>1?tt(i,t.columns):[i],c=nt(a,function(t){return'<div class="tox-collection__group">'.concat(t.join(""),"</div>")});Na(e.element,c.join(""))},s=a(function(e,o,r,i){o.stop(),n.checkUiComponentContext("mode:design").shouldDisable||n.isDisabled()||su(e,NO,{name:t.name,value:i})}),l=[vu(Si(),a(function(t,n,e){tl(e,!0)})),vu(Di(),s),vu(Ui(),s),vu(Ci(),a(function(t,n,e){ds(t.element,"."+Nx).each(function(t){$u(t,Nx)}),Ku(e,Nx)})),vu(ki(),a(function(t){ds(t.element,"."+Nx).each(function(t){$u(t,Nx),nl(t)})})),Eu(a(function(n,e,o,r){su(n,NO,{name:t.name,value:r})}))],f=function(t,n){return nt(wf(t.element,".tox-collection__item"),n)},d=TO.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==t.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:L},behaviours:zu([vg.config({disabled:function(){return n.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){f(t,function(t){Ku(t,"tox-collection__item--state-disabled"),Hn(t,"aria-disabled",!0)})},onEnabled:function(t){f(t,function(t){$u(t,"tox-collection__item--state-disabled"),Gn(t,"aria-disabled")})}}),IS(function(){return n.checkUiComponentContext(t.context)}),Fh.config({}),ry.config(_(_({},n.tooltips.getConfig({tooltipText:"",onShow:function(t){ds(t.element,"."+Nx+"[data-mce-tooltip]").each(function(e){Wn(e,"data-mce-tooltip").each(function(e){ry.setComponents(t,n.tooltips.getComponents({tooltipText:e}))})})}})),{},{mode:"children-keyboard-focus",anchor:function(t){return{type:"node",node:ds(t.element,"."+Nx).orThunk(function(){return gn(".tox-collection__item")}
2),root:t.element,layouts:{onLtr:N([Vs,Hs,Ns,zs,Ls,Ps]),onRtl:N([Vs,Hs,Ns,zs,Ls,Ps])},bubble:zl(0,-2,{})}}})),Xd.config({store:{mode:"memory",initialValue:e.getOr([])},onSetValue:function(n,e){c(n,e),"auto"===t.columns&&xS(n,5,"tox-collection__item").each(function(t){var e=t.numRows,o=t.numColumns;Oh.setGridSize(n,e,o)}),cu(n,VO)}}),Yb.config({}),Oh.config((o=t.columns,r="normal",1===o?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===o?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===r?".tox-swatches__row":".tox-collection__group",cell:".".concat("color"===r?Ax:Dx)}})),Rh("collection-events",l)]),eventOrder:T(T({},Hi(),["disabling","alloy.base.behaviour","collection-events"]),Ci(),["collection-events","tooltipping"])});return DO(i,d,["tox-form__group--collection"],[])},WO=["input","textarea"],jO=function(t){var n=on(t);return $(WO,n)},GO=function(t,n){var e=n.getRoot(t).getOr(t.element);$u(e,n.invalidClass),n.notify.each(function(n){jO(t.element)&&Hn(t.element,"aria-invalid",!1),n.getContainer(t).each(function(t){Na(t,n.validHtml)}),n.onValid(t)})},qO=function(t,n,e,o){var r=n.getRoot(t).getOr(t.element);Ku(r,n.invalidClass),n.notify.each(function(n){jO(t.element)&&Hn(t.element,"aria-invalid",!0),n.getContainer(t).each(function(t){Na(t,o)}),n.onInvalid(t,o)})},YO=function(t,n,e){return n.validator.fold(function(){return Rk(Co.value(!0))},function(n){return n.validate(t)})},XO=function(t,n,e){return n.notify.each(function(n){n.onValidate(t)}),YO(t,n).map(function(e){return t.getSystem().isConnected()?e.fold(function(e){return qO(t,n,0,e),Co.error(e)},function(e){return GO(t,n),Co.value(e)}):Co.error("No longer in system")})},KO=Object.freeze({__proto__:null,markValid:GO,markInvalid:qO,query:YO,run:XO,isInvalid:function(t,n){var e=n.getRoot(t).getOr(t.element);return Zu(e,n.invalidClass)}}),JO=Object.freeze({__proto__:null,events:function(t,n){return t.validator.map(function(n){return gu([vu(n.onEvent,function(n){XO(n,t).get(L)})].concat(n.validateOnLoad?[Ou(function(n){XO(n,t).get(I)})]:[]))}).getOr({})}}),$O=[Dr("invalidClass"),Gr("getRoot",G.none),jr("notify",[Gr("aria","alert"),Gr("getContainer",G.none),Gr("validHtml",""),Za("onValid"),Za("onInvalid"),Za("onValidate")]),jr("validator",[Dr("validate"),Gr("onEvent","input"),Gr("validateOnLoad",!0)])],QO=Hu({fields:$O,name:"invalidating",active:JO,apis:KO,extra:{validation:function(t){return function(n){var e=Xd.getValue(n);return Rk(t(e))}}}}),ZO=Object.freeze({__proto__:null,events:function(){return gu([pu(Ii(),j)])},exhibit:function(){return Mu({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}}),t_=Hu({fields:[],name:"unselecting",active:ZO}),n_=mc("color-input-change"),e_=mc("color-swatch-change"),o_=mc("color-picker-cancel"),r_=function(t,n,e,o){var r=TO.parts.field({factory:Jx,inputClasses:["tox-textfield"],data:o,onSetValue:function(t){return QO.run(t).get(I)},inputBehaviours:zu([vg.config({disabled:function(){return n.providers.isDisabled()||n.providers.checkUiComponentContext(t.context).shouldDisable}}),IS(function(){return n.providers.checkUiComponentContext(t.context)}),Yb.config({}),QO.config({invalidClass:"tox-textbox-field-invalid",getRoot:function(t){return Sn(t.element)},notify:{onValid:function(t){var n=Xd.getValue(t);su(t,n_,{color:n})}},validator:{validateOnLoad:!1,validate:function(t){var n=Xd.getValue(t);if(0===n.length)return Rk(Co.value(!0));var e=$t.fromTag("span");Xn(e,"background-color",n);var o=Zn(e,"background-color").fold(function(){return Co.error("blah")},function(t){return Co.value(n)});return Rk(o)}}})]),selectOnFocus:!1}),i=t.label.map(function(t){return BO(t,n.providers)}),u=function(t,n){su(t,e_,{value:n})},a=jb(function(t,n){return Jk.sketch({dom:t.dom,components:t.components,toggleClass:"mce-active",dropdownBehaviours:zu([kS(function(){return n.providers.isDisabled()||n.providers.checkUiComponentContext(t.context).shouldDisable}),IS(function(){return n.providers.checkUiComponentContext(t.context)}),t_.config({}),Yb.config({})]),layouts:t.layouts,sandboxClasses:["tox-dialog__popups"],lazySink:n.get
2Sink,fetch:function(e){return Fk(function(n){return t.fetch(n)}).map(function(o){return G.from(aO(Ho(sk(mc("menu-value"),o,function(n){t.onItemAction(e,n)},t.columns,t.presets,Tx.CLOSE_ON_EXECUTE,W,n.providers),{movement:fk(t.columns,t.presets)})))})},parts:{menu:Gx(0,0,t.presets)}})}({dom:{tag:"span",attributes:{"aria-label":n.providers.translate("Color swatch")}},layouts:{onRtl:function(){return[Ls,Ns,Vs]},onLtr:function(){return[Ns,Ls,Vs]}},components:[],fetch:nk(e.getColors(t.storageKey),t.storageKey,e.hasCustomColors()),columns:e.getColorCols(t.storageKey),presets:"color",onItemAction:function(n,o){a.getOpt(n).each(function(n){"custom"===o?e.colorPicker(function(e){e.fold(function(){return cu(n,o_)},function(e){u(n,e),IC(t.storageKey,e)})},"#ffffff"):u(n,"remove"===o?"":o)})},context:t.context},n));return TO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:i.toArray().concat([{dom:{tag:"div",classes:["tox-color-input"]},components:[r,a.asSpec()]}]),fieldBehaviours:zu([Rh("form-field-events",[vu(n_,function(n,e){a.getOpt(n).each(function(t){Xn(t.element,"background-color",e.event.color)}),su(n,IO,{name:t.name})}),vu(e_,function(t,n){TO.getField(t).each(function(e){Xd.setValue(e,n.event.value),og.getCurrent(t).each(Hh.focus)})}),vu(o_,function(t,n){TO.getField(t).each(function(n){og.getCurrent(t).each(Hh.focus)})})])])})},i_=_m({schema:[Dr("dom")],name:"label"}),u_=function(t){return _m({name:t+"-edge",overrides:function(n){return n.model.manager.edgeActions[t].fold(function(){return{}},function(t){return{events:gu([bu(gi(),function(n,e,o){return t(n,o)},[n]),bu(bi(),function(n,e,o){return t(n,o)},[n]),bu(yi(),function(n,e,o){o.mouseIsDown.get()&&t(n,o)},[n])])}})}})},a_=u_("top-left"),c_=u_("top"),s_=u_("top-right"),l_=u_("right"),f_=u_("bottom-right"),d_=u_("bottom"),m_=u_("bottom-left"),g_=u_("left"),p_=km({name:"thumb",defaults:N({dom:{styles:{position:"absolute"}}}),overrides:function(t){return{events:gu([xu(gi(),t,"spectrum"),xu(pi(),t,"spectrum"),xu(hi(),t,"spectrum"),xu(bi(),t,"spectrum"),xu(yi(),t,"spectrum"),xu(wi(),t,"spectrum")])}}}),h_=function(t){return jg(t.event)},v_=km({schema:[Tr("mouseIsDown",function(){return ho(!1)})],name:"spectrum",overrides:function(t){var n=t.model.manager,e=function(e,o){return n.getValueFromEvent(o).map(function(o){return n.setValueFrom(e,t,o)})};return{behaviours:zu([Oh.config({mode:"special",onLeft:function(e,o){return n.onLeft(e,t,h_(o))},onRight:function(e,o){return n.onRight(e,t,h_(o))},onUp:function(e,o){return n.onUp(e,t,h_(o))},onDown:function(e,o){return n.onDown(e,t,h_(o))}}),Yb.config({}),Hh.config({})]),events:gu([vu(gi(),e),vu(pi(),e),vu(bi(),e),vu(yi(),function(n,o){t.mouseIsDown.get()&&e(n,o)})])}}}),b_=[i_,g_,l_,c_,d_,a_,s_,m_,f_,p_,v_],y_=N("slider.change.value"),x_=function(t){var n=t.event.raw;if(function(t){return-1!==t.type.indexOf("touch")}(n)){var e=n;return void 0!==e.touches&&1===e.touches.length?G.some(e.touches[0]).map(function(t){return se(t.clientX,t.clientY)}):G.none()}var o=n;return void 0!==o.clientX?G.some(o).map(function(t){return se(t.clientX,t.clientY)}):G.none()},w_=function(t){return t.model.minX},S_=function(t){return t.model.minY},C_=function(t){return t.model.minX-1},k_=function(t){return t.model.minY-1},O_=function(t){return t.model.maxX},__=function(t){return t.model.maxY},T_=function(t){return t.model.maxX+1},E_=function(t){return t.model.maxY+1},D_=function(t,n,e){return n(t)-e(t)},A_=function(t){return D_(t,O_,w_)},M_=function(t){return D_(t,__,S_)},B_=function(t){return A_(t)/2},I_=function(t){return M_(t)/2},F_=function(t,n){return n?t.stepSize*t.speedMultiplier:t.stepSize},R_=function(t){return t.snapToGrid},N_=function(t){return t.snapStart},L_=function(t){return t.rounded},z_=function(t,n){return void 0!==t[n+"-edge"]},P_=function(t){return z_(t,"left")},H_=function(t){return z_(t,"right")},V_=function(t){return z_(t,"top")},U_=function(t){return z_(t,"bottom")},W_=function(t){return t.model.value.get()},j_=function(t,n){return{x:t,y:n}},G_=function(t,n){su(t,y_(),{value:n})},q_=function(t,n,e,o){return t<n?t:t>e?e:t===n?n-1:Math.max(n,t-o)},Y_=function(t,n,e,o){return t>e?t:t<n?n:t===e?e+1:Math.min(e,t+o)},X_=function(t,n,e){return Math.max(n,Math.min(e,t))},K_=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.step,u=t.snap,a=t.snapStart,c=t.rounded,s=t.hasMinEdge,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(r>d)return p;var h=function(t,n,e){return Math.min(e,Math.max(t,n))-n}(r,f,d),v=X_(h/m*o+n,g,p);return u&&v>=n&&v<=e?function(t,n,e,o,r){return r.fold(function(){var r=t-n,i=Math.round(r/o)*o;return X_(n+i,n-1,e+1)},function(n){var r=(t-n)%o,i=Math.round(r/o),u=Math.floor((t-n)/o),a=Math.floor((e-n)/o),c=n+Math.min(a,u+i)*o;return Math.max(n,c)})}(v,n,e,i,a):c?Math.round(v):v},J_=function(t){var n=t.min,e=t.max,o=t.range,r=t.value,i=t.hasMinEdge,u=t.hasMaxEdge,a=t.maxBound,c=t.maxOffset,s=t.centerMinEdge,l=t.centerMaxEdge;return r<n?i?0:s:r>e?u?a:l:(r-n)/o*c},$_="top",Q_="right",Z_="bottom",tT="left",nT=function(t){return t.element.dom.getBoundingClientRect()},eT=function(t,n){return t[n]},oT=function(t){var n=nT(t);return eT(n,tT)},rT=function(t){var n=nT(t);return eT(n,Q_)},iT=function(t){var n=nT(t);return eT(n,$_)}
2,uT=function(t){var n=nT(t);return eT(n,Z_)},aT=function(t){var n=nT(t);return eT(n,"width")},cT=function(t){var n=nT(t);return eT(n,"height")},sT=function(t,n,e){return(t+n)/2-e},lT=function(t,n){var e=nT(t),o=nT(n),r=eT(e,tT),i=eT(e,Q_),u=eT(o,tT);return sT(r,i,u)},fT=function(t,n){var e=nT(t),o=nT(n),r=eT(e,$_),i=eT(e,Z_),u=eT(o,$_);return sT(r,i,u)},dT=function(t,n){su(t,y_(),{value:n})},mT=function(t,n,e){var o={min:w_(n),max:O_(n),range:A_(n),value:e,step:F_(n),snap:R_(n),snapStart:N_(n),rounded:L_(n),hasMinEdge:P_(n),hasMaxEdge:H_(n),minBound:oT(t),maxBound:rT(t),screenRange:aT(t)};return K_(o)},gT=function(t){return function(n,e,o){return function(t,n,e,o){var r=(t>0?Y_:q_)(W_(e),w_(e),O_(e),F_(e,o));return dT(n,r),G.some(r)}(t,n,e,o).map(j)}},pT=function(t,n,e,o,r,i){var u=function(t,n,e,o,r){var i=aT(t),u=o.bind(function(n){return G.some(lT(n,t))}).getOr(0),a=r.bind(function(n){return G.some(lT(n,t))}).getOr(i),c={min:w_(n),max:O_(n),range:A_(n),value:e,hasMinEdge:P_(n),hasMaxEdge:H_(n),minBound:oT(t),minOffset:0,maxBound:rT(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return J_(c)}(n,i,e,o,r);return oT(n)-oT(t)+u},hT=gT(-1),vT=gT(1),bT=G.none,yT=G.none,xT={"top-left":G.none(),top:G.none(),"top-right":G.none(),right:G.some(function(t,n){G_(t,T_(n))}),"bottom-right":G.none(),bottom:G.none(),"bottom-left":G.none(),left:G.some(function(t,n){G_(t,C_(n))})},wT=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=mT(t,n,e);return dT(t,o),o},setToMin:function(t,n){var e=w_(n);dT(t,e)},setToMax:function(t,n){var e=O_(n);dT(t,e)},findValueOfOffset:mT,getValueFromEvent:function(t){return x_(t).map(function(t){return t.left})},findPositionOfValue:pT,setPositionFromValue:function(t,n,e,o){var r=W_(e),i=pT(t,o.getSpectrum(t),r,o.getLeftEdge(t),o.getRightEdge(t),e),u=ge(n.element)/2;Xn(n.element,"left",i-u+"px")},onLeft:hT,onRight:vT,onUp:bT,onDown:yT,edgeActions:xT}),ST=function(t,n){su(t,y_(),{value:n})},CT=function(t,n,e){var o={min:S_(n),max:__(n),range:M_(n),value:e,step:F_(n),snap:R_(n),snapStart:N_(n),rounded:L_(n),hasMinEdge:V_(n),hasMaxEdge:U_(n),minBound:iT(t),maxBound:uT(t),screenRange:cT(t)};return K_(o)},kT=function(t){return function(n,e,o){return function(t,n,e,o){var r=(t>0?Y_:q_)(W_(e),S_(e),__(e),F_(e,o));return ST(n,r),G.some(r)}(t,n,e,o).map(j)}},OT=function(t,n,e,o,r,i){var u=function(t,n,e,o,r){var i=cT(t),u=o.bind(function(n){return G.some(fT(n,t))}).getOr(0),a=r.bind(function(n){return G.some(fT(n,t))}).getOr(i),c={min:S_(n),max:__(n),range:M_(n),value:e,hasMinEdge:V_(n),hasMaxEdge:U_(n),minBound:iT(t),minOffset:0,maxBound:uT(t),maxOffset:i,centerMinEdge:u,centerMaxEdge:a};return J_(c)}(n,i,e,o,r);return iT(n)-iT(t)+u},_T=G.none,TT=G.none,ET=kT(-1),DT=kT(1),AT={"top-left":G.none(),top:G.some(function(t,n){G_(t,k_(n))}),"top-right":G.none(),right:G.none(),"bottom-right":G.none(),bottom:G.some(function(t,n){G_(t,E_(n))}),"bottom-left":G.none(),left:G.none()},MT=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=CT(t,n,e);return ST(t,o),o},setToMin:function(t,n){var e=S_(n);ST(t,e)},setToMax:function(t,n){var e=__(n);ST(t,e)},findValueOfOffset:CT,getValueFromEvent:function(t){return x_(t).map(function(t){return t.top})},findPositionOfValue:OT,setPositionFromValue:function(t,n,e,o){var r=W_(e),i=OT(t,o.getSpectrum(t),r,o.getTopEdge(t),o.getBottomEdge(t),e),u=ue(n.element)/2;Xn(n.element,"top",i-u+"px")},onLeft:_T,onRight:TT,onUp:ET,onDown:DT,edgeActions:AT}),BT=function(t,n){su(t,y_(),{value:n})},IT=function(t,n){return{x:t,y:n}},FT=function(t,n){return function(e,o,r){return function(t,n,e,o,r){var i=t>0?Y_:q_,u=n?W_(o).x:i(W_(o).x,w_(o),O_(o),F_(o,r)),a=n?i(W_(o).y,S_(o),__(o),F_(o,r)):W_(o).y;return BT(e,IT(u,a)),G.some(u)}(t,n,e,o,r).map(j)}},RT=FT(-1,!1),NT=FT(1,!1),LT=FT(-1,!0),zT=FT(1,!0),PT={"top-left":G.some(function(t,n){G_(t,j_(C_(n),k_(n)))}),top:G.some(function(t,n){G_(t,j_(B_(n),k_(n)))}),"top-right":G.some(function(t,n){G_(t,j_(T_(n),k_(n)))}),right:G.some(function(t,n){G_(t,j_(T_(n),I_(n)))}),"bottom-right":G.some(function(t,n){G_(t,j_(T_(n),E_(n)))}),bottom:G.some(function(t,n){G_(t,j_(B_(n),E_(n)))}),"bottom-left":G.some(function(t,n){G_(t,j_(C_(n),E_(n)))}),left:G.some(function(t,n){G_(t,j_(C_(n),I_(n)))})},HT=Object.freeze({__proto__:null,setValueFrom:function(t,n,e){var o=mT(t,n,e.left),r=CT(t,n,e.top),i=IT(o,r);
2return BT(t,i),i},setToMin:function(t,n){var e=w_(n),o=S_(n);BT(t,IT(e,o))},setToMax:function(t,n){var e=O_(n),o=__(n);BT(t,IT(e,o))},getValueFromEvent:function(t){return x_(t)},setPositionFromValue:function(t,n,e,o){var r=W_(e),i=pT(t,o.getSpectrum(t),r.x,o.getLeftEdge(t),o.getRightEdge(t),e),u=OT(t,o.getSpectrum(t),r.y,o.getTopEdge(t),o.getBottomEdge(t),e),a=ge(n.element)/2,c=ue(n.element)/2;Xn(n.element,"left",i-a+"px"),Xn(n.element,"top",u-c+"px")},onLeft:RT,onRight:NT,onUp:LT,onDown:zT,edgeActions:PT}),VT=[Gr("stepSize",1),Gr("speedMultiplier",10),Gr("onChange",I),Gr("onChoose",I),Gr("onInit",I),Gr("onDragStart",I),Gr("onDragEnd",I),Gr("snapToGrid",!1),Gr("rounded",!0),Lr("snapStart"),Ar("model",kr("mode",{x:[Gr("minX",0),Gr("maxX",100),Tr("value",function(t){return ho(t.mode.minX)}),Dr("getInitialValue"),oc("manager",wT)],y:[Gr("minY",0),Gr("maxY",100),Tr("value",function(t){return ho(t.mode.minY)}),Dr("getInitialValue"),oc("manager",MT)],xy:[Gr("minX",0),Gr("maxX",100),Gr("minY",0),Gr("maxY",100),Tr("value",function(t){return ho({x:t.mode.minX,y:t.mode.minY})}),Dr("getInitialValue"),oc("manager",HT)]})),Kd("sliderBehaviours",[Oh,Xd]),Tr("mouseIsDown",function(){return ho(!1)})],UT=Zm({name:"Slider",configFields:VT,partFields:b_,factory:function(t,n,e,o){var r=function(n){return Pm(n,t,"thumb")},i=function(n){return Pm(n,t,"spectrum")},u=function(n){return zm(n,t,"left-edge")},a=function(n){return zm(n,t,"right-edge")},c=function(n){return zm(n,t,"top-edge")},s=function(n){return zm(n,t,"bottom-edge")},l=t.model,f=l.manager,d=function(n,e){f.setPositionFromValue(n,e,t,{getLeftEdge:u,getRightEdge:a,getTopEdge:c,getBottomEdge:s,getSpectrum:i})},m=function(t,n){l.value.set(n);var e=r(t);d(t,e)},g=function(n){var e=t.mouseIsDown.get();t.mouseIsDown.set(!1),e&&zm(n,t,"thumb").each(function(e){var o=l.value.get();t.onChoose(n,e,o)})},p=function(n,e){e.stop(),t.mouseIsDown.set(!0),t.onDragStart(n,r(n))},h=function(n,e){e.stop(),t.onDragEnd(n,r(n)),g(n)},v=function(n){zm(n,t,"spectrum").map(Oh.focusIn)};return{uid:t.uid,dom:t.dom,components:n,behaviours:$d(t.sliderBehaviours,[Oh.config({mode:"special",focusIn:v}),Xd.config({store:{mode:"manual",getValue:function(t){return l.value.get()},setValue:m}}),Qs.config({channels:T({},Md(),{onReceive:g})})]),events:gu([vu(y_(),function(n,e){!function(n,e){m(n,e);var o=r(n);t.onChange(n,o,e),G.some(!0)}(n,e.event.value)}),Ou(function(n,e){var o=l.getInitialValue();l.value.set(o);var u=r(n);d(n,u);var a=i(n);t.onInit(n,u,a,l.value.get())}),vu(gi(),p),vu(hi(),h),vu(bi(),function(t,n){v(t),p(t,n)}),vu(wi(),h)]),apis:{resetToMin:function(n){f.setToMin(n,t)},resetToMax:function(n){f.setToMax(n,t)},setValue:m,refresh:d},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)}}}),WT=mc("rgb-hex-update"),jT=mc("slider-update"),GT=mc("palette-update"),qT="form",YT=[Kd("formBehaviours",[Xd])],XT=function(t){return"<alloy.field."+t+">"},KT=function(t,n){return{uid:t.uid,dom:t.dom,components:n,behaviours:$d(t.formBehaviours,[Xd.config({store:{mode:"manual",getValue:function(n){var e=Vm(n,t);return Ot(e,function(t,n){return t().bind(function(t){var e,o,r=og.getCurrent(t);return e=r,o=new Error("Cannot find a current component to extract the value from for form part '".concat(n,"': ")+Pa(t.element)),e.fold(function(){return Co.error(o)},Co.value)}).map(Xd.getValue)})},setValue:function(n,e){kt(e,function(e,o){zm(n,t,o).each(function(t){og.getCurrent(t).each(function(t){Xd.setValue(t,e)})})})}}})]),apis:{getField:function(n,e){return zm(n,t,e).bind(og.getCurrent)}}}},JT={getField:Tc(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var n=function(){var t=[];return{field:function(n,e){return t.push(n),Im(qT,XT(n),e)},record:N(t)}}(),e=t(n),o=n.record(),r=nt(o,function(t){return km({name:t,pname:XT(t)})});return Xm(qT,YT,r,KT,e)}},$T=mc("valid-input"),QT=mc("invalid-input"),ZT=mc("validating-input"),tE="colorcustom.rgb.",nE={isEnabled:j,setEnabled:I,immediatelyShow:I,immediatelyHide:I},eE=function(t,n,e,o,r,i){var u=function(t,n){var e=n.get();t!==e.isEnabled()&&(e.setEnabled(t),t?e.immediatelyShow():e.immediatelyHide())}
2,a=function(e,o,r){return QO.config({invalidClass:n("invalid"),notify:{onValidate:function(t){su(t,ZT,{type:e})},onValid:function(t){u(!1,r),su(t,$T,{type:e,value:Xd.getValue(t)})},onInvalid:function(t){u(!0,r),su(t,QT,{type:e,value:Xd.getValue(t)})}},validator:{validate:function(n){var e=Xd.getValue(n),r=o(e)?Co.value(!0):Co.error(t("aria.input.invalid"));return Rk(r)},validateOnLoad:!1}})},c=function(e,o,u,c,s){var l=ho(nE),f=t(tE+"range"),d=TO.parts.label({dom:{tag:"label"},components:[Qc(u)]}),m=TO.parts.field({data:s,factory:Jx,inputAttributes:_({type:"text","aria-label":c},"hex"===o?{"aria-live":"polite"}:{}),inputClasses:[n("textfield")],inputBehaviours:zu([a(o,e,l),Yb.config({}),ry.config(_({},r({tooltipText:"",onSetup:function(t){l.set({isEnabled:function(){return ry.isEnabled(t)},setEnabled:function(n){return ry.setEnabled(t,n)},immediatelyShow:function(){return ry.immediateOpenClose(t,!0)},immediatelyHide:function(){return ry.immediateOpenClose(t,!1)}}),ry.setEnabled(t,!1)},onShow:function(e,r){ry.setComponents(e,[{dom:{tag:"p",classes:[n("rgb-warning-note")]},components:[Qc(t("hex"===o?"colorcustom.rgb.invalidHex":"colorcustom.rgb.invalid"))]}])}})))]),onSetValue:function(t){QO.isInvalid(t)&&QO.run(t).get(I)}}),g=mc("aria-invalid"),p=jb(i("invalid",G.some(g),"warning")),h=[d,m,jb({dom:{tag:"div",classes:[n("invalid-icon")]},components:[p.asSpec()]}).asSpec()],v="hex"!==o?[TO.parts["aria-descriptor"]({text:f}
2)]:[],b=h.concat(v);return{dom:{tag:"div",attributes:{role:"presentation"},classes:[n("rgb-container")]},components:b}},s=function(t,n){var e=n.red,o=n.green,r=n.blue;Xd.setValue(t,{red:e,green:o,blue:r})},l=jb({dom:{tag:"div",classes:[n("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),f=function(t,n){l.getOpt(t).each(function(t){Xn(t.element,"background-color","#"+n.value)})},d=Qm({factory:function(){var r={red:ho(G.some(255)),green:ho(G.some(255)),blue:ho(G.some(255)),hex:ho(G.some("ffffff"))},i=function(t){return r[t].get()},u=function(t,n){r[t].set(n)},a=function(t){var n=t.red,e=t.green,o=t.blue;u("red",G.some(n)),u("green",G.some(e)),u("blue",G.some(o))},d=function(t,n){var e=n.event;"hex"!==e.type?u(e.type,G.none()):o(t)},m=function(t,n,e){var o=parseInt(e,10);u(n,G.some(o)),i("red").bind(function(t){return i("green").bind(function(n){return i("blue").map(function(e){return dC(t,n,e,1)})})}).each(function(n){var e=function(t,n){var e=uC(n);return JT.getField(t,"hex").each(function(n){Hh.isFocused(n)||Xd.setValue(t,{hex:e.value})}),e}(t,n);su(t,WT,{hex:e}),f(t,e)})},g=function(t,n){var o=n.event;!function(t){return"hex"===t.type}(o)?m(t,o.type,o.value):function(t,n){e(t);var o=ZS(n);u("hex",G.some(o.value));var r=pC(o);s(t,r),a(r),su(t,WT,{hex:o}),f(t,o)}(t,o.value)},p=function(n){return{label:t(tE+n+".label"),description:t(tE+n+".description")}},h=p("red"),v=p("green"),b=p("blue"),y=p("hex");return Ho(JT.sketch(function(e){return{dom:{tag:"form",classes:[n("rgb-form")],attributes:{"aria-label":t("aria.color.picker")}},components:[e.field("red",TO.sketch(c(mC,"red",h.label,h.description,255))),e.field("green",TO.sketch(c(mC,"green",v.label,v.description,255))),e.field("blue",TO.sketch(c(mC,"blue",b.label,b.description,255))),e.field("hex",TO.sketch(c(eC,"hex",y.label,y.description,"ffffff"))),l.asSpec()],formBehaviours:zu([QO.config({invalidClass:n("form-invalid")}),Rh("rgb-form-events",[vu($T,g),vu(QT,d),vu(ZT,d)])])}}),{apis:{updateHex:function(t,n){Xd.setValue(t,{hex:n.value}),function(t,n){var e=pC(n);s(t,e),a(e)}(t,n),f(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}});return d},oE=function(t,n){var e=UT.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[n("sv-palette-spectrum")]}}),o=UT.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[n("sv-palette-thumb")],innerHtml:"<div class=".concat(n("sv-palette-inner-thumb"),' role="presentation"></div>')}}),r=function(t,n){var e=t.width,o=t.height,r=t.getContext("2d");if(null!==r){r.fillStyle=n,r.fillRect(0,0,e,o);var i=r.createLinearGradient(0,0,e,0);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(1,"rgba(255,255,255,0)"),r.fillStyle=i,r.fillRect(0,0,e,o);var u=r.createLinearGradient(0,0,0,o);u.addColorStop(0,"rgba(0,0,0,0)"),u.addColorStop(1,"rgba(0,0,0,1)"),r.fillStyle=u,r.fillRect(0,0,e,o)}},i=Qm({factory:function(i){var u=N({x:0,y:0}),a=zu([og.config({find:G.some}),Hh.config({})]);return UT.sketch({dom:{tag:"div",attributes:{role:"slider","aria-valuetext":t(["Saturation {0}%, Brightness {1}%",0,0])},classes:[n("sv-palette")]},model:{mode:"xy",getInitialValue:u},rounded:!1,components:[e,o],onChange:function(n,e,o){M(o)||Hn(n.element,"aria-valuetext",t(["Saturation {0}%, Brightness {1}%",Math.floor(o.x),Math.floor(100-o.y)])),su(n,GT,{value:o})},onInit:function(t,n,e,o){r(e.element.dom,bC(yC))},sliderBehaviours:a})},name:"SaturationBrightnessPalette",configFields:[],apis:{setHue:function(t,n,e){!function(t,n){var e=t.components()[0].element.dom,o=FC(n,100,100),i=gC(o);r(e,bC(i))}(n,e)},setThumb:function(n,e,o){!function(n,e){var o=RC(pC(e));UT.setValue(n,{x:o.saturation,y:100-o.value}),Hn(n.element,"aria-valuetext",t(["Saturation {0}%, Brightness {1}%",o.saturation,o.value]))}(e,o)}},extraApis:{}});return i},rE=function(t,n,e,o){var r=Qm({name:"ColourPicker",configFields:[Dr("dom"),Gr("onValidHex",I),Gr("onInvalidHex",I)],factory:function(r){var i,u=eE(t,n,r.onValidHex,r.onInvalidHex,e,o),a=oE(t,n),c={paletteRgba:ho(yC),paletteHue:ho(0)},s=jb(function(t,n){var e=UT.parts.spectrum({dom:{tag:"div",classes:[n("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=UT.parts.thumb({dom:{tag:"div",classes:[n("hue-slider-thumb")],attributes:{role:"presentation"}}});return UT.sketch({dom:{tag:"div",classes:[n("hue-slider")],attributes:{role:"slider","aria-valuemin":0,"aria-valuemax":360,"aria-valuenow":120}},rounded:!1,model:{mode:"y",getInitialValue:N(0)},components:[e,o],sliderBehaviours:zu([Hh.config({})]),onChange:function(t,n,e){Hn(t.element,"aria-valuenow",Math.floor(360-3.6*e)),su(t,jT,{value:e})}})}(0,n)),l=jb(a.sketch({})),f=jb(u.sketch({})),d=function(t,n,e){l.getOpt(t).each(function(t){a.setHue(t,e)})},m=function(t,n){f.getOpt(t).each(function(t){u.updateHex(t,n)})},g=function(t,n,e){s.getOpt(t).each(function(t){UT.setValue(t,function(t){return 100-t/360*100}(e))})},p=function(t,n){l.getOpt(t).each(function(t){a.setThumb(t,n)})},h=function(t,n,e,o){!function(t,n){var e=pC(t);c.paletteRgba.set(e),c.paletteHue.set(n)}(n,e),et(o,function(o){o(t,n,e)})};return{uid:r.uid,dom:r.dom,components:[l.asSpec(),s.asSpec(),f.asSpec()],behaviours:zu([Rh("colour-picker-events",[vu(WT,(i=[d,g,p],function(t,n){var e=n.event.hex,o=function(t){return RC(pC(t))}(e);h(t,e,o.hue,i)})),vu(GT,function(){var t=[m];return function(n,e){var o=e.event.value,r=c.paletteHue.get(),i=FC(r,o.x,100-o.y),u=NC(i);h(n,u,r,t)}}()),vu(jT,function(){var t=[d,m];return function(n,e){var o=function(t){return(100-t)/100*360}(e.event.value),r=c.paletteRgba.get(),i=RC(r),u=FC(o,i.saturation,i.value),a=NC(u);h(n,a,o,t)}}())]),og.config({find:function(t){return f.getOpt(t)}}),Oh.config({mode:"acyclic"})])}}});return r},iE=function(){return og.config({find:G.some})},uE=function(t){return og.config({find:t.getOpt})},aE=function(t){return og.config({find:function(n){return On(n.element,t).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}})},cE=or([Gr("preprocess",L),Gr("postprocess",L)]),sE=function(t,n,e){return Xd.config({store:_(_({mode:"manual"},t.map(function(t){return{initialValue:t}}).getOr({})),{},{getValue:n,setValue:e})})},lE=function(t,n,e){return sE(t,function(t){return n(t.element)},function(t,n){return e(t.element,n)})},fE=function(t){return Xd.config({store:{mode:"memory",initialValue:t}})},dE={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red channel","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green channel","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue channel","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.rgb.invalid":"Numbers only, 0 to 255","colorcustom.rgb.invalidHex":"Hexadecimal only, 000000 to FFFFFF","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},mE=function(t,n,e){var o=function(t){return"tox-"+t},r=rE(function(t){return function(n){return f(n)?t.translate(dE[n]):t.translate(n)}}(n),o,n.tooltips.getConfig,function(t,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t;return xx(arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:_({title:n.translate(o),"aria-live":"polite"},e.fold(function(){return{}},function(t){return{id:t}}))},n.icons)}),i=jb(r.sketch({dom:{tag:"div",classes:[o("color-picker-container")],attributes:{role:"presentation"}},onValidHex:function(t){su(t,NO,{name:"hex-valid",value:!0})},onInvalidHex:function(t){su(t,NO,{name:"hex-valid",value:!1})}}));return{dom:{tag:"div"},components:[i.asSpec()],behaviours:zu([sE(e,function(t){var n=i.get(t);return og.getCurrent(n).bind(function(t){return Xd.getValue(t).hex}).map(function(t){return"#"+Ut(t,"#")}).getOr("")},function(t,n){var e=G.from(/^#([a-fA-F0-9]{3}(?:[a-fA-F0-9]{3})?)/.exec(n)).bind(function(t){return vt(t,1)}),o=i.get(t);og.getCurrent(o).fold(function(){console.log("Can not find form")},function(t){Xd.setValue(t,{hex:e.getOr("")}),JT.getField(t,"hex").each(function(t){cu(t,Ti())})})}),iE()])}},gE=tinymce.util.Tools.resolve("tinymce.Resource"),pE=function(t){return Ft(t,"init")},hE=tinymce.util.Tools.resolve("tinymce.util.Tools"),vE=mc("browse.files.event"),bE=function(t,n,e){var o=function(t,n){n.stop()},r=function(t){return function(n,e){et(t,function(t){t(n,e)})}},i=function(e,o){o&&(Xd.setValue(e,function(t,n){var e=hE.explode(n.getOption("images_file_types"));
2return rt(xt(t),function(t){return Q(e,function(n){return Gt(t.name.toLowerCase(),".".concat(n.toLowerCase()))})})}(o,n)),su(e,IO,{name:t.name}))},u=jb({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:zu([Rh("input-file-events",[Su(Di()),Su(Ui())])])}),a=t.label.map(function(t){return BO(t,n)}),c=TO.parts.field({factory:Ub,dom:{tag:"button",styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[Qc(n.translate("Browse for an image")),u.asSpec()],action:function(t){u.get(t).element.dom.click()},buttonBehaviours:zu([iE(),fE(e.getOr([])),Yb.config({}),kS(function(){return n.checkUiComponentContext(t.context).shouldDisable}),IS(function(){return n.checkUiComponentContext(t.context)})])}),s={dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:zu([vg.config({disabled:function(){return n.checkUiComponentContext(t.context).shouldDisable}}),IS(function(){return n.checkUiComponentContext(t.context)}),Xh.config({toggleClass:"dragenter",toggleOnExecute:!1}),Rh("dropzone-events",[vu("dragenter",r([o,Xh.toggle])),vu("dragleave",r([o,Xh.toggle])),vu("dragover",o),vu("drop",r([o,function(t,n){var e;if(!vg.isDisabled(t)){var o=n.event.raw;su(t,vE,{files:null===(e=o.dataTransfer)||void 0===e?void 0:e.files})}}])),vu(Ei(),function(t,n){var e=n.event.raw.target;su(t,vE,{files:e.files})})])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p"},components:[Qc(n.translate("Drop an image here"))]},c]}]};return DO(a,s,["tox-form__group--stretched"],[Rh("handle-files",[vu(vE,function(t,n){TO.getField(t).each(function(t){i(t,n.event.files)})})])])},yE=function(t,n){var e=null,o=function(){b(e)||(clearTimeout(e),e=null)};return{cancel:o,throttle:function(){for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];o(),e=setTimeout(function(){e=null,t.apply(null,i)},n)}}},xE=mc("alloy-fake-before-tabstop"),wE=mc("alloy-fake-after-tabstop"),SE=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:zu([Hh.config({ignore:!0}),Yb.config({})])}},CE=function(t,n){return{dom:{tag:"div",classes:["tox-navobj"].concat(w(t.getOr([])))},components:[SE([xE]),n,SE([wE])],behaviours:zu([aE(1)])}},kE=function(t,n){su(t,Oi(),{raw:{which:9,shiftKey:n}})},OE=function(t,n){var e=n.element;Zu(e,xE)?kE(t,!0):Zu(e,wE)&&kE(t,!1)},_E=function(t){return lO(t,["."+xE,"."+wE].join(","),W)},TE=mc("update-dialog"),EE=mc("update-title"),DE=mc("update-body"),AE=mc("update-footer"),ME=mc("body-send-message"),BE=mc("dialog-focus-shifted"),IE=Ge().browser,FE=IE.isSafari(),RE=IE.isFirefox(),NE=FE||RE,LE=IE.isChromium(),zE=function(t){var n=t.scrollTop,e=t.scrollHeight,o=t.clientHeight;return Math.ceil(n)+o>=e},PE=function(t,n){return t.scrollTo(0,"bottom"===n?99999999:n)},HE=function(t,n,e){var o=t.dom;G.from(o.contentDocument).fold(e,function(t){var e=0,r=function(t,n){var e=t.body;return G.from(!/^<!DOCTYPE (html|HTML)/.test(n)&&(!LE&&!FE||O(e)&&(0!==e.scrollTop||Math.abs(e.scrollHeight-e.clientHeight)>1))?e:t.documentElement)}(t,n).map(function(t){return e=t.scrollTop,t}).forall(zE),i=function(){var t=o.contentWindow;O(t)&&(r?PE(t,"bottom"):!r&&NE&&0!==e&&PE(t,e))};FE&&o.addEventListener("load",i,{once:!0}),t.open(),t.write(n),t.close(),FE||i()})},VE=Ht(NE,FE?500:200),UE=VE.map(function(t){return n=HE,e=t,o=null,r=null,{cancel:function(){b(o)||(clearTimeout(o),o=null,r=null)},throttle:function(){for(var t=arguments.length,i=new Array(t),u=0;u<t;u++)i[u]=arguments[u];r=i,b(o)&&(o=setTimeout(function(){var t=r;o=null,r=null,n.apply(null,t)},e))}};var n,e,o,r}),WE=function(t,n,e){var o="tox-dialog__iframe",r=t.transparent?[]:["".concat(o,"--opaque")],i=t.border?["tox-navobj-bordered"]:[],u=_(_(_({},t.label.map(function(t){return{title:t}}).getOr({})),e.map(function(t){return{srcdoc:t}}).getOr({})),t.sandboxed?{sandbox:"allow-scripts allow-same-origin"}:{}),a=function(t,n){var e=ho(t.getOr(""));return{getValue:function(t){return e.get()},setValue:function(t,o){if(e.get()!==o){var r=t.element,i=function(){return Hn(r,"srcdoc",o)};n?UE.fold(N(HE),function(t){return t.throttle})(r,o,i):i()}e.set(o)}}}(e,t.streamContent),c=t.label.map(function(t){return BO(t,n)}),s=TO.parts.field({factory:{sketch:function(t){return CE(G.from(i),{uid:t.uid,dom:{tag:"iframe",attributes:u,classes:[o].concat(r)},behaviours:zu([Yb.config({}),Hh.config({}),sE(e,a.getValue,a.setValue),Qs.config({channels:T({},BE,{onReceive:function(t,n){n.newFocus.each(function(n){Sn(t.element).each(function(e){(pn(t.element,n)?Ku:$u)(e,"tox-navobj-bordered-focus")})})}})})])})}}});return DO(c,s,["tox-form__group--stretched"],[])},jE=function(t,n){var e=ho(n.getOr({url:""})),o=jb({dom:{tag:"img",classes:["tox-imagepreview__image"],attributes:n.map(function(t){return{src:t.url}}).getOr({})}}),r=jb({dom:{tag:"div",classes:["tox-imagepreview__container"],attributes:{role:"presentation"}},components:[o.asSpec()]}),i={};
2t.height.each(function(t){return i.height=t});var u=n.map(function(t){return{url:t.url,zoom:G.from(t.zoom),cachedWidth:G.from(t.cachedWidth),cachedHeight:G.from(t.cachedHeight)}});return{dom:{tag:"div",classes:["tox-imagepreview"],styles:i,attributes:{role:"presentation"}},components:[r.asSpec()],behaviours:zu([iE(),sE(u,function(){return e.get()},function(t,n){var i={url:n.url};n.zoom.each(function(t){return i.zoom=t}),n.cachedWidth.each(function(t){return i.cachedWidth=t}),n.cachedHeight.each(function(t){return i.cachedHeight=t}),e.set(i);var u=function(){var n=i.cachedWidth,e=i.cachedHeight,o=i.zoom;if(!C(n)&&!C(e)){if(C(o)){var u=function(t,n,e){var o=ge(t),r=ue(t);return Math.min(o/n,r/e,1)}(t.element,n,e);i.zoom=u}var a=function(t,n,e,o,r){var i=e*r,u=o*r,a=Math.max(0,t/2-i/2),c=Math.max(0,n/2-u/2);return{left:a.toString()+"px",top:c.toString()+"px",width:i.toString()+"px",height:u.toString()+"px"}}(ge(t.element),ue(t.element),n,e,i.zoom);r.getOpt(t).each(function(t){Kn(t.element,a)})}};o.getOpt(t).each(function(e){var o,r=e.element;n.url!==Un(r,"src")&&(Hn(r,"src",n.url),$u(t.element,"tox-imagepreview__loaded")),u(),(o=r,new Promise(function(t,n){var e=function(){i(),t(o)},r=[wl(o,"load",e),wl(o,"error",function(){i(),n("Unable to load data from image: "+o.dom.src)})],i=function(){return et(r,function(t){return t.unbind()})};o.dom.complete&&e()})).then(function(n){t.getSystem().isConnected()&&(Ku(t.element,"tox-imagepreview__loaded"),i.cachedWidth=n.dom.naturalWidth,i.cachedHeight=n.dom.naturalHeight,u())})})})])}},GE=mc("toolbar.button.execute"),qE=mc("common-button-display-events"),YE=T(T(T(T({},Hi(),["disabling","alloy.base.behaviour","toggling","toolbar-button-events","tooltipping"]),$i(),["toolbar-button-events",qE]),Qi(),["toolbar-button-events","dropdown-events","tooltipping"]),bi(),["focusing","alloy.base.behaviour",qE]),XE=function(t){return Xn(t.element,"width",$n(t.element,"width"))},KE=function(t,n,e){return xx(t,{tag:"span",classes:["tox-icon","tox-tbtn__icon-wrap"],behaviours:e},n)},JE=function(t,n){return KE(t,n,[])},$E=function(t,n){return KE(t,n,[Fh.config({})])},QE=function(t,n,e){return{dom:{tag:"span",classes:["".concat(n,"__select-label")]},components:[Qc(e.translate(t))],behaviours:zu([Fh.config({})])}},ZE=mc("update-menu-text"),tD=mc("update-menu-icon"),nD=function(t,n,e,o){var r=ho(I),i=t.text.map(function(t){return jb(QE(t,n,e.providers))}),u=t.icon.map(function(t){return jb($E(t,e.providers.icons))}),a=function(t,n){var e=Xd.getValue(t);return Hh.focus(e),su(e,"keydown",{raw:n.event.raw}),Jk.close(e),G.some(!0)},c=t.role.fold(function(){return{}},function(t){return{role:t}}),s=G.from(t.listRole).map(function(t){return{listRole:t}}).getOr({}),l=t.ariaLabel.fold(function(){return{}},function(t){return{"aria-label":e.providers.translate(t)}}),f=xx("chevron-down",{tag:"div",classes:["".concat(n,"__select-chevron")]},e.providers.icons),d=mc("common-button-display-events"),m="dropdown-events",g=jb(Jk.sketch(_(_(_(_({},t.uid?{uid:t.uid}:{}),c),s),{},{dom:{tag:"button",classes:[n,"".concat(n,"--select")].concat(nt(t.classes,function(t){return"".concat(n,"--").concat(t)})),attributes:_(_({},l),O(o)?{"data-mce-name":o}:{})},components:NS([u.map(function(t){return t.asSpec()}),i.map(function(t){return t.asSpec()}),G.some(f)]),matchWidth:!0,useMinWidth:!0,onOpen:function(n,e,o){t.searchable&&function(t){nw(t).each(function(t){return Hh.focus(t)})}(o)},dropdownBehaviours:zu([].concat(w(t.dropdownBehaviours),[kS(function(){return t.disabled||e.providers.checkUiComponentContext(t.context).shouldDisable}),IS(function(){return e.providers.checkUiComponentContext(t.context)}),t_.config({}),Fh.config({})],w(t.tooltip.map(function(t){return ry.config(e.providers.tooltips.getConfig({tooltipText:e.providers.translate(t)}))}).toArray()),[Rh(m,[ES(t,r),DS(t,r)]),Rh(d,[Ou(function(n,e){"listbox"!==t.listRole&&XE(n)})]),Rh("update-dropdown-width-variable",[vu(Ji(),function(t,n){return Jk.close(t)})]),Rh("menubutton-update-display-text",[vu(ZE,function(t,n){i.bind(function(n){return n.getOpt(t)}).each(function(t){Fh.set(t,[Qc(e.providers.translate(n.event.text))])})}),vu(tD,function(t,n){u.bind(function(n){return n.getOpt(t)}).each(function(t){Fh.set(t,[$E(n.event.icon,e.providers.icons)])})})])])),eventOrder:Ho(YE,T(T({},bi(),["focusing","alloy.base.behaviour","item-type-events","normal-dropdown-events"]),$i(),["toolbar-button-events",ry.name(),m,d])),sandboxBehaviours:zu([Oh.config({mode:"special",onLeft:a,onRight:a}),Rh("dropdown-sandbox-events",[vu($x,function(t,n){$k(t),n.stop()}),vu(Qx,function(t,n){Qk(t,n),n.stop()})])]),lazySink:e.getSink,toggleClass:"".concat(n,"--active"),parts:{menu:_(_({},Gx(0,t.columns,t.presets)),{},{fakeFocus:t.searchable},"listbox"===t.listRole?{}:{onHighlightItem:tO,onCollapseMenu:function(t,n,e){Eg.getHighlighted(e).each(function(n){tO(t,e,n)})},onDehighlightItem:nO})},getAnchorOverrides:function(){return{maxHeightFunction:function(t,n){Il()(t,n-10)}}},fetch:function(n){return Fk(P(t.fetch,n))}})));return g.asSpec()},eD=function(t){return"separator"===t.type},oD={type:"separator"},rD=function(t,n){var e=ut(t,function(t,e){return function(t){return f(t)}(e)?""===e?t:"|"===e?t.length>0&&!eD(t[t.length-1])?t.concat([oD]):t:Ft(n,e.toLowerCase())?t.concat([n[e.toLowerCase()]]):t:t.concat([e])},[]);return e.length>0&&eD(e[e.length-1])&&e.pop(),e},iD=function(t,n){var e=t.getSubmenuItems(),o=uD(e,n);return{item:t,menus:Ho(o.menus,T({},t.value,o.items)),expansions:Ho(o.expansions,T({},t.value,t.value))}},uD=function(t,n){var e=rD(f(t)?t.split(" "):t,n);return it(e,function(t,e){if(function(t){return Ft(t,"getSubmenuItems")}(e)){var o=function(t){var n=It(t,"value").getOrThunk(function(){return mc("generated-menu-item")});return Ho({value:n},t)}(e),r=iD(o,n);return{menus:Ho(t.menus,r.menus),items:[r.item].concat(w(t.items)),expansions:Ho(t.expansions,r.expansions)}}return _(_({},t),{},{items:[e].concat(w(t.items))})},{menus:{},expansions:{},items:[]})},aD=function(t,n,e,o){var r=mc("primary-menu"),i=uD(t,e.shared.providers.menuItems());if(0===i.items.length)return G.none();var u=function(t){return t.search.fold(function(){return{searchMode:"no-search"}},function(t){return{searchMode:"search-with-field",placeholder:t.placeholder}})}(o),a=uO(r,i.items,n,e,o.isHorizontalMenu,u),c=function(t){return t.search.fold(function(){return{searchMode:"no-search"}},function(t){return{searchMode:"search-with-results"}})}(o),s=Ot(i.menus,function(t,o){return uO(o,t,n,e,!1,c)}),l=Ho(s,oi(r,a));return G.from(_v.tieredData(r,l,i.expansions))},cD=function(t){return!Ft(t,"items")},sD="data-value",lD=function(t,n,e,o,r){return nt(e,function(e){return cD(e)?_(_({type:"togglemenuitem"},r?{}:{role:"option"}),{},{text:e.text,value:e.value,active:e.value===o,onAction:function(){Xd.setValue(t,e.value),su(t,IO,{name:n}),Hh.focus(t)}}):{type:"nestedmenuitem",text:e.text,getSubmenuItems:function(){return lD(t,n,e.items,o,r)}}})},fD=function(t,n){return wt(t,function(t){return cD(t)?Ht(t.value===n,t):fD(t.items,n)})},dD=Qm({name:"HtmlSelect",configFields:[Dr("options"),Kd("selectBehaviours",[Hh,Xd]),Gr("selectClasses",[]),Gr("selectAttributes",{}),Lr("data")],factory:function(t,n){var e=nt(t.options,function(t){return{dom:{tag:"option",value:t.value,innerHtml:t.text}}}),o=t.data.map(function(t){return oi("initialValue",t)}).getOr({});return{uid:t.uid,dom:{tag:"select",classes:t.selectClasses,attributes:t.selectAttributes},components:e,behaviours:$d(t.selectBehaviours,[Hh.config({}),Xd.config({store:_({mode:"manual",getValue:function(t){return zc(t.element)},setValue:function(n,e){var o=bt(t.options);at(t.options,function(t){return t.value===e}).isSome()?Pc(n.element,e):-1===n.element.dom.selectedIndex&&""===e&&o.each(function(t){return Pc(n.element,t.value)})}},o)})])}}}),mD=N([Gr("field1Name","field1"),Gr("field2Name","field2"),nc("onLockedChange"),$a(["lockClass"]),Gr("locked",!1),Qd("coupledFieldBehaviours",[og,Xd])]),gD=function(t,n){return km({factory:TO,name:t,overrides:function(t){return{fieldBehaviours:zu([Rh("coupled-input-behaviour",[vu(Ti(),function(e){(function(t,n,e){return zm(t,n,e).bind(og.getCurrent)})(e,t,n).each(function(n){zm(e,t,"lock").each(function(o){Xh.isOn(o)&&t.onLockedChange(e,n,o)})})})])])}}})},pD=N([gD("field1","field2"),gD("field2","field1"),km({factory:Ub,schema:[Dr("dom")],name:"lock",overrides:function(t){return{buttonBehaviours:zu([Xh.config({selected:t.locked,toggleClass:t.markers.lockClass,aria:{mode:"pressed"}})])}}})]),hD=Zm({name:"FormCoupledInputs",configFields:mD(),partFields:pD(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,behaviours:Zd(t.coupledFieldBehaviours,[og.config({find:G.some}),Xd.config({store:{mode:"manual",getValue:function(n){var e=Wm(n,t,["field1","field2"]);return T(T({},t.field1Name,Xd.getValue(e.field1())),t.field2Name,Xd.getValue(e.field2()))},setValue:function(n,e){var o=Wm(n,t,["field1","field2"]);Rt(e,t.field1Name)&&Xd.setValue(o.field1(),e[t.field1Name]),Rt(e,t.field2Name)&&Xd.setValue(o.field2(),e[t.field2Name])}}})]),apis:{getField1:function(n){return zm(n,t,"field1")},getField2:function(n){return zm(n,t,"field2")},getLock:function(n){return zm(n,t,"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)}}}),vD=function(t){var n=/^\s*(\d+(?:\.\d+)?)\s*(|cm|mm|in|px|pt|pc|em|ex|ch|rem|vw|vh|vmin|vmax|%)\s*$/.exec(t);if(null!==n){var e=parseFloat(n[1]),o=n[2];return Co.value({value:e,unit:o})}return Co.error(t)},bD=function(t,n){var e={"":96,px:96,pt:72,cm:2.54,pc:12,mm:25.4,in:1},o=function(t){return Ft(e,t)};return t.unit===n?G.some(t.value):o(t.unit)&&o(n)?e[t.unit]===e[n]?G.some(t.value):G.some(t.value/e[t.unit]*e[n]):G.none()},yD=function(t){return G.none()},xD=function(t,n){var e=vD(t).toOptional(),o=vD(n).toOptional();return zt(e,o,function(t,n){return bD(t,n.unit).map(function(t){return n.value/t}).map(function(t){return e=t,o=n.unit,function(t){return bD(t,o).map(function(t){return{value:t*e,unit:o}})};var e,o}).getOr(yD)}).getOr(yD)},wD=function(t,n){var e=t.label.map(function(t){return BO(t,n)}),o=[vg.config({disabled:function(){return t.disabled||n.checkUiComponentContext(t.context).shouldDisable}}),IS(function(){return n.checkUiComponentContext(t.context)}),Oh.config({mode:"execution",useEnter:!0!==t.multiline,useControlEnter:!0===t.multiline,execute:function(t){return cu(t,LO),G.some(!0)}}),Rh("textfield-change",[vu(Ti(),function(n,e){su(n,IO,{name:t.name})}),vu(zi(),function(n,e){su(n,IO,{name:t.name})})]),Yb.config({})],r=t.validation.map(function(t){return QO.config({getRoot:function(t){return Sn(t.element)},invalidClass:"tox-invalid",validator:{validate:function(n){var e=Xd.getValue(n),o=t.validator(e);return Rk(!0===o?Co.value(e):Co.error(o))},validateOnLoad:t.validateOnLoad}})}).toArray(),i=t.placeholder.fold(N({}),function(t){return{placeholder:n.translate(t)}
2}),u=t.inputMode.fold(N({}),function(t){return{inputmode:t}}),a=_(_(_({},i),u),{},{"data-mce-name":t.name}),c=TO.parts.field(_(_({tag:!0===t.multiline?"textarea":"input"},t.data.map(function(t){return{data:t}}).getOr({})),{},{inputAttributes:a,inputClasses:[t.classname],inputBehaviours:zu(st([o,r])),selectOnFocus:!1,factory:Jx})),s=t.multiline?{dom:{tag:"div",classes:["tox-textarea-wrap"]},components:[c]}:c,l=(t.flex?["tox-form__group--stretched"]:[]).concat(t.maximized?["tox-form-group--maximize"]:[]),f=[vg.config({disabled:function(){return t.disabled||n.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){TO.getField(t).each(vg.disable)},onEnabled:function(t){TO.getField(t).each(vg.enable)}}),IS(function(){return n.checkUiComponentContext(t.context)})];return DO(e,s,l,f)},SD=function(t,n){return n.getAnimationRoot.fold(function(){return t.element},function(n){return n(t)})},CD=function(t){return t.dimension.property},kD=function(t,n){return t.dimension.getDimension(n)},OD=function(t,n){var e=SD(t,n);na(e,[n.shrinkingClass,n.growingClass])},_D=function(t,n){$u(t.element,n.openClass),Ku(t.element,n.closedClass),Xn(t.element,CD(n),"0px"),oe(t.element)},TD=function(t,n){$u(t.element,n.closedClass),Ku(t.element,n.openClass),ee(t.element,CD(n))},ED=function(t,n,e,o){e.setCollapsed(),Xn(t.element,CD(n),kD(n,t.element)),OD(t,n),_D(t,n),n.onStartShrink(t),n.onShrunk(t)},DD=function(t,n,e,o){var r=o.getOrThunk(function(){return kD(n,t.element)});e.setCollapsed(),Xn(t.element,CD(n),r),oe(t.element);var i=SD(t,n);$u(i,n.growingClass),Ku(i,n.shrinkingClass),_D(t,n),n.onStartShrink(t)},AD=function(t,n,e){var o=kD(n,t.element);("0px"===o?ED:DD)(t,n,e,G.some(o))},MD=function(t,n,e){var o=SD(t,n),r=Zu(o,n.shrinkingClass),i=kD(n,t.element);TD(t,n);var u=kD(n,t.element);(r?function(){Xn(t.element,CD(n),i),oe(t.element)}:function(){_D(t,n)})(),$u(o,n.shrinkingClass),Ku(o,n.growingClass),TD(t,n),Xn(t.element,CD(n),u),e.setExpanded(),n.onStartGrow(t)},BD=function(t,n,e){var o=SD(t,n);return!0===Zu(o,n.growingClass)},ID=function(t,n,e){var o=SD(t,n);return!0===Zu(o,n.shrinkingClass)},FD=Object.freeze({__proto__:null,refresh:function(t,n,e){if(e.isExpanded()){ee(t.element,CD(n));var o=kD(n,t.element);Xn(t.element,CD(n),o)}},grow:function(t,n,e){e.isExpanded()||MD(t,n,e)},shrink:function(t,n,e){e.isExpanded()&&AD(t,n,e)},immediateShrink:function(t,n,e){e.isExpanded()&&ED(t,n,e)},hasGrown:function(t,n,e){return e.isExpanded()},hasShrunk:function(t,n,e){return e.isCollapsed()},isGrowing:BD,isShrinking:ID,isTransitioning:function(t,n,e){return BD(t,n)||ID(t,n)},toggleGrow:function(t,n,e){(e.isExpanded()?AD:MD)(t,n,e)},disableTransitions:OD,immediateGrow:function(t,n,e){e.isExpanded()||(TD(t,n),Xn(t.element,CD(n),kD(n,t.element)),OD(t,n),e.setExpanded(),n.onStartGrow(t),n.onGrown(t))}}),RD=Object.freeze({__proto__:null,exhibit:function(t,n,e){var o=n.expanded;return Mu(o?{classes:[n.openClass],styles:{}}:{classes:[n.closedClass],styles:oi(n.dimension.property,"0px")})},events:function(t,n){return gu([ku(Mi(),function(e,o){o.event.raw.propertyName===t.dimension.property&&(OD(e,t),n.isExpanded()&&ee(e.element,t.dimension.property),(n.isExpanded()?t.onGrown:t.onShrunk)(e))})])}}),ND=[Dr("closedClass"),Dr("openClass"),Dr("shrinkingClass"),Dr("growingClass"),Lr("getAnimationRoot"),Za("onShrunk"),Za("onStartShrink"),Za("onGrown"),Za("onStartGrow"),Gr("expanded",!1),Ar("dimension",kr("property",{width:[oc("property","width"),oc("getDimension",function(t){return ge(t)+"px"})],height:[oc("property","height"),oc("getDimension",function(t){return ue(t)+"px"})]}))],LD=Object.freeze({__proto__:null,init:function(t){var n=ho(t.expanded);return Lu({isExpanded:function(){return!0===n.get()},isCollapsed:function(){return!1===n.get()},setCollapsed:P(n.set,!1),setExpanded:P(n.set,!0),readState:function(){return"expanded: "+n.get()}})}}),zD=Hu({fields:ND,name:"sliding",active:RD,apis:FD,state:LD}),PD=function(t){return{isEnabled:function(){return!vg.isDisabled(t)},setEnabled:function(n){return vg.set(t,!n)},setActive:function(n){var e=t.element;n?(Ku(e,"tox-tbtn--enabled"),Hn(e,"aria-pressed",!0)):($u(e,"tox-tbtn--enabled"),Gn(e,"aria-pressed"))},isActive:function(){return Zu(t.element,"tox-tbtn--enabled")},setText:function(n){su(t,ZE,{text:n})},setIcon:function(n){return su(t,tD,{icon:n})}}},HD=function(t,n,e,o){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=arguments.length>5?arguments[5]:void 0;return nD({text:t.text,icon:t.icon,tooltip:t.tooltip,ariaLabel:t.tooltip,searchable:t.search.isSome(),role:o,fetch:function(n,o){var r={pattern:t.search.isSome()?eO(n):""};t.fetch(function(n){o(aD(n,Tx.CLOSE_ON_EXECUTE,e,{isHorizontalMenu:!1,search:t.search}))},r,PD(n))},onSetup:t.onSetup,getApi:PD,columns:1,presets:"normal",classes:[],dropdownBehaviours:w(r?[Yb.config({})]:[]),context:t.context},n,e.shared,i)},VD=function(t,n,e){var o=function(t){return function(o){var r=!o.isActive();o.setActive(r),t.storage.set(r),e.shared.getSink().each(function(e){n().getOpt(e).each(function(n){tl(n.element),su(n,NO,{name:t.name,value:t.storage.get()})})})}}
2,r=function(t){return function(n){n.setActive(t.storage.get())}};return function(n){n(nt(t,function(t){var n=t.text.fold(function(){return{}},function(t){return{text:t}});return _(_({type:t.type,active:!1},n),{},{context:t.context,onAction:o(t),onSetup:r(t)})}))}},UD=function(t){return{dom:{tag:"span",classes:["tox-tree__label"],attributes:{"aria-label":t}},components:[Qc(t)]}},WD=function(t,n,e){t.customStateIcon.each(function(o){return n.push(qD(o,e.shared.providers.icons,t.customStateIconTooltip.fold(function(){return[]},function(t){return[ry.config(e.shared.providers.tooltips.getConfig({tooltipText:t}))]}),["tox-icon-custom-state"],t.customStateIconTooltip.fold(function(){return{}},function(t){return{title:t}})))})},jD=mc("leaf-label-event-id"),GD=function(t){var n=t.leaf,e=t.onLeafAction,o=t.visible,r=t.treeId,i=t.selectedId,u=t.backstage,a=n.menu.map(function(t){return HD(t,"tox-mbtn",u,G.none(),o)}),c=[UD(n.title)];return WD(n,c,u),a.each(function(t){return c.push(t)}),Ub.sketch({dom:{tag:"div",classes:["tox-tree--leaf__label","tox-trbtn"].concat(o?["tox-tree--leaf__label--visible"]:[])},components:c,role:"treeitem",action:function(t){e(n.id),t.getSystem().broadcastOn(["update-active-item-".concat(r)],{value:n.id})},eventOrder:T({},Oi(),[jD,"keying"]),buttonBehaviours:zu([].concat(w(o?[Yb.config({})]:[]),[Xh.config({toggleClass:"tox-trbtn--enabled",toggleOnExecute:!1,aria:{mode:"selected"}}),Qs.config({channels:T({},"update-active-item-".concat(r),{onReceive:function(t,e){(e.value===n.id?Xh.on:Xh.off)(t)}})}),Rh(jD,[Ou(function(t,e){i.each(function(e){(e===n.id?Xh.on:Xh.off)(t)})}),vu(Oi(),function(t,n){var e="ArrowLeft"===n.event.raw.code,o="ArrowRight"===n.event.raw.code;e?(ss(t.element,".tox-tree--directory").each(function(n){t.getSystem().getByDom(n).each(function(t){fs(n,".tox-tree--directory__label").each(function(n){t.getSystem().getByDom(n).each(Hh.focus)})})}),n.stop()):o&&n.stop()})])]))})},qD=function(t,n,e,o,r){return xx(t,{tag:"span",classes:["tox-tree__icon-wrap","tox-icon"].concat(o||[]),behaviours:e,attributes:r},n)},YD=mc("directory-label-event-id"),XD=function(t){var n,e,o=t.directory,r=t.visible,i=t.noChildren,u=t.backstage,a=o.menu.map(function(t){return HD(t,"tox-mbtn",u,G.none())}),c=[{dom:{tag:"div",classes:["tox-chevron"]},components:[(n="chevron-right",e=u.shared.providers.icons,qD(n,e,[]))]},UD(o.title)];WD(o,c,u),a.each(function(t){c.push(t)});var s=function(t){ss(t.element,".tox-tree--directory").each(function(n){t.getSystem().getByDom(n).each(function(n){var e=!Xh.isOn(n);Xh.toggle(n),su(t,"expand-tree-node",{expanded:e,node:o.id})})})};return Ub.sketch({dom:{tag:"div",classes:["tox-tree--directory__label","tox-trbtn"].concat(r?["tox-tree--directory__label--visible"]:[])},components:c,action:s,eventOrder:T({},Oi(),[YD,"keying"]),buttonBehaviours:zu([].concat(w(r?[Yb.config({})]:[]),[Rh(YD,[vu(Oi(),function(t,n){var e="ArrowRight"===n.event.raw.code,o="ArrowLeft"===n.event.raw.code;e&&i&&n.stop(),(e||o)&&ss(t.element,".tox-tree--directory").each(function(r){t.getSystem().getByDom(r).each(function(r){!Xh.isOn(r)&&e||Xh.isOn(r)&&o?(s(t),n.stop()):o&&!Xh.isOn(r)&&(ss(r.element,".tox-tree--directory").each(function(t){fs(t,".tox-tree--directory__label").each(function(t){r.getSystem().getByDom(t).each(Hh.focus)})}),n.stop())})})})])]))})},KD=function(t){var n=t.children,e=t.onLeafAction,o=t.visible,r=t.treeId,i=t.expandedIds,u=t.selectedId,a=t.backstage;return{dom:{tag:"div",classes:["tox-tree--directory__children"]},components:n.map(function(t){return"leaf"===t.type?GD({leaf:t,selectedId:u,onLeafAction:e,visible:o,treeId:r,backstage:a}):$D({directory:t,expandedIds:i,selectedId:u,onLeafAction:e,labelTabstopping:o,treeId:r,backstage:a})}),behaviours:zu([zD.config({dimension:{property:"height"},closedClass:"tox-tree--directory__children--closed",openClass:"tox-tree--directory__children--open",growingClass:"tox-tree--directory__children--growing",shrinkingClass:"tox-tree--directory__children--shrinking",expanded:o}),Fh.config({})])}},JD=mc("directory-event-id"),$D=function(t){var n=t.directory,e=t.onLeafAction,o=t.labelTabstopping,r=t.treeId,i=t.backstage,u=t.expandedIds,a=t.selectedId,c=n.children,s=ho(u),l=u.includes(n.id
2);return{dom:{tag:"div",classes:["tox-tree--directory"],attributes:{role:"treeitem"}},components:[XD({directory:n,visible:o,noChildren:0===n.children.length,backstage:i}),KD({children:c,expandedIds:u,selectedId:a,onLeafAction:e,visible:l,treeId:r,backstage:i})],behaviours:zu([Rh(JD,[Ou(function(t,n){Xh.set(t,l)}),vu("expand-tree-node",function(t,n){var e=n.event,o=e.expanded,r=e.node;s.set(o?[].concat(w(s.get()),[r]):s.get().filter(function(t){return t!==r}))})]),Xh.config(_(_({},n.children.length>0?{aria:{mode:"expanded"}}:{}),{},{toggleClass:"tox-tree--directory--expanded",onToggled:function(t,n){var o,u=t.components()[1],l=(o=n,c.map(function(t){return"leaf"===t.type?GD({leaf:t,selectedId:a,onLeafAction:e,visible:o,treeId:r,backstage:i}):$D({directory:t,expandedIds:s.get(),selectedId:a,onLeafAction:e,labelTabstopping:o,treeId:r,backstage:i})}));n?zD.grow(u):zD.shrink(u),Fh.set(u,l)}}))])}},QD=mc("tree-event-id"),ZD=Object.freeze({__proto__:null,events:function(t,n){var e=t.stream.streams.setup(t,n);return gu([vu(t.event,e),_u(function(){return n.cancel()})].concat(t.cancelEvent.map(function(t){return[vu(t,function(){return n.cancel()})]}).getOr([])))}}),tA=function(t){var n=ho(null);return Lu({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()}})},nA=Object.freeze({__proto__:null,throttle:tA,init:function(t){return t.stream.streams.state(t)}}),eA=[Ar("stream",kr("mode",{throttle:[Dr("delay"),Gr("stopEvent",!0),oc("streams",{setup:function(t,n){var e=t.stream,o=yE(t.onStream,e.delay);return n.setTimer(o),function(t,n){o.throttle(t,n),e.stopEvent&&n.stop()}},state:tA})]})),Gr("event","input"),Lr("cancelEvent"),nc("onStream")],oA=Hu({fields:eA,name:"streaming",active:ZD,state:nA}),rA=function(t,n,e){var o=Xd.getValue(e);Xd.setValue(n,o),uA(n)},iA=function(t,n){var e=t.element,o=zc(e),r=e.dom;"number"!==Un(e,"type")&&n(r,o)},uA=function(t){iA(t,function(t,n){return t.setSelectionRange(n.length,n.length)})},aA=function(t,n,e){if(t.selectsOver){var o=Xd.getValue(n),r=t.getDisplayText(o),i=Xd.getValue(e);return 0===t.getDisplayText(i).indexOf(r)?G.some(function(){rA(0,n,e),function(t,n){iA(t,function(t,e){return t.setSelectionRange(n,e.length)})}(n,r.length)}):G.none()}return G.none()},cA=N("alloy.typeahead.itemexecute"),sA=N([Lr("lazySink"),Dr("fetch"),Gr("minChars",5),Gr("responseTime",1e3),Za("onOpen"),Gr("getHotspot",G.some),Gr("getAnchorOverrides",N({})),Gr("layouts",G.none()),Gr("eventOrder",{}),Zr("model",{},[Gr("getDisplayText",function(t){return void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.value}),Gr("selectsOver",!0),Gr("populateFromBrowse",!0)]),Za("onSetValue"),tc("onExecute"),Za("onItemExecute"),Gr("inputClasses",[]),Gr("inputAttributes",{}),Gr("inputStyles",{}),Gr("matchWidth",!0),Gr("useMinWidth",!1),Gr("dismissOnBlur",!0),$a(["openClass"]),Lr("initialData"),Lr("listRole"),Kd("typeaheadBehaviours",[Hh,Xd,oA,Oh,Xh,Dk]),Tr("lazyTypeaheadComp",function(){return ho(G.none)}),Tr("previewing",function(){return ho(!0)})].concat(qx()).concat(Yk())),lA=N([Om({schema:[Ja()],name:"menu",overrides:function(t){return{fakeFocus:!0,onHighlightItem:function(n,e,o){t.previewing.get()?t.lazyTypeaheadComp.get().each(function(n){aA(t.model,n,o).fold(function(){t.model.selectsOver?(Eg.dehighlight(e,o),t.previewing.set(!0)):t.previewing.set(!1)},function(n){n(),t.previewing.set(!1)})}):t.lazyTypeaheadComp.get().each(function(n){t.model.populateFromBrowse&&rA(t.model,n,o),Wn(o.element,"id").each(function(t){return Hn(n.element,"aria-activedescendant",t)})})},onExecute:function(n,e){return t.lazyTypeaheadComp.get().map(function(t){return su(t,cA(),{item:e}),!0})},onHover:function(n,e){t.previewing.set(!1),t.lazyTypeaheadComp.get().each(function(n){t.model.populateFromBrowse&&rA(t.model,n,e)})}}}})]),fA=Zm({name:"Typeahead",configFields:sA(),partFields:lA(),factory:function(t,n,e,o){var r=function(n,e,r){t.previewing.set(!1);var i=Dk.getCoupled(n,"sandbox");if(Ed.isOpen(i))og.getCurrent(i).each(function(t){Eg.getHighlighted(t).fold(function(){r(t)},function(){mu(i,t.element,"keydown",e)})});else{Pk(t,u(n),n,i,o,function(t){og.getCurrent(t).each(r)},Qg.HighlightMenuAndItem).get(I)}},i=Yx(t),u=function(t){return function(n){return n.map(function(n){var e=Bt(n.menus),o=lt(e,function(t){return rt(t.items,function(t){return"item"===t.type})});return Xd.getState(t).update(nt(o,function(t){return t.data})),n})}},a=function(t){return og.getCurrent(t)},c="typeaheadevents",s=[Hh.config({}),Xd.config({onSetValue:t.onSetValue,store:_({mode:"dataset",getDataKey:function(t){return zc(t.element)},getFallbackEntry:function(t){return{value:t,meta:{}}},setValue:function(n,e){Pc(n.element,t.model.getDisplayText(e))}},t.initialData.map(function(t){return oi("initialValue",t)}).getOr({}))}
2),oA.config({stream:{mode:"throttle",delay:t.responseTime,stopEvent:!1},onStream:function(n,e){var r=Dk.getCoupled(n,"sandbox");if(Hh.isFocused(n)&&zc(n.element).length>=t.minChars){var i=a(r).bind(function(t){return Eg.getHighlighted(t).map(Xd.getValue)});t.previewing.set(!0);Pk(t,u(n),n,r,o,function(n){a(r).each(function(n){i.fold(function(){t.model.selectsOver&&Eg.highlightFirst(n)},function(t){Eg.highlightBy(n,function(n){return Xd.getValue(n).value===t.value}),Eg.getHighlighted(n).orThunk(function(){return Eg.highlightFirst(n),G.none()})})})},Qg.HighlightJustMenu).get(I)}},cancelEvent:Gi()}),Oh.config({mode:"special",onDown:function(t,n){return r(t,n,Eg.highlightFirst),G.some(!0)},onEscape:function(t){var n=Dk.getCoupled(t,"sandbox");return Ed.isOpen(n)?(Ed.close(n),G.some(!0)):G.none()},onUp:function(t,n){return r(t,n,Eg.highlightLast),G.some(!0)},onEnter:function(n){var e=Dk.getCoupled(n,"sandbox"),o=Ed.isOpen(e);if(o&&!t.previewing.get())return a(e).bind(function(t){return Eg.getHighlighted(t)}).map(function(t){return su(n,cA(),{item:t}),!0});var r=Xd.getValue(n);return cu(n,Gi()),t.onExecute(e,n,r),o&&Ed.close(e),G.some(!0)}}),Xh.config({toggleClass:t.markers.openClass,aria:{mode:"expanded"}}),Dk.config({others:{sandbox:function(n){return Gk(t,n,{onOpen:function(){return Xh.on(n)},onClose:function(){t.lazyTypeaheadComp.get().each(function(t){return Gn(t.element,"aria-activedescendant")}),Xh.off(n)}})}}}),Rh(c,[Ou(function(n){t.lazyTypeaheadComp.set(G.some(n))}),_u(function(n){t.lazyTypeaheadComp.set(G.none())}),Eu(function(n){var e=I;Vk(t,u(n),n,o,e,Qg.HighlightMenuAndItem).get(I)}),vu(cA(),function(n,e){var o=Dk.getCoupled(n,"sandbox");rA(t.model,n,e.event.item),cu(n,Gi()),t.onItemExecute(n,o,e.event.item,Xd.getValue(n)),Ed.close(o),uA(n)})].concat(t.dismissOnBlur?[vu(Li(),function(t){var n=Dk.getCoupled(t,"sandbox");rl(n.element).isNone()&&Ed.close(n)})]:[]))],l=_(T({},Qi(),[Xd.name(),oA.name(),c]),t.eventOrder);return{uid:t.uid,dom:Kx(Ho(t,{inputAttributes:{role:"combobox","aria-autocomplete":"list","aria-haspopup":"true"}})),behaviours:_(_({},i),$d(t.typeaheadBehaviours,s)),eventOrder:l}}}),dA=function(t){return _(_({},t),{},{toCached:function(){return dA(t.toCached())},bindFuture:function(n){return dA(t.bind(function(t){return t.fold(function(t){return Rk(Co.error(t))},function(t){return n(t)})}))},bindResult:function(n){return dA(t.map(function(t){return t.bind(n)}))},mapResult:function(n){return dA(t.map(function(t){return t.map(n)}))},mapError:function(n){return dA(t.map(function(t){return t.mapError(n)}))},foldResult:function(n,e){return t.map(function(t){return t.fold(n,e)})},withTimeout:function(n,e){return dA(Fk(function(o){var r=!1,i=setTimeout(function(){r=!0,o(Co.error(e()))},n);t.get(function(t){r||(clearTimeout(i),o(t))})}))}})},mA=function(t){return dA(Fk(t))},gA=mA,pA=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0,u=arguments.length>6?arguments[6]:void 0,a=n.fold(function(){return{}},function(t){return{action:t}}),c=_({buttonBehaviours:zu([CS(function(){return!t.enabled||u.checkUiComponentContext(t.context).shouldDisable}),IS(function(){return u.checkUiComponentContext(t.context)}),Yb.config({})].concat(w(i.map(function(t){return ry.config(u.tooltips.getConfig({tooltipText:u.translate(t)}))}).toArray()),[Rh("button press",[hu("click")])]).concat(e)),eventOrder:{click:["button press","alloy.base.behaviour"],mousedown:["button press","alloy.base.behaviour"]}},a),s=Ho(c,{dom:o});return Ho(s,{components:r})},hA=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=arguments.length>4?arguments[4]:void 0,i={tag:"button",classes:["tox-tbtn"],attributes:_(_({},t.tooltip.map(function(t){return{"aria-label":e.translate(t)}}).getOr({})),{},{"data-mce-name":r})},u=t.icon.map(function(t){return JE(t,e.icons)}),a=NS([u]);return pA(t,n,o,i,a,t.tooltip,e)},vA=function(t){switch(t){case"primary":return["tox-button"];case"toolbar":return["tox-tbtn"];default:return["tox-button","tox-button--secondary"]}},bA=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=e.translate(t.text),u=t.icon.map(function(t){return JE(t,e.icons)}),a=[u.getOrThunk(function(){return Qc(i)})],c=t.buttonType.getOr(t.primary||t.borderless?"primary":"secondary"),s=vA(c),l={tag:"button",classes:[].concat(w(s),w(u.isSome()?["tox-button--icon"]:[]),w(t.borderless?["tox-button--naked"]:[]),w(r)),attributes:{"aria-label":i,"data-mce-name":t.text}},f=t.icon.map(N(i));return pA(t,n,o,l,a,f,e)},yA=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=bA(t,G.some(n),e,o,r);return Ub.sketch(i)},xA=function(t,n){return function(e){"custom"===n?su(e,NO,{name:t,value:{}}):"submit"===n?cu(e,LO):"cancel"===n?cu(e,RO):console.error("Unknown button type: ",n)}},wA=function(t,n,e){if(function(t,n){return"menu"===n}(0,n)){var o=t,r=_(_({},t),{},{type:"menubutton",search:G.none(),onSetup:function(n){return n.setEnabled(t.enabled),I},fetch:VD(o.items,function(){return i},e)}),i=jb(HD(r,"tox-tbtn",e,G.none(),!0,t.text.or(t.tooltip).getOrUndefined()));return i.asSpec()}if(function(t,n){return"custom"===n||"cancel"===n||"submit"===n}(0,n)){var u=xA(t.name,n),a=_(_({},t),{},{context:"cancel"===n?"any":t.context,borderless:!1});return yA(a,u,e.shared.providers,[])}if(function(t,n){return"togglebutton"===n}(0,n))return function(t,n,e){var o,r,i=t.icon.map(function(t){return $E(t,n.icons)}).map(jb),u=t.buttonType.getOr(t.primary?"primary":"secondary"),a=_(_({},t),{},{name:null!==(o=t.name)&&void 0!==o?o:"",primary:"primary"===u,tooltip:t.tooltip,enabled:null!==(r=t.enabled)&&void 0!==r&&r,borderless:!1}),c=a.tooltip.or(t.text).map(function(t){return{"aria-label":n.translate(t)}
2}).getOr({}),s=vA(null!=u?u:"secondary"),l=t.icon.isSome()&&t.text.isSome(),f={tag:"button",classes:[].concat(w(s.concat(t.icon.isSome()?["tox-button--icon"]:[])),w(t.active?["tox-button--enabled"]:[]),w(l?["tox-button--icon-and-text"]:[])),attributes:_(_({},c),O(e)?{"data-mce-name":e}:{})},d=n.translate(t.text.getOr("")),m=Qc(d),g=NS([i.map(function(t){return t.asSpec()})]),p=[].concat(w(g),w(t.text.isSome()?[m]:[])),h=pA(a,G.some(function(e){su(e,NO,{name:t.name,value:{setIcon:function(t){i.map(function(o){return o.getOpt(e).each(function(e){Fh.set(e,[$E(t,n.icons)])})})}}})}),[],f,p,t.tooltip,n);return Ub.sketch(h)}(t,e.shared.providers,t.text.or(t.tooltip).getOrUndefined());throw console.error("Unknown footer button type: ",n),new Error("Unknown footer button type")},SA=function(t,n){var e,o,r=xA(t.name,"custom");return e=G.none(),o=TO.parts.field(_({factory:Ub},bA(t,G.some(r),n,[fE(""),iE()]))),DO(e,o,[],[])},CA={type:"separator"},kA=function(t){return{type:"menuitem",value:t.url,text:t.title,meta:{attach:t.attach},onAction:I}},OA=function(t,n){return{type:"menuitem",value:n,text:t,meta:{attach:void 0},onAction:I}},_A=function(t,n){return function(t){return nt(t,kA)}(function(t,n){return rt(n,function(n){return n.type===t})}(t,n))},TA=function(t){return _A("header",t.targets)},EA=function(t){return _A("anchor",t.targets)},DA=function(t){return G.from(t.anchorTop).map(function(t){return OA("<top>",t)}).toArray()},AA=function(t){return G.from(t.anchorBottom).map(function(t){return OA("<bottom>",t)}).toArray()},MA=function(t,n){var e=t.toLowerCase();return rt(n,function(t){var n,o=void 0!==t.meta&&void 0!==t.meta.text?t.meta.text:t.text,r=null!==(n=t.value)&&void 0!==n?n:"";return Wt(o.toLowerCase(),e)||Wt(r.toLowerCase(),e)})},BA=function(t,n,e){var o,r,i=Xd.getValue(n),u=null!==(r=null===(o=null==i?void 0:i.meta)||void 0===o?void 0:o.text)&&void 0!==r?r:i.value;return e.getLinkInformation().fold(function(){return[]},function(n){var o,r=MA(u,function(t){return nt(t,function(t){return OA(t,t)})}(e.getHistory(t)));return"file"===t?(o=[r,MA(u,TA(n)),MA(u,st([DA(n),EA(n),AA(n)]))],ut(o,function(t,n){return 0===t.length||0===n.length?t.concat(n):t.concat(CA,n)},[])):r})},IA=mc("aria-invalid"),FA=function(t,n){t.dom.checked=n},RA=function(t){return t.dom.checked},NA=function(t){return function(n,e,o,r,i){return It(e,"name").fold(function(){return t(e,r,G.none(),i)},function(u){return n.field(u,t(e,r,It(o,u),i))})}},LA={bar:NA(function(t,n){return function(t,n){return{dom:{tag:"div",classes:["tox-bar","tox-form__controls-h-stack"]},components:nt(t.items,n.interpreter)}}(t,n.shared)}),collection:NA(function(t,n,e){return UO(t,n.shared.providers,e)}),alertbanner:NA(function(t,n){return function(t,n){var e=vx(t.icon,n.icons);return CO.sketch({dom:{tag:"div",attributes:{role:"alert"},classes:["tox-notification","tox-notification--in","tox-notification--".concat(t.level)]},components:[{dom:{tag:"div",classes:["tox-notification__icon"],innerHtml:t.url?void 0:e},components:t.url?[Ub.sketch({dom:{tag:"button",classes:["tox-button","tox-button--naked","tox-button--icon"],innerHtml:e,attributes:{title:n.translate(t.iconTooltip)}},action:function(n){return su(n,NO,{name:"alert-banner",value:t.url})},buttonBehaviours:zu([bx()])})]:void 0},{dom:{tag:"div",classes:["tox-notification__body"],innerHtml:n.translate(t.text)}}]})}
2(t,n.shared.providers)}),input:NA(function(t,n,e){return function(t,n,e){return wD({name:t.name,multiline:!1,label:t.label,inputMode:t.inputMode,placeholder:t.placeholder,flex:!1,disabled:!t.enabled,classname:"tox-textfield",validation:G.none(),maximized:t.maximized,data:e,context:t.context},n)}(t,n.shared.providers,e)}),textarea:NA(function(t,n,e){return function(t,n,e){return wD({name:t.name,multiline:!0,label:t.label,inputMode:G.none(),placeholder:t.placeholder,flex:!0,disabled:!t.enabled,classname:"tox-textarea",validation:G.none(),maximized:t.maximized,data:e,context:t.context},n)}(t,n.shared.providers,e)}),label:NA(function(t,n,e,o){return function(t,n,e){var o,r="tox-label",i="center"===t.align?["".concat(r,"--center")]:[],u="end"===t.align?["".concat(r,"--end")]:[],a=jb({dom:{tag:"label",classes:[r].concat(i,u)},components:[Qc(n.providers.translate(t.label))]}),c=nt(t.items,n.interpreter);return{dom:{tag:"div",classes:["tox-form__group"]},components:[a.asSpec()].concat(w(c)),behaviours:zu([iE(),Fh.config({}),(o=G.none(),lE(o,Ra,Na)),Oh.config({mode:"acyclic"}),Rh("label",[Ou(function(n){t.for.each(function(t){e(t).each(function(t){a.getOpt(n).each(function(n){var e,o=null!==(e=Un(t.element,"id"))&&void 0!==e?e:mc("form-field");Hn(t.element,"id",o),Hn(n.element,"for",o)})})})})])])}}(t,n.shared,o)}),iframe:function(t){return function(n,e,o,r,i){var u=Ho(e,{source:"dynamic"});return NA(t)(n,u,o,r,i)}}(function(t,n,e){return WE(t,n.shared.providers,e)}),button:NA(function(t,n){return SA(t,n.shared.providers)}),checkbox:NA(function(t,n,e){return function(t,n,e){var o=function(t){return t.element.dom.click(),G.some(!0)},r=TO.parts.field({factory:{sketch:L},dom:{tag:"input",classes:["tox-checkbox__input"],attributes:{type:"checkbox"}},behaviours:zu([iE(),vg.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){Sn(t.element).each(function(t){return Ku(t,"tox-checkbox--disabled")})},onEnabled:function(t){Sn(t.element).each(function(t){return $u(t,"tox-checkbox--disabled")})}}),Yb.config({}),Hh.config({}),lE(e,RA,FA),Oh.config({mode:"special",onEnter:o,onSpace:o,stopSpaceKeyup:!0}),Rh("checkbox-events",[vu(Ei(),function(n,e){su(n,IO,{name:t.name})})])])}),i=TO.parts.label({dom:{tag:"span",classes:["tox-checkbox__label"]},components:[Qc(n.translate(t.label))],behaviours:zu([t_.config({})])}),u=function(t){return xx("checked"===t?"selected":"unselected",{tag:"span",classes:["tox-icon","tox-checkbox-icon__"+t]},n.icons)},a=jb({dom:{tag:"div",classes:["tox-checkbox__icons"]},components:[u("checked"),u("unchecked")]});return TO.sketch({dom:{tag:"label",classes:["tox-checkbox"]},components:[r,a.asSpec(),i],fieldBehaviours:zu([vg.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable}}),IS(function(){return n.checkUiComponentContext(t.context)})])})}(t,n.shared.providers,e)}),colorinput:NA(function(t,n,e){return r_(t,n.shared,n.colorinput,e)}),colorpicker:NA(function(t,n,e){return mE(0,n.shared.providers,e)}),dropzone:NA(function(t,n,e){return bE(t,n.shared.providers,e)}),grid:NA(function(t,n){return function(t,n){return{dom:{tag:"div",classes:["tox-form__grid","tox-form__grid--".concat(t.columns,"col")]},components:nt(t.items,n.interpreter)}}(t,n.shared)}),listbox:NA(function(t,n,e){return function(t,n,e){var o=Q(t.items,function(t){return!cD(t)}),r=n.shared.providers,i=e.bind(function(n){return fD(t.items,n)}).orThunk(function(){return bt(t.items).filter(cD)}),u=t.label.map(function(t){return BO(t,r)}),a=TO.parts.field({dom:{},factory:{sketch:function(e){return nD(_(_({context:t.context,uid:e.uid,text:i.map(function(t){return t.text}),icon:G.none(),tooltip:G.none(),role:Ht(!o,"combobox")},o?{}:{listRole:"listbox"}),{},{ariaLabel:t.label,fetch:function(e,r){var i=lD(e,t.name,t.items,Xd.getValue(e),o);r(aD(i,Tx.CLOSE_ON_EXECUTE,n,{isHorizontalMenu:!1,search:G.none()}))},onSetup:N(I),getApi:N({}),columns:1,presets:"normal",classes:[],dropdownBehaviours:[Yb.config({}),sE(i.map(function(t){return t.value}),function(t){return Un(t.element,sD)},function(n,e){fD(t.items,e).each(function(t){Hn(n.element,sD,t.value),su(n,ZE,{text:t.text})})})]}),"tox-listbox",n.shared)}}}),c={dom:{tag:"div",classes:["tox-listboxfield"]},components:[a]};return TO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:st([u.toArray(),[c]]),fieldBehaviours:zu([vg.config({disabled:function(){return!t.enabled||r.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){TO.getField(t).each(vg.disable)},onEnabled:function(t){TO.getField(t).each(vg.enable)}})])})}(t,n,e)}),selectbox:NA(function(t,n,e){return function(t,n,e){var o=nt(t.items,function(t){return{text:n.translate(t.text),value:t.value}}),r=t.label.map(function(t){return BO(t,n)}),i=TO.parts.field(_(_({dom:{}},e.map(function(t){return{data:t}}).getOr({})),{},{selectAttributes:{size:t.size}
2,options:o,factory:dD,selectBehaviours:zu([vg.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable}}),Yb.config({}),Rh("selectbox-change",[vu(Ei(),function(n,e){su(n,IO,{name:t.name})})])])})),u=t.size>1?G.none():G.some(xx("chevron-down",{tag:"div",classes:["tox-selectfield__icon-js"]},n.icons)),a={dom:{tag:"div",classes:["tox-selectfield"]},components:st([[i],u.toArray()])};return TO.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:st([r.toArray(),[a]]),fieldBehaviours:zu([vg.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){TO.getField(t).each(vg.disable)},onEnabled:function(t){TO.getField(t).each(vg.enable)}}),IS(function(){return n.checkUiComponentContext(t.context)})])})}(t,n.shared.providers,e)}),sizeinput:NA(function(t,n){return function(t,n){var e=yD,o=mc("ratio-event"),r=function(t){return xx(t,{tag:"span",classes:["tox-icon","tox-lock-icon__"+t]},n.icons)},i=t.label.getOr("Constrain proportions"),u=n.translate(i),a=hD.parts.lock({dom:{tag:"button",classes:["tox-lock","tox-button","tox-button--naked","tox-button--icon"],attributes:{"aria-label":u,"data-mce-name":i}},components:[r("lock"),r("unlock")],buttonBehaviours:zu([vg.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable}}),IS(function(){return n.checkUiComponentContext(t.context)}),Yb.config({}),ry.config(n.tooltips.getConfig({tooltipText:u}))])}),c=function(t){return{dom:{tag:"div",classes:["tox-form__group"]},components:t}},s=function(e){return TO.parts.field({factory:Jx,inputClasses:["tox-textfield"],inputBehaviours:zu([vg.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable}}),IS(function(){return n.checkUiComponentContext(t.context)}),Yb.config({}),Rh("size-input-events",[vu(Ci(),function(t,n){su(t,o,{isField1:e})}),vu(Ei(),function(n,e){su(n,IO,{name:t.name})})])]),selectOnFocus:!1})},l=function(t){return{dom:{tag:"label",classes:["tox-label"]},components:[Qc(n.translate(t))]}},f=hD.parts.field1(c([TO.parts.label(l("Width")),s(!0)])),d=hD.parts.field2(c([TO.parts.label(l("Height")),s(!1)]));return hD.sketch({dom:{tag:"div",classes:["tox-form__group"]},components:[{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:[f,d,c([l(" "),a])]}],field1Name:"width",field2Name:"height",locked:!0,markers:{lockClass:"tox-locked"},onLockedChange:function(t,n,o){vD(Xd.getValue(t)).each(function(t){e(t).each(function(t){Xd.setValue(n,function(t){var n,e={"":0,px:0,pt:1,mm:1,pc:2,ex:2,em:2,ch:2,rem:2,cm:3,in:4,"%":4},o=t.value.toFixed((n=t.unit)in e?e[n]:1);return-1!==o.indexOf(".")&&(o=o.replace(/\.?0*$/,"")),o+t.unit}(t))})})},coupledFieldBehaviours:zu([vg.config({disabled:function(){return!t.enabled||n.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){hD.getField1(t).bind(TO.getField).each(vg.disable),hD.getField2(t).bind(TO.getField).each(vg.disable),hD.getLock(t).each(vg.disable)},onEnabled:function(t){hD.getField1(t).bind(TO.getField).each(vg.enable),hD.getField2(t).bind(TO.getField).each(vg.enable),hD.getLock(t).each(vg.enable)}}),IS(function(){return n.checkUiComponentContext("mode:design")}),Rh("size-input-events2",[vu(o,function(t,n){var o=n.event.isField1,r=o?hD.getField1(t):hD.getField2(t),i=o?hD.getField2(t):hD.getField1(t),u=r.map(Xd.getValue).getOr(""),a=i.map(Xd.getValue).getOr("");e=xD(u,a)})])])})}(t,n.shared.providers)}),slider:NA(function(t,n,e){return function(t,n,e){var o=UT.parts.label({dom:{tag:"label",classes:["tox-label"]},components:[Qc(n.translate(t.label))]}),r=UT.parts.spectrum({dom:{tag:"div",classes:["tox-slider__rail"],attributes:{role:"presentation"}}}),i=UT.parts.thumb({dom:{tag:"div",classes:["tox-slider__handle"],attributes:{role:"presentation"}}});return UT.sketch({dom:{tag:"div",classes:["tox-slider"],attributes:{role:"presentation"}},model:{mode:"x",minX:t.min,maxX:t.max,getInitialValue:N(e.getOrThunk(function(){return(Math.abs(t.max)-Math.abs(t.min))/2}))},components:[o,r,i],sliderBehaviours:zu([iE(),Hh.config({})]),onChoose:function(n,e,o){su(n,IO,{name:t.name,value:o})},onChange:function(n,e,o){su(n,IO,{name:t.name,value:o})}})}
2(t,n.shared.providers,e)}),urlinput:NA(function(t,n,e){return function(t,n,e,o){var r=n.shared.providers,i=function(n){var o=Xd.getValue(n);e.addToHistory(o.value,t.filetype)},u=_(_({},o.map(function(t){return{initialData:t}}).getOr({})),{},{dismissOnBlur:!0,inputClasses:["tox-textfield"],sandboxClasses:["tox-dialog__popups"],inputAttributes:{"aria-errormessage":IA,type:"url"},minChars:0,responseTime:0,fetch:function(o){var r=BA(t.filetype,o,e),i=aD(r,Tx.BUBBLE_TO_SANDBOX,n,{isHorizontalMenu:!1,search:G.none()});return Rk(i)},getHotspot:function(t){return m.getOpt(t)},onSetValue:function(t,n){t.hasConfigured(QO)&&QO.run(t).get(I)},typeaheadBehaviours:zu([].concat(w(e.getValidationHandler().map(function(n){return QO.config({getRoot:function(t){return Sn(t.element)},invalidClass:"tox-control-wrap--status-invalid",notify:{onInvalid:function(t,n){s.getOpt(t).each(function(t){Hn(t.element,"title",r.translate(n))})}},validator:{validate:function(e){var o=Xd.getValue(e);return gA(function(e){n({type:t.filetype,url:o.value},function(t){if("invalid"===t.status){var n=Co.error(t.message);e(n)}else{var o=Co.value(t.message);e(o)}})})},validateOnLoad:!1}})}).toArray()),[vg.config({disabled:function(){return!t.enabled||r.checkUiComponentContext(t.context).shouldDisable}}),Yb.config({}),Rh("urlinput-events",[vu(Ti(),function(n){var e=zc(n.element),o=e.trim();o!==e&&Pc(n.element,o),"file"===t.filetype&&su(n,IO,{name:t.name})}),vu(Ei(),function(n){su(n,IO,{name:t.name}),i(n)}),vu(zi(),function(n){su(n,IO,{name:t.name}),i(n)})])])),eventOrder:T({},Ti(),["streaming","urlinput-events","invalidating"]),model:{getDisplayText:function(t){return t.value},selectsOver:!1,populateFromBrowse:!1},markers:{openClass:"tox-textfield--popup-open"},lazySink:n.shared.getSink,parts:{menu:Gx(0,0,"normal")},onExecute:function(t,n,e){su(n,LO,{})},onItemExecute:function(n,e,o,r){i(n),su(n,IO,{name:t.name})}}),a=TO.parts.field(_(_({},u),{},{factory:fA})),c=t.label.map(function(t){return BO(t,r)}),s=jb(function(t,n){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t;return xx(arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,{tag:"div",classes:["tox-icon","tox-control-wrap__status-icon-"+t],attributes:_({title:r.translate(e),"aria-live":"polite"},n.fold(function(){return{}},function(t){return{id:t}}))},r.icons)}("invalid",G.some(IA),"warning")),l=jb({dom:{tag:"div",classes:["tox-control-wrap__status-icon-wrap"]},components:[s.asSpec()]}),f=e.getUrlPicker(t.filetype),d=mc("browser.url.event"),m=jb({dom:{tag:"div",classes:["tox-control-wrap"]},components:[a,l.asSpec()],behaviours:zu([vg.config({disabled:function(){return!t.enabled||r.checkUiComponentContext(t.context).shouldDisable}})])}),g=jb(yA({context:t.context,name:t.name,icon:G.some("browse"),text:t.picker_text.or(t.label).getOr(""),enabled:t.enabled,primary:!1,buttonType:G.none(),borderless:!0},function(t){return cu(t,d)},r,[],["tox-browse-url"]));return TO.sketch({dom:MO([]),components:c.toArray().concat([{dom:{tag:"div",classes:["tox-form__controls-h-stack"]},components:st([[m.asSpec()],f.map(function(){return g.asSpec()}).toArray()])}]),fieldBehaviours:zu([vg.config({disabled:function(){return!t.enabled||r.checkUiComponentContext(t.context).shouldDisable},onDisabled:function(t){TO.getField(t).each(vg.disable),g.getOpt(t).each(vg.disable)},onEnabled:function(t){TO.getField(t).each(vg.enable),g.getOpt(t).each(vg.enable)}}),IS(function(){return r.checkUiComponentContext(t.context)}),Rh("url-input-events",[vu(d,function(n){og.getCurrent(n).each(function(e){var o=Xd.getValue(e),r=_({fieldname:t.name},o);f.each(function(o){o(r).get(function(o){Xd.setValue(e,o),su(n,IO,{name:t.name})})})})})])])})}(t,n,n.urlinput,e)}),customeditor:NA(function(t){var n=yo(),e=jb({dom:{tag:t.tag}}),o=yo(),r=!pE(t)&&t.onFocus.isSome()?[Hh.config({onFocus:function(n){t.onFocus.each(function(t){t(n.element.dom)})}}),Yb.config({})]:[];return{dom:{tag:"div",classes:["tox-custom-editor"]},behaviours:zu([Rh("custom-editor-events",[Ou(function(r){e.getOpt(r).each(function(e){(pE(t)?t.init(e.element.dom):gE.load(t.scriptId,t.scriptUrl).then(function(n){return n(e.element.dom,t.settings)})).then(function(t){o.on(function(n){t.setValue(n)}),o.clear(),n.set(t)})})})]),sE(G.none(),function(){return n.get().fold(function(){return o.get().getOr("")},function(t){return t.getValue()})},function(t,e){n.get().fold(function(){return o.set(e)},function(t){return t.setValue(e)})}),iE()].concat(r)),components:[e.asSpec()]}}),htmlpanel:NA(function(t,n){return function(t,n){var e=["tox-form__group"].concat(w(t.stretched?["tox-form__group--stretched"]:[])),o=Rh("htmlpanel",[Ou(function(n){t.onInit(n.element.dom)}
2)]);return"presentation"===t.presets?CO.sketch({dom:{tag:"div",classes:e,innerHtml:t.html},containerBehaviours:zu([ry.config(_(_({},n.tooltips.getConfig({tooltipText:"",onShow:function(t){ds(t.element,"[data-mce-tooltip]:hover").orThunk(function(){return rl(t.element)}).each(function(e){Wn(e,"data-mce-tooltip").each(function(e){ry.setComponents(t,n.tooltips.getComponents({tooltipText:e}))})})}})),{},{mode:"children-normal",anchor:function(t){return{type:"node",node:ds(t.element,"[data-mce-tooltip]:hover").orThunk(function(){return rl(t.element).filter(function(t){return Wn(t,"data-mce-tooltip").isSome()})}),root:t.element,layouts:{onLtr:N([Vs,Hs,Ns,zs,Ls,Ps]),onRtl:N([Vs,Hs,Ns,zs,Ls,Ps])},bubble:zl(0,-2,{})}}})),o])}):CO.sketch({dom:{tag:"div",classes:e,innerHtml:t.html,attributes:{role:"document"}},containerBehaviours:zu([Yb.config({}),Hh.config({}),o])})}(t,n.shared.providers)}),imagepreview:NA(function(t,n,e){return jE(t,e)}),table:NA(function(t,n){return function(t,n){var e,o,r=function(t){return{dom:{tag:"th",innerHtml:n.translate(t)}}},i=function(t){return{dom:{tag:"td",innerHtml:n.translate(t)}}},u=function(t){return{dom:{tag:"tr"},components:nt(t,i)}};return{dom:{tag:"table",classes:["tox-dialog__table"]},components:[(o=t.header,{dom:{tag:"thead"},components:[{dom:{tag:"tr"},components:nt(o,r)}]}),(e=t.cells,{dom:{tag:"tbody"},components:nt(e,u)})],behaviours:zu([Yb.config({}),Hh.config({})])}}(t,n.shared.providers)}),tree:NA(function(t,n){return function(t,n){var e=t.onLeafAction.getOr(I),o=t.onToggleExpand.getOr(I),r=t.defaultExpandedIds,i=ho(r),u=ho(t.defaultSelectedId),a=mc("tree-id"),c=function(o,r){return t.items.map(function(t){return"leaf"===t.type?GD({leaf:t,selectedId:o,onLeafAction:e,visible:!0,treeId:a,backstage:n}):$D({directory:t,selectedId:o,onLeafAction:e,expandedIds:r,labelTabstopping:!0,treeId:a,backstage:n})})};return{dom:{tag:"div",classes:["tox-tree"],attributes:{role:"tree"}},components:c(u.get(),i.get()),behaviours:zu([Oh.config({mode:"flow",selector:".tox-tree--leaf__label--visible, .tox-tree--directory__label--visible",cycles:!1}),Rh(QD,[vu("expand-tree-node",function(t,n){var e=n.event,r=e.expanded,u=e.node;i.set(r?[].concat(w(i.get()),[u]):i.get().filter(function(t){return t!==u})),o(i.get(),{expanded:r,node:u})})]),Qs.config({channels:T({},"update-active-item-".concat(a),{onReceive:function(t,n){u.set(G.some(n.value)),Fh.set(t,c(G.some(n.value),i.get()))}})}),Fh.config({})])}}(t,n)}),panel:NA(function(t,n){return function(t,n){return{dom:{tag:"div",classes:t.classes},components:nt(t.items,n.shared.interpreter)}}(t,n)})},zA={field:function(t,n){return n},record:N([])},PA=function(t,n,e,o,r){var i=Ho(o,{shared:{interpreter:function(n){return HA(t,n,e,i,r)}}});return HA(t,n,e,i,r)},HA=function(t,n,e,o,r){return It(LA,n.type).fold(function(){return console.error('Unknown factory type "'.concat(n.type,'", defaulting to container: '),n),n},function(i){return i(t,n,e,o,r)})},VA=function(t,n,e,o){return HA(zA,t,n,e,o)},UA="layout-inset",WA=function(t){return t.x},jA=function(t,n){return t.x+t.width/2-n.width/2},GA=function(t,n){return t.x+t.width-n.width},qA=function(t){return t.y},YA=function(t,n){return t.y+t.height-n.height},XA=function(t,n){return t.y+t.height/2-n.height/2},KA=function(t,n,e){return bs(GA(t,n),YA(t,n),e.insetSouthwest(),Cs(),"southwest",Es(t,{right:0,bottom:3}),UA)},JA=function(t,n,e){return bs(WA(t),YA(t,n),e.insetSoutheast(),Ss(),"southeast",Es(t,{left:1,bottom:3}),UA)},$A=function(t,n,e){return bs(GA(t,n),qA(t),e.insetNorthwest(),ws(),"northwest",Es(t,{right:0,top:2}),UA)},QA=function(t,n,e){return bs(WA(t),qA(t),e.insetNortheast(),xs(),"northeast",Es(t,{left:1,top:2}),UA)},ZA=function(t,n,e){return bs(jA(t,n),qA(t),e.insetNorth(),ks(),"north",Es(t,{top:2}),UA)},tM=function(t,n,e){return bs(jA(t,n),YA(t,n),e.insetSouth(),Os(),"south",Es(t,{bottom:3}),UA)},nM=function(t,n,e){return bs(GA(t,n),XA(t,n),e.insetEast(),Ts(),"east",Es(t,{right:0}),UA)},eM=function(t,n,e){return bs(WA(t),XA(t,n),e.insetWest(),_s(),"west",Es(t,{left:1}),UA)},oM=function(t){switch(t){case"north":return ZA;case"northeast":return QA;case"northwest":return $A;case"south":return tM;case"southeast":return JA;case"southwest":return KA;case"east":return nM;case"west":return eM}},rM=function(t,n,e,o,r){return vl(o).map(oM).getOr(ZA)(t,n,e,o,r)},iM=function(t){switch(t){case"north":return tM;case"northeast":return JA;case"northwest":return KA;case"south":return ZA;case"southeast":return QA;case"southwest":return $A;case"east":return eM;case"west":return nM}},uM=function(t,n,e,o,r){return vl(o).map(iM).getOr(ZA)(t,n,e,o,r)},aM={valignCentre:[],alignCentre:[],alignLeft:[],alignRight:[],right:[],left:[],bottom:[],top:[]},cM=function(t,n,e){var o={maxHeightFunction:Fl()};return function(){return e()?{type:"node",root:Mn(An(t())),node:G.from(t()),bubble:zl(12,12,aM),layouts:{onRtl:function(){return[QA]},onLtr:function(){return[$A]}},overrides:o}:{type:"hotspot",hotspot:n(),bubble:zl(-12,12,aM),layouts:{onRtl:function(){return[Ns,Ls,Vs]},onLtr:function(){return[Ls,Ns,Vs]}},overrides:o}}},sM=function(t,n,e,o){var r={maxHeightFunction:Fl()};return function(){return o()?{type:"node",root:Mn(An(n())),node:G.from(n()),bubble:zl(12,12,aM),layouts:{onRtl:function(){return[ZA]},onLtr:function(){return[ZA]}},overrides:r}:t?{type:"node",root:Mn(An(n())),node:G.from(n()),bubble:zl(0,-ae(n()),aM),layouts:{onRtl:function(){return[Hs]},onLtr:function(){return[Hs]}},overrides:r}:{type:"hotspot",hotspot:e(),bubble:zl(0,0,aM),layouts:{onRtl:function(){return[Hs]},onLtr:function(){return[Hs]}},overrides:r}}},lM=function(t,n,e){return function(){return e()?{type:"node",root:Mn(An(t())),node:G.from(t()),layouts:{onRtl:function(){return[ZA]},onLtr:function(){return[ZA]}}}:{type:"hotspot",hotspot:n(),layouts:{onRtl:function(){return[Vs]},onLtr:function(){return[Vs]}}}}},fM=function(t,n){return function(){return{type:"selection",root:n(),getSelection:function(){var n=t.selection.getRng(),e=t.model.table.getSelectedCells();if(e.length>1){var o=e[0],r=e[e.length-1],i={firstCell:$t.fromDom(o),lastCell:$t.fromDom(r)};return G.some(i)}return G.some(ff.range($t.fromDom(n.startContainer),n.startOffset,$t.fromDom(n.endContainer),n.endOffset))}}}},dM=function(t){return function(n){return{type:"node",root:t(),node:n}}},mM=function(t,n,e,o){var r=Db(t),i=function(){return $t.fromDom(t.getBody())},u=function(){return $t.fromDom(t.getContentAreaContainer())},a=function(){return r||!o()};return{inlineDialog:cM(u,n,a),inlineBottomDialog:sM(t.inline,u,e,a),banner:lM(u,n,a),cursor:fM(t,i),node:dM(i)}},gM=function(t){return function(n,e){ck(t)(n,e)}},pM=function(t){return function(){return YC(t)}},hM=function(t){return function(n){return WC(t,n)}},vM=function(t){return function(n){return qC(t,n)}},bM=function(t){return function(){return sb(t)}},yM=function(t){return Rt(t,"items")},xM=function(t){return Rt(t,"format")},wM=[{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"}
2,{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"}]}],SM=function(t){return ut(t,function(t,n){if(Ft(n,"items")){var e=SM(n.items);return{customFormats:t.customFormats.concat(e.customFormats),formats:t.formats.concat([{title:n.title,items:e.formats}])}}if(function(t){return Ft(t,"inline")}(n)||function(t){return Ft(t,"block")}(n)||function(t){return Ft(t,"selector")}(n)){var o=f(n.name)?n.name:n.title.toLowerCase(),r="custom-".concat(o);return{customFormats:t.customFormats.concat([{name:r,format:n}]),formats:t.formats.concat([{title:n.title,format:r,icon:n.icon}])}}return _(_({},t),{},{formats:t.formats.concat(n)})},{customFormats:[],formats:[]})},CM=function(t){return Uv(t).map(function(n){var e=function(t,n){var e=SM(n),o=function(n){et(n,function(n){t.formatter.has(n.name)||t.formatter.register(n.name,n.format)})};return t.formatter?o(e.customFormats):t.on("init",function(){o(e.customFormats)}),e.formats}(t,n);return Wv(t)?wM.concat(e):e}).getOr(wM)},kM=function(t,n,e){return _(_({},t),{},{type:"formatter",isSelected:n(t.format),getStylePreview:e(t.format)})},OM=function(t,n,e,o){var r=function(t){var n=i(t.items);return _(_({},t),{},{type:"submenu",getStyleItems:N(n)})},i=function(n){return nt(n,function(n){return yM(n)?r(n):xM(n)?function(t){return kM(t,e,o)}(n):1===(i=St(n)).length&&$(i,"title")?_(_({},n),{},{type:"separator"}):function(n){var r=f(n.name)?n.name:mc(n.title),i="custom-".concat(r),u=_(_({},n),{},{type:"formatter",format:i,isSelected:e(i),getStylePreview:o(i)});return t.formatter.register(r,u),u}(n);var i})};return i(n)},_M=function(t){var n=0,e=function(t){return[{dom:{tag:"div",classes:["tox-tooltip__body"]},components:[Qc(t.tooltipText)]}]};return{getConfig:function(o){return{delayForShow:function(){return n>0?60:300},delayForHide:N(300),exclusive:!0,lazySink:t,tooltipDom:{tag:"div",classes:["tox-tooltip","tox-tooltip--up"]}
2,tooltipComponents:e(o),onShow:function(t,e){n++,o.onShow&&o.onShow(t,e)},onHide:function(t,e){n--,o.onHide&&o.onHide(t,e)},onSetup:o.onSetup}},getComponents:e}},TM=hE.trim,EM=function(t){return function(n){if(function(t){return O(t)&&1===t.nodeType}(n)){if(n.contentEditable===t)return!0;if(n.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},DM=EM("true"),AM=EM("false"),MM=function(t,n,e,o,r){return{type:t,title:n,url:e,level:o,attach:r}},BM=function(t){return t.innerText||t.textContent},IM=function(t){return function(t){return t&&"A"===t.nodeName&&void 0!==(t.id||t.name)}(t)&&RM(t)},FM=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},RM=function(t){return function(t){for(var n=t;n=n.parentNode;){var e=n.contentEditable;if(e&&"inherit"!==e)return DM(n)}return!1}(t)&&!AM(t)},NM=function(t){return FM(t)&&RM(t)},LM=function(t){var n,e=function(t){return t.id?t.id:mc("h")}(t);return MM("header",null!==(n=BM(t))&&void 0!==n?n:"","#"+e,function(t){return FM(t)?parseInt(t.nodeName.substr(1),10):0}(t),function(){t.id=e})},zM=function(t){var n=t.id||t.name,e=BM(t);return MM("anchor",e||"#"+n,"#"+n,0,I)},PM=function(t){var n,e,o=(n="h1,h2,h3,h4,h5,h6,a:not([href])",e=t,nt(wf($t.fromDom(e),n),function(t){return t.dom}));return o},HM=function(t){return TM(t.title).length>0},VM=function(t){var n=PM(t);return rt(function(t){return nt(rt(t,NM),LM)}(n).concat(function(t){return nt(rt(t,IM),zM)}(n)),HM)},UM="tinymce-url-history",WM=function(t){return f(t)&&/^https?/.test(t)},jM=function(t){return d(t)&&Mt(t,function(t){return!(g(n=t)&&n.length<=5&&ft(n,WM));var n}).isNone()},GM=function(){var t,n=DC.getItem(UM);if(null===n)return{};try{t=JSON.parse(n)}catch(t){if(t instanceof SyntaxError)return console.log("Local storage "+UM+" was not valid JSON",t),{};throw t}return jM(t)?t:(console.log("Local storage "+UM+" was not valid format",t),{})},qM=function(t){var n=GM();return It(n,t).getOr([])},YM=function(t,n){if(WM(t)){var e=GM(),o=It(e,n).getOr([]),r=rt(o,function(n){return n!==t});e[n]=[t].concat(r).slice(0,5),function(t){if(!jM(t))throw new Error("Bad format for history:\n"+JSON.stringify(t));DC.setItem(UM,JSON.stringify(t))}(e)}},XM=function(t){return!!t},KM=function(t){return Ot(hE.makeMap(t,/[, ]/),XM)},JM=function(t){return G.from(eb(t))},$M=function(t,n){var e=function(t){var n=G.from(ib(t)).filter(XM).map(KM);return JM(t).fold(W,function(t){return n.fold(j,function(t){return St(t).length>0&&t})})}(t);return y(e)?e?JM(t):G.none():e[n]?JM(t):G.none()},QM=function(t){return G.from(t).filter(f).getOrUndefined()},ZM=function(t){return{getHistory:qM,addToHistory:YM,getLinkInformation:function(){return function(t){return ub(t)?G.some({targets:VM(t.getBody()),anchorTop:QM(ab(t)),anchorBottom:QM(cb(t))}):G.none()}(t)},getValidationHandler:function(){return function(t){return G.from(ob(t))}(t)},getUrlPicker:function(n){return function(t,n){return $M(t,n).map(function(e){return function(o){return Fk(function(r){var i=_({filetype:n,fieldname:o.fieldname},G.from(o.meta).getOr({}));e.call(t,function(t,n){if(!f(t))throw new Error("Expected value to be string");if(void 0!==n&&!d(n))throw new Error("Expected meta to be a object");r({value:t,meta:n})},o.value,i)})}})}(t,n)}}},tB=function(t,n,e,o){var r=ho(!1),i=function(t){var n=ho(Tb(t)?"bottom":"top");return{isPositionedAtTop:function(){return"top"===n.get()},getDockingMode:n.get,setDockingMode:n.set}}(n),u={icons:function(){return n.ui.registry.getAll().icons},menuItems:function(){return n.ui.registry.getAll().menuItems},translate:fx.translate,isDisabled:function(){return!n.ui.isEnabled()},getOption:n.options.get,tooltips:_M(t.dialog),checkUiComponentContext:function(t){var e=h(t.split(":"),2),o=e[0],r=e[1],i=void 0===r?"":r,u=n.ui.registry.getAll().contexts;return{contextType:o,shouldDisable:!It(u,o).fold(function(){return It(u,"mode").map(function(t){return t("design")}).getOr(!1)},function(t){return"!"===i.charAt(0)?!t(i.slice(1)):t(i)})}}},a=ZM(n),c=function(t){var n=function(n){return function(){return t.formatter.match(n)}},e=function(n){return function(){var e=t.formatter.get(n);return void 0!==e?G.some({tag:e.length>0&&(e[0].inline||e[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(n))}):G.none()}},o=ho([]),r=ho([]),i=ho(!1);return t.on("PreInit",function(r){var i=CM(t),u=OM(t,i,n,e);o.set(u)}),t.on("addStyleModifications",function(o){var u=OM(t,o.items,n,e);r.set(u),i.set(o.replace)}),{getData:function(){var t=i.get()?[]:o.get(),n=r.get();return t.concat(n)}}}(n),s=function(t){return{colorPicker:gM(t),hasCustomColors:pM(t),getColors:hM(t),getColorCols:vM(t)}}(n),l=function(t){return{isDraggableModal:bM(t)}}(n),f={shared:{providers:u,anchors:mM(n,e,o,i.isPositionedAtTop),header:i},urlinput:a,styles:c,colorinput:s,dialog:l,isContextMenuOpen:function(){return r.get()},setContextMenuState:function(t){return r.set(t)}},d=function(t){return G.none()},m=_(_({},f),{},{shared:_(_({},f.shared),{},{interpreter:function(t){return VA(t,{},m,d)},getSink:t.popup})}),g=_(_({},f),{},{shared:_(_({},f.shared),{},{interpreter:function(t){return VA(t,{},g,d)},getSink:t.dialog})});return{popup:m,dialog:g}},nB=qm,eB=Dm,oB=N([Gr("shell",!1),Dr("makeItem"),Gr("setupItem",I),Qd("listBehaviours",[Fh])]),rB=_m({name:"items",overrides:function(){return{behaviours:zu([Fh.config({})])}}}),iB=N([rB]),uB=Zm({name:N("CustomList")(),configFields:oB(),partFields:iB(),factory:function(t,n,e,o){var r=t.shell?{behaviours:[Fh.config({})],components:[]}:{behaviours:[],components:n},i=function(n){return t.shell?G.some(n):zm(n,t,"items")};return{uid:t.uid,dom:t.dom,components:r.components,behaviours:$d(t.listBehaviours,r.behaviours),apis:{setItems:function(n,e){i(n).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(o){var r=Fh.contents(o),i=e.length,u=i-r.length,a=u>0?Z(u,function(){return t.makeItem()}):[],c=r.slice(i);et(c,function(t){return Fh.remove(o,t)}
2),et(a,function(t){return Fh.append(o,t)});var s=Fh.contents(o);et(s,function(o,r){t.setupItem(n,o,e[r],r)})})}}}},apis:{setItems:function(t,n,e){t.setItems(n,e)}}}),aB=N([Dr("dom"),Gr("shell",!0),Kd("toolbarBehaviours",[Fh])]),cB=N([_m({name:"groups",overrides:function(){return{behaviours:zu([Fh.config({})])}}})]),sB=Zm({name:"Toolbar",configFields:aB(),partFields:cB(),factory:function(t,n,e,o){var r=function(n){return t.shell?G.some(n):zm(n,t,"groups")},i=t.shell?{behaviours:[Fh.config({})],components:[]}:{behaviours:[],components:n};return{uid:t.uid,dom:t.dom,components:i.components,behaviours:$d(t.toolbarBehaviours,i.behaviours),apis:{setGroups:function(t,n){r(t).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){Fh.set(t,n)})},refresh:I},domModification:{attributes:{role:"group"}}}},apis:{setGroups:function(t,n,e){t.setGroups(n,e)}}}),lB=I,fB=W,dB=N([]),mB=Object.freeze({__proto__:null,setup:lB,isDocked:fB,getBehaviours:dB}),gB=N(mc("toolbar-height-change")),pB={fadeInClass:"tox-editor-dock-fadein",fadeOutClass:"tox-editor-dock-fadeout",transitionClass:"tox-editor-dock-transition"},hB="tox-tinymce--toolbar-sticky-on",vB="tox-tinymce--toolbar-sticky-off",bB=function(t,n){return $(ac.getModes(t),n)},yB=function(t){var n=t.element;Sn(n).each(function(e){var o="padding-"+ac.getModes(t)[0];if(ac.isDocked(t)){var r=ge(e);Xn(n,"width",r+"px"),Xn(e,o,function(t){return ae(t)+(parseInt($n(t,"margin-top"),10)||0)+(parseInt($n(t,"margin-bottom"),10)||0)}(n)+"px")}else ee(n,"width"),ee(e,o)})},xB=function(t,n){n?($u(t,pB.fadeOutClass),ta(t,[pB.transitionClass,pB.fadeInClass])):($u(t,pB.fadeInClass),ta(t,[pB.fadeOutClass,pB.transitionClass]))},wB=function(t,n){var e=$t.fromDom(t.getContainer());n?(Ku(e,hB),$u(e,vB)):(Ku(e,vB),$u(e,hB))},SB=function(t,n){var e=yo(),o=n.getSink,r=function(t){o().each(function(n){return t(n.element)})},i=function(n){t.inline||yB(n),wB(t,ac.isDocked(n)),n.getSystem().broadcastOn([Ad()],{}),o().each(function(t){return t.getSystem().broadcastOn([Ad()],{})})},u=t.inline?[]:[Qs.config({channels:T({},gB(),{onReceive:yB})})];return[Hh.config({}),ac.config({contextual:_({lazyContext:function(n){var e=ae(n.element),o=t.inline?t.getContentAreaContainer():t.getContainer();return G.from(o).map(function(o){var r=fo($t.fromDom(o));return Hb(t,n.element).fold(function(){var t=r.height-e,o=r.y+(bB(n,"top")?0:e);return lo(r.x,o,r.width,t)},function(t){var o=go(r,Vb(t)),i=bB(n,"top")?o.y:o.y+e;return lo(o.x,i,o.width,o.height-e)})})},onShow:function(){r(function(t){return xB(t,!0)})},onShown:function(t){r(function(t){return na(t,[pB.transitionClass,pB.fadeInClass])}),e.get().each(function(n){var o,r,i;o=t.element,i=vn(r=n),ol(i).filter(function(t){return!pn(r,t)}).filter(function(t){return pn(t,$t.fromDom(i.dom.body))||hn(o,t)}).each(function(){return tl(r)}),e.clear()})},onHide:function(t){(function(t,n){return rl(t).orThunk(function(){return n().toOptional().bind(function(t){return rl(t.element)})})})(t.element,o).fold(e.clear,e.set),r(function(t){return xB(t,!1)})},onHidden:function(){r(function(t){return na(t,[pB.transitionClass])})}},pB),lazyViewport:function(n){return Hb(t,n.element).fold(function(){var e=po(),o=Zv(t),r=e.y+(bB(n,"top")&&!Pb(t)?o:0),i=e.height-(bB(n,"bottom")?o:0);return{bounds:lo(e.x,r,e.width,i),optScrollEnv:G.none()}},function(t){return{bounds:Vb(t),optScrollEnv:G.some({currentScrollTop:t.element.dom.scrollTop,scrollElmTop:fe(t.element).top})}})},modes:[n.header.getDockingMode()],onDocked:i,onUndocked:i})].concat(w(u))},CB=Object.freeze({__proto__:null,setup:function(t,n,e){t.inline||(n.header.isPositionedAtTop()||t.on("ResizeEditor",function(){e().each(ac.reset)}),t.on("ResizeWindow ResizeEditor",function(){e().each(yB)}),t.on("SkinLoaded",function(){e().each(function(t){ac.isDocked(t)?ac.reset(t):ac.refresh(t)})}),t.on("FullscreenStateChanged",function(){e().each(ac.reset)})),t.on("AfterScrollIntoView",function(t){e().each(function(n){ac.refresh(n);var e=n.element;
2bp(e)&&function(t,n){var e=vn(n),o=xn(n).dom.innerHeight,r=eo(e),i=$t.fromDom(t.elm),u=mo(i),a=ue(i),c=u.y,s=c+a,l=fe(n),f=ue(n),d=l.top,m=d+f,g=Math.abs(d-r.top)<2,p=Math.abs(m-(r.top+o))<2;if(g&&c<m)oo(r.left,c-f,e);else if(p&&s>d){var h=c-o+a+f;oo(r.left,h,e)}}(t,e)})}),t.on("PostRender",function(){wB(t,!1)})},isDocked:function(t){return t().map(ac.isDocked).getOr(!1)},getBehaviours:SB}),kB=or([mw,Ar("items",ir([ar([gw,Nr("items",fr)]),fr]))].concat(jw)),OB=[Hr("text"),Hr("tooltip"),Hr("icon"),qr("search",!1,ir([dr,or([Hr("placeholder")])],function(t){return y(t)?t?G.some({placeholder:G.none()}):G.none():G.some(t)})),Ir("fetch"),$r("onSetup",function(){return I}),Xr("context","mode:design")],_B=or([mw].concat(OB)),TB=function(t){return xr("menubutton",_B,t)},EB=or([mw,Dw,Ew,_w,Bw,xw,kw,Kr("presets","normal",["normal","color","listpreview"]),Lw(1),Sw,Cw,Xr("context","mode:design")]),DB=Qm({factory:function(t,n){var e={focus:Oh.focusIn,setMenus:function(t,e){var o=nt(e,function(t){var e={type:"menubutton",text:t.text,fetch:function(n){n(t.getItems())},context:"any"},o=TB(e).mapError(function(t){return Cr(t)}).getOrDie();return HD(o,"tox-mbtn",n.backstage,G.some("menuitem"))});Fh.set(t,o)}};return{uid:t.uid,dom:t.dom,components:[],behaviours:zu([Fh.config({}),Rh("menubar-events",[Ou(function(n){t.onSetup(n)}),vu(Si(),function(t,n){ds(t.element,".tox-mbtn--active").each(function(e){ms(n.event.target,".tox-mbtn").each(function(n){pn(e,n)||t.getSystem().getByDom(e).each(function(e){t.getSystem().getByDom(n).each(function(t){Jk.expand(t),Jk.close(e),Hh.focus(t)})})})})}),vu(nu(),function(t,n){n.event.prevFocus.bind(function(n){return t.getSystem().getByDom(n).toOptional()}).each(function(e){n.event.newFocus.bind(function(n){return t.getSystem().getByDom(n).toOptional()}).each(function(t){Jk.isOpen(e)&&(Jk.expand(t),Jk.close(e))})})})]),Oh.config({mode:"flow",selector:".tox-mbtn",onEscape:function(n){return t.onEscape(n),G.some(!0)}}),Yb.config({})]),apis:e,domModification:{attributes:{role:"menubar"}}}},name:"silver.Menubar",configFields:[Dr("dom"),Dr("uid"),Dr("onEscape"),Dr("backstage"),Gr("onSetup",I)],apis:{focus:function(t,n){t.focus(n)},setMenus:function(t,n,e){t.setMenus(n,e)}}}),AB="container",MB=[Kd("slotBehaviours",[])],BB=function(t){return"<alloy.field."+t+">"},IB=function(t,n){var e=function(n){return Um(t)},o=function(n,e){return function(o,r){return zm(o,t,r).map(function(t){return n(t,r)}).getOr(e)}},r=function(t,n){return"true"!==Un(t.element,"aria-hidden")},i=o(r,!1),u=o(function(t,n){if(r(t)){var e=t.element;Xn(e,"display","none"),Hn(e,"aria-hidden","true"),su(t,eu(),{name:n,visible:!1})}}),a=function(t){return function(n,e){et(e,function(e){return t(n,e)})}}(u),c=o(function(t,n){if(!r(t)){var e=t.element;ee(e,"display"),Gn(e,"aria-hidden"),su(t,eu(),{name:n,visible:!0})}}),s={getSlotNames:e,getSlot:function(n,e){return zm(n,t,e)},isShowing:i,hideSlot:u,hideAllSlots:function(t){return a(t,e())},showSlot:c};return{uid:t.uid,dom:t.dom,components:n,behaviours:Jd(t.slotBehaviours),apis:s}},FB=Ot({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)}},function(t){return Tc(t)}),RB=_(_({},FB),{sketch:function(t){var n=function(){var t=[];return{slot:function(n,e){return t.push(n),Im(AB,BB(n),e)},record:N(t)}}(),e=t(n),o=n.record(),r=nt(o,function(t){return km({name:t,pname:BB(t)})});return Xm(AB,MB,r,IB,e)}}),NB=or([Ew,Dw,$r("onShow",I),$r("onHide",I),kw]),LB=function(t){return{element:function(){return t.element.dom}}},zB=function(t,n){var e=nt(St(n),function(t){var e=n[t],o=wr(function(t){return xr("sidebar",NB,t)}(e));return{name:t,getApi:LB,onSetup:o.onSetup,onShow:o.onShow,onHide:o.onHide}});return nt(e,function(n){var o=ho(I);return t.slot(n.name,{dom:{tag:"div",classes:["tox-sidebar__pane"]},behaviours:SS([ES(n,o),DS(n,o),vu(eu(),function(t,n){var o=n.event,r=at(e,function(t){return t.name===o.name});r.each(function(n){(o.visible?n.onShow:n.onHide)(n.getApi(t))})})])})})},PB=function(t){return RB.sketch(function(n){return{dom:{tag:"div",classes:["tox-sidebar__pane-container"]},components:zB(n,t),slotBehaviours:SS([Ou(function(t){return RB.hideAllSlots(t)})])}})},HB=function(t,n){Hn(t,"role",n)},VB=function(t){return og.getCurrent(t).bind(function(t){return zD.isGrowing(t)||zD.hasGrown(t)?og.getCurrent(t).bind(function(t){return at(RB.getSlotNames(t),function(n){return RB.isShowing(t,n)})}):G.none()})},UB=mc("FixSizeEvent"),WB=mc("AutoSizeEvent"),jB=Object.freeze({__proto__:null,block:function(t,n,e,o){Hn(t.element,"aria-busy",!0);var r=n.getRoot(t).getOr(t),i=zu([Oh.config({mode:"special",onTab:function(){return G.some(!0)},onShiftTab:function(){return G.some(!0)}}),Hh.config({})]),u=o(r,i),a=r.getSystem().build(u);Fh.append(r,os(a)),a.hasConfigured(Oh)&&n.focus&&Oh.focusIn(a),e.isBlocked()||n.onBlock(t),e.blockWith(function(){return Fh.remove(r,a)})},unblock:function(t,n,e){Gn(t.element,"aria-busy"),e.isBlocked()&&n.onUnblock(t),e.clear()},isBlocked:function(t,n,e){return e.isBlocked()}}),GB=[$r("getRoot",G.none),Jr("focus",!0),Za("onBlock"),Za("onUnblock")],qB=Hu({fields:GB,name:"blocking",apis:jB,state:Object.freeze({__proto__:null,init:function(){var t=vo(function(t){return t.destroy()});return Lu({readState:t.isSet,blockWith:function(n){t.set({destroy:n})},clear:t.clear,isBlocked:t.isSet})}})}),YB=function(t){return og.getCurrent(t).each(function(t){return tl(t.element,!0)})},XB=function(t,n,e,o){var r=n.element;if(function(t,n){var e="tabindex",o="data-mce-".concat(e);G.from(t.iframeElement).map($t.fromDom).each(function(t){n?(Wn(t,e).each(function(n){return Hn(t,o,n)}),Hn(t,e,-1)):(Gn(t,e),Wn(t,o).each(function(n){Hn(t,e,n),Gn(t,o)}))})}(t,e),e)qB.block(n,function(t){return function(n,e){return{dom:{tag:"div",attributes:{"aria-label":t.translate("Loading..."),tabindex:"0"},classes:["tox-throbber__busy-spinner"]},components:[{dom:Wb('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}}}(o)),ee(r,"display"),Gn(r,"aria-hidden"),t.hasFocus()&&YB(n);else{var i=og.getCurrent(n).exists(function(t){return el(t.element)});qB.unblock(n),Xn(r,"display","none"),Hn(r,"aria-hidden","true"),i&&t.focu
2s()}},KB=function(t,n,e){var o=ho(!1),r=yo(),i=function(e){var r;!o.get()||function(t){return"focusin"===t.type}(r=e)&&(r.composed?bt(r.composedPath()):G.from(r.target)).map($t.fromDom).filter(an).exists(function(t){return Zu(t,"mce-pastebin")})||(e.preventDefault(),YB(n()),t.editorManager.setActive(t))};t.inline||t.on("PreInit",function(){t.dom.bind(t.getWin(),"focusin",i),t.on("BeforeExecCommand",function(t){"mcefocus"===t.command.toLowerCase()&&!0!==t.value&&i(t)})});var u=function(r){r!==o.get()&&(o.set(r),XB(t,n(),r,e.providers),function(t,n){t.dispatch("AfterProgressState",{state:n})}(t,r))};t.on("ProgressState",function(n){if(r.on(clearTimeout),M(n.time)){var e=Ev.setEditorTimeout(t,function(){return u(n.state)},n.time);r.set(e)}else u(n.state),r.clear()})},JB=function(t,n,e){return{within:t,extra:n,withinWidth:e}},$B=function(t,n,e){var o=function(t,n){var e=ut(t,function(t,e){return n(e,t.len).fold(N(t),function(n){return{len:n.finish,list:t.list.concat([n])}})},{len:0,list:[]});return e.list}(t,function(t,n){var o=e(t);return G.some({element:t,start:n,finish:n+o,width:o})}),r=rt(o,function(t){return t.finish<=n}),i=it(r,function(t,n){return t+n.width},0);return{within:r,extra:o.slice(r.length),withinWidth:i}},QB=function(t){return nt(t,function(t){return t.element})},ZB=function(t,n,e,o){var r=function(t,n,e){var o=$B(n,t,e);return 0===o.extra.length?G.some(o):G.none()}(t,n,e).getOrThunk(function(){return $B(n,t-e(o),e)}),i=r.within,u=r.extra,a=r.withinWidth;return 1===u.length&&u[0].width<=e(o)?function(t,n,e){var o=QB(t.concat(n));return JB(o,[],e)}(i,u,a):u.length>=1?function(t,n,e,o){var r=QB(t).concat([e]);return JB(r,QB(n),o)}(i,u,o,a):function(t,n,e){return JB(QB(t),[],e)}(i,0,a)},tI=function(t,n){var e=nt(n,function(t){return os(t)});sB.setGroups(t,e)},nI=function(t,n,e){var o=n.builtGroups.get();if(0!==o.length){var r=Pm(t,n,"primary"),i=Dk.getCoupled(t,"overflowGroup");Xn(r.element,"visibility","hidden");var u=o.concat([i]),a=wt(u,function(t){return rl(t.element).bind(function(n){return t.getSystem().getByDom(n).toOptional()})});e([]),tI(r,u);var c=ge(r.element),s=ZB(c,n.builtGroups.get(),function(t){return Math.ceil(t.element.dom.getBoundingClientRect().width)},i);0===s.extra.length?(Fh.remove(r,i),e([])):(tI(r,s.within),e(s.extra)),ee(r.element,"visibility"),oe(r.element),a.each(Hh.focus)}},eI=N([Kd("splitToolbarBehaviours",[Dk]),Tr("builtGroups",function(){return ho([])})]),oI=N([$a(["overflowToggledClass"]),Ur("getOverflowBounds"),Dr("lazySink"),Tr("overflowGroups",function(){return ho([])}),Za("onOpened"),Za("onClosed")].concat(eI())),rI=N([km({factory:sB,schema:aB(),name:"primary"}),Om({schema:aB(),name:"overflow"}),Om({name:"overflow-button"}),Om({name:"overflow-group"})]),iI=N(function(t,n){!function(t,n){var e=me.max(t,n,["margin-left","border-left-width","padding-left","padding-right","border-right-width","margin-right"]);Xn(t,"max-width",e+"px")}(t,Math.floor(n))}),uI=N([$a(["toggledClass"]),Dr("lazySink"),Ir("fetch"),Ur("getBounds"),jr("fireDismissalEventInstead",[Gr("event",Zi())]),Gl(),Za("onToggled")]),aI=N([Om({name:"button",overrides:function(t){return{dom:{attributes:{"aria-haspopup":"true"}},buttonBehaviours:zu([Xh.config({toggleClass:t.markers.toggledClass,aria:{mode:"expanded"},toggleOnExecute:!1,onToggled:t.onToggled})])}}}),Om({factory:sB,schema:aB(),name:"toolbar",overrides:function(t){return{toolbarBehaviours:zu([Oh.config({mode:"cyclic",onEscape:function(n){return zm(n,t,"button").each(Hh.focus),G.none()}})])}}})]),cI=yo(),sI=function(t,n){var e=Dk.getCoupled(t,"toolbarSandbox");Ed.isOpen(e)?Ed.close(e):Ed.open(e,n.toolbar())},lI=function(t,n,e,o){var r=e.getBounds.map(function(t){return t()}),i=e.lazySink(t).getOrDie();nd.positionWithinBounds(i,n,{anchor:{type:"hotspot",hotspot:t,layouts:o,overrides:{maxWidthFunction:iI()}}},r)},fI=function(t,n,e,o,r){sB.setGroups(n,r),lI(t,n,e,o),Xh.on(t)},dI=Zm({name:"FloatingToolbarButton",factory:function(t,n,e,o){return _(_({},Ub.sketch(_(_({},o.button()),{},{action:function(t){sI(t,o)},buttonBehaviours:Zd({dump:o.button().buttonBehaviours},[Dk.config({others:{toolbarSandbox:function(n){return function(t,n,e){var o=ps();return{dom:{tag:"div",attributes:{id:o.id}},behaviours:zu([Oh.config({mode:"special",onEscape:function(t){return Ed.close(t),G.some(!0)}}),Ed.config({onOpen:function(r,i){var u=cI.get().getOr(!1);e.fetch().get(function(r){fI(t,i,e,n.layouts,r),o.link(t.element),u||Oh.focusIn(i)})},onClose:function(){Xh.off(t),cI.get().getOr(!1)||Hh.focus(t),o.unlink(t.element)},isPartOf:function(n,e,o){return vs(e,o)||vs(t,o)},getAttachPoint:function(){return e.lazySink(t).getOrDie()}}),Qs.config({channels:_(_({},Id(_({isExtraPart:W},e.fireDismissalEventInstead.map(function(t){return{fireEventInstead:{event:t.event}}}).getOr({})))),Rd({doReposition:function(){Ed.getState(Dk.getCoupled(t,"toolbarSandbox")).each(function(o){lI(t,o,e,n.layouts)})}}))})])}}(n,e,t)}}})])}))),{}
2,{apis:{setGroups:function(n,o){Ed.getState(Dk.getCoupled(n,"toolbarSandbox")).each(function(r){fI(n,r,t,e.layouts,o)})},reposition:function(n){Ed.getState(Dk.getCoupled(n,"toolbarSandbox")).each(function(o){lI(n,o,t,e.layouts)})},toggle:function(t){sI(t,o)},toggleWithoutFocusing:function(t){!function(t,n){cI.set(!0),sI(t,n),cI.clear()}(t,o)},getToolbar:function(t){return Ed.getState(Dk.getCoupled(t,"toolbarSandbox"))},isOpen:function(t){return Ed.isOpen(Dk.getCoupled(t,"toolbarSandbox"))}}})},configFields:uI(),partFields:aI(),apis:{setGroups:function(t,n,e){t.setGroups(n,e)},reposition:function(t,n){t.reposition(n)},toggle:function(t,n){t.toggle(n)},toggleWithoutFocusing:function(t,n){t.toggleWithoutFocusing(n)},getToolbar:function(t,n){return t.getToolbar(n)},isOpen:function(t,n){return t.isOpen(n)}}}),mI=N([Dr("items"),$a(["itemSelector"]),Kd("tgroupBehaviours",[Oh])]),gI=N([Tm({name:"items",unit:"item"})]),pI=Zm({name:"ToolbarGroup",configFields:mI(),partFields:gI(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,behaviours:$d(t.tgroupBehaviours,[Oh.config({mode:"flow",selector:t.markers.itemSelector})]),domModification:{attributes:{role:"toolbar"}}}}}),hI=function(t){return nt(t,function(t){return os(t)})},vI=function(t,n,e){nI(t,e,function(o){e.overflowGroups.set(o),n.getOpt(t).each(function(t){dI.setGroups(t,hI(o))})})},bI=Zm({name:"SplitFloatingToolbar",configFields:oI(),partFields:rI(),factory:function(t,n,e,o){var r=jb(dI.sketch({fetch:function(){return Fk(function(n){n(hI(t.overflowGroups.get()))})},layouts:{onLtr:function(){return[Ls,Ns]},onRtl:function(){return[Ns,Ls]},onBottomLtr:function(){return[Ps,zs]},onBottomRtl:function(){return[zs,Ps]}},getBounds:e.getOverflowBounds,lazySink:t.lazySink,fireDismissalEventInstead:{},markers:{toggledClass:t.markers.overflowToggledClass},parts:{button:o["overflow-button"](),toolbar:o.overflow()},onToggled:function(n,e){return t[e?"onOpened":"onClosed"](n)}}));return{uid:t.uid,dom:t.dom,components:n,behaviours:$d(t.splitToolbarBehaviours,[Dk.config({others:{overflowGroup:function(){return pI.sketch(_(_({},o["overflow-group"]()),{},{items:[r.asSpec()]}))}}})]),apis:{setGroups:function(n,e){t.builtGroups.set(nt(e,n.getSystem().build)),vI(n,r,t)},refresh:function(n){return vI(n,r,t)},toggle:function(t){r.getOpt(t).each(function(t){dI.toggle(t)})},toggleWithoutFocusing:function(t){r.getOpt(t).each(dI.toggleWithoutFocusing)},isOpen:function(t){return r.getOpt(t).map(dI.isOpen).getOr(!1)},reposition:function(t){r.getOpt(t).each(function(t){dI.reposition(t)})},getOverflow:function(t){return r.getOpt(t).bind(dI.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)},toggleWithoutFocusing:function(t,n){t.toggle(n)},isOpen:function(t,n){return t.isOpen(n)},getOverflow:function(t,n){return t.getOverflow(n)}}}),yI=N([$a(["closedClass","openClass","shrinkingClass","growingClass","overflowToggledClass"]),Za("onOpened"),Za("onClosed")].concat(eI())),xI=N([km({factory:sB,schema:aB(),name:"primary"}),km({factory:sB,schema:aB(),name:"overflow",overrides:function(t){return{toolbarBehaviours:zu([zD.config({dimension:{property:"height"},closedClass:t.markers.closedClass,openClass:t.markers.openClass,shrinkingClass:t.markers.shrinkingClass,growingClass:t.markers.growingClass,onShrunk:function(n){zm(n,t,"overflow-button").each(function(t){Xh.off(t)}),t.onClosed(n)},onGrown:function(n){t.onOpened(n)},onStartGrow:function(n){zm(n,t,"overflow-button").each(Xh.on)}}),Oh.config({mode:"acyclic",onEscape:function(n){return zm(n,t,"overflow-button").each(Hh.focus),G.some(!0)}})])}}}),Om({name:"overflow-button",overrides:function(t){return{buttonBehaviours:zu([Xh.config({toggleClass:t.markers.overflowToggledClass,aria:{mode:"expanded"},toggleOnExecute:!1})])}}}),Om({name:"overflow-group"})]),wI=function(t,n,e){zm(t,n,"overflow-button").each(function(o){zm(t,n,"overflow").each(function(r){if(SI(t,n),zD.hasShrunk(r)){var i=n.onOpened;n.onOpened=function(t){e||Oh.focusIn(r),i(t),n.onOpened=i}}else{var u=n.onClosed;
2n.onClosed=function(t){e||Hh.focus(o),u(t),n.onClosed=u}}zD.toggleGrow(r)})})},SI=function(t,n){zm(t,n,"overflow").each(function(e){nI(t,n,function(t){var n=nt(t,function(t){return os(t)});sB.setGroups(e,n)}),zm(t,n,"overflow-button").each(function(t){zD.hasGrown(e)&&Xh.on(t)}),zD.refresh(e)})},CI=Zm({name:"SplitSlidingToolbar",configFields:yI(),partFields:xI(),factory:function(t,n,e,o){var r="alloy.toolbar.toggle";return{uid:t.uid,dom:t.dom,components:n,behaviours:$d(t.splitToolbarBehaviours,[Dk.config({others:{overflowGroup:function(t){return pI.sketch(_(_({},o["overflow-group"]()),{},{items:[Ub.sketch(_(_({},o["overflow-button"]()),{},{action:function(n){cu(t,r)}}))]}))}}}),Rh("toolbar-toggle-events",[vu(r,function(n){wI(n,t,!1)})])]),apis:{setGroups:function(n,e){!function(n,e){var o=nt(e,n.getSystem().build);t.builtGroups.set(o)}(n,e),SI(n,t)},refresh:function(n){return SI(n,t)},toggle:function(n){wI(n,t,!1)},toggleWithoutFocusing:function(n){wI(n,t,!0)},isOpen:function(n){return function(t,n){return zm(t,n,"overflow").map(zD.hasGrown).getOr(!1)}(n,t)}},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)}}}),kI=function(t){var n=t.title.fold(function(){return{}},function(t){return{attributes:{title:t}}});return{dom:_({tag:"div",classes:["tox-toolbar__group"]},n),components:[pI.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]), .tox-number-input:not([disabled])"},tgroupBehaviours:zu([Yb.config({}),Hh.config({})])}},OI=function(t){return pI.sketch(kI(t))},_I=function(t,n){var e=Ou(function(n){var e=nt(t.initGroups,OI);sB.setGroups(n,e)});return zu([_S(function(){return t.providers.checkUiComponentContext("any").shouldDisable}),IS(function(){return t.providers.checkUiComponentContext("any")}),Oh.config({mode:n,onEscape:t.onEscape,selector:".tox-toolbar__group"}),Rh("toolbar-events",[e])])},TI=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return{uid:t.uid,dom:{tag:"div",classes:["tox-toolbar-overlord"]},parts:{"overflow-group":kI({title:G.none(),items:[]}),"overflow-button":hA({context:"any",name:"more",icon:G.some("more-drawer"),enabled:!0,tooltip:G.some("Reveal or hide additional toolbar items"),primary:!1,buttonType:G.none(),borderless:!1},G.none(),t.providers,[],"overflow-button")},splitToolbarBehaviours:_I(t,n)}},EI=function(t){var n=TI(t),e=bI.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}});return bI.sketch(_(_({},n),{},{lazySink:t.getSink,getOverflowBounds:function(){var n=t.moreDrawerData.lazyHeader().element,e=mo(n),o=yn(n),r=mo(o),i=Math.max(o.dom.scrollHeight,r.height);return lo(e.x+4,r.y,e.width-8,i)},parts:_(_({},n.parts),{},{overflow:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:t.attributes}}}),components:[e],markers:{overflowToggledClass:"tox-tbtn--enabled"},onOpened:function(n){return t.onToggled(n,!0)},onClosed:function(n){return t.onToggled(n,!1)}}))},DI=function(t){var n=CI.parts.primary({dom:{tag:"div",classes:["tox-toolbar__primary"]}}),e=CI.parts.overflow({dom:{tag:"div",classes:["tox-toolbar__overflow"]}}),o=TI(t);return CI.sketch(_(_({},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(n){n.getSystem().broadcastOn([gB()],{type:"opened"}),t.onToggled(n,!0)},onClosed:function(n){n.getSystem().broadcastOn([gB()],{type:"closed"}),t.onToggled(n,!1)}}))},AI=function(t){var n=t.cyclicKeying?"cyclic":"acyclic";return sB.sketch({uid:t.uid,dom:{tag:"div",classes:["tox-toolbar"].concat(t.type===Cv.scrolling?["tox-toolbar--scrolling"]:[])},components:[sB.parts.groups({})],toolbarBehaviours:_I(t,n)})},MI=[_w,Ew,Hr("tooltip"),Kr("buttonType","secondary",["primary","secondary"]),Jr("borderless",!1),Ir("onAction"),Xr("context","mode:design")],BI={button:[].concat(MI,[hw,Br("type",["button"])]),togglebutton:[].concat(MI,[Jr("active",!1),Br("type",["togglebutton"])])},II=[Br("type",["group"]),Qr("buttons",[],kr("type",BI))],FI=kr("type",_(_({},BI),{},{group:II}
2)),RI=or([Qr("buttons",[],FI),Ir("onShow"),Ir("onHide")]),NI=function(t,n){return function(t,n){var e,o,r,i,u,a="togglebutton"===t.type,c=t.icon.map(function(t){return $E(t,n.icons)}).map(jb),s=function(e){var o=function(t){c.map(function(o){return o.getOpt(e).each(function(e){Fh.set(e,[$E(t,n.icons)])})})};return a?t.onAction({setIcon:o,setActive:function(t){var n=e.element;t?(Ku(n,"tox-button--enabled"),Hn(n,"aria-pressed",!0)):($u(n,"tox-button--enabled"),Gn(n,"aria-pressed"))},isActive:function(){return Zu(e.element,"tox-button--enabled")},focus:function(){return tl(e.element)}}):"button"===t.type?t.onAction({setIcon:o}):void 0},l=_(_({},t),{},{name:a?t.text.getOr(t.icon.getOr("")):null!==(i=t.text)&&void 0!==i?i:t.icon.getOr(""),primary:"primary"===t.buttonType,buttonType:G.from(t.buttonType),tooltip:t.tooltip,icon:t.icon,enabled:!0,borderless:t.borderless}),f=vA(null!==(u=t.buttonType)&&void 0!==u?u:"secondary"),d=a?t.text.map(n.translate):G.some(n.translate(t.text)),m=d.map(Qc),g=l.tooltip.or(d).map(function(t){return{"aria-label":n.translate(t)}}).getOr({}),p=c.map(function(t){return t.asSpec()}),h=NS([p,m]),v=t.icon.isSome()&&m.isSome(),b={tag:"button",classes:(e=(o=(r=f.concat.apply(f,w(t.icon.isSome()&&!v?["tox-button--icon"]:[]))).concat.apply(r,w(v?["tox-button--icon-and-text"]:[]))).concat.apply(o,w(t.borderless?["tox-button--naked"]:[]))).concat.apply(e,w("togglebutton"===t.type&&t.active?["tox-button--enabled"]:[])),attributes:g},y=pA(l,G.some(s),[],b,h,t.tooltip,n);return Ub.sketch(y)}(t,n)},LI=Ge().deviceType,zI=LI.isPhone(),PI=LI.isTablet(),HI=Zm({name:"silver.View",configFields:[Dr("viewConfig")],partFields:[_m({factory:{sketch:function(t){var n=!1,e=nt(t.buttons,function(e){return"group"===e.type?(n=!0,function(t,n){return{dom:{tag:"div",classes:["tox-view__toolbar__group"]},components:nt(t.buttons,function(t){return NI(t,n)})}}(e,t.providers)):NI(e,t.providers)});return{uid:t.uid,dom:{tag:"div",classes:[n?"tox-view__toolbar":"tox-view__header"].concat(w(zI||PI?["tox-view--mobile","tox-view--scrolling"]:[]))},behaviours:zu([Hh.config({}),Oh.config({mode:"flow",selector:"button, .tox-button",focusInside:yf.OnEnterOrSpaceMode})]),components:n?e:[CO.sketch({dom:{tag:"div",classes:["tox-view__header-start"]},components:[]}),CO.sketch({dom:{tag:"div",classes:["tox-view__header-end"]},components:e})]}}},schema:[Dr("buttons"),Dr("providers")],name:"header"}),_m({factory:{sketch:function(t){return{uid:t.uid,behaviours:zu([Hh.config({}),Yb.config({})]),dom:{tag:"div",classes:["tox-view__pane"]}}}},schema:[],name:"pane"})],factory:function(t,n,e,o){var r={getPane:function(n){return nB.getPart(n,t,"pane")},getOnShow:function(n){return t.viewConfig.onShow},getOnHide:function(n){return t.viewConfig.onHide}};return{uid:t.uid,dom:t.dom,components:n,behaviours:zu([Hh.config({}),Oh.config({mode:"cyclic",focusInside:yf.OnEnterOrSpaceMode})]),apis:r}},apis:{getPane:function(t,n){return t.getPane(n)},getOnShow:function(t,n){return t.getOnShow(n)},getOnHide:function(t,n){return t.getOnHide(n)}}}),VI=function(t,n,e){return At(n,function(n,o){var r=wr(xr("view",RI,n));return t.slot(o,HI.sketch({dom:{tag:"div",classes:["tox-view"]},viewConfig:r,components:[].concat(w(r.buttons.length>0?[HI.parts.header({buttons:r.buttons,providers:e})]:[]),[HI.parts.pane({})])}))})},UI=function(t,n){return RB.sketch(function(e){return{dom:{tag:"div",classes:["tox-view-wrap__slot-container"]},components:VI(e,t,n),slotBehaviours:SS([Ou(function(t){return RB.hideAllSlots(t)})])}})},WI=function(t){return at(RB.getSlotNames(t),function(n){return RB.isShowing(t,n)})},jI=function(t,n,e){RB.getSlot(t,n).each(function(t){HI.getPane(t).each(function(n){var o;e(t)((o=n.element.dom,{getContainer:N(o)}))})})},GI=Qm({factory:function(t,n){var e={setViews:function(t,e){Fh.set(t,[UI(e,n.backstage.shared.providers)])},whichView:function(t){return og.getCurrent(t).bind(WI)},toggleView:function(t,n,e,o){return og.getCurrent(t).exists(function(r){var i=WI(r),u=i.exists(function(t){return o===t}),a=RB.getSlot(r,o).isSome();return a&&(RB.hideAllSlots(r),u?(!function(t){var n=t.element;
2Xn(n,"display","none"),Hn(n,"aria-hidden","true")}(t),n()):(e(),function(t){var n=t.element;ee(n,"display"),Gn(n,"aria-hidden")}(t),RB.showSlot(r,o),function(t,n){jI(t,n,HI.getOnShow)}(r,o)),i.each(function(t){return function(t,n){return jI(t,n,HI.getOnHide)}(r,t)})),a})}};return{uid:t.uid,dom:{tag:"div",classes:["tox-view-wrap"],attributes:{"aria-hidden":"true"},styles:{display:"none"}},components:[],behaviours:zu([Fh.config({}),og.config({find:function(t){var n=Fh.contents(t);return bt(n)}})]),apis:e}},name:"silver.ViewWrapper",configFields:[Dr("backstage")],apis:{setViews:function(t,n,e){return t.setViews(n,e)},toggleView:function(t,n,e,o,r){return t.toggleView(n,e,o,r)},whichView:function(t,n){return t.whichView(n)}}}),qI=eB.optional({factory:DB,name:"menubar",schema:[Dr("backstage")]}),YI=eB.optional({factory:{sketch:function(t){return uB.sketch({uid:t.uid,dom:t.dom,listBehaviours:zu([Oh.config({mode:"acyclic",selector:".tox-toolbar"})]),makeItem:function(){return AI({type:t.type,uid:mc("multiple-toolbar-item"),cyclicKeying:!1,initGroups:[],providers:t.providers,onEscape:function(){return t.onEscape(),G.some(!0)}})},setupItem:function(t,n,e,o){sB.setGroups(n,e)},shell:!0})}},name:"multiple-toolbar",schema:[Dr("dom"),Dr("onEscape")]}),XI=eB.optional({factory:{sketch:function(t){var n=function(t){return t.type===Cv.sliding?DI:t.type===Cv.floating?EI:AI}(t);return n({type:t.type,uid:t.uid,onEscape:function(){return t.onEscape(),G.some(!0)},onToggled:function(n,e){return t.onToolbarToggled(e)},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:[Dr("dom"),Dr("onEscape"),Dr("getSink")]}),KI=eB.optional({factory:{sketch:function(t){var n=t.editor,e=t.sticky?SB:dB;return{uid:t.uid,dom:t.dom,components:t.components,behaviours:zu(e(n,t.sharedBackstage))}}},name:"header",schema:[Dr("dom")]}),JI=eB.optional({factory:{sketch:function(t){return{uid:t.uid,dom:t.dom,components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/tinymce-self-hosted-premium-features/?utm_campaign=self_hosted_upgrade_promo&utm_source=tiny&utm_medium=referral",rel:"noopener",target:"_blank","aria-hidden":"true"},classes:["tox-promotion-link"],innerHtml:"⚡️Upgrade"}}]}}},name:"promotion",schema:[Dr("dom")]}),$I=eB.optional({name:"socket",schema:[Dr("dom")]}),QI=eB.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-sidebar"],attributes:{role:"presentation"}},components:[{dom:{tag:"div",classes:["tox-sidebar__slider"]},components:[],behaviours:zu([Yb.config({}),Hh.config({}),zD.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){og.getCurrent(t).each(RB.hideAllSlots),cu(t,WB)},onGrown:function(t){cu(t,WB)},onStartGrow:function(t){su(t,UB,{width:Zn(t.element,"width").getOr("")})},onStartShrink:function(t){su(t,UB,{width:ge(t.element)+"px"})}}),Fh.config({}),og.config({find:function(t){var n=Fh.contents(t);return bt(n)}})])}],behaviours:zu([aE(0),Rh("sidebar-sliding-events",[vu(UB,function(t,n){Xn(t.element,"width",n.event.width)}),vu(WB,function(t,n){ee(t.element,"width")})])])}}},name:"sidebar",schema:[Dr("dom")]}),ZI=eB.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",attributes:{"aria-hidden":"true"},classes:["tox-throbber"],styles:{display:"none"}},behaviours:zu([Fh.config({}),qB.config({focus:!1}),og.config({find:function(t){return bt(t.components())}})]),components:[]}}},name:"throbber",schema:[Dr("dom")]}),tF=eB.optional({factory:GI,name:"viewWrapper",schema:[Dr("backstage")]}),nF=eB.optional({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-editor-container"]},components:t.components}}},name:"editorContainer",schema:[]}),eF=Zm({name:"OuterContainer",factory:function(t,n,e){var o=!1,r=function(t){ls(t,".tox-statusbar").each(function(t){"none"===$n(t,"display")&&"true"===Un(t,"aria-hidden")?(ee(t,"display"),Gn(t,"aria-hidden")):(Xn(t,"display","none"),Hn(t,"aria-hidden","true"))})},i={getSocket:function(n){return nB.getPart(n,t,"socket")},setSidebar:function(n,e,o){nB.getPart(n,t,"sidebar").each(function(t){return function(t,n,e){og.getCurrent(t).each(function(o){Fh.set(o,[PB(n)]);var r=null==e?void 0:e.toLowerCase();f(r)&&Ft(n,r)&&og.getCurrent(o).each(function(n){RB.showSlot(n,r),zD.immediateGrow(o),ee(o.element,"width"),HB(t.element,"region")})})}(t,e,o)})},toggleSidebar:function(n,e){nB.getPart(n,t,"sidebar").each(function(t){return function(t,n){og.getCurrent(t).each(function(e){og.getCurrent(e).each(function(o){zD.hasGrown(e)?RB.isShowing(o,n)?(zD.shrink(e),HB(t.element,"presentation")):(RB.hideAllSlots(o),RB.showSlot(o,n),HB(t.element,"region")):(RB.hideAllSlots(o),RB.showSlot(o,n),zD.grow(e),HB(t.element,"region"))})})}(t,e)})},whichSidebar:function(n){return nB.getPart(n,t,"sidebar").bind(VB).getOrNull()},getHeader:function(n){return nB.getPart(n,t,"header")},getToolbar:function(n){return nB.getPart(n,t,"toolbar")},setToolbar:function(n,e){nB.getPart(n,t,"toolbar").each(function(t){var n=nt(e,OI);t.getApis().setGroups(t,n)})},setToolbars:function(n,e){nB.getPart(n,t,"multiple-toolbar").each(function(t){var n=nt(e,function(t){return nt(t,OI)});
2uB.setItems(t,n)})},refreshToolbar:function(n){nB.getPart(n,t,"toolbar").each(function(t){return t.getApis().refresh(t)})},toggleToolbarDrawer:function(n){nB.getPart(n,t,"toolbar").each(function(t){Pt(t.getApis().toggle,function(n){return n(t)})})},toggleToolbarDrawerWithoutFocusing:function(n){nB.getPart(n,t,"toolbar").each(function(t){Pt(t.getApis().toggleWithoutFocusing,function(n){return n(t)})})},isToolbarDrawerToggled:function(n){return nB.getPart(n,t,"toolbar").bind(function(t){return G.from(t.getApis().isOpen).map(function(n){return n(t)})}).getOr(!1)},getThrobber:function(n){return nB.getPart(n,t,"throbber")},focusToolbar:function(n){nB.getPart(n,t,"toolbar").orThunk(function(){return nB.getPart(n,t,"multiple-toolbar")}).each(function(t){Oh.focusIn(t)})},setMenubar:function(n,e){nB.getPart(n,t,"menubar").each(function(t){DB.setMenus(t,e)})},focusMenubar:function(n){nB.getPart(n,t,"menubar").each(function(t){DB.focus(t)})},setViews:function(n,e){nB.getPart(n,t,"viewWrapper").each(function(t){GI.setViews(t,e)})},toggleView:function(n,e){return nB.getPart(n,t,"viewWrapper").exists(function(t){return GI.toggleView(t,function(){return i.showMainView(n)},function(){return i.hideMainView(n)},e)})},whichView:function(n){return nB.getPart(n,t,"viewWrapper").bind(GI.whichView).getOrNull()},hideMainView:function(n){(o=i.isToolbarDrawerToggled(n))&&i.toggleToolbarDrawer(n),nB.getPart(n,t,"editorContainer").each(function(t){var n=t.element;r(n),Xn(n,"display","none"),Hn(n,"aria-hidden","true")})},showMainView:function(n){o&&i.toggleToolbarDrawer(n),nB.getPart(n,t,"editorContainer").each(function(t){var n=t.element;r(n),ee(n,"display"),Gn(n,"aria-hidden")})}};return{uid:t.uid,dom:t.dom,components:n,apis:i,behaviours:t.behaviours}},configFields:[Dr("dom"),Dr("behaviours")],partFields:[KI,qI,XI,YI,$I,QI,JI,ZI,tF,nF],apis:{getSocket:function(t,n){return t.getSocket(n)},setSidebar:function(t,n,e,o){t.setSidebar(n,e,o)},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){t.setToolbar(n,e)},setToolbars:function(t,n,e){t.setToolbars(n,e)},refreshToolbar:function(t,n){return t.refreshToolbar(n)},toggleToolbarDrawer:function(t,n){t.toggleToolbarDrawer(n)},toggleToolbarDrawerWithoutFocusing:function(t,n){t.toggleToolbarDrawerWithoutFocusing(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)},setViews:function(t,n,e){t.setViews(n,e)},toggleView:function(t,n,e){return t.toggleView(n,e)},whichView:function(t,n){return t.whichView(n)}}}),oF={file:{title:"File",items:"newdocument restoredraft | preview | importword exportpdf exportword | export print | deleteallconversations"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall | searchreplace"},view:{title:"View",items:"code revisionhistory | visualaid visualchars visualblocks | spellchecker | preview fullscreen | showcomments"},insert:{title:"Insert",items:"image link media addcomment pageembed inserttemplate codesample inserttable accordion math | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents footnotes | mergetags | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | styles blocks fontfamily fontsize align lineheight | forecolor backcolor | language | removeformat"},tools:{title:"Tools",items:"aidialog aishortcuts | spellchecker spellcheckerlanguage | autocorrect capitalization | a11ycheck code typography wordcount addtemplate"},table:{title:"Table",items:"inserttable | cell row column | advtablesort | tableprops deletetable"},help:{title:"Help",items:"help"}},rF=function(t){return t.split(" ")},iF=function(t,n){var e=_(_({},oF),n.menus),o=St(n.menus).length>0,r=void 0===n.menubar||!0===n.menubar?rF("file edit view insert format tools table help"):rF(!1===n.menubar?"":n.menubar),i=rt(r,function(t){var e=Ft(oF,t);return o?e||It(n.menus,t).exists(function(t){return Ft(t,"items")}):e}),u=nt(i,function(o){var r=e[o];return function(t,n,e){var o=qv(e).split(/[ ,]/);return{text:t.title,getItems:function(){return lt(t.items,function(t){var e=t.toLowerCase();return 0===e.trim().length||Q(o,function(t){return t===e})?[]:"separator"===e||"|"===e?[{type:"separator"}]:n.menuItems[e]?[n.menuItems[e]]:[]})}}}({title:r.title,items:rF(r.items)},n,t)});return rt(u,function(t){return t.getItems().length>0&&Q(t.getItems(),function(t){return f(t)||"separator"!==t.type})})},uF=function(t,n,e){return t.on("remove",function(){return e.unload(n)}),e.load(n)},aF=function(t,n,e,o){return t.on("remove",function(){return o.unloadRawCss(n)}),o.loadRawCss(n,e)},cF=function(){var t=p(i().mark(function t(n,e){var o,r,u,a,c;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=Sb(n).getOr("default"),r="ui/"+o+"/skin.css",u=tinymce.Resource.get(r),!f(u)){t.next=7;break}aF(n,r,u,n.ui.styleSheetLoader),t.next=10;break;case 7:return a=n.editorManager.suffix,c=e+"/skin".concat(a,".css"),t.abrupt("return",uF(n,c,n.ui.styleSheetLoader));case 10:case"end":return t.stop()}},t)}));return function(n,e){return t.apply(this,arguments)}}(),sF=function(){var t=p(i().mark(function t(n,e){var o,r,u,a,c;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!Bn($t.fromDom(n.getElement()))){t.next=12;break}if(o=Sb(n).getOr("default"),r="ui/"+o+"/skin.shadowdom.css",u=tinymce.Resource.get(r),!f(u)){t.next=9;break}aF(n,r,u,Dv.DOM.styleSheetLoader),t.next=12;break;case 9:return a=n.editorManager.suffix,c=e+"/skin.shadowdom".concat(a,".css"),t.abrupt("return",uF(n,c,Dv.DOM.styleSheetLoader));case 12:case"end":return t.stop()}},t)}));return function(n,e){return t.apply(this,arguments)}}(),lF=function(){var t=p(i().mark(function t(n,e){var o,r;return i().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(o=function(){var t=wb(e),o=e.editorManager.suffix;t&&e.contentCSS.push(t+(n?"/content.inline":"/content")+"".concat(o,".css"))},Sb(e).fold(o,function(t){var r="ui/"+t+(n?"/content.inline":"/content")+".css",i=tinymce.Resource.get(r);f(i)?aF(e,r,i,e.ui.styleSheetLoader):o()}),r=wb(e),yb(e)||!f(r)){t.next=5;break}return t.abrupt("return",Promise.all([cF(e,r),sF(e,r)]).then());case 5:case"end":return t.stop()}},t)}));return function(n,e){return t.apply(this,arguments)}}(),fF=function(t,n){return lF(t,n).then(function(t){var n=function(){t._skinLoaded=!0,function(t){t.dispatch("SkinLoaded")}(t)};return function(){t.initialized?n():t.on("init",n)}}(n),function(t,n){return function(){return function(t,n){t.dispatch("SkinLoadError",n)}(t,{message:n})}}(n,"Skin could not be loaded"))},dF=P(fF,!1),mF=P(fF,!0),gF=function(t,n,e){return Xt(e)?t.translate(n):t.translate([n,t.translate(e)])},pF=function(t,n){var e=function(e,r,i,u){var a=t.shared.providers.translate(e.title);if("separator"===e.type)return G.some({type:"separator",text:a});if("submenu"===e.type){var c=lt(e.getStyleItems(),function(t){return o(t,r,u)});return 0===r&&c.length<=0?G.none():G.some({type:"nestedmenuitem",text:a,enabled:c.length>0,getSubmenuItems:function(){return lt(e.getStyleItems(),function(t){return o(t,r,u)})}})}return G.some(_({type:"togglemenuitem",text:a,icon:e.icon,active:e.isSelected(u),enabled:!i,onAction:n.onAction(e)},e.getStylePreview().fold(function(){return{}},function(t){return{meta:{style:t}}})))},o=function(t,o,r){var i="formatter"===t.type&&n.isInvalid(t);return 0===o?i?[]:e(t,o,!1,r).toArray():e(t,o,i,r).toArray()},r=function(t){var e=n.getCurrentValue(),r=n.shouldHide?0:1;return lt(t,function(t){return o(t,r,e)}
2)};return{validateItems:r,getFetch:function(t,n){return function(e,o){var i=n(),u=r(i);o(aD(u,Tx.CLOSE_ON_EXECUTE,t,{isHorizontalMenu:!1,search:G.none()}))}}}},hF=function(t,n){var e=n.dataset,o="basic"===e.type?function(){return nt(e.data,function(t){return kM(t,n.isSelectedFor,n.getPreviewFor)})}:e.getData;return{items:pF(t,n),getStyleItems:o}},vF=function(t,n,e,o,r,i){var u=hF(n,e),a=u.items,c=u.getStyleItems,s=ho(e.tooltip);return nD({context:"mode:design",text:e.icon.isSome()?G.none():e.text,icon:e.icon,ariaLabel:G.some(e.tooltip),tooltip:G.none(),role:G.none(),fetch:a.getFetch(n,c),onSetup:function(n){var i=function(e){return n.setTooltip(gF(t,o(e.value),e.value))};return t.on(r,i),CC(_C(t,"NodeChange",function(n){var o=n.getComponent();e.updateText(o),vg.set(n.getComponent(),!t.selection.isEditable())})(n),function(){return t.off(r,i)})},getApi:function(t){return{getComponent:N(t),setTooltip:function(e){var o=n.shared.providers.translate(e);Hn(t.element,"aria-label",o),s.set(e)}}},columns:1,presets:"normal",classes:e.icon.isSome()?[]:["bespoke"],dropdownBehaviours:[ry.config(_({},n.shared.providers.tooltips.getConfig({tooltipText:n.shared.providers.translate(e.tooltip),onShow:function(t){if(e.tooltip!==s.get()){var o=n.shared.providers.translate(s.get());ry.setComponents(t,n.shared.providers.tooltips.getComponents({tooltipText:o}))}}})))]},"tox-tbtn",n.shared,i)};!function(t){t[t.SemiColon=0]="SemiColon",t[t.Space=1]="Space"}(oO||(oO={}));var bF,yF,xF,wF,SF,CF,kF=function(t,n,e){var o=function(t){return nt(t,function(t){var n=t,e=t,o=t.split("=");return o.length>1&&(n=o[0],e=o[1]),{title:n,format:e}})}(function(t,n){return n===oO.SemiColon?t.replace(/;$/,"").split(";"):t.split(" ")}(t.options.get(n),e));return{type:"basic",data:o}},OF=N("Alignment {0}"),_F="left",TF=[{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"}],EF=function(t){var n={type:"basic",data:TF};return{tooltip:gF(t,OF(),_F),text:G.none(),icon:G.some("align-left"),isSelectedFor:function(n){return function(){return t.formatter.match(n)}},getCurrentValue:G.none,getPreviewFor:function(t){return G.none},onAction:function(n){return function(){return at(TF,function(t){return t.format===n.format}).each(function(n){return t.execCommand(n.command)})}},updateText:function(n){var e=at(TF,function(n){return t.formatter.match(n.format)}),o=e.fold(N(_F),function(t){return t.title.toLowerCase()});su(n,tD,{icon:"align-".concat(o)}),function(t,n){t.dispatch("AlignTextUpdate",n)}(t,{value:o})},dataset:n,shouldHide:!1,isInvalid:function(n){return!t.formatter.canApply(n.format)}}},DF=function(t,n){var e=n(),o=nt(e,function(t){return t.format});return G.from(t.formatter.closest(o)).bind(function(t){return at(e,function(n){return n.format===t})})},AF=N("Block {0}"),MF="Paragraph",BF=function(t){var n=kF(t,"block_formats",oO.SemiColon);return{tooltip:gF(t,AF(),MF),text:G.some(MF),icon:G.none(),isSelectedFor:function(n){return function(){return t.formatter.match(n)}},getCurrentValue:G.none,getPreviewFor:function(n){return function(){var e=t.formatter.get(n);return e?G.some({tag:e.length>0&&(e[0].inline||e[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(n))}):G.none()}},onAction:TC(t),updateText:function(e){var o=DF(t,function(){return n.data}).fold(N(MF),function(t){return t.title});su(e,ZE,{text:o}),function(t,n){t.dispatch("BlocksTextUpdate",n)}(t,{value:o})},dataset:n,shouldHide:!1,isInvalid:function(n){return!t.formatter.canApply(n.format)}}},IF=N("Font {0}"),FF="System Font",RF=["-apple-system","Segoe UI","Roboto","Helvetica Neue","sans-serif"],NF=function(t){var n=t.split(/\s*,\s*/);return nt(n,function(t){return t.replace(/^['"]+|['"]+$/g,"")})},LF=function(t,n){return n.length>0&&ft(n,function(n){return t.indexOf(n.toLowerCase())>-1})},zF=function(t){var n=function(){var n=function(t){return t?NF(t)[0]:""},o=t.queryCommandValue("FontName"),r=e.data,i=o?o.toLowerCase():"",u=bb(t),a=at(r,function(t){var e=t.format;return e.toLowerCase()===i||n(e).toLowerCase()===n(i).toLowerCase()}).orThunk(function(){return Ht(function(t,n){if(0===t.indexOf("-apple-system")||n.length>0){var e=NF(t.toLowerCase());return LF(e,RF)||LF(e,n)}return!1}(i,u),{title:FF,format:i})});return{matchOpt:a,font:o}},e=kF(t,"font_family_formats",oO.SemiColon);return{tooltip:gF(t,IF(),FF),text:G.some(FF),icon:G.none(),isSelectedFor:function(t){return function(n){return n.exists(function(n){return n.format===t})}},getCurrentValue:function(){return n().matchOpt},getPreviewFor:function(t){return function(){return G.some({tag:"div",styles:-1===t.indexOf("dings")?{"font-family":t}:{}})}}
2,onAction:function(n){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("FontName",!1,n.format)})}},updateText:function(e){var o=n(),r=o.matchOpt,i=o.font,u=r.fold(N(i),function(t){return t.title});su(e,ZE,{text:u}),function(t,n){t.dispatch("FontFamilyTextUpdate",n)}(t,{value:u})},dataset:e,shouldHide:!1,isInvalid:W}},PF={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:[""]},HF=(bF="[0-9]+",yF="[eE][+-]?"+bF,xF=function(t){return"(?:".concat(t,")?")},wF=["Infinity",bF+"\\."+xF(bF)+xF(yF),"\\."+bF+xF(yF),bF+xF(yF)].join("|"),SF="[+-]?(?:".concat(wF,")"),new RegExp("^(".concat(SF,")(.*)$"))),VF=function(t,n){return G.from(HF.exec(t)).bind(function(t){var e=Number(t[1]),o=t[2];return function(t,n){return Q(n,function(n){return Q(PF[n],function(n){return t===n})})}(o,n)?G.some({value:e,unit:o}):G.none()})},UF={tab:N(9),escape:N(27),enter:N(13),backspace:N(8),delete:N(46),left:N(37),up:N(38),right:N(39),down:N(40),space:N(32),home:N(36),end:N(35),pageUp:N(33),pageDown:N(34)},WF=function(t,n,e,o){var r=G.none(),i=_C(t,"NodeChange SwitchMode",function(n){var o=n.getComponent();r=G.some(o),e.updateInputValue(o),vg.set(o,!t.selection.isEditable())}),u=function(t){return{getComponent:N(t)}},a=ho(I),c=mc("custom-number-input-events"),s=function(t,n,o){var i=r.map(function(t){return Xd.getValue(t)}).getOr(""),u=e.getNewValue(i,t),a=i.length-"".concat(u).length,c=r.map(function(t){return t.element.dom.selectionStart-a}),s=r.map(function(t){return t.element.dom.selectionEnd-a});e.onAction(u,o),r.each(function(t){Xd.setValue(t,u),n&&(c.each(function(n){return t.element.dom.selectionStart=n}),s.each(function(n){return t.element.dom.selectionEnd=n}))})},l=function(t,n){return s(function(t,n){return t-n},t,n)},f=function(t,n){return s(function(t,n){return t+n},t,n)},d=function(t){return Sn(t.element).fold(G.none,function(t){return tl(t),G.some(!0)})},m=function(t){return el(t.element)?(_n(t.element).each(function(t){return tl(t)}),G.some(!0)):G.none()},g=function(e,o,r,i){var a=ho(I),c=n.shared.providers.translate(r),s=mc("altExecuting"),l=_C(t,"NodeChange SwitchMode",function(n){vg.set(n.getComponent(),!t.selection.isEditable())}),f=function(t){vg.isDisabled(t)||e(!0)};return Ub.sketch({dom:{tag:"button",attributes:{"aria-label":c,"data-mce-name":o},classes:i.concat(o)},components:[JE(o,n.shared.providers.icons)],buttonBehaviours:zu([vg.config({}),ry.config(n.shared.providers.tooltips.getConfig({tooltipText:c})),Rh(s,[ES({onSetup:l,getApi:u},a),DS({getApi:u},a),vu(Oi(),function(t,n){n.event.raw.keyCode!==UF.space()&&n.event.raw.keyCode!==UF.enter()||vg.isDisabled(t)||e(!1)}),vu(Di(),f),vu(hi(),f)])]),eventOrder:T(T(T(T(T({},Oi(),[s,"keying"]),Di(),[s,"alloy.base.behaviour"]),hi(),[s,"alloy.base.behaviour"]),$i(),["alloy.base.behaviour",s,"tooltipping"]),Qi(),[s,"tooltipping"])})},p=jb(g(function(t){return l(!1,t)},"minus","Decrease font size",[])),h=jb(g(function(t){return f(!1,t)},"plus","Increase font size",[])),v=jb({dom:{tag:"div",classes:["tox-input-wrapper"]},components:[Jx.sketch({inputBehaviours:zu([vg.config({}),Rh(c,[ES({onSetup:i,getApi:u},a),DS({getApi:u},a)]),Rh("input-update-display-text",[vu(ZE,function(t,n){Xd.setValue(t,n.event.text)}),vu(ki(),function(t){e.onAction(Xd.getValue(t))}),vu(Ei(),function(t){e.onAction(Xd.getValue(t))})]),Oh.config({mode:"special",onEnter:function(t){return s(L,!0,!0),G.some(!0)},onEscape:d,onUp:function(t){return f(!0,!1),G.some(!0)},onDown:function(t){return l(!0,!1),G.some(!0)},onLeft:function(t,n){return n.cut(),G.none()},onRight:function(t,n){return n.cut(),G.none()}})])})],behaviours:zu([Hh.config({}),Oh.config({mode:"special",onEnter:m,onSpace:m,onEscape:d}),Rh("input-wrapper-events",[vu(Si(),function(t){et([p,h],function(n){var e=$t.fromDom(n.get(t).element.dom);el(e)&&nl(e)})})])])});return{dom:{tag:"div",classes:["tox-number-input"],attributes:_({},O(o)?{"data-mce-name":o}:{})},components:[p.asSpec(),v.asSpec(),h.asSpec()],behaviours:zu([Hh.config({}),Oh.config({mode:"flow",focusInside:yf.OnEnterOrSpaceMode,cycles:!1,selector:"button, .tox-input-wrapper",onEscape:function(t){return el(t.element)?G.none():(tl(t.element),G.some(!0))}})])}},jF=N("Font size {0}"),GF="12pt",qF={"8pt":"1","10pt":"2","12pt":"3","14pt":"4","18pt":"5","24pt":"6","36pt":"7"},YF={"xx-small":"7pt","x-small":"8pt",small:"10pt",medium:"12pt",large:"14pt","x-large":"18pt","xx-large":"24pt"},XF=function(t,n){return/[0-9.]+px$/.test(t)?function(t,n){var e=Math.pow(10,n);return Math.round(t*e)/e}(72*parseInt(t,10)/96,n||0)+"pt":It(YF,t).getOr(t)},KF=function(t){var n=function(){var n=G.none(),e=o.data,r=t.queryCommandValue("FontSize");if(r)for(var i=function(){var t=XF(r,u),o=function(t){return It(qF,t).getOr("")}(t);n=at(e,function(n){return n.format===r||n.format===t||n.format===o})},u=3;n.isNone()&&u>=0;u--)i();return{matchOpt:n,size:r}},e=N(G.none),o=kF(t,"font_size_formats",oO.Space);return{tooltip:gF(t,jF(),GF),text:G.some(GF),icon:G.none(),isSelectedFor:function(t){return function(n){return n.exists(function(n){return n.format===t})}},getPreviewFor:e,getCurrentValue:function(){return n().matchOpt}
2,onAction:function(n){return function(){t.undoManager.transact(function(){t.focus(),t.execCommand("FontSize",!1,n.format)})}},updateText:function(e){var o=n(),r=o.matchOpt,i=o.size,u=r.fold(N(i),function(t){return t.title});su(e,ZE,{text:u}),function(t,n){t.dispatch("FontSizeTextUpdate",n)}(t,{value:u})},dataset:o,shouldHide:!1,isInvalid:W}},JF=function(t){return Xt(t)?"Formats":"Format {0}"},$F=function(t,n){var e="Formats";return{tooltip:gF(t,JF(""),""),text:G.some(e),icon:G.none(),isSelectedFor:function(n){return function(){return t.formatter.match(n)}},getCurrentValue:G.none,getPreviewFor:function(n){return function(){var e=t.formatter.get(n);return void 0!==e?G.some({tag:e.length>0&&(e[0].inline||e[0].block)||"div",styles:t.dom.parseStyle(t.formatter.getCssText(n))}):G.none()}},onAction:TC(t),updateText:function(n){var o=function(t){return yM(t)?lt(t.items,o):xM(t)?[{title:t.title,format:t.format}]:[]},r=lt(CM(t),o),i=DF(t,N(r)).fold(N({title:e,tooltipLabel:""}),function(t){return{title:t.title,tooltipLabel:t.title}});su(n,ZE,{text:i.title}),function(t,n){t.dispatch("StylesTextUpdate",n)}(t,{value:i.tooltipLabel})},shouldHide:jv(t),isInvalid:function(n){return!t.formatter.canApply(n.format)},dataset:n}},QF=N([Dr("toggleClass"),Dr("fetch"),nc("onExecute"),Gr("getHotspot",G.some),Gr("getAnchorOverrides",N({})),Gl(),nc("onItemExecute"),Lr("lazySink"),Dr("dom"),Za("onOpen"),Kd("splitDropdownBehaviours",[Dk,Oh,Hh]),Gr("matchWidth",!1),Gr("useMinWidth",!1),Gr("eventOrder",{}),Lr("role"),Lr("listRole")].concat(Yk())),ZF=km({factory:Ub,schema:[Dr("dom")],name:"arrow",defaults:function(){return{buttonBehaviours:zu([Hh.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(t.uid).each(lu)},buttonBehaviours:zu([Xh.config({toggleOnExecute:!1,toggleClass:t.toggleClass})])}}}),tR=km({factory:Ub,schema:[Dr("dom")],name:"button",defaults:function(){return{buttonBehaviours:zu([Hh.revoke()])}},overrides:function(t){return{dom:{tag:"span",attributes:{role:"presentation"}},action:function(n){n.getSystem().getByUid(t.uid).each(function(e){t.onExecute(e,n)})}}}}),nR=N([ZF,tR,_m({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"span",styles:{display:"none"},attributes:{"aria-hidden":"true"},innerHtml:t.text}}}},schema:[Dr("text")],name:"aria-descriptor"}),Om({schema:[Ja()],name:"menu",defaults:function(t){return{onExecute:function(n,e){n.getSystem().getByUid(t.uid).each(function(o){t.onItemExecute(o,n,e)})}}}}),Lk()]),eR=Zm({name:"SplitDropdown",configFields:QF(),partFields:nR(),factory:function(t,n,e,o){var r=function(t){og.getCurrent(t).each(function(t){Eg.highlightFirst(t),Oh.focusIn(t)})},i=function(n){Vk(t,L,n,o,r,Qg.HighlightMenuAndItem).get(I)},u=function(n){var e=Pm(n,t,"button");return lu(e),G.some(!0)},a=_(_({},gu([Ou(function(n,e){zm(n,t,"aria-descriptor").each(function(t){var e=mc("aria");Hn(t.element,"id",e),Hn(n.element,"aria-describedby",e)})})])),Jh(G.some(i))),c={repositionMenus:function(t){Xh.isOn(t)&&qk(t)}};return{uid:t.uid,dom:t.dom,components:n,apis:c,eventOrder:_(_({},t.eventOrder),{},T({},Hi(),["disabling","toggling","alloy.base.behaviour"])),events:a,behaviours:$d(t.splitDropdownBehaviours,[Dk.config({others:{sandbox:function(n){var e=Pm(n,t,"arrow");return Gk(t,n,{onOpen:function(){Xh.on(e),Xh.on(n)},onClose:function(){Xh.off(e),Xh.off(n)}})}}}),Oh.config({mode:"special",onSpace:u,onEnter:u,onDown:function(t){return i(t),G.some(!0)}}),Hh.config({}),Xh.config({toggleOnExecute:!1,aria:{mode:"expanded"}})]),domModification:{attributes:{role:t.role.getOr("button"),"aria-haspopup":!0}}}},apis:{repositionMenus:function(t,n){return t.repositionMenus(n)}}}),oR=function(t){return{isEnabled:function(){return!vg.isDisabled(t)},setEnabled:function(n){return vg.set(t,!n)},setText:function(n){return su(t,ZE,{text:n})},setIcon:function(n){return su(t,tD,{icon:n})}}},rR=function(t){return{setActive:function(n){Xh.set(t,n)},isActive:function(){return Xh.isOn(t)},isEnabled:function(){return!vg.isDisabled(t)},setEnabled:function(n){return vg.set(t,!n)},setText:function(n){return su(t,ZE,{text:n})},setIcon:function(n){return su(t,tD,{icon:n})}}},iR=function(t,n){return t.map(function(t){return{"aria-label":n.translate(t)}
2}).getOr({})},uR=mc("focus-button"),aR=function(t,n,e,o,r,i,u){var a=n.map(function(t){return jb(QE(t,"tox-tbtn",r))}),c=t.map(function(t){return jb($E(t,r.icons))});return{dom:{tag:"button",classes:["tox-tbtn"].concat(n.isSome()?["tox-tbtn--select"]:[]),attributes:_(_({},iR(e,r)),O(u)?{"data-mce-name":u}:{})},components:NS([c.map(function(t){return t.asSpec()}),a.map(function(t){return t.asSpec()})]),eventOrder:T(T({},bi(),["focusing","alloy.base.behaviour",qE]),$i(),[qE,"toolbar-group-button-events"]),buttonBehaviours:zu([_S(function(){return r.checkUiComponentContext(i).shouldDisable}),IS(function(){return r.checkUiComponentContext(i)}),Rh(qE,[Ou(function(t,n){return XE(t)}),vu(ZE,function(t,n){a.bind(function(n){return n.getOpt(t)}).each(function(t){Fh.set(t,[Qc(r.translate(n.event.text))])})}),vu(tD,function(t,n){c.bind(function(n){return n.getOpt(t)}).each(function(t){Fh.set(t,[$E(n.event.icon,r.icons)])})}),vu(bi(),function(t,n){n.event.prevent(),cu(t,uR)})])].concat(o.getOr([])))}},cR=function(t,n,e,o){var r,i,u=ho(I),a=aR(t.icon,t.text,t.tooltip,G.none(),e,t.context,o);return Ub.sketch({dom:a.dom,components:a.components,eventOrder:YE,buttonBehaviours:_(_({},zu([Rh("toolbar-button-events",[(i={onAction:t.onAction,getApi:n.getApi},Eu(function(t,n){TS(i,t)(function(n){su(t,GE,{buttonApi:n}),i.onAction(n)})})),ES(n,u),DS(n,u)])].concat(w(t.tooltip.map(function(n){return ry.config(e.tooltips.getConfig({tooltipText:e.translate(n)+t.shortcut.map(function(t){return" (".concat(PS(t),")")}).getOr("")}))}).toArray()),[_S(function(){return!t.enabled||e.checkUiComponentContext(t.context).shouldDisable}),IS(function(){return e.checkUiComponentContext(t.context)})]).concat(n.toolbarButtonBehaviours))),{},T({},qE,null===(r=a.buttonBehaviours)||void 0===r?void 0:r[qE]))})},sR=function(t,n,e,o){return cR(t,{toolbarButtonBehaviours:e.length>0?[Rh("toolbarButtonWith",e)]:[],getApi:oR,onSetup:t.onSetup},n,o)},lR=function(t,n,e,o){return cR(t,{toolbarButtonBehaviours:[Fh.config({}),Xh.config({toggleClass:"tox-tbtn--enabled",aria:{mode:"pressed"},toggleOnExecute:!1})].concat(e.length>0?[Rh("toolbarToggleButtonWith",e)]:[]),getApi:rR,onSetup:t.onSetup},n,o)},fR=function(t,n,e){return function(o){return Fk(function(t){return n.fetch(t)}).map(function(r){return G.from(aO(Ho(sk(mc("menu-value"),r,function(e){n.onItemAction(t(o),e)},n.columns,n.presets,Tx.CLOSE_ON_EXECUTE,n.select.getOr(W),e),{movement:fk(n.columns,n.presets),menuBehaviours:SS("auto"!==n.columns?[]:[Ou(function(t,e){xS(t,4,Px(n.presets)).each(function(n){var e=n.numRows,o=n.numColumns;Oh.setGridSize(t,e,o)})})])})))})}},dR=[{name:"history",items:["undo","redo"]},{name:"ai",items:["aidialog","aishortcuts"]},{name:"styles",items:["styles"]},{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"]}],mR=function(t,n){return function(e,o,r,i){var u=t(e).mapError(function(t){return Cr(t)}).getOrDie();return n(u,o,r,i)}},gR={button:mR(qw,function(t,n,e,o){return function(t,n,e){return sR(t,n,[],e)}(t,n.shared.providers,o)}),togglebutton:mR(Kw,function(t,n,e,o){return function(t,n,e){return lR(t,n,[],e)}(t,n.shared.providers,o)}),menubutton:mR(TB,function(t,n,e,o){return HD(t,"tox-tbtn",n,G.none(),!1,o)}),splitbutton:mR(function(t){return xr("SplitButton",EB,t)},function(t,n,e,o){return function(t,n,e){var o=ho(t.tooltip.getOr("")),r=function(t){return{isEnabled:function(){return!vg.isDisabled(t)},setEnabled:function(n){return vg.set(t,!n)},setIconFill:function(n,e){ds(t.element,'svg path[class="'.concat(n,'"], rect[class="').concat(n,'"]')).each(function(t){Hn(t,"fill",e)})},setActive:function(n){Hn(t.element,"aria-pressed",n),ds(t.element,"span").each(function(e){t.getSystem().getByDom(e).each(function(t){return Xh.set(t,n)})})},isActive:function(){return ds(t.element,"span").exists(function(n){return t.getSystem().getByDom(n).exists(Xh.isOn)})},setText:function(n){return ds(t.element,"span").each(function(e){return t.getSystem().getByDom(e).each(function(t){return su(t,ZE,{text:n})})})},setIcon:function(n){return ds(t.element,"span").each(function(e){return t.getSystem().getByDom(e).each(function(t){return su(t,tD,{icon:n})})})},setTooltip:function(e){var r=n.providers.translate(e);Hn(t.element,"aria-label",r),o.set(e)}}},i=ho(I),u={getApi:r,onSetup:t.onSetup};return eR.sketch({dom:{tag:"div",classes:["tox-split-button"],attributes:_(_({"aria-pressed":!1},iR(t.tooltip,n.providers)),O(e)?{"data-mce-name":e}:{})},onExecute:function(n){var e=r(n);e.isEnabled()&&t.onAction(e)},onItemExecute:function(t,n,e){},splitDropdownBehaviours:zu([Rh("split-dropdown-events",[Ou(function(t,n){return XE(t)}),vu(uR,Hh.focus),ES(u,i),DS(u,i)]),OS(function(){return n.providers.isDisabled()||n.providers.checkUiComponentContext(t.context).shouldDisable}),IS(function(){return n.providers.checkUiComponentContext(t.context)}),t_.config({})].concat(w(t.tooltip.map(function(t){return ry.config(_({},n.providers.tooltips.getConfig({tooltipText:n.providers.translate(t),onShow:function(e){if(o.get()!==t){var r=n.providers.translate(o.get());ry.setComponents(e,n.providers.tooltips.getComponents({tooltipText:r}))}}})))}).toArray()))),eventOrder:T(T({},$i(),["alloy.base.behaviour","split-dropdown-events","tooltipping"]),Qi(),["split-dropdown-events","tooltipping"]),toggleClass:"tox-tbtn--enabled",lazySink:n.get
2Sink,fetch:fR(r,t,n.providers),parts:{menu:Gx(0,t.columns,t.presets)},components:[eR.parts.button(aR(t.icon,t.text,G.none(),G.some([Xh.config({toggleClass:"tox-tbtn--enabled",toggleOnExecute:!1}),_S(W),IS(N({contextType:"any",shouldDisable:!1}))]),n.providers,t.context)),eR.parts.arrow({dom:{tag:"button",classes:["tox-tbtn","tox-split-button__chevron"],innerHtml:vx("chevron-down",n.providers.icons)},buttonBehaviours:zu([OS(W),IS(N({contextType:"any",shouldDisable:!1}))])}),eR.parts["aria-descriptor"]({text:n.providers.translate("To open the popup, press Shift+Enter")})]})}(t,n.shared,o)}),grouptoolbarbutton:mR(function(t){return xr("GroupToolbarButton",kB,t)},function(t,n,e,o){var r=e.ui.registry.getAll().buttons,i=T({},Wl,n.shared.header.isPositionedAtTop()?dl.TopToBottom:dl.BottomToTop);if(Yv(e)===Cv.floating)return function(t,n,e,o,r){var i=n.shared,u=ho(I),a={toolbarButtonBehaviours:[],getApi:oR,onSetup:t.onSetup},c=[Rh("toolbar-group-button-events",[ES(a,u),DS(a,u)])];return dI.sketch({lazySink:i.getSink,fetch:function(){return Fk(function(n){n(nt(e(t.items),OI))})},markers:{toggledClass:"tox-tbtn--enabled"},parts:{button:aR(t.icon,t.text,t.tooltip,G.some(c),i.providers,t.context,r),toolbar:{dom:{tag:"div",classes:["tox-toolbar__overflow"],attributes:o}}}})}(t,n,function(t){return bR(e,{buttons:r,toolbar:t,allowToolbarGroups:!1},n,G.none())},i,o);throw new Error("Toolbar groups are only supported when using floating toolbar mode")})},pR={styles:function(t,n){var e=_({type:"advanced"},n.styles);return vF(t,n,$F(t,e),JF,"StylesTextUpdate","styles")},fontsize:function(t,n){return vF(t,n,KF(t),jF,"FontSizeTextUpdate","fontsize")},fontsizeinput:function(t,n){return WF(t,n,function(t){var n=function(){return t.queryCommandValue("FontSize")};return{updateInputValue:function(t){return su(t,ZE,{text:n()})},onAction:function(n,e){return t.execCommand("FontSize",!1,n,{skip_focus:!e})},getNewValue:function(e,o){VF(e,["unsupportedLength","empty"]);var r=n(),i=VF(e,["unsupportedLength","empty"]).or(VF(r,["unsupportedLength","empty"])),u=i.map(function(t){return t.value}).getOr(16),a=rb(t),c=i.map(function(t){return t.unit}).filter(function(t){return""!==t}).getOr(a),s=o(u,function(t){var n;return null!==(n={em:{step:.1},cm:{step:.1},in:{step:.1},pc:{step:.1},ch:{step:.1},rem:{step:.1}}[t])&&void 0!==n?n:{step:1}}(c).step),l="".concat(function(t){return t>=0}(s)?s:u).concat(c);return l!==r&&function(t,n){t.dispatch("FontSizeInputTextUpdate",n)}(t,{value:l}),l}}}(t),"fontsizeinput")},fontfamily:function(t,n){return vF(t,n,zF(t),IF,"FontFamilyTextUpdate","fontfamily")},blocks:function(t,n){return vF(t,n,BF(t),AF,"BlocksTextUpdate","blocks")},align:function(t,n){return vF(t,n,EF(t),OF,"AlignTextUpdate","align")}},hR=function(t){var n,e=t.toolbar,o=t.buttons;return!1===e?[]:void 0===e||!0===e?function(t){var n=nt(dR,function(n){var e=rt(n.items,function(n){return Ft(t,n)||Ft(pR,n)});return{name:n.name,items:e}});return rt(n,function(t){return t.items.length>0})}(o):f(e)?(n=e.split("|"),nt(n,function(t){return{items:t.trim().split(" ")}})):function(t){return B(t,function(t){return Ft(t,"name")&&Ft(t,"items")})}(e)?e:(console.error("Toolbar type should be string, string[], boolean or ToolbarGroup[]"),[])},vR=function(t,n,e,o,r,i){return It(n,e.toLowerCase()).orThunk(function(){return i.bind(function(t){return wt(t,function(t){return It(n,t+e.toLowerCase())})})}).fold(function(){return It(pR,e.toLowerCase()).map(function(n){return n(t,r)})},function(n){return"grouptoolbarbutton"!==n.type||o?function(t,n,e,o){return It(gR,t.type).fold(function(){return console.error("skipping button defined by",t),G.none()},function(r){return G.some(r(t,n,e,o))})}(n,r,t,e.toLowerCase()):(console.warn("Ignoring the '".concat(e,"' toolbar button. Group toolbar buttons are only supported when using floating toolbar mode and cannot be nested.")),G.none())})},bR=function(t,n,e,o){var r=hR(n),i=nt(r,function(r){var i=lt(r.items,function(r){return 0===r.trim().length?[]:vR(t,n.buttons,r,n.allowToolbarGroups,e,o).toArray()});return{title:G.from(t.translate(r.name)),items:i}});return rt(i,function(t){return t.items.length>0})},yR=function(t,n,e,o){var r=n.mainUi.outerContainer,i=e.toolbar,u=e.buttons;if(B(i,f)){var a=i.map(function(n){var r={toolbar:n,buttons:u,allowToolbarGroups:e.allowToolbarGroups};return bR(t,r,o,G.none())});eF.setToolbars(r,a)}else eF.setToolbar(r,bR(t,e,o,G.none()))},xR=Ge(),wR=xR.os.isiOS()&&xR.os.version.major<=12,SR=Object.freeze({__proto__:null,render:function(t,n,e,o,r){var i=n.mainUi,u=n.uiMotherships,a=ho(0),c=i.outerContainer;dF(t);var s=$t.fromDom(r.targetNode),l=Mn(An(s));pd(s,i.mothership),function(t,n,e){Ib(t)&&pd(e.mainUi.mothership.element,e.popupUi.mothership),gd(n,e.dialogUi.mothership)}(t,l,n),t.on("PostRender",function(){eF.setSidebar(c,e.sidebar,pb(t))}),t.on("SkinLoaded",function(){yR(t,n,e,o),a.set(t.getWin().innerWidth),eF.setMenubar(c,iF(t,e)),eF.setViews(c,e.views),function(t,n){var e=n.uiMotherships,o=t.dom,r=t.getW
2in(),i=t.getDoc().documentElement,u=ho(se(r.innerWidth,r.innerHeight)),a=ho(se(i.offsetWidth,i.offsetHeight)),c=function(){var n=u.get();n.left===r.innerWidth&&n.top===r.innerHeight||(u.set(se(r.innerWidth,r.innerHeight)),xC(t))},s=function(){var n=t.getDoc().documentElement,e=a.get();e.left===n.offsetWidth&&e.top===n.offsetHeight||(a.set(se(n.offsetWidth,n.offsetHeight)),xC(t))},l=function(n){!function(t,n){t.dispatch("ScrollContent",n)}(t,n)};o.bind(r,"resize",c),o.bind(r,"scroll",l);var f=Sl($t.fromDom(t.getBody()),"load",s);t.on("hide",function(){et(e,function(t){Xn(t.element,"display","none")})}),t.on("show",function(){et(e,function(t){ee(t.element,"display")})}),t.on("NodeChange",s),t.on("remove",function(){f.unbind(),o.unbind(r,"resize",c),o.unbind(r,"scroll",l),r=null})}(t,n)});var f,d,m,g=eF.getSocket(c).getOrDie("Could not find expected socket element");if(wR){Kn(g.element,{overflow:"scroll","-webkit-overflow-scrolling":"touch"});var p=(f=function(){t.dispatch("ScrollContent")},d=20,m=null,{cancel:function(){b(m)||(clearTimeout(m),m=null)},throttle:function(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];b(m)&&(m=setTimeout(function(){m=null,f.apply(null,n)},d))}}),h=wl(g.element,"scroll",p.throttle);t.on("remove",h.unbind)}BS(t,n),t.addCommand("ToggleSidebar",function(n,e){eF.toggleSidebar(c,e),function(t){t.dispatch("ToggleSidebar")}(t)}),t.addQueryValueHandler("ToggleSidebar",function(){var t;return null!==(t=eF.whichSidebar(c))&&void 0!==t?t:""}),t.addCommand("ToggleView",function(n,e){if(eF.toggleView(c,e)){var o=c.element;i.mothership.broadcastOn([Dd()],{target:o}),et(u,function(t){t.broadcastOn([Dd()],{target:o})}),b(eF.whichView(c))&&(t.focus(),t.nodeChanged(),eF.refreshToolbar(c)),function(t){t.dispatch("ToggleView")}(t)}}),t.addQueryValueHandler("ToggleView",function(){var t;return null!==(t=eF.whichView(c))&&void 0!==t?t:""});var v=Yv(t);v!==Cv.sliding&&v!==Cv.floating||t.on("ResizeWindow ResizeEditor ResizeContent",function(){var e=t.getWin().innerWidth;e!==a.get()&&(eF.refreshToolbar(n.mainUi.outerContainer),a.set(e))});var y={setEnabled:function(t){MS(n,t?"setEnabled":"setDisabled")},isEnabled:function(){return!vg.isDisabled(c)}};return{iframeContainer:g.element.dom,editorContainer:c.element.dom,api:y}}}),CR=function(t){return/^[0-9\.]+(|px)$/i.test(""+t)?G.some(parseInt(""+t,10)):G.none()},kR=function(t){return M(t)?t+"px":t},OR=function(t,n,e){var o=n.filter(function(n){return t<n}),r=e.filter(function(n){return t>n});return o.or(r).getOr(t)},_R=function(t){var n=function(t){var n=Nv(t),e=Pv(t),o=Vv(t);return CR(n).map(function(t){return OR(t,e,o)})}(t);return n.getOr(Nv(t))},TR=function(t){var n=Lv(t),e=zv(t),o=Hv(t);return CR(n).map(function(t){return OR(t,e,o)})},ER=Rb.ToolbarLocation,DR=Rb.ToolbarMode,AR=function(t,n,e,o,r){var i=e.mainUi,u=e.uiMotherships,a=Dv.DOM,c=Db(t),s=Bb(t),l=Hv(t).or(TR(t)),f=o.shared.header,d=f.isPositionedAtTop,m=Yv(t),g=m===DR.sliding||m===DR.floating,p=ho(!1),h=function(){return p.get()&&!t.removed},v=function(t){return g?t.fold(N(0),function(t){return t.components().length>1?ue(t.components()[1].element):0}):0},b=function(t,n){return Ib(t)?ia(n):G.none()},y=function(){et(u,function(t){t.broadcastOn([Ad()],{})})},x=function(e){if(h()){c||r.on(function(t){var e=l.getOrThunk(function(){return io().width-de(n).left-10});Xn(t.element,"max-width",e+"px")});var o=eo(),u=!c&&!(c||!(fe(i.outerContainer.element).left+pe(i.outerContainer.element)>=window.innerWidth-40||Zn(i.outerContainer.element,"width").isSome())||(Xn(i.outerContainer.element,"position","absolute"),Xn(i.outerContainer.element,"left","0px"),ee(i.outerContainer.element,"width"),0));if(g&&eF.refreshToolbar(i.outerContainer),!c){var a=eo(),f=Ht(o.left!==a.left,o);!function(e,o){r.on(function(r){var u=eF.getToolbar(i.outerContainer),a=v(u),c=fo(n),s=b(t,i.outerContainer.element),l=s.fold(function(){return c.x},function(t){var n=fo(t);return pn(t,Ln())?c.x:c.x-n.x}),f=Ht(e,Math.ceil(i.outerContainer.element.dom.getBoundingClientRect().width)).filter(function(t){return t>150}).map(function(t){var n=o.getOr(eo()),e=window.innerWidth-(l-n.left),r=Math.max(Math.min(t,e),150);return e<t&&Xn(i.outerContainer.element,"width",r+"px"),{width:r+"px"}}).getOr({width:"max-content"}),m={position:"absolute",left:Math.round(l)+"px",top:s.fold(function(){return d()?Math.max(c.y-ue(r.element)+a,0):c.bottom},function(t){var n,e=fo(t),o=null!==(n=t.dom.scrollTop)&&void 0!==n?n:0,i=pn(t,Ln())?Math.max(c.y-ue(r.element)+a,0):c.y-e.y+o-ue(r.element)+a;return d()?i:c.bottom})+"px"};Kn(i.outerContainer.element,_(_({},m),f))})}(u,f),f.each(function(t){oo(t.left,a.top)})}s&&r.on(e),y()}},w=function(){return!(c||!s||!h())&&r.get().exists(function(e){var o,u=f.getDockingMode(),a=function(e){switch(Kv(t)){case ER.auto:var o=eF.getToolbar(i.outerContainer),r=v(o),u=ue(e.element)-r,a=fo(n);if(a.y>u)return"top";var c=yn(n),s=Math.max(c.dom.scrollHeight,ue(c));return a.bottom<s-u||po().bottom<a.bottom-u?"bottom":"top";case ER.bottom:return"bottom";case ER.top:default:return"top"}}(e);return a!==u&&(o=a,r.on(function(t){ac.setModes(t,[o]),f.setDockingMode(o);
2var n=d()?dl.TopToBottom:dl.BottomToTop;Hn(t.element,Wl,n)}),!0)})};return{isVisible:h,isPositionedAtTop:d,show:function(){p.set(!0),Xn(i.outerContainer.element,"display","flex"),a.addClass(t.getBody(),"mce-edit-focus"),et(u,function(t){ee(t.element,"display")}),w(),Ib(t)?x(function(t){return ac.isDocked(t)?ac.reset(t):ac.refresh(t)}):x(ac.refresh)},hide:function(){p.set(!1),Xn(i.outerContainer.element,"display","none"),a.removeClass(t.getBody(),"mce-edit-focus"),et(u,function(t){Xn(t.element,"display","none")})},update:x,updateMode:function(){w()&&x(ac.reset)},repositionPopups:y}},MR=function(t,n){var e=fo(t);return{pos:n?e.y:e.bottom,bounds:e}},BR=Object.freeze({__proto__:null,render:function(t,n,e,o,r){var i=n.mainUi,u=yo(),a=$t.fromDom(r.targetNode),c=AR(t,a,n,o,u),s=Qv(t);mF(t);var l=function(){if(u.isSet())c.show();else{u.set(eF.getHeader(i.outerContainer).getOrDie());var r=Ab(t);Ib(t)?(pd(a,i.mothership),pd(a,n.popupUi.mothership)):gd(r,i.mothership),gd(r,n.dialogUi.mothership);var l=function(){yR(t,n,e,o),eF.setMenubar(i.outerContainer,iF(t,e)),c.show(),function(t,n,e,o){var r=ho(MR(n,e.isPositionedAtTop())),i=function(o){var i=MR(n,e.isPositionedAtTop()),u=i.pos,a=i.bounds,c=r.get(),s=c.pos,l=c.bounds,f=a.height!==l.height||a.width!==l.width;r.set({pos:u,bounds:a}),f&&xC(t,o),e.isVisible()&&(s!==u?e.update(ac.reset):f&&(e.updateMode(),e.repositionPopups()))};o||(t.on("activate",e.show),t.on("deactivate",e.hide)),t.on("SkinLoaded ResizeWindow",function(){return e.update(ac.reset)}),t.on("NodeChange keydown",function(t){requestAnimationFrame(function(){return i(t)})});var u=0,a=yE(function(){return e.update(ac.refresh)},33);t.on("ScrollWindow",function(){var t=eo().left;t!==u&&(u=t,a.throttle()),e.updateMode()}),Ib(t)&&t.on("ElementScroll",function(t){e.update(ac.refresh)});var c=bo();c.set(Sl($t.fromDom(t.getBody()),"load",function(t){return i(t.raw)})),t.on("remove",function(){c.clear()})}(t,a,c,s),t.nodeChanged()};s?t.once("SkinLoaded",l):l()}};t.on("show",l),t.on("hide",c.hide),s||(t.on("focus",l),t.on("blur",c.hide)),t.on("init",function(){(t.hasFocus()||s)&&l()}),BS(t,n);var f={show:l,hide:c.hide,setEnabled:function(t){MS(n,t?"setEnabled":"setDisabled")},isEnabled:function(){return!vg.isDisabled(i.outerContainer)}};return{editorContainer:i.outerContainer.element.dom,api:f}}}),IR="contexttoolbar-hide",FR=function(t,n){return vu(GE,function(e,o){var r=function(t){return{hide:function(){return cu(t,ji())},getValue:function(){return Xd.getValue(t)}}}(t.get(e));n.onAction(r,o.event.buttonApi)})},RR=function(t,n,e){return function(t){return"contextformtogglebutton"===t.type}(n)?function(t,n,e){var o=n.original,i=(o.primary,x(o,r)),u=wr(Kw(_(_({},i),{},{type:"togglebutton",onAction:I})));return lR(u,e,[FR(t,n)])}(t,n,e):function(t,n,e){var r=n.original,i=(r.primary,x(r,o)),u=wr(qw(_(_({},i),{},{type:"button",onAction:I})));return sR(u,e,[FR(t,n)])}(t,n,e)},NR=function(t,n){var e=t.label.fold(function(){return{}},function(t){return{"aria-label":t}}),o=jb(Jx.sketch({inputClasses:["tox-toolbar-textfield","tox-toolbar-nav-js"],data:t.initValue(),inputAttributes:e,selectOnFocus:!0,inputBehaviours:zu([vg.config({disabled:function(){return n.checkUiComponentContext("mode:design").shouldDisable}}),IS(function(){return n.checkUiComponentContext("mode:design")}),Oh.config({mode:"special",onEnter:function(t){return r.findPrimary(t).map(function(t){return lu(t),!0})},onLeft:function(t,n){return n.cut(),G.none()},onRight:function(t,n){return n.cut(),G.none()}})])})),r=function(t,n,e){var o=nt(n,function(n){return jb(RR(t,n,e))});return{asSpecs:function(){return nt(o,function(t){return t.asSpec()})},findPrimary:function(t){return wt(n,function(n,e){return n.primary?G.from(o[e]).bind(function(n){return n.getOpt(t)}).filter(H(vg.isDisabled)):G.none()})}}}(o,t.commands,n);return[{title:G.none(),items:[o.asSpec()]},{title:G.none(),items:r.asSpecs()}]},LR=NR,zR=function(t,n,e){return n.bottom-t.y>=e&&t.bottom-n.y>=e},PR=function(t){var n=function(t){var n=t.getBoundingClientRect();if(n.height<=0&&n.width<=0){var e=En($t.fromDom(t.startContainer),t.startOffset).element;return(cn(e)?wn(e):G.some(e)).filter(an).map(function(t){return t.dom.getBoundingClientRect()}).getOr(n)}return n}(t.selection.getRng());if(t.inline){var e=eo();return lo(e.left+n.left,e.top+n.top,n.width,n.height)}var o=mo($t.fromDom(t.getBody()));return lo(o.x+n.left,o.y+n.top,n.width,n.height)},HR=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=io(window),i=fo($t.fromDom(t.getContentAreaContainer())),u=xb(t)||kb(t)||_b(t),a=function(t,n,e){var o=Math.max(t.x+e,n.x);return{x:o,width:Math.min(t.right-e,n.right)-o}}(i,r,o),c=a.x,s=a.width;if(t.inline&&!u)return lo(c,r.y,s,r.height);var l=function(t,n,e,o,r,i){var u=$t.fromDom(t.getContainer()),a=ds(u,".tox-editor-header").getOr(u),c=fo(a),s=c.y>=n.bottom,l=o&&!s;if(t.inline&&l)return{y:Math.max(c.bottom+i,e.y),bottom:e.bottom};
2if(t.inline&&!l)return{y:e.y,bottom:Math.min(c.y-i,e.bottom)};var f="line"===r?fo(u):n;return l?{y:Math.max(c.bottom+i,e.y),bottom:Math.min(f.bottom-i,e.bottom)}:{y:Math.max(f.y+i,e.y),bottom:Math.min(c.y-i,e.bottom)}}(t,i,r,n.header.isPositionedAtTop(),e,o),f=l.y,d=l.bottom;return lo(c,f,s,d-f)},VR={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"]},UR={maxHeightFunction:Fl(),maxWidthFunction:iI()},WR=function(t){return"node"===t},jR=function(t,n,e,o,r){var i=PR(t),u=o.lastElement().exists(function(t){return pn(e,t)});return function(t,n){var e=t.selection.getRng(),o=En($t.fromDom(e.startContainer),e.startOffset);return e.startContainer===e.endContainer&&e.startOffset===e.endOffset-1&&pn(o.element,n)}(t,e)?u?rM:ZA:u?function(t,n,e){var o=Zn(t,"position");Xn(t,"position",n);var r=e(t);return o.each(function(n){return Xn(t,"position",n)}),r}(n,o.getMode(),function(){return zR(i,fo(n),-20)&&!o.isReposition()?uM:rM}):("fixed"===o.getMode()?r.y+eo().top:r.y)+(ue(n)+12)<=i.y?ZA:tM},GR=function(t,n,e,o){var r=function(n){return function(o,r,i,u,a){var c=jR(t,u,n,e,a),s=_(_({},o),{},{y:a.y,height:a.height});return _(_({},c(s,r,i,u,a)),{},{alwaysFit:!0})}},i=function(t){return WR(o)?[r(t)]:[]};return n?{onLtr:function(t){return[Vs,Ns,Ls,zs,Ps,Hs].concat(i(t))},onRtl:function(t){return[Vs,Ls,Ns,Ps,zs,Hs].concat(i(t))}}:{onLtr:function(t){return[Hs,Vs,zs,Ns,Ps,Ls].concat(i(t))},onRtl:function(t){return[Hs,Vs,Ps,Ls,zs,Ns].concat(i(t))}}},qR=function(t,n){var e=rt(n,function(n){return n.predicate(t.dom)}),o=ot(e,function(t){return"contexttoolbar"===t.type});return{contextToolbars:o.pass,contextForms:o.fail}},YR=function(t,n,e){var o=qR(t,n);if(o.contextForms.length>0)return G.some({elem:t,toolbars:[o.contextForms[0]]});var r=qR(t,e);if(r.contextForms.length>0)return G.some({elem:t,toolbars:[r.contextForms[0]]});if(o.contextToolbars.length>0||r.contextToolbars.length>0){var i=function(t){if(t.length<=1)return t;var n=function(n){return Q(t,function(t){return t.position===n})},e=function(n){return rt(t,function(t){return t.position===n})},o=n("selection"),r=n("node");if(o||r){if(r&&o){var i=e("node"),u=nt(e("selection"),function(t){return _(_({},t),{},{position:"node"})});return i.concat(u)}return e(o?"selection":"node")}return e("line")}(o.contextToolbars.concat(r.contextToolbars));return G.some({elem:t,toolbars:i})}return G.none()},XR=function(t,n,e){return t(n)?G.none():ai(n,function(t){if(an(t)){var n=qR(t,e.inNodeScope),o=n.contextToolbars,r=n.contextForms,i=r.length>0?r:function(t){if(t.length<=1)return t;var n=function(n){return at(t,function(t){return t.position===n})},e=n("selection").orThunk(function(){return n("node")}).orThunk(function(){return n("line")}).map(function(t){return t.position});return e.fold(function(){return[]},function(n){return rt(t,function(t){return t.position===n})})}(o);return i.length>0?G.some({elem:t,toolbars:i}):G.none()}return G.none()},t)},KR=function(t,n){var e={},o=[],r=[],i={},u={},a=function(t,a){var c=wr(xr("ContextForm",eS,a));e[t]=c,c.launch.map(function(e){i["form:"+t]=_(_({},a.launch),{},{type:"contextformtogglebutton"===e.type?"togglebutton":"button",onAction:function(){n(c)}})}),"editor"===c.scope?r.push(c):o.push(c),u[t]=c},c=function(t,n){var e;(e=n,xr("ContextToolbar",oS,e)).each(function(e){"editor"===n.scope?r.push(e):o.push(e),u[t]=e})},s=St(t);return et(s,function(n){var e=t[n];"contextform"===e.type?a(n,e):"contexttoolbar"===e.type&&c(n,e)}),{forms:e,inNodeScope:o,inEditorScope:r,lookupTable:u,formNavigators:i}},JR=mc("forward-slide"),$R=mc("backward-slide"),QR=mc("change-slide-event"),ZR="tox-pop--resizing",tN="tox-pop--transition",nN=function(t,n,e,o){var r,i,u=o.backstage,a=u.shared,c=Ge().deviceType.isTouch,s=yo(),l=yo(),f=yo(),d=es((r={sink:e,onEscape:function(){return t.focus(),G.some(!0)}},i=ho([]),Tv.sketch({dom:{tag:"div",classes:["tox-pop"]},fireDismissalEventInstead:{event:"doNotDismissYet"},onShow:function(t){i.set([]),Tv.getContent(t).each(function(t){ee(t.element,"visibility")}),$u(t.element,ZR),ee(t.element,"width")},inlineBehaviours:zu([Rh("context-toolbar-events",[ku(Mi(),function(t,n){"width"===n.event.raw.propertyName&&($u(t.element,ZR),ee(t.element,"width"))}),vu(QR,function(t,n){var e=t.element;ee(e,"width");var o=ge(e);Tv.setContent(t,n.event.contents),Ku(e,ZR);var r=ge(e);Xn(e,"width",o+"px"),Tv.getContent(t).each(function(t){n.event.focus.bind(function(t){return tl(t),rl(e)}).orThunk(function(){return Oh.focusIn(t),ol(An(e))})}),setTimeout(function(){Xn(t.element,"width",r+"px")},0)}),vu(JR,function(t,n){Tv.getContent(t).each(function(n){i.set(i.get().concat([{bar:n,focus:ol(An(t.element))}]))}),su(t,QR,{contents:n.event.forwardContents,focus:G.none()})}),vu($R,function(t,n){yt(i.get()).each(function(n){i.set(i.get().slice(0,i.get().length-1)),su(t,QR,{contents:os(n.bar),focus:n.focus})})})]),Oh.config({mode:"special",onEscape:function(t){return yt(i.get()).fold(function(){return r.onEscape()},function(n){return cu(t,$R),G.some(!0)})}})]),lazySink:function(){return Co.value(r.sink)}}))),m=function(){var n=f.get().getOr("node"),e=WR(n)?1:0;return HR(t,a,n,e)}
2,g=function(){return!(t.removed||c()&&u.isContextMenuOpen())},p=function(){if(g()){var n=m(),e=Nt(f.get(),"node")?function(t,n){return n.filter(function(t){return Nn(t)&&un(t)}).map(mo).getOrThunk(function(){return PR(t)})}(t,s.get()):PR(t);return n.height<=0||!zR(e,n,.01)}return!0},h=function(){s.clear(),l.clear(),f.clear(),Tv.hide(d)},v=function(){if(Tv.isOpen(d)){var t=d.element;ee(t,"display"),p()?Xn(t,"display","none"):(l.set(0),Tv.reposition(d))}},b=function(n){return{dom:{tag:"div",classes:["tox-pop__dialog"]},components:[n],behaviours:zu([Oh.config({mode:"acyclic"}),Rh("pop-dialog-wrap-events",[Ou(function(n){t.shortcuts.add("ctrl+F9","focus statusbar",function(){return Oh.focusIn(n)})}),_u(function(n){t.shortcuts.remove("ctrl+F9")})])])}},y=he(function(){return KR(n,function(t){var n=x([t]);su(d,JR,{forwardContents:b(n)})})}),x=function(n){var e=t.ui.registry.getAll().buttons,r=y(),i=_(_({},e),r.formNavigators),u=Yv(t)===Cv.scrolling?Cv.scrolling:Cv.default,c=st(nt(n,function(n){return"contexttoolbar"===n.type?function(n,e){return bR(t,{buttons:n,toolbar:e.items,allowToolbarGroups:!1},o.backstage,G.some(["form:"]))}(i,n):function(t,n){return LR(t,n)}(n,a.providers)}));return AI({type:u,uid:mc("context-toolbar"),initGroups:c,onEscape:G.none,cyclicKeying:!0,providers:a.providers})},w=function(n,o){var r="node"===n?a.anchors.node(o):a.anchors.cursor(),i=function(t,n,e,o){return"line"===n?{bubble:zl(12,0,VR),layouts:{onLtr:function(){return[Us]},onRtl:function(){return[Ws]}},overrides:UR}:{bubble:zl(0,12,VR,1/12),layouts:GR(t,e,o,n),overrides:UR}}(t,n,c(),{lastElement:s.get,isReposition:function(){return Nt(l.get(),0)},getMode:function(){return nd.getMode(e)}});return Ho(r,i)},S=function(t,n){if(k.cancel(),g()){var o=x(t),r=t[0].position,i=w(r,n);f.set(r),l.set(1);var u=d.element;ee(u,"display"),function(t){return Nt(zt(t,s.get(),pn),!0)}(n)||($u(u,tN),nd.reset(e,d)),Tv.showWithinBounds(d,b(o),{anchor:i,transition:{classes:[tN],mode:"placement"}},function(){return G.some(m())}),n.fold(s.clear,s.set),p()&&Xn(u,"display","none")}},C=!1,k=yE(function(){!t.hasFocus()||t.removed||C||(Zu(d.element,tN)?k.throttle():function(t,n){var e=$t.fromDom(n.getBody()),o=function(t){return pn(t,e)},r=$t.fromDom(n.selection.getNode());return function(t){return!o(t)&&!hn(e,t)}(r)?G.none():YR(r,t.inNodeScope,t.inEditorScope).orThunk(function(){return XR(o,r,t)})}(y(),t).fold(h,function(t){S(t.toolbars,G.some(t.elem))}))},17);t.on("init",function(){t.on("remove",h),t.on("ScrollContent ScrollWindow ObjectResized ResizeEditor longpress",v),t.on("click keyup focus SetContent",k.throttle),t.on(IR,h),t.on("contexttoolbar-show",function(n){var e=y();It(e.lookupTable,n.toolbarKey).each(function(e){S([e],Ht(n.target!==t,n.target)),Tv.getContent(d).each(Oh.focusIn)})}),t.on("focusout",function(n){Ev.setEditorTimeout(t,function(){rl(e.element).isNone()&&rl(d.element).isNone()&&h()},0)}),t.on("SwitchMode",function(){t.mode.isReadOnly()&&h()}),t.on("ExecCommand",function(t){"toggleview"===t.command.toLowerCase()&&h()}),t.on("AfterProgressState",function(n){n.state?h():t.hasFocus()&&k.throttle()}),t.on("dragstart",function(){C=!0}),t.on("dragend drop",function(){C=!1}),t.on("NodeChange",function(t){rl(d.element).fold(k.throttle,I)})})},eN=function(t,n){var e=function(){var e=n.getOptions(t),o=n.getCurrent(t).map(n.hash),r=yo();return nt(e,function(e){return{type:"togglemenuitem",text:n.display(e),onSetup:function(i){var u=function(t){t&&(r.on(function(t){return t.setActive(!1)}),r.set(i)),i.setActive(t)};u(Nt(o,n.hash(e)));var a=n.watcher(t,e,u);return function(){r.clear(),a()}},onAction:function(){return n.setCurrent(t,e)}}})};t.ui.registry.addMenuButton(n.name,{tooltip:n.text,icon:n.icon,fetch:function(t){return t(e())},onSetup:n.onToolbarSetup}),t.ui.registry.addNestedMenuItem(n.name,{type:"nestedmenuitem",text:n.text,getSubmenuItems:e,onSetup:n.onMenuSetup})},oN=function(t){return{name:"lineheight",text:"Line height",icon:"line-height",getOptions:Cb,hash:function(t){return function(t,n){return VF(t,n).map(function(t){return t.value+t.unit})}(t,["fixed","relative","empty"]).getOr(t)},display:L,watcher:function(t,n,e){return t.formatter.formatChanged("lineheight",e,!1,{value:n}).unbind},getCurrent:function(t){return G.from(t.queryCommandValue("LineHeight"))},setCurrent:function(t,n){return t.execCommand("LineHeight",!1,n)},onToolbarSetup:kC(t),onMenuSetup:kC(t)}},rN=function(t){eN(t,oN(t)),function(t){return G.from(Gv(t)).map(function(n){return{name:"language",text:"Language",icon:"language",getOptions:N(n),hash:function(t){return C(t.customCode)?t.code:"".concat(t.code,"/").concat(t.customCode)},display:function(t){return t.title},watcher:function(t,n,e){var o;return t.formatter.formatChanged("lang",e,!1,{value:n.code,customValue:null!==(o=n.customCode)&&void 0!==o?o:null}).unbind},getCurrent:function(t){var n=$t.fromDom(t.selection.getNode());return ci(n,function(t){return G.some(t).filter(an).bind(function(t){return Wn(t,"lang").map(function(n){return{code:n,customCode:Wn(t,"data-mce-lang").getOrUndefined(),title:""}})})})},setCurrent:function(t,n){return t.execCommand("Lang",!1,n)},onToolbarSetup:function(n){var e=bo();return n.setActive(t.formatter.match("lang",{},void 0,!0)),e.set(t.formatter.formatChanged("lang",n.setActive,!0)),CC(e.clear,kC(t)(n))},onMenuSetup:kC(t)}})}
2(t).each(function(n){return eN(t,n)})},iN=function(t,n){!function(t,n){var e=hF(n,EF(t));t.ui.registry.addNestedMenuItem("align",{text:n.shared.providers.translate("Align"),onSetup:kC(t),getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(t,n),function(t,n){var e=hF(n,zF(t));t.ui.registry.addNestedMenuItem("fontfamily",{text:n.shared.providers.translate("Fonts"),onSetup:kC(t),getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(t,n),function(t,n){var e=_({type:"advanced"},n.styles),o=hF(n,$F(t,e));t.ui.registry.addNestedMenuItem("styles",{text:"Formats",onSetup:kC(t),getSubmenuItems:function(){return o.items.validateItems(o.getStyleItems())}})}(t,n),function(t,n){var e=hF(n,BF(t));t.ui.registry.addNestedMenuItem("blocks",{text:"Blocks",onSetup:kC(t),getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(t,n),function(t,n){var e=hF(n,KF(t));t.ui.registry.addNestedMenuItem("fontsize",{text:"Font sizes",onSetup:kC(t),getSubmenuItems:function(){return e.items.validateItems(e.getStyleItems())}})}(t,n)},uN=function(t){return _C(t,"NodeChange",function(n){n.setEnabled(t.queryCommandState("outdent")&&t.selection.isEditable())})},aN=function(t){!function(t){t.ui.registry.addButton("outdent",{tooltip:"Decrease indent",icon:"outdent",onSetup:uN(t),onAction:EC(t,"outdent")}),t.ui.registry.addButton("indent",{tooltip:"Increase indent",icon:"indent",onSetup:kC(t),onAction:EC(t,"indent")})}(t)},cN=function(t,n){return function(e){e.setActive(n.get());var o=function(t){n.set(t.state),e.setActive(t.state)};return t.on("PastePlainTextToggle",o),CC(function(){return t.off("PastePlainTextToggle",o)},kC(t)(e))}},sN=function(t,n){return function(){t.execCommand("mceToggleFormat",!1,n)}},lN=function(t){!function(t){hE.each([{name:"bold",text:"Bold",icon:"bold",shortcut:"Meta+B"},{name:"italic",text:"Italic",icon:"italic",shortcut:"Meta+I"},{name:"underline",text:"Underline",icon:"underline",shortcut:"Meta+U"},{name:"strikethrough",text:"Strikethrough",icon:"strike-through"},{name:"subscript",text:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",icon:"superscript"}],function(n,e){t.ui.registry.addToggleButton(n.name,{tooltip:n.text,icon:n.icon,onSetup:OC(t,n.name),onAction:sN(t,n.name),shortcut:n.shortcut})});for(var n=1;n<=6;n++){var e="h"+n,o="Access+".concat(n);t.ui.registry.addToggleButton(e,{text:e.toUpperCase(),tooltip:"Heading "+n,onSetup:OC(t,e),onAction:sN(t,e),shortcut:o})}}(t),function(t){hE.each([{name:"copy",text:"Copy",action:"Copy",icon:"copy",context:"any"},{name:"help",text:"Help",action:"mceHelp",icon:"help",shortcut:"Alt+0",context:"any"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A",context:"any"},{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"print",text:"Print",action:"mcePrint",icon:"print",shortcut:"Meta+P",context:"any"}],function(n){t.ui.registry.addButton(n.name,{tooltip:n.text,icon:n.icon,onAction:EC(t,n.action),shortcut:n.shortcut,context:n.context})}),hE.each([{name:"cut",text:"Cut",action:"Cut",icon:"cut"},{name:"paste",text:"Paste",action:"Paste",icon:"paste"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"remove",text:"Remove",action:"Delete",icon:"remove"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],function(n){t.ui.registry.addButton(n.name,{tooltip:n.text,icon:n.icon,onSetup:kC(t),onAction:EC(t,n.action)})})}(t),function(t){hE.each([{name:"blockquote",text:"Blockquote",action:"mceBlockQuote",icon:"quote"}],function(n){t.ui.registry.addToggleButton(n.name,{tooltip:n.text,icon:n.icon,onAction:EC(t,n.action),onSetup:OC(t,n.name)})})}(t)},fN=function(t){lN(t),function(t){hE.each([{name:"newdocument",text:"New document",action:"mceNewDocument",icon:"new-document"},{name:"copy",text:"Copy",action:"Copy",icon:"copy",shortcut:"Meta+C",context:"any"},{name:"selectall",text:"Select all",action:"SelectAll",icon:"select-all",shortcut:"Meta+A",context:"any"},{name:"print",text:"Print...",action:"mcePrint",icon:"print",shortcut:"Meta+P",context:"any"}],function(n){t.ui.registry.addMenuItem(n.name,{text:n.text,icon:n.icon,shortcut:n.shortcut,onAction:EC(t,n.action),context:n.context})}),hE.each([{name:"bold",text:"Bold",action:"Bold",icon:"bold",shortcut:"Meta+B"}
2,{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"},{name:"subscript",text:"Subscript",action:"Subscript",icon:"subscript"},{name:"superscript",text:"Superscript",action:"Superscript",icon:"superscript"},{name:"removeformat",text:"Clear formatting",action:"RemoveFormat",icon:"remove-formatting"},{name:"cut",text:"Cut",action:"Cut",icon:"cut",shortcut:"Meta+X"},{name:"paste",text:"Paste",action:"Paste",icon:"paste",shortcut:"Meta+V"},{name:"hr",text:"Horizontal line",action:"InsertHorizontalRule",icon:"horizontal-rule"}],function(n){t.ui.registry.addMenuItem(n.name,{text:n.text,icon:n.icon,shortcut:n.shortcut,onSetup:kC(t),onAction:EC(t,n.action)})}),t.ui.registry.addMenuItem("codeformat",{text:"Code",icon:"sourcecode",onSetup:kC(t),onAction:sN(t,"code")})}(t)},dN=function(t,n){return _C(t,"Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(e){e.setEnabled(!t.mode.isReadOnly()&&t.undoManager[n]())})},mN=function(t){!function(t){t.ui.registry.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onSetup:dN(t,"hasUndo"),onAction:EC(t,"undo")}),t.ui.registry.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onSetup:dN(t,"hasRedo"),onAction:EC(t,"redo")})}(t),function(t){t.ui.registry.addButton("undo",{tooltip:"Undo",icon:"undo",enabled:!1,onSetup:dN(t,"hasUndo"),onAction:EC(t,"undo"),shortcut:"Meta+Z"}),t.ui.registry.addButton("redo",{tooltip:"Redo",icon:"redo",enabled:!1,onSetup:dN(t,"hasRedo"),onAction:EC(t,"redo"),shortcut:"Meta+Y"})}(t)},gN=function(t){return _C(t,"VisualAid",function(n){n.setActive(t.hasVisual)})},pN=function(t){!function(t){t.ui.registry.addButton("visualaid",{tooltip:"Visual aids",text:"Visual aids",onAction:EC(t,"mceToggleVisualAid"),context:"any"})}(t),function(t){t.ui.registry.addToggleMenuItem("visualaid",{text:"Visual aids",onSetup:gN(t),onAction:EC(t,"mceToggleVisualAid"),context:"any"})}(t)},hN=function(t,n){!function(t){et([{name:"alignleft",text:"Align left",cmd:"JustifyLeft",icon:"align-left"},{name:"aligncenter",text:"Align center",cmd:"JustifyCenter",icon:"align-center"},{name:"alignright",text:"Align right",cmd:"JustifyRight",icon:"align-right"},{name:"alignjustify",text:"Justify",cmd:"JustifyFull",icon:"align-justify"}],function(n){t.ui.registry.addToggleButton(n.name,{tooltip:n.text,icon:n.icon,onAction:EC(t,n.cmd),onSetup:OC(t,n.name)})}),t.ui.registry.addButton("alignnone",{tooltip:"No alignment",icon:"align-none",onSetup:kC(t),onAction:EC(t,"JustifyNone")})}(t),fN(t),iN(t,n),mN(t),function(t){!function(t){t.addCommand("mceApplyTextcolor",function(n,e){!function(t,n,e){t.undoManager.transact(function(){t.focus(),t.formatter.apply(n,{value:e}),t.nodeChanged()})}(t,n,e)}),t.addCommand("mceRemoveTextcolor",function(n){!function(t,n){t.undoManager.transact(function(){t.focus(),t.formatter.remove(n,{value:null},void 0,!0),t.nodeChanged()})}(t,n)})}(t);var n=XC(t),e=KC(t),o=ho(n),r=ho(e);uk(t,"forecolor","forecolor",o),uk(t,"backcolor","hilitecolor",r),ak(t,"forecolor","forecolor","Text color",o),ak(t,"backcolor","hilitecolor","Background color",r)}(t),pN(t),aN(t),rN(t),function(t){var n=ho(gb(t)),e=function(){return t.execCommand("mceTogglePlainTextPaste")};t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:e,onSetup:cN(t,n)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:e,onSetup:cN(t,n)})}(t),function(t){t.ui.registry.addContext("editable",function(){return t.selection.isEditable()}),t.ui.registry.addContext("mode",function(n){return t.mode.get()===n}),t.ui.registry.addContext("any",j),t.ui.registry.addContext("formatting",function(n){return t.formatter.canApply(n)}),t.ui.registry.addContext("insert",function(n){return t.schema.isValidChild(t.selection.getNode().tagName,n)})}(t)},vN=function(t){return f(t)?t.split(/[ ,]/):t},bN=function(t){return function(n){return n.options.get(t)}},yN=bN("contextmenu_never_use_native"),xN=bN("contextmenu_avoid_overlap"),wN=function(t){var n=t.ui.registry.getAll().contextMenus,e=t.options.get("contextmenu");return t.options.isSet("contextmenu")?e:rt(e,function(t){return Ft(n,t)})},SN=function(t,n){return{type:"makeshift",x:t,y:n}},CN=function(t){return"longpress"===t.type||0===t.type.indexOf("touch")},kN=function(t,n){var e=Dv.DOM.getPos(t);return function(t,n,e){return SN(t.x+n,t.y+e)}(n,e.x,e.y)},ON=function(t,n){return"contextmenu"===n.type||"longpress"===n.type?t.inline?function(t){if(CN(t)){var n=t.touches[0];return SN(n.pageX,n.pageY)}return SN(t.pageX,t.pageY)}(n):kN(t.getContentAreaContainer(),function(t){if(CN(t)){var n=t.touches[0];return SN(n.clientX,n.clientY)}return SN(t.clientX,t.clientY)}(n)):_N(t)},_N=function(t){return{type:"selection",root:$t.fromDom(t.selection.getNode())}},TN=function(t,n,e){switch(e){case"node":return function(t){return{type:"node",node:G.some($t.fromDom(t.selection.getNode())),root:$t.fromDom(t.getBody())}}(t);case"point":return ON(t,n);case"selection":return _N(t)}},EN=function(t,n,e,o,r,i){var u=e(),a=TN(t,n,i);aD(u,Tx.CLOSE_ON_EXECUTE,o,{isHorizontalMenu:!1,search:G.none()}).map(function(t){n.preventDefault(),Tv.showMenuAt(r,{anchor:a},{menu:{markers:Ux("normal")},data:t})})},DN={onLtr:function(){return[Vs,Ns,Ls,zs,Ps,Hs,ZA,tM,QA,JA,$A,KA]},onRtl:function(){return[Vs,Ls,Ns,Ps,zs,Hs,ZA,tM,$A,KA,QA,JA]}},AN={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"]},MN=function(t,n,e,o,r,i,u){var a=function(t,n,e){var o=TN(t,n,e);return _({bubble:zl(0,"point"===e?12:0,AN),layouts:DN,overrides:{maxWidthFunction:iI(),maxHeightFunction:Fl()}},o)}(t,n,i);aD(e,Tx.CLOSE_ON_EXECUTE,o,{isHorizontalMenu:!0,search:G.none()}).map(function(e){n.preventDefault();var c=u?Qg.HighlightMenuAndItem:Qg.HighlightNone;Tv.showMenuWithinBounds(r,{anchor:a},{menu:{markers:Ux("normal"),highlightOnOpen:c},data:e,type:"horizontal"},function(){return G.some(HR(t,o.shared,"node"===i?"node":"selection"))}
2),t.dispatch(IR)})},BN=function(t,n,e,o,r,i){var u=Ge(),a=u.os.isiOS(),c=u.os.isMacOS(),s=u.os.isAndroid(),l=u.deviceType.isTouch(),f=function(){var u=e();MN(t,n,u,o,r,i,!(s||a||c&&l))};if((c||a)&&"node"!==i){var d=function(){!function(t){var n=t.selection.getRng(),e=function(){Ev.setEditorTimeout(t,function(){t.selection.setRng(n)},10),i()};t.once("touchend",e);var o=function(t){t.preventDefault(),t.stopImmediatePropagation()};t.on("mousedown",o,!0);var r=function(){return i()};t.once("longpresscancel",r);var i=function(){t.off("touchend",e),t.off("longpresscancel",r),t.off("mousedown",o)}}(t),f()};!function(t,n){var e=t.selection;if(e.isCollapsed()||n.touches.length<1)return!1;var o=n.touches[0],r=e.getRng();return _f(t.getWin(),ff.domRange(r)).exists(function(t){return t.left<=o.clientX&&t.right>=o.clientX&&t.top<=o.clientY&&t.bottom>=o.clientY})}(t,n)?(t.once("selectionchange",d),t.once("touchend",function(){return t.off("selectionchange",d)})):d()}else f()},IN=function(t){return f(t)?"|"===t:"separator"===t.type},FN={type:"separator"},RN=function(t){var n=function(t){return{text:t.text,icon:t.icon,enabled:t.enabled,shortcut:t.shortcut}};if(f(t))return t;switch(t.type){case"separator":return FN;case"submenu":return _(_({type:"nestedmenuitem"},n(t)),{},{getSubmenuItems:function(){var n=t.getSubmenuItems();return f(n)?n:nt(n,RN)}});default:var e=t;return _(_({type:"menuitem"},n(e)),{},{onAction:F(e.onAction)})}},NN=function(t,n){if(0===n.length)return t;var e=yt(t).filter(function(t){return!IN(t)}),o=e.fold(function(){return[]},function(t){return[FN]});return t.concat(o).concat(n).concat([FN])},LN=function(t,n){return!function(t){return"longpress"===t.type||Ft(t,"touches")}(n)&&(2!==n.button||n.target===t.getBody()&&""===n.pointerType)},zN=function(t,n){return LN(t,n)?t.selection.getStart(!0):n.target},PN=function(t,n,e){var o=Ge().deviceType.isTouch,r=es(Tv.sketch({dom:{tag:"div"},lazySink:n,onEscape:function(){return t.focus()},onShow:function(){return e.setContextMenuState(!0)},onHide:function(){return e.setContextMenuState(!1)},fireDismissalEventInstead:{},inlineBehaviours:zu([Rh("dismissContextMenu",[vu(Zi(),function(n,e){Ed.close(n),t.focus()})])])})),i=function(){return Tv.hide(r)},u=function(n){if(yN(t)&&n.preventDefault(),!function(t,n){return n.ctrlKey&&!yN(t)}(t,n)&&!function(t){return 0===wN(t).length}(t)){var i=function(t,n){var e=xN(t),o=LN(t,n)?"selection":"point";if(Yt(e)){var r=zN(t,n);return lO($t.fromDom(r),e)?"node":o}return o}(t,n);(o()?BN:EN)(t,n,function(){var e=zN(t,n),o=t.ui.registry.getAll(),r=wN(t);return function(t,n,e){var o=ut(n,function(n,o){return It(t,o.toLowerCase()).map(function(t){var o=t.update(e);if(f(o)&&Yt(qt(o)))return NN(n,o.split(" "));if(g(o)&&o.length>0){var r=nt(o,RN);return NN(n,r)}return n}).getOrThunk(function(){return n.concat([o])})},[]);return o.length>0&&IN(o[o.length-1])&&o.pop(),o}(o.contextMenus,r,e)},e,r,i)}};t.on("init",function(){var n="ResizeEditor ScrollContent ScrollWindow longpresscancel"+(o()?"":" ResizeWindow");t.on(n,i),t.on("longpress contextmenu",u)})},HN=ti([{offset:["x","y"]},{absolute:["x","y"]},{fixed:["x","y"]}]),VN=function(t){return function(n){return n.translate(-t.left,-t.top)}},UN=function(t){return function(n){return n.translate(t.left,t.top)}},WN=function(t){return function(n,e){return ut(t,function(t,n){return n(t)},se(n,e))}},jN=function(t,n,e){return t.fold(WN([UN(e),VN(n)]),WN([VN(n)]),WN([]))},GN=function(t,n,e){return t.fold(WN([UN(e)]),WN([]),WN([UN(n)]))},qN=function(t,n,e){return t.fold(WN([]),WN([VN(e)]),WN([UN(n),VN(e)]))},YN=function(t,n,e){var o=t.fold(function(t,n){return{position:G.some("absolute"),left:G.some(t+"px"),top:G.some(n+"px")}},function(t,n){return{position:G.some("absolute"),left:G.some(t-e.left+"px"),top:G.some(n-e.top+"px")}},function(t,n){return{position:G.some("fixed"),left:G.some(t+"px"),top:G.some(n+"px")}});return _({right:G.none(),bottom:G.none()},o)},XN=function(t,n,e,o){var r=function(t,r){return function(i,u){var a=t(n,e,o);return r(i.getOr(a.left),u.getOr(a.top))}};return t.fold(r(qN,KN),r(GN,JN),r(jN,$N))},KN=HN.offset,JN=HN.absolute,$N=HN.fixed,QN=function(t,n){var e=Un(t,n);return C(e)?NaN:parseInt(e,10)},ZN=function(t,n,e,o){return function(t,n){var e=t.element,o=QN(e,n.leftAttr),r=QN(e,n.topAttr);return isNaN(o)||isNaN(r)?G.none():G.some(se(o,r))}(t,n).fold(function(){return e},function(t){return $N(t.left+o.left,t.top+o.top)})},tL=function(t,n,e,o,r,i){var u=ZN(t,n,e,o),a=n.mustSnap?oL(t,n,u,r,i):rL(t,n,u,r,i),c=jN(u,r,i
2);return function(t,n,e){var o=t.element;Hn(o,n.leftAttr,e.left+"px"),Hn(o,n.topAttr,e.top+"px")}(t,n,c),a.fold(function(){return{coord:$N(c.left,c.top),extra:G.none()}},function(t){return{coord:t.output,extra:t.extra}})},nL=function(t,n){!function(t,n){var e=t.element;Gn(e,n.leftAttr),Gn(e,n.topAttr)}(t,n)},eL=function(t,n,e,o){return wt(t,function(t){var r=t.sensor,i=function(t,n,e,o,r,i){var u=GN(t,r,i),a=GN(n,r,i);return Math.abs(u.left-a.left)<=e&&Math.abs(u.top-a.top)<=o}(n,r,t.range.left,t.range.top,e,o);return i?G.some({output:XN(t.output,n,e,o),extra:t.extra}):G.none()})},oL=function(t,n,e,o,r){var i=n.getSnapPoints(t);return eL(i,e,o,r).orThunk(function(){var t=ut(i,function(t,n){var i=n.sensor,u=function(t,n,e,o,r,i){var u=GN(t,r,i),a=GN(n,r,i),c=Math.abs(u.left-a.left),s=Math.abs(u.top-a.top);return se(c,s)}(e,i,n.range.left,n.range.top,o,r);return t.deltas.fold(function(){return{deltas:G.some(u),snap:G.some(n)}},function(e){return(u.left+u.top)/2<=(e.left+e.top)/2?{deltas:G.some(u),snap:G.some(n)}:t})},{deltas:G.none(),snap:G.none()});return t.snap.map(function(t){return{output:XN(t.output,e,o,r),extra:t.extra}})})},rL=function(t,n,e,o,r){var i=n.getSnapPoints(t);return eL(i,e,o,r)},iL=Object.freeze({__proto__:null,snapTo:function(t,n,e,o){var r=n.getTarget(t.element);if(n.repositionTarget){var i=vn(t.element),u=eo(i),a=ua(r),c=function(t,n,e){return{coord:XN(t.output,t.output,n,e),extra:t.extra}}(o,u,a),s=YN(c.coord,0,a);Jn(r,s)}}}),uL="data-initial-z-index",aL=function(t,n){t.getSystem().addToGui(n),function(t){wn(t.element).filter(an).each(function(n){Zn(n,"z-index").each(function(t){Hn(n,uL,t)}),Xn(n,"z-index",$n(t.element,"z-index"))})}(n)},cL=function(t){!function(t){wn(t.element).filter(an).each(function(t){Wn(t,uL).fold(function(){return ee(t,"z-index")},function(n){return Xn(t,"z-index",n)}),Gn(t,uL)})}(t),t.getSystem().removeFromGui(t)},sL=function(t,n,e){return t.getSystem().build(CO.sketch({dom:{styles:{left:"0px",top:"0px",width:"100%",height:"100%",position:"fixed","z-index":"1000000000000000"},classes:[n]},events:e}))},lL=jr("snaps",[Dr("getSnapPoints"),Za("onSensor"),Dr("leftAttr"),Dr("topAttr"),Gr("lazyViewport",po),Gr("mustSnap",!1)]),fL=[Gr("useFixed",W),Dr("blockerClass"),Gr("getTarget",L),Gr("onDrag",I),Gr("repositionTarget",!0),Gr("onDrop",I),$r("getBounds",po),lL],dL=function(t){return function(t,n,e,o){return t.isSome()&&n.isSome()&&e.isSome()?G.some(o(t.getOrDie(),n.getOrDie(),e.getOrDie())):G.none()}(Zn(t,"left"),Zn(t,"top"),Zn(t,"position"),function(t,n,e){return("fixed"===e?$N:KN)(parseInt(t,10),parseInt(n,10))}).getOrThunk(function(){var n=fe(t);return JN(n.left,n.top)})},mL=function(t,n,e,o,r,i,u){return function(t,n,e,o,r){var i=r.bounds,u=GN(n,e,o),a=fc(u.left,i.x,i.x+i.width-r.width),c=fc(u.top,i.y,i.y+i.height-r.height),s=JN(a,c);return n.fold(function(){var t=qN(s,e,o);return KN(t.left,t.top)},N(s),function(){var t=jN(s,e,o);return $N(t.left,t.top)})}(0,n.fold(function(){var t,n,u,a=(t=e,n=i.left,u=i.top,t.fold(function(t,e){return KN(t+n,e+u)},function(t,e){return JN(t+n,e+u)},function(t,e){return $N(t+n,e+u)})),c=jN(a,o,r);return $N(c.left,c.top)},function(n){var u=tL(t,n,e,i,o,r);return u.extra.each(function(e){n.onSensor(t,e)}),u.coord}),o,r,u)},gL=function(t,n){return{bounds:t.getBounds(),height:ae(n.element),width:pe(n.element)}},pL=function(t,n,e,o,r){var i=e.update(o,r),u=e.getStartData().getOrThunk(function(){return gL(n,t)});i.each(function(e){!function(t,n,e,o){var r=n.getTarget(t.element);if(n.repositionTarget){var i=vn(t.element),u=eo(i),a=ua(r),c=dL(r),s=mL(t,n.snaps,c,u,a,o,e),l=YN(s,0,a);Jn(r,l)}n.onDrag(t,r,o)}(t,n,u,e)})},hL=function(t,n,e,o){n.each(cL),e.snaps.each(function(n){nL(t,n)});var r=e.getTarget(t.element);o.reset(),e.onDrop(t,r)},vL=function(t){return function(n,e){var o=function(t){e.setStartData(gL(n,t))};return gu([vu(Ki(),function(t){e.getStartData().each(function(){return o(t)})})].concat(w(t(n,e,o))))}},bL=Object.freeze({__proto__:null,getData:function(t){return G.from(se(t.x,t.y))},getDelta:function(t,n){return se(n.left-t.left,n.top-t.top)}}),yL=function(t,n,e){return[vu(bi(),function(o,r){if(0===r.event.raw.button){r.stop();var i=function(){return hL(o,G.some(c),t,n)},u=fO(i,200),a={drop:i,delayDrop:u.schedule,forceDrop:i,move:function(e){u.cancel(),pL(o,t,n,bL,e)}},c=sL(o,t.blockerClass,function(t){return gu([vu(bi(),t.forceDrop),vu(wi(),t.drop),vu(yi(),function(n,e){t.move(e.event)}),vu(xi(),t.delayDrop)])}(a));e(o),aL(o,c)}})]},xL=[].concat(fL,[oc("dragger",{handlers:vL(yL)})]),wL=Object.freeze({__proto__:null,getData:function(t){var n=t.raw.touches;return 1===n.length?function(t){var n=t[0];return G.some(se(n.clientX,n.clientY))}(n):G.none()},getDelta:function(t,n){return se(n.left-t.left,n.top-t.top)}}),SL=function(t,n,e){var o=yo(),r=function(e){hL(e,o.get(),t,n),o.clear()};return[vu(gi(),function(i,u){u.stop();var a=function(){return r(i)},c={drop:a,delayDrop:I,forceDrop:a,move:function(e){pL(i,t,n,wL,e)}},s=sL(i,t.blockerClass,function(t){return gu([vu(gi(),t.forceDrop),vu(hi(),t.drop),vu(vi(),t.drop),vu(pi(),function(n,e){t.move(e.event)})])}(c));o.set(s);e(i),aL(i,s)}),vu(pi(),function(e,o){o.stop(),pL(e,t,n,wL,o.event)}),vu(hi(),function(t,n){n.stop(),r(t)}),vu(vi(),r)]},CL=xL,kL=[].concat(fL,[oc("dragger",{handlers:vL(SL)})]),OL=[].concat(fL,[oc("dragger",{handlers:vL(function(t,n,e){return[].concat(w(yL(t,n,e)),w(SL(t,n,e)))})})]),_L=Object.freeze({__proto__:null,mouse:CL,touch:kL,mouseOrTouch:OL}),TL=Object.freeze({__proto__:null,init:function(){var t=G.none(),n=G.none(),e=N({});return Lu({readState:e,reset:function(){t=G.none(),n=G.none()},update:function(n,e){return n.getData(e).bind(function(e){return function(n,e){var o=t.map(function(t){return n.getDelta(t,e)});return t=G.some(e),o}(n,e)})},getStartData:function(){return n},setStartData:function(t){n=G.some(t)}})}}),EL=Uu({branchKey:"mode",branches:_L,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:G.from(t.extra)}}},state:TL,apis:iL}),DL=function(t,n,e,o,r,i){return t.fold(function(){return EL.snap({sensor:JN(e-20,o-20),range:se(r,i),output:JN(G.some(e),G.some(o)),extra:{td:n}})},function(t){var r=e-20,i=o-20,u=t.element.dom.getBoundingClientRect();return EL.snap({sensor:JN(r,i),range:se(40,40),output:JN(G.some(e-u.width/2),G.some(o-u.height/2)),extra:{td:n}})})},AL=function(t,n,e){return{getSnapPoints:t,leftAttr:"data-drag-left",topAttr:"data-drag-top",onSensor:function(t,o){var r=o.td;(function(t,n){return t.exists(function(t){return pn(t,n)})})(n.get(),r)||(n.set(r),e(r))},mustSnap:!0}},ML=function(t){return jb(Ub.sketch({dom:{tag:"div",classes:["tox-selector"]},buttonBehaviours:zu([EL.config({mode:"mouseOrTouch",blockerClass:"blocker",snaps:t}),t_.config({})]),eventOrder:{mousedown:["dragging","alloy.base.behaviour"],touchstart:["dragging","alloy.base.behaviour"]}}))},BL=function(t,n){var e=ho([]),o=ho([]),r=ho(!1),i=yo(),u=yo(),a=function(t){var e=mo(t);return DL(f.getOpt(n),t,e.x,e.y,e.width,e.height)},c=function(t){var e=mo(t);return DL(d.getOpt(n),t,e.right,e.bottom,e.width,e.height)},s=AL(function(){return nt(e.get(),function(t){return a(t)})},i,function(n){u.get().each(function(e){t.dispatch("TableSelectorChange",{start:n,finish:e})})}),l=AL(function(){return nt(o.get(),function(t){return c(t)})},u,function(n){i.get().each(function(e){t.dispatch("TableSelectorChange",{start:e,finish:n})})}),f=ML(s),d=ML(l),m=es(f.asSpec()),g=es(d.asSpec()),p=function(n,e,o,r){var i=o(e);EL.snapTo(n,i);!function(n,e,o,r){var i=e.dom.getBoundingClientRect();ee(n.element,"display");
2var u=xn($t.fromDom(t.getBody())).dom.innerHeight,a=o(i),c=r(i,u);(a||c)&&Xn(n.element,"display","none")}(n,e,function(t){return t[r]<0},function(t,n){return t[r]>n})},h=function(t){return p(m,t,a,"top")},v=function(t){return p(g,t,c,"bottom")};if(Ge().deviceType.isTouch()){var b=function(t){return nt(t,$t.fromDom)};t.on("TableSelectionChange",function(t){r.get()||(sd(n,m),sd(n,g),r.set(!0));var a=$t.fromDom(t.start),c=$t.fromDom(t.finish);i.set(a),u.set(c),G.from(t.otherCells).each(function(t){e.set(b(t.upOrLeftCells)),o.set(b(t.downOrRightCells)),h(a),v(c)})}),t.on("ResizeEditor ResizeWindow ScrollContent",function(){i.get().each(h),u.get().each(v)}),t.on("TableSelectionClear",function(){r.get()&&(dd(m),dd(g),r.set(!1)),i.clear(),u.clear()})}},IL=function(t){return"BR"===t.nodeName||!!t.getAttribute("data-mce-bogus")||"bookmark"===t.getAttribute("data-mce-type")},FL=function(t,n,e){var o,r=null!==(o=n.delimiter)&&void 0!==o?o:"›",i=function(n,o,r){return Ub.sketch({dom:{tag:"div",classes:["tox-statusbar__path-item"],attributes:{"data-index":r}}
2,components:[Qc(n)],action:function(n){t.focus(),t.selection.select(o),t.nodeChanged()},buttonBehaviours:zu([ry.config(_({},e.tooltips.getConfig({tooltipText:e.translate(["Select the {0} element",o.nodeName.toLowerCase()]),onShow:function(t,n){var e,o,r;e=t.element,o=n.element,r=G.from(Un(e,"id")).getOrThunk(function(){var t=mc("aria");return Hn(o,"id",t),t}),Hn(e,"aria-describedby",r)},onHide:function(t){var n;n=t.element,Gn(n,"aria-describedby")}}))),kS(e.isDisabled),IS(function(){return e.checkUiComponentContext("any")})])})};return{dom:{tag:"div",classes:["tox-statusbar__path"],attributes:{role:"navigation"}},behaviours:zu([Oh.config({mode:"flow",selector:"div[role=button]"}),vg.config({disabled:e.isDisabled}),IS(function(){return e.checkUiComponentContext("any")}),Yb.config({}),Fh.config({}),Rh("elementPathEvents",[Ou(function(n,e){t.shortcuts.add("alt+F11","focus statusbar elementpath",function(){return Oh.focusIn(n)}),t.on("NodeChange",function(e){var o=function(n){for(var e=[],o=n.length;o-- >0;){var r=n[o];if(1===r.nodeType&&!IL(r)){var i=SC(t,r);if(i.isDefaultPrevented()||e.push({name:i.name,element:r}),i.isPropagationStopped())break}}return e}(e.parents),u=o.length>0?ut(o,function(t,n,e){var o=i(n.name,n.element,e);return 0===e?t.concat([o]):t.concat([{dom:{tag:"div",classes:["tox-statusbar__path-divider"],attributes:{"aria-hidden":!0}},components:[Qc(" ".concat(r," "))]},o])},[]):[];Fh.set(n,u)})})])]),components:[]}};!function(t){t[t.None=0]="None",t[t.Both=1]="Both",t[t.Vertical=2]="Vertical"}(CF||(CF={}));var RL=function(t,n,e){var o=$t.fromDom(t.getContainer()),r=function(t,n,e,o,r){var i={height:OR(o+n.top,Pv(t),Vv(t))};return e===CF.Both&&(i.width=OR(r+n.left,zv(t),Hv(t))),i}(t,n,e,ue(o),ge(o));kt(r,function(t,n){M(t)&&Xn(o,n,kR(t))}),function(t){t.dispatch("ResizeEditor")}(t)},NL=function(t,n,e,o){var r=se(20*e,20*o);return RL(t,r,n),G.some(!0)},LL=function(t,n){var e=function(t){var n=mb(t);return!1===n?CF.None:"both"===n?CF.Both:CF.Vertical}(t);
2if(e===CF.None)return G.none();var o=e===CF.Both?"Press the arrow keys to resize the editor.":"Press the Up and Down arrow keys to resize the editor.";return G.some(xx("resize-handle",{tag:"div",classes:["tox-statusbar__resize-handle"],attributes:{"aria-label":n.translate(o),"data-mce-name":"resize-handle"},behaviours:[EL.config({mode:"mouse",repositionTarget:!1,onDrag:function(n,o,r){return RL(t,r,e)},blockerClass:"tox-blocker"}),Oh.config({mode:"special",onLeft:function(){return NL(t,e,-1,0)},onRight:function(){return NL(t,e,1,0)},onUp:function(){return NL(t,e,0,-1)},onDown:function(){return NL(t,e,0,1)}}),Yb.config({}),Hh.config({}),ry.config(n.tooltips.getConfig({tooltipText:n.translate("Resize")}))]},n.icons))},zL=function(t,n){var e=function(){var e=[];return t.hasPlugin("wordcount")&&e.push(function(t,n){var e=function(t,e,o){return Fh.set(t,[Qc(n.translate(["{0} "+o,e[o]]))])};return Ub.sketch({dom:{tag:"button",classes:["tox-statusbar__wordcount"]},components:[],buttonBehaviours:zu([kS(n.isDisabled),IS(function(){return n.checkUiComponentContext("any")}),Yb.config({}),Fh.config({}),Xd.config({store:{mode:"memory",initialValue:{mode:"words",count:{words:0,characters:0}}}}),Rh("wordcount-events",[Eu(function(t){var n=Xd.getValue(t),o="words"===n.mode?"characters":"words";Xd.setValue(t,{mode:o,count:n.count}),e(t,n.count,o)}),Ou(function(n){t.on("wordCountUpdate",function(t){var o=Xd.getValue(n).mode;Xd.setValue(n,{mode:o,count:t.wordCount}),e(n,t.wordCount,o)})})])]),eventOrder:T({},Hi(),["disabling","alloy.base.behaviour","wordcount-events"])})}(t,n)),db(t)&&e.push({dom:{tag:"span",classes:["tox-statusbar__branding"]},components:[{dom:{tag:"a",attributes:{href:"https://www.tiny.cloud/powered-by-tiny?utm_campaign=poweredby&utm_source=tiny&utm_medium=referral&utm_content=v7",rel:"noopener",target:"_blank","aria-label":t.translate(["Build with {0}","TinyMCE"])},innerHtml:t.translate(["Build with {0}",'<svg height="16" viewBox="0 0 80 16" width="80" xmlns="http://www.w3.org/2000/svg"><g opacity=".8"><path d="m80 3.537v-2.202h-7.976v11.585h7.976v-2.25h-5.474v-2.621h4.812v-2.069h-4.812v-2.443zm-10.647 6.929c-.493.217-1.13.337-1.864.337s-1.276-.156-1.805-.47a3.732 3.732 0 0 1 -1.3-1.298c-.324-.554-.48-1.191-.48-1.877s.156-1.335.48-1.877a3.635 3.635 0 0 1 1.3-1.299 3.466 3.466 0 0 1 1.805-.481c.65 0 .914.06 1.263.18.36.12.698.277.986.47.289.192.578.384.842.6l.12.085v-2.586l-.023-.024c-.385-.35-.855-.614-1.384-.818-.53-.205-1.155-.313-1.877-.313-.721 0-1.6.144-2.333.445a5.773 5.773 0 0 0 -1.937 1.251 5.929 5.929 0 0 0 -1.324 1.9c-.324.735-.48 1.565-.48 2.455s.156 1.72.48 2.454c.325.734.758 1.383 1.324 1.913.553.53 1.215.938 1.937 1.25a6.286 6.286 0 0 0 2.333.434c.819 0 1.384-.108 1.961-.313.59-.216 1.083-.505 1.468-.866l.024-.024v-2.49l-.12.096c-.41.337-.878.626-1.396.866zm-14.869-4.15-4.8-5.04-.024-.025h-.902v11.67h2.502v-6.847l2.827 3.08.385.409.397-.41 2.791-3.067v6.845h2.502v-11.679h-.902l-4.788 5.052z"/><path clip-rule="evenodd" d="m15.543 5.137c0-3.032-2.466-5.113-4.957-5.137-.36 0-.745.024-1.094.096-.157.024-3.85.758-3.85.758-3.032.602-4.62 2.466-4.704 4.788-.024.89-.024 4.27-.024 4.27.036 3.165 2.406 5.138 5.017 5.126.337 0 1.119-.109 1.287-.145.144-.024.385-.084.746-.144.661-.12 1.684-.325 3.067-.602 2.37-.409 4.103-2.009 4.44-4.33.156-1.023.084-4.692.084-4.692zm-3.213 3.308-2.346.457v2.31l-5.859 1.143v-5.75l2.346-.458v3.441l3.513-.686v-3.44l-3.513.685v-2.297l5.859-1.143v5.75zm20.09-3.296-.083-1.023h-2.13v8.794h2.346v-4.884c0-1.107.95-1.985 2.057-1.997 1.095 0 1.901.89 1.901 1.997v4.884h2.346v-5.245c-.012-2.105-1.588-3.777-3.67-3.765a3.764 3.764 0 0 0 -2.778 1.25l.012-.011zm-6.014-4.102 2.346-.458v2.298l-2.346.457z" fill-rule="evenodd"/><path d="m28.752 4.126h-2.346v8.794h2.346z"/><path clip-rule="evenodd" d="m43.777 15.483 4.043-11.357h-2.418l-1.54 4.355-.445 1.324-.36-1.324-1.54-4.355h-2.418l3.151 8.794-1.083 3.08zm-21.028-5.51c0 .722.541 1.034.878 1.034s.638-.048.95-.144l.518 1.708c-.217.145-.879.518-2.13.518a2.565 2.565 0 0 1 -2.562-2.587c-.024-1.082-.024-2.49 0-4.21h-1.54v-2.142h1.54v-1.912l2.346-.458v2.37h2.201v2.142h-2.2v3.693-.012z" fill-rule="evenodd"/></g></svg>\n'.trim()])},behaviours:zu([Hh.config({})])}]}),{dom:{tag:"div",classes:["tox-statusbar__right-container"]},components:e}},o=function(){var o,r=[],i=vb(t),u=fb(t),a=db(t)||t.hasPlugin("wordcount");return u&&r.push(FL(t,{},n)),i&&r.push((o=PS("Alt+0"),{dom:{tag:"div",classes:["tox-statusbar__help-text"]},components:[Qc(fx.translate(["Press {0} for help",o]))]})),a&&r.push(e()),r.length>0?[{dom:{tag:"div",classes:["tox-statusbar__text-container"].concat(w(function(){var t="tox-statusbar__text-container--flex-start",n="tox-statusbar__text-container--flex-end";if(i){var e="tox-statusbar__text-container-3-cols";return a||u?a&&!u?[e,n]:[e,t]:[e,"tox-statusbar__text-container--space-around"]}return[a&&!u?n:t]}()))},components:r}]:[]};return{dom:{tag:"div",classes:["tox-statusbar"]},components:function(){var e=o(),r=LL(t,n);return e.concat(r.toArray())}()}},PL=function(t,n){return n.get().getOrDie("UI for ".concat(t," has not been rendered"))},HL=function(t,n){var e,o,r,i=t.inline,u=i?BR:SR,a=Bb(t)?CB:mB,c=(e=yo(),o=yo(),r=yo(),{dialogUi:e,popupUi:o,mainUi:r,getUiMotherships:function(){var t=e.get().map(function(t){return t.mothership}),n=o.get().map(function(t){return t.mothership});return t.fold(function(){return n.toArray()},function(t){return n.fold(function(){return[t]},function(n){return pn(t.element,n.element)?[t]:[t,n]})})},lazyGetInOuterOrDie:function(t,n){return function(){return r.get().bind(function(t){return n(t.outerContainer)}).getOrDie("Could not find ".concat(t," element in OuterContainer"))}}}),s=yo(),l=yo(),f=yo(),d=Ge().deviceType.isTouch()?["tox-platform-touch"]:[],m=Tb(t),g=Yv(t),p=jb({dom:{tag:"div",classes:["tox-anchorbar"]}}),h=jb({dom:{tag:"div",classes:["tox-bottom-anchorbar"]}}),v=function(){return c.mainUi.get().map(function(t){return t.outerContainer}).bind(eF.getHeader)},b=c.lazyGetInOuterOrDie("anchor bar",p.getOpt),y=c.lazyGetInOuterOrDie("bottom anch
2or bar",h.getOpt),x=c.lazyGetInOuterOrDie("toolbar",eF.getToolbar),S=c.lazyGetInOuterOrDie("throbber",eF.getThrobber),C=tB({popup:function(){return Co.fromOption(c.popupUi.get().map(function(t){return t.sink}),"(popup) UI has not been rendered")},dialog:function(){return Co.fromOption(c.dialogUi.get().map(function(t){return t.sink}),"UI has not been rendered")}},t,b,y),k=function(){return eF.parts.promotion({dom:{tag:"div",classes:["tox-promotion"]}})},O=function(){var n=function(){var n={attributes:T({},Wl,m?dl.BottomToTop:dl.TopToBottom)},e=eF.parts.menubar({dom:{tag:"div",classes:["tox-menubar"]},backstage:C.popup,onEscape:function(){t.focus()}}),o=eF.parts.toolbar(_({dom:{tag:"div",classes:["tox-toolbar"]},getSink:C.popup.shared.getSink,providers:C.popup.shared.providers,onEscape:function(){t.focus()},onToolbarToggled:function(n){!function(t,n){t.dispatch("ToggleToolbarDrawer",{state:n})}(t,n)},type:g,lazyToolbar:x,lazyHeader:function(){return v().getOrDie("Could not find header element")}},n)),r=eF.parts["multiple-toolbar"]({dom:{tag:"div",classes:["tox-toolbar-overlord"]},providers:C.popup.shared.providers,onEscape:function(){t.focus()},type:g}),i=_b(t),u=kb(t),a=xb(t),c=hb(t),s=k(),l=i||u||a,f=c?[s,e]:[e];return eF.parts.header({dom:_({tag:"div",classes:["tox-editor-header"].concat(l?[]:["tox-editor-header--empty"])},n),components:st([a?f:[],i?[r]:u?[o]:[],Db(t)?[]:[p.asSpec()]]),sticky:Bb(t),editor:t,sharedBackstage:C.popup.shared})}(),e={dom:{tag:"div",classes:["tox-sidebar-wrap"]},components:[eF.parts.socket({dom:{tag:"div",classes:["tox-edit-area"]}}),eF.parts.sidebar({dom:{tag:"div",classes:["tox-sidebar"]}})]},o=eF.parts.throbber({dom:{tag:"div",classes:["tox-throbber"]},backstage:C.popup}),r=eF.parts.viewWrapper({backstage:C.popup}),u=lb(t)&&!i?G.some(zL(t,C.popup.shared.providers)):G.none(),a=st([m?[]:[n],i?[]:[e],m?[n]:[]]),c=eF.parts.editorContainer({components:st([a,i?[]:[h.asSpec()]])}),l=Mb(t),f=_(_({role:"application"},fx.isRtl()?{dir:"rtl"}:{}),l?{"aria-hidden":"true"}:{}),b=es(eF.sketch({dom:{tag:"div",classes:["tox","tox-tinymce"].concat(i?["tox-tinymce-inline"]:[]).concat(m?["tox-tinymce--toolbar-bottom"]:[]).concat(d),styles:_({visibility:"hidden"},l?{opacity:"0",border:"0"}:{}),attributes:f},components:[c].concat(w(i?[]:[r].concat(w(u.toArray()))),[o]),behaviours:zu([IS(function(){return C.popup.shared.providers.checkUiComponentContext("any")}),vg.config({disableClass:"tox-tinymce--disabled"}),Oh.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"})])})),y=kO(b);return s.set(y),{mothership:y,outerContainer:b}},E=function(n){var e=kR(_R(t)),o=kR(function(t){return TR(t).getOr(Lv(t))}(t));return t.inline||(ne("div","width",o)&&Xn(n.element,"width",o),ne("div","height",e)?Xn(n.element,"height",e):Xn(n.element,"height","400px")),e},D=function(n){var e=n.mainUi,o=n.popupUi,r=n.uiMotherships;Ot(Xv(t),function(n,e){t.ui.registry.addGroupToolbarButton(e,n)});var i,c=t.ui.registry.getAll(),s=c.buttons,l=c.menuItems,f=c.contextToolbars,d=c.sidebars,m=c.views,p=Ob(t),h={menuItems:l,menus:Fb(t),menubar:tb(t),toolbar:p.getOrThunk(function(){return nb(t)}),allowToolbarGroups:g===Cv.floating,buttons:s,sidebar:d,views:m};i=e.outerContainer,t.addShortcut("alt+F9","focus menubar",function(){eF.focusMenubar(i)}),t.addShortcut("alt+F10","focus toolbar",function(){eF.focusToolbar(i)}),t.addCommand("ToggleToolbarDrawer",function(t,n){(null==n?void 0:n.skipFocus)?eF.toggleToolbarDrawerWithoutFocusing(i):eF.toggleToolbarDrawer(i)}),t.addQueryStateHandler("ToggleToolbarDrawer",function(){return eF.isToolbarDrawerToggled(i)}),function(t,n,e){var o=function(t,o){et([n].concat(w(e)),function(n){n.broadcastEvent(t,o)})},r=function(t,o){et([n].concat(w(e)),function(n){n.broadcastOn([t],o)})},i=function(t){return r(Dd(),{target:t.target})},u=uo(),a=wl(u,"touchstart",i),c=wl(u,"touchmove",function(t){return o(Yi(),t)}),s=wl(u,"touchend",function(t){return o(Xi(),t)}),l=wl(u,"mousedown",i),f=wl(u,"mouseup",function(t){0===t.raw.button&&r(Md(),{target:t.target})}),d=function(t){return r(Dd(),{target:$t.fromDom(t.target)})},m=function(t){0===t.button&&r(Md(),{target:$t.fromDom(t.target)})},g=function(){et(t.editorManager.get(),function(n){t!==n&&n.dispatch("DismissPopups",{relatedTarget:t})})},p=function(t){return o(Ki(),Cl(t))},h=function(t){r(Ad(),{}),o(Ji(),Cl(t))},v=An($t.fromDom(t.getElement())),b=Sl(v,"scroll",function(e){requestAnimationFrame(function(){if(null!=t.getContainer()){var r=Hb(t,n.element).map(function(t){return[t.element].concat(w(t.others
2))}).getOr([]);Q(r,function(t){return pn(t,e.target)})&&(t.dispatch("ElementScroll",{target:e.target.dom}),o(ou(),e))}})}),y=function(){return r(Ad(),{})},x=function(n){n.state&&r(Dd(),{target:$t.fromDom(t.getContainer())})},S=function(t){r(Dd(),{target:$t.fromDom(t.relatedTarget.getContainer())})},C=function(n){return t.dispatch("focusin",n)},k=function(n){return t.dispatch("focusout",n)};t.on("PostRender",function(){t.on("click",d),t.on("tap",d),t.on("mouseup",m),t.on("mousedown",g),t.on("ScrollWindow",p),t.on("ResizeWindow",h),t.on("ResizeEditor",y),t.on("AfterProgressState",x),t.on("DismissPopups",S),et([n].concat(w(e)),function(t){t.element.dom.addEventListener("focusin",C),t.element.dom.addEventListener("focusout",k)})}),t.on("remove",function(){t.off("click",d),t.off("tap",d),t.off("mouseup",m),t.off("mousedown",g),t.off("ScrollWindow",p),t.off("ResizeWindow",h),t.off("ResizeEditor",y),t.off("AfterProgressState",x),t.off("DismissPopups",S),et([n].concat(w(e)),function(t){t.element.dom.removeEventListener("focusin",C),t.element.dom.removeEventListener("focusout",k)}),l.unbind(),a.unbind(),c.unbind(),s.unbind(),f.unbind(),b.unbind()}),t.on("detach",function(){et([n].concat(w(e)),vd),et([n].concat(w(e)),function(t){return t.destroy()})})}(t,e.mothership,r),a.setup(t,C.popup.shared,v),hN(t,C.popup),PN(t,C.popup.shared.getSink,C.popup),function(t){var n=t.ui.registry.getAll().sidebars;et(St(n),function(e){var o=n[e],r=function(){return Nt(G.from(t.queryCommandValue("ToggleSidebar")),e)};t.ui.registry.addToggleButton(e,{icon:o.icon,tooltip:o.tooltip,onAction:function(n){t.execCommand("ToggleSidebar",!1,e),n.setActive(r())},onSetup:function(n){n.setActive(r());var e=function(){return n.setActive(r())};return t.on("ToggleSidebar",e),function(){t.off("ToggleSidebar",e)}},context:"any"})})}(t),KB(t,S,C.popup.shared),nN(t,f,o.sink,{backstage:C.popup}),BL(t,o.sink);var b={targetNode:t.getElement(),height:E(e.outerContainer)};return u.render(t,n,h,C.popup,b)};return{popups:{backstage:C.popup,getMothership:function(){return PL("popups",f)}},dialogs:{backstage:C.dialog,getMothership:function(){return PL("dialogs",l)}},renderUI:function(){var e,o,r,i,u,s,m=O(),g=(e=Ab(t),o=pn(Ln(),e)&&"grid"===$n(e,"display"),r={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-tinymce-aux"].concat(d),attributes:_({},fx.isRtl()?{dir:"rtl"}:{})},behaviours:zu([nd.config({useFixed:function(){return a.isDocked(v)}})])},i={dom:{styles:{width:document.body.clientWidth+"px"}},events:gu([vu(Ji(),function(t){Xn(t.element,"width",document.body.clientWidth+"px")})])},u=es(Ho(r,o?i:{})),s=kO(u),l.set(s),{sink:u,mothership:s}),p=Ib(t)?function(){var t={dom:{tag:"div",classes:["tox","tox-silver-sink","tox-silver-popup-sink","tox-tinymce-aux"].concat(d),attributes:_({},fx.isRtl()?{dir:"rtl"}:{})},behaviours:zu([nd.config({useFixed:function(){return a.isDocked(v)},getBounds:function(){return n.getPopupSinkBounds()}})])},e=es(t),o=kO(e);return f.set(o),{sink:e,mothership:o}}():function(t){return f.set(t.mothership),t}(g);c.dialogUi.set(g),c.popupUi.set(p),c.mainUi.set(m);var h={popupUi:p,dialogUi:g,mainUi:m,uiMotherships:c.getUiMotherships()};return D(h)}}},VL=N([Dr("lazySink"),Lr("dragBlockClass"),$r("getBounds",po),Gr("useTabstopAt",j),Gr("firstTabstop",0),Gr("eventOrder",{}),Kd("modalBehaviours",[Oh]),tc("onExecute"),ec("onEscape")]),UL={sketch:L},WL=N([_m({name:"draghandle",overrides:function(t,n){return{behaviours:zu([EL.config({mode:"mouse",getTarget:function(t){return ss(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})])}}}),km({schema:[Dr("dom")],name:"title"}),km({factory:UL,schema:[Dr("dom")],name:"close"}),km({factory:UL,schema:[Dr("dom")],name:"body"}),_m({factory:UL,schema:[Dr("dom")],name:"footer"}),Om({factory:{sketch:function(t,n){return _(_({},t),{},{dom:n.dom,components:n.components})}},schema:[Gr("dom",{tag:"div",styles:{position:"fixed",left:"0px",top:"0px",right:"0px",bottom:"0px"}}),Gr("components",[])],name:"blocker"})]),jL=Zm({name:"ModalDialog",configFields:VL(),partFields:WL(),factory:function(t,n,e,o){var r=yo(),i=mc("modal-events"),u=_(_({},t.eventOrder),{},T({},$i(),[i].concat(t.eventOrder["alloy.system.attached"]||[]))),a=Ge();return{uid:t.uid,dom:t.dom,components:n,apis:{show:function(n){r.set(n);var e=t.lazySink(n).getOrDie(),i=o.blocker(),u=e.getSystem().build(_(_({},i),{}
2,{components:i.components.concat([os(n)]),behaviours:zu([Hh.config({}),Rh("dialog-blocker-events",[ku(Ci(),function(){qB.isBlocked(n)||Oh.focusIn(n)})])])}));sd(e,u),Oh.focusIn(n)},hide:function(t){r.clear(),wn(t.element).each(function(n){t.getSystem().getByDom(n).each(function(t){dd(t)})})},getBody:function(n){return Pm(n,t,"body")},getFooter:function(n){return zm(n,t,"footer")},setIdle:function(t){qB.unblock(t)},setBusy:function(t,n){qB.block(t,n)}},eventOrder:u,domModification:{attributes:{role:"dialog","aria-modal":"true"}},behaviours:$d(t.modalBehaviours,[Fh.config({}),Oh.config({mode:"cyclic",onEnter:t.onExecute,onEscape:t.onEscape,useTabstopAt:t.useTabstopAt,firstTabstop:t.firstTabstop}),qB.config({getRoot:r.get}),Rh(i,[Ou(function(n){var e,o,r,i=Pm(n,t,"title").element,u=function(t){return t.dom.textContent}(i);a.os.isMacOS()&&O(u)?Hn(n.element,"aria-label",u):(e=n.element,o=i,r=Wn(e,"id").fold(function(){var t=mc("dialog-label");return Hn(o,"id",t),t},L),Hn(e,"aria-labelledby",r))})])])}},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)}}}),GL=or([mw,gw].concat(lS)),qL=dr,YL=[Vw("button"),Ew,Kr("align","end",["start","end"]),Nw,Rw,Vr("buttonType",["primary","secondary"]),Xr("context","mode:design")],XL=[].concat(YL,[hw]),KL=[Br("type",["submit","cancel","custom"])].concat(w(XL)),JL=[Br("type",["menu"]),_w,Dw,Ew,Nr("items",GL)].concat(YL),$L=[].concat(YL,[Br("type",["togglebutton"]),Dw,Ew,_w,Jr("active",!1)]),QL=kr("type",{submit:KL,cancel:KL,custom:KL,menu:JL,togglebutton:$L}),ZL=[mw,hw,Br("level",["info","warn","error","success"]),bw,Gr("url","")],tz=or(ZL),nz=[mw,hw,Rw,Vw("button"),Ew,Fw,Vr("buttonType",["primary","secondary","toolbar"]),Nw,Xr("context","mode:design")],ez=or(nz),oz=[mw,gw],rz=oz.concat([Aw]),iz=oz.concat([pw,Rw,Xr("context","mode:design")]),uz=or(iz),az=dr,cz=rz.concat([Lw("auto"),Xr("context","mode:design")]),sz=or(cz),lz=ar([yw,hw,bw]),fz=rz.concat([Xr("storageKey","default"),Xr("context","mode:design")]),dz=or(fz),mz=fr,gz=or(rz),pz=fr,hz=oz.concat([Xr("tag","textarea"),Mr("scriptId"),Mr("scriptUrl"),Ur("onFocus"),function(t,n){return qr(t,n,pr)}("settings",void 0)]),vz=oz.concat([Xr("tag","textarea"),Ir("init")]),bz=br(function(t){return xr("customeditor.old",er(vz),t).orThunk(function(){return xr("customeditor.new",er(hz),t)})}),yz=fr,xz=rz.concat([Xr("context","mode:design")]),wz=or(xz),Sz=rr(Jo),Cz=function(t){return[mw,(n="columns",Ar(n,lr)),t];var n},kz=[mw,Mr("html"),Kr("presets","presentation",["presentation","document"]),$r("onInit",I),Jr("stretched",!1)],Oz=or(kz),_z=rz.concat([Jr("border",!1),Jr("sandboxed",!0),Jr("streamContent",!1),Jr("transparent",!0)]),Tz=or(_z),Ez=fr,Dz=or(oz.concat([Hr("height")])),Az=or([Mr("url"),Pr("zoom"),Pr("cachedWidth"),Pr("cachedHeight")]),Mz=rz.concat([Hr("inputMode"),Hr("placeholder"),Jr("maximized",!1),Rw,Xr("context","mode:design")]),Bz=or(Mz),Iz=fr,Fz=function(t){return[mw,pw,t,Kr("align","start",["start","center","end"]),Hr("for")]},Rz=[hw,yw],Nz=[hw,Nr("items",Or(0,function(){return Lz}))],Lz=ir([or(Rz),or(Nz)]),zz=rz.concat([Nr("items",Lz),Rw,Xr("context","mode:design")]),Pz=or(zz),Hz=fr,Vz=rz.concat([Rr("items",[hw,yw]),Yr("size",1),Rw,Xr("context","mode:design")]),Uz=or(Vz),Wz=fr,jz=rz.concat([Jr("constrain",!0),Rw,Xr("context","mode:design")]),Gz=or(jz),qz=or([Mr("width"),Mr("height")]),Yz=oz.concat([pw,Yr("min",0),Yr("max",0)]),Xz=or(Yz),Kz=lr,Jz=[mw,Nr("header",fr),Nr("cells",rr(fr))],$z=or(Jz),Qz=rz.concat([Hr("placeholder"),Jr("maximized",!1),Rw,Xr("context","mode:design")]),Zz=or(Qz),tP=fr,nP=[Br("type",["directory","leaf"]),vw,Mr("id"),zr("menu",_B),Hr("customStateIcon"),Hr("customStateIconTooltip")],eP=or(nP),oP=nP.concat([Nr("children",Or(0,function(){return vr("type",{directory:rP,leaf:eP})}))]),rP=or(oP),iP=vr("type",{directory:rP,leaf:eP}),uP=[mw,Nr("items",iP),Ur("onLeafAction"),Ur("onToggleExpand"),Qr("defaultExpandedIds",[],fr),Hr("defaultSelectedId")],aP=or(uP),cP=rz.concat([Kr("filetype","file",["image","media","file"]),Rw,Hr("picker_text"),Xr("context","mode:design")]),sP=or(cP),lP=or([yw,zw]),fP=function(t){return _r("items","items",{tag:"required",process:{}},rr(br(function(n){return xr("Checking item of ".concat(t),dP,n).fold(function(t){return Co.error(Cr(t))},function(t){return Co.value(t)})})))},dP=tr(function(){return vr("type",{alertbanner:tz,bar:or((t=fP("bar"),[mw,t])),button:ez,checkbox:uz,colorinput:dz,colorpicker:gz,dropzone:wz,grid:or(Cz(fP("grid"))),iframe:Tz,input:Bz,listbox:Pz,selectbox:Uz,sizeinput:Gz,slider:Xz,textarea:Zz,urlinput:sP,customeditor:bz,htmlpanel:Oz,imagepreview:Dz,collection:sz,label:or(Fz(fP("label"))),table:$z,tree:aP,panel:gP});var t}),mP=[mw,Gr("classes",[]),Nr("items",dP)],gP=or(mP),pP=[Vw("tab"),vw,Nr("items",dP)],hP=[mw,Rr("tabs",pP)],vP=or(hP),bP=XL,yP=QL,xP=or([Mr("title"),Ar("body",vr("type",{panel:gP,tabpanel:vP})),Xr("size","normal"),Qr("buttons",[],yP),Gr("initialData",{}),$r("onAction",I),$r("onChange",I),$r("onSubmit",I),$r("onClose",I),$r("onCancel",I),$r("onTabChange",I)]),wP=or([Br("type",["cancel","custom"])].concat(w(bP))),SP=or([Mr("title"),Mr("url"),Pr("height"),Pr("width"),Wr("buttons",wP),$r("onAction",I),$r("onCancel",I),$r("onClose",I),$r("onMessage",I)]),CP=function(t){return d(t)?[t].concat(lt(Bt(t),CP)):g(t)?lt(t,CP):[]},kP=function(t){return f(t.type)&&f(t.name)},OP={checkbox:az,colorinput:mz,colorpicker:pz,dropzone:Sz,input:Iz,iframe:Ez,imagepreview:Az,selectbox:Wz,sizeinput:qz,slider:Kz,listbox:Hz,size:qz,textarea:tP,urlinput:lP,customeditor:yz,collection:lz,togglemenuitem:qL},_P=function(t){var n=function(t){return rt(CP(t),kP)}(t),e=lt(n,function(t){return function(t){return G.from(OP[t.type])}(t).fold(function(){return[]},function(n){return[Ar(t.name,n)]})});return or(e)},TP=function(t){var n;return{internalDialog:wr(xr("dialog",xP,t)),dataValidator:_P(t),initialData:null!==(n=t.initialData)&&void 0!==n?n:{}}},EP={open:function(t,n){var e=TP(n);return t(e.internalDialog,e.initialData,e.dataValidator)},openUrl:function(t,n){return t(wr(xr("dialog",SP,n)))},redial:function(t){return TP(t)}},DP=Object.freeze({__proto__:null,events:function(t,n){var e=function(e,o){t.updateState.each(function(t){var r=t(e,o);n.set(r)}),t.renderComponents.each(function(r){var i=r(o,n.get());(t.reuseDom?Th:_h)(e,i)})};return gu([vu(Pi(),function(n,o){var r=o;if(!r.universal){var i=t.channel;$(r.channels,i)&&e(n,r.data)}}),Ou(function(n,o){t.initialData.each(function(t){e(n,t)})})])}}),AP=Object.freeze({__proto__:null,getState:function(t,n,e){return e}}),MP=[Dr("channel"),Lr("renderComponents"),Lr("updateState"),Lr("initialData"),Jr("reuseDom",!0)],BP=Hu({fields:MP,name:"reflecting",active:DP,apis:AP,state:Object.freeze({__proto__:null,init:function(){var t=ho(G.none());return{readState:function(){return t.get().getOr("none")},get:t.get,set:t.set,clear:function(){return t.set(G.none())}}}})}),IP=function(t){var n=[],e={};return kt(t,function(t,o){t.fold(function(){n.push(o)},function(t){e[o]=t})}),n.length>0?Co.error(n):Co.value(e)},FP=function(t,n,e,o){var r,i,u,a=jb(JT.sketch(function(r){return{dom:{tag:"div",classes:["tox-form"].concat(t.classes)},components:nt(t.items,function(t){return PA(r,t,n,e,o)})}}));return{dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[a.asSpec()]}],behaviours:zu([Oh.config({mode:"acyclic",useTabstopAt:H(_E)}),uE(a),(r=a,i={postprocess:function(t){return IP(t).fold(function(t){return console.error(t),{}},L)}},u=Sr("RepresentingConfigs.memento processors",cE,i),Xd.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=Xd.getValue(n);return u.postprocess(e)},setValue:function(t,n){var e=u.preprocess(n),o=r.get(t);Xd.setValue(o,e)}}})),Rh("dialog-body-panel",[vu(Ci(),function(t,n){t.getSystem().broadcastOn([BE],{newFocus:G.some(n.event.target)})})])])}},RP=Qm({name:"TabButton",configFields:[Gr("uid",void 0),Dr("value"),_r("dom","dom",jo(function(){return{attributes:{role:"tab",id:mc("aria"),"aria-selected":"false"}}}),cr()),Lr("action"),Gr("domModification",{}),Kd("tabButtonBehaviours",[Hh,Oh,Xd]),Dr("view")],factory:function(t,n){return{uid:t.uid,dom:t.dom,components:t.components,events:Jh(t.action),behaviours:$d(t.tabButtonBehaviours,[Hh.config({}
2),Oh.config({mode:"execution",useSpace:!0,useEnter:!0}),Xd.config({store:{mode:"memory",initialValue:t.value}})]),domModification:t.domModification}}}),NP=N([Dr("tabs"),Dr("dom"),Gr("clickToDismiss",!1),Kd("tabbarBehaviours",[Eg,Oh]),$a(["tabClass","selectedClass"])]),LP=Tm({factory:RP,name:"tabs",unit:"tab",overrides:function(t){var n=function(t,n){Eg.dehighlight(t,n),su(t,iu(),{tabbar:t,button:n})},e=function(t,n){Eg.highlight(t,n),su(t,ru(),{tabbar:t,button:n})};return{action:function(o){var r=o.getSystem().getByUid(t.uid).getOrDie(),i=Eg.isHighlighted(r,o);(i&&t.clickToDismiss?n:i?I:e)(r,o)},domModification:{classes:[t.markers.tabClass]}}}}),zP=N([LP]),PP=Zm({name:"Tabbar",configFields:NP(),partFields:zP(),factory:function(t,n,e,o){return{uid:t.uid,dom:t.dom,components:n,"debug.sketcher":"Tabbar",domModification:{attributes:{role:"tablist"}},behaviours:$d(t.tabbarBehaviours,[Eg.config({highlightClass:t.markers.selectedClass,itemClass:t.markers.tabClass,onHighlight:function(t,n){Hn(n.element,"aria-selected","true")},onDehighlight:function(t,n){Hn(n.element,"aria-selected","false")}}),Oh.config({mode:"flow",getInitial:function(t){return Eg.getHighlighted(t).map(function(t){return t.element})},selector:"."+t.markers.tabClass,executeOnMove:!0})])}}}),HP=Qm({name:"Tabview",configFields:[Kd("tabviewBehaviours",[Fh])],factory:function(t,n){return{uid:t.uid,dom:t.dom,behaviours:$d(t.tabviewBehaviours,[Fh.config({})]),domModification:{attributes:{role:"tabpanel"}}}}}),VP=N([Gr("selectFirst",!0),Za("onChangeTab"),Za("onDismissTab"),Gr("tabs",[]),Kd("tabSectionBehaviours",[])]),UP=km({factory:PP,schema:[Dr("dom"),Fr("markers",[Dr("tabClass"),Dr("selectedClass")])],name:"tabbar",defaults:function(t){return{tabs:t.tabs}}}),WP=km({factory:HP,name:"tabview"}),jP=N([UP,WP]),GP=Zm({name:"TabSection",configFields:VP(),partFields:jP(),factory:function(t,n,e,o){var r=function(n,e){zm(n,t,"tabbar").each(function(t){e(t).each(lu)})};return{uid:t.uid,dom:t.dom,components:n,behaviours:Jd(t.tabSectionBehaviours),events:gu(st([t.selectFirst?[Ou(function(t,n){r(t,Eg.getFirst)})]:[],[vu(ru(),function(n,e){!function(n){var e=Xd.getValue(n);zm(n,t,"tabview").each(function(o){var r=at(t.tabs,function(t){return t.value===e});r.each(function(e){var r=e.view();Wn(n.element,"id").each(function(t){Hn(o.element,"aria-labelledby",t)}),Fh.set(o,r),t.onChangeTab(o,n,r)})})}(e.event.button)}),vu(iu(),function(n,e){var o=e.event.button;t.onDismissTab(n,o)})]])),apis:{getViewItems:function(n){return zm(n,t,"tabview").map(function(t){return Fh.contents(t)}).getOr([])},showTab:function(t,n){r(t,function(t){var e=Eg.getCandidates(t);return at(e,function(t){return Xd.getValue(t)===n}).filter(function(n){return!Eg.isHighlighted(t,n)})})}}}},apis:{getViewItems:function(t,n){return t.getViewItems(n)},showTab:function(t,n,e){t.showTab(n,e)}}}),qP=function(t,n){Xn(t,"height",n+"px"),Xn(t,"flex-basis",n+"px")},YP=function(t,n,e){ss(t,'[role="dialog"]').each(function(t){ds(t,'[role="tablist"]').each(function(o){e.get().map(function(e){return Xn(n,"height","0"),Xn(n,"flex-basis","0"),Math.min(e,function(t,n,e){var o,r=yn(t).dom,i=ss(t,".tox-dialog-wrap").getOr(t);o="fixed"===$n(i,"position")?Math.max(r.clientHeight,window.innerHeight):Math.max(r.offsetHeight,r.scrollHeight);var u=ue(n),a=n.dom.offsetLeft>=e.dom.offsetLeft+ge(e)?Math.max(ue(e),u):u,c=parseInt($n(t,"margin-top"),10)||0,s=parseInt($n(t,"margin-bottom"),10)||0;return o-(ue(t)+c+s-a)}(t,n,o))}).each(function(t){qP(n,t)})})})},XP=function(t){return ds(t,'[role="tabpanel"]')},KP=function(t){var n=yo(),e=[Ou(function(e){var o=e.element;XP(o).each(function(r){Xn(r,"visibility","hidden"),e.getSystem().getByDom(r).toOptional().each(function(e){var o=function(t,n,e){return nt(t,function(o,r){Fh.set(e,t[r].view());var i=n.dom.getBoundingClientRect();return Fh.set(e,[]),i.height})}(t,r,e),i=function(t){return bt(ht(t,function(t,n){return t>n?-1:t<n?1:0}))}(o);i.fold(n.clear,n.set)}),YP(o,r,n),ee(r,"visibility"),function(t,n){bt(t).each(function(t){return GP.showTab(n,t.value)})}(t,e),requestAnimationFrame(function(){YP(o,r,n)})})}),vu(Ji(),function(t){var e=t.element;XP(e).each(function(t){YP(e,t,n)})}),vu(VO,function(t,e){var o=t.element;XP(o).each(function(t){var e=ol(An(t));Xn(t,"visibility","hidden");var r=Zn(t,"height").map(function(t){return parseInt(t,10)});ee(t,"height"),ee(t,"flex-basis");var i=t.dom.getBoundingClientRect().height;r.forall(function(t){return i>t})?(n.set(i),YP(o,t,n)):r.each(function(n){qP(t,n)}),ee(t,"visibility"),e.each(tl)})})];return{extraEvents:e,selectFirst:!1}},JP="send-data-to-section",$P="send-data-to-view",QP=function(t,n,e,o){var r=ho({}
2),i=function(t){var n=Xd.getValue(t),e=IP(n).getOr({}),o=r.get(),i=Ho(o,e);r.set(i)},u=function(t){var n=r.get();Xd.setValue(t,n)},a=ho(null),c=nt(t.tabs,function(t){return{value:t.name,dom:{tag:"div",classes:["tox-dialog__body-nav-item"]},components:[Qc(e.shared.providers.translate(t.title))],view:function(){return[JT.sketch(function(r){return{dom:{tag:"div",classes:["tox-form"]},components:nt(t.items,function(t){return PA(r,t,n,e,o)}),formBehaviours:zu([Oh.config({mode:"acyclic",useTabstopAt:H(_E)}),Rh("TabView.form.events",[Ou(u),_u(i)]),Qs.config({channels:ri([{key:JP,value:{onReceive:i}},{key:$P,value:{onReceive:u}}])})])}})]}}}),s=KP(c);return GP.sketch({dom:{tag:"div",classes:["tox-dialog__body"]},onChangeTab:function(t,n,e){var o=Xd.getValue(n);su(t,HO,{name:o,oldName:a.get()}),a.set(o)},tabs:c,components:[GP.parts.tabbar({dom:{tag:"div",classes:["tox-dialog__body-nav"]},components:[PP.parts.tabs({})],markers:{tabClass:"tox-tab",selectedClass:"tox-dialog__body-nav-item--active"},tabbarBehaviours:zu([Yb.config({})])}),GP.parts.tabview({dom:{tag:"div",classes:["tox-dialog__body-content"]}})],selectFirst:s.selectFirst,tabSectionBehaviours:zu([Rh("tabpanel",s.extraEvents),Oh.config({mode:"acyclic"}),og.config({find:function(t){return bt(GP.getViewItems(t))}}),sE(G.none(),function(t){return t.getSystem().broadcastOn([JP],{}),r.get()},function(t,n){r.set(n),t.getSystem().broadcastOn([$P],{})})])})},ZP=function(t,n,e,o,r,i){return{dom:{tag:"div",classes:["tox-dialog__content-js"],attributes:_(_({},e.map(function(t){return{id:t}}).getOr({})),r?{"aria-live":"polite"}:{})},components:[],behaviours:zu([aE(0),BP.config({channel:"".concat(DE,"-").concat(n),updateState:function(t,n){return G.some({isTabPanel:function(){return"tabpanel"===n.body.type}})},renderComponents:function(t){var n=t.body;return"tabpanel"===n.type?[QP(n,t.initialData,o,i)]:[FP(n,t.initialData,o,i)]},initialData:t})])}},tH=Mv.deviceType.isTouch(),nH=function(t,n){return{dom:{tag:"div",styles:{display:"none"},classes:["tox-dialog__header"]},components:[t,n]}},eH=function(t,n){return jL.parts.close(Ub.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":n.translate("Close")}},action:t,buttonBehaviours:zu([Yb.config({})])}))},oH=function(){return jL.parts.title({dom:{tag:"div",classes:["tox-dialog__title"],innerHtml:"",styles:{display:"none"}}})},rH=function(t,n){return jL.parts.body({dom:{tag:"div",classes:["tox-dialog__body"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-content"]},components:[{dom:Wb("<p>".concat(lx(n.translate(t)),"</p>"))}]}]})},iH=function(t){return jL.parts.footer({dom:{tag:"div",classes:["tox-dialog__footer"]},components:t})},uH=function(t,n){return[CO.sketch({dom:{tag:"div",classes:["tox-dialog__footer-start"]},components:t}),CO.sketch({dom:{tag:"div",classes:["tox-dialog__footer-end"]},components:n})]},aH=function(t){var n="tox-dialog",e=n+"-wrap",o=e+"__backdrop",r=n+"__disable-scroll";return jL.sketch({lazySink:t.lazySink,onEscape:function(n){return t.onEscape(n),G.some(!0)},useTabstopAt:function(t){return!_E(t)},firstTabstop:t.firstTabstop,dom:{tag:"div",classes:[n].concat(t.extraClasses),styles:_({position:"relative"},t.extraStyles)},components:[t.header,t.body].concat(w(t.footer.toArray())),parts:{blocker:{dom:Wb('<div class="'.concat(e,'"></div>')),components:[{dom:{tag:"div",classes:tH?[o,o+"--opaque"]:[o]}}]}},dragBlockClass:e,modalBehaviours:zu([Hh.config({}),Rh("dialog-events",t.dialogEvents.concat([ku(Ci(),function(t,n){qB.isBlocked(t)||Oh.focusIn(t)}),vu(nu(),function(t,n){t.getSystem().broadcastOn([BE],{newFocus:n.event.newFocus})})])),Rh("scroll-lock",[Ou(function(){Ku(Ln(),r)}),_u(function(){$u(Ln(),r)})])].concat(w(t.extraBehaviours))),eventOrder:_(T(T(T({},Hi(),["dialog-events"]),$i(),["scroll-lock","dialog-events","alloy.base.behaviour"]),Qi(),["alloy.base.behaviour","dialog-events","scroll-lock"]),t.eventOrder)})},cH=function(t){return Ub.sketch({dom:{tag:"button",classes:["tox-button","tox-button--icon","tox-button--naked"],attributes:{type:"button","aria-label":t.translate("Close"),"data-mce-name":"close"}},buttonBehaviours:zu([Yb.config({}),ry.config(t.tooltips.getConfig({tooltipText:t.translate("Close")}))]),components:[xx("close",{tag:"span",classes:["tox-icon"]},t.icons)],action:function(t){cu(t,RO)}})},sH=function(t,n,e,o){return{dom:{tag:"h1",classes:["tox-dialog__title"],attributes:_({},e.map(function(t){return{id:t}}).getOr({}))},components:[],behaviours:zu([BP.config({channel:"".concat(EE,"-").concat(n),initialData:t,renderComponents:function(t){return[Qc(o.translate(t.title))]}})])}},lH=function(){return{dom:Wb('<div class="tox-dialog__draghandle"></div>')}},fH=function(t,n,e){return function(t,n,e){var o=jL.parts.title(sH(t,n,G.none(),e)),r=jL.parts.draghandle(lH()),i=jL.parts.close(cH(e)),u=[o].concat(t.draggable?[r]:[]).concat([i]);return CO.sketch({dom:Wb('<div class="tox-dialog__header"></div>'),components:u})}({title:e.shared.providers.translate(t),draggable:e.dialog.isDraggableModal()},n,e.shared.providers)},dH=function(t,n,e,o){return{dom:{tag:"div",classes:["tox-dialog__busy-spinner"],attributes:{"aria-label":e.translate(t)}
2,styles:{left:"0px",right:"0px",bottom:"0px",top:"".concat(o.getOr(0),"px"),position:"absolute"}},behaviours:n,components:[{dom:Wb('<div class="tox-spinner"><div></div><div></div><div></div></div>')}]}},mH=function(t,n,e){return{onClose:function(){return e.closeWindow()},onBlock:function(e){var o=ds(t().element,".tox-dialog__header").map(function(t){return ue(t)});jL.setBusy(t(),function(t,r){return dH(e.message,r,n,o)})},onUnblock:function(){jL.setIdle(t())}}},gH="tox-dialog--fullscreen",pH="tox-dialog--width-lg",hH="tox-dialog--width-md",vH=function(t){switch(t){case"large":return G.some(pH);case"medium":return G.some(hH);default:return G.none()}},bH=function(t,n){var e=$t.fromDom(n.element.dom);Zu(e,gH)||(na(e,[pH,hH]),vH(t).each(function(t){return Ku(e,t)}))},yH=function(t,n){var e=$t.fromDom(t.element.dom),o=ea(e),r=at(o,function(t){return t===pH||t===hH}).or(vH(n));!function(t,n){et(n,function(n){Qu(t,n)})}(e,[gH].concat(w(r.toArray())))},xH=function(t,n,e){return es(aH(_(_({},t),{},{firstTabstop:1,lazySink:e.shared.getSink,extraBehaviours:[fE({})].concat(w(t.extraBehaviours)),onEscape:function(t){cu(t,RO)},dialogEvents:n,eventOrder:T(T(T({},Pi(),[BP.name(),Qs.name()]),$i(),["scroll-lock",BP.name(),"messages","dialog-events","alloy.base.behaviour"]),Qi(),["alloy.base.behaviour","dialog-events","messages",BP.name(),"scroll-lock"])})))},wH=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nt(t,function(t){return"menu"===t.type?function(t){var e=nt(t.items,function(t){var e=It(n,t.name).getOr(ho(!1));return _(_({},t),{},{storage:e})});return _(_({},t),{},{items:e})}(t):t})},SH=function(t){return ut(t,function(t,n){return"menu"===n.type?ut(n.items,function(t,n){return t[n.name]=n.storage,t},t):t},{})},CH=function(t,n){return[wu(Ci(),OE),t(FO,function(t,e,o,r){el(r.element)&&ol(An(r.element)).each(nl),n.onClose(),e.onClose()}),t(RO,function(t,n,e,o){n.onCancel(t),cu(o,FO)}),vu(PO,function(t,e){return n.onUnblock()}),vu(zO,function(t,e){return n.onBlock(e.event)})]},kH=function(t,n,e){var o=function(n,e){return vu(n,function(n,o){r(n,function(r,i){e(t(),r,o.event,n)})})},r=function(t,n){BP.getState(t).get().each(function(e){n(e.internalDialog,t)})};return[].concat(w(CH(o,n)),[o(LO,function(t,n){return n.onSubmit(t)}),o(IO,function(t,n,e){n.onChange(t,{name:e.name})}),o(NO,function(t,n,o,r){var i=function(){return r.getSystem().isConnected()?Oh.focusIn(r):void 0},u=function(t){return jn(t,"disabled")||Wn(t,"aria-disabled").exists(function(t){return"true"===t})},a=An(r.element),c=ol(a);n.onAction(t,{name:o.name,value:o.value}),ol(a).fold(i,function(t){u(t)||c.exists(function(n){return hn(t,n)&&u(n)})?i():e().toOptional().filter(function(n){return!hn(n.element,t)}).each(i)})}),o(HO,function(t,n,e){n.onTabChange(t,{newTabName:e.name,oldTabName:e.oldName})}),_u(function(n){var e=t();Xd.setValue(n,e.getData())})])},OH=function(t,n){var e=n.map(function(t){return t.footerButtons}).getOr([]),o=ot(e,function(t){return"start"===t.align}),r=function(t,n){return CO.sketch({dom:{tag:"div",classes:["tox-dialog__footer-".concat(t)]},components:nt(n,function(t){return t.memento.asSpec()})})};return[r("start",o.pass),r("end",o.fail)]},_H=function(t,n,e){return{dom:Wb('<div class="tox-dialog__footer"></div>'),components:[],behaviours:zu([BP.config({channel:"".concat(AE,"-").concat(n),initialData:t,updateState:function(t,n){var o=nt(n.buttons,function(t){var n=jb(function(t,n){return wA(t,t.type,n)}(t,e));return{name:t.name,align:t.align,memento:n}});return G.some({lookupByName:function(n){return function(t,n,e){return at(n,function(t){return t.name===e}).bind(function(n){return n.memento.getOpt(t)})}(t,o,n)},footerButtons:o})},renderComponents:OH})])}},TH=function(t,n,e){return jL.parts.footer(_H(t,n,e))},EH=function(t,n){if(t.getRoot().getSystem().isConnected()){var e=og.getCurrent(t.getFormWrapper()).getOr(t.getFormWrapper());return JT.getField(e,n).orThunk(function(){var e=t.getFooter().bind(function(t){return BP.getState(t).get()});return e.bind(function(t){return t.lookupByName(n)})})}return G.none()},DH=function(t,n,e){var o=function(n){var e=t.getRoot();e.getSystem().isConnected()&&n(e)}
2,r={getData:function(){var n=t.getRoot(),o=n.getSystem().isConnected()?t.getFormWrapper():n,r=Xd.getValue(o),i=Ot(e,function(t){return t.get()});return _(_({},r),i)},setData:function(n){o(function(o){var i=r.getData(),u=Ho(i,n),a=function(t,n){var e=t.getRoot();return BP.getState(e).get().map(function(t){return wr(xr("data",t.dataValidator,n))}).getOr(n)}(t,u),c=t.getFormWrapper();Xd.setValue(c,a),kt(e,function(t,n){Ft(u,n)&&t.set(u[n])})})},setEnabled:function(n,e){EH(t,n).each(e?vg.enable:vg.disable)},focus:function(n){EH(t,n).each(Hh.focus)},block:function(t){if(!f(t))throw new Error("The dialogInstanceAPI.block function should be passed a blocking message of type string as an argument");o(function(n){su(n,zO,{message:t})})},unblock:function(){o(function(t){cu(t,PO)})},showTab:function(n){o(function(e){var o=t.getBody();BP.getState(o).get().exists(function(t){return t.isTabPanel()})&&og.getCurrent(o).each(function(t){GP.showTab(t,n)})})},redial:function(i){o(function(o){var u=t.getId(),a=n(i),c=wH(a.internalDialog.buttons,e);o.getSystem().broadcastOn(["".concat(TE,"-").concat(u)],a),o.getSystem().broadcastOn(["".concat(EE,"-").concat(u)],a.internalDialog),o.getSystem().broadcastOn(["".concat(DE,"-").concat(u)],a.internalDialog),o.getSystem().broadcastOn(["".concat(AE,"-").concat(u)],_(_({},a.internalDialog),{},{buttons:c})),r.setData(a.initialData)})},close:function(){o(function(t){cu(t,FO)})},toggleFullscreen:t.toggleFullscreen};return r},AH=function(t,n,e){var o=mc("dialog"),r=t.internalDialog,i=fH(r.title,o,e),u=ho(r.size),a=vH(u.get()).toArray(),c=function(t,n,e,o){var r=ZP(t,n,G.none(),e,!1,o);return jL.parts.body(r)}({body:r.body,initialData:r.initialData},o,e,function(t){return EH(p,t)}),s=wH(r.buttons),l=SH(s),f=Ht(0!==s.length,TH({buttons:s},o,e)),d=kH(function(){return h},mH(function(){return g},e.shared.providers,n),e.shared.getSink),m={id:o,header:i,body:c,footer:f,extraClasses:a,extraBehaviours:[BP.config({channel:"".concat(TE,"-").concat(o),updateState:function(t,n){return u.set(n.internalDialog.size),bH(n.internalDialog.size,t),G.some(n)},initialData:t})],extraStyles:{}},g=xH(m,d,e),p={getId:N(o),getRoot:N(g),getBody:function(){return jL.getBody(g)},getFooter:function(){return jL.getFooter(g)},getFormWrapper:function(){var t=jL.getBody(g);return og.getCurrent(t).getOr(t)},toggleFullscreen:function(){yH(g,u.get())}},h=DH(p,n.redial,l);return{dialog:g,instanceApi:h}},MH=function(t,n,e){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4?arguments[4]:void 0,i=mc("dialog"),u=mc("dialog-label"),a=mc("dialog-content"),c=t.internalDialog,s=ho(c.size),l=vH(s.get()).toArray(),f=jb(function(t,n,e,o){return CO.sketch({dom:Wb('<div class="tox-dialog__header"></div>'),components:[sH(t,n,G.some(e),o),lH(),cH(o)],containerBehaviours:zu([EL.config({mode:"mouse",blockerClass:"blocker",getTarget:function(t){return ms(t,'[role="dialog"]').getOrDie()},snaps:{getSnapPoints:function(){return[]},leftAttr:"data-drag-left",topAttr:"data-drag-top"}})])})}({title:c.title,draggable:!0},i,u,e.shared.providers)),d=jb(function(t,n,e,o,r,i){return ZP(t,n,G.some(e),o,r,i)}({body:c.body,initialData:c.initialData},i,a,e,o,function(t){return EH(y,t)})),m=wH(c.buttons),g=SH(m),p=Ht(0!==m.length,jb(function(t,n,e){return _H(t,n,e)}({buttons:m},i,e))),h=kH(function(){return x},{onBlock:function(t){qB.block(b,function(n,o){var r=f.getOpt(b).map(function(t){return ue(t.element)});return dH(t.message,o,e.shared.providers,r)})},onUnblock:function(){qB.unblock(b)},onClose:function(){return n.closeWindow()}},e.shared.getSink),v=Ge().os,b=es({dom:{tag:"div",classes:["tox-dialog","tox-dialog-inline"].concat(w(l)),attributes:_({role:"dialog"},v.isMacOS()?{"aria-label":c.title}:{"aria-labelledby":u})},eventOrder:T(T(T({},Pi(),[BP.name(),Qs.name()]),Hi(),["execute-on-form"]),$i(),["reflecting","execute-on-form"]),behaviours:zu([Oh.config({mode:"cyclic",onEscape:function(t){return cu(t,FO),G.some(!0)},useTabstopAt:function(t){return!_E(t)&&("button"!==on(t)||"disabled"!==Un(t,"disabled"))},firstTabstop:1}),BP.config({channel:"".concat(TE,"-").concat(i),updateState:function(t,n){return s.set(n.internalDialog.size),bH(n.internalDialog.size,t),r(),G.some(n)},initialData:t}),Hh.config({}),Rh("execute-on-form",h.concat([ku(Ci(),function(t,n){Oh.focusIn(t)}),vu(nu(),function(t,n){t.getSystem().broadcastOn([BE],{newFocus:n.event.newFocus})})])),qB.config({getRoot:function(){return G.some(b)}}),Fh.config({}),fE({})]),components:[f.asSpec(),d.asSpec()].concat(w(p.map(function(t){return t.asSpec()}).toArray()))}),y={getId:N(i),getRoot:N(b),getFooter:function(){return p.map(function(t){return t.get(b)})},getBody:function(){return d.get(b)},getFormWrapper:function(){var t=d.get(b);return og.getCurrent(t).getOr(t)},toggleFullscreen:function(){yH(b,s.get())}},x=DH(y,n.redial,g);return{dialog:b,instanceApi:x}},BH=tinymce.util.Tools.resolve("tinymce.util.URI"),IH=["insertContent","setContent","execCommand","close","block","unblock"],FH=function(t){return d(t)&&-1!==IH.indexOf(t.mceAction)}
2,RH=function(t,n,e,o){var r,i,u,a,c,s,l=mc("dialog"),m=fH(t.title,l,o),g=function(t){var n={dom:{tag:"div",classes:["tox-dialog__content-js"]},components:[{dom:{tag:"div",classes:["tox-dialog__body-iframe"]},components:[CE(G.none(),{dom:{tag:"iframe",attributes:{src:t.url}},behaviours:zu([Yb.config({}),Hh.config({})])})]}],behaviours:zu([Oh.config({mode:"acyclic",useTabstopAt:H(_E)})])};return jL.parts.body(n)}(t),p=t.buttons.bind(function(t){return 0===t.length?G.none():G.some(TH({buttons:t},l,o))}),h=(r=function(){return D},i=mH(function(){return E},o.shared.providers,n),u=function(t,n){return vu(t,function(t,e){a(t,function(o,i){n(r(),o,e.event,t)})})},a=function(t,n){BP.getState(t).get().each(function(e){n(e,t)})},[].concat(w(CH(u,i)),[u(NO,function(t,n,e){n.onAction(t,{name:e.name})})])),v=_(_({},t.height.fold(function(){return{}},function(t){return{height:t+"px","max-height":t+"px"}})),t.width.fold(function(){return{}},function(t){return{width:t+"px","max-width":t+"px"}})),b=t.width.isNone()&&t.height.isNone()?["tox-dialog--width-lg"]:[],x=new BH(t.url,{base_uri:new BH(window.location.href)}),S="".concat(x.protocol,"://").concat(x.host).concat(x.port?":"+x.port:""),C=bo(),k=[BP.config({channel:"".concat(TE,"-").concat(l),updateState:function(t,n){return G.some(n)},initialData:t}),Rh("messages",[Ou(function(){var n=wl($t.fromDom(window),"message",function(n){if(x.isSameOrigin(new BH(n.raw.origin))){var o=n.raw.data;FH(o)?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=!!y(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()}}(e,D,o):function(t){return!FH(t)&&d(t)&&Ft(t,"mceAction")}(o)&&t.onMessage(D,o)}});C.set(n)}),_u(C.clear)]),Qs.config({channels:T({},ME,{onReceive:function(t,n){ds(t.element,"iframe").each(function(t){var e=t.dom.contentWindow;O(e)&&e.postMessage(n,S)})}})})],E=xH({id:l,header:m,body:g,footer:p,extraClasses:b,extraBehaviours:k,extraStyles:v},h,o),D=(c=E,s=function(t){c.getSystem().isConnected()&&t(c)},{block:function(t){if(!f(t))throw new Error("The urlDialogInstanceAPI.block function should be passed a blocking message of type string as an argument");s(function(n){su(n,zO,{message:t})})},unblock:function(){s(function(t){cu(t,PO)})},close:function(){s(function(t){cu(t,FO)})},sendMessage:function(t){s(function(n){n.getSystem().broadcastOn([ME],t)})}});return{dialog:E,instanceApi:D}},NH=function(t,n){return wr(xr("data",n,t))},LH=function(t){return lO(t,".tox-alert-dialog")||lO(t,".tox-confirm-dialog")},zH=function(t,n,e){return n&&e?[]:[ac.config({contextual:{lazyContext:function(){return G.some(fo($t.fromDom(t.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top"],lazyViewport:function(n){return Hb(t,n.element).map(function(t){return{bounds:Vb(t),optScrollEnv:G.some({currentScrollTop:t.element.dom.scrollTop,scrollElmTop:fe(t.element).top})}}).getOrThunk(function(){return{bounds:po(),optScrollEnv:G.none()}})}})]},PH=function(t){var n,e,o=t.editor,r=Bb(o),i=(n=t.backstages.dialog,e=n.shared,{open:function(t,o){var r=function(){jL.hide(c),o()},i=jb(wA({context:"any",name:"close-alert",text:"OK",primary:!0,buttonType:G.some("primary"),align:"end",enabled:!0,icon:G.none()},"cancel",n)),u=oH(),a=eH(r,e.providers),c=es(aH({lazySink:function(){return e.getSink()},header:nH(u,a),body:rH(t,e.providers),footer:G.some(iH(uH([],[i.asSpec()]))),onEscape:r,extraClasses:["tox-alert-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[vu(RO,r)],eventOrder:{}}));jL.show(c);var s=i.get(c);Hh.focus(s)}}),u=function(t){var n=t.shared;return{open:function(e,o){var r=function(t){jL.hide(s),o(t)},i=jb(wA({context:"any",name:"yes",text:"Yes",primary:!0,buttonType:G.some("primary"),align:"end",enabled:!0,icon:G.none()},"submit",t)),u=wA({context:"any",name:"no",text:"No",primary:!1,buttonType:G.some("secondary"),align:"end",enabled:!0,icon:G.none()},"cancel",t),a=oH(),c=eH(function(){return r(!1)},n.providers),s=es(aH({lazySink:function(){return n.getSink()},header:nH(a,c),body:rH(e,n.providers),footer:G.some(iH(uH([],[u,i.asSpec()]))),onEscape:function(){return r(!1)}
2,extraClasses:["tox-confirm-dialog"],extraBehaviours:[],extraStyles:{},dialogEvents:[vu(RO,function(){return r(!1)}),vu(LO,function(){return r(!0)})],eventOrder:{}}));jL.show(s);var l=i.get(s);Hh.focus(l)}}}(t.backstages.dialog),a=function(n,e){return EP.openUrl(function(n){var r=RH(n,{closeWindow:function(){jL.hide(r.dialog),e(r.instanceApi)}},o,t.backstages.dialog);return jL.show(r.dialog),r.instanceApi},n)},c=function(n,e){return EP.open(function(n,o,r){var i=o,u=AH({dataValidator:r,initialData:i,internalDialog:n},{redial:EP.redial,closeWindow:function(){jL.hide(u.dialog),e(u.instanceApi)}},t.backstages.dialog);return jL.show(u.dialog),u.instanceApi.setData(i),u.instanceApi},n)},s=function(n,e,i,u){return EP.open(function(n,a,c){var s=NH(a,c),l=yo(),f=t.backstages.popup.shared.header.isPositionedAtTop(),d=function(){return l.on(function(t){Tv.reposition(t),r&&f||ac.refresh(t)})},m=MH({dataValidator:c,initialData:s,internalDialog:n},{redial:EP.redial,closeWindow:function(){l.on(Tv.hide),o.off("ResizeEditor",d),l.clear(),i(m.instanceApi)}},t.backstages.popup,u.ariaAttrs,d),g=es(Tv.sketch(_(_({lazySink:t.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:u.persistent?{event:"doNotDismissYet"}:{}},f?{}:{fireRepositionEventInstead:{}}),{},{inlineBehaviours:zu([Rh("window-manager-inline-events",[vu(Zi(),function(t,n){cu(m.dialog,RO)})])].concat(w(zH(o,r,f)))),isExtraPart:function(t,n){return LH(n)}})));l.set(g);return Tv.showWithinBounds(g,os(m.dialog),{anchor:e},function(){var t=o.inline?Ln():$t.fromDom(o.getContainer()),n=fo(t);return G.some(n)}),r&&f||(ac.refresh(g),o.on("ResizeEditor",d)),m.instanceApi.setData(s),Oh.focusIn(m.dialog),m.instanceApi},n)},l=function(n,e,r,i){return EP.open(function(n,u,a){var c=NH(u,a),s=yo(),l=t.backstages.popup.shared.header.isPositionedAtTop(),f=function(){return s.on(function(t){Tv.reposition(t),ac.refresh(t)})},d=MH({dataValidator:a,initialData:c,internalDialog:n},{redial:EP.redial,closeWindow:function(){s.on(Tv.hide),o.off("ResizeEditor ScrollWindow ElementScroll",f),s.clear(),r(d.instanceApi)}},t.backstages.popup,i.ariaAttrs,f),m=es(Tv.sketch(_(_({lazySink:t.backstages.popup.shared.getSink,dom:{tag:"div",classes:[]},fireDismissalEventInstead:i.persistent?{event:"doNotDismissYet"}:{}},l?{}:{fireRepositionEventInstead:{}}),{},{inlineBehaviours:zu([Rh("window-manager-inline-events",[vu(Zi(),function(t,n){cu(d.dialog,RO)})]),ac.config({contextual:{lazyContext:function(){return G.some(fo($t.fromDom(o.getContentAreaContainer())))},fadeInClass:"tox-dialog-dock-fadein",fadeOutClass:"tox-dialog-dock-fadeout",transitionClass:"tox-dialog-dock-transition"},modes:["top","bottom"],lazyViewport:function(t){return Hb(o,t.element).map(function(t){return{bounds:Vb(t),optScrollEnv:G.some({currentScrollTop:t.element.dom.scrollTop,scrollElmTop:fe(t.element).top})}}).getOrThunk(function(){return{bounds:po(),optScrollEnv:G.none()}})}})]),isExtraPart:function(t,n){return LH(n)}})));s.set(m);return Tv.showWithinBounds(m,os(d.dialog),{anchor:e},function(){return t.backstages.popup.shared.getSink().toOptional().bind(function(t){var n=Hb(o,t.element).map(function(t){return Vb(t)}).getOr(po()),e=fo($t.fromDom(o.getContentAreaContainer())),r=go(e,n);return G.some(lo(r.x,r.y,r.width,r.height-15))})}),ac.refresh(m),o.on("ResizeEditor ScrollWindow ElementScroll ResizeWindow",f),d.instanceApi.setData(c),Oh.focusIn(d.dialog),d.instanceApi},n)};return{open:function(n,e,o){if(!C(e)){if("toolbar"===e.inline)return s(n,t.backstages.popup.shared.anchors.inlineDialog(),o,e);if("bottom"===e.inline)return l(n,t.backstages.popup.shared.anchors.inlineBottomDialog(),o,e);if("cursor"===e.inline)return s(n,t.backstages.popup.shared.anchors.cursor(),o,e)}return c(n,o)},openUrl:function(t,n){return a(t,n)},alert:function(t,n){i.open(t,n)},close:function(t){t.close()},confirm:function(t,n){u.open(t,n)}}},HH=function(t){Fv(t),function(t){var n=t.options.register,e=function(t){return B(t,f)?{value:(n=t,HC(n.map(function(t,n){return n%2==0?"#"+LC(t).value:t}))),valid:!0}
2:{valid:!1,message:"Must be an array of strings."};var n},o=function(t){return M(t)&&t>0?{value:t,valid:!0}:{valid:!1,message:"Must be a positive number."}};n("color_map",{processor:e,default:["#BFEDD2","Light Green","#FBEEB8","Light Yellow","#F8CAC6","Light Red","#ECCAFA","Light Purple","#C2E0F4","Light Blue","#2DC26B","Green","#F1C40F","Yellow","#E03E2D","Red","#B96AD9","Purple","#3598DB","Blue","#169179","Dark Turquoise","#E67E23","Orange","#BA372A","Dark Red","#843FA1","Dark Purple","#236FA1","Dark Blue","#ECF0F1","Light Gray","#CED4D9","Medium Gray","#95A5A6","Gray","#7E8C8D","Dark Gray","#34495E","Navy Blue","#000000","Black","#ffffff","White"]}),n("color_map_raw",{processor:function(t){return B(t,f)?{value:HC(t),valid:!0}:{valid:!1,message:"Must be an array of strings."}}}),n("color_map_background",{processor:e}),n("color_map_foreground",{processor:e}),n("color_cols",{processor:o,default:jC(t)}),n("color_cols_foreground",{processor:o,default:GC(t,zC)}),n("color_cols_background",{processor:o,default:GC(t,PC)}),n("custom_colors",{processor:"boolean",default:!0}),n("color_default_foreground",{processor:"string",default:UC}),n("color_default_background",{processor:"string",default:UC})}(t),function(t){var n=t.options.register;n("contextmenu_avoid_overlap",{processor:"string",default:""}),n("contextmenu_never_use_native",{processor:"boolean",default:!1}),n("contextmenu",{processor:function(t){return!1===t?{value:[],valid:!0}:f(t)||B(t,f)?{value:vN(t),valid:!0}:{valid:!1,message:"Must be false or a string."}},default:"link linkchecker image editimage table spellchecker configurepermanentpen"})}(t)};xo.add("silver",function(t){HH(t);var n=function(){return po()},e=HL(t,{getPopupSinkBounds:function(){return n()}}),o=e.dialogs,r=e.popups,i=e.renderUI;sO(t,r.backstage.shared);var u=PH({editor:t,backstages:{popup:r.backstage,dialog:o.backstage}}),a=yo();return{renderUI:function(){var e=i();return Hb(t,r.getMothership().element).each(function(t){n=function(){return Vb(t)}}),e},getWindowManagerImpl:N(u),getNotificationManagerImpl:function(){return Cx(t,{backstage:r.backstage},r.getMothership(),a)}}})}()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.